Skip to content

Commit 02de975

Browse files
committed
[AArch64] Add some tests for the cost of extending an extract. NFC
1 parent bb90135 commit 02de975

File tree

1 file changed

+41
-0
lines changed
  • llvm/test/Analysis/CostModel/AArch64

1 file changed

+41
-0
lines changed

llvm/test/Analysis/CostModel/AArch64/cast.ll

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,4 +981,45 @@ define i32 @store_truncs() {
981981
ret i32 undef
982982
}
983983

984+
define void @extend_extract() {
985+
; CHECK-LABEL: 'extend_extract'
986+
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %e8 = extractelement <8 x i8> undef, i32 1
987+
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %e16 = extractelement <8 x i16> undef, i32 1
988+
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %e32 = extractelement <8 x i32> undef, i32 1
989+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8_16 = sext i8 %e8 to i16
990+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %z8_16 = zext i8 %e8 to i16
991+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8_32 = sext i8 %e8 to i32
992+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %z8_32 = zext i8 %e8 to i32
993+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s8_64 = sext i8 %e8 to i64
994+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %z8_64 = zext i8 %e8 to i64
995+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s16_32 = sext i16 %e16 to i32
996+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %z16_32 = zext i16 %e16 to i32
997+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s16_64 = sext i16 %e16 to i64
998+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %z16_64 = zext i16 %e16 to i64
999+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s32_64 = sext i32 %e32 to i64
1000+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %z32_64 = zext i32 %e32 to i64
1001+
; CHECK-NEXT: Cost Model: Found an estimated cost of 13 for instruction: call void @use(i16 %s8_16, i16 %z8_16, i32 %s8_32, i32 %z8_32, i64 %s8_64, i64 %z8_64, i32 %s16_32, i32 %z16_32, i64 %s16_64, i64 %z16_64, i64 %s32_64, i64 %z32_64)
1002+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
1003+
;
1004+
%e8 = extractelement <8 x i8> undef, i32 1
1005+
%e16 = extractelement <8 x i16> undef, i32 1
1006+
%e32 = extractelement <8 x i32> undef, i32 1
1007+
%s8_16 = sext i8 %e8 to i16
1008+
%z8_16 = zext i8 %e8 to i16
1009+
%s8_32 = sext i8 %e8 to i32
1010+
%z8_32 = zext i8 %e8 to i32
1011+
%s8_64 = sext i8 %e8 to i64
1012+
%z8_64 = zext i8 %e8 to i64
1013+
%s16_32 = sext i16 %e16 to i32
1014+
%z16_32 = zext i16 %e16 to i32
1015+
%s16_64 = sext i16 %e16 to i64
1016+
%z16_64 = zext i16 %e16 to i64
1017+
%s32_64 = sext i32 %e32 to i64
1018+
%z32_64 = zext i32 %e32 to i64
1019+
call void @use(i16 %s8_16, i16 %z8_16, i32 %s8_32, i32 %z8_32, i64 %s8_64, i64 %z8_64, i32 %s16_32, i32 %z16_32, i64 %s16_64, i64 %z16_64, i64 %s32_64, i64 %z32_64)
1020+
ret void
1021+
}
1022+
1023+
declare void @use(i16, i16, i32, i32, i64, i64, i32, i32, i64, i64, i64, i64)
1024+
9841025
attributes #0 = { "target-features"="+sve" }

0 commit comments

Comments
 (0)