#66771 introduce `llvm::post_order(&r.front())` which is equal to `r.front().getSuccessor(...)`. It will visit the succ block of current block. But actually here need to visit all block of region in reverse order. Fixes: #77420.
22 lines
349 B
MLIR
22 lines
349 B
MLIR
// RUN: mlir-opt --canonicalize %s | FileCheck %s
|
|
|
|
|
|
module {
|
|
|
|
// CHECK: func.func @f() {
|
|
// CHECK-NEXT: return
|
|
// CHECK-NEXT: }
|
|
func.func @f() {
|
|
return
|
|
^bb1: // no predecessors
|
|
omp.parallel {
|
|
%0 = llvm.intr.stacksave : !llvm.ptr
|
|
llvm.br ^bb1
|
|
^bb1: // pred: ^bb0
|
|
omp.terminator
|
|
}
|
|
return
|
|
}
|
|
|
|
}
|