Skip to content

Commit

Permalink
IntrinsicEmitter: Change IntrinsicsToAttributesMap from uint8_t[] to …
Browse files Browse the repository at this point in the history
…uint16_t[]

We need at least 252 UniqAttributes now, which will soon overflow.
Actually with downstream backends we can easily use up the last few values.
So bump to uint16_t.

(cherry picked from commit b7d6324)
  • Loading branch information
MaskRay authored and tstellar committed Feb 13, 2021
1 parent ef27138 commit e5c6c5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/utils/TableGen/IntrinsicEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,13 @@ void IntrinsicEmitter::EmitAttributes(const CodeGenIntrinsicTable &Ints,
std::max(maxArgAttrs, unsigned(intrinsic.ArgumentAttributes.size()));
unsigned &N = UniqAttributes[&intrinsic];
if (N) continue;
assert(AttrNum < 256 && "Too many unique attributes for table!");
N = ++AttrNum;
assert(N < 65536 && "Too many unique attributes for table!");
}

// Emit an array of AttributeList. Most intrinsics will have at least one
// entry, for the function itself (index ~1), which is usually nounwind.
OS << " static const uint8_t IntrinsicsToAttributesMap[] = {\n";
OS << " static const uint16_t IntrinsicsToAttributesMap[] = {\n";

for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
const CodeGenIntrinsic &intrinsic = Ints[i];
Expand Down

0 comments on commit e5c6c5c

Please sign in to comment.