[PATCH] D28489: [CodeGen] Move MacroFusion to the target

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 16:38:46 PST 2017

MatzeB added inline comments.

Comment at: llvm/lib/Target/AArch64/AArch64MacroFusion.h:26-35
+class AArch64MacroFusion : public ScheduleDAGMutation {
+  const AArch64InstrInfo &TII;
+  AArch64MacroFusion(const AArch64InstrInfo &TII)
+    : TII(TII) {}
+  void apply(ScheduleDAGInstrs *DAGInstrs) override {
evandro wrote:
> MatzeB wrote:
> > This can stay private to the .cpp file where createMacroFusionDAGMutation() is defined and doesn't need to go into a header.
> > 
> > The same comment applies to the X86 version.
> You mean moving the method `scheduleAdjacent()` from `<Target>InstrInfo` to `<Target>MacroFusion` as a private function?
Pretty much. After moving the method you will probably realize that there the only caller is inside apply() and the apply() method consists only of that 1 call, so you can just as well "inline" manually and move the code into the apply() method.



More information about the llvm-commits mailing list