-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[CallGraph] New llvm.assume might not show up in GlobalsAA/CallGraph #63925
Labels
Comments
jdoerfert
changed the title
[Call] New llvm.assume might not show up in the CallGraph
[CallGraph] New llvm.assume might not show up in the CallGraph
Jul 17, 2023
Test case: https://godbolt.org/z/1jbvKPzEn
Run with Results in memory(none) even though there is an llvm.assume (=not good). |
jdoerfert
changed the title
[CallGraph] New llvm.assume might not show up in the CallGraph
[CallGraph] New llvm.assume might not show up in GlobalsAA/CallGraph
Jul 17, 2023
jdoerfert
added a commit
to jdoerfert/llvm-project
that referenced
this issue
Jul 18, 2023
When SimplifyCFG, and probably other passes, create a call to `llvm.assume` to retain some knowledge, they need to update the state of GlobalsAA. If not, later passes might think the function is side-effect free, or read only, which it is not, due to the `llvm.assume` call. Deducing the wrong memory effects can lead to problems, e.g., hoisting of a call and thereby introducing UB. Fixes: llvm#63925
Invalid, see discussion here: https://reviews.llvm.org/D155528#4509210 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After we create the CallGraph, we might add a
llvm.assume
call. They need to be added to the CallGraph, or GlobalsAA thinks the function is side-effect free.I don't have a small reproducer. I found this because
@_X_strcmp
inllvm-test-suite/MultiSource/Applications/spiff/compare.c
is markedmemory(read)
even though it contains a (non-trivial)llvm.assume
call.The text was updated successfully, but these errors were encountered: