This is an archive of the discontinued LLVM Phabricator instance.

[Polly][Simplify] Remove writes that are overwritten.
ClosedPublic

Authored by Meinersbur on May 12 2017, 11:28 AM.

Details

Summary

Remove memory writes that are overwritten by later writes. This works for StoreInsts:

store double 21.0, double* %A
store double 42.0, double* %A

, scalar writes at the end of a statement and mixes of these.

Multiple writes can be the result of DeLICM, which might map multiple writes to the same location when it knows that these do no conflict (for instance because they write the same value). Such writes interfere with pattern-matched optimization such as gemm and may not get removed by other LLVM passes after code generation.

Diff Detail

Repository
rL LLVM

Event Timeline

Meinersbur created this revision.May 12 2017, 11:28 AM
grosser accepted this revision.May 13 2017, 2:53 AM

L:GTM

lib/Transform/Simplify.cpp
87 ↗(On Diff #98807)

Formatting is broken.

269 ↗(On Diff #98807)

There

282 ↗(On Diff #98807)

overwrite

285 ↗(On Diff #98807)

"a region statement" or "region statements"

This revision is now accepted and ready to land.May 13 2017, 2:53 AM

Btw, this improves the gemm performance nicely from 4s to 1.3 seconds, which matches the results we obtain without pattern matching based opts.

This revision was automatically updated to reflect the committed changes.
Meinersbur marked 4 inline comments as done.