[WebAssembly] Make WebAssemblyStoreResults only return true when it has a change.
authorDan Gohman <dan433584@gmail.com>
Thu, 10 Dec 2015 14:17:36 +0000 (14:17 +0000)
committerDan Gohman <dan433584@gmail.com>
Thu, 10 Dec 2015 14:17:36 +0000 (14:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255253 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/WebAssembly/WebAssemblyStoreResults.cpp

index 21122ba2b2ea9677c031003e96bf26c5b57fb5ad..650143a94095393dc32c563800a481686d865926 100644 (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;
 }