[PATCH] D106099: [DependenceAnalysis] Guard analysis using getPointerBase()

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 14:37:48 PDT 2021


bmahjour added inline comments.


================
Comment at: llvm/lib/Analysis/DependenceAnalysis.cpp:3556
   LLVM_DEBUG(dbgs() << "    DstSCEV = " << *DstSCEV << "\n");
+  if (SE->getPointerBase(SrcSCEV) != SE->getPointerBase(DstSCEV)) {
+    // If two pointers have different bases, trying to analyze indexes won't
----------------
We only get here if the two pointers `MustAlias`.  If my understanding of `MustAlias` is correct (that it means precise and complete overlapping of memory), and if the two references are in the same loop, then comparing indexes seems reasonable. In that case, the effect of the following analysis should be as if `src` and `dst` SCEVs have their base pointers replaced with the same value. Not sure what's the best way to deal with such cases. Does it make sense to introduce a mode in `getMinusSCEV` where different base pointers can be permitted? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106099



More information about the llvm-commits mailing list