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

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 10:41:03 PDT 2016


mcrosier created this revision.
mcrosier added reviewers: eli.friedman, dberlin, Henric.
mcrosier added a subscriber: llvm-commits.

This patch is the mechanical part of D21007 to avoid problems with iterator invalidation.

Unfortunately, the changes in D21007 break the test case added in http://reviews.llvm.org/rL273141.  Now that we don't/can't toy with the iterators, 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 D21076).  If someone else has another idea, I'm open to suggestions.

No correctness issues across SPEC2000, SPEC2006, and llvm-test-suite.  The only codegen changes were slightly fewer stores in:
./llvm-test-suite/MultiSource/Benchmarks/Bullet/bullet
./llvm-test-suite/MultiSource/Benchmarks/MiBench/consumer-jpeg/consumer-jpeg
./llvm-test-suite/MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4
./llvm-test-suite/MultiSource/Benchmarks/mediabench/jpeg/jpeg-6a/cjpeg
./llvm-test-suite/MultiSource/Applications/oggenc
./llvm-test-suite/MultiSource/Applications/sqlite3
./spec2006/povray
./spec2006/perlbench
./spec2006/dealII

All other benchmarks across SPEC200X and llvm-test-suite were unchanged.

 Chad

FWIW, I'm in the process of trying to port DSE to use MemorySSA and I thought pushing this change sooner rather than later would simplify my life.  Sorry to hijack your change, Eli.

http://reviews.llvm.org/D21613

Files:
  lib/Transforms/Scalar/DeadStoreElimination.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21613.61568.patch
Type: text/x-patch
Size: 21625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160622/6b582ebe/attachment.bin>


More information about the llvm-commits mailing list