[PATCH] D38501: [ValueTracking] Fix a misuse of APInt in GetPointerBaseWithConstantOffset

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 11:41:37 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D38501#887149, @aprantl wrote:

> It would be better if the test would check for an actual different result rather than "it doesn't crash".


I agree.



================
Comment at: lib/Analysis/ValueTracking.cpp:3081
   }
   Offset = ByteOffset.getSExtValue();
   return Ptr;
----------------
Do we need to add a check here that the offset can actually be represented in 64 bits? I don't think that a truncated return value here actually makes sense.



https://reviews.llvm.org/D38501





More information about the llvm-commits mailing list