[llvm] f7bf11c - [LoongArch] Pre-commit test for #88694. NFC
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 15 01:05:58 PDT 2024
Author: wanglei
Date: 2024-04-15T16:04:49+08:00
New Revision: f7bf11cd8db29a178463f2a12b9f1589ecab64e2
URL: https://github.com/llvm/llvm-project/commit/f7bf11cd8db29a178463f2a12b9f1589ecab64e2
DIFF: https://github.com/llvm/llvm-project/commit/f7bf11cd8db29a178463f2a12b9f1589ecab64e2.diff
LOG: [LoongArch] Pre-commit test for #88694. NFC
Added:
llvm/test/CodeGen/LoongArch/gep-imm.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/LoongArch/gep-imm.ll b/llvm/test/CodeGen/LoongArch/gep-imm.ll
new file mode 100644
index 00000000000000..52d25f9d638949
--- /dev/null
+++ b/llvm/test/CodeGen/LoongArch/gep-imm.ll
@@ -0,0 +1,52 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: llc --mtriple=loongarch64 < %s | FileCheck %s
+
+define void @test(ptr %sp, ptr %t, i32 %n) {
+; CHECK-LABEL: test:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: move $a3, $zero
+; CHECK-NEXT: ld.d $a4, $a0, 0
+; CHECK-NEXT: lu12i.w $a0, 1
+; CHECK-NEXT: ori $a5, $a0, 3904
+; CHECK-NEXT: add.d $a0, $a1, $a5
+; CHECK-NEXT: add.d $a1, $a4, $a5
+; CHECK-NEXT: addi.w $a2, $a2, 0
+; CHECK-NEXT: addi.w $a4, $a3, 0
+; CHECK-NEXT: bge $a4, $a2, .LBB0_2
+; CHECK-NEXT: .p2align 4, , 16
+; CHECK-NEXT: .LBB0_1: # %while_body
+; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
+; CHECK-NEXT: addi.d $a4, $a3, 1
+; CHECK-NEXT: st.w $a4, $a1, 0
+; CHECK-NEXT: st.w $a3, $a1, 4
+; CHECK-NEXT: st.w $a4, $a0, 0
+; CHECK-NEXT: st.w $a3, $a0, 4
+; CHECK-NEXT: move $a3, $a4
+; CHECK-NEXT: addi.w $a4, $a3, 0
+; CHECK-NEXT: blt $a4, $a2, .LBB0_1
+; CHECK-NEXT: .LBB0_2: # %while_end
+; CHECK-NEXT: ret
+entry:
+ %s = load ptr, ptr %sp
+ br label %while_cond
+
+while_cond:
+ %phi = phi i32 [ 0, %entry ], [ %i, %while_body ]
+ %gep0 = getelementptr [65536 x i32], ptr %s, i64 0, i64 2000
+ %gep1 = getelementptr [65536 x i32], ptr %s, i64 0, i64 2001
+ %gep2 = getelementptr [65536 x i32], ptr %t, i64 0, i64 2000
+ %gep3 = getelementptr [65536 x i32], ptr %t, i64 0, i64 2001
+ %cmp = icmp slt i32 %phi, %n
+ br i1 %cmp, label %while_body, label %while_end
+
+while_body:
+ %i = add i32 %phi, 1
+ store i32 %i, ptr %gep0
+ store i32 %phi, ptr %gep1
+ store i32 %i, ptr %gep2
+ store i32 %phi, ptr %gep3
+ br label %while_cond
+
+while_end:
+ ret void
+}
More information about the llvm-commits
mailing list