Skip to content

Commit bc8910d

Browse files
committed
[RISCV] Mark RISCVFoldMasks methods as const. NFC
1 parent 2dd5204 commit bc8910d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

llvm/lib/Target/RISCV/RISCVFoldMasks.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class RISCVFoldMasks : public MachineFunctionPass {
4747
StringRef getPassName() const override { return "RISC-V Fold Masks"; }
4848

4949
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;
5252

53-
bool isAllOnesMask(MachineInstr *MaskDef);
53+
bool isAllOnesMask(MachineInstr *MaskDef) const;
5454
};
5555

5656
} // namespace
@@ -59,7 +59,7 @@ char RISCVFoldMasks::ID = 0;
5959

6060
INITIALIZE_PASS(RISCVFoldMasks, DEBUG_TYPE, "RISC-V Fold Masks", false, false)
6161

62-
bool RISCVFoldMasks::isAllOnesMask(MachineInstr *MaskDef) {
62+
bool RISCVFoldMasks::isAllOnesMask(MachineInstr *MaskDef) const {
6363
if (!MaskDef)
6464
return false;
6565
assert(MaskDef->isCopy() && MaskDef->getOperand(0).getReg() == RISCV::V0);
@@ -89,7 +89,8 @@ bool RISCVFoldMasks::isAllOnesMask(MachineInstr *MaskDef) {
8989

9090
// Transform (VMERGE_VVM_<LMUL> false, false, true, allones, vl, sew) to
9191
// (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 {
9394
#define CASE_VMERGE_TO_VMV(lmul) \
9495
case RISCV::PseudoVMERGE_VVM_##lmul: \
9596
NewOpc = RISCV::PseudoVMV_V_V_##lmul; \
@@ -133,7 +134,7 @@ bool RISCVFoldMasks::convertVMergeToVMv(MachineInstr &MI, MachineInstr *V0Def) {
133134
}
134135

135136
bool RISCVFoldMasks::convertToUnmasked(MachineInstr &MI,
136-
MachineInstr *MaskDef) {
137+
MachineInstr *MaskDef) const {
137138
const RISCV::RISCVMaskedPseudoInfo *I =
138139
RISCV::getMaskedPseudoInfo(MI.getOpcode());
139140
if (!I)

0 commit comments

Comments
 (0)