diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp --- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp +++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp @@ -1013,7 +1013,7 @@ DA = nullptr; - if (SkipUniformRegions) { + if (SkipUniformRegions && !skipRegion(*R)) { // TODO: We could probably be smarter here with how we handle sub-regions. // We currently rely on the fact that metadata is set by earlier invocations // of the pass on sub-regions, and that this metadata doesn't get lost --