[llvm] [JumpThreading] Clear LoopLatches for each invocation of JumpThreading pass. (PR #127768)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 00:48:37 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Jim Lin (tclin914)

<details>
<summary>Changes</summary>

Clear LoopLatches after each resolved function is finished to avoid 
non-determinisc that I encountered in mingw environment.

---
Full diff: https://github.com/llvm/llvm-project/pull/127768.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Scalar/JumpThreading.cpp (+1) 


``````````diff
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index 7b221a814aabd..48bc868e6601b 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -379,6 +379,7 @@ bool JumpThreadingPass::runImpl(Function &F_, FunctionAnalysisManager *FAM_,
     }
 
   LoopHeaders.clear();
+  LoopLatches.clear();
   return EverChanged;
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/127768


More information about the llvm-commits mailing list