[PATCH] D21613: [DSE] Avoid iterator invalidation bugs by deferring deletion.

Henric Karlsson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 05:23:49 PDT 2016


Henric added a comment.

> I've addressed the regressed test by added an outer loop around the kernel code in eliminateDeadStores that reevaluates the block until there is no change (as was suggested in http://reviews.llvm.org/D21076)


If the extra compilation time does not turn out to be a problem, then I think it's a good improvement. The code that is now encapsulated in eliminateNoopStore could already do that (reevaluate the block) so you could probably already create a rather bad test case if you really wanted.

I remember someone suggested in mail to the review list that it might be possible to remove stores if you process them in the right order. But I never understood how, at least not in the general case where you don't know the address origin of a load. For example if the use comes from an input param to the function,   two examples:

load -> r1
store *r1 -> g1
load -> r2 
store *r2 -> g2
...
store -> g1
store -> g2

compared to

load -> r2
store *r2 -> g2
load -> r1 
store *r1 -> g1
...
store -> g1
store -> g2


http://reviews.llvm.org/D21613





More information about the llvm-commits mailing list