[PATCH] D34144: [CodeGen] Add generic MacroFusion pass.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 14:15:48 PDT 2017


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

LGTM with the change below:



================
Comment at: lib/CodeGen/MacroFusion.cpp:77-79
+    // Ignore dependencies that don't enforce ordering.
+    if (Dep.isWeak())
+      continue;
----------------
fhahn wrote:
> MatzeB wrote:
> > Maybe we should even go for `if (Dep.getKind() != Data)` at least I can't imagine right now how anti or output dependencies could lead to macrofusion.
> I think we have to consider Order dependencies as well, because Order dependencies are used between compare and branch instructions, which should be fused on X86.
Odd, I really would have expected a data dependency on the eflags register for X86. Anyway if that isn't the case today, then you should be able to use at least:
```
if (Dep.getKind() == Anti || Dep.getKind() == Output || Dep.isWeak())
  continue;
```
then.


https://reviews.llvm.org/D34144





More information about the llvm-commits mailing list