[PATCH] D93065: [InstCombine] Disable optimizations of select instructions that causes propagation of poison values

Congzhe Cao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 14:05:46 PST 2020


congzhe added a comment.

In D93065#2461196 <https://reviews.llvm.org/D93065#2461196>, @nlopes wrote:

> Using freeze loses information (if some of the inputs was poison). Plus It requires an extra op.
> If we canonicalize around select there's no loss of information and it's just 1 instruction.
>
> The disadvantage is that then we have 2 ways or doing boolean ANDs/ORs. Though most analyses can be patched easily, as most LLVM analyses' results are of the form "x has property foo unless it's poison". So for those analyses using and/or or select is the same (as the only difference between these is propagation of poison).
> Other analyses/optimization can learn about select as needed.

Thank you for raising up the good point! I understand that we lose information by preventing poison values from propagation using freeze. But I'm unclear what would be the side effect or problem with that? I'd appreciate it if you could clarify a bit, thanks!


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

https://reviews.llvm.org/D93065



More information about the llvm-commits mailing list