Skip to content

Commit d8269a3

Browse files
committed
Review nits
1 parent 5f9b9ec commit d8269a3

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ class TargetTransformInfo {
913913
/// Insert is true.
914914
InstructionCost getScalarizationOverhead(
915915
VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract,
916-
TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = std::nullopt) const;
916+
TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = {}) const;
917917

918918
/// Estimate the overhead of scalarizing an instructions unique
919919
/// non-constant operands. The (potentially vector) types to use for each of
@@ -2004,7 +2004,7 @@ class TargetTransformInfo::Concept {
20042004
virtual InstructionCost
20052005
getScalarizationOverhead(VectorType *Ty, const APInt &DemandedElts,
20062006
bool Insert, bool Extract, TargetCostKind CostKind,
2007-
ArrayRef<Value *> VL = std::nullopt) = 0;
2007+
ArrayRef<Value *> VL = {}) = 0;
20082008
virtual InstructionCost
20092009
getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
20102010
ArrayRef<Type *> Tys,
@@ -2585,7 +2585,7 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
25852585
InstructionCost
25862586
getScalarizationOverhead(VectorType *Ty, const APInt &DemandedElts,
25872587
bool Insert, bool Extract, TargetCostKind CostKind,
2588-
ArrayRef<Value *> VL = std::nullopt) override {
2588+
ArrayRef<Value *> VL = {}) override {
25892589
return Impl.getScalarizationOverhead(Ty, DemandedElts, Insert, Extract,
25902590
CostKind, VL);
25912591
}

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class TargetTransformInfoImplBase {
403403

404404
InstructionCost getScalarizationOverhead(
405405
VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract,
406-
TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = std::nullopt) const {
406+
TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = {}) const {
407407
return 0;
408408
}
409409

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -779,17 +779,15 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
779779
/// extracted from vectors.
780780
InstructionCost getScalarizationOverhead(
781781
VectorType *InTy, const APInt &DemandedElts, bool Insert, bool Extract,
782-
TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = std::nullopt) {
783-
assert((VL.empty() ||
784-
VL.size() == cast<FixedVectorType>(InTy)->getNumElements()) &&
785-
"Type does not match the values.");
782+
TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = {}) {
786783
/// FIXME: a bitfield is not a reasonable abstraction for talking about
787784
/// which elements are needed from a scalable vector
788785
if (isa<ScalableVectorType>(InTy))
789786
return InstructionCost::getInvalid();
790787
auto *Ty = cast<FixedVectorType>(InTy);
791788

792789
assert(DemandedElts.getBitWidth() == Ty->getNumElements() &&
790+
(VL.empty() || VL.size() == Ty->getNumElements()) &&
793791
"Vector size mismatch");
794792

795793
InstructionCost Cost = 0;

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
424424
const APInt &DemandedElts,
425425
bool Insert, bool Extract,
426426
TTI::TargetCostKind CostKind,
427-
ArrayRef<Value *> VL = std::nullopt);
427+
ArrayRef<Value *> VL = {});
428428

429429
/// Return the cost of the scaling factor used in the addressing
430430
/// mode represented by AM for this target, for a load/store

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class RISCVTTIImpl : public BasicTTIImplBase<RISCVTTIImpl> {
150150
const APInt &DemandedElts,
151151
bool Insert, bool Extract,
152152
TTI::TargetCostKind CostKind,
153-
ArrayRef<Value *> VL = std::nullopt);
153+
ArrayRef<Value *> VL = {});
154154

155155
InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
156156
TTI::TargetCostKind CostKind);

llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
8585
const APInt &DemandedElts,
8686
bool Insert, bool Extract,
8787
TTI::TargetCostKind CostKind,
88-
ArrayRef<Value *> VL = std::nullopt);
88+
ArrayRef<Value *> VL = {});
8989
bool supportsEfficientVectorElementLoadStore() { return true; }
9090
bool enableInterleavedAccessVectorization() { return true; }
9191

llvm/lib/Target/X86/X86TargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class X86TTIImpl : public BasicTTIImplBase<X86TTIImpl> {
170170
const APInt &DemandedElts,
171171
bool Insert, bool Extract,
172172
TTI::TargetCostKind CostKind,
173-
ArrayRef<Value *> VL = std::nullopt);
173+
ArrayRef<Value *> VL = {});
174174
InstructionCost getReplicationShuffleCost(Type *EltTy, int ReplicationFactor,
175175
int VF,
176176
const APInt &DemandedDstElts,

0 commit comments

Comments
 (0)