@@ -47,10 +47,10 @@ class RISCVFoldMasks : public MachineFunctionPass {
47
47
StringRef getPassName () const override { return " RISC-V Fold Masks" ; }
48
48
49
49
private:
50
- bool convertToUnmasked (MachineInstr &MI, MachineInstr *MaskDef);
51
- bool convertVMergeToVMv (MachineInstr &MI, MachineInstr *MaskDef);
50
+ bool convertToUnmasked (MachineInstr &MI, MachineInstr *MaskDef) const ;
51
+ bool convertVMergeToVMv (MachineInstr &MI, MachineInstr *MaskDef) const ;
52
52
53
- bool isAllOnesMask (MachineInstr *MaskDef);
53
+ bool isAllOnesMask (MachineInstr *MaskDef) const ;
54
54
};
55
55
56
56
} // namespace
@@ -59,7 +59,7 @@ char RISCVFoldMasks::ID = 0;
59
59
60
60
INITIALIZE_PASS (RISCVFoldMasks, DEBUG_TYPE, " RISC-V Fold Masks" , false , false )
61
61
62
- bool RISCVFoldMasks::isAllOnesMask(MachineInstr *MaskDef) {
62
+ bool RISCVFoldMasks::isAllOnesMask(MachineInstr *MaskDef) const {
63
63
if (!MaskDef)
64
64
return false ;
65
65
assert (MaskDef->isCopy () && MaskDef->getOperand (0 ).getReg () == RISCV::V0);
@@ -89,7 +89,8 @@ bool RISCVFoldMasks::isAllOnesMask(MachineInstr *MaskDef) {
89
89
90
90
// Transform (VMERGE_VVM_<LMUL> false, false, true, allones, vl, sew) to
91
91
// (VMV_V_V_<LMUL> false, true, vl, sew). It may decrease uses of VMSET.
92
- bool RISCVFoldMasks::convertVMergeToVMv (MachineInstr &MI, MachineInstr *V0Def) {
92
+ bool RISCVFoldMasks::convertVMergeToVMv (MachineInstr &MI,
93
+ MachineInstr *V0Def) const {
93
94
#define CASE_VMERGE_TO_VMV (lmul ) \
94
95
case RISCV::PseudoVMERGE_VVM_##lmul: \
95
96
NewOpc = RISCV::PseudoVMV_V_V_##lmul; \
@@ -133,7 +134,7 @@ bool RISCVFoldMasks::convertVMergeToVMv(MachineInstr &MI, MachineInstr *V0Def) {
133
134
}
134
135
135
136
bool RISCVFoldMasks::convertToUnmasked (MachineInstr &MI,
136
- MachineInstr *MaskDef) {
137
+ MachineInstr *MaskDef) const {
137
138
const RISCV::RISCVMaskedPseudoInfo *I =
138
139
RISCV::getMaskedPseudoInfo (MI.getOpcode ());
139
140
if (!I)
0 commit comments