This is an archive of the discontinued LLVM Phabricator instance.

[EarlyCSEwMemorySSA] Add MSSA verification and tests to make EarlyCSE failures easier to track.
ClosedPublic

Authored by asbirlea on Sep 11 2018, 4:45 PM.

Details

Summary

EarlyCSE can make IR changes that will leave MemorySSA with accesses claiming to be optimized, but for which a subsequent MemorySSA run will yield a different optimized result.
Due to relying on AA queries, we can't fix this in general, unless we recompute MemorySSA.
Adding some tests to track this and a basic verify for future potential failures.

Diff Detail

Event Timeline

asbirlea created this revision.Sep 11 2018, 4:45 PM

LGTM, modulo one nit. Thanks!

test/Transforms/EarlyCSE/preserve_memoryssa.ll
2

Can we disable this if asserts are off, since verifyMemorySSA() will do nothing without asserts?

Looks like ; REQUIRES: asserts might be what we want, but I've never used it myself.

This revision is now accepted and ready to land.Sep 12 2018, 10:32 AM
asbirlea updated this revision to Diff 165839.Sep 17 2018, 3:10 PM
asbirlea marked an inline comment as done.

Thank you for the review!

This revision was automatically updated to reflect the committed changes.