xref: /llvm-project/llvm/test/CodeGen/PowerPC/ext-bool-trunc-repl.ll (revision e4a4122eb6768b69640173b4c32fd88de4547227)
1; RUN: llc -verify-machineinstrs -O0 < %s | FileCheck %s
2target datalayout = "e-m:e-i64:64-n32:64"
3target triple = "powerpc64le-unknown-linux-gnu"
4
5@c = external global i32, align 4
6@d = external global [2 x i32], align 4
7
8; Function Attrs: norecurse nounwind
9define void @fn2() #0 {
10; CHECK-LABEL: @fn2
11  br i1 undef, label %1, label %10
12
131:                                                ; preds = %0
14  br i1 undef, label %3, label %2
15
162:                                                ; preds = %2, %1
17  br i1 undef, label %3, label %2
18
193:                                                ; preds = %2, %1
20  br i1 undef, label %8, label %4
21
224:                                                ; preds = %4, %3
23  %5 = phi i64 [ %6, %4 ], [ undef, %3 ]
24  %constexpr = getelementptr inbounds [2 x i32], ptr @d, i64 0, i64 1
25  %constexpr1 = icmp eq ptr %constexpr, @c
26  %constexpr2 = zext i1 %constexpr1 to i32
27  %constexpr3 = getelementptr inbounds [2 x i32], ptr @d, i64 0, i64 1
28  %constexpr4 = icmp eq ptr %constexpr3, @c
29  %constexpr5 = zext i1 %constexpr4 to i32
30  %constexpr6 = lshr i32 %constexpr5, 6
31  %constexpr7 = getelementptr inbounds [2 x i32], ptr @d, i64 0, i64 1
32  %constexpr8 = icmp eq ptr %constexpr7, @c
33  %constexpr9 = zext i1 %constexpr8 to i16
34  %constexpr10 = icmp slt i16 %constexpr9, 0
35  %constexpr11 = select i1 %constexpr10, i32 %constexpr2, i32 %constexpr6
36  %constexpr112 = sext i32 %constexpr11 to i64
37  %constexpr213 = and i64 %constexpr112, %constexpr112
38  %constexpr314 = and i64 %constexpr213, %constexpr112
39  %constexpr415 = and i64 %constexpr314, %constexpr112
40  %constexpr516 = and i64 %constexpr415, %constexpr112
41  %constexpr617 = and i64 %constexpr516, %constexpr112
42  %constexpr718 = and i64 %constexpr617, %constexpr112
43  %constexpr819 = and i64 %constexpr718, %constexpr112
44  %6 = and i64 %5, %constexpr819
45  %7 = icmp slt i32 undef, 6
46  br i1 %7, label %4, label %8
47
488:                                                ; preds = %4, %3
49  %9 = phi i64 [ undef, %3 ], [ %6, %4 ]
50  br label %10
51
5210:                                               ; preds = %8, %0
53  ret void
54}
55
56attributes #0 = { norecurse nounwind "target-cpu"="ppc64le" }
57
58