[PATCH] D130188: [DependenceAnalysis][PR56275] Normalize dependence analysis results to be non-negative when required

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 13:21:34 PDT 2022


bmahjour added inline comments.


================
Comment at: llvm/include/llvm/Analysis/DependenceAnalysis.h:960
+    /// directions and distances in the vector.
+    void normalize(FullDependence &Result);
   }; // class DependenceInfo
----------------
It would be good for the `normalize()` function to return a boolean indicating if it changed the result or not. This could come in handy, for example, when printing the results (please see my comment about the printer pass).


================
Comment at: llvm/test/Analysis/DependenceAnalysis/Banerjee.ll:248
+; NORMALIZE: da analyze - none!
+; NORMALIZE: da analyze - anti [< <]!
+; NORMALIZE: da analyze - confused!
----------------
Since the printer pass (using `dumpExampleDependence`) prints the Src and Dst instructions in a fixed order, these results could easily be misinterpreted. To avoid confusion can we flag the results that have been normalized with a special marker? eg:

```
Src: store....
Dst: ...load
  da analyze - anti [< <]! **normalized**
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130188



More information about the llvm-commits mailing list