Skip to content

Commit 0dc205a

Browse files
committed
VE part
1 parent 9c34e71 commit 0dc205a

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

llvm/lib/Target/VE/VE.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class VETargetMachine;
2929

3030
FunctionPass *createVEISelDag(VETargetMachine &TM);
3131
FunctionPass *createLVLGenPass();
32-
void initializeVEDAGToDAGISelPass(PassRegistry &);
32+
void initializeVEDAGToDAGISelLegacyPass(PassRegistry &);
3333

3434
void LowerVEMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
3535
AsmPrinter &AP);

llvm/lib/Target/VE/VEISelDAGToDAG.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ class VEDAGToDAGISel : public SelectionDAGISel {
3434
const VESubtarget *Subtarget;
3535

3636
public:
37-
static char ID;
38-
3937
VEDAGToDAGISel() = delete;
4038

41-
explicit VEDAGToDAGISel(VETargetMachine &tm) : SelectionDAGISel(ID, tm) {}
39+
explicit VEDAGToDAGISel(VETargetMachine &tm) : SelectionDAGISel(tm) {}
4240

4341
bool runOnMachineFunction(MachineFunction &MF) override {
4442
Subtarget = &MF.getSubtarget<VESubtarget>();
@@ -70,11 +68,18 @@ class VEDAGToDAGISel : public SelectionDAGISel {
7068
bool matchADDRrr(SDValue N, SDValue &Base, SDValue &Index);
7169
bool matchADDRri(SDValue N, SDValue &Base, SDValue &Offset);
7270
};
71+
72+
class VEDAGToDAGISelLegacy : public SelectionDAGISelLegacy {
73+
public:
74+
static char ID;
75+
explicit VEDAGToDAGISelLegacy(VETargetMachine &tm)
76+
: SelectionDAGISelLegacy(ID, std::make_unique<VEDAGToDAGISel>(tm)) {}
77+
};
7378
} // end anonymous namespace
7479

75-
char VEDAGToDAGISel::ID = 0;
80+
char VEDAGToDAGISelLegacy::ID = 0;
7681

77-
INITIALIZE_PASS(VEDAGToDAGISel, DEBUG_TYPE, PASS_NAME, false, false)
82+
INITIALIZE_PASS(VEDAGToDAGISelLegacy, DEBUG_TYPE, PASS_NAME, false, false)
7883

7984
bool VEDAGToDAGISel::selectADDRrri(SDValue Addr, SDValue &Base, SDValue &Index,
8085
SDValue &Offset) {
@@ -336,5 +341,5 @@ SDNode *VEDAGToDAGISel::getGlobalBaseReg() {
336341
/// VE-specific DAG, ready for instruction scheduling.
337342
///
338343
FunctionPass *llvm::createVEISelDag(VETargetMachine &TM) {
339-
return new VEDAGToDAGISel(TM);
344+
return new VEDAGToDAGISelLegacy(TM);
340345
}

llvm/lib/Target/VE/VETargetMachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeVETarget() {
3030
RegisterTargetMachine<VETargetMachine> X(getTheVETarget());
3131

3232
PassRegistry &PR = *PassRegistry::getPassRegistry();
33-
initializeVEDAGToDAGISelPass(PR);
33+
initializeVEDAGToDAGISelLegacyPass(PR);
3434
}
3535

3636
static std::string computeDataLayout(const Triple &T) {

0 commit comments

Comments
 (0)