This is an archive of the discontinued LLVM Phabricator instance.

clang: Add __builtin_elementwise_sqrt
ClosedPublic

Authored by arsenm on Jul 31 2023, 1:40 PM.

Details

Summary

This will be used in the opencl builtin headers to provide direct
intrinsic access with proper !fpmath metadata.

Diff Detail

Event Timeline

arsenm created this revision.Jul 31 2023, 1:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 1:40 PM
arsenm requested review of this revision.Jul 31 2023, 1:40 PM

I think you need to mention this new builtin in clang/docs/ReleaseNotes.rst.

clang/lib/CodeGen/CGBuiltin.cpp
2534

Nit: I think despite this code working, it should be moved to be grouped with the other elementwise builtins at around line 3240.
Consider BI__builtin_log at around 2436 and the other log builtins, the bultin_elementwise_log builtin is not in that group since it's with the other elementwise builtins. Writing this case here would make an inconsistency with the placement of the other elementwise builtins.

arsenm added inline comments.Jul 31 2023, 2:23 PM
clang/lib/CodeGen/CGBuiltin.cpp
2534

I think it's more important to group with the emission of the metadata

Also don't understand why there is a broken constrained path and a redundant set of constrained handling in IRBuilder

Shouldn't this new builtin be mentioned in Release Notes?

arsenm updated this revision to Diff 549490.Aug 11 2023, 12:33 PM

Release note

bob80905 accepted this revision.Aug 11 2023, 12:34 PM
This revision is now accepted and ready to land.Aug 11 2023, 12:34 PM