File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -89,12 +89,14 @@ bool RISCVVectorPeephole::convertToVLMAX(MachineInstr &MI) const {
89
89
return false ;
90
90
91
91
// Fixed-point value, denominator=8
92
- unsigned ScaleFixed = 8 ;
92
+ uint64_t ScaleFixed = 8 ;
93
93
// Check if the VLENB was potentially scaled with slli/srli
94
94
if (Def->getOpcode () == RISCV::SLLI) {
95
+ assert (Def->getOperand (2 ).getImm () < 64 );
95
96
ScaleFixed <<= Def->getOperand (2 ).getImm ();
96
97
Def = MRI->getVRegDef (Def->getOperand (1 ).getReg ());
97
98
} else if (Def->getOpcode () == RISCV::SRLI) {
99
+ assert (Def->getOperand (2 ).getImm () < 64 );
98
100
ScaleFixed >>= Def->getOperand (2 ).getImm ();
99
101
Def = MRI->getVRegDef (Def->getOperand (1 ).getReg ());
100
102
}
@@ -109,6 +111,7 @@ bool RISCVVectorPeephole::convertToVLMAX(MachineInstr &MI) const {
109
111
// A Log2SEW of 0 is an operation on mask registers only
110
112
unsigned SEW = Log2SEW ? 1 << Log2SEW : 8 ;
111
113
assert (RISCVVType::isValidSEW (SEW) && " Unexpected SEW" );
114
+ assert (8 * LMULFixed / SEW > 0 );
112
115
113
116
// AVL = (VLENB * Scale)
114
117
//
You can’t perform that action at this time.
0 commit comments