-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[llvm-diff] Also diff alloca's allocated type and alignment #84781
base: main
Are you sure you want to change the base?
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct, but I think it only scratches the surface of the problem? The same problem exists for load types, GEP types, and basically everything else that is checked by hasSameSpecialState()
. Can we use that instead?
Adding test case |
When I was adding the test cases, I found another weird thing: same struct in different I'm gonna investigate this issue tomorrow, because I have to go sleep now - I have lessons tomorrow. |
After investigation, I found that two The related code might be llvm-project/llvm/lib/IR/Type.cpp Lines 513 to 529 in ffe4181
We can infer that different calls to StructType::create will always create different Type* s, which cause llvm-diff (of the current PR) to consider same struct as different types.
So, should we modify the code in Reproduction ( %struct = type { i8 }
define void @gep(ptr %addr) {
%1 = getelementptr %struct, ptr %addr, i32 0
ret void
} Command:
|
a83471e
to
fe96bfe
Compare
TL;DR: added a function In |
ping? |
ping @nikic |
Currently, the function
llvm-project/llvm/tools/llvm-diff/lib/DifferenceEngine.cpp
Lines 364 to 369 in 8c33044
doesn't handle the non-operand data of
AllocaInst
. For example,would be considered the same instruction.
Under some special circumstances, that would make llvm-diff crash: