[llvm] [MacroFusion] Support multiple predicators (PR #72219)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 11:05:55 PST 2023


================
@@ -137,19 +137,33 @@ namespace {
 /// Post-process the DAG to create cluster edges between instrs that may
 /// be fused by the processor into a single operation.
 class MacroFusion : public ScheduleDAGMutation {
-  ShouldSchedulePredTy shouldScheduleAdjacent;
+  std::vector<MacroFusionPredTy> Predicates;
   bool FuseBlock;
   bool scheduleAdjacentImpl(ScheduleDAGInstrs &DAG, SUnit &AnchorSU);
 
 public:
-  MacroFusion(ShouldSchedulePredTy shouldScheduleAdjacent, bool FuseBlock)
-    : shouldScheduleAdjacent(shouldScheduleAdjacent), FuseBlock(FuseBlock) {}
+  MacroFusion(std::vector<MacroFusionPredTy> Predicates, bool FuseBlock)
----------------
topperc wrote:

I made a version of this patch that uses ArrayRef here https://github.com/topperc/llvm-project/commit/03e23872f54f83426d49361a810c26b81ac6e86c. I was able to drop the changes to all the targets because ArrayRef can be implicitly created from a single value.

https://github.com/llvm/llvm-project/pull/72219


More information about the llvm-commits mailing list