[llvm] [InstCombine] Make backedge check in op of phi transform more precise (PR #106075)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 31 18:38:31 PDT 2024


================
@@ -359,6 +365,13 @@ class LLVM_LIBRARY_VISIBILITY InstCombiner {
       std::function<void(Instruction *, unsigned, APInt, APInt &)>
           SimplifyAndSetOp);
 
+  void computeBackEdges();
+  bool isBackEdge(const BasicBlock *From, const BasicBlock *To) {
+    if (!ComputedBackEdges)
----------------
dtcxzyw wrote:

```suggestion
  bool isBackEdge(const BasicBlock *From, const BasicBlock *To) {
    if (From == To) return true;
  
    if (!ComputedBackEdges)
```

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


More information about the llvm-commits mailing list