Skip to content

Commit 6dde0bc

Browse files
toppercmahesh-attarde
authored andcommitted
[RISCV] Use empty() instead of size()==0. NFC (llvm#149868)
Move the assert past the code that determines if the pass should run.
1 parent 1448426 commit 6dde0bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,6 @@ bool RISCVVLOptimizer::tryReduceVL(MachineInstr &MI) const {
14861486
}
14871487

14881488
bool RISCVVLOptimizer::runOnMachineFunction(MachineFunction &MF) {
1489-
assert(DemandedVLs.size() == 0);
14901489
if (skipFunction(MF.getFunction()))
14911490
return false;
14921491

@@ -1499,6 +1498,8 @@ bool RISCVVLOptimizer::runOnMachineFunction(MachineFunction &MF) {
14991498

15001499
TII = ST.getInstrInfo();
15011500

1501+
assert(DemandedVLs.empty());
1502+
15021503
// For each instruction that defines a vector, compute what VL its
15031504
// downstream users demand.
15041505
for (MachineBasicBlock *MBB : post_order(&MF)) {

0 commit comments

Comments
 (0)