Skip to content

Commit c7367f9

Browse files
committed
[LoongArch] Fix incorrect pattern XVREPL128VEI_{W/D} instructions
Remove the incorrect patterns for `XVREPL128VEI_{W/D}` instructions, and add correct patterns for XVREPLVE0_{W/D} instructions
1 parent 47c88bc commit c7367f9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,11 +1571,11 @@ def : Pat<(loongarch_vreplve v8i32:$xj, GRLenVT:$rk),
15711571
def : Pat<(loongarch_vreplve v4i64:$xj, GRLenVT:$rk),
15721572
(XVREPLVE_D v4i64:$xj, GRLenVT:$rk)>;
15731573

1574-
// XVREPL128VEI_{W/D}
1574+
// XVREPLVE0_{W/D}
15751575
def : Pat<(lasxsplatf32 FPR32:$fj),
1576-
(XVREPL128VEI_W (SUBREG_TO_REG (i64 0), FPR32:$fj, sub_32), 0)>;
1576+
(XVREPLVE0_W (SUBREG_TO_REG (i64 0), FPR32:$fj, sub_32))>;
15771577
def : Pat<(lasxsplatf64 FPR64:$fj),
1578-
(XVREPL128VEI_D (SUBREG_TO_REG (i64 0), FPR64:$fj, sub_64), 0)>;
1578+
(XVREPLVE0_D (SUBREG_TO_REG (i64 0), FPR64:$fj, sub_64))>;
15791579

15801580
// Loads/Stores
15811581
foreach vt = [v32i8, v16i16, v8i32, v4i64, v8f32, v4f64] in {

llvm/test/CodeGen/LoongArch/lasx/build-vector.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ define void @buildvector_v8f32_splat(ptr %dst, float %a0) nounwind {
5757
; CHECK-LABEL: buildvector_v8f32_splat:
5858
; CHECK: # %bb.0: # %entry
5959
; CHECK-NEXT: # kill: def $f0 killed $f0 def $xr0
60-
; CHECK-NEXT: xvrepl128vei.w $xr0, $xr0, 0
60+
; CHECK-NEXT: xvreplve0.w $xr0, $xr0
6161
; CHECK-NEXT: xvst $xr0, $a0, 0
6262
; CHECK-NEXT: ret
6363
entry:
@@ -71,7 +71,7 @@ define void @buildvector_v4f64_splat(ptr %dst, double %a0) nounwind {
7171
; CHECK-LABEL: buildvector_v4f64_splat:
7272
; CHECK: # %bb.0: # %entry
7373
; CHECK-NEXT: # kill: def $f0_64 killed $f0_64 def $xr0
74-
; CHECK-NEXT: xvrepl128vei.d $xr0, $xr0, 0
74+
; CHECK-NEXT: xvreplve0.d $xr0, $xr0
7575
; CHECK-NEXT: xvst $xr0, $a0, 0
7676
; CHECK-NEXT: ret
7777
entry:

0 commit comments

Comments
 (0)