-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Overloaded Intrinsic Functions #1669
Comments
sounds good to me |
Patch to implement these features Remaining to do:
|
Updated patch to implement overloaded intrinsics Patch for llvm-gcc to follow shortly. |
llvm-gcc patch |
Chris, The patches attached to this PR (overloaded intrinsics) are ready for review. Thanks, Reid. |
Comments here: In general, please email patches to llvm-commits. I will see them sooner than if you attach them to a bug. -Chris |
I generally do but mentioned adding this one to the PR in IRC and you said
Actually, I did and reverted it. For some reason I care not to investigate this I'll implement all your other suggestions. This one we can revisit separately. |
Right. In SDISel, you need to lower it to create the ctpop node (f.e.) with matching source and
This is a serious problem.
Perhaps not yet, but we may in the future. The name should be mangled to include one suffix for every If you want to avoid changing everything, I think that fixing the codegen and making the "count" -Chris |
Okay, I'll give SDISel one more shot. If it doesn't get happy then I'm going to Either way, I will add the return type overloading in a subsequent patch. |
llvm-gcc patch (revised) |
This is done, right? |
This is now done and working with 5 intrinsics. |
Extended Description
With there now being up to 8 million integer types, we need the ability to
overload intrinsic functions by the type of their arguments. To this end, this
PR tracks work that I'm doing to:
of any bit width
variety of integer bit widths. For example llvm.ctpop will now work on any
integer bit width.
mechanisms (bswap, ctpop, cttz, ctlz).
the recognizers where only the prefix should be matched for overloaded
intrinsics.
bit_select (select one bit from many)
bit_set (set a bit in an integer of arbitrary width)
bit_part_set (set a range of bits in an arbitrary integer)
bit_part_select (select a set of bits from an integer type)
bit_concat (concat two integer values of arbitrary width)
bit_and_reduce (reduce an iAny to i1 by applying AND bitwise)
bit_or_reduce (reduce an iAny to i1 by applying OR bitwise)
bit_xor_reduce (reduce an iAny to i1 by applying XOR bitwise)
bit_nand_reduce (reduce an iAny to i1 by applying NAND bitwise)
bit_nor_reduce (reduce an iAny to i1 by applying NOR bitwise)
bit_nxor_reduce (reduce an iAny to i1 by applying NXOR bitwise)
the suffix is of the correct form (. followed by the actual type for each
iAny type).
regardless of whether a target supports lowering them itself (to an
instruction). Targets (and CBE and LLI) can decide which of these intrinsics
they wish to support directly. The others will be lowered to internal
functions of a similar name (. -> _) with bodies defined in LLVM IR. These
function bodies would then need to be code generated. Only those overloadings
actually used (called) will be generated.
The text was updated successfully, but these errors were encountered: