-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong select folding for undef conditions by InstCombine #98435
Comments
Would this issue be to fix InstCombine to not try to optimise it or get InstCombine to pick |
The problematic step seems to be this one: https://alive2.llvm.org/ce/z/C2waWU I don't think the quoted code is responsible for this, as it is guarded by |
I think the problem is with how llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp Lines 1721 to 1760 in af80d3a
|
@jf-botto Agree. It assumes that !isNullValue() means "is true", which is not the case. |
…nts (llvm#102244) This PR fixes llvm#98435. `SimplifyDemandedVectorElts` mishandles the undef by assuming that !isNullValue() means the condition is true. By preventing any value that we're not certain equals 1 or 0, it avoids having to make any particular choice by not demanding bits from a particular branch with potentially picking a wrong value. Proof: https://alive2.llvm.org/ce/z/r8CmEu
llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
Lines 3582 to 3585 in 7eae9bb
Alive2 report: https://alive2.llvm.org/ce/z/Qtu72J
The text was updated successfully, but these errors were encountered: