[PATCH] D22747: [InstCombine] try to fold (select C, (sext A), B) into logical ops

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 12:21:18 PDT 2016


nhaehnle updated this revision to Diff 66690.
nhaehnle added a comment.

Simplified the test cases (baseline is already in SVN), and use the APInt
hint, thanks!

About the vector case: As you can see, it requires a change to
FoldOpIntoSelect (to avoid an infinite loop) and a change to one other test
case. Now the change looks correct, but I don't know if there may be
unintended optimization regressions in some backend...

Reverting the behavior for vectors is easy enough, though, just remove the
->getScalarType() in foldSelectExtConst and FoldOpIntoSelect.


https://reviews.llvm.org/D22747

Files:
  lib/Transforms/InstCombine/InstCombineSelect.cpp
  lib/Transforms/InstCombine/InstructionCombining.cpp
  test/Transforms/InstCombine/select-bitext.ll
  test/Transforms/InstCombine/vector-casts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22747.66690.patch
Type: text/x-patch
Size: 8592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160803/368b4cc8/attachment.bin>


More information about the llvm-commits mailing list