[llvm] r190417 - ARM: Use the PICADD opcode calculated.
Jim Grosbach
grosbach at apple.com
Tue Sep 10 10:21:39 PDT 2013
Author: grosbach
Date: Tue Sep 10 12:21:39 2013
New Revision: 190417
URL: http://llvm.org/viewvc/llvm-project?rev=190417&view=rev
Log:
ARM: Use the PICADD opcode calculated.
We were figuring out whether to use tPICADD or PICADD, then just using
tPICADD unconditionally anyway. Oops.
A testcase from someone familiar enough with ELF to produce one would
be appreciated. The existing PIC testcase correctly verifies the .s
generated, but that doesn't catch this bug, which only showed up in
direct-to-object mode.
http://llvm.org/bugs/show_bug.cgi?id=17180
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp?rev=190417&r1=190416&r2=190417&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Tue Sep 10 12:21:39 2013
@@ -136,8 +136,12 @@ namespace {
unsigned GlobalBaseReg = AFI->getGlobalBaseReg();
Opc = TM->getSubtarget<ARMSubtarget>().isThumb2() ? ARM::tPICADD
: ARM::PICADD;
- BuildMI(FirstMBB, MBBI, DL, TII.get(ARM::tPICADD), GlobalBaseReg)
- .addReg(TempReg).addImm(ARMPCLabelIndex);
+ MIB = BuildMI(FirstMBB, MBBI, DL, TII.get(Opc), GlobalBaseReg)
+ .addReg(TempReg)
+ .addImm(ARMPCLabelIndex);
+ if (Opc == ARM::PICADD)
+ AddDefaultPred(MIB);
+
return true;
}
More information about the llvm-commits
mailing list