-
Notifications
You must be signed in to change notification settings - Fork 13.6k
clang-20 crashed with optnone attribute at -O1 and above. error in backend: Cannot select: intrinsic %llvm.expect.with.probability. #115411
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
@llvm/issue-subscribers-backend-x86 Author: Anonymous (iamanonymouscs)
clang-20 crashed with ```optnone``` attribute at ```-O1``` and above.
Compiler explorer: https://godbolt.org/z/4dP5xGxnx
|
@llvm/issue-subscribers-clang-codegen Author: Anonymous (iamanonymouscs)
clang-20 crashed with ```optnone``` attribute at ```-O1``` and above.
Compiler explorer: https://godbolt.org/z/4dP5xGxnx
|
I think this is Clang codegen problem. According to https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGBuiltin.cpp#L3522, we should not generate llvm.expect.with.probability for |
That link seems to have drifted, but I presume it means to link to this: llvm-project/clang/lib/CodeGen/CGBuiltin.cpp Lines 3573 to 3577 in 93a4244
Curiously, if you replace It seems like SelectionDAGBuilder, FastISel, and IntrinsicLowering each have similar handling that removes the |
…when optimizations are disabled (#117835) Handle @llvm.expect.with.probability in GlobalISel in the same way @llvm.expect is handled, passing the value through as-is. This can be encountered if the intrinsic is used without optimizations, which would otherwise transform it out. Fixes #115411 for GlobalISel
clang-20 crashed with
optnone
attribute at-O1
and above.Compiler explorer: https://godbolt.org/z/4dP5xGxnx
The text was updated successfully, but these errors were encountered: