[llvm-commits] [llvm] r107086 - /llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
Bob Wilson
bob.wilson at apple.com
Mon Jun 28 15:23:17 PDT 2010
Author: bwilson
Date: Mon Jun 28 17:23:17 2010
New Revision: 107086
URL: http://llvm.org/viewvc/llvm-project?rev=107086&view=rev
Log:
Make the ARMCodeEmitter identify Thumb functions via ARMFunctionInfo instead
of the Subtarget.
Modified:
llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=107086&r1=107085&r2=107086&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Jun 28 17:23:17 2010
@@ -55,6 +55,7 @@
const std::vector<MachineConstantPoolEntry> *MCPEs;
const std::vector<MachineJumpTableEntry> *MJTEs;
bool IsPIC;
+ bool IsThumb;
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<MachineModuleInfo>();
@@ -67,8 +68,8 @@
: MachineFunctionPass(&ID), JTI(0),
II((const ARMInstrInfo *)tm.getInstrInfo()),
TD(tm.getTargetData()), TM(tm),
- MCE(mce), MCPEs(0), MJTEs(0),
- IsPIC(TM.getRelocationModel() == Reloc::PIC_) {}
+ MCE(mce), MCPEs(0), MJTEs(0),
+ IsPIC(TM.getRelocationModel() == Reloc::PIC_), IsThumb(false) {}
/// getBinaryCodeForInstr - This function, generated by the
/// CodeEmitterGenerator using TableGen, produces the binary encoding for
@@ -199,6 +200,7 @@
MJTEs = 0;
if (MF.getJumpTableInfo()) MJTEs = &MF.getJumpTableInfo()->getJumpTables();
IsPIC = TM.getRelocationModel() == Reloc::PIC_;
+ IsThumb = MF.getInfo<ARMFunctionInfo>()->isThumbFunction();
JTI->Initialize(MF, IsPIC);
MMI = &getAnalysis<MachineModuleInfo>();
MCE.setModuleInfo(MMI);
@@ -1635,7 +1637,7 @@
unsigned Imm3 = (Imm >> 4) & 0x7;
unsigned Imm4 = Imm & 0xf;
Binary |= (I << 24) | (Imm3 << 16) | (Cmode << 8) | (Op << 5) | Imm4;
- if (Subtarget->isThumb())
+ if (IsThumb)
Binary = convertNEONDataProcToThumb(Binary);
emitWordLE(Binary);
}
@@ -1649,7 +1651,7 @@
if (TID.getOperandConstraint(OpIdx, TOI::TIED_TO) != -1)
++OpIdx;
Binary |= encodeNEONRm(MI, OpIdx);
- if (Subtarget->isThumb())
+ if (IsThumb)
Binary = convertNEONDataProcToThumb(Binary);
// FIXME: This does not handle VDUPfdf or VDUPfqf.
emitWordLE(Binary);
@@ -1667,7 +1669,7 @@
if (TID.getOperandConstraint(OpIdx, TOI::TIED_TO) != -1)
++OpIdx;
Binary |= encodeNEONRm(MI, OpIdx);
- if (Subtarget->isThumb())
+ if (IsThumb)
Binary = convertNEONDataProcToThumb(Binary);
// FIXME: This does not handle VMOVDneon or VMOVQ.
emitWordLE(Binary);
More information about the llvm-commits
mailing list