[PATCH] D113160: [stack-safety] Check SCEV constraints at memory instructions.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 14:00:11 PST 2021


eugenis added a comment.

This looks nice. Any idea how much does it improve analysis success rate in practice?

Would be great to have a test with some loop, if it works.



================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:343
+    return SE.getCouldNotCompute();
+  auto *PtrTy = IntegerType::getInt8PtrTy(SE.getContext());
+  return SE.getConstant(PtrTy, TS.getFixedSize());
----------------
It's a little strange to compute type size in a pointer, but SCEV does not care as long as the number of bits is the same, so I guess it is fine.



================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:401
         }
-        US.addRange(I,
-                    getAccessRange(UI, Ptr, DL.getTypeStoreSize(I->getType())));
+        auto TypeSize = DL.getTypeStoreSize(I->getType());
+        auto AccessRange = getAccessRange(UI, Ptr, TypeSize);
----------------
move getTypeStoreSize into getTypeSize


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113160



More information about the llvm-commits mailing list