[PATCH] D134142: [InstCombine] Handle integer extension in `select` patterns using the condition as value

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 05:02:12 PDT 2022


zero9178 updated this revision to Diff 461536.
zero9178 retitled this revision from "[InstSimplify] Fold `select C, not(C), C` to zero" to "[InstCombine] Handle integer extension in `select` patterns using the condition as value".
zero9178 edited the summary of this revision.
zero9178 added a comment.

Address review comments: Change approach to handling it in InstCombine. I noticed that these "implication" patterns for the condition being used as either the true or false values already existed but have simply only been handled for `i1` selection type while not taking `zext` and `sext` into account. 
I now made these also handle `zext` and `sext` as well, making it capable of handling any integer type.


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

https://reviews.llvm.org/D134142

Files:
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/test/Transforms/InstCombine/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134142.461536.patch
Type: text/x-patch
Size: 7569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220920/6b53774e/attachment.bin>


More information about the llvm-commits mailing list