[PATCH] D98240: [VectorCombine] Simplify to scalar store if only one element updated

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 06:00:23 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:784
+  StoreInst *SI = dyn_cast<StoreInst>(&I);
+  if (!SI || !SI->isSimple() || !SI->getValueOperand()->getType()->isVectorTy())
+    return false;
----------------
I'm not sure if the vector GEP will properly handle types that are non-power-of-2 properly. Perhaps it might be good to limit this to types for which the following holds? `SI->typeSizeEqualsStoreSize(LI->getType())`?


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:884
     auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
-    VectorCombine Combiner(F, TTI, DT);
+    auto &AA = getAnalysis<AAResultsWrapperPass>().getAAResults();
+    VectorCombine Combiner(F, TTI, DT, AA);
----------------
qiucf wrote:
> fhahn wrote:
> > I think there are some oddities with respect to `GlobalsAA` and it should also be preserved, e.g. see D82342 (same for the new PM)
> Do you mean dropping this and use result from GlobalsAA? I see GlobalsAA is already preserved.
Ah never mind, I missed that it was already preserved.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98240



More information about the llvm-commits mailing list