18194 Commits

Author SHA1 Message Date
Kazu Hirata
325281631a
[clang] Use *Map::try_emplace (NFC) (#140477)
We can simplify the code with *Map::try_emplace where we need
default-constructed values while avoding calling constructors when
keys are already present.
2025-05-19 06:19:53 -07:00
Kazu Hirata
4388f38fbd
[clang] Use llvm::max_element (NFC) (#140435) 2025-05-18 07:33:35 -07:00
Kazu Hirata
013c7ba785
[CodeGen] Use DenseMap::try_emplace (NFC) (#140430)
We can simplify the code with DenseMap::try_emplace and structured
binding.  Note that DenseMap::try_emplace default-constructs the value
if omitted.
2025-05-18 07:33:02 -07:00
Kazu Hirata
f9f69dac2a
[clang] Remove redundant control flow statements (NFC) (#140359) 2025-05-17 12:59:47 -07:00
Justin Bogner
f695c8d529
[DirectX][SPIRV] Fix the lowering of dot4add (#140315)
There were some issues with these ops:
- The overload wasn't being specified (`dx.op.dot4AddPacked` vs
`dx.op.dot4AddPacked.i32`)
- The versioning wasn't correct (These ops were added in SM 6.4)
- The argument order was off - while the HLSL function has the
accumulator as the last argument, the DXIL op lists it first.

This fixes the DXIL.td definition and adjusts the LLVM DX and SPIRV
intrinsics to match the argument order in DXIL rather than the argument
order in HLSL.

Fixes #139018
2025-05-17 10:38:24 -07:00
Kazu Hirata
9adcb4fe12
[clang] Use llvm::replace (NFC) (#140264) 2025-05-16 09:06:31 -07:00
Matthew Devereau
22576e2cce
[Clang][AArch64] Add pessimistic vscale_range for sve/sme (#137624)
The "target-features" function attribute is not currently considered
when adding vscale_range to a function. When +sve/+sme are pushed onto
functions with "#pragma attribute push(+sve/+sme)", the function
potentially misses out on optimizations that rely on vscale_range being
present.
2025-05-16 09:39:07 +01:00
Kiva
af083d09bd
[RISCV] Add zihintpause LLVM/Clang intrinsic (#139519)
This PR adds the missing intrinsic `__builtin_riscv_pause` for the
zihintpause extension.

Spec:
https://five-embeddev.com/riscv-user-isa-manual/Priv-v1.12/zihintpause.html
Fixes #129961
2025-05-16 14:20:53 +08:00
Helena Kotas
f95f3030e5
[HLSL] Implicit resource binding for cbuffers (#139022)
Constant buffers defined with the `cbuffer` keyword do not have a
constructor. Instead, the call to initialize the resource handle based
on its binding is generated in codegen. This change adds initialization
of `cbuffer` handles that have implicit binding.

Closes  #139617
2025-05-15 19:49:29 -07:00
Thurston Dang
b07e19fe5d
[NFCI][cfi] Refactor into 'SanitizerInfoFromCFICheckKind' (#140117)
This refactors existing code into a 'SanitizerInfoFromCFICheckKind'
helper function. This will be useful in future work to annotate CFI
checks with debug info
(https://github.com/llvm/llvm-project/pull/139809).
2025-05-15 16:59:38 -07:00
Finn Plummer
a4eb0db062
[HLSL][RootSignature] Add metadata generation for descriptor tables (#139633)
- prereq: Modify `RootSignatureAttr` to hold a reference to the owned
declaration
- Define and implement `MetadataBuilder` in `HLSLRootSignature`
- Integrate and invoke the builder in `CGHLSLRuntime.cpp` to generate
the Root Signature for any associated entry functions
- Add tests to demonstrate functionality in `RootSignature.hlsl`

Resolves https://github.com/llvm/llvm-project/issues/126584

Note: this is essentially just
https://github.com/llvm/llvm-project/pull/125131 rebased onto the new
approach of constructing a root signature decl, instead of holding the
elements in `AdditionalMembers`.
2025-05-15 14:54:00 -07:00
Steven Perron
2e6433b829
[clang] Emit convergence tokens for loop in global array init (#140120)
When initializing a global array, a loop is generated, but no
convergence is emitted for the loop. This fixes that up.
2025-05-15 17:44:34 -04:00
Thurston Dang
5defe490c9
[sanitizer][NFCI] Add 'SanitizerAnnotateDebugInfo' (#139965)
This generalizes the debug info annotation code from https://github.com/llvm/llvm-project/pull/139149 and moves it into a helper function, SanitizerAnnotateDebugInfo().

Future work can use 'ApplyDebugLocation ApplyTrapDI(*this, SanitizerAnnotateDebugInfo(Ordinal));' to add annotations to additional checks.
2025-05-15 09:24:04 -07:00
Lukacma
6fc0312919
[Clang][AArch64] Add fp8 variants for untyped NEON intrinsics (#128019)
This patch adds fp8 variants to existing intrinsics, whose operation
doesn't depend on arguments being a specific type.

It also changes mfloat8 type representation in memory from `i8` to
`<1xi8>`
2025-05-15 14:01:41 +01:00
Helena Kotas
520773b47e
[HLSL] Add resource constructor with implicit binding for global resources (#138976)
Adds constructor for resources with implicit binding and applies it to
all resources without binding at the global scope.
Adds Clang builtin function
`__builtin_hlsl_resource_handlefromimplicitbinding` that gets translated
to `llvm.dx|spv.resource.handlefromimplicitbinding` intrinsic calls.
Specific bindings are assigned in DXILResourceImplicitBinding pass.

Design proposals:

https://github.com/llvm/wg-hlsl/blob/main/proposals/0024-implicit-resource-binding.md

https://github.com/llvm/wg-hlsl/blob/main/proposals/0025-resource-constructors.md

One change from the proposals is that the `orderId` parameter is added
onto the constructor. Originally it was supposed to be generated in
codegen when the `llvm.dx|spv.resource.handlefromimplicitbinding` call
is emitted, but that is not possible because the call is inside a
constructor, and the constructor body is generated once per resource
type and not resource instance. So the only way to inject instance-based
data like `orderId` into the
`llvm.dx|spv.resource.handlefromimplicitbinding` call is that it must
come in via the constructor argument.

Closes #136784
2025-05-14 18:41:17 -07:00
Jessica Clarke
864f0ff4ef
[clang][IR] Overload @llvm.thread.pointer to support non-AS0 targets (#132489)
Thread-local globals live, by default, in the default globals address
space, which may not be 0, so we need to overload @llvm.thread.pointer
to support other address spaces, and use the default globals address
space in Clang.
2025-05-14 21:51:56 +01:00
Tomohiro Kashiwada
a3d52ea99e
[Cygwin] RTTI and VTable should be dllexport-ed (#139798)
Behaves as same as both of Clang and GCC targetting MinGW. Required for
compatibility for Cygwin-GCC.

Divided from https://github.com/llvm/llvm-project/pull/138773
2025-05-14 22:22:18 +03:00
Tomohiro Kashiwada
76d866f793
[Cygwin] Global symbols should be external by default (#139797)
Behaves as same as both of Clang and GCC targetting MinGW. Required for
compatibility for Cygwin-GCC.

Divided from https://github.com/llvm/llvm-project/pull/138773
2025-05-14 22:21:09 +03:00
Craig Topper
bf0655f208
[RISCV] Improve casting between i1 scalable vectors and i8 fixed vectors for -mrvv-vector-bits (#139190)
For i1 vectors, we used an i8 fixed vector as the storage type.

If the known minimum number of elements of the scalable vector type is
less than 8, we were doing the cast through memory. This used a load or
store from a fixed vector alloca. If  is less than 8, DataLayout
indicates that the load/store reads/writes vscale bytes even if vscale
is known and vscale*X is less than or equal to 8. This means the load or
store is outside the bounds of the fixed size alloca as far as
DataLayout is concerned leading to undefined behavior.

This patch avoids this by widening the i1 scalable vector type with zero
elements until it is divisible by 8. This allows it be bitcasted to/from
an i8 scalable vector. We then insert or extract the i8 fixed vector
into this type.

Hopefully this enables #130973 to be accepted.
2025-05-14 10:27:00 -07:00
Timm Baeder
9ca8248a91
[clang] Save ShuffleVectorExpr args as ConstantExpr (#139709)
The passed indices have to be constant integers anyway, which we verify
before creating the ShuffleVectorExpr. Use the value we create there and
save the indices using a ConstantExpr instead. This way, we don't have
to evaluate the args every time we call getShuffleMaskIdx().
2025-05-14 16:13:01 +02:00
Hood Chatham
e29b70ee11
[WebAssembly][Clang] Add __builtin_wasm_ref_is_null_extern (#139580)
I also fixed __builtin_wasm_ref_null_extern() to generate a diagnostic
when it gets an argument. It seems like `SemaRef.checkArgCount()` has a
bug that makes it unable to check for 0 args.
2025-05-13 21:36:51 -07:00
Bill Wendling
9ae3bce175
[Clang][counted_by] Add support for 'counted_by' on struct pointers (#137250)
The 'counted_by' attribute is now available for pointers in structs.
It generates code for sanity checks as well as
__builtin_dynamic_object_size()
calculations. For example:

  struct annotated_ptr {
    int count;
    char *buf __attribute__((counted_by(count)));
  };

If the pointer's type is 'void *', use the 'sized_by' attribute, which
works similarly to 'counted_by', but can handle the 'void' base type:

  struct annotated_ptr {
    int count;
    void *buf __attribute__((sized_by(count)));
  };

If the 'count' field member occurs after the pointer, use the
'-fexperimental-late-parse-attributes' flag during compilation.

Note that 'counted_by' cannot be applied to a pointer to an incomplete
type, because the size isn't known.

  struct foo;
  struct annotated_ptr {
    int count;
    struct foo *buf __attribute__((counted_by(count))); /* invalid */
  };

Signed-off-by: Bill Wendling <morbo@google.com>
2025-05-13 16:01:36 -07:00
ykhatav
3cf280c16a
Emit nested unused enum types with -fno-eliminate-unused-debug-types (#137818)
Unused types are retained in the debug info when
-fno-eliminate-unused-debug-types is specified.
However, unused nested enums were not being emitted even with this
option.
This patch fixes the missing emission of unused nested enums with
-fno-eliminate-unused-debug-types
2025-05-13 11:29:53 -04:00
Finn Plummer
dd3d7cfe2e
[HLSL][RootSignature] Define and integrate rootsig clang attr and decl (#137690)
- Defines a new declaration node `HLSLRootSignature` in `DeclNodes.td`
that will consist of a `TrailingObjects` of the in-memory construction
of the root signature, namely an array of `hlsl::rootsig::RootElement`s

- Defines a new clang attr `RootSignature` which simply holds an
identifier to a corresponding root signature declaration as above

- Integrate the `HLSLRootSignatureParser` to construct the decl node in
`ParseMicrosoftAttributes` and then attach the parsed attr with an
identifier to the entry point function declaration.

- Defines the various required declaration methods

- Add testing that the declaration and reference attr are created
correctly, and some syntactical error tests.

It was previously proposed that we could have the root elements
reference be stored directly as an additional member of the attribute
and to not have a separate root signature decl. In contrast, by defining
them separately as this change proposes, we will allow a unique root
signature to have its own declaration in the AST tree. This allows us to
only construct a single root signature for all duplicate root signature
attributes. Having it located directly as a declaration might also prove
advantageous when we consider root signature libraries.

Resolves https://github.com/llvm/llvm-project/issues/119011
2025-05-12 09:59:46 -07:00
Kazu Hirata
64f53db79c
[clang] Use StringRef::consume_front (NFC) (#139472) 2025-05-11 15:38:22 -07:00
Kazu Hirata
f5f8ddc166
[clang] Remove redundant calls to std::unique_ptr<T>::get (NFC) (#139399) 2025-05-10 12:11:17 -07:00
Daniel Paoliello
97a58b04c6
[aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (#125320)
Adds support for MSVC's undocumented `/funcoverride` flag, which marks
functions as being replaceable by the Windows kernel loader. This is
used to allow functions to be upgraded depending on the capabilities of
the current processor (e.g., the kernel can be built with the naive
implementation of a function, but that function can be replaced at boot
with one that uses SIMD instructions if the processor supports them).

For each marked function we need to generate:
* An undefined symbol named `<name>_$fo$`.
* A defined symbol `<name>_$fo_default$` that points to the `.data`
section (anywhere in the data section, it is assumed to be zero sized).
* An `/ALTERNATENAME` linker directive that points from `<name>_$fo$` to
`<name>_$fo_default$`.

This is used by the MSVC linker to generate the appropriate metadata in
the Dynamic Value Relocation Table.

Marked function must never be inlined (otherwise those inline sites
can't be replaced).

Note that I've chosen to implement this in AsmPrinter as there was no
way to create a `GlobalVariable` for `<name>_$fo$` that would result in
a symbol being emitted (as nothing consumes it and it has no
initializer). I tried to have `llvm.used` and `llvm.compiler.used` point
to it, but this didn't help.

Within LLVM I referred to this feature as "loader replaceable" as
"function override" already has a different meaning to C++ developers...

I also took the opportunity to extract the feature symbol generation
code used by both AArch64 and X86 into a common function in AsmPrinter.
2025-05-09 14:56:38 -07:00
Oliver Hunt
65a6cbde5b
[clang] Add support for __ptrauth being applied to integer types (#137580)
Allows the __ptrauth qualifier to be applied to pointer sized integer types,
updates Sema to ensure trivially copyable, etc correctly handle address
discriminated integers, and updates codegen to perform authentication
around arithmetic on the types.
2025-05-09 13:12:09 -07:00
Daniel Paoliello
72c3ed6745
[win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (#129142)
Adds support for emitting Windows x64 Unwind V2 information, includes
support `/d2epilogunwind` in clang-cl.

Unwind v2 adds information about the epilogs in functions such that the
unwinder can unwind even in the middle of an epilog, without having to
disassembly the function to see what has or has not been cleaned up.

Unwind v2 requires that all epilogs are in "canonical" form:
* If there was a stack allocation (fixed or dynamic) in the prolog, then
the first instruction in the epilog must be a stack deallocation.
* Next, for each `PUSH` in the prolog there must be a corresponding
`POP` instruction in exact reverse order.
* Finally, the epilog must end with the terminator.

This change adds a pass to validate epilogs in modules that have Unwind
v2 enabled and, if they pass, emits new pseudo instructions to MC that
1) note that the function is using unwind v2 and 2) mark the start of
the epilog (this is either the first `POP` if there is one, otherwise
the terminator instruction). If a function does not meet these
requirements, it is downgraded to Unwind v1 (i.e., these new pseudo
instructions are not emitted).

Note that the unwind v2 table only marks the size of the epilog in the
"header" unwind code, but it's possible for epilogs to use different
terminator instructions thus they are not all the same size. As a work
around for this, MC will assume that all terminator instructions are
1-byte long - this still works correctly with the Windows unwinder as it
is only using the size to do a range check to see if a thread is in an
epilog or not, and since the instruction pointer will never be in the
middle of an instruction and the terminator is always at the end of an
epilog the range check will function correctly. This does mean, however,
that the "at end" optimization (where an epilog unwind code can be
elided if the last epilog is at the end of the function) can only be
used if the terminator is 1-byte long.

One other complication with the implementation is that the unwind table
for a function is emitted during streaming, however we can't calculate
the distance between an epilog and the end of the function at that time
as layout hasn't been completed yet (thus some instructions may be
relaxed). To work around this, epilog unwind codes are emitted via a
fixup. This also means that we can't pre-emptively downgrade a function
to Unwind v1 if one of these offsets is too large, so instead we raise
an error (but I've passed through the location information, so the user
will know which of their functions is problematic).
2025-05-09 10:42:10 -07:00
Matt Arsenault
5ae2aed218
clang: Remove dest LangAS argument from performAddrSpaceCast (#138866)
It isn't used and is redundant with the result pointer type argument.
A more reasonable API would only have LangAS parameters, or IR parameters,
not both. Not all values have a meaningful value for this. I'm also
not sure why we have this at all, it's not overridden by any targets and
further simplification is possible.
2025-05-09 14:24:54 +02:00
Matt Arsenault
e8898a6275
clang: Read the address space from the ABIArgInfo (#138865)
Do not assume it's the alloca address space, we have an explicit
address space to use for the argument already. Also use the original
value's type instead of assuming DefaultAS.
2025-05-09 14:19:00 +02:00
Matt Arsenault
416cdcf3aa
clang/OpenCL: Fix special casing OpenCL in call emission (#138864)
This essentially reverts 1bf1a156d673.

OpenCL's handling of address spaces has always been a mess, but it's
better than it used to be so this hack appears to be unnecessary now.

None of the code here should really depend on the language or language
address space. The ABI address space to use is already explicit in the
ABIArgInfo, so use that instead of guessing it has anything to do with
LangAS::Default or getASTAllocaAddressSpace.

The below usage of LangAS::Default and getASTAllocaAddressSpace are also
suspect, but appears to be a more involved and separate fix.
2025-05-09 14:15:56 +02:00
Yingwei Zheng
d2b012e391
[Clang][CodeGen] Enable pointer overflow check for GCC workaround (#137849)
Do not suppress the pointer overflow check for the `(i8*) nullptr + N`
idiom.

Related issue: https://github.com/llvm/llvm-project/issues/137833
2025-05-09 14:53:00 +08:00
Helena Kotas
3bc3b1c6c0
[HLSL][NFC] Rename isImplicit() to hasRegisterStot() on HLSLResourceBindingAttr (#138964)
Renaming because the name `isImplicit` is ambiguous. It can mean
implicit attribute or implicit binding.
2025-05-08 10:03:21 -07:00
Marina Taylor
850d96e63a
[ObjC] Also enable ARC attachedcall operand bundle for arm64_32. (#138677)
It was enabled for "aarch64", which covers arm64e but not arm64_32.

Co-authored-by: Ahmed Bougacha <ahmed@bougacha.org>
2025-05-08 16:48:18 +01:00
Kirill Radkin
b3ef15aa00
[RISCV] Fix generation of DWARF info for vector segmented types (#137941)
In DWARF info RISC-V Vector types are presented as DW_TAG_array_type
with tags DW_AT_type (what elements does this array consist of) and
DW_TAG_subrange_type. DW_TAG_subrange_type have DW_AT_upper_bound tag
which contain upper bound value for this array.

For now, it's generate same DWARF info about length of segmented types
and their corresponding non-tuple types.

For example, vint32m4x2_t and vint32m4_t have DW_TAG_array_type with
same DW_AT_type and DW_TAG_subrange_type, it means that this types have
same length, which is not correct
(vint32m4x2_t length is twice as big as vint32m4_t)
2025-05-08 18:29:27 +08:00
Matt Arsenault
a11d86461e
clang: Fix broken implicit cast to generic address space (#138863)
This fixes emitting undefined behavior where a 64-bit generic
pointer is written to a 32-bit slot allocated for a private pointer.
This can be seen in test/CodeGenOpenCL/amdgcn-automatic-variable.cl's
wrong_pointer_alloca.
2025-05-08 07:51:57 +02:00
Prabhu Rajasekaran
20d6375796
[clang] Handle CC attrs for UEFI (#138935)
UEFI's default ABI is MS ABI. Handle the calling convention attributes
accordingly.
2025-05-07 21:42:01 -07:00
Thurston Dang
6a28d8c24a
[sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (#138577)
@fmayer introduced '-mllvm -array-bounds-pseudofn'
(https://github.com/llvm/llvm-project/pull/128977/) to make it easier to
see why crashes occurred, and to estimate with a profiler the cycles
spent on these array-bounds checks. This functionality could be usefully
generalized to other checks in future work.

This patch adds the plumbing for -fsanitize-annotate-debug-info, and
connects it to the existing array-bounds-pseudo-fn functionality i.e.,
-fsanitize-annotate-debug-info=array-bounds can be used as a replacement
for '-mllvm -array-bounds-pseudofn', though we do not yet delete the
latter.

Note: we replaced '-mllvm -array-bounds-pseudofn' in
clang/test/CodeGen/bounds-checking-debuginfo.c, because adding test
cases would modify the line numbers in the test assertions, and
therefore obscure that the test output is the same between '-mllvm
-array-bounds-pseudofn' and -fsanitize-annotate-debug-info=array-bounds.
2025-05-07 15:57:01 -07:00
Matt Arsenault
9808e1f982
clang: Remove unnecessary pointer bitcast (#138857) 2025-05-07 19:24:34 +02:00
Nick Sarnie
93f61ceadb
[clang][NFC] Fix some more incorrectly formatted comments (#138342)
More fixes based on https://github.com/llvm/llvm-project/pull/138036

---------

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-05-07 14:25:08 +00:00
Kees Cook
c7b2d98c93
[sancov] Introduce optional callback for stack-depth tracking (#138323)
Normally -fsanitize-coverage=stack-depth inserts inline arithmetic to
update thread_local __sancov_lowest_stack. To support stack depth
tracking in the Linux kernel, which does not implement traditional
thread_local storage, provide the option to call a function instead.

This matches the existing "stackleak" implementation that is supported
in Linux via a GCC plugin. To make this coverage more performant, a
minimum estimated stack depth can be chosen to enable the callback mode,
skipping instrumentation of functions with smaller stacks.

With -fsanitize-coverage-stack-depth-callback-min set greater than 0,
the __sanitize_cov_stack_depth() callback will be injected when the
estimated stack depth is greater than or equal to the given minimum.
2025-05-07 05:41:24 -07:00
Aniket Lal
c3ce5684a8
[Clang][OpenCL][AMDGPU] OpenCL Kernel stubs should be assigned alwaysinline attribute (#137769)
OpenCL Kernels body is emitted as stubs and the kernel is emitted as
call to respective stub.
(https://github.com/llvm/llvm-project/pull/115821).
The stub function should be alwaysinlined, since call to stub can cause
performance drop.

Co-authored-by: anikelal <anikelal@amd.com>
2025-05-07 15:42:23 +05:30
cor3ntin
300d4026f7
[Clang] Implement the core language parts of P2786 - Trivial relocation (#127636)
This adds

- The parsing of `trivially_relocatable_if_eligible`,
`replaceable_if_eligible` keywords
- `__builtin_trivially_relocate`, implemented in terms of memmove. In
the future this should
- Add the appropriate start/end lifetime markers that llvm does not have
(`start_lifetime_as`)
     - Add support for ptrauth when that's upstreamed

- the `__builtin_is_cpp_trivially_relocatable` and
`__builtin_is_replaceable` traits


Fixes #127609
2025-05-06 14:13:32 +02:00
Jim Lin
658cac84a1
[RISCV] Rename XCValu intrinsic name *_slet(u) to *_sle(u)) (#138498)
The instruction name and intrinsic name have been renamed to sle(u). The
`t` was removed. Please refer to
https://github.com/openhwgroup/core-v-sw/blob/master/specifications/corev-builtin-spec.md.
2025-05-06 09:57:07 +08:00
Sarah Spall
02e0a954a0
[HLSL] Handle init list with OpaqueValueExprs in CGExprScalar (#138541)
When an HLSL Init list is producing a Scalar, handle OpaqueValueExprs in
the Init List with 'emitInitListOpaqueValues'
Copied from 'AggExprEmitter::VisitCXXParenListOrInitListExpr'
Closes #136408

---------

Co-authored-by: Chris B <beanz@abolishcrlf.org>
2025-05-05 13:04:41 -07:00
Kazu Hirata
f002f300c5
[clang] Remove unused local variables (NFC) (#138453) 2025-05-04 10:51:40 -07:00
Craig Topper
123758b1f4
[IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (#138324)
Most callers want a constant index. Instead of making every caller
create a ConstantInt, we can do it in IRBuilder. This is similar to
createInsertElement/createExtractElement.
2025-05-02 16:10:18 -07:00
Nick Sarnie
aa4b44e699
[clang][NFC] Fix some clang-format mistakes (#138036)
Fixes for https://github.com/llvm/llvm-project/pull/138000

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-05-02 14:12:35 +00:00
Nikita Popov
4109bac330
[IR] Do not store Function inside BlockAddress (#137958)
Currently BlockAddresses store both the Function and the BasicBlock they
reference, and the BlockAddress is part of the use list of both the
Function and BasicBlock.

This is quite awkward, because this is not really a use of the function
itself (and walks of function uses generally skip block addresses for
that reason). This also has weird implications on function RAUW (as that
will replace the function in block addresses in a way that generally
doesn't make sense), and causes other peculiar issues, like the ability
to have multiple block addresses for one block (with different
functions).

Instead, I believe it makes more sense to specify only the basic block
and let the function be implied by the BB parent. This does mean that we
may have block addresses without a function (if the BB is not inserted),
but this should only happen during IR construction.
2025-05-02 09:40:50 +02:00