[PATCH] D115167: [DSE] Use precise loc for memset_chk writing to local objects.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 09:42:15 PST 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1025
 
-  Optional<MemoryLocation> getLocForWriteEx(Instruction *I) const {
+  Optional<MemoryLocation> getLocForWriteEx(Instruction *I) {
     if (!I->mayWriteToMemory())
----------------
No longer necessary.


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1041
+        // executes. So it either writes exactly the number of specified bytes
+        // or the program gets aborted.
+        if (const auto *Len = dyn_cast<ConstantInt>(CB->getArgOperand(2))) {
----------------
This hold for AA results in general though (they are only valid under the assumption of execution), so maybe it's okay to return a precise result directly in MemoryLocation?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115167



More information about the llvm-commits mailing list