diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp --- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp +++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp @@ -219,6 +219,10 @@ if (Strict) return false; + // Store instructions don't use the policy fields. + if (InstrInfo.StoreOp && VLMul == InstrInfo.VLMul && SEW == InstrInfo.SEW) + return true; + // If this is a mask reg operation, it only cares about VLMAX. // FIXME: Mask reg operations are probably ok if "this" VLMAX is larger // than "InstrInfo". @@ -271,15 +275,6 @@ if (hasCompatibleVTYPE(InstrInfo, Strict)) return true; - // Strict matches must ensure a full VTYPE match. - if (Strict) - return false; - - // Store instructions don't use the policy fields. - // TODO: Move into hasCompatibleVTYPE? - if (InstrInfo.StoreOp && VLMul == InstrInfo.VLMul && SEW == InstrInfo.SEW) - return true; - // Anything else is not compatible. return false; }