]> granicus.if.org Git - llvm/commit
[InstCombine] Make sure AddReachableCodeToWorklist sets MadeIRChange
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 19 Jun 2017 18:00:27 +0000 (18:00 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 19 Jun 2017 18:00:27 +0000 (18:00 +0000)
commit763224da2b02af5b8a6bdfdda79867386a39a347
tree016e196049e0f35af1b7d961a64b610ccd8522bf
parent08030e76839ecf0bb43f4475c6a285f847c4f770
[InstCombine] Make sure AddReachableCodeToWorklist sets MadeIRChange

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.

Reviewers: sanjoy, craig.topper, dblaikie

Reviewed By: craig.topper

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34346

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305725 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstructionCombining.cpp
test/Transforms/InstCombine/early_constfold_changes_IR.ll [new file with mode: 0644]
test/Transforms/InstCombine/early_dce_clobbers_callgraph.ll [new file with mode: 0644]