[CostModel][X86] Add more realistic v8i64/v16i32 + v8f64/v16f32 add reduction costs - #206124
Merged
Merged
Conversation
…eduction costs Fixes failure to fodl to v16i32 reduction on ax512 targets We still need to determine better CostKind values - but that can wait until llvm#194621 is complete
RKSimon
enabled auto-merge (squash)
June 26, 2026 16:24
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/Target/X86/X86TargetTransformInfo.cpp --diff_from_common_commit
View the diff from clang-format here.diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 8838fd7e7..06508e947 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -5672,15 +5672,15 @@ X86TTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *ValTy,
};
static const CostTblEntry AVX512FCostTbl[] = {
- { ISD::FADD, MVT::v8f64, 4 },
- { ISD::FADD, MVT::v16f32, 5 },
- { ISD::ADD, MVT::v8i64, 4 },
- { ISD::ADD, MVT::v16i32, 6 },
+ {ISD::FADD, MVT::v8f64, 4},
+ {ISD::FADD, MVT::v16f32, 5},
+ {ISD::ADD, MVT::v8i64, 4},
+ {ISD::ADD, MVT::v16i32, 6},
};
static const CostTblEntry AVX512BWCostTbl[] = {
- { ISD::ADD, MVT::v32i16, 7 },
- { ISD::ADD, MVT::v64i8, 4 },
+ {ISD::ADD, MVT::v32i16, 7},
+ {ISD::ADD, MVT::v64i8, 4},
};
int ISD = TLI->InstructionOpcodeToISD(Opcode);
|
LouisLu060211
pushed a commit
to LouisLu060211/llvm-project
that referenced
this pull request
Jun 30, 2026
…eduction costs (llvm#206124) Fixes failure to fold to v16i32 reduction on ax512 targets We still need to determine better CostKind values - but that can wait until llvm#194621 is complete
maarcosrmz
pushed a commit
to maarcosrmz/llvm-project
that referenced
this pull request
Jul 1, 2026
…eduction costs (llvm#206124) Fixes failure to fold to v16i32 reduction on ax512 targets We still need to determine better CostKind values - but that can wait until llvm#194621 is complete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes failure to fold to v16i32 reduction on ax512 targets
We still need to determine better CostKind values - but that can wait until #194621 is complete