Skip to content

Commit dca2ed3

Browse files
committed
[LoongArch][NFC] Pre-commit tests for sign-extension removal with vectors
1 parent 35619c7 commit dca2ed3

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

llvm/test/CodeGen/LoongArch/sextw-removal.ll

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,4 +1314,23 @@ bb7: ; preds = %bb2
13141314
ret i32 %trunc
13151315
}
13161316

1317-
declare void @side_effect(i64)
1317+
declare void @side_effect(i64)
1318+
1319+
declare i32 @llvm.loongarch.lsx.vpickve2gr.w(<4 x i32>, i32)
1320+
1321+
define signext i32 @test20(<4 x i32> %v) {
1322+
; CHECK-LABEL: test20:
1323+
; CHECK: # %bb.0: # %entry
1324+
; CHECK-NEXT: vpickve2gr.w $a0, $vr0, 3
1325+
; CHECK-NEXT: addi.w $a0, $a0, 0
1326+
; CHECK-NEXT: ret
1327+
;
1328+
; NORMV-LABEL: test20:
1329+
; NORMV: # %bb.0: # %entry
1330+
; NORMV-NEXT: vpickve2gr.w $a0, $vr0, 3
1331+
; NORMV-NEXT: addi.w $a0, $a0, 0
1332+
; NORMV-NEXT: ret
1333+
entry:
1334+
%a = call i32 @llvm.loongarch.lsx.vpickve2gr.w(<4 x i32> %v, i32 3)
1335+
ret i32 %a
1336+
}

0 commit comments

Comments
 (0)