diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-22 17:31:01 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-22 17:31:01 +0000 |
commit | 7809578cfe0a5cd1e451a33b21c20792e645aaa4 (patch) | |
tree | 6b30b828057b8ed4a14c531411e9daeb933e9f7b /llvm | |
parent | 25fe3191b3aa7d810d42b07ac56037dd0be752f6 (diff) | |
download | bcm5719-llvm-7809578cfe0a5cd1e451a33b21c20792e645aaa4.tar.gz bcm5719-llvm-7809578cfe0a5cd1e451a33b21c20792e645aaa4.zip |
Use MRI::isConstantPhysReg() to check remat feasibility.
Don't depend on LiveIntervals::hasInterval() to determine if a physreg
is reserved and constant.
llvm-svn: 159013
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/LiveRangeEdit.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp index 434388b94ef..261d860e015 100644 --- a/llvm/lib/CodeGen/LiveRangeEdit.cpp +++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp @@ -82,12 +82,16 @@ bool LiveRangeEdit::allUsesAvailableAt(const MachineInstr *OrigMI, UseIdx = UseIdx.getRegSlot(true); for (unsigned i = 0, e = OrigMI->getNumOperands(); i != e; ++i) { const MachineOperand &MO = OrigMI->getOperand(i); - if (!MO.isReg() || !MO.getReg() || MO.isDef()) - continue; - // Reserved registers are OK. - if (MO.isUndef() || !LIS.hasInterval(MO.getReg())) + if (!MO.isReg() || !MO.getReg() || !MO.readsReg()) continue; + // We can't remat physreg uses, unless it is a constant. + if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) { + if (MRI.isConstantPhysReg(MO.getReg(), VRM->getMachineFunction())) + continue; + return false; + } + LiveInterval &li = LIS.getInterval(MO.getReg()); const VNInfo *OVNI = li.getVNInfoAt(OrigIdx); if (!OVNI) |