[llvm-branch-commits] [llvm] e5c6c5c - IntrinsicEmitter: Change IntrinsicsToAttributesMap from uint8_t[] to uint16_t[]
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Feb 12 16:42:48 PST 2021
Author: Fangrui Song
Date: 2021-02-12T16:42:35-08:00
New Revision: e5c6c5c16923b2127a92e8a596ade50b97111b03
URL: https://github.com/llvm/llvm-project/commit/e5c6c5c16923b2127a92e8a596ade50b97111b03
DIFF: https://github.com/llvm/llvm-project/commit/e5c6c5c16923b2127a92e8a596ade50b97111b03.diff
LOG: 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.
(cherry picked from commit b7d63244226ba2c0df651622fe7fe3f5f8aba262)
Added:
Modified:
llvm/utils/TableGen/IntrinsicEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/IntrinsicEmitter.cpp b/llvm/utils/TableGen/IntrinsicEmitter.cpp
index 4be0d90a45d2..978d24c8300d 100644
--- a/llvm/utils/TableGen/IntrinsicEmitter.cpp
+++ b/llvm/utils/TableGen/IntrinsicEmitter.cpp
@@ -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];
More information about the llvm-branch-commits
mailing list