[all-commits] [llvm/llvm-project] 481005: [Inline][Cloning] Reliably remove unreachable bloc...
Nikita Popov via All-commits
all-commits at lists.llvm.org
Mon Jan 31 00:33:32 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4810051a828c4e0bc6a7d11ee5da1a40b3fc32f9
https://github.com/llvm/llvm-project/commit/4810051a828c4e0bc6a7d11ee5da1a40b3fc32f9
Author: Nikita Popov <npopov at redhat.com>
Date: 2022-01-31 (Mon, 31 Jan 2022)
Changed paths:
M llvm/lib/Transforms/Utils/CloneFunction.cpp
A llvm/test/Transforms/Inline/pr53206.ll
Log Message:
-----------
[Inline][Cloning] Reliably remove unreachable blocks during cloning (PR53206)
The pruning cloner already tries to remove unreachable blocks. The
original cloning process will simplify instructions and constant
terminators, and only clone blocks that are reachable at that point.
However, phi nodes can only be simplified after everything has been
cloned. For that reason, additional blocks may become unreachable
after phi simplification.
The code does try to handle this as well, but only removes blocks
that don't have predecessors. It misses unreachable cycles. This
can cause issues if SEH exception handling code is part of an
unreachable cycle, as the inliner is not prepared to deal with that.
This patch instead performs an explicit scan for reachable blocks,
and drops everything else.
Fixes https://github.com/llvm/llvm-project/issues/53206.
Differential Revision: https://reviews.llvm.org/D118449
More information about the All-commits
mailing list