llvm.org GIT mirror llvm / 3f67904
[ARM] Use a Changed flag to avoid making a pass's return value dependent on a compare with a Statistic object. Statistic compile to always be 0 in release build so this compare would always return false. And in the debug builds Statistic are global variables and remember their values across pass runs. So this compare returns true anytime the pass runs after the first time it modifies something. This was found after reviewing all usages of comparison operators on a Statistic object. We had some internal code that did a compare with a statistic that caused a mismatch in output between debug and release builds. So we did an audit out of paranoia. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302450 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 years ago
1 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
8787 }
8888 }
8989 }
90 bool Changed = false;
9091 // Remove the tagged DMB
9192 for (auto MI : ToRemove) {
9293 MI->eraseFromParent();
9394 ++NumDMBsRemoved;
95 Changed = true;
9496 }
96 return NumDMBsRemoved > 0;
98 return Changed;
9799 }
99101 /// createARMOptimizeBarriersPass - Returns an instance of the remove double