[PATCH] D59065: [BasicAA] Simplify inttoptr(and(ptrtoint(X), C)) to X, if C preserves all significant bits.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 08:08:14 PDT 2019


arsenm added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:3760
+        uint64_t MeaningfulPtrBits =
+            (AllOnes >> (64 - DL.getMaxPointerSizeInBits())) &
+            (AllOnes << Log2_64(DL.getMinPointerABIAlignment()));
----------------
I don't see why you would use the max size, when you can check the 2 address space sizes


================
Comment at: llvm/test/Analysis/BasicAA/strip-nonsignificant-ptr-bits.ll:88
+}
+
+declare void @init(i64, %struct.zot** nocapture dereferenceable(8))
----------------
Needs tests where the address spaces don't match and have different sizes


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59065/new/

https://reviews.llvm.org/D59065





More information about the llvm-commits mailing list