summaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMBaseInstrInfo.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-06-23 23:00:16 +0000
committerBill Wendling <isanbard@gmail.com>2010-06-23 23:00:16 +0000
commit4b722108e2cf8e77157e0879a23789cd44829933 (patch)
treeba80a80ba5136b9294fdf239c0cf081a4dad27ff /lib/Target/ARM/ARMBaseInstrInfo.h
parent8ff72b534436a1f4f221ddb21cf0d22c5b09769c (diff)
downloadexternal_llvm-4b722108e2cf8e77157e0879a23789cd44829933.zip
external_llvm-4b722108e2cf8e77157e0879a23789cd44829933.tar.gz
external_llvm-4b722108e2cf8e77157e0879a23789cd44829933.tar.bz2
We are missing opportunites to use ldm. Take code like this:
void t(int *cp0, int *cp1, int *dp, int fmd) { int c0, c1, d0, d1, d2, d3; c0 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); c1 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); /* ... */ } It code gens into something pretty bad. But with this change (analogous to the X86 back-end), it will use ldm and generate few instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMBaseInstrInfo.h')
-rw-r--r--lib/Target/ARM/ARMBaseInstrInfo.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMBaseInstrInfo.h b/lib/Target/ARM/ARMBaseInstrInfo.h
index bc82e14..d7d9f52 100644
--- a/lib/Target/ARM/ARMBaseInstrInfo.h
+++ b/lib/Target/ARM/ARMBaseInstrInfo.h
@@ -320,6 +320,26 @@ public:
virtual bool produceSameValue(const MachineInstr *MI0,
const MachineInstr *MI1) const;
+ /// areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler to
+ /// determine if two loads are loading from the same base address. It should
+ /// only return true if the base pointers are the same and the only
+ /// differences between the two addresses is the offset. It also returns the
+ /// offsets by reference.
+ virtual bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2,
+ int64_t &Offset1, int64_t &Offset2)const;
+
+ /// shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to
+ /// determine (in conjuction with areLoadsFromSameBasePtr) if two loads should
+ /// be scheduled togther. On some targets if two loads are loading from
+ /// addresses in the same cache line, it's better if they are scheduled
+ /// together. This function takes two integers that represent the load offsets
+ /// from the common base address. It returns true if it decides it's desirable
+ /// to schedule the two loads together. "NumLoads" is the number of loads that
+ /// have already been scheduled after Load1.
+ virtual bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2,
+ int64_t Offset1, int64_t Offset2,
+ unsigned NumLoads) const;
+
virtual bool isSchedulingBoundary(const MachineInstr *MI,
const MachineBasicBlock *MBB,
const MachineFunction &MF) const;