[llvm] [StackSafetyAnalysis] Don't call getTruncateOrZeroExtend for pointers of different sizes (PR #79804)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 03:26:07 PST 2024


================
@@ -273,6 +273,14 @@ ConstantRange StackSafetyLocalAnalysis::offsetFrom(Value *Addr, Value *Base) {
     return UnknownRange;
 
   auto *PtrTy = PointerType::getUnqual(SE.getContext());
+
+  // FIXME: Pass does not deal with pointers from different address spaces that
+  // don't have the same size.
+  if (DL.getTypeSizeInBits(Addr->getType()) != PointerSize ||
----------------
arsenm wrote:

Checking mismatched address space would also be better? 

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


More information about the llvm-commits mailing list