[llvm-dev] [MemorySSA] A question about how to update the MemorySSA when we call RecursivelyDeleteTriviallyDeadInstructions

Wei Mi via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 28 11:29:21 PDT 2017


When we erase a memory access instruction, existing passes using
memory ssa like GVN, NewGVN, GVNHoist and EarlyCSE uses
MemorySSAUpdater to do the update before the instruction is erased.

However, if we call llvm::RecursivelyDeleteTriviallyDeadInstructions
to find out dead instruction recursively and memory access
instructions may be erased inside the recursive process, we need a way
to update MemorySSA for those instructions. Note MemorySSA update
should be done before the instruction is erased.

Is it acceptable to have an API with MemorySSAUpdater as a param, or
it is better for MemoryUseOrDef to have a callback value handler to do
the update transparently, or there are better ways to be suggested.

Thanks,
Wei.


More information about the llvm-dev mailing list