Skip to content

Commit b79c01a

Browse files
author
Dylan McKay
committedSep 29, 2016
[AVR] Add instruction selection lowering code
Summary: This adds AVRISelLowering.cpp Reviewers: kparzysz, arsenm Subscribers: wdng, beanz, mgorny Differential Revision: https://reviews.llvm.org/D25034 llvm-svn: 282711
1 parent 09a8c7d commit b79c01a

File tree

3 files changed

+1954
-2
lines changed

3 files changed

+1954
-2
lines changed
 

‎llvm/lib/Target/AVR/AVRISelLowering.cpp

+1,940
Large diffs are not rendered by default.

‎llvm/lib/Target/AVR/AVRISelLowering.h

+13-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_AVR_ISEL_LOWERING_H
1616
#define LLVM_AVR_ISEL_LOWERING_H
1717

18+
#include "llvm/CodeGen/CallingConvLower.h"
1819
#include "llvm/Target/TargetLowering.h"
1920

2021
namespace llvm {
@@ -92,6 +93,9 @@ class AVRTargetLowering : public TargetLowering {
9293

9394
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
9495

96+
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context,
97+
EVT VT) const override;
98+
9599
MachineBasicBlock *
96100
EmitInstrWithCustomInserter(MachineInstr &MI,
97101
MachineBasicBlock *MBB) const override;
@@ -125,6 +129,13 @@ class AVRTargetLowering : public TargetLowering {
125129
SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
126130
SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG) const;
127131

132+
CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC) const;
133+
134+
bool CanLowerReturn(CallingConv::ID CallConv,
135+
MachineFunction &MF, bool isVarArg,
136+
const SmallVectorImpl<ISD::OutputArg> &Outs,
137+
LLVMContext &Context) const override;
138+
128139
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
129140
const SmallVectorImpl<ISD::OutputArg> &Outs,
130141
const SmallVectorImpl<SDValue> &OutVals, const SDLoc &dl,
@@ -143,8 +154,8 @@ class AVRTargetLowering : public TargetLowering {
143154
SmallVectorImpl<SDValue> &InVals) const;
144155

145156
private:
146-
MachineBasicBlock *insertShift(MachineInstr *MI, MachineBasicBlock *BB) const;
147-
MachineBasicBlock *insertMul(MachineInstr *MI, MachineBasicBlock *BB) const;
157+
MachineBasicBlock *insertShift(MachineInstr &MI, MachineBasicBlock *BB) const;
158+
MachineBasicBlock *insertMul(MachineInstr &MI, MachineBasicBlock *BB) const;
148159
};
149160

150161
} // end namespace llvm

‎llvm/lib/Target/AVR/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ add_public_tablegen_target(AVRCommonTableGen)
99

1010
add_llvm_target(AVRCodeGen
1111
AVRInstrInfo.cpp
12+
AVRISelLowering.cpp
1213
AVRRegisterInfo.cpp
1314
AVRSubtarget.cpp
1415
AVRTargetMachine.cpp

0 commit comments

Comments
 (0)
Please sign in to comment.