File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1346,7 +1346,6 @@ bool RISCVVLOptimizer::runOnMachineFunction(MachineFunction &MF) {
1346
1346
// For each instruction that defines a vector, compute what VL its
1347
1347
// downstream users demand.
1348
1348
for (MachineBasicBlock *MBB : post_order (&MF)) {
1349
- // Avoid unreachable blocks as they have degenerate dominance
1350
1349
assert (MDT->isReachableFromEntry (MBB));
1351
1350
for (MachineInstr &MI : reverse (*MBB)) {
1352
1351
if (!isCandidate (MI))
@@ -1356,11 +1355,15 @@ bool RISCVVLOptimizer::runOnMachineFunction(MachineFunction &MF) {
1356
1355
}
1357
1356
}
1358
1357
1358
+ // Then go through and see if we can reduce the VL of any instructions to
1359
+ // only what's demanded.
1359
1360
bool MadeChange = false ;
1360
1361
for (MachineBasicBlock &MBB : MF) {
1361
- // Then go through and see if we can reduce the VL of any instructions to
1362
- // only what's demanded.
1363
- for (auto &MI : MBB) {
1362
+ // Avoid unreachable blocks as they have degenerate dominance
1363
+ if (!MDT->isReachableFromEntry (&MBB))
1364
+ continue ;
1365
+
1366
+ for (auto &MI : reverse (MBB)) {
1364
1367
if (!isCandidate (MI))
1365
1368
continue ;
1366
1369
if (!tryReduceVL (MI))
You can’t perform that action at this time.
0 commit comments