62 lines
1.9 KiB
C++
62 lines
1.9 KiB
C++
#ifndef LLVM_LIB_TARGET_FOOT_FOOTISELLOWERING_H
|
|
#define LLVM_LIB_TARGET_FOOT_FOOTISELLOWERING_H
|
|
|
|
#include "llvm/CodeGen/TargetLowering.h"
|
|
|
|
namespace llvm {
|
|
|
|
namespace FootISD {
|
|
|
|
enum NodeType : unsigned {
|
|
FIRST_NUMBER = ISD::BUILTIN_OP_END,
|
|
CALL,
|
|
CMP_CHAIN,
|
|
BR_L,
|
|
BR_LE,
|
|
BR_E,
|
|
BR_GE,
|
|
BR_G,
|
|
BR_NE
|
|
};
|
|
|
|
} // namespace FootISD
|
|
|
|
class FootSubtarget;
|
|
class FootTargetMachine;
|
|
|
|
class FootTargetLowering : public TargetLowering {
|
|
const FootSubtarget &Subtarget;
|
|
public:
|
|
explicit FootTargetLowering(const TargetMachine &TM,
|
|
const FootSubtarget &STI);
|
|
|
|
const char *getTargetNodeName(unsigned Opcode) const override;
|
|
|
|
SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg,
|
|
const SmallVectorImpl<ISD::InputArg> &Ins, const SDLoc &DL,
|
|
SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const override;
|
|
|
|
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg,
|
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
|
const SmallVectorImpl<SDValue> &OutVals, const SDLoc &DL,
|
|
SelectionDAG &DAG) const override;
|
|
|
|
SDValue LowerCall(CallLoweringInfo &CLI, SmallVectorImpl<SDValue> &InVals) const override;
|
|
|
|
bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF, bool IsVarArg,
|
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
|
LLVMContext &Context, const Type *RetTy) const override;
|
|
|
|
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
|
|
|
|
MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override;
|
|
|
|
private:
|
|
SDValue LowerBrCC(SDValue Op, SelectionDAG &DAG) const;
|
|
MachineBasicBlock *EmitSelect(MachineInstr &MI) const;
|
|
};
|
|
|
|
} // namespace llvm
|
|
|
|
#endif // LLVM_LIB_TARGET_FOOT_FOOTISELLOWERING_H
|