This is an archive of the discontinued LLVM Phabricator instance.

[SROA] Correctly invalidate analyses when dead instructions deleted
ClosedPublic

Authored by tejohnson on Nov 10 2017, 1:29 PM.

Details

Summary

SROA can fail in rewriting alloca but still rewrite a phi resulting
in dead instruction elimination. The Changed flag was not being set
correctly, resulting in downstream passes using stale analyses.
The included test case will assert during the second BDCE pass as a
result.

Diff Detail

Repository
rL LLVM

Event Timeline

tejohnson created this revision.Nov 10 2017, 1:29 PM
davide added a subscriber: davide.Nov 20 2017, 8:05 AM

This is correct but please simplify the testcase :) [I don't think you need branch weight metadata]

tejohnson updated this revision to Diff 123611.Nov 20 2017, 9:54 AM

Simplify the test case as much as possible

davide accepted this revision.Nov 20 2017, 9:59 AM

LGTM

test/Transforms/SROA/dead-inst.ll
14–15 ↗(On Diff #123611)

you don't need these two.

This revision is now accepted and ready to land.Nov 20 2017, 9:59 AM
tejohnson marked an inline comment as done.Nov 20 2017, 10:33 AM

Remove ModuleID and source_filename

This revision was automatically updated to reflect the committed changes.