Skip to content

Commit 3be191c

Browse files
committed
AVR
1 parent 32faa1a commit 3be191c

File tree

5 files changed

+28
-95
lines changed

5 files changed

+28
-95
lines changed

llvm/lib/Target/AVR/AVRISelLowering.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -220,40 +220,6 @@ AVRTargetLowering::AVRTargetLowering(const AVRTargetMachine &TM,
220220
setMinimumJumpTableEntries(UINT_MAX);
221221
}
222222

223-
const char *AVRTargetLowering::getTargetNodeName(unsigned Opcode) const {
224-
#define NODE(name) \
225-
case AVRISD::name: \
226-
return #name
227-
228-
switch (Opcode) {
229-
default:
230-
return nullptr;
231-
NODE(RET_GLUE);
232-
NODE(RETI_GLUE);
233-
NODE(CALL);
234-
NODE(WRAPPER);
235-
NODE(LSL);
236-
NODE(LSLW);
237-
NODE(LSR);
238-
NODE(LSRW);
239-
NODE(ROL);
240-
NODE(ROR);
241-
NODE(ASR);
242-
NODE(ASRW);
243-
NODE(LSLLOOP);
244-
NODE(LSRLOOP);
245-
NODE(ROLLOOP);
246-
NODE(RORLOOP);
247-
NODE(ASRLOOP);
248-
NODE(BRCOND);
249-
NODE(CMP);
250-
NODE(CMPC);
251-
NODE(TST);
252-
NODE(SELECT_CC);
253-
#undef NODE
254-
}
255-
}
256-
257223
EVT AVRTargetLowering::getSetCCResultType(const DataLayout &DL, LLVMContext &,
258224
EVT VT) const {
259225
assert(!VT.isVector() && "No AVR SetCC type for vectors!");

llvm/lib/Target/AVR/AVRISelLowering.h

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -19,64 +19,6 @@
1919

2020
namespace llvm {
2121

22-
namespace AVRISD {
23-
24-
/// AVR Specific DAG Nodes
25-
enum NodeType {
26-
/// Start the numbering where the builtin ops leave off.
27-
FIRST_NUMBER = ISD::BUILTIN_OP_END,
28-
/// Return from subroutine.
29-
RET_GLUE,
30-
/// Return from ISR.
31-
RETI_GLUE,
32-
/// Represents an abstract call instruction,
33-
/// which includes a bunch of information.
34-
CALL,
35-
/// A wrapper node for TargetConstantPool,
36-
/// TargetExternalSymbol, and TargetGlobalAddress.
37-
WRAPPER,
38-
LSL, ///< Logical shift left.
39-
LSLBN, ///< Byte logical shift left N bits.
40-
LSLWN, ///< Word logical shift left N bits.
41-
LSLHI, ///< Higher 8-bit of word logical shift left.
42-
LSLW, ///< Wide logical shift left.
43-
LSR, ///< Logical shift right.
44-
LSRBN, ///< Byte logical shift right N bits.
45-
LSRWN, ///< Word logical shift right N bits.
46-
LSRLO, ///< Lower 8-bit of word logical shift right.
47-
LSRW, ///< Wide logical shift right.
48-
ASR, ///< Arithmetic shift right.
49-
ASRBN, ///< Byte arithmetic shift right N bits.
50-
ASRWN, ///< Word arithmetic shift right N bits.
51-
ASRLO, ///< Lower 8-bit of word arithmetic shift right.
52-
ASRW, ///< Wide arithmetic shift right.
53-
ROR, ///< Bit rotate right.
54-
ROL, ///< Bit rotate left.
55-
LSLLOOP, ///< A loop of single logical shift left instructions.
56-
LSRLOOP, ///< A loop of single logical shift right instructions.
57-
ROLLOOP, ///< A loop of single left bit rotate instructions.
58-
RORLOOP, ///< A loop of single right bit rotate instructions.
59-
ASRLOOP, ///< A loop of single arithmetic shift right instructions.
60-
/// AVR conditional branches. Operand 0 is the chain operand, operand 1
61-
/// is the block to branch if condition is true, operand 2 is the
62-
/// condition code, and operand 3 is the flag operand produced by a CMP
63-
/// or TEST instruction.
64-
BRCOND,
65-
/// Compare instruction.
66-
CMP,
67-
/// Compare with carry instruction.
68-
CMPC,
69-
/// Test for zero or minus instruction.
70-
TST,
71-
/// Swap Rd[7:4] <-> Rd[3:0].
72-
SWAP,
73-
/// Operand 0 and operand 1 are selection variable, operand 2
74-
/// is condition code and operand 3 is flag operand.
75-
SELECT_CC
76-
};
77-
78-
} // end of namespace AVRISD
79-
8022
class AVRSubtarget;
8123
class AVRTargetMachine;
8224

@@ -95,8 +37,6 @@ class AVRTargetLowering : public TargetLowering {
9537
return MVT::i8;
9638
}
9739

98-
const char *getTargetNodeName(unsigned Opcode) const override;
99-
10040
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
10141

10242
void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===- AVRSelectionDAGInfo.cpp --------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "AVRSelectionDAGInfo.h"
10+
11+
#define GET_SDNODE_DESC
12+
#include "AVRGenSDNodeInfo.inc"
13+
14+
using namespace llvm;
15+
16+
AVRSelectionDAGInfo::AVRSelectionDAGInfo()
17+
: SelectionDAGGenTargetInfo(AVRGenSDNodeInfo) {}
18+
19+
AVRSelectionDAGInfo::~AVRSelectionDAGInfo() = default;

llvm/lib/Target/AVR/AVRSelectionDAGInfo.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515

1616
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
1717

18+
#define GET_SDNODE_ENUM
19+
#include "AVRGenSDNodeInfo.inc"
20+
1821
namespace llvm {
1922

2023
/// Holds information about the AVR instruction selection DAG.
21-
class AVRSelectionDAGInfo : public SelectionDAGTargetInfo {
24+
class AVRSelectionDAGInfo : public SelectionDAGGenTargetInfo {
2225
public:
26+
AVRSelectionDAGInfo();
27+
28+
~AVRSelectionDAGInfo() override;
2329
};
2430

2531
} // end namespace llvm

llvm/lib/Target/AVR/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tablegen(LLVM AVRGenDisassemblerTables.inc -gen-disassembler)
1010
tablegen(LLVM AVRGenInstrInfo.inc -gen-instr-info)
1111
tablegen(LLVM AVRGenMCCodeEmitter.inc -gen-emitter)
1212
tablegen(LLVM AVRGenRegisterInfo.inc -gen-register-info)
13+
tablegen(LLVM AVRGenSDNodeInfo.inc -gen-sd-node-info)
1314
tablegen(LLVM AVRGenSubtargetInfo.inc -gen-subtarget)
1415

1516
add_public_tablegen_target(AVRCommonTableGen)
@@ -23,6 +24,7 @@ add_llvm_target(AVRCodeGen
2324
AVRISelLowering.cpp
2425
AVRMCInstLower.cpp
2526
AVRRegisterInfo.cpp
27+
AVRSelectionDAGInfo.cpp
2628
AVRShiftExpand.cpp
2729
AVRSubtarget.cpp
2830
AVRTargetMachine.cpp

0 commit comments

Comments
 (0)