@@ -262,6 +262,17 @@ struct DemandedFields {
262
262
VLZeroness = true ;
263
263
}
264
264
265
+ // Make this the result of demanding both the fields in this and B.
266
+ void doUnion (const DemandedFields &B) {
267
+ VLAny |= B.VLAny ;
268
+ VLZeroness |= B.VLZeroness ;
269
+ SEW = std::max (SEW, B.SEW );
270
+ LMUL |= B.LMUL ;
271
+ SEWLMULRatio |= B.SEWLMULRatio ;
272
+ TailPolicy |= B.TailPolicy ;
273
+ MaskPolicy |= B.MaskPolicy ;
274
+ }
275
+
265
276
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
266
277
// / Support for debugging, callable in GDB: V->dump()
267
278
LLVM_DUMP_METHOD void dump () const {
@@ -1547,16 +1558,6 @@ void RISCVInsertVSETVLI::doPRE(MachineBasicBlock &MBB) {
1547
1558
AvailableInfo, OldExit);
1548
1559
}
1549
1560
1550
- static void doUnion (DemandedFields &A, DemandedFields B) {
1551
- A.VLAny |= B.VLAny ;
1552
- A.VLZeroness |= B.VLZeroness ;
1553
- A.SEW = std::max (A.SEW , B.SEW );
1554
- A.LMUL |= B.LMUL ;
1555
- A.SEWLMULRatio |= B.SEWLMULRatio ;
1556
- A.TailPolicy |= B.TailPolicy ;
1557
- A.MaskPolicy |= B.MaskPolicy ;
1558
- }
1559
-
1560
1561
// Return true if we can mutate PrevMI to match MI without changing any the
1561
1562
// fields which would be observed.
1562
1563
static bool canMutatePriorConfig (const MachineInstr &PrevMI,
@@ -1606,7 +1607,7 @@ bool RISCVCoalesceVSETVLI::coalesceVSETVLIs(MachineBasicBlock &MBB) {
1606
1607
for (MachineInstr &MI : make_range (MBB.rbegin (), MBB.rend ())) {
1607
1608
1608
1609
if (!isVectorConfigInstr (MI)) {
1609
- doUnion (Used, getDemanded (MI, MRI, ST));
1610
+ Used. doUnion (getDemanded (MI, MRI, ST));
1610
1611
if (MI.isCall () || MI.isInlineAsm () ||
1611
1612
MI.modifiesRegister (RISCV::VL, /* TRI=*/ nullptr ) ||
1612
1613
MI.modifiesRegister (RISCV::VTYPE, /* TRI=*/ nullptr ))
0 commit comments