[PATCH] D83311: [CodeMoverUtils] Add optional data dependence checks using MSSA

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 09:28:46 PDT 2020


bmahjour added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:259
+        // write after read dependency on same memory location
+        if (InstMA == CurInstDefMA || InstLastDefMA == CurInstDefMA)
+          return true;
----------------
I don't understand why we need this part: `|| InstLastDefMA == CurInstDefMA`. Wouldn't it suffice to check the reaching def of the use against the instruction being moved (the first part of this condition) ? Do you have a test that would fail if you remove it?


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:264
+      // read after write dependency on same memory location
+      if (InstDefMA == CurInstLastDefMA || InstDefMA == CurInstMA)
+        return true;
----------------
Do we really need `InstDefMA == CurInstLastDefMA ||`? See my comment above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83311





More information about the llvm-commits mailing list