[llvm] 4614b80 - [LoongArch] Pre-commit tests for merge base with large offset. NFC

WANG Rui via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 01:02:29 PDT 2024


Author: WANG Rui
Date: 2024-10-22T15:44:40+08:00
New Revision: 4614b80c49fbab8b0283bf4ccba0716c488bcd98

URL: https://github.com/llvm/llvm-project/commit/4614b80c49fbab8b0283bf4ccba0716c488bcd98
DIFF: https://github.com/llvm/llvm-project/commit/4614b80c49fbab8b0283bf4ccba0716c488bcd98.diff

LOG: [LoongArch] Pre-commit tests for merge base with large offset. NFC

Added: 
    

Modified: 
    llvm/test/CodeGen/LoongArch/merge-base-offset.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/LoongArch/merge-base-offset.ll b/llvm/test/CodeGen/LoongArch/merge-base-offset.ll
index 323858c7613a67..b53f94303b6ea4 100644
--- a/llvm/test/CodeGen/LoongArch/merge-base-offset.ll
+++ b/llvm/test/CodeGen/LoongArch/merge-base-offset.ll
@@ -1082,6 +1082,68 @@ entry:
   ret ptr getelementptr inbounds ([1 x i64], ptr @g_a64, i64 268432897)
 }
 
+define dso_local ptr @load_addr_offset_281474439839744() nounwind {
+; LA32-LABEL: load_addr_offset_281474439839744:
+; LA32:       # %bb.0: # %entry
+; LA32-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
+; LA32-NEXT:    addi.w $a0, $a0, %pc_lo12(g_a64)
+; LA32-NEXT:    ret
+;
+; LA64-LABEL: load_addr_offset_281474439839744:
+; LA64:       # %bb.0: # %entry
+; LA64-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
+; LA64-NEXT:    addi.d $a0, $a0, %pc_lo12(g_a64)
+; LA64-NEXT:    ori $a1, $zero, 0
+; LA64-NEXT:    lu32i.d $a1, 524287
+; LA64-NEXT:    add.d $a0, $a0, $a1
+; LA64-NEXT:    ret
+;
+; LA64-LARGE-LABEL: load_addr_offset_281474439839744:
+; LA64-LARGE:       # %bb.0: # %entry
+; LA64-LARGE-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
+; LA64-LARGE-NEXT:    addi.d $a1, $zero, %pc_lo12(g_a64)
+; LA64-LARGE-NEXT:    lu32i.d $a1, %pc64_lo20(g_a64)
+; LA64-LARGE-NEXT:    lu52i.d $a1, $a1, %pc64_hi12(g_a64)
+; LA64-LARGE-NEXT:    add.d $a0, $a1, $a0
+; LA64-LARGE-NEXT:    ori $a1, $zero, 0
+; LA64-LARGE-NEXT:    lu32i.d $a1, 524287
+; LA64-LARGE-NEXT:    add.d $a0, $a0, $a1
+; LA64-LARGE-NEXT:    ret
+entry:
+  ret ptr getelementptr inbounds ([1 x i64], ptr @g_a64, i64 281474439839744)
+}
+
+define dso_local ptr @load_addr_offset_248792680471040() nounwind {
+; LA32-LABEL: load_addr_offset_248792680471040:
+; LA32:       # %bb.0: # %entry
+; LA32-NEXT:    pcalau12i $a0, %pc_hi20(g_a64+2059194368)
+; LA32-NEXT:    addi.w $a0, $a0, %pc_lo12(g_a64+2059194368)
+; LA32-NEXT:    ret
+;
+; LA64-LABEL: load_addr_offset_248792680471040:
+; LA64:       # %bb.0: # %entry
+; LA64-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
+; LA64-NEXT:    addi.d $a0, $a0, %pc_lo12(g_a64)
+; LA64-NEXT:    lu12i.w $a1, 502733
+; LA64-NEXT:    lu32i.d $a1, 463412
+; LA64-NEXT:    add.d $a0, $a0, $a1
+; LA64-NEXT:    ret
+;
+; LA64-LARGE-LABEL: load_addr_offset_248792680471040:
+; LA64-LARGE:       # %bb.0: # %entry
+; LA64-LARGE-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
+; LA64-LARGE-NEXT:    addi.d $a1, $zero, %pc_lo12(g_a64)
+; LA64-LARGE-NEXT:    lu32i.d $a1, %pc64_lo20(g_a64)
+; LA64-LARGE-NEXT:    lu52i.d $a1, $a1, %pc64_hi12(g_a64)
+; LA64-LARGE-NEXT:    add.d $a0, $a1, $a0
+; LA64-LARGE-NEXT:    lu12i.w $a1, 502733
+; LA64-LARGE-NEXT:    lu32i.d $a1, 463412
+; LA64-LARGE-NEXT:    add.d $a0, $a0, $a1
+; LA64-LARGE-NEXT:    ret
+entry:
+  ret ptr getelementptr inbounds ([1 x i64], ptr @g_a64, i64 248792680471040)
+}
+
 define dso_local ptr @load_addr_offset_9380351707272() nounwind {
 ; LA32-LABEL: load_addr_offset_9380351707272:
 ; LA32:       # %bb.0: # %entry
@@ -1115,35 +1177,66 @@ entry:
   ret ptr getelementptr inbounds ([1 x i64], ptr @g_a64, i64 9380351707272)
 }
 
-define dso_local ptr @load_addr_offset_614750729487779976() nounwind {
-; LA32-LABEL: load_addr_offset_614750729487779976:
+define dso_local ptr @load_addr_offset_562949953421312() nounwind {
+; LA32-LABEL: load_addr_offset_562949953421312:
 ; LA32:       # %bb.0: # %entry
-; LA32-NEXT:    pcalau12i $a0, %pc_hi20(g_a64+1145062464)
-; LA32-NEXT:    addi.w $a0, $a0, %pc_lo12(g_a64+1145062464)
+; LA32-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
+; LA32-NEXT:    addi.w $a0, $a0, %pc_lo12(g_a64)
 ; LA32-NEXT:    ret
 ;
-; LA64-LABEL: load_addr_offset_614750729487779976:
+; LA64-LABEL: load_addr_offset_562949953421312:
 ; LA64:       # %bb.0: # %entry
 ; LA64-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
 ; LA64-NEXT:    addi.d $a0, $a0, %pc_lo12(g_a64)
-; LA64-NEXT:    lu12i.w $a1, 279556
-; LA64-NEXT:    ori $a1, $a1, 1088
-; LA64-NEXT:    bstrins.d $a1, $a1, 62, 32
+; LA64-NEXT:    lu52i.d $a1, $zero, 1
 ; LA64-NEXT:    add.d $a0, $a0, $a1
 ; LA64-NEXT:    ret
 ;
-; LA64-LARGE-LABEL: load_addr_offset_614750729487779976:
+; LA64-LARGE-LABEL: load_addr_offset_562949953421312:
 ; LA64-LARGE:       # %bb.0: # %entry
 ; LA64-LARGE-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
 ; LA64-LARGE-NEXT:    addi.d $a1, $zero, %pc_lo12(g_a64)
 ; LA64-LARGE-NEXT:    lu32i.d $a1, %pc64_lo20(g_a64)
 ; LA64-LARGE-NEXT:    lu52i.d $a1, $a1, %pc64_hi12(g_a64)
 ; LA64-LARGE-NEXT:    add.d $a0, $a1, $a0
-; LA64-LARGE-NEXT:    lu12i.w $a1, 279556
-; LA64-LARGE-NEXT:    ori $a1, $a1, 1088
-; LA64-LARGE-NEXT:    bstrins.d $a1, $a1, 62, 32
+; LA64-LARGE-NEXT:    lu52i.d $a1, $zero, 1
+; LA64-LARGE-NEXT:    add.d $a0, $a0, $a1
+; LA64-LARGE-NEXT:    ret
+entry:
+  ret ptr getelementptr inbounds ([1 x i64], ptr @g_a64, i64 562949953421312)
+}
+
+define dso_local ptr @load_addr_offset_614749556925924693() nounwind {
+; LA32-LABEL: load_addr_offset_614749556925924693:
+; LA32:       # %bb.0: # %entry
+; LA32-NEXT:    pcalau12i $a0, %pc_hi20(g_a64+858794664)
+; LA32-NEXT:    addi.w $a0, $a0, %pc_lo12(g_a64+858794664)
+; LA32-NEXT:    ret
+;
+; LA64-LABEL: load_addr_offset_614749556925924693:
+; LA64:       # %bb.0: # %entry
+; LA64-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
+; LA64-NEXT:    addi.d $a0, $a0, %pc_lo12(g_a64)
+; LA64-NEXT:    lu12i.w $a1, 209666
+; LA64-NEXT:    ori $a1, $a1, 2728
+; LA64-NEXT:    lu32i.d $a1, 15288
+; LA64-NEXT:    lu52i.d $a1, $a1, 1092
+; LA64-NEXT:    add.d $a0, $a0, $a1
+; LA64-NEXT:    ret
+;
+; LA64-LARGE-LABEL: load_addr_offset_614749556925924693:
+; LA64-LARGE:       # %bb.0: # %entry
+; LA64-LARGE-NEXT:    pcalau12i $a0, %pc_hi20(g_a64)
+; LA64-LARGE-NEXT:    addi.d $a1, $zero, %pc_lo12(g_a64)
+; LA64-LARGE-NEXT:    lu32i.d $a1, %pc64_lo20(g_a64)
+; LA64-LARGE-NEXT:    lu52i.d $a1, $a1, %pc64_hi12(g_a64)
+; LA64-LARGE-NEXT:    add.d $a0, $a1, $a0
+; LA64-LARGE-NEXT:    lu12i.w $a1, 209666
+; LA64-LARGE-NEXT:    ori $a1, $a1, 2728
+; LA64-LARGE-NEXT:    lu32i.d $a1, 15288
+; LA64-LARGE-NEXT:    lu52i.d $a1, $a1, 1092
 ; LA64-LARGE-NEXT:    add.d $a0, $a0, $a1
 ; LA64-LARGE-NEXT:    ret
 entry:
-  ret ptr getelementptr inbounds ([1 x i64], ptr @g_a64, i64 614750729487779976)
+  ret ptr getelementptr inbounds ([1 x i64], ptr @g_a64, i64 614749556925924693)
 }


        


More information about the llvm-commits mailing list