9 Commits

Author SHA1 Message Date
Sirui Mu
b2cdd80411
[CIR] Add support for __builtin_assume_aligned (#152152)
This patch upstreams CIRGen and LLVM lowering support for the
`__builtin_assume_aligned` builtin function.
2025-08-10 12:25:45 +08:00
Sirui Mu
13600c72ce
[CIR] Add CIRGen for cir.unreachable and cir.trap (#151363) 2025-08-05 18:52:02 +08:00
Sirui Mu
3371b9111f
[CIR] Add assume_separate_storage operation (#149696)
This patch adds the `cir.assume_separate_storage` operation for the
`__builtin_assume_separate_storage` builtin function.
2025-07-21 22:21:44 +08:00
Sirui Mu
23104a74e7
[CIR] Add nothrow attribute to the call operation (#145178)
This patch adds extra function attributes to the `cir.call` operation.
The extra attributes now may contain a single `cir.nothrow` attribute
that indicates whether the callee throws.
2025-07-03 22:54:15 +08:00
Andy Kaylor
1e45ea12db
[CIR] Add support for function linkage and visibility (#145600)
This change adds support for function linkage and visibility and related
attributes. Most of the test changes are generalizations to allow
'dso_local' to be accepted where we aren't specifically testing for it.
Some tests based on CIR inputs have been updated to add 'private' to
function declarations where required by newly supported interfaces.

The dso-local.c test has been updated to add specific tests for
dso_local being set correctly, and a new test, func-linkage.cpp tests
other linkage settings.

This change sets `comdat` correctly in CIR, but it is not yet applied to
functions when lowering to LLVM IR. That will be handled in a later
change.
2025-06-25 10:59:30 -07:00
Sirui Mu
9291ad1c96
[CIR] Add support for __builtin_expect (#144726)
This patch adds support for the `__builtin_expect` and
`__builtin_expect_with_probability` builtin functions.
2025-06-24 10:17:12 -07:00
Sirui Mu
8e157fdbb7
[CIR] Add support for __builtin_assume (#144376)
This patch adds support for the `__builtin_assume` builtin function.
2025-06-18 17:10:29 +08:00
Morris Hafner
4bcf9732c7
[CIR] Add Support For Library Builtins (#143984)
This patch upstreams support for builtins that map to a standard library
function. Examples would be abort() and printf().

It also fixes a minor issue with the errorNYI for all remaining
unimplemented builtins using the mlir::Location instead of the clang AST
SourceLocation.
2025-06-16 23:03:49 +01:00
Morris Hafner
8e4f0d8614
[CIR] Upstream minimal builtin function call support (#142981)
This patch adds all bits required to implement builtin function calls to
ClangIR. It doesn't actually implement any of the builtins except those
that fold to a constant ahead of CodeGen
(`__builtin_is_constant_evaluated()` being one example).
2025-06-11 18:24:46 +02:00