[PATCH] D93840: [InstCombine] Disable unsafe select transform behind a flag

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 28 01:13:00 PST 2020


aqjune added a comment.

What do you think about using D78152 <https://reviews.llvm.org/D78152> to allow select -> and/or when it's safe (maybe in a separate patch)?

`select x, y, false` -> `and x, y` is safe if impliesPoison(y, x) holds because it guarantees that there is no such case that x is non-poison and y is poison.
The transformation is safe if x and y are non-poison: see https://alive2.llvm.org/ce/z/3X6bkc

I think this will allow many useful optimizations in InstCombine/InstSimplify working on and/or.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93840



More information about the llvm-commits mailing list