@@ -23,11 +23,11 @@ static cl::opt<bool>
23
23
" to lower to librt functions" ),
24
24
cl::init(true ));
25
25
26
- SDValue AArch64SelectionDAGInfo::EmitMOPS (AArch64ISD::NodeType SDOpcode ,
27
- SelectionDAG &DAG, const SDLoc &DL,
28
- SDValue Chain , SDValue Dst ,
29
- SDValue SrcOrValue, SDValue Size ,
30
- Align Alignment, bool isVolatile,
26
+ SDValue AArch64SelectionDAGInfo::EmitMOPS (unsigned Opcode, SelectionDAG &DAG ,
27
+ const SDLoc &DL, SDValue Chain ,
28
+ SDValue Dst , SDValue SrcOrValue ,
29
+ SDValue Size, Align Alignment ,
30
+ bool isVolatile,
31
31
MachinePointerInfo DstPtrInfo,
32
32
MachinePointerInfo SrcPtrInfo) const {
33
33
@@ -36,23 +36,8 @@ SDValue AArch64SelectionDAGInfo::EmitMOPS(AArch64ISD::NodeType SDOpcode,
36
36
if (auto *C = dyn_cast<ConstantSDNode>(Size))
37
37
ConstSize = C->getZExtValue ();
38
38
39
- const bool IsSet = SDOpcode == AArch64ISD::MOPS_MEMSET ||
40
- SDOpcode == AArch64ISD::MOPS_MEMSET_TAGGING;
41
-
42
- const auto MachineOpcode = [&]() {
43
- switch (SDOpcode) {
44
- case AArch64ISD::MOPS_MEMSET:
45
- return AArch64::MOPSMemorySetPseudo;
46
- case AArch64ISD::MOPS_MEMSET_TAGGING:
47
- return AArch64::MOPSMemorySetTaggingPseudo;
48
- case AArch64ISD::MOPS_MEMCOPY:
49
- return AArch64::MOPSMemoryCopyPseudo;
50
- case AArch64ISD::MOPS_MEMMOVE:
51
- return AArch64::MOPSMemoryMovePseudo;
52
- default :
53
- llvm_unreachable (" Unhandled MOPS ISD Opcode" );
54
- }
55
- }();
39
+ const bool IsSet = Opcode == AArch64::MOPSMemorySetPseudo ||
40
+ Opcode == AArch64::MOPSMemorySetTaggingPseudo;
56
41
57
42
MachineFunction &MF = DAG.getMachineFunction ();
58
43
@@ -68,13 +53,13 @@ SDValue AArch64SelectionDAGInfo::EmitMOPS(AArch64ISD::NodeType SDOpcode,
68
53
SrcOrValue = DAG.getNode (ISD::ANY_EXTEND, DL, MVT::i64 , SrcOrValue);
69
54
SDValue Ops[] = {Dst, Size, SrcOrValue, Chain};
70
55
const EVT ResultTys[] = {MVT::i64 , MVT::i64 , MVT::Other};
71
- MachineSDNode *Node = DAG.getMachineNode (MachineOpcode , DL, ResultTys, Ops);
56
+ MachineSDNode *Node = DAG.getMachineNode (Opcode , DL, ResultTys, Ops);
72
57
DAG.setNodeMemRefs (Node, {DstOp});
73
58
return SDValue (Node, 2 );
74
59
} else {
75
60
SDValue Ops[] = {Dst, SrcOrValue, Size, Chain};
76
61
const EVT ResultTys[] = {MVT::i64 , MVT::i64 , MVT::i64 , MVT::Other};
77
- MachineSDNode *Node = DAG.getMachineNode (MachineOpcode , DL, ResultTys, Ops);
62
+ MachineSDNode *Node = DAG.getMachineNode (Opcode , DL, ResultTys, Ops);
78
63
79
64
auto SrcFlags = MachineMemOperand::MOLoad | Vol;
80
65
auto *SrcOp =
@@ -150,8 +135,8 @@ SDValue AArch64SelectionDAGInfo::EmitTargetCodeForMemcpy(
150
135
DAG.getMachineFunction ().getSubtarget <AArch64Subtarget>();
151
136
152
137
if (STI.hasMOPS ())
153
- return EmitMOPS (AArch64ISD::MOPS_MEMCOPY , DAG, DL, Chain, Dst, Src, Size ,
154
- Alignment, isVolatile, DstPtrInfo, SrcPtrInfo);
138
+ return EmitMOPS (AArch64::MOPSMemoryCopyPseudo , DAG, DL, Chain, Dst, Src,
139
+ Size, Alignment, isVolatile, DstPtrInfo, SrcPtrInfo);
155
140
156
141
SMEAttrs Attrs (DAG.getMachineFunction ().getFunction ());
157
142
if (LowerToSMERoutines && !Attrs.hasNonStreamingInterfaceAndBody ())
@@ -168,8 +153,9 @@ SDValue AArch64SelectionDAGInfo::EmitTargetCodeForMemset(
168
153
DAG.getMachineFunction ().getSubtarget <AArch64Subtarget>();
169
154
170
155
if (STI.hasMOPS ())
171
- return EmitMOPS (AArch64ISD::MOPS_MEMSET, DAG, dl, Chain, Dst, Src, Size,
172
- Alignment, isVolatile, DstPtrInfo, MachinePointerInfo{});
156
+ return EmitMOPS (AArch64::MOPSMemorySetPseudo, DAG, dl, Chain, Dst, Src,
157
+ Size, Alignment, isVolatile, DstPtrInfo,
158
+ MachinePointerInfo{});
173
159
174
160
SMEAttrs Attrs (DAG.getMachineFunction ().getFunction ());
175
161
if (LowerToSMERoutines && !Attrs.hasNonStreamingInterfaceAndBody ())
@@ -186,8 +172,8 @@ SDValue AArch64SelectionDAGInfo::EmitTargetCodeForMemmove(
186
172
DAG.getMachineFunction ().getSubtarget <AArch64Subtarget>();
187
173
188
174
if (STI.hasMOPS ())
189
- return EmitMOPS (AArch64ISD::MOPS_MEMMOVE , DAG, dl, Chain, Dst, Src, Size ,
190
- Alignment, isVolatile, DstPtrInfo, SrcPtrInfo);
175
+ return EmitMOPS (AArch64::MOPSMemoryMovePseudo , DAG, dl, Chain, Dst, Src,
176
+ Size, Alignment, isVolatile, DstPtrInfo, SrcPtrInfo);
191
177
192
178
SMEAttrs Attrs (DAG.getMachineFunction ().getFunction ());
193
179
if (LowerToSMERoutines && !Attrs.hasNonStreamingInterfaceAndBody ())
0 commit comments