[WebAssembly] Make WebAssemblyStoreResults only return true when it has a change.

llvm-svn: 255253
This commit is contained in:
Dan Gohman 2015-12-10 14:17:36 +00:00
parent a87629d6d7
commit b949b9c01b
1 changed files with 3 additions and 1 deletions

View File

@ -71,6 +71,7 @@ bool WebAssemblyStoreResults::runOnMachineFunction(MachineFunction &MF) {
const MachineRegisterInfo &MRI = MF.getRegInfo();
MachineDominatorTree &MDT = getAnalysis<MachineDominatorTree>();
bool Changed = false;
assert(MRI.isSSA() && "StoreResults depends on SSA form");
@ -108,6 +109,7 @@ bool WebAssemblyStoreResults::runOnMachineFunction(MachineFunction &MF) {
if (&MI == Where || !MDT.dominates(&MI, Where))
continue;
}
Changed = true;
DEBUG(dbgs() << "Setting operand " << O << " in " << *Where
<< " from " << MI << "\n");
O.setReg(ToReg);
@ -115,5 +117,5 @@ bool WebAssemblyStoreResults::runOnMachineFunction(MachineFunction &MF) {
}
}
return true;
return Changed;
}