[PATCH] D109917: [InstCombine] Improve TryToSink for side-effecting calls that would be trivially dead
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 1 11:36:40 PST 2021
nikic requested changes to this revision.
nikic added inline comments.
This revision now requires changes to proceed.
================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3736
+ if (!wouldInstructionBeTriviallyDeadOnUnusedPaths(I, &TLI))
+ return false;
+ for (BasicBlock::iterator Scan = std::next(I->getIterator()),
----------------
Comparing with the previous code block, the `DestBlock->getUniquePredecessor() != I->getParent()` check is missing. With an unreachable/return terminator, there may be intervening blocks. Please add a test for this.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109917/new/
https://reviews.llvm.org/D109917
More information about the llvm-commits
mailing list