[PATCH] D84589: [CodeMoverUtils] Add optional data dependence checks using Alias Analysis

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 26 02:45:34 PDT 2020


Whitney added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:230
 
+/// Checks data dependency between /p I and Instructions in /p InstsToCheck
+/// using dependence info.
----------------
Instructions -> instructions


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:236
+    auto DepResult = DI.depends(&I, CurInst, true);
+    if (DepResult &&
+        (DepResult->isOutput() || DepResult->isFlow() || DepResult->isAnti()))
----------------
`return (DepResult && (DepResult->isOutput() || DepResult->isFlow() || DepResult->isAnti()));`


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:269
+/// Checks data dependency between /p I and Instructions in /p InstsToCheck
+/// using alias analysis and dependence info.
+static bool isDependenceSafe(Instruction &I, DependenceInfo *DI, AAResults *AA,
----------------
using dependence info or alias analysis


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:258
+
+    if (!AA.isNoAlias(MemLoc, DestMemLoc))
+      return true;
----------------
Whitney wrote:
> check this at line 251.
> ```
> if (AA.isNoAlias(MemLoc, DestMemLoc))
>   return false;
> ```
check `isNoAlias` before querying `getModRefInfo`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84589





More information about the llvm-commits mailing list