[PATCH] D156158: [LAA] Rename and fix semantics of MaxSafeDepDistBytes to MinDepDistBytes

Michael Maitland via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 11:17:41 PDT 2023


michaelmaitland added inline comments.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:2010
+  // since there is a backwards dependency.
+  uint64_t MaxVF = MinDepDistBytes / (TypeByteSize * Stride);
   LLVM_DEBUG(dbgs() << "LAA: Positive distance " << Val.getSExtValue()
----------------
michaelmaitland wrote:
> fhahn wrote:
> > fhahn wrote:
> > > This is the only non-NFC part of the patch, IIUC? Would it be possible to create a test case showing the new behavior?
> > Would it be possible to add a test for the functional change here?
> I assume you mean the fact that we update MaxSafeVectorWidthInBits even if `IsTrueDataDependence && EnableForwardingConflictDetection && couldPreventStoreLoadForward(Distance, TypeByteSize)`. 
> 
> I am working on constructing a test case for this.
@fhahn I've updated this diff that no longer update MaxSafeVectorWidthInBits even if IsTrueDataDependence && EnableForwardingConflictDetection && couldPreventStoreLoadForward(Distance, TypeByteSize). The reason for this is that if `couldPreventStoreLoadForward` returns true, then it must be the case that `MinDepDistBytes` was not updated, and therefore MaxSafeVectorWidthInBits will remain the same.

I've added an assert statement as a sanity check against any future changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156158



More information about the llvm-commits mailing list