[llvm] [Attributor] Check range size before constant fold load (PR #151359)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 17:45:25 PDT 2025


================
@@ -272,6 +272,9 @@ AA::getInitialValueForObj(Attributor &A, const AbstractAttribute &QueryingAA,
   }
 
   if (RangePtr && !RangePtr->offsetOrSizeAreUnknown()) {
+    int64_t StorageSize = DL.getTypeStoreSize(&Ty);
+    if (StorageSize != RangePtr->Size)
+      return nullptr;
----------------
arsenm wrote:

This is a load of a value that's too small, I'd expect that this to truncate? 

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


More information about the llvm-commits mailing list