This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Make sure AddReachableCodeToWorklist sets MadeIRChange
ClosedPublic

Authored by bjope on Jun 19 2017, 4:45 AM.

Details

Summary

Some optimizations in AddReachableCodeToWorklist did not update
the MadeIRChange state. This could happen both when removing
trivially dead instructions (DCE) and at constant folds.

It is essential that changes to the IR is reported correctly,
since for example InstCombinePass::run() will indicate that all
analyses are preserved otherwise.
And the CGPassManager determines if the CallGraph is up-to-date
based on status from InstructionCombiningPass::runOnFunction().

The new test case early_dce_clobbers_callgraph.ll is a reproducer
for some asserts that started to trigger after changes in the
inliner in r305245. With this patch the test case passes again.

Diff Detail

Repository
rL LLVM

Event Timeline

bjope created this revision.Jun 19 2017, 4:45 AM
This revision is now accepted and ready to land.Jun 19 2017, 10:10 AM
This revision was automatically updated to reflect the committed changes.