[PATCH] D77297: [Alignment][NFC] Remove unused private functions

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 3 02:39:47 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG1a584a8d509f: [Alignment][NFC] Remove unused private functions (authored by gchatelet).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77297/new/

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.254734.patch
Type: text/x-patch
Size: 2403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200403/7f91f205/attachment.bin>


More information about the llvm-commits mailing list