From e81fdb99014d07ac595742a05a4590194d16c064 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 6 Dec 2007 00:01:56 +0000 Subject: 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 --- include/llvm/CodeGen/LiveIntervalAnalysis.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/llvm/CodeGen/LiveIntervalAnalysis.h') 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 -- cgit v1.1