[PATCH] D77868: [InstSimplify] fold select of bools using bitwise logic

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 06:25:42 PDT 2020


spatel created this revision.
spatel added reviewers: lebedev.ri, nikic, aqjune, nlopes, regehr.
Herald added subscribers: hiraditya, mcrosier.

select Cond, T, false --> Cond & T
select Cond, true, F --> Cond | F

This fixes regressions that would be visible if we remove known poison-unsafe transforms in instcombine mentioned here:
https://reviews.llvm.org/D72396#1810460

I'm not sure yet how to deal with the 'and-not' and 'or-not' variations.

Alive2 example for 1 of the tests:
http://volta.cs.utah.edu:8080/z/Ue2UE3


https://reviews.llvm.org/D77868

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstSimplify/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77868.256552.patch
Type: text/x-patch
Size: 4695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200410/f2f3c971/attachment.bin>


More information about the llvm-commits mailing list