Skip to content

Commit 0cb12b6

Browse files
committed
[DFAJumpThreading] Set MadeChanges only if threading happened
1 parent 958ec32 commit 0cb12b6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,11 +820,14 @@ struct TransformDFA {
820820
: SwitchPaths(SwitchPaths), DT(DT), AC(AC), TTI(TTI), ORE(ORE),
821821
EphValues(EphValues) {}
822822

823-
void run() {
823+
bool run() {
824+
bool MadeChange = false;
824825
if (isLegalAndProfitableToTransform()) {
825826
createAllExitPaths();
827+
MadeChange = true;
826828
NumTransforms++;
827829
}
830+
return MadeChange;
828831
}
829832

830833
private:
@@ -1426,9 +1429,8 @@ bool DFAJumpThreading::run(Function &F) {
14261429

14271430
for (AllSwitchPaths SwitchPaths : ThreadableLoops) {
14281431
TransformDFA Transform(&SwitchPaths, DT, AC, TTI, ORE, EphValues);
1429-
Transform.run();
1430-
MadeChanges = true;
1431-
LoopInfoBroken = true;
1432+
if (Transform.run())
1433+
MadeChanges = LoopInfoBroken = true;
14321434
}
14331435

14341436
#ifdef EXPENSIVE_CHECKS

0 commit comments

Comments
 (0)