LLVM 22.0.0git
X86MacroFusion.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Functions

static X86::FirstMacroFusionInstKind classifyFirst (const MachineInstr &MI)
static X86::SecondMacroFusionInstKind classifySecond (const MachineInstr &MI)
static bool shouldScheduleAdjacent (const TargetInstrInfo &TII, const TargetSubtargetInfo &TSI, const MachineInstr *FirstMI, const MachineInstr &SecondMI)
 Check if the instr pair, FirstMI and SecondMI, should be fused together.
std::unique_ptr< ScheduleDAGMutationllvm::createX86MacroFusionDAGMutation ()
 Note that you have to add: DAG.addMutation(createX86MacroFusionDAGMutation()); to X86TargetMachine::createMachineScheduler() to have an effect.

Function Documentation

◆ classifyFirst()

X86::FirstMacroFusionInstKind classifyFirst ( const MachineInstr & MI)
static

Definition at line 23 of file X86MacroFusion.cpp.

References llvm::X86::classifyFirstOpcodeInMacroFusion(), and MI.

Referenced by shouldScheduleAdjacent().

◆ classifySecond()

◆ shouldScheduleAdjacent()

bool shouldScheduleAdjacent ( const TargetInstrInfo & TII,
const TargetSubtargetInfo & TSI,
const MachineInstr * FirstMI,
const MachineInstr & SecondMI )
static

Check if the instr pair, FirstMI and SecondMI, should be fused together.

Given SecondMI, when FirstMI is unspecified, then check if SecondMI may be part of a fused pair at all.

Definition at line 35 of file X86MacroFusion.cpp.

References classifyFirst(), classifySecond(), llvm::X86::Cmp, llvm::X86::Invalid, llvm::X86::isMacroFused(), llvm_unreachable, llvm::X86::Test, and TII.