When expanding the MOVCCi32imm, make sure to use the ARM movt/movw opcodes,
authorJim Grosbach <grosbach@apple.com>
Thu, 2 Dec 2010 16:42:25 +0000 (16:42 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 2 Dec 2010 16:42:25 +0000 (16:42 +0000)
not thumb2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120711 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMExpandPseudoInsts.cpp

index 1cc5bd60b920da488f9f340109beaeee8df6d208..1c02c34e82666d7b814be0350ad0eea66d1517df 100644 (file)
@@ -755,13 +755,14 @@ bool ARMExpandPseudo::ExpandMBB(MachineBasicBlock &MBB) {
         break;
       }
 
+      bool isThumb =
+        (Opcode == ARM::t2MOVi32imm || Opcode == ARM::t2MOVCCi32imm);
+
       LO16 = BuildMI(MBB, MBBI, MI.getDebugLoc(),
-                     TII->get(Opcode == ARM::MOVi32imm ?
-                              ARM::MOVi16 : ARM::t2MOVi16),
+                     TII->get(isThumb ? ARM::t2MOVi16 : ARM::MOVi16),
                      DstReg);
       HI16 = BuildMI(MBB, MBBI, MI.getDebugLoc(),
-                     TII->get(Opcode == ARM::MOVi32imm ?
-                              ARM::MOVTi16 : ARM::t2MOVTi16))
+                     TII->get(isThumb ? ARM::t2MOVTi16 : ARM::MOVTi16))
         .addReg(DstReg, RegState::Define | getDeadRegState(DstIsDead))
         .addReg(DstReg);