-
Notifications
You must be signed in to change notification settings - Fork 13.4k
is EarlyCSEPass folding icmp of global to null => false correct? #133621
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
I think only weak symbols can be resolved to null pointer and be valid. |
llvm-project/llvm/lib/IR/ConstantFold.cpp Lines 1032 to 1049 in a03367f
|
Hmm. It seems like it should be explicitly noted in the LangRef that declaring something with non- And apparently Alive2 does not believe that this transformation is incorrect, even with I guess I should file that against Alive2? |
We recently discovered that EarlyCSEPass applies something like the following transformation:
Unfortunately, this symbol is actually "linked" at 0x0.
The full(?) LLVMIR with no prepopulated passes, though the externally linked item declaration seems to have gone missing...? It should be as above
As an external global of zero bytes can seemingly be given the address of 0x0 without needing to be initialized, and doing so might make sense, it seems that this folding is incorrect. Or, at least, the LangRef needs a considerable amount of updating to explain this optimization's justification.
The text was updated successfully, but these errors were encountered: