[PATCH] D132704: [LCSSA] Re-use suitable PHI if available instead creating new ones.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 15:05:56 PDT 2022


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LCSSA.cpp:176
+        }
+      }
       Builder.SetInsertPoint(&ExitBB->front());
----------------
efriedma wrote:
> Is the new code to prevent creating identical PHI nodes part of the fix, or just an optimization?  It isn't obviously related.
Preventing identical phis is the main part of the fix.  The issue is that currently scev expansion can create different LCSSA phis when expanding the same expression (since we changed scev to look through trivial phis)

If those are then used as incoming values for phis with multiple matching predecessors we create invalid ir .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132704/new/

https://reviews.llvm.org/D132704



More information about the llvm-commits mailing list