[PATCH] D77297: [Alignment][NFC] Remove unused private functions
Guillaume Chatelet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 05:56:11 PDT 2020
gchatelet created this revision.
gchatelet added a reviewer: courbet.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77297
Files:
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
Index: llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
+++ llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
@@ -128,16 +128,10 @@
private:
unsigned getPointerAddressSpace(Value *I);
- /// TODO: Remove this function once transition to Align is over.
- unsigned getAlignment(LoadInst *LI) const { return getAlign(LI).value(); }
-
Align getAlign(LoadInst *LI) const {
return DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType());
}
- /// TODO: Remove this function once transition to Align is over.
- unsigned getAlignment(StoreInst *SI) const { return getAlign(SI).value(); }
-
Align getAlign(StoreInst *SI) const {
return DL.getValueOrABITypeAlignment(SI->getAlign(),
SI->getValueOperand()->getType());
@@ -1109,7 +1103,7 @@
unsigned VecRegSize = TTI.getLoadStoreVecRegBitWidth(AS);
unsigned VF = VecRegSize / Sz;
unsigned ChainSize = Chain.size();
- unsigned Alignment = getAlignment(L0);
+ Align Alignment = getAlign(L0);
if (!isPowerOf2_32(Sz) || VF < 2 || ChainSize < 2) {
InstructionsProcessed->insert(Chain.begin(), Chain.end());
@@ -1159,7 +1153,7 @@
InstructionsProcessed->insert(Chain.begin(), Chain.end());
// If the load is going to be misaligned, don't vectorize it.
- if (accessIsMisaligned(SzInBytes, AS, Alignment)) {
+ if (accessIsMisaligned(SzInBytes, AS, Alignment.value())) {
if (L0->getPointerAddressSpace() != DL.getAllocaAddrSpace()) {
auto Chains = splitOddVectorElts(Chain, Sz);
return vectorizeLoadChain(Chains.first, InstructionsProcessed) |
@@ -1168,13 +1162,13 @@
unsigned NewAlign = getOrEnforceKnownAlignment(
L0->getPointerOperand(), StackAdjustedAlignment, DL, L0, nullptr, &DT);
- if (NewAlign >= Alignment)
- Alignment = NewAlign;
+ if (NewAlign >= Alignment.value())
+ Alignment = Align(NewAlign);
else
return false;
}
- if (!TTI.isLegalToVectorizeLoadChain(SzInBytes, Alignment, AS)) {
+ if (!TTI.isLegalToVectorizeLoadChain(SzInBytes, Alignment.value(), AS)) {
auto Chains = splitOddVectorElts(Chain, Sz);
return vectorizeLoadChain(Chains.first, InstructionsProcessed) |
vectorizeLoadChain(Chains.second, InstructionsProcessed);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77297.254493.patch
Type: text/x-patch
Size: 2403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200402/2b92102f/attachment.bin>
More information about the llvm-commits
mailing list