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

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 11:21:37 PDT 2020


aqjune added a comment.

To partially support this optimization, my patch D78152 <https://reviews.llvm.org/D78152> might be of help. It contains impliesPoison(X, Y), which returns true if Y is poison given that X is poison.
With D76010 <https://reviews.llvm.org/D76010> and making propagatesFullPoison return true on fcmp, tests in InstSimplify/select.ll except `x | (x & y) --> x` are supported.
To support the case, I think we need to separately enumerate such optimizations that are safe for select.

To check whether using impliesPoison affects compilation time, I ran CTMark after applying D76010 <https://reviews.llvm.org/D76010>, D78152 <https://reviews.llvm.org/D78152>, and making propagatesFullPoison return true on fcmp.
It has ~0.5% increase in compilation time. If you think this is too much, I can tweak D78152 <https://reviews.llvm.org/D78152> to make it faster.
 F11767873: ctmark.csv <https://reviews.llvm.org/F11767873>


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

https://reviews.llvm.org/D77868





More information about the llvm-commits mailing list