aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Utils.cpp
diff options
context:
space:
mode:
authorSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>2020-04-15 11:29:19 +0530
committerSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>2020-04-15 11:29:19 +0530
commit2ada8e2525dd2653f30c8696a27162a3b1647d66 (patch)
tree150f1361a967dfc22a30786b5597028a27f9e603 /llvm/lib/Transforms/Utils/Utils.cpp
parentd83541d1b8f75ff44083c8ba1dba1ca7bac330cf (diff)
downloadllvm-2ada8e2525dd2653f30c8696a27162a3b1647d66.zip
llvm-2ada8e2525dd2653f30c8696a27162a3b1647d66.tar.gz
llvm-2ada8e2525dd2653f30c8696a27162a3b1647d66.tar.bz2
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
Diffstat (limited to 'llvm/lib/Transforms/Utils/Utils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Utils.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Utils.cpp b/llvm/lib/Transforms/Utils/Utils.cpp
index 363110a..7469e38 100644
--- a/llvm/lib/Transforms/Utils/Utils.cpp
+++ b/llvm/lib/Transforms/Utils/Utils.cpp
@@ -40,6 +40,7 @@ void llvm::initializeTransformUtils(PassRegistry &Registry) {
initializeStripGCRelocatesPass(Registry);
initializePredicateInfoPrinterLegacyPassPass(Registry);
initializeInjectTLIMappingsLegacyPass(Registry);
+ initializeFixIrreduciblePass(Registry);
initializeUnifyLoopExitsPass(Registry);
}