diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -4332,7 +4332,8 @@ let hasSideEffects = 0, mayLoad = 0, mayStore = 0, isCodeGenOnly = 1 in { def PseudoReadVLENB : Pseudo<(outs GPR:$rd), (ins), - [(set GPR:$rd, (riscv_read_vlenb))]>; + [(set GPR:$rd, (riscv_read_vlenb))]>, + Sched<[WriteRdVLENB]>; } let hasSideEffects = 0, mayLoad = 0, mayStore = 0, isCodeGenOnly = 1, diff --git a/llvm/lib/Target/RISCV/RISCVScheduleV.td b/llvm/lib/Target/RISCV/RISCVScheduleV.td --- a/llvm/lib/Target/RISCV/RISCVScheduleV.td +++ b/llvm/lib/Target/RISCV/RISCVScheduleV.td @@ -9,6 +9,9 @@ //===----------------------------------------------------------------------===// /// Define scheduler resources associated with def operands. +// 3.6 Vector Byte Length vlenb +def WriteRdVLENB : SchedWrite; + // 7. Vector Loads and Stores // 7.4. Vector Unit-Stride Instructions def WriteVLDE8 : SchedWrite; @@ -493,6 +496,9 @@ multiclass UnsupportedSchedV { let Unsupported = true in { +// 3.6 Vector Byte Length vlenb +def : WriteRes; + // 7. Vector Loads and Stores def : WriteRes; def : WriteRes;