diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td @@ -105,83 +105,76 @@ class VLESched : Sched<[ !cast("WriteVLDE_"#suffix), - !cast("ReadVLDX_"#suffix), ReadVMask + ReadVLDX, ReadVMask ]>; class VSESched : Sched<[ !cast("WriteVSTE_" # suffix), !cast("ReadVSTEV_" # suffix), - !cast("ReadVSTX_" # suffix), ReadVMask + ReadVSTX, ReadVMask ]>; class VLSSched : Sched<[ !cast("WriteVLDS" #n #"_" # suffix), - !cast("ReadVLDX_" # suffix), - !cast("ReadVLDSX_" # suffix), ReadVMask + ReadVLDX, ReadVLDSX, ReadVMask ]>; class VSSSched : Sched<[ !cast("WriteVSTS" #n #"_"#suffix), !cast("ReadVSTS" #n #"V_"#suffix), - !cast("ReadVSTX_"#suffix), - !cast("ReadVSTSX_"#suffix), ReadVMask + ReadVSTX, ReadVSTSX, ReadVMask ]>; class VLXSched : Sched<[ !cast("WriteVLD" #o #"X" #n #"_" # suffix), - !cast("ReadVLDX_" # suffix), + ReadVLDX, !cast("ReadVLD" #o #"XV_" # suffix), ReadVMask ]>; class VSXSched : Sched<[ !cast("WriteVST" #o #"X" #n #"_"#suffix), !cast("ReadVST" #o #"X" #n #"_"#suffix), - !cast("ReadVSTX_"#suffix), - !cast("ReadVST" #o #"XV_"#suffix), ReadVMask + ReadVSTX, !cast("ReadVST" #o #"XV_"#suffix), ReadVMask ]>; class VLFSched : Sched<[ !cast("WriteVLDFF_" # suffix), - !cast("ReadVLDX_" # suffix), ReadVMask + ReadVLDX, ReadVMask ]>; // Unit-Stride Segment Loads and Stores class VLSEGSched : Sched<[ !cast("WriteVLSEG" #nf #"e" #eew #"_"#suffix), - !cast("ReadVLDX_"#suffix), ReadVMask + ReadVLDX, ReadVMask ]>; class VSSEGSched : Sched<[ !cast("WriteVSSEG" #nf #"e" #eew #"_"#suffix), !cast("ReadVSTEV_"#suffix), - !cast("ReadVSTX_"#suffix), ReadVMask + ReadVSTX, ReadVMask ]>; class VLSEGFFSched : Sched<[ !cast("WriteVLSEGFF" #nf #"e" #eew #"_"#suffix), - !cast("ReadVLDX_"#suffix), ReadVMask + ReadVLDX, ReadVMask ]>; // Strided Segment Loads and Stores class VLSSEGSched : Sched<[ !cast("WriteVLSSEG" #nf #"e" #eew #"_"#suffix), - !cast("ReadVLDX_"#suffix), - !cast("ReadVLDSX_"#suffix), ReadVMask + ReadVLDX, ReadVLDSX, ReadVMask ]>; class VSSSEGSched : Sched<[ !cast("WriteVSSSEG" #nf #"e" #eew #"_"#suffix), !cast("ReadVSTS" #eew #"V_"#suffix), - !cast("ReadVSTX_"#suffix), - !cast("ReadVSTSX_"#suffix), ReadVMask + ReadVSTX, ReadVSTSX, ReadVMask ]>; // Indexed Segment Loads and Stores class VLXSEGSched : Sched<[ !cast("WriteVL" #o #"XSEG" #nf #"e" #eew #"_"#suffix), - !cast("ReadVLDX_"#suffix), - !cast("ReadVLD" #o #"XV" #"_"#suffix), ReadVMask + ReadVLDX, !cast("ReadVLD" #o #"XV" #"_"#suffix), ReadVMask ]>; class VSXSEGSched : Sched<[ !cast("WriteVS" #o #"XSEG" #nf #"e" #eew #"_"#suffix), !cast("ReadVST" #o #"X" #eew # "_"#suffix), - !cast("ReadVSTX_"#suffix), - !cast("ReadVST" #o #"XV" # "_"#suffix), ReadVMask + ReadVSTX, !cast("ReadVST" #o #"XV" # "_"#suffix), ReadVMask ]>; //===----------------------------------------------------------------------===// @@ -972,12 +965,12 @@ defvar s = !cast("WriteVLD" # !add(nf, 1) # "R"); def E # l # _V : VWholeLoad, - Sched<[s, ReadVLDX_WorstCase]>; + Sched<[s, ReadVLDX]>; } } multiclass VWholeLoadEEW64 nf, string opcodestr, RegisterClass VRC, SchedReadWrite schedrw> { def E64_V : VWholeLoad, - Sched<[schedrw, ReadVLDX_WorstCase]>; + Sched<[schedrw, ReadVLDX]>; } //===----------------------------------------------------------------------===// @@ -1017,9 +1010,9 @@ let Predicates = [HasVInstructions] in { def VLM_V : VUnitStrideLoadMask<"vlm.v">, - Sched<[WriteVLDM_WorstCase, ReadVLDX_WorstCase]>; + Sched<[WriteVLDM_WorstCase, ReadVLDX]>; def VSM_V : VUnitStrideStoreMask<"vsm.v">, - Sched<[WriteVSTM_WorstCase, ReadVSTM_WorstCase, ReadVSTX_WorstCase]>; + Sched<[WriteVSTM_WorstCase, ReadVSTM_WorstCase, ReadVSTX]>; def : InstAlias<"vle1.v $vd, (${rs1})", (VLM_V VR:$vd, GPR:$rs1), 0>; def : InstAlias<"vse1.v $vs3, (${rs1})", @@ -1031,13 +1024,13 @@ defm VL8R : VWholeLoadN<7, "vl8r", VRM8>; def VS1R_V : VWholeStore<0, "vs1r.v", VR>, - Sched<[WriteVST1R, ReadVST1R, ReadVSTX_WorstCase]>; + Sched<[WriteVST1R, ReadVST1R, ReadVSTX]>; def VS2R_V : VWholeStore<1, "vs2r.v", VRM2>, - Sched<[WriteVST2R, ReadVST2R, ReadVSTX_WorstCase]>; + Sched<[WriteVST2R, ReadVST2R, ReadVSTX]>; def VS4R_V : VWholeStore<3, "vs4r.v", VRM4>, - Sched<[WriteVST4R, ReadVST4R, ReadVSTX_WorstCase]>; + Sched<[WriteVST4R, ReadVST4R, ReadVSTX]>; def VS8R_V : VWholeStore<7, "vs8r.v", VRM8>, - Sched<[WriteVST8R, ReadVST8R, ReadVSTX_WorstCase]>; + Sched<[WriteVST8R, ReadVST8R, ReadVSTX]>; def : InstAlias<"vl1r.v $vd, (${rs1})", (VL1RE8_V VR:$vd, GPR:$rs1)>; def : InstAlias<"vl2r.v $vd, (${rs1})", (VL2RE8_V VRM2:$vd, GPR:$rs1)>; 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 @@ -1701,10 +1701,9 @@ foreach mti = AllMasks in { defvar mx = mti.LMul.MX; defvar WriteVLDM_MX = !cast("WriteVLDM_" # mx); - defvar ReadVLDX_MX = !cast("ReadVLDX_" # mx); let VLMul = mti.LMul.value in { def "_V_" # mti.BX : VPseudoUSLoadNoMask, - Sched<[WriteVLDM_MX, ReadVLDX_MX]>; + Sched<[WriteVLDM_MX, ReadVLDX]>; } } } @@ -1780,10 +1779,9 @@ foreach mti = AllMasks in { defvar mx = mti.LMul.MX; defvar WriteVSTM_MX = !cast("WriteVSTM_" # mx); - defvar ReadVSTX_MX = !cast("ReadVSTX_" # mx); let VLMul = mti.LMul.value in { def "_V_" # mti.BX : VPseudoUSStoreNoMask, - Sched<[WriteVSTM_MX, ReadVSTX_MX]>; + Sched<[WriteVSTM_MX, ReadVSTX]>; } } } 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 @@ -402,15 +402,15 @@ def ReadVSETVL : SchedRead; // 7. Vector Loads and Stores -defm "" : LMULSchedReads<"ReadVLDX">; -defm "" : LMULSchedReads<"ReadVSTX">; +def ReadVLDX : SchedRead; +def ReadVSTX : SchedRead; // 7.4. Vector Unit-Stride Instructions defm "" : LMULSchedReads<"ReadVSTEV">; // 7.4.1. Vector Unit-Strided Mask defm "" : LMULSchedReads<"ReadVSTM">; // 7.5. Vector Strided Instructions -defm "" : LMULSchedReads<"ReadVLDSX">; -defm "" : LMULSchedReads<"ReadVSTSX">; +def ReadVLDSX : SchedRead; +def ReadVSTSX : SchedRead; defm "" : LMULSchedReads<"ReadVSTS8V">; defm "" : LMULSchedReads<"ReadVSTS16V">; defm "" : LMULSchedReads<"ReadVSTS32V">; @@ -814,12 +814,12 @@ def : ReadAdvance; // 7. Vector Loads and Stores -defm "" : LMULReadAdvance<"ReadVLDX", 0>; -defm "" : LMULReadAdvance<"ReadVSTX", 0>; +def : ReadAdvance; +def : ReadAdvance; defm "" : LMULReadAdvance<"ReadVSTEV", 0>; defm "" : LMULReadAdvance<"ReadVSTM", 0>; -defm "" : LMULReadAdvance<"ReadVLDSX", 0>; -defm "" : LMULReadAdvance<"ReadVSTSX", 0>; +def : ReadAdvance; +def : ReadAdvance; defm "" : LMULReadAdvance<"ReadVSTS8V", 0>; defm "" : LMULReadAdvance<"ReadVSTS16V", 0>; defm "" : LMULReadAdvance<"ReadVSTS32V", 0>;