llvm::fuseInstructionPair

Fuse two scheduling units so they are scheduled back to back.

Synopsis

Declared in <llvm/CodeGen/MacroFusion.h>

bool
fuseInstructionPair(
    ScheduleDAGInstrs& DAG,
    SUnit& FirstSU,
    SUnit& SecondSU);

Description

Create an artificial edge between FirstSU and SecondSU. Make data dependencies from the FirstSU also dependent on the SecondSU to prevent them from being scheduled between the FirstSU and the SecondSU and vice-versa. Fusing more than 2 instructions is not currently supported.

Return Value

True if the pair was fused; false if either unit was already clustered.

Parameters

NameDescription
DAGScheduling DAG that owns the units being fused.
FirstSUFirst scheduling unit in the fused pair.
SecondSUSecond scheduling unit in the fused pair.