[PATCH] D37163: [LICM] sink through non-trivially replicable PHI

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 10:23:02 PDT 2017


junbuml updated this revision to Diff 114198.
junbuml marked an inline comment as done.
junbuml added a comment.

I looked at if we can add an extra check to avoid unnecessary splitting, but for me this seems to be a special case for which I don't want to increase complexity in this change.  Since all incoming edges in non-trivially replacable PHI in LCSSA is critical, splitting them by default doesn't seems unreasonable to me.

The splitting is not required only when all incoming value are sinkable and the operation of them is same in the non-trivially replicable PHIs. In such case, we can sink the same sinkable operation and modify the PHI to pass the operands to the shared operation like the IR you mentioned above. Handling such case pretty much special case which I believe we can let other pass handle or we can extend it in a separate patch if we need to handle it in LICM.

Added more test cases and made minor updates.


https://reviews.llvm.org/D37163

Files:
  lib/Transforms/Scalar/LICM.cpp
  test/Transforms/LICM/sinking.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37163.114198.patch
Type: text/x-patch
Size: 19460 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170907/403a38ef/attachment.bin>


More information about the llvm-commits mailing list