[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
Fri Jul 10 16:10:29 PDT 2020


guiand created this revision.
guiand added reviewers: eugenis, vitalybuka.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

If we know that every path from an alloca leads to a store, we can optimize away poisoning its shadow (it'll be overwritten anyway).

I'm wondering if there's a better approach for finding all these def-uses. I investigated the `DominatorTree`, but I'm not sure how I would use that to check *all* the uses without blowing up the runtime for instrumenting an alloca to O(N^2) (N=# uses) or so.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83595

Files:
  llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
  llvm/test/Instrumentation/MemorySanitizer/alloca.ll
  llvm/test/Instrumentation/MemorySanitizer/msan_x86_bts_asm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83595.277159.patch
Type: text/x-patch
Size: 4308 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200710/d5386aa1/attachment.bin>


More information about the llvm-commits mailing list