You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alive2 is correct in rejecting this.
There was a decision some time ago that pointer comparison compares addresses. I forget if it was needed for C/C++, but at least it was needed for optimizations that do alias checks at run time (i.e., the loop vectorizer).
This means that ptr1 == ptr2 does not imply that the pointers are equivalent. It just states that their addresses are equal, ignoring provenance. Establishing pointer equivalent in this scheme is quite tricky (seeing a gep inbounds or a dereference is not sufficient due to integer to pointer casts, for example).
See the case from llvm/llvm-project#115574: https://alive2.llvm.org/ce/z/VbP3na
In
ICmp::toSMT
, we use pointer compare modeINTEGRAL
foricmp eq
. However, inPointer::refined
we usePROVENANCE
mode to check refinement:alive2/ir/pointer.cpp
Line 736 in 0281f6a
Is it possible to allow this transformation under non-asm mode?
The text was updated successfully, but these errors were encountered: