xref: /llvm-project/llvm/test/CodeGen/ARM/ldrd_ifcvt.ll (revision bed1c7f061aa12417aa081e334afdba45767b938)
1; RUN: llc -mtriple=armv7a-none-eabi %s -o -  -verify-machineinstrs | FileCheck %s
2; RUN: llc -mtriple=thumbv7a-none-eabi %s -o -  -verify-machineinstrs | FileCheck %s
3; RUN: llc -mtriple=thumbv7m-none-eabi %s -o -  -verify-machineinstrs | FileCheck %s
4
5; Check we do not hit verifier errors from ifcvting volatile ldrd's
6; CHECK: ldrdne
7; CHECK: ldrdne
8; CHECK: ldrdne
9; CHECK: ldrdne
10
11define void @c(ptr %b) noreturn nounwind {
12entry:
13  br label %for.cond
14
15for.cond:                                         ; preds = %land.end.3, %entry
16  %a.0 = phi i32 [ 0, %entry ], [ %conv2.3, %land.end.3 ]
17  %tobool.not = icmp eq i32 %a.0, 0
18  br i1 %tobool.not, label %land.end, label %land.rhs
19
20land.rhs:                                         ; preds = %for.cond
21  %0 = load volatile i64, ptr %b, align 8
22  br label %land.end
23
24land.end:                                         ; preds = %land.rhs, %for.cond
25  %sub.i = add nuw nsw i32 %a.0, 65533
26  %conv2 = and i32 %sub.i, 65535
27  %tobool.not.1 = icmp eq i32 %conv2, 0
28  br i1 %tobool.not.1, label %land.end.1, label %land.rhs.1
29
30land.rhs.1:                                       ; preds = %land.end
31  %1 = load volatile i64, ptr %b, align 8
32  br label %land.end.1
33
34land.end.1:                                       ; preds = %land.rhs.1, %land.end
35  %sub.i.1 = add nuw nsw i32 %a.0, 65530
36  %conv2.1 = and i32 %sub.i.1, 65535
37  %tobool.not.2 = icmp eq i32 %conv2.1, 0
38  br i1 %tobool.not.2, label %land.end.2, label %land.rhs.2
39
40land.rhs.2:                                       ; preds = %land.end.1
41  %2 = load volatile i64, ptr %b, align 8
42  br label %land.end.2
43
44land.end.2:                                       ; preds = %land.rhs.2, %land.end.1
45  %sub.i.2 = add nuw nsw i32 %a.0, 65527
46  %conv2.2 = and i32 %sub.i.2, 65535
47  %tobool.not.3 = icmp eq i32 %conv2.2, 0
48  br i1 %tobool.not.3, label %land.end.3, label %land.rhs.3
49
50land.rhs.3:                                       ; preds = %land.end.2
51  %3 = load volatile i64, ptr %b, align 8
52  br label %land.end.3
53
54land.end.3:                                       ; preds = %land.rhs.3, %land.end.2
55  %sub.i.3 = add nuw nsw i32 %a.0, 65524
56  %conv2.3 = and i32 %sub.i.3, 65535
57  br label %for.cond
58}
59