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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 11:55:20 PST 2021


craig.topper accepted this revision.
craig.topper added a comment.
This revision is now accepted and ready to land.

LGTM



================
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);
----------------
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.


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