History log of /llvm-project/llvm/lib/IR/Intrinsics.cpp (Results 1 – 8 of 8)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# f4de28a6 28-Jan-2025 Chandler Carruth <chandlerc@gmail.com>

[StrTable] Switch intrinsics to StringTable and work around MSVC (#123548)

Historically, the main example of *very* large string tables used the
`EmitCharArray` to work around MSVC limitations with

[StrTable] Switch intrinsics to StringTable and work around MSVC (#123548)

Historically, the main example of *very* large string tables used the
`EmitCharArray` to work around MSVC limitations with string literals,
but that was switched (without removing the API) in order to consolidate
on a nicer emission primitive.

While this large string table in `IntrinsicsImpl.inc` seems to compile
correctly on MSVC without the work around in `EmitCharArray` (and that
this PR adds back to the nicer emission path), other users have
repeatedly hit this MSVC limitation as you can see in the discussion on
PR https://github.com/llvm/llvm-project/pull/120534. This PR teaches the
string offset table emission to look at
the size of the table and switch to the char array emission strategy
when the table becomes too large.

This work around does have the downside of making compile times worse
for large string tables, but that appears unavoidable until we can
identify known good MSVC versions and switch to requiring them for all
LLVM users. It also reduces searchability of the generated string table
-- I looked at emitting a comment with each string but it is tricky
because the escaping rules for an inline comment are different from
those of of a string literal, and there's no real way to turn the string
literal into a comment.

While improving the output in this way, also clean up the output to not
emit an extraneous empty string at the end of the string table, and
update the `StringTable` class to not look for that. It isn't actually
used by anything and is wasteful.

This PR also switches the `IntrinsicsImpl.inc` string tables over to the
new `StringTable` runtime abstraction. I didn't want to do this until
landing the MSVC workaround in case it caused even this example to start
hitting the MSVC bug, but I wanted to switch here so that I could
simplify the API for emitting the string table with the workaround
present. With the two different emission strategies, its important to
use a very exact syntax and that seems better encapsulated in the API.

Last but not least, the `SDNodeInfoEmitter` is updated, including its
tests to match the new output.

This PR should unblock landing
https://github.com/llvm/llvm-project/pull/120534 and letting us switch
all of
Clang's builtins to use string tables. That PR has all the details
motivating the overall effort.

Follow-up patches will try to consolidate the remaining users onto the
single interface, but those at least were easy to separate into
follow-ups and keep this PR somewhat smaller.

show more ...


Revision tags: llvmorg-19.1.7, llvmorg-19.1.6
# f0297ae5 08-Dec-2024 Chandler Carruth <chandlerc@gmail.com>

Switch the intrinsic names to a string table (#118929)

This avoids the need to dynamically relocate each pointer in the table.

To make this work, this PR also moves the binary search of intrinsic

Switch the intrinsic names to a string table (#118929)

This avoids the need to dynamically relocate each pointer in the table.

To make this work, this PR also moves the binary search of intrinsic
names to an internal function with an adjusted signature, and switches
the unittesting to test against actual intrinsics.

show more ...


Revision tags: llvmorg-19.1.5, llvmorg-19.1.4
# 3c3f19ca 08-Nov-2024 Adrian Kuegel <akuegel@google.com>

Revert "[NFC][LLVM] Use namespace `Intrinsic` in `Intrinsics.cpp` (#114822)"

This reverts commit c2b61fcb3cd4ffa286b24437b7b6d66f0dee6c25.

Intrinsic namespace contains memcpy which is a naming conf

Revert "[NFC][LLVM] Use namespace `Intrinsic` in `Intrinsics.cpp` (#114822)"

This reverts commit c2b61fcb3cd4ffa286b24437b7b6d66f0dee6c25.

Intrinsic namespace contains memcpy which is a naming conflict with
memcpy from string.h header.

show more ...


# c2b61fcb 05-Nov-2024 Rahul Joshi <rjoshi@nvidia.com>

[NFC][LLVM] Use namespace `Intrinsic` in `Intrinsics.cpp` (#114822)

Add `using namespace Intrinsic` to Intrinsics.cpp file.


# 6f10b652 02-Nov-2024 Kazu Hirata <kazu@google.com>

[IR] Remove unused includes (NFC) (#114679)

Identified with misc-include-cleaner.


Revision tags: llvmorg-19.1.3
# 6924fc03 16-Oct-2024 Rahul Joshi <rjoshi@nvidia.com>

[LLVM] Add `Intrinsic::getDeclarationIfExists` (#112428)

Add `Intrinsic::getDeclarationIfExists` to lookup an existing
declaration of an intrinsic in a `Module`.


Revision tags: llvmorg-19.1.2
# fa789dff 11-Oct-2024 Rahul Joshi <rjoshi@nvidia.com>

[NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (#111752)

Rename the function to reflect its correct behavior and to be consistent
with `Module::getOrInsertFunction`. This is a

[NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (#111752)

Rename the function to reflect its correct behavior and to be consistent
with `Module::getOrInsertFunction`. This is also in preparation of
adding a new `Intrinsic::getDeclaration` that will have behavior similar
to `Module::getFunction` (i.e, just lookup, no creation).

show more ...


# 2469d7e3 01-Oct-2024 Rahul Joshi <rjoshi@nvidia.com>

[NFC] Add a new Intrinsics.cpp file for intrinsic code (#110078)

Add new file Intrinsics.cpp and move all functions in the `Intrinsic`
namespace to it.