[PATCH] D115036: [SelectionDAG] Use UnknownSize for VP memory ops

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 11:59:14 PST 2021


dmgreen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:7332
     // anything.
-    MemoryLocation ML;
-    if (VT.isScalableVector())
-      ML = MemoryLocation::getAfter(PtrOperand);
-    else
-      ML = MemoryLocation(
-          PtrOperand,
-          LocationSize::precise(
-              DAG.getDataLayout().getTypeStoreSize(VPIntrin.getType())),
-          AAInfo);
+    MemoryLocation ML = MemoryLocation::getAfter(PtrOperand, AAInfo);
     AddToChain = !AA || !AA->pointsToConstantMemory(ML);
----------------
craig.topper wrote:
> simoll wrote:
> > Not intimately familiar with MemoryLocations, but conceptually, for fixed size, we should be able to use an imprecise MemoryLocation here, quoting from the MemLoc header:
> > ```
> > // precisely N bytes. An imprecise value is formed as the union of two or more
> > // precise values, and can conservatively represent all of the values unioned
> > // into it. Importantly, imprecise values are an *upper-bound* on the size of a
> > // MemoryLocation.
> > ```
> We're re-using MemoryLocation::UnknownSize, but I don't think MachineMemOperand uses MemoryLocation or LocationSize in its underlying implementation.
Yeah, it's really stored as a LLT, where the size is passed along to AA. MemoryLocation::UnknownSize creates an invalid LLT.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115036



More information about the llvm-commits mailing list