Skip to content

Commit 7321d54

Browse files
committed
[TTI][AArch64] Detect OperandInfo from scalable splats.
Pulled out of llvm#122236, this allows Splats contants to be recognized in by getOperandInfo, allowing "better" costs for instructions like divides by constants to be produced (which are expanded into mul+add+shift). Some of the costs are not very accurate yet, but the comparison of scalar vs fixed-with vs scalable for the same fiv can become more accurate, especially with patches like llvm#122236.
1 parent 2e6030e commit 7321d54

File tree

3 files changed

+78
-77
lines changed

3 files changed

+78
-77
lines changed

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,8 @@ TargetTransformInfo::getOperandInfo(const Value *V) {
893893

894894
// Check for a splat of a constant or for a non uniform vector of constants
895895
// and check if the constant(s) are all powers of two.
896-
if (isa<ConstantVector>(V) || isa<ConstantDataVector>(V)) {
896+
if (isa<ConstantVector>(V) || isa<ConstantDataVector>(V) ||
897+
isa<ConstantExpr>(V)) {
897898
OpInfo = OK_NonUniformConstantValue;
898899
if (Splat) {
899900
OpInfo = OK_UniformConstantValue;

0 commit comments

Comments
 (0)