HomePhabricator

Introduce fix-irreducible pass

Authored by sameerds on Apr 15 2020, 2:35 AM.

Description

Introduce fix-irreducible pass

An irreducible SCC is one which has multiple "header" blocks, i.e., blocks
with control-flow edges incident from outside the SCC. This pass converts an
irreducible SCC into a natural loop by introducing a single new header
block and redirecting all the edges on the original headers to this
new block.

This is a useful workaround for a limitation in the structurizer
which, which produces incorrect control flow in the presence of
irreducible regions. The AMDGPU backend provides an option to
enable this pass before the structurizer, which may eventually be
enabled by default.

Reviewed By: nhaehnle

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

This restores commit 2ada8e2525dd2653f30c8696a27162a3b1647d66.

Originally reverted with commit 44e09b59b869a91bf47d76e8bc569d9ee91ad145.

Details

Committed
sameerdsApr 15 2020, 2:35 AM
Reviewer
nhaehnle
Differential Revision
D77198: Introduce fix-irreducible pass
Parents
rG79d185c79271: [VPlan] Move Load/Store checks out of tryToWiden (NFC).
Branches
Unknown
Tags
Unknown