[llvm] [RISCV][VLOpt] Minor worklist invariant cleanup [NFC] (PR #123989)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 06:57:45 PST 2025


================
@@ -1347,14 +1348,11 @@ bool RISCVVLOptimizer::runOnMachineFunction(MachineFunction &MF) {
   auto PushOperands = [this, &Worklist](MachineInstr &MI,
                                         bool IgnoreSameBlock) {
     for (auto &Op : MI.operands()) {
-      if (!Op.isReg() || !Op.isUse() || !Op.getReg().isVirtual())
-        continue;
-
-      if (!isVectorRegClass(Op.getReg(), MRI))
+      if (!Op.isReg() || !Op.isUse() || !Op.getReg().isVirtual() ||
+          !isVectorRegClass(Op.getReg(), MRI))
----------------
michaelmaitland wrote:

I don't know that we check isVectorRegClass in isCandidate, although we could probably move this check to isCandidate?

https://github.com/llvm/llvm-project/pull/123989


More information about the llvm-commits mailing list