5 Commits

Author SHA1 Message Date
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
Andy Kaylor
ea3c225786
[CIR] Add alignment support for global, store, and load ops (#141163)
This adds alignment support for GlobalOp, LoadOp, and StoreOp.

Tests which failed because cir.store/cir.load now print alignment were
updated with wildcard matches, except where the alignment was relevant
to the test. Tests which check for cir.store/cir.load in cases that
don't have explicit alignment were not updated.

New tests for alignment are alignment.c, align-load.c, and
align-store.c.
2025-05-23 15:34:59 -07:00
Andres-Salamanca
35434f2cd9
[CIR] Upstream support for lowering cir.switch to LLVM (#140425)
This PR adds support for lowering the `cir.switch` operation to LLVM. It
includes tests for lowering from `.cir` as well as end-to-end source
code tests.
2025-05-22 10:23:06 -07:00
Andres-Salamanca
f74d893987
[CIR] Upstream support for switch statements case kinds (#138003)
This introduces support for the following cir::case kinds:
- `Equal`
- `AnyOf`
- `Range`
2025-05-07 12:28:35 -07:00
Andres-Salamanca
9d1f1c4c8b
[CIR] Upstream initial support for switch statements (#137106)
This introduces initial support for the switchOP, with caseOP of the
Equal kind. Support for additional case kinds such as AnyOf, Range, and
Default will be included in a future patch. Similarly, lowering to LLVM
IR and flattening of the switch are deferred and will be addressed in
subsequent updates.
2025-04-29 08:43:44 -07:00