[llvm] r364565 - [ARM] Move low overhead loop codegen tests into a separate file. NFC
David Green via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 27 09:56:42 PDT 2019
Author: dmgreen
Date: Thu Jun 27 09:56:41 2019
New Revision: 364565
URL: http://llvm.org/viewvc/llvm-project?rev=364565&view=rev
Log:
[ARM] Move low overhead loop codegen tests into a separate file. NFC
Added:
llvm/trunk/test/Transforms/HardwareLoops/ARM/calls-codegen.ll
Modified:
llvm/trunk/test/Transforms/HardwareLoops/ARM/calls.ll
Added: llvm/trunk/test/Transforms/HardwareLoops/ARM/calls-codegen.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/HardwareLoops/ARM/calls-codegen.ll?rev=364565&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/HardwareLoops/ARM/calls-codegen.ll (added)
+++ llvm/trunk/test/Transforms/HardwareLoops/ARM/calls-codegen.ll Thu Jun 27 09:56:41 2019
@@ -0,0 +1,58 @@
+; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+lob,+mve.fp -disable-arm-loloops=false %s -o - | FileCheck %s
+
+; CHECK-LABEL: test_target_specific:
+; CHECK: mov.w lr, #50
+; CHECK: dls lr, lr
+; CHECK-NOT: mov lr,
+; CHECK: [[LOOP_HEADER:\.LBB[0-9_]+]]:
+; CHECK: le lr, [[LOOP_HEADER]]
+; CHECK-NOT: b .
+; CHECK: @ %exit
+
+define i32 @test_target_specific(i32* %a, i32* %b) {
+entry:
+ br label %loop
+loop:
+ %acc = phi i32 [ 0, %entry ], [ %res, %loop ]
+ %count = phi i32 [ 0, %entry ], [ %count.next, %loop ]
+ %addr.a = getelementptr i32, i32* %a, i32 %count
+ %addr.b = getelementptr i32, i32* %b, i32 %count
+ %load.a = load i32, i32* %addr.a
+ %load.b = load i32, i32* %addr.b
+ %res = call i32 @llvm.arm.smlad(i32 %load.a, i32 %load.b, i32 %acc)
+ %count.next = add nuw i32 %count, 2
+ %cmp = icmp ne i32 %count.next, 100
+ br i1 %cmp, label %loop, label %exit
+exit:
+ ret i32 %res
+}
+
+; CHECK-LABEL: test_fabs:
+; CHECK: mov.w lr, #100
+; CHECK: dls lr, lr
+; CHECK-NOT: mov lr,
+; CHECK: [[LOOP_HEADER:\.LBB[0-9_]+]]:
+; CHECK-NOT: bl
+; CHECK: le lr, [[LOOP_HEADER]]
+; CHECK-NOT: b .
+; CHECK: @ %exit
+
+define float @test_fabs(float* %a) {
+entry:
+ br label %loop
+loop:
+ %acc = phi float [ 0.0, %entry ], [ %res, %loop ]
+ %count = phi i32 [ 0, %entry ], [ %count.next, %loop ]
+ %addr.a = getelementptr float, float* %a, i32 %count
+ %load.a = load float, float* %addr.a
+ %abs = call float @llvm.fabs.f32(float %load.a)
+ %res = fadd float %abs, %acc
+ %count.next = add nuw i32 %count, 1
+ %cmp = icmp ne i32 %count.next, 100
+ br i1 %cmp, label %loop, label %exit
+exit:
+ ret float %res
+}
+
+declare i32 @llvm.arm.smlad(i32, i32, i32)
+declare float @llvm.fabs.f32(float)
Modified: llvm/trunk/test/Transforms/HardwareLoops/ARM/calls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/HardwareLoops/ARM/calls.ll?rev=364565&r1=364564&r2=364565&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/HardwareLoops/ARM/calls.ll (original)
+++ llvm/trunk/test/Transforms/HardwareLoops/ARM/calls.ll Thu Jun 27 09:56:41 2019
@@ -3,7 +3,6 @@
; RUN: opt -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+fp-armv8,+fullfp16 -hardware-loops -disable-arm-loloops=false %s -S -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-FP64
; RUN: opt -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve -hardware-loops -disable-arm-loloops=false %s -S -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-MVE
; RUN: opt -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve.fp -hardware-loops -disable-arm-loloops=false %s -S -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-MVEFP
-; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+lob,+mve.fp -disable-arm-loloops=false %s -o - | FileCheck %s --check-prefix=CHECK-LLC
; CHECK-LABEL: skip_call
; CHECK-NOT: call void @llvm.set.loop.iterations
@@ -41,15 +40,6 @@ while.end:
; CHECK: [[CMP:%[^ ]+]] = icmp ne i32 [[LOOP_DEC]], 0
; CHECK: br i1 [[CMP]], label %loop, label %exit
-; CHECK-LLC-LABEL: test_target_specific:
-; CHECK-LLC: mov.w lr, #50
-; CHECK-LLC: dls lr, lr
-; CHECK-LLC-NOT: mov lr,
-; CHECK-LLC: [[LOOP_HEADER:\.LBB[0-9_]+]]:
-; CHECK-LLC: le lr, [[LOOP_HEADER]]
-; CHECK-LLC-NOT: b .
-; CHECK-LLC: @ %exit
-
define i32 @test_target_specific(i32* %a, i32* %b) {
entry:
br label %loop
@@ -96,16 +86,6 @@ exit:
; CHECK-FP: call void @llvm.set.loop.iterations.i32(i32 100)
; CHECK-MVEFP: call void @llvm.set.loop.iterations.i32(i32 100)
-; CHECK-LLC-LABEL: test_fabs:
-; CHECK-LLC: mov.w lr, #100
-; CHECK-LLC: dls lr, lr
-; CHECK-LLC-NOT: mov lr,
-; CHECK-LLC: [[LOOP_HEADER:\.LBB[0-9_]+]]:
-; CHECK-LLC-NOT: bl
-; CHECK-LLC: le lr, [[LOOP_HEADER]]
-; CHECK-LLC-NOT: b .
-; CHECK-LLC: @ %exit
-
define float @test_fabs(float* %a) {
entry:
br label %loop
More information about the llvm-commits
mailing list