Skip to content

Commit 0662f8d

Browse files
fix all the targets I missed in #66003
1 parent ab68742 commit 0662f8d

25 files changed

+133
-121
lines changed

llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ class BPFDAGToDAGISel : public SelectionDAGISel {
6161

6262
void PreprocessISelDAG() override;
6363

64-
bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintCode,
64+
bool SelectInlineAsmMemoryOperand(const SDValue &Op,
65+
InlineAsm::ConstraintCode ConstraintCode,
6566
std::vector<SDValue> &OutOps) override;
6667

67-
6868
private:
6969
// Include the pieces autogenerated from the target description.
7070
#include "BPFGenDAGISel.inc"
@@ -159,12 +159,13 @@ bool BPFDAGToDAGISel::SelectFIAddr(SDValue Addr, SDValue &Base,
159159
}
160160

161161
bool BPFDAGToDAGISel::SelectInlineAsmMemoryOperand(
162-
const SDValue &Op, unsigned ConstraintCode, std::vector<SDValue> &OutOps) {
162+
const SDValue &Op, InlineAsm::ConstraintCode ConstraintCode,
163+
std::vector<SDValue> &OutOps) {
163164
SDValue Op0, Op1;
164165
switch (ConstraintCode) {
165166
default:
166167
return true;
167-
case InlineAsm::Constraint_m: // memory
168+
case InlineAsm::ConstraintCode::m: // memory
168169
if (!SelectAddr(Op, Op0, Op1))
169170
return true;
170171
break;

llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -955,17 +955,17 @@ void HexagonDAGToDAGISel::Select(SDNode *N) {
955955
SelectCode(N);
956956
}
957957

958-
bool HexagonDAGToDAGISel::
959-
SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
960-
std::vector<SDValue> &OutOps) {
958+
bool HexagonDAGToDAGISel::SelectInlineAsmMemoryOperand(
959+
const SDValue &Op, InlineAsm::ConstraintCode ConstraintID,
960+
std::vector<SDValue> &OutOps) {
961961
SDValue Inp = Op, Res;
962962

963963
switch (ConstraintID) {
964964
default:
965965
return true;
966-
case InlineAsm::Constraint_o: // Offsetable.
967-
case InlineAsm::Constraint_v: // Not offsetable.
968-
case InlineAsm::Constraint_m: // Memory.
966+
case InlineAsm::ConstraintCode::o: // Offsetable.
967+
case InlineAsm::ConstraintCode::v: // Not offsetable.
968+
case InlineAsm::ConstraintCode::m: // Memory.
969969
if (SelectAddrFI(Inp, Res))
970970
OutOps.push_back(Res);
971971
else
@@ -977,7 +977,6 @@ SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
977977
return false;
978978
}
979979

980-
981980
static bool isMemOPCandidate(SDNode *I, SDNode *U) {
982981
// I is an operand of U. Check if U is an arithmetic (binary) operation
983982
// usable in a memop, where the other operand is a loaded value, and the

llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class HexagonDAGToDAGISel : public SelectionDAGISel {
8585
/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
8686
/// inline asm expressions.
8787
bool SelectInlineAsmMemoryOperand(const SDValue &Op,
88-
unsigned ConstraintID,
88+
InlineAsm::ConstraintCode ConstraintID,
8989
std::vector<SDValue> &OutOps) override;
9090
bool tryLoadOfLoadIntrinsic(LoadSDNode *N);
9191
bool SelectBrevLdIntrinsic(SDNode *IntN);

llvm/lib/Target/Lanai/LanaiISelDAGToDAG.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ class LanaiDAGToDAGISel : public SelectionDAGISel {
5959
return SelectionDAGISel::runOnMachineFunction(MF);
6060
}
6161

62-
bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintCode,
62+
bool SelectInlineAsmMemoryOperand(const SDValue &Op,
63+
InlineAsm::ConstraintCode ConstraintCode,
6364
std::vector<SDValue> &OutOps) override;
6465

6566
private:
@@ -284,12 +285,13 @@ bool LanaiDAGToDAGISel::selectAddrRr(SDValue Addr, SDValue &R1, SDValue &R2,
284285
}
285286

286287
bool LanaiDAGToDAGISel::SelectInlineAsmMemoryOperand(
287-
const SDValue &Op, unsigned ConstraintCode, std::vector<SDValue> &OutOps) {
288+
const SDValue &Op, InlineAsm::ConstraintCode ConstraintCode,
289+
std::vector<SDValue> &OutOps) {
288290
SDValue Op0, Op1, AluOp;
289291
switch (ConstraintCode) {
290292
default:
291293
return true;
292-
case InlineAsm::Constraint_m: // memory
294+
case InlineAsm::ConstraintCode::m: // memory
293295
if (!selectAddrRr(Op, Op0, Op1, AluOp) &&
294296
!selectAddrRi(Op, Op0, Op1, AluOp))
295297
return true;

llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,21 @@ void LoongArchDAGToDAGISel::Select(SDNode *Node) {
9191
}
9292

9393
bool LoongArchDAGToDAGISel::SelectInlineAsmMemoryOperand(
94-
const SDValue &Op, unsigned ConstraintID, std::vector<SDValue> &OutOps) {
94+
const SDValue &Op, InlineAsm::ConstraintCode ConstraintID,
95+
std::vector<SDValue> &OutOps) {
9596
SDValue Base = Op;
9697
SDValue Offset =
9798
CurDAG->getTargetConstant(0, SDLoc(Op), Subtarget->getGRLenVT());
9899
switch (ConstraintID) {
99100
default:
100101
llvm_unreachable("unexpected asm memory constraint");
101102
// Reg+Reg addressing.
102-
case InlineAsm::Constraint_k:
103+
case InlineAsm::ConstraintCode::k:
103104
Base = Op.getOperand(0);
104105
Offset = Op.getOperand(1);
105106
break;
106107
// Reg+simm12 addressing.
107-
case InlineAsm::Constraint_m:
108+
case InlineAsm::ConstraintCode::m:
108109
if (CurDAG->isBaseWithConstantOffset(Op)) {
109110
ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Op.getOperand(1));
110111
if (isIntN(12, CN->getSExtValue())) {
@@ -115,10 +116,10 @@ bool LoongArchDAGToDAGISel::SelectInlineAsmMemoryOperand(
115116
}
116117
break;
117118
// Reg+0 addressing.
118-
case InlineAsm::Constraint_ZB:
119+
case InlineAsm::ConstraintCode::ZB:
119120
break;
120121
// Reg+(simm14<<2) addressing.
121-
case InlineAsm::Constraint_ZC:
122+
case InlineAsm::ConstraintCode::ZC:
122123
if (CurDAG->isBaseWithConstantOffset(Op)) {
123124
ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Op.getOperand(1));
124125
if (isIntN(16, CN->getSExtValue()) &&

llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class LoongArchDAGToDAGISel : public SelectionDAGISel {
3838

3939
void Select(SDNode *Node) override;
4040

41-
bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
41+
bool SelectInlineAsmMemoryOperand(const SDValue &Op,
42+
InlineAsm::ConstraintCode ConstraintID,
4243
std::vector<SDValue> &OutOps) override;
4344

4445
bool SelectBaseAddr(SDValue Addr, SDValue &Base);

llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4296,12 +4296,12 @@ LoongArchTargetLowering::getConstraintType(StringRef Constraint) const {
42964296
return TargetLowering::getConstraintType(Constraint);
42974297
}
42984298

4299-
unsigned LoongArchTargetLowering::getInlineAsmMemConstraint(
4299+
InlineAsm::ConstraintCode LoongArchTargetLowering::getInlineAsmMemConstraint(
43004300
StringRef ConstraintCode) const {
4301-
return StringSwitch<unsigned>(ConstraintCode)
4302-
.Case("k", InlineAsm::Constraint_k)
4303-
.Case("ZB", InlineAsm::Constraint_ZB)
4304-
.Case("ZC", InlineAsm::Constraint_ZC)
4301+
return StringSwitch<InlineAsm::ConstraintCode>(ConstraintCode)
4302+
.Case("k", InlineAsm::ConstraintCode::k)
4303+
.Case("ZB", InlineAsm::ConstraintCode::ZB)
4304+
.Case("ZC", InlineAsm::ConstraintCode::ZC)
43054305
.Default(TargetLowering::getInlineAsmMemConstraint(ConstraintCode));
43064306
}
43074307

llvm/lib/Target/LoongArch/LoongArchISelLowering.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ class LoongArchTargetLowering : public TargetLowering {
283283

284284
ConstraintType getConstraintType(StringRef Constraint) const override;
285285

286-
unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const override;
286+
InlineAsm::ConstraintCode
287+
getInlineAsmMemConstraint(StringRef ConstraintCode) const override;
287288

288289
std::pair<unsigned, const TargetRegisterClass *>
289290
getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,

llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ namespace {
103103
bool MatchWrapper(SDValue N, MSP430ISelAddressMode &AM);
104104
bool MatchAddressBase(SDValue N, MSP430ISelAddressMode &AM);
105105

106-
bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
106+
bool SelectInlineAsmMemoryOperand(const SDValue &Op,
107+
InlineAsm::ConstraintCode ConstraintID,
107108
std::vector<SDValue> &OutOps) override;
108109

109110
// Include the pieces autogenerated from the target description.
@@ -282,13 +283,13 @@ bool MSP430DAGToDAGISel::SelectAddr(SDValue N,
282283
return true;
283284
}
284285

285-
bool MSP430DAGToDAGISel::
286-
SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
287-
std::vector<SDValue> &OutOps) {
286+
bool MSP430DAGToDAGISel::SelectInlineAsmMemoryOperand(
287+
const SDValue &Op, InlineAsm::ConstraintCode ConstraintID,
288+
std::vector<SDValue> &OutOps) {
288289
SDValue Op0, Op1;
289290
switch (ConstraintID) {
290291
default: return true;
291-
case InlineAsm::Constraint_m: // memory
292+
case InlineAsm::ConstraintCode::m: // memory
292293
if (!SelectAddr(Op, Op0, Op1))
293294
return true;
294295
break;

llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,16 +308,16 @@ void MipsDAGToDAGISel::Select(SDNode *Node) {
308308
SelectCode(Node);
309309
}
310310

311-
bool MipsDAGToDAGISel::
312-
SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
313-
std::vector<SDValue> &OutOps) {
311+
bool MipsDAGToDAGISel::SelectInlineAsmMemoryOperand(
312+
const SDValue &Op, InlineAsm::ConstraintCode ConstraintID,
313+
std::vector<SDValue> &OutOps) {
314314
// All memory constraints can at least accept raw pointers.
315315
switch(ConstraintID) {
316316
default:
317317
llvm_unreachable("Unexpected asm memory constraint");
318-
case InlineAsm::Constraint_m:
319-
case InlineAsm::Constraint_R:
320-
case InlineAsm::Constraint_ZC:
318+
case InlineAsm::ConstraintCode::m:
319+
case InlineAsm::ConstraintCode::R:
320+
case InlineAsm::ConstraintCode::ZC:
321321
OutOps.push_back(Op);
322322
return false;
323323
}

0 commit comments

Comments
 (0)