Skip to content

Commit beb2c7f

Browse files
authored
[RISCV] Move TargetOverlapConstraintType from RISCVVPseudo to TSFlags. NFC (#75877)
It can be more efficiently accessed from TSFlags and won't require extra storage. NFC because it wasn't exported to the cpp PseudoTable and isn't used in tree yet.
1 parent 0905865 commit beb2c7f

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ enum {
113113

114114
UsesVXRMShift = HasRoundModeOpShift + 1,
115115
UsesVXRMMask = 1 << UsesVXRMShift,
116+
117+
// Indicates whether these instructions can partially overlap between source
118+
// registers and destination registers according to the vector spec.
119+
// 0 -> not a vector pseudo
120+
// 1 -> default value for vector pseudos. not widening or narrowing.
121+
// 2 -> narrowing case
122+
// 3 -> widening case
123+
TargetOverlapConstraintTypeShift = UsesVXRMShift + 1,
124+
TargetOverlapConstraintTypeMask = 3ULL << TargetOverlapConstraintTypeShift,
116125
};
117126

118127
enum VLMUL : uint8_t {

llvm/lib/Target/RISCV/RISCVInstrFormats.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,15 @@ class RVInstCommon<dag outs, dag ins, string opcodestr, string argstr,
212212
// to the correct CSR.
213213
bit UsesVXRM = 0;
214214
let TSFlags{20} = UsesVXRM;
215+
216+
// Indicates whther these instructions can partially overlap between source
217+
// registers and destination registers according to the vector spec.
218+
// 0 -> not a vector pseudo
219+
// 1 -> default value for vector pseudos. not widening or narrowing.
220+
// 2 -> narrowing case
221+
// 3 -> widening case
222+
bits<2> TargetOverlapConstraintType = 0;
223+
let TSFlags{22-21} = TargetOverlapConstraintType;
215224
}
216225

217226
class RVInst<dag outs, dag ins, string opcodestr, string argstr,

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -529,14 +529,6 @@ class RISCVVPseudo {
529529
// SEW = 0 is used to denote that the Pseudo is not SEW specific (or unknown).
530530
bits<8> SEW = 0;
531531
bit NeedBeInPseudoTable = 1;
532-
// TargetOverlapConstraintType indicates that these instructions can
533-
// overlap between source operands and destination operands.
534-
// 1 -> default value, remain current constraint
535-
// 2 -> narrow case
536-
// 3 -> widen case
537-
// TODO: Add TargetOverlapConstraintType into PseudosTable for further
538-
// query.
539-
bits<2> TargetOverlapConstraintType = 1;
540532
}
541533

542534
// The actual table.

0 commit comments

Comments
 (0)