[PATCH] D36137: [Polly][Simplify] Rewrite redundant write detection algorithm.
Michael Kruse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 1 04:13:03 PDT 2017
Meinersbur created this revision.
Meinersbur added a project: Polly.
Herald added a reviewer: bollu.
The previous algorithm was to search for pairs of reads and writes and see whether the write just stores the same read value back, which includes a search whether there is another write access between them. This is O(n^3) in the max number of accesses in a statement (+ the complexity of isl comparing the access functions).
The new algorithm is more similar to the one used for searching for overwrites and coalescable writes. It scans over all accesses in order of execution while tracking which array elements still have the same value since it was read. This is O(n), not counting the complexity within isl. It should be more reliable than trying to catch all non-conforming cases in the previous approach. It is also less code.
We now also support if the write is a partial write of the read's subset, and to some extent non-affine subregions.
https://reviews.llvm.org/D36137
Files:
lib/Transform/Simplify.cpp
test/Simplify/notredundant_region_loop.ll
test/Simplify/notredundant_region_loop___%for---%return.jscop
test/Simplify/notredundant_region_loop___%for---%return.jscop.transformed
test/Simplify/notredundant_region_middle.ll
test/Simplify/redundant_differentindex.ll
test/Simplify/redundant_partialwrite.ll
test/Simplify/redundant_partialwrite___%for---%return.jscop
test/Simplify/redundant_partialwrite___%for---%return.jscop.transformed
test/Simplify/redundant_region.ll
test/Simplify/redundant_region___%for---%return.jscop
test/Simplify/redundant_region___%for---%return.jscop.transformed
test/Simplify/redundant_region_scalar.ll
test/Simplify/redundant_region_scalar___%for---%return.jscop
test/Simplify/redundant_region_scalar___%for---%return.jscop.transformed
test/Simplify/redundant_storebetween.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36137.109072.patch
Type: text/x-patch
Size: 30346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170801/c7854fc0/attachment-0001.bin>
More information about the llvm-commits
mailing list