1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/test/Transforms/SimplifyCFG/convergent.ll
Roman Lebedev 495950222a [NFCI][SimplifyCFG] Mark all the SimplifyCFG tests that already don't invalidate DomTree as such
First step after e1133179587dd895962a2fe4d6eb0cb1e63b5ee2,
in these tests, DomTree is valid afterwards, so mark them as such,
so that they don't regress.

In further steps, SimplifyCFG transforms shall taught to preserve DomTree,
in as small steps as possible.
2020-12-17 01:03:49 +03:00

43 lines
1.1 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
; RUN: opt -S -passes=simplify-cfg < %s | FileCheck %s
declare void @foo() convergent
define i32 @test_01(i32 %a) {
; CHECK-LABEL: @test_01(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[A:%.*]], 0
; CHECK-NEXT: br i1 [[COND]], label [[MERGE:%.*]], label [[IF_FALSE:%.*]]
; CHECK: if.false:
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[MERGE]]
; CHECK: merge:
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br i1 [[COND]], label [[EXIT:%.*]], label [[IF_FALSE_2:%.*]]
; CHECK: if.false.2:
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
; CHECK-NEXT: ret i32 [[A]]
;
entry:
%cond = icmp eq i32 %a, 0
br i1 %cond, label %merge, label %if.false
if.false:
call void @foo()
br label %merge
merge:
call void @foo()
br i1 %cond, label %exit, label %if.false.2
if.false.2:
call void @foo()
br label %exit
exit:
ret i32 %a
}