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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 06:43:32 PDT 2020


fhahn added a comment.

> 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).
> 
>> ! In D83595#2145347 <https://reviews.llvm.org/D83595#2145347>, @lebedev.ri wrote:
> 
> Perhaps MemSSA-based DCE can be taught about it?

MemorySSA-based DSE has similar logic (check that a store is either overwritten or never read on all paths to a function exit), but it uses a MemorySSA traversal to do so. I don't think alloca are modeled directly in MemorySSA though, so the approach cannot be directly applied I think. It might be possible to add a pseudo-memorydef writing to the alloca directly after its definition. Then the MemorySSA based logic may apply.


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