[llvm] 5f4927d - [PowerPC][NFC] refactor some test cases.
Chen Zheng via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 12 05:20:03 PDT 2022
Author: Chen Zheng
Date: 2022-10-12T12:19:52Z
New Revision: 5f4927da770f8214639773cd50e16ddcce9482de
URL: https://github.com/llvm/llvm-project/commit/5f4927da770f8214639773cd50e16ddcce9482de
DIFF: https://github.com/llvm/llvm-project/commit/5f4927da770f8214639773cd50e16ddcce9482de.diff
LOG: [PowerPC][NFC] refactor some test cases.
Added:
Modified:
llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
llvm/test/CodeGen/PowerPC/ctrloop-sh.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll b/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
index 48ad85ab5dd72..de0441f279971 100644
--- a/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
+++ b/llvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
@@ -1,7 +1,5 @@
-; RUN: llc < %s -verify-machineinstrs -stop-after=hardware-loops -mcpu=pwr9 \
-; RUN: -mtriple=powerpc64le-unknown-unknown | FileCheck %s
-; RUN: llc < %s -verify-machineinstrs -stop-after=hardware-loops -mcpu=pwr8 \
-; RUN: -mtriple=powerpc64le-unknown-unknown | FileCheck %s
+; RUN: llc < %s -verify-machineinstrs -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown | FileCheck %s
+; RUN: llc < %s -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown | FileCheck %s
@a = internal global fp128 0xL00000000000000000000000000000000, align 16
@x = internal global [4 x fp128] zeroinitializer, align 16
@@ -27,8 +25,7 @@ for.end: ; preds = %for.body
ret void
; CHECK-LABEL: fmul_ctrloop_fp128
-; CHECK-NOT: call void @llvm.set.loop.iterations.i64(i64 4)
-; CHECK-NOT: call i1 @llvm.loop.decrement.i64(i64 1)
+; CHECK-NOT: mtctr
}
define void @fpext_ctrloop_fp128(ptr %a) {
@@ -50,8 +47,7 @@ for.end:
ret void
; CHECK-LABEL: fpext_ctrloop_fp128
-; CHECK-NOT: call void @llvm.set.loop.iterations.i64(i64 4)
-; CHECK-NOT: call i1 @llvm.loop.decrement.i64(i64 1)
+; CHECK-NOT: mtctr
}
define void @fptrunc_ctrloop_fp128(ptr %a) {
@@ -73,8 +69,7 @@ for.end:
ret void
; CHECK-LABEL: fptrunc_ctrloop_fp128
-; CHECK-NOT: call void @llvm.set.loop.iterations.i64(i64 4)
-; CHECK-NOT: call i1 @llvm.loop.decrement.i64(i64 1)
+; CHECK-NOT: mtctr
}
declare void @obfuscate(ptr, ...) local_unnamed_addr #2
diff --git a/llvm/test/CodeGen/PowerPC/ctrloop-sh.ll b/llvm/test/CodeGen/PowerPC/ctrloop-sh.ll
index 93d5dfa068f75..822cdecae7b2d 100644
--- a/llvm/test/CodeGen/PowerPC/ctrloop-sh.ll
+++ b/llvm/test/CodeGen/PowerPC/ctrloop-sh.ll
@@ -1,9 +1,105 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs < %s | FileCheck %s
target datalayout = "E-m:e-p:32:32-i128:64-n32"
target triple = "powerpc-ellcc-linux"
; Function Attrs: nounwind
define void @foo1(ptr %a, ptr readonly %b, ptr readonly %c) #0 {
+; CHECK-LABEL: foo1:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: stwu 1, -48(1)
+; CHECK-NEXT: li 6, 2048
+; CHECK-NEXT: li 7, 0
+; CHECK-NEXT: stw 24, 16(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 25, 20(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 26, 24(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 27, 28(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 28, 32(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 29, 36(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 30, 40(1) # 4-byte Folded Spill
+; CHECK-NEXT: .LBB0_1: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: lwz 10, 12(5)
+; CHECK-NEXT: addi 6, 6, -1
+; CHECK-NEXT: lwz 12, 12(4)
+; CHECK-NEXT: lwz 11, 8(4)
+; CHECK-NEXT: subfic 0, 10, 96
+; CHECK-NEXT: lwz 8, 4(4)
+; CHECK-NEXT: addi 30, 10, -64
+; CHECK-NEXT: lwz 9, 0(4)
+; CHECK-NEXT: cmplwi 10, 64
+; CHECK-NEXT: slw 25, 12, 10
+; CHECK-NEXT: addi 29, 10, -96
+; CHECK-NEXT: subfic 27, 10, 32
+; CHECK-NEXT: srw 0, 12, 0
+; CHECK-NEXT: slw 24, 11, 30
+; CHECK-NEXT: bc 12, 0, .LBB0_3
+; CHECK-NEXT: # %bb.2: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 25, 7, 0
+; CHECK-NEXT: b .LBB0_3
+; CHECK-NEXT: .LBB0_3: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: slw 28, 9, 10
+; CHECK-NEXT: or 0, 24, 0
+; CHECK-NEXT: srw 24, 8, 27
+; CHECK-NEXT: stw 25, 12(3)
+; CHECK-NEXT: subfic 25, 10, 64
+; CHECK-NEXT: slw 29, 12, 29
+; CHECK-NEXT: slw 26, 11, 10
+; CHECK-NEXT: or 28, 28, 24
+; CHECK-NEXT: srw 24, 12, 27
+; CHECK-NEXT: or 29, 0, 29
+; CHECK-NEXT: subfic 0, 25, 32
+; CHECK-NEXT: or 26, 26, 24
+; CHECK-NEXT: addi 24, 10, -32
+; CHECK-NEXT: srw 27, 11, 27
+; CHECK-NEXT: slw 0, 11, 0
+; CHECK-NEXT: srw 11, 11, 25
+; CHECK-NEXT: srw 25, 12, 25
+; CHECK-NEXT: slw 30, 12, 30
+; CHECK-NEXT: slw 12, 12, 24
+; CHECK-NEXT: slw 24, 8, 24
+; CHECK-NEXT: or 0, 25, 0
+; CHECK-NEXT: or 28, 28, 24
+; CHECK-NEXT: cmplwi 1, 10, 0
+; CHECK-NEXT: slw 10, 8, 10
+; CHECK-NEXT: or 0, 0, 27
+; CHECK-NEXT: or 11, 28, 11
+; CHECK-NEXT: or 10, 10, 0
+; CHECK-NEXT: or 12, 26, 12
+; CHECK-NEXT: bc 12, 0, .LBB0_5
+; CHECK-NEXT: # %bb.4: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 11, 29, 0
+; CHECK-NEXT: ori 10, 30, 0
+; CHECK-NEXT: ori 12, 7, 0
+; CHECK-NEXT: b .LBB0_5
+; CHECK-NEXT: .LBB0_5: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: cmplwi 6, 0
+; CHECK-NEXT: bc 12, 6, .LBB0_7
+; CHECK-NEXT: # %bb.6: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 9, 11, 0
+; CHECK-NEXT: ori 8, 10, 0
+; CHECK-NEXT: b .LBB0_7
+; CHECK-NEXT: .LBB0_7: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: stw 12, 8(3)
+; CHECK-NEXT: stw 9, 0(3)
+; CHECK-NEXT: stw 8, 4(3)
+; CHECK-NEXT: bne 0, .LBB0_1
+; CHECK-NEXT: # %bb.8: # %for.end
+; CHECK-NEXT: lwz 30, 40(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 29, 36(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 28, 32(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 27, 28(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 26, 24(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 25, 20(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 24, 16(1) # 4-byte Folded Reload
+; CHECK-NEXT: addi 1, 1, 48
+; CHECK-NEXT: blr
entry:
br label %for.body
@@ -19,13 +115,121 @@ for.body: ; preds = %for.body, %entry
for.end: ; preds = %for.body
ret void
-
-; CHECK-LABEL: @foo1
-; CHECK-NOT: mtctr
}
; Function Attrs: nounwind
define void @foo2(ptr %a, ptr readonly %b, ptr readonly %c) #0 {
+; CHECK-LABEL: foo2:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: stwu 1, -48(1)
+; CHECK-NEXT: li 6, 2048
+; CHECK-NEXT: stw 23, 12(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 24, 16(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 25, 20(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 26, 24(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 27, 28(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 28, 32(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 29, 36(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 30, 40(1) # 4-byte Folded Spill
+; CHECK-NEXT: .LBB1_1: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: lwz 9, 12(5)
+; CHECK-NEXT: addi 6, 6, -1
+; CHECK-NEXT: lwz 10, 4(4)
+; CHECK-NEXT: lwz 11, 0(4)
+; CHECK-NEXT: subfic 12, 9, 96
+; CHECK-NEXT: lwz 7, 8(4)
+; CHECK-NEXT: addi 0, 9, -64
+; CHECK-NEXT: lwz 8, 12(4)
+; CHECK-NEXT: subfic 28, 9, 32
+; CHECK-NEXT: slw 12, 11, 12
+; CHECK-NEXT: srw 24, 10, 0
+; CHECK-NEXT: srw 29, 8, 9
+; CHECK-NEXT: or 12, 24, 12
+; CHECK-NEXT: slw 24, 7, 28
+; CHECK-NEXT: srw 26, 10, 9
+; CHECK-NEXT: or 29, 29, 24
+; CHECK-NEXT: slw 24, 11, 28
+; CHECK-NEXT: cmplwi 9, 64
+; CHECK-NEXT: srawi 25, 11, 31
+; CHECK-NEXT: or 26, 26, 24
+; CHECK-NEXT: sraw 24, 11, 9
+; CHECK-NEXT: addi 30, 9, -96
+; CHECK-NEXT: bc 12, 0, .LBB1_3
+; CHECK-NEXT: # %bb.2: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 24, 25, 0
+; CHECK-NEXT: b .LBB1_3
+; CHECK-NEXT: .LBB1_3: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: cmpwi 1, 30, 1
+; CHECK-NEXT: sraw 30, 11, 30
+; CHECK-NEXT: stw 24, 0(3)
+; CHECK-NEXT: subfic 24, 9, 64
+; CHECK-NEXT: addi 27, 9, -32
+; CHECK-NEXT: bc 12, 4, .LBB1_5
+; CHECK-NEXT: # %bb.4: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 12, 30, 0
+; CHECK-NEXT: b .LBB1_5
+; CHECK-NEXT: .LBB1_5: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: subfic 30, 24, 32
+; CHECK-NEXT: slw 28, 10, 28
+; CHECK-NEXT: srw 30, 10, 30
+; CHECK-NEXT: slw 10, 10, 24
+; CHECK-NEXT: slw 24, 11, 24
+; CHECK-NEXT: sraw 23, 11, 0
+; CHECK-NEXT: srw 0, 7, 27
+; CHECK-NEXT: sraw 11, 11, 27
+; CHECK-NEXT: cmpwi 1, 27, 1
+; CHECK-NEXT: or 0, 29, 0
+; CHECK-NEXT: or 30, 24, 30
+; CHECK-NEXT: bc 12, 4, .LBB1_6
+; CHECK-NEXT: b .LBB1_7
+; CHECK-NEXT: .LBB1_6: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: addi 11, 26, 0
+; CHECK-NEXT: .LBB1_7: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: cmplwi 1, 9, 0
+; CHECK-NEXT: srw 9, 7, 9
+; CHECK-NEXT: or 10, 0, 10
+; CHECK-NEXT: or 0, 30, 28
+; CHECK-NEXT: or 9, 9, 0
+; CHECK-NEXT: bc 12, 0, .LBB1_9
+; CHECK-NEXT: # %bb.8: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 10, 12, 0
+; CHECK-NEXT: ori 9, 23, 0
+; CHECK-NEXT: ori 11, 25, 0
+; CHECK-NEXT: b .LBB1_9
+; CHECK-NEXT: .LBB1_9: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: cmplwi 6, 0
+; CHECK-NEXT: bc 12, 6, .LBB1_11
+; CHECK-NEXT: # %bb.10: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 8, 10, 0
+; CHECK-NEXT: ori 7, 9, 0
+; CHECK-NEXT: b .LBB1_11
+; CHECK-NEXT: .LBB1_11: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: stw 11, 4(3)
+; CHECK-NEXT: stw 8, 12(3)
+; CHECK-NEXT: stw 7, 8(3)
+; CHECK-NEXT: bne 0, .LBB1_1
+; CHECK-NEXT: # %bb.12: # %for.end
+; CHECK-NEXT: lwz 30, 40(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 29, 36(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 28, 32(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 27, 28(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 26, 24(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 25, 20(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 24, 16(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 23, 12(1) # 4-byte Folded Reload
+; CHECK-NEXT: addi 1, 1, 48
+; CHECK-NEXT: blr
entry:
br label %for.body
@@ -41,13 +245,105 @@ for.body: ; preds = %for.body, %entry
for.end: ; preds = %for.body
ret void
-
-; CHECK-LABEL: @foo2
-; CHECK-NOT: mtctr
}
; Function Attrs: nounwind
define void @foo3(ptr %a, ptr readonly %b, ptr readonly %c) #0 {
+; CHECK-LABEL: foo3:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: stwu 1, -48(1)
+; CHECK-NEXT: li 6, 2048
+; CHECK-NEXT: li 7, 0
+; CHECK-NEXT: stw 24, 16(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 25, 20(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 26, 24(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 27, 28(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 28, 32(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 29, 36(1) # 4-byte Folded Spill
+; CHECK-NEXT: stw 30, 40(1) # 4-byte Folded Spill
+; CHECK-NEXT: .LBB2_1: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: lwz 10, 12(5)
+; CHECK-NEXT: addi 6, 6, -1
+; CHECK-NEXT: lwz 12, 0(4)
+; CHECK-NEXT: lwz 11, 4(4)
+; CHECK-NEXT: subfic 0, 10, 96
+; CHECK-NEXT: lwz 8, 8(4)
+; CHECK-NEXT: addi 30, 10, -64
+; CHECK-NEXT: lwz 9, 12(4)
+; CHECK-NEXT: cmplwi 10, 64
+; CHECK-NEXT: srw 25, 12, 10
+; CHECK-NEXT: addi 29, 10, -96
+; CHECK-NEXT: subfic 27, 10, 32
+; CHECK-NEXT: slw 0, 12, 0
+; CHECK-NEXT: srw 24, 11, 30
+; CHECK-NEXT: bc 12, 0, .LBB2_3
+; CHECK-NEXT: # %bb.2: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 25, 7, 0
+; CHECK-NEXT: b .LBB2_3
+; CHECK-NEXT: .LBB2_3: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: srw 28, 9, 10
+; CHECK-NEXT: or 0, 24, 0
+; CHECK-NEXT: slw 24, 8, 27
+; CHECK-NEXT: stw 25, 0(3)
+; CHECK-NEXT: subfic 25, 10, 64
+; CHECK-NEXT: srw 29, 12, 29
+; CHECK-NEXT: srw 26, 11, 10
+; CHECK-NEXT: or 28, 28, 24
+; CHECK-NEXT: slw 24, 12, 27
+; CHECK-NEXT: or 29, 0, 29
+; CHECK-NEXT: subfic 0, 25, 32
+; CHECK-NEXT: or 26, 26, 24
+; CHECK-NEXT: addi 24, 10, -32
+; CHECK-NEXT: slw 27, 11, 27
+; CHECK-NEXT: srw 0, 11, 0
+; CHECK-NEXT: slw 11, 11, 25
+; CHECK-NEXT: slw 25, 12, 25
+; CHECK-NEXT: srw 30, 12, 30
+; CHECK-NEXT: srw 12, 12, 24
+; CHECK-NEXT: srw 24, 8, 24
+; CHECK-NEXT: or 0, 25, 0
+; CHECK-NEXT: or 28, 28, 24
+; CHECK-NEXT: cmplwi 1, 10, 0
+; CHECK-NEXT: srw 10, 8, 10
+; CHECK-NEXT: or 0, 0, 27
+; CHECK-NEXT: or 11, 28, 11
+; CHECK-NEXT: or 10, 10, 0
+; CHECK-NEXT: or 12, 26, 12
+; CHECK-NEXT: bc 12, 0, .LBB2_5
+; CHECK-NEXT: # %bb.4: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 11, 29, 0
+; CHECK-NEXT: ori 10, 30, 0
+; CHECK-NEXT: ori 12, 7, 0
+; CHECK-NEXT: b .LBB2_5
+; CHECK-NEXT: .LBB2_5: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: cmplwi 6, 0
+; CHECK-NEXT: bc 12, 6, .LBB2_7
+; CHECK-NEXT: # %bb.6: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: ori 9, 11, 0
+; CHECK-NEXT: ori 8, 10, 0
+; CHECK-NEXT: b .LBB2_7
+; CHECK-NEXT: .LBB2_7: # %for.body
+; CHECK-NEXT: #
+; CHECK-NEXT: stw 12, 4(3)
+; CHECK-NEXT: stw 9, 12(3)
+; CHECK-NEXT: stw 8, 8(3)
+; CHECK-NEXT: bne 0, .LBB2_1
+; CHECK-NEXT: # %bb.8: # %for.end
+; CHECK-NEXT: lwz 30, 40(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 29, 36(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 28, 32(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 27, 28(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 26, 24(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 25, 20(1) # 4-byte Folded Reload
+; CHECK-NEXT: lwz 24, 16(1) # 4-byte Folded Reload
+; CHECK-NEXT: addi 1, 1, 48
+; CHECK-NEXT: blr
entry:
br label %for.body
@@ -63,9 +359,6 @@ for.body: ; preds = %for.body, %entry
for.end: ; preds = %for.body
ret void
-
-; CHECK-LABEL: @foo3
-; CHECK-NOT: mtctr
}
attributes #0 = { nounwind }
More information about the llvm-commits
mailing list