HomePhabricator

[InstCombine] Fully disable select to and/or i1 folding

Authored by aqjune on May 1 2021, 8:28 PM.

Description

[InstCombine] Fully disable select to and/or i1 folding

This is a patch that disables the poison-unsafe select -> and/or i1 folding.

It has been blocking D72396 and also has been the source of a few miscompilations
described in llvm.org/pr49688 .
D99674 conditionally blocked this folding and successfully fixed the latter one.
The former one was still blocked, and this patch addresses it.

Note that a few test functions that has _logical suffix are now deoptimized.
These are created by @nikic to check the impact of disabling this optimization
by copying existing original functions and replacing and/or with select.

I can see that most of these are poison-unsafe; they can be revived by introducing
freeze instruction. I left comments at fcmp + select optimizations (or-fcmp.ll, and-fcmp.ll)
because I think they are good targets for freeze fix.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D101191

Details

Committed
aqjuneMay 5 2021, 5:29 PM
Reviewer
nikic
Differential Revision
D101191: [InstCombine] Fully disable select to and/or i1 folding
Parents
rGf5199d7ae0ed: [AMDGPU] Revise handling of preexisting waitcnt
Branches
Unknown
Tags
Unknown