[PATCH] D150662: [SLP] Rename IsUniformStride to IsUnitStride. NFCI
Luke Lau via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 05:19:21 PDT 2023
luke created this revision.
luke added reviewers: vdmitrie, ABataev, RKSimon, reames, vporpo.
Herald added subscribers: asb, pmatos, hiraditya.
Herald added a project: All.
luke requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.
IsUniformStride is only used when the stride is a unit-stride, i.e. in a
plain wide vector load. This tightens the condition and renames it to
isUnitStride. It removes the old unused getUniformStrided() variant, as
isUnitStride should now imply that the stride is known.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D150662
Files:
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Index: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -7264,8 +7264,7 @@
// stay in vectorized code due to uses outside of these scalar
// loads/stores.
ScalarCost = TTI->getPointersChainCost(
- Ptrs, BasePtr, TTI::PointersChainInfo::getKnownUniformStrided(),
- CostKind);
+ Ptrs, BasePtr, TTI::PointersChainInfo::getUnitStride(), CostKind);
SmallVector<const Value *> PtrsRetainedInVecCode;
for (Value *V : Ptrs) {
@@ -7291,7 +7290,7 @@
}
VecCost = TTI->getPointersChainCost(
PtrsRetainedInVecCode, BasePtr,
- TTI::PointersChainInfo::getKnownNonUniformStrided(), CostKind);
+ TTI::PointersChainInfo::getKnownStride(), CostKind);
} else {
// Case 1: Ptrs are the arguments of loads that we are going to transform
// into masked gather load intrinsic.
@@ -7304,8 +7303,8 @@
auto *Ptr = dyn_cast<GetElementPtrInst>(V);
return Ptr && !Ptr->hasAllConstantIndices();
})
- ? TTI::PointersChainInfo::getNonUniformStrided()
- : TTI::PointersChainInfo::getKnownNonUniformStrided();
+ ? TTI::PointersChainInfo::getUnknownStride()
+ : TTI::PointersChainInfo::getKnownStride();
ScalarCost = TTI->getPointersChainCost(Ptrs, BasePtr, PtrsInfo, CostKind);
Index: llvm/include/llvm/Analysis/TargetTransformInfo.h
===================================================================
--- llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -293,32 +293,28 @@
/// All the GEPs in a set have same base address.
unsigned IsSameBaseAddress : 1;
/// These properties only valid if SameBaseAddress is set.
- /// True if distance between any two neigbouring pointers is same value.
- unsigned IsUniformStride : 1;
+ /// True if all pointers are separated by a unit stride.
+ unsigned IsUnitStride : 1;
/// True if distance between any two neigbouring pointers is a known value.
unsigned IsKnownStride : 1;
unsigned Reserved : 29;
bool isSameBase() const { return IsSameBaseAddress; }
- bool isUniformStride() const {
- return IsSameBaseAddress && IsUniformStride;
+ bool isUnitStride() const {
+ return IsSameBaseAddress && IsUnitStride;
}
bool isKnownStride() const { return IsSameBaseAddress && IsKnownStride; }
- static PointersChainInfo getKnownUniformStrided() {
- return {/*IsSameBaseAddress=*/1, /*IsUniformStride=*/1,
+ static PointersChainInfo getUnitStride() {
+ return {/*IsSameBaseAddress=*/1, /*IsUnitStride=*/1,
/*IsKnownStride=*/1, 0};
}
- static PointersChainInfo getUniformStrided() {
- return {/*IsSameBaseAddress=*/1, /*IsUniformStride=*/1,
- /*IsKnownStride=*/0, 0};
- }
- static PointersChainInfo getKnownNonUniformStrided() {
- return {/*IsSameBaseAddress=*/1, /*IsUniformStride=*/0,
+ static PointersChainInfo getKnownStride() {
+ return {/*IsSameBaseAddress=*/1, /*IsUnitStride=*/0,
/*IsKnownStride=*/1, 0};
}
- static PointersChainInfo getNonUniformStrided() {
- return {/*IsSameBaseAddress=*/1, /*IsUniformStride=*/0,
+ static PointersChainInfo getUnknownStride() {
+ return {/*IsSameBaseAddress=*/1, /*IsUnitStride=*/0,
/*IsKnownStride=*/0, 0};
}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150662.522555.patch
Type: text/x-patch
Size: 3639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230516/9f3bc3c1/attachment.bin>
More information about the llvm-commits
mailing list