aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-04-01 21:37:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-04-01 21:37:32 +0000
commit985a0b51d76c06b42f14353993da42525467a989 (patch)
tree752a799b82700fef6994acfcc66131070d083bf6 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parentce4f31d3ce8a7a5df380a917647d1bbf9a48c9f8 (diff)
downloadllvm-985a0b51d76c06b42f14353993da42525467a989.zip
llvm-985a0b51d76c06b42f14353993da42525467a989.tar.gz
llvm-985a0b51d76c06b42f14353993da42525467a989.tar.bz2
Re-materialization is for uses only.
llvm-svn: 49053
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index f29b61b..bab6a29 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -794,7 +794,7 @@ bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI,
/// folding is possible.
bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
SmallVector<unsigned, 2> &Ops,
- bool ReMatLoad) const {
+ bool ReMat) const {
// Filter the list of operand indexes that are to be folded. Abort if
// any operand will prevent folding.
unsigned MRInfo = 0;
@@ -802,8 +802,8 @@ bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
if (FilterFoldedOps(MI, Ops, MRInfo, FoldOps))
return false;
- // Can't fold a remat'ed load into a two address instruction.
- if (ReMatLoad && (MRInfo & VirtRegMap::isMod))
+ // It's only legal to remat for a use, not a def.
+ if (ReMat && (MRInfo & VirtRegMap::isMod))
return false;
return tii_->canFoldMemoryOperand(MI, FoldOps);
@@ -947,7 +947,7 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
goto RestartInstruction;
}
} else {
- CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat && isLoad);
+ CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat);
}
} else
CanFold = false;