summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMBaseInstrInfo.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-11-17 20:13:28 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-11-17 20:13:28 +0000
commit7f8ab6ee8bd9a6a039cbd6e8683dd041b2f723d5 (patch)
tree8d10f06dd1700f71a2a015947b8c847bc6af59e7 /llvm/lib/Target/ARM/ARMBaseInstrInfo.h
parent7a2cd8b5401ef57af7bd5164c4305961708fe264 (diff)
downloadbcm5719-llvm-7f8ab6ee8bd9a6a039cbd6e8683dd041b2f723d5.tar.gz
bcm5719-llvm-7f8ab6ee8bd9a6a039cbd6e8683dd041b2f723d5.zip
Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,
and xor. The 32-bit move immediates can be hoisted out of loops by machine LICM but the isel hacks were preventing them. Instead, let peephole optimization pass recognize registers that are defined by immediates and the ARM target hook will fold the immediates in. Other changes include 1) do not fold and / xor into cmp to isel TST / TEQ instructions if there are multiple uses. This happens when the 'and' is live out, machine sink would have sinked the computation and that ends up pessimizing code. The peephole pass would recognize situations where the 'and' can be toggled to define CPSR and eliminate the comparison anyway. 2) Move peephole pass to after machine LICM, sink, and CSE to avoid blocking important optimizations. rdar://8663787, rdar://8241368 llvm-svn: 119548
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseInstrInfo.h')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseInstrInfo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.h b/llvm/lib/Target/ARM/ARMBaseInstrInfo.h
index c929fce9e7b..cbcc428b712 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.h
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.h
@@ -346,6 +346,11 @@ public:
int CmpMask, int CmpValue,
const MachineRegisterInfo *MRI) const;
+ /// FoldImmediate - 'Reg' is known to be defined by a move immediate
+ /// instruction, try to fold the immediate into the use instruction.
+ virtual bool FoldImmediate(MachineInstr *UseMI, MachineInstr *DefMI,
+ unsigned Reg, MachineRegisterInfo *MRI) const;
+
virtual unsigned getNumMicroOps(const InstrItineraryData *ItinData,
const MachineInstr *MI) const;
OpenPOWER on IntegriCloud