[llvm] [RISCV][VLOpt] Reorganize visit order and worklist management (PR #123973)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 22 10:06:02 PST 2025
================
@@ -1292,53 +1292,60 @@ std::optional<MachineOperand> RISCVVLOptimizer::checkUsers(MachineInstr &MI) {
return CommonVL;
}
-bool RISCVVLOptimizer::tryReduceVL(MachineInstr &OrigMI) {
- SetVector<MachineInstr *> Worklist;
- Worklist.insert(&OrigMI);
+bool RISCVVLOptimizer::tryReduceVL(MachineInstr &MI) {
+ LLVM_DEBUG(dbgs() << "Trying to reduce VL for " << MI << "\n");
- bool MadeChange = false;
- while (!Worklist.empty()) {
- MachineInstr &MI = *Worklist.pop_back_val();
- LLVM_DEBUG(dbgs() << "Trying to reduce VL for " << MI << "\n");
+ if (!isVectorRegClass(MI.getOperand(0).getReg(), MRI))
----------------
michaelmaitland wrote:
Do we need this since we skip adding it to the worklist in PushOperands?
https://github.com/llvm/llvm-project/pull/123973
More information about the llvm-commits
mailing list