[llvm] [ValueTracking] Allow getUnderlyingPointer to look through inttoptr/ptrtoint round trip casts (PR #146432)

Drew Kersnar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 1 09:01:54 PDT 2025


================
@@ -1602,6 +1602,8 @@ AliasResult BasicAAResult::aliasCheck(const Value *V1, LocationSize V1Size,
   // Figure out what objects these things are pointing to if we can.
   const Value *O1 = getUnderlyingObject(V1, MaxLookupSearchDepth);
   const Value *O2 = getUnderlyingObject(V2, MaxLookupSearchDepth);
+  removeRoundTripCasts(O1);
+  removeRoundTripCasts(O2);
----------------
dakersnar wrote:

Thanks for the explanation, that makes sense to me. Closing this PR. Appreciate the time!

https://github.com/llvm/llvm-project/pull/146432


More information about the llvm-commits mailing list