[PATCH] D37419: Teach scalar evolution to handle inttoptr/ptrtoint

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 3 00:15:27 PDT 2017


davidxl added inline comments.


================
Comment at: lib/Transforms/Scalar/AlignmentFromAssumptions.cpp:276
+        else
+          AAPtr = OpUnk->getValue();
+        break;
----------------
hfinkel wrote:
> I'm not sure that this is correct: How do we know that AAPtr is a pointer value? The idea here is that there's some expression that looks like ptrtoint(ptr) + e1 + e2 + ..., and we want to separate it into (ptr, e1 + e2 + ...). If we update SCEV to look through ptrtoint, we can't do this in the same way. I imagine we need to write a visitor to pull out the underlying pointer, or we need to not use SCEV for this task.
Won't adding a pointer type check be enough ?


https://reviews.llvm.org/D37419





More information about the llvm-commits mailing list