[cfe-dev] [PROPOSAL] Reintroduce guards for Intel intrinsic headers

Sean Silva chisophugis at gmail.com
Fri Jul 31 13:55:52 PDT 2015


On Fri, Jul 31, 2015 at 9:26 AM, Reid Kleckner <rnk at google.com> wrote:

> On Thu, Jul 30, 2015 at 2:53 PM, Robinson, Paul <
> Paul_Robinson at playstation.sony.com> wrote:
>
>> The problem that we reported in PR24125 is fundamentally that for
>> intrinsics implemented as macros (rather than inline functions) the symptom
>> for "you didn't set the right target" is a backend crash. For those
>> intrinsics there's no function to attach the attribute to.  I was thinking
>> about re-introducing the #ifdefs for those cases, so we'd be going back to
>> the "undefined identifier" diagnostic from the frontend.  But I'd be
>> happier with some other solution that worked more smoothly for macros.
>>
>
> The macro intrinsics are pretty gnarly. I'd love it if we could come up
> with a principled solution to the general problem of always_inline
> functions that need to propagate constant parameters into their bodies.
>

Did you see  the thread "__attribute__((enable_if(...))) for de-macroifying
the builtin headers"? I think the macros can be disposed of using a
solution along those lines. There are some details to discuss, but the
fundamental approach I think can be made to work.



> Barring a solution to the general problem, we could at least address
> PR24125 by having all the macros call an artificial empty inline function
> with __attribute__((target)).
>

That would probably improve the state of things, but I still worry about
what the diagnostic quality would be.

-- Sean Silva


>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150731/25442878/attachment.html>


More information about the cfe-dev mailing list