[PATCH] Fix CombineToPostIndexedLoadStore in DAGCombiner.cpp

Quentin Colombet qcolombet at apple.com
Tue Apr 21 09:57:23 PDT 2015


Hi François,

Almost good to me. See my inlined comments.

Could you run clang-format on your patch?
Some indents are suspicious.

Thanks,
-Quentin


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9088
@@ +9087,3 @@
+          continue;
+
+        // If one use is not a load / store address, then do the transformation.
----------------
This check still does not make sense to me.
This is indeed equivalent to your previous commit, but then, it has the same problem.

The bottom line is, yes, please remove it :).

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9092
@@ -9086,2 +9091,3 @@
           bool RealUse = false;
           for (SDNode *UseUse : Use->uses()) {
+            if (!canFoldInAddressingMode(Use, UseUse, DAG, TLI)) {
----------------
I would remove the RealUse variable…

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9094
@@ -9089,1 +9093,3 @@
+            if (!canFoldInAddressingMode(Use, UseUse, DAG, TLI)) {
               RealUse = true;
+	      break;
----------------
And directly set TryNext here...

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9101
@@ -9094,2 +9100,3 @@
+            TryNext = false;
             break;
           }
----------------
Then, this if-block becomes useless.

http://reviews.llvm.org/D9107

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list