<div dir="ltr"><div dir="ltr">On Wed, Sep 30, 2020 at 6:20 AM Nicolai Hähnle via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Paul,<br>
<br>
the intrinsics of all backends together with the target-agnostic<br>
intrinsics are all part of a single large enum, and there are some<br>
subtle assumptions made e.g. about how the values in this enum are<br>
sorted (in order to emit tables that are suitable for binary search).<br>
So this is an area in which to tread carefully.<br></blockquote><div><br></div><div>Strictly speaking, they are no longer part of the same enum:</div><div><a href="http://github.com/llvm/llvm-project/commit/5d986953c8b917bacfaa1f800fc1e242559f76be">http://github.com/llvm/llvm-project/commit/5d986953c8b917bacfaa1f800fc1e242559f76be</a><br></div><div>But yes, they use the same enumerator space, and tablgen processes them all at once.</div><div><br></div><div>Processing intrinsics separately by target requires dividing the 32-bit intrinsic opcode space up front. For example, we could use 8 bits for target, 24 for intrinsics. This would make intrinsic ids no longer dense, and no longer suitable as array indices, but perhaps having distinct arrays per target is better anyway.</div></div></div>