Skip to content

Commit 30b2c3b

Browse files
committed
fixup! Remove toMaskIdx.
1 parent 5bf2247 commit 30b2c3b

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

llvm/include/llvm/CodeGen/RDFRegisters.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct RegisterRef {
116116

117117
constexpr unsigned asMaskIdx() const {
118118
assert(isMask());
119-
return toMaskIdx(Reg);
119+
return Reg & ~MaskFlag;
120120
}
121121

122122
constexpr operator bool() const {
@@ -138,11 +138,6 @@ struct RegisterRef {
138138

139139
static constexpr RegisterId toMaskId(unsigned Idx) { return Idx | MaskFlag; }
140140

141-
static constexpr unsigned toMaskIdx(RegisterId Id) {
142-
assert(isMaskId(Id));
143-
return Id & ~MaskFlag;
144-
}
145-
146141
bool operator<(RegisterRef) const = delete;
147142
bool operator==(RegisterRef) const = delete;
148143
bool operator!=(RegisterRef) const = delete;
@@ -157,7 +152,7 @@ struct PhysicalRegisterInfo {
157152
}
158153

159154
const uint32_t *getRegMaskBits(RegisterId R) const {
160-
return RegMasks.get(RegisterRef::toMaskIdx(R));
155+
return RegMasks.get(RegisterRef(R).asMaskIdx());
161156
}
162157

163158
bool alias(RegisterRef RA, RegisterRef RB) const;
@@ -170,7 +165,7 @@ struct PhysicalRegisterInfo {
170165
}
171166

172167
const BitVector &getMaskUnits(RegisterId MaskId) const {
173-
return MaskInfos[RegisterRef::toMaskIdx(MaskId)].Units;
168+
return MaskInfos[RegisterRef(MaskId).asMaskIdx()].Units;
174169
}
175170

176171
std::set<RegisterId> getUnits(RegisterRef RR) const;

0 commit comments

Comments
 (0)