Skip to content

Commit a0869b1

Browse files
committed
[CostModel][X86] Fix expanded CTPOP i8 costs
Updated to match #79989 / 9410019
1 parent 6ba8ca8 commit a0869b1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4000,7 +4000,7 @@ X86TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
40004000
{ ISD::CTTZ_ZERO_UNDEF, MVT::i8, { 2, 2, 1, 1 } }, // BSF
40014001
{ ISD::CTPOP, MVT::i32, { 8, 7, 15, 15 } },
40024002
{ ISD::CTPOP, MVT::i16, { 9, 8, 17, 17 } },
4003-
{ ISD::CTPOP, MVT::i8, { 7, 6, 13, 13 } },
4003+
{ ISD::CTPOP, MVT::i8, { 7, 6, 6, 6 } },
40044004
{ ISD::ROTL, MVT::i32, { 2, 3, 1, 3 } },
40054005
{ ISD::ROTL, MVT::i16, { 2, 3, 1, 3 } },
40064006
{ ISD::ROTL, MVT::i8, { 2, 3, 1, 3 } },

llvm/test/Analysis/CostModel/X86/ctpop-codesize.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ define i16 @var_ctpop_i16(i16 %a) {
5757

5858
define i8 @var_ctpop_i8(i8 %a) {
5959
; NOPOPCNT-LABEL: 'var_ctpop_i8'
60-
; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
60+
; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
6161
; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %ctpop
6262
;
6363
; POPCNT-LABEL: 'var_ctpop_i8'

llvm/test/Analysis/CostModel/X86/ctpop-sizelatency.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ define i16 @var_ctpop_i16(i16 %a) {
5757

5858
define i8 @var_ctpop_i8(i8 %a) {
5959
; NOPOPCNT-LABEL: 'var_ctpop_i8'
60-
; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 13 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
60+
; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %ctpop = call i8 @llvm.ctpop.i8(i8 %a)
6161
; NOPOPCNT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i8 %ctpop
6262
;
6363
; POPCNT-LABEL: 'var_ctpop_i8'

0 commit comments

Comments
 (0)