[PATCH] D123408: [InstCombine] Limit folding of cast into PHI

Zaara Syeda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 10:16:59 PDT 2022


syzaara created this revision.
syzaara added reviewers: bmahjour, Whitney, spatel.
Herald added a subscriber: hiraditya.
Herald added a project: All.
syzaara requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

InstCombine folds a cast of a phi into the phi. Sometimes, this isn't beneficial because there could be another user of the phi which is also a cast such a zext which feed an add (or other operations which vectorization would consider for reductions) and then truncate. When folding the cast into the phi, it can break the pattern of zext + add + truncate which otherwise could've been simplified into a smaller width add and been considered for loop vectorization.


https://reviews.llvm.org/D123408

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
  llvm/test/Transforms/InstCombine/phi-multiple-zext.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123408.421571.patch
Type: text/x-patch
Size: 4010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220408/54dd1d41/attachment.bin>


More information about the llvm-commits mailing list