Skip to content

Commit b7d6324

Browse files
committed
IntrinsicEmitter: Change IntrinsicsToAttributesMap from uint8_t[] to 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.
1 parent 5c1cea6 commit b7d6324

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/TableGen/IntrinsicEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,13 @@ void IntrinsicEmitter::EmitAttributes(const CodeGenIntrinsicTable &Ints,
638638
std::max(maxArgAttrs, unsigned(intrinsic.ArgumentAttributes.size()));
639639
unsigned &N = UniqAttributes[&intrinsic];
640640
if (N) continue;
641-
assert(AttrNum < 256 && "Too many unique attributes for table!");
642641
N = ++AttrNum;
642+
assert(N < 65536 && "Too many unique attributes for table!");
643643
}
644644

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

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

0 commit comments

Comments
 (0)