[PATCH] D83595: [Draft][MSAN] Optimize away poisoning allocas that are always written before load

Gui Andrade via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 11:53:29 PDT 2020


guiand added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3848
+  // Mapping of Value modifying a pointer => Offset it's pointing to
+  using RedefOffsets = DenseMap<Value *, uint64_t>;
+  // Set of instructions consuming a given alloca
----------------
No longer needed


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3850
+  // Set of instructions consuming a given alloca
+  using UserSet = SmallPtrSet<Value *, 10>;
+
----------------
No longer needed


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3656
+          // pointer somewhere. But we don't want that.
+          return Store->getPointerOperand() == &Alloca;
+        } else {
----------------
vitalybuka wrote:
> Store may write only part of alloca.
> How useful (binary size) the patch as is?
It depends a lot on the program. Grep saw like a 8% decrease in binary size, while clang saw 0.5% to 1% decrease.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83595



More information about the llvm-commits mailing list