[ARM] More MVE load/store tests for offsets around the negative limit. NFC
[llvm-core.git] / test / CodeGen / Thumb2 / ifcvt-rescan-diamonds.ll
blobb7ba741b2498351e6823bc7bce2543eaa867f81d
1 ; RUN: llc -O2 -o - %s | FileCheck %s
2 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
3 target triple = "thumbv8-unknown-linux-gnueabihf"
5 ; This is a tricky test case.
6 ; The point of it is to create a diamond where both the true block and the
7 ; false block clobber the predicate when viewed as a whole, but only one of them
8 ; clobbers the predicate when considering the instructions they share.
10 ; Function Attrs: nounwind
11 define void @BN_kronecker(i1 %a, i32 %b) #0 {
12 entry:
13   br label %while.cond38
15 while.cond38:                                     ; preds = %if.end111, %entry
16   %cmp79 = icmp eq i32 0, 0
17   br i1 %a, label %cond.true77, label %cond.false87
19 ; CHECK: %cond.true77
20 ; CHECK-NEXT: @ in Loop
21 ; CHECK-NEXT: cmp.w {{r[0-9]+}}, #0
22 ; CHECK-NEXT: it eq
23 ; CHECK-NEXT: ldreq
24 ; CHECK-NEXT: it ne
25 ; CHECK-NEXT: movsne
26 ; CHECK-NEXT: mvns
27 ; CHECK-NEXT: b
28 cond.true77:                                      ; preds = %while.cond38
29   br i1 %cmp79, label %cond.end84, label %cond.false81
31 cond.false81:                                     ; preds = %cond.true77
32   %0 = load i32, i32* null, align 4
33   br label %cond.end84
35 cond.end84:                                       ; preds = %cond.false81, %cond.true77
36   %cond85 = phi i32 [ %0, %cond.false81 ], [ 0, %cond.true77 ]
37   %neg86 = xor i32 %cond85, -1
38   br label %cond.false101
40 cond.false87:                                     ; preds = %while.cond38
41   br i1 %cmp79, label %cond.false101, label %cond.false91
43 cond.false91:                                     ; preds = %cond.false87
44   br label %cond.false101
46 cond.false101:                                    ; preds = %cond.false91, %cond.false87, %cond.end84
47   %cond97 = phi i32 [ %neg86, %cond.end84 ], [ %b, %cond.false91 ], [ 0, %cond.false87 ]
48   %1 = load i32, i32* null, align 4
49   %and106 = and i32 %cond97, %1
50   %and107 = and i32 %and106, 2
51   %tobool108 = icmp ne i32 %and107, 0
52   br i1 %tobool108, label %if.then109, label %if.end111
54 if.then109:                                       ; preds = %cond.false101
55   store i32 0, i32* undef, align 4
56   br label %if.end111
58 if.end111:                                        ; preds = %if.then109, %cond.false101
59   %tobool113 = icmp ne i32 0, 0
60   br i1 %tobool113, label %while.cond38, label %end
62 end:                                              ; preds = %if.end111
63   ret void
66 attributes #0 = { nounwind }