[PATCH] D48122: [SimplifyCFG] Hoist common if-then-else code if used by two-entry PHI nodes

Alexandros Lamprineas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 06:34:00 PDT 2018


labrinea created this revision.
labrinea added reviewers: llvm-commits, hfinkel, efriedma, davide, spatel.
Herald added a reviewer: dberlin.

The current algorithm for hoisting if-then-else code is limited to only match identical instructions with the exact same ordering. The reason is to keep the complexity low. There are cases where the InstCombiner cannot sink the common code and we end up with trivial PHIs which cannot be eliminated. This prevents if-conversion. SimplifyCFG is not the best place for this kind of transformation but it is a short-term solution until GVN-Hoist gets fixed/enabled.


https://reviews.llvm.org/D48122

Files:
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Transforms/SimplifyCFG/HoistThenElseCodeToIf.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48122.151121.patch
Type: text/x-patch
Size: 10697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180613/e1ef2e6c/attachment.bin>


More information about the llvm-commits mailing list