[llvm-commits] [llvm] r112793 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Eric Christopher
echristo at apple.com
Wed Sep 1 18:39:14 PDT 2010
Author: echristo
Date: Wed Sep 1 20:39:14 2010
New Revision: 112793
URL: http://llvm.org/viewvc/llvm-project?rev=112793&view=rev
Log:
One definition of isThumb is plenty, thanks.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=112793&r1=112792&r2=112793&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Wed Sep 1 20:39:14 2010
@@ -59,6 +59,9 @@
const TargetLowering &TLI;
const ARMFunctionInfo *AFI;
+ // Convenience variable to avoid checking all the time.
+ bool isThumb;
+
public:
explicit ARMFastISel(FunctionLoweringInfo &funcInfo)
: FastISel(funcInfo),
@@ -67,6 +70,7 @@
TLI(*TM.getTargetLowering()) {
Subtarget = &TM.getSubtarget<ARMSubtarget>();
AFI = funcInfo.MF->getInfo<ARMFunctionInfo>();
+ isThumb = AFI->isThumbFunction();
}
// Code from FastISel.cpp.
@@ -395,7 +399,7 @@
ARMCC::CondCodes Pred = ARMCC::AL;
unsigned PredReg = 0;
- if (!AFI->isThumbFunction())
+ if (!isThumb)
emitARMRegPlusImmediate(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
Reg, Reg, Offset, Pred, PredReg,
static_cast<const ARMBaseInstrInfo&>(TII));
@@ -435,8 +439,6 @@
unsigned Reg, int Offset) {
assert(VT.isSimple() && "Non-simple types are invalid here!");
-
- bool isThumb = AFI->isThumbFunction();
unsigned Opc;
switch (VT.getSimpleVT().SimpleTy) {
@@ -475,7 +477,6 @@
bool ARMFastISel::ARMMaterializeConstant(const ConstantInt *CI, unsigned &Reg) {
unsigned Opc;
bool Signed = true;
- bool isThumb = AFI->isThumbFunction();
EVT VT = TLI.getValueType(CI->getType(), true);
switch (VT.getSimpleVT().SimpleTy) {
@@ -518,8 +519,6 @@
bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg,
unsigned DstReg, int Offset) {
- bool isThumb = AFI->isThumbFunction();
-
unsigned StrOpc;
switch (VT.getSimpleVT().SimpleTy) {
default: return false;
@@ -615,7 +614,7 @@
bool ARMFastISel::TargetSelectInstruction(const Instruction *I) {
// No Thumb-1 for now.
- if (AFI->isThumbFunction() && !AFI->isThumb2Function()) return false;
+ if (isThumb && !AFI->isThumb2Function()) return false;
switch (I->getOpcode()) {
case Instruction::Load:
More information about the llvm-commits
mailing list