[AArch64] Only run macro fusion for CPUs with any fusion support.
authorFlorian Hahn <florian.hahn@arm.com>
Wed, 12 Jul 2017 21:41:28 +0000 (21:41 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Wed, 12 Jul 2017 21:41:28 +0000 (21:41 +0000)
Reviewers: evandro, t.p.northover, javed.absar

Reviewed By: evandro

Subscribers: aemerson, rengolin, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D34959

llvm-svn: 307851

llvm/lib/Target/AArch64/AArch64TargetMachine.cpp

index 25bcc79..6237b8f 100644 (file)
@@ -277,10 +277,12 @@ public:
 
   ScheduleDAGInstrs *
   createMachineScheduler(MachineSchedContext *C) const override {
+    const AArch64Subtarget &ST = C->MF->getSubtarget<AArch64Subtarget>();
     ScheduleDAGMILive *DAG = createGenericSchedLive(C);
     DAG->addMutation(createLoadClusterDAGMutation(DAG->TII, DAG->TRI));
     DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI));
-    DAG->addMutation(createAArch64MacroFusionDAGMutation());
+    if (ST.hasFusion())
+      DAG->addMutation(createAArch64MacroFusionDAGMutation());
     return DAG;
   }