[PATCH] D8705: ScheduleDAGInstrs::buildSchedGraph() handling of memory dependecies rewritten.

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 06:54:43 PST 2015


jonpa updated this revision to Diff 42847.
jonpa added a comment.

OK - I have now changed the patch so it does not assume that unanalyzable stores / loads are never NonAlias.

I guess what is needed is for the scheduler to print out a line each time there is a missing mem-operand, as it would then be simple to check that they are not forgotten somewhere. When that is done, this change should not matter.

diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp
index d6a72b5..c719c78 100644

- a/lib/CodeGen/ScheduleDAGInstrs.cpp

+++ b/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -1030,10 +1030,11 @@ void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA,

  if (MI->mayStore()) {
    if (Objs.empty()) {

- // An unknown store depends on all stores and loads, except
- // NonAliasStores and NonAliasLoads.

+        // An unknown store depends on all stores and loads.

  addChainDependencies(SU, Stores);

+        addChainDependencies(SU, NonAliasStores);

  addChainDependencies(SU, Loads);

+        addChainDependencies(SU, NonAliasLoads);

@@ -1067,17 +1068,16 @@ void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA,

- if (MayAlias) {
- // The store is not 'NonAlias', and may therefore have
- // dependencies to unanalyzable loads and stores.
- addChainDependencies(SU, Loads, UnknownValue);
- addChainDependencies(SU, Stores, UnknownValue);
- }

+      // The store may have dependencies to unanalyzable loads and
+      // stores.
+      addChainDependencies(SU, Loads, UnknownValue);
+      addChainDependencies(SU, Stores, UnknownValue);

  }
  else { // SU is a load.
    if (Objs.empty()) {

- // An unknown load depends on all stores, except NonAliasStores.

+        // An unknown load depends on all stores.

  addChainDependencies(SU, Stores);

+        addChainDependencies(SU, NonAliasStores);

  Loads.insert(SU, UnknownValue);
  continue;

@@ -1097,10 +1097,8 @@ void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA,

    // Map this load to V.
    (ThisMayAlias ? Loads : NonAliasLoads).insert(SU, V);
  }

- if (MayAlias)
- // The load is not 'NonAlias', and may therefore have
- // dependencies to unanalyzable stores.
- addChainDependencies(SU, Stores, UnknownValue);

+      // The load may have dependencies to unanalyzable stores.
+      addChainDependencies(SU, Stores, UnknownValue);

  }
   


http://reviews.llvm.org/D8705

Files:
  include/llvm/CodeGen/PseudoSourceValue.h
  include/llvm/CodeGen/ScheduleDAG.h
  include/llvm/CodeGen/ScheduleDAGInstrs.h
  lib/CodeGen/ScheduleDAGInstrs.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8705.42847.patch
Type: text/x-patch
Size: 39163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151215/4b21cfc5/attachment.bin>


More information about the llvm-commits mailing list