1 ; RUN: llc < %s -mtriple=aarch64-linux-gnuabi -O2 -tail-dup-placement=0 | FileCheck %s
2 ; -tail-dup-placement causes tail duplication during layout. This breaks the
3 ; assumptions of the test case as written (specifically, it creates an
4 ; additional cmp instruction, creating a false positive), so we pass
5 ; -tail-dup-placement=0 to restore the original behavior
7 ; marked as external to prevent possible optimizations
8 @a = external global i32
9 @b = external global i32
10 @c = external global i32
11 @d = external global i32
12 @e = external global i32
14 define i32 @combine-sign-comparisons-by-cse(ptr %arg) {
21 %a = load i32, ptr @a, align 4
22 %b = load i32, ptr @b, align 4
23 %c = load i32, ptr @c, align 4
24 %d = load i32, ptr @d, align 4
25 %e = load i32, ptr @e, align 4
27 %cmp = icmp slt i32 %a, %e
28 br i1 %cmp, label %land.lhs.true, label %lor.lhs.false
31 %cmp1 = icmp eq i32 %b, %c
32 br i1 %cmp1, label %return, label %if.end
35 %cmp2 = icmp sgt i32 %a, %e
36 br i1 %cmp2, label %land.lhs.true3, label %if.end
39 %cmp4 = icmp eq i32 %b, %d
40 br i1 %cmp4, label %return, label %if.end
46 %retval.0 = phi i32 [ 0, %if.end ], [ 1, %land.lhs.true3 ], [ 1, %land.lhs.true ]
47 store i32 %a, ptr %arg
51 define void @combine_vector_zeros(ptr %p, ptr %q) {
52 ; CHECK-LABEL: combine_vector_zeros:
53 ; CHECK: movi v[[REG:[0-9]+]].2d, #0
55 ; CHECK: str d[[REG]], [x0]
56 ; CHECK: str q[[REG]], [x1]
58 store <8 x i8> zeroinitializer, ptr %p
59 store <16 x i8> zeroinitializer, ptr %q
63 define void @combine_vector_ones(ptr %p, ptr %q) {
64 ; CHECK-LABEL: combine_vector_ones:
65 ; CHECK: movi v[[REG:[0-9]+]].2d, #0xffffffffffffffff
67 ; CHECK: str d[[REG]], [x0]
68 ; CHECK: str q[[REG]], [x1]
70 store <2 x i32> <i32 -1, i32 -1>, ptr %p
71 store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, ptr %q