[PATCH] D12887: [Machine Combiner] Refactor machine reassociation into a target-independent pass

Gerolf Hoflehner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 13:14:30 PDT 2015


Gerolf added a comment.

LGTM.


================
Comment at: lib/CodeGen/TargetInstrInfo.cpp:550
@@ +549,3 @@
+
+  // 1. The previous instruction must be the same type as Inst.
+  // 2. The previous instruction must have virtual register definitions for its
----------------
There is a lot of duplication in the comments. You could define the rules for reassociation once and simply refer to it. You could think of formalizing them and use them as verifier when the actual transformation happens.

================
Comment at: lib/CodeGen/TargetInstrInfo.cpp:563
@@ +562,3 @@
+                                               bool &Commuted) const {
+  // 1. The operation must be associative and commutative.
+  // 2. The instruction must have virtual register definitions for its
----------------
It would be consistent with other functions if you pulled them out before the prototype.


Repository:
  rL LLVM

http://reviews.llvm.org/D12887





More information about the llvm-commits mailing list