@@ -31,7 +31,7 @@ using namespace llvm;
31
31
using namespace MIPatternMatch ;
32
32
33
33
bool CombinerHelper::matchExtractVectorElement (MachineInstr &MI,
34
- BuildFnTy &MatchInfo) {
34
+ BuildFnTy &MatchInfo) const {
35
35
GExtractVectorElement *Extract = cast<GExtractVectorElement>(&MI);
36
36
37
37
Register Dst = Extract->getReg (0 );
@@ -89,7 +89,7 @@ bool CombinerHelper::matchExtractVectorElement(MachineInstr &MI,
89
89
}
90
90
91
91
bool CombinerHelper::matchExtractVectorElementWithDifferentIndices (
92
- const MachineOperand &MO, BuildFnTy &MatchInfo) {
92
+ const MachineOperand &MO, BuildFnTy &MatchInfo) const {
93
93
MachineInstr *Root = getDefIgnoringCopies (MO.getReg (), MRI);
94
94
GExtractVectorElement *Extract = cast<GExtractVectorElement>(Root);
95
95
@@ -146,7 +146,8 @@ bool CombinerHelper::matchExtractVectorElementWithDifferentIndices(
146
146
}
147
147
148
148
bool CombinerHelper::matchExtractVectorElementWithBuildVector (
149
- const MachineInstr &MI, const MachineInstr &MI2, BuildFnTy &MatchInfo) {
149
+ const MachineInstr &MI, const MachineInstr &MI2,
150
+ BuildFnTy &MatchInfo) const {
150
151
const GExtractVectorElement *Extract = cast<GExtractVectorElement>(&MI);
151
152
const GBuildVector *Build = cast<GBuildVector>(&MI2);
152
153
@@ -185,7 +186,7 @@ bool CombinerHelper::matchExtractVectorElementWithBuildVector(
185
186
}
186
187
187
188
bool CombinerHelper::matchExtractVectorElementWithBuildVectorTrunc (
188
- const MachineOperand &MO, BuildFnTy &MatchInfo) {
189
+ const MachineOperand &MO, BuildFnTy &MatchInfo) const {
189
190
MachineInstr *Root = getDefIgnoringCopies (MO.getReg (), MRI);
190
191
GExtractVectorElement *Extract = cast<GExtractVectorElement>(Root);
191
192
@@ -252,7 +253,8 @@ bool CombinerHelper::matchExtractVectorElementWithBuildVectorTrunc(
252
253
}
253
254
254
255
bool CombinerHelper::matchExtractVectorElementWithShuffleVector (
255
- const MachineInstr &MI, const MachineInstr &MI2, BuildFnTy &MatchInfo) {
256
+ const MachineInstr &MI, const MachineInstr &MI2,
257
+ BuildFnTy &MatchInfo) const {
256
258
const GExtractVectorElement *Extract = cast<GExtractVectorElement>(&MI);
257
259
const GShuffleVector *Shuffle = cast<GShuffleVector>(&MI2);
258
260
@@ -338,7 +340,7 @@ bool CombinerHelper::matchExtractVectorElementWithShuffleVector(
338
340
}
339
341
340
342
bool CombinerHelper::matchInsertVectorElementOOB (MachineInstr &MI,
341
- BuildFnTy &MatchInfo) {
343
+ BuildFnTy &MatchInfo) const {
342
344
GInsertVectorElement *Insert = cast<GInsertVectorElement>(&MI);
343
345
344
346
Register Dst = Insert->getReg (0 );
@@ -361,7 +363,7 @@ bool CombinerHelper::matchInsertVectorElementOOB(MachineInstr &MI,
361
363
}
362
364
363
365
bool CombinerHelper::matchAddOfVScale (const MachineOperand &MO,
364
- BuildFnTy &MatchInfo) {
366
+ BuildFnTy &MatchInfo) const {
365
367
GAdd *Add = cast<GAdd>(MRI.getVRegDef (MO.getReg ()));
366
368
GVScale *LHSVScale = cast<GVScale>(MRI.getVRegDef (Add->getLHSReg ()));
367
369
GVScale *RHSVScale = cast<GVScale>(MRI.getVRegDef (Add->getRHSReg ()));
@@ -380,7 +382,7 @@ bool CombinerHelper::matchAddOfVScale(const MachineOperand &MO,
380
382
}
381
383
382
384
bool CombinerHelper::matchMulOfVScale (const MachineOperand &MO,
383
- BuildFnTy &MatchInfo) {
385
+ BuildFnTy &MatchInfo) const {
384
386
GMul *Mul = cast<GMul>(MRI.getVRegDef (MO.getReg ()));
385
387
GVScale *LHSVScale = cast<GVScale>(MRI.getVRegDef (Mul->getLHSReg ()));
386
388
@@ -401,7 +403,7 @@ bool CombinerHelper::matchMulOfVScale(const MachineOperand &MO,
401
403
}
402
404
403
405
bool CombinerHelper::matchSubOfVScale (const MachineOperand &MO,
404
- BuildFnTy &MatchInfo) {
406
+ BuildFnTy &MatchInfo) const {
405
407
GSub *Sub = cast<GSub>(MRI.getVRegDef (MO.getReg ()));
406
408
GVScale *RHSVScale = cast<GVScale>(MRI.getVRegDef (Sub->getRHSReg ()));
407
409
@@ -421,7 +423,7 @@ bool CombinerHelper::matchSubOfVScale(const MachineOperand &MO,
421
423
}
422
424
423
425
bool CombinerHelper::matchShlOfVScale (const MachineOperand &MO,
424
- BuildFnTy &MatchInfo) {
426
+ BuildFnTy &MatchInfo) const {
425
427
GShl *Shl = cast<GShl>(MRI.getVRegDef (MO.getReg ()));
426
428
GVScale *LHSVScale = cast<GVScale>(MRI.getVRegDef (Shl->getSrcReg ()));
427
429
0 commit comments