Skip to content

PR for llvm/llvm-project#64589 #580

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

Merged
merged 2 commits into from
Aug 15, 2023
Merged

PR for llvm/llvm-project#64589 #580

merged 2 commits into from
Aug 15, 2023

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Aug 14, 2023

nikic added 2 commits August 14, 2023 07:31
(cherry picked from commit 59d558a)
D141386 changed the semantics of !range metadata to return poison
on violation. If !range is combined with !noundef, violation is
immediate UB instead, matching the old semantics.

In theory, these IR semantics should also carry over into SDAG.
In practice, DAGCombine has at least one key transform that is
invalid in the presence of poison, namely the conversion of logical
and/or to bitwise and/or (https://github.com/llvm/llvm-project/blob/c7b537bf0923df05254f9fa4722b298eb8f4790d/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L11252).
Ideally, we would fix this transform, but this will require
substantial work to avoid codegen regressions.

In the meantime, avoid transferring !range metadata without
!noundef, effectively restoring the old !range metadata semantics
on the SDAG layer.

Fixes llvm/llvm-project#64589.

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

(cherry picked from commit 9deee6b)
@llvmbot
Copy link
Member Author

llvmbot commented Aug 14, 2023

@arsenm What do you think about merging this PR to the release branch?

@tru
Copy link
Contributor

tru commented Aug 14, 2023

ping @arsenm

@tru tru merged commit f124907 into release/17.x Aug 15, 2023
@tru tru deleted the llvm-issue64589 branch August 15, 2023 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SDAG] Miscompile of logical or of comparisons of loads with !range metadata
3 participants