[PATCH] D121310: [IROutliner] IR Outliner can mix up order of incoming values when compressing phi nodes if contain the same values

Andrew Litteken via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 10:53:30 PST 2022


AndrewLitteken created this revision.
AndrewLitteken added a reviewer: paquette.
Herald added subscribers: ormris, hiraditya.
Herald added a project: All.
AndrewLitteken requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Github issue: https://github.com/llvm/llvm-project/issues/54211

Example: https://godbolt.org/z/KrKPojnqE

When matching PHINodes when margining functions the IROutliner only checks that an incoming value exists in phi node in overall function. It doesn't check the length, the order, or that the incoming block also matches. In the given example, we see that both phi nodes have the same incoming values, but from different blocks.

The fix is to to enforce stricter a match of the incoming value, and the incoming block as well when matching the created phi nodes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121310

Files:
  llvm/include/llvm/Transforms/IPO/IROutliner.h
  llvm/lib/Transforms/IPO/IROutliner.cpp
  llvm/test/Transforms/IROutliner/different-order-phi-merges.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121310.414154.patch
Type: text/x-patch
Size: 10824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220309/0adf0a0a/attachment.bin>


More information about the llvm-commits mailing list