Index: lib/Target/ARM/ARMConstantIslandPass.cpp =================================================================== --- lib/Target/ARM/ARMConstantIslandPass.cpp +++ lib/Target/ARM/ARMConstantIslandPass.cpp @@ -1351,6 +1351,15 @@ if (CC != ARMCC::AL) MI = LastIT; } + + // Windows requires that the mov.w/mov.t relocation of an address be + // contiguous, so make sure that the pair is kept at the same side of the + // island. + if (STI->isTargetWindows()) + if (MI->getOpcode() == ARM::t2MOVTi16 && MI->getOperand(0).isTied()) + while (MI->getOperand(0).isTied()) + --MI; + NewMBB = splitBlockBeforeInstr(MI); }