[llvm-commits] [llvm] r123031 - in /llvm/trunk: include/llvm/Target/Target.td lib/CodeGen/MachineInstr.cpp lib/CodeGen/PeepholeOptimizer.cpp lib/CodeGen/VirtRegRewriter.cpp
Evan Cheng
evan.cheng at apple.com
Fri Jan 7 13:08:26 PST 2011
Author: evancheng
Date: Fri Jan 7 15:08:26 2011
New Revision: 123031
URL: http://llvm.org/viewvc/llvm-project?rev=123031&view=rev
Log:
DBG_VALUE does not have any side effects; it also makes no sense to mark it cheap as a copy.
Modified:
llvm/trunk/include/llvm/Target/Target.td
llvm/trunk/lib/CodeGen/MachineInstr.cpp
llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
Modified: llvm/trunk/include/llvm/Target/Target.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=123031&r1=123030&r2=123031&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/Target.td (original)
+++ llvm/trunk/include/llvm/Target/Target.td Fri Jan 7 15:08:26 2011
@@ -484,7 +484,7 @@
let OutOperandList = (outs);
let InOperandList = (ins variable_ops);
let AsmString = "DBG_VALUE";
- let isAsCheapAsAMove = 1;
+ let neverHasSideEffects = 1;
}
def REG_SEQUENCE : Instruction {
let OutOperandList = (outs unknown:$dst);
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=123031&r1=123030&r2=123031&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Fri Jan 7 15:08:26 2011
@@ -1115,7 +1115,9 @@
SawStore = true;
return false;
}
- if (TID->isTerminator() || TID->hasUnmodeledSideEffects())
+
+ if (isLabel() || isDebugValue() ||
+ TID->isTerminator() || TID->hasUnmodeledSideEffects())
return false;
// See if this instruction does a load. If so, we have to guarantee that the
Modified: llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp?rev=123031&r1=123030&r2=123031&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp Fri Jan 7 15:08:26 2011
@@ -336,7 +336,9 @@
MachineInstr *MI = &*MII++;
LocalMIs.insert(MI);
- if (MI->getDesc().hasUnmodeledSideEffects())
+ if (MI->isLabel() || MI->isPHI() || MI->isImplicitDef() ||
+ MI->isKill() || MI->isInlineAsm() || MI->isDebugValue() ||
+ MI->getDesc().hasUnmodeledSideEffects())
continue;
if (MI->getDesc().isCompare()) {
Modified: llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp?rev=123031&r1=123030&r2=123031&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp Fri Jan 7 15:08:26 2011
@@ -1620,7 +1620,8 @@
const TargetInstrDesc &TID = MI.getDesc();
if (TID.mayLoad() || TID.mayStore() || TID.isCall() || TID.isTerminator() ||
TID.isCall() || TID.isBarrier() || TID.isReturn() ||
- TID.hasUnmodeledSideEffects())
+ TID.hasUnmodeledSideEffects() ||
+ MI.isLabel() || MI.isDebugValue())
return false;
for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
MachineOperand &MO = MI.getOperand(i);
More information about the llvm-commits
mailing list