From 1ab4b211ea5165445b791277507d58dcf1e46688 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Thu, 2 Dec 2010 16:42:25 +0000 Subject: [PATCH] When expanding the MOVCCi32imm, make sure to use the ARM movt/movw opcodes, not thumb2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120711 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMExpandPseudoInsts.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Target/ARM/ARMExpandPseudoInsts.cpp b/lib/Target/ARM/ARMExpandPseudoInsts.cpp index 1cc5bd60b92..1c02c34e826 100644 --- a/lib/Target/ARM/ARMExpandPseudoInsts.cpp +++ b/lib/Target/ARM/ARMExpandPseudoInsts.cpp @@ -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);