aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/LiveIntervalAnalysis.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-12-06 00:01:56 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-12-06 00:01:56 +0000
commite81fdb99014d07ac595742a05a4590194d16c064 (patch)
tree6b72163b7ae2b198f8295130ebab1761ada9d43b /include/llvm/CodeGen/LiveIntervalAnalysis.h
parent3be74352745863deaf2e287d69701a79ab369aa6 (diff)
downloadexternal_llvm-e81fdb99014d07ac595742a05a4590194d16c064.zip
external_llvm-e81fdb99014d07ac595742a05a4590194d16c064.tar.gz
external_llvm-e81fdb99014d07ac595742a05a4590194d16c064.tar.bz2
Fix for PR1831: if all defs of an interval are re-materializable, then it's a preferred spill candiate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveIntervalAnalysis.h')
-rw-r--r--include/llvm/CodeGen/LiveIntervalAnalysis.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h
index 19865e5..83d8d1d 100644
--- a/include/llvm/CodeGen/LiveIntervalAnalysis.h
+++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h
@@ -233,6 +233,11 @@ namespace llvm {
addIntervalsForSpills(const LiveInterval& i,
const LoopInfo *loopInfo, VirtRegMap& vrm);
+ /// isReMaterializable - Returns true if every definition of MI of every
+ /// val# of the specified interval is re-materializable. Also returns true
+ /// by reference if all of the defs are load instructions.
+ bool isReMaterializable(const LiveInterval &li, bool &isLoad);
+
private:
/// computeIntervals - Compute live intervals.
void computeIntervals();
@@ -265,9 +270,10 @@ namespace llvm {
LiveInterval &interval, bool isAlias = false);
/// isReMaterializable - Returns true if the definition MI of the specified
- /// val# of the specified interval is re-materializable.
+ /// val# of the specified interval is re-materializable. Also returns true
+ /// by reference if the def is a load.
bool isReMaterializable(const LiveInterval &li, const VNInfo *ValNo,
- MachineInstr *MI);
+ MachineInstr *MI, bool &isLoad);
/// tryFoldMemoryOperand - Attempts to fold either a spill / restore from
/// slot / to reg or any rematerialized load into ith operand of specified