Skip to content

Commit

Permalink
[Alignment][NFC] Remove unused private functions
Browse files Browse the repository at this point in the history
Summary:
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

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77297
  • Loading branch information
gchatelet committed Apr 3, 2020
1 parent c7e1fc8 commit 1a584a8
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
Expand Up @@ -128,16 +128,10 @@ class Vectorizer {
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());
Expand Down Expand Up @@ -1109,7 +1103,7 @@ bool Vectorizer::vectorizeLoadChain(
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());
Expand Down Expand Up @@ -1159,7 +1153,7 @@ bool Vectorizer::vectorizeLoadChain(
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) |
Expand All @@ -1168,13 +1162,13 @@ bool Vectorizer::vectorizeLoadChain(

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);
Expand Down

0 comments on commit 1a584a8

Please sign in to comment.