-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Miscompilation when matching on an enum after printing Hello world #114691
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
Comments
define i8 @test(ptr %p) {
%v1 = load i8, ptr %p, align 4, !range !0, !noundef !{}
%cmp1 = icmp eq i8 %v1, 0
%p2 = getelementptr inbounds i8, ptr %p, i64 1
%v2 = load i8, ptr %p2, align 1, !range !0
%cmp2 = icmp eq i8 %v2, 0
%or = select i1 %cmp1, i1 %cmp2, i1 false
%res = select i1 %or, i8 0, i8 2
ret i8 %res
}
!0 = !{i8 0, i8 2} Results in:
This makes use of the |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-critical +T-compiler |
Upstream issue: llvm/llvm-project#64589 |
Sorry for commenting on a closed issue, but this test is regressing for us with a custom target, because the problematic transformation To me, it's clear to see why the transformation is invalid, but for seemingly different reasons than the above fix addresses. The IR is:
Which represents a logical, short-circuiting Does anyone have a theory as to why this fix used to work, but seems to no longer work? Frustratingly, the testcase still passes for x86_64, but that doesn't mean anything about this fix because they have switched to using GlobalISel. |
Can you instead open a new issue? This is a really old closed issue so likely has very limited visibility. |
I tried this code:
The assertion shouldn't fail, because
pass
isPass::Transparent
and so the parameter to the functioncheck
should beNone
, but the assertion still fails.Meta
rustc --version --verbose
:It seems that the bug only occurs when using
opt-level=1
oropt-level=2
and after updating to LLVM 17.The text was updated successfully, but these errors were encountered: