llvm-project/llvm/test/Transforms/ConstantHoisting/AArch64
Bjorn Pettersson 89e3bb4502 [ConstantHoisting] Ignore unreachable bb:s when collecting candidates
Summary:
Ignore looking at blocks that are unreachable from entry when
collecting candidates for hosting.

Normally the consthoist pass is executed in the llc pipeline,
just after unreachableblockelim. So it is abnormal to have code
that is unreachable from the entry block. But when running the
pass as part of opt, for example as part of fuzzy testing, we
might trigger various kinds of asserts when collecting candidates
if we include unreachable blocks in that analysis.

It seems like a waste of time to hoist constants in unreachble
blocks, so the solution is to simply ignore such blocks when
collecting the hoisting candidates.

The two added test cases used to end up in two different asserts,
and the intention with the checks is just to verify that we no
longer fail.

Fixes: PR43903

Reviewers: spatel

Reviewed By: spatel

Subscribers: hiraditya, uabelho, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71678
2019-12-19 15:07:55 +01:00
..
const-addr.ll
const-hoist-gep.ll
const-hoist-intrinsics.ll [AArch64TTI] Compute imm materialization cost for AArch64 intrinsics 2019-12-04 11:09:03 +00:00
consthoist-unreachable.ll [ConstantHoisting] Ignore unreachable bb:s when collecting candidates 2019-12-19 15:07:55 +01:00
large-immediate.ll
lit.local.cfg