mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-26 06:04:47 +00:00
DBG_VALUE does not have any side effects; it also makes no sense to mark it cheap as a copy.
llvm-svn: 123031
This commit is contained in:
parent
62b5a4d14c
commit
8b58b77d06
@ -484,7 +484,7 @@ def DBG_VALUE : Instruction {
|
||||
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);
|
||||
|
@ -1115,7 +1115,9 @@ bool MachineInstr::isSafeToMove(const TargetInstrInfo *TII,
|
||||
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
|
||||
|
@ -336,7 +336,9 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
|
||||
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()) {
|
||||
|
@ -1620,7 +1620,8 @@ static bool isSafeToDelete(MachineInstr &MI) {
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user