Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / Transforms / LoopSimplifyCFG / irreducible_cfg.ll
bloba257d6bbf374b6bc7dcf7d958184861f7f258f83
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; REQUIRES: asserts
3 ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes='require<domtree>,loop(loop-simplifycfg)' -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
4 ; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes=loop-simplifycfg -verify-memoryssa -debug-only=loop-simplifycfg -verify-loop-info -verify-dom-info -verify-loop-lcssa 2>&1 < %s | FileCheck %s
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
8 ; This test has irreducible CFG, and RPO may be the following:
9 ; Header, Dead, Irreducible2, Latch, Irreducible3, Irreducible1.
10 ; As result, we will process Irreducible2 before its predecessor Irreducible1.
11 ; The current algorithm gets confused in this case. We may support irreducible
12 ; CFG in the future.
13 define void @irreducible_cfg(i1 %cond) {
14 ; CHECK-LABEL: @irreducible_cfg(
15 ; CHECK-NEXT:  entry:
16 ; CHECK-NEXT:    br label [[HEADER:%.*]]
17 ; CHECK:       header:
18 ; CHECK-NEXT:    br i1 false, label [[DEAD:%.*]], label [[IRREDUCIBLE1:%.*]]
19 ; CHECK:       dead:
20 ; CHECK-NEXT:    br label [[IRREDUCIBLE2:%.*]]
21 ; CHECK:       irreducible2:
22 ; CHECK-NEXT:    br i1 [[COND:%.*]], label [[LATCH:%.*]], label [[IRREDUCIBLE3:%.*]]
23 ; CHECK:       latch:
24 ; CHECK-NEXT:    br label [[HEADER]]
25 ; CHECK:       irreducible3:
26 ; CHECK-NEXT:    br label [[IRREDUCIBLE1]]
27 ; CHECK:       irreducible1:
28 ; CHECK-NEXT:    br label [[IRREDUCIBLE2]]
30 entry:
31   br label %header
33 header:                                             ; preds = %latch, %entry
34   br i1 false, label %dead, label %irreducible1
36 dead:                                          ; preds = %header
37   br label %irreducible2
39 irreducible2:                                             ; preds = %irreducible1, %dead
40   br i1 %cond, label %latch, label %irreducible3
42 latch:                                         ; preds = %irreducible2
43   br label %header
45 irreducible3:                                           ; preds = %irreducible2
46   br label %irreducible1
48 irreducible1:                                          ; preds = %irreducible3, %header
49   br label %irreducible2