brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 6478f5a Raw
74 lines · plain
1; RUN: llc < %s -mtriple=aarch64-linux-gnuabi -O2 -tail-dup-placement=0 | FileCheck %s2; -tail-dup-placement causes tail duplication during layout. This breaks the3; assumptions of the test case as written (specifically, it creates an4; additional cmp instruction, creating a false positive), so we pass5; -tail-dup-placement=0 to restore the original behavior6 7; marked as external to prevent possible optimizations8@a = external global i329@b = external global i3210@c = external global i3211@d = external global i3212@e = external global i3213 14define i32 @combine-sign-comparisons-by-cse(ptr %arg) {15; CHECK: cmp16; CHECK: b.ge17; CHECK-NOT: cmp18; CHECK: b.le19 20entry:21  %a = load i32, ptr @a, align 422  %b = load i32, ptr @b, align 423  %c = load i32, ptr @c, align 424  %d = load i32, ptr @d, align 425  %e = load i32, ptr @e, align 426 27  %cmp = icmp slt i32 %a, %e28  br i1 %cmp, label %land.lhs.true, label %lor.lhs.false29 30land.lhs.true:31  %cmp1 = icmp eq i32 %b, %c32  br i1 %cmp1, label %return, label %if.end33 34lor.lhs.false:35  %cmp2 = icmp sgt i32 %a, %e36  br i1 %cmp2, label %land.lhs.true3, label %if.end37 38land.lhs.true3:39  %cmp4 = icmp eq i32 %b, %d40  br i1 %cmp4, label %return, label %if.end41 42if.end:43  br label %return44 45return:46  %retval.0 = phi i32 [ 0, %if.end ], [ 1, %land.lhs.true3 ], [ 1, %land.lhs.true ]47  store i32 %a, ptr %arg48  ret i32 %retval.049}50 51define void @combine_vector_zeros(ptr %p, ptr %q) {52; CHECK-LABEL: combine_vector_zeros:53; CHECK: movi v[[REG:[0-9]+]].2d, #054; CHECK-NOT: movi55; CHECK: str d[[REG]], [x0]56; CHECK: str q[[REG]], [x1]57entry:58  store <8 x i8> zeroinitializer, ptr %p59  store <16 x i8> zeroinitializer, ptr %q60  ret void61}62 63define void @combine_vector_ones(ptr %p, ptr %q) {64; CHECK-LABEL: combine_vector_ones:65; CHECK: movi v[[REG:[0-9]+]].2d, #0xffffffffffffffff66; CHECK-NOT: movi67; CHECK: str d[[REG]], [x0]68; CHECK: str q[[REG]], [x1]69entry:70  store <2 x i32> <i32 -1, i32 -1>, ptr %p71  store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, ptr %q72  ret void73}74