[PATCH] D11854: DeadStoreElimination: remove a redundant store even if the load is in a different block.

Erik Eckstein via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 16:17:01 PDT 2015


eeckstein added a comment.

Thanks for reviewing!

PS to compile time: while you are right that it goes over the whole CFG for each store, this is only the worst case scenario.
The MemoryIsNotModifiedBetween() is only called if the value and pointer operands match, which is the case for 0.2% of all stores.
And even then it bails out early if it finds a potentially aliased store. On average MemoryIsNotModifiedBetween() traverses only about 3 blocks or 10 instructions per invocation. On average it calls 2 times getModRefInfo per invocation.


http://reviews.llvm.org/D11854





More information about the llvm-commits mailing list