Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIR] Extend support for floating point attributes #572

Open
wants to merge 1,521 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1521 commits
Select commit Hold shift + click to select a range
94d428b
Revert "[CIR][CIRGen][Exception] Workaround internal testcase break"
bcardosolopes Nov 3, 2023
099f575
[CIR] Add cir.std.find operation
bcardosolopes Dec 12, 2023
1e0e169
[CIR] Raise std::find call to cir.std.find
bcardosolopes Dec 12, 2023
dba066d
[CIR][Lowering] Fix function ptr field lowering in a global struct (#…
gitoleg Dec 13, 2023
59d6eb9
[CIR][NFC] Formatting
lanza Dec 14, 2023
a8e47cf
[CIR] Vector types - part 1 (#347)
dkolsen-pgi Dec 14, 2023
bc1a644
[CIR][CodeGen][Lowering] Support multi-block case/default clauses (#356)
gitoleg Dec 19, 2023
5fed9bd
[CIR][NFC] Fix some copy n paste and update comments
bcardosolopes Dec 19, 2023
d58857d
[CIR][Passes] Introduce cir-lib-opt pass
bcardosolopes Dec 19, 2023
15f763b
[CIR] Fix issues pointed by github CI
bcardosolopes Dec 20, 2023
abcf931
[CIR] Add iterator_{begin,end} ops
bcardosolopes Dec 20, 2023
ee41cbd
[CIR][IdiomRecognizer] Recognize few variations for begin/end iterators
bcardosolopes Dec 20, 2023
073a014
[CIR][CodeGen] Use signed type for result of ptrdiff operation. (#355)
yugr Dec 21, 2023
be3f6f7
[CIR] support -std=gnu89 (#358)
gitoleg Dec 21, 2023
ffd5ae3
[CIR][CodeGen] support extern var in function (#359)
gitoleg Dec 21, 2023
6c4bf4c
[CIR][Codegen] Adds Stack save-restore ops (#346)
gitoleg Dec 21, 2023
1ef7eab
[CIR][Lowering][Bugfix] Lower nested breaks in switch statements (#357)
gitoleg Dec 21, 2023
d5b3cc1
[CIR] Change mock std::array iterator definitions
bcardosolopes Dec 21, 2023
8fb3356
[CIR][IdiomRecognizer] Make iterator recognition more strict
bcardosolopes Dec 21, 2023
28bf4ec
[CIR] Cleanup idiom-recognizer and lib-opt options
bcardosolopes Dec 22, 2023
2fdc25b
[CIR][LibOpt] Add a first transformation: std::find to memchr
bcardosolopes Dec 22, 2023
1139cfe
[mlir][llvm] Fixes CallOp builder for the case of indirect call
gitoleg Dec 22, 2023
cb09502
[CIR][CodeGen] Fix flat offset lowering code to consider field alignm…
yugr Dec 13, 2023
8d37db3
Revert "[mlir][llvm] Fixes CallOp builder for the case of indirect call"
gitoleg Dec 26, 2023
cb185ad
[CIR][Lowering][Bugfix] Lower ScopeOp with return op (#364)
gitoleg Jan 4, 2024
7d4101a
[CIR][CodeGen] Support lowering of cir.const with ZeroAttr. (#365)
yugr Jan 4, 2024
67da9e6
[CIR][Lowering][Bugfix] explicit lowering for the indirect call
gitoleg Dec 26, 2023
f88ee31
[CIR][CIRGen][NFC] Enhance alloca helpers (#367)
gitoleg Jan 4, 2024
403ae40
[CIR][Lowering] add cir.ternary to scf.if lowering (#368)
Kuree Jan 4, 2024
b21e81e
[CIR][CIRGen] supports struct copy from function call result (#369)
gitoleg Jan 4, 2024
ead25fe
[CIR][CodeGen] Fix lowering for class types (#378)
philnik777 Jan 4, 2024
be13b81
[CIR][Lowering] Support lowering of cir.const with GlobalViewAttr (gh…
yugr Jan 4, 2024
f387e1a
[CIR][CIRGen] emit cir.zero for constant string literals (#373)
Lancern Jan 4, 2024
2bde4fe
[CIR][CIRGen] Lvalues and comma expression (#376)
Lancern Jan 4, 2024
6a0e742
[CIR] Replace AnyType with CIR_AnyType (#371)
Lancern Jan 9, 2024
1d442f6
[CIR][CIRGen] Support array def after decl with unknown bound (#375)
Lancern Jan 9, 2024
0affd8d
[CIR][CIRGen] Implement constant evaluation for integral builtins (#381)
philnik777 Jan 9, 2024
3aeb3e0
[CIR][Transforms][NFC] Refactor MergeCleanups pass (#384)
sitio-couto Jan 9, 2024
006dfd0
[CIR][NFC] Enable the formatting workflow for llvm/clangir and format…
philnik777 Jan 10, 2024
67859c4
[CIR][Transforms][Bugfix] Do not use-after-free in MergeCleanups and …
yugr Jan 10, 2024
58ccd20
[CIR][IR] Implement loop's conditional operation (#391)
sitio-couto Jan 10, 2024
8fa0bbb
[CIR][NFC] Canonicalize the names of the lowering classes
philnik777 Jan 10, 2024
ada6175
[CIR][CIRGen][NFC] Support yielding values in LexicalScope
sitio-couto Jan 10, 2024
d744421
[CIR][CIRGen][NFC] Return scope result in compound stmt builders
sitio-couto Jan 10, 2024
50d414a
[CIR][CIRGen] Partially support statement expressions return values
sitio-couto Jan 10, 2024
9cbc015
[CIR] Introduce exception info type
bcardosolopes Nov 3, 2023
fbb25ae
[CIR][CIRGen][Exceptions] More on try statemet codegen: wrap with cir…
bcardosolopes Jan 11, 2024
b0dd640
[CIR][NFC] Update comment for implemented fix
bcardosolopes Jan 11, 2024
21718ce
[CIR][CIRGen] Fix wrong assert
bcardosolopes Nov 13, 2023
439217e
[CIR] Add a CIRCallOpInterface, on top of CallOpInterface
bcardosolopes Jan 11, 2024
7463d87
[CIR][NFC] Refactor cir.call into a tablegen helper class
bcardosolopes Jan 12, 2024
d3e07d2
[CIR] Introduce cir.try_call operation
bcardosolopes Jan 12, 2024
2d58e58
[CIR][CIRGen] Add constraints to inline assembly (#351)
gitoleg Jan 16, 2024
b91b91c
[CIR][Lowering] Support lowering of const arrays of structs (#370)
gitoleg Jan 16, 2024
11024a5
[CIR][CIRGen] Implement unary floating point builtins (#383)
philnik777 Jan 16, 2024
e881544
[CIR] Fix int constant type verification (#386)
Lancern Jan 16, 2024
5a6fe55
[CIR] Vector types, part 2 (#387)
dkolsen-pgi Jan 16, 2024
9989230
[CIR][IR] Implement `cir.continue` operation
sitio-couto Jan 16, 2024
65880d7
[CIR][IR] Implement `cir.break` operation
sitio-couto Jan 16, 2024
2f48e4a
[CIR][IR] Deprecate `cir.yield nosuspend`
sitio-couto Jan 16, 2024
1ee5f18
[CIR][IR] Deprecate `cir.yield fallthrough`
sitio-couto Jan 16, 2024
92cceb7
[CIR] TryCallOp: add blocks, arguments, proper interface impl and tes…
bcardosolopes Jan 16, 2024
1273f07
[CIR][Exceptions] Simplify cir.try_call
bcardosolopes Jan 17, 2024
d98b9f0
[CIR] TryCallOp: improve printing
bcardosolopes Jan 17, 2024
0d91f68
[CIR][CIRGen][Exceptions] More prep work on landing-pad like logic
bcardosolopes Jan 18, 2024
bcfacd1
[CIR][CIRGen][Exceptions] Complete buildCatchDispatchBlock
bcardosolopes Jan 18, 2024
4aa8ff9
[CIR] Add cir.resume op and use it in cir.catch
bcardosolopes Jan 18, 2024
7a4e5c3
[CIR][CIRGen] Support wide string literals (#399)
Lancern Jan 19, 2024
c003cb3
[CIR][OpenMP] Initial commit for OpenMP support in CIR (#382)
fabianmcg Jan 22, 2024
8e6cad9
[CIR][Interfaces] Implement LoopOpInterface
sitio-couto Jan 22, 2024
b41ff5f
[CIR][Lowering][NFC] Refactor LoopOp lowering
sitio-couto Jan 22, 2024
979ea99
[CIR][IR] Refactor do-while loops
sitio-couto Jan 22, 2024
4541cfa
[CIR][IR] Refactor while loops
sitio-couto Jan 22, 2024
7bd9fe3
[CIR][IR] Refactor for loops
sitio-couto Jan 22, 2024
bc1b7c9
[CIR][CIRGen][Exceptions] Populate catch clauses and fix order of ope…
bcardosolopes Jan 23, 2024
7acd41f
[CIR] Fix a few depends to only apply to ClangIR
lanza Jan 25, 2024
e4f7839
[CIR] Make MLIRCIR depend on MLIRCIRInterfaces
lanza Jan 27, 2024
3cf377a
[CIR] Remove LLVM_ENABLE_PROJECTS support
lanza Jan 26, 2024
1de9a22
[CIR][Interfaces] Temporarily disable verifier to get out of circular…
lanza Jan 27, 2024
8d26c92
[CIR] Move CI to CLANG_ENABLE_CIR
lanza Jan 29, 2024
1cd5a4b
[CIR][CIRGen][Exceptions] Use cir.try instead of cir.scope
bcardosolopes Jan 30, 2024
d1d7b19
[CIR][CIRGen][NFC] Make buildCall more generic by using CIRCallOpInte…
bcardosolopes Jan 30, 2024
1390496
[CIR][CIRGen][Exceptions] Use cir.try_call within cir.try regions
bcardosolopes Jan 30, 2024
fae636d
[CIR] Add a new volatile flag to distinguish volatile accesses (#402)
Lancern Jan 31, 2024
1da7e33
[CIR] Vector types, comparison operators (#432)
dkolsen-pgi Jan 31, 2024
000f9f7
[CIR][CIRGen] Add missing visitor for ParenExpr (#428)
YazZz1k Jan 31, 2024
e1ad7ee
[CIR][CodeGen][BugFix] use proper base type for derived class (#404)
gitoleg Jan 31, 2024
3f9153d
[CIR][CodeGen] Initial variable length array support (#398)
gitoleg Jan 31, 2024
a602024
[CIR][CIRGen][Bugfix] Fix source location in ctors (#415)
YazZz1k Jan 31, 2024
c5e3476
[CIR][CIRGen] Handle initilization of arrays (#431)
YazZz1k Jan 31, 2024
eced6fa
[CIR][CIRGen] Handle __extension__ keyword (#421)
YazZz1k Jan 31, 2024
efb9922
[CIR][CIRGen] Add missing case to 'isNullValue' (#433)
YazZz1k Jan 31, 2024
87c4338
[CIR][CIRGen] Support for section atttribute (#422)
YazZz1k Feb 2, 2024
765e5dc
[CIR][CIRGen][Bugfix] Fix bool zero initialization (#411)
YazZz1k Feb 2, 2024
58b5474
[CIR][Lowering] Support conversion of cir.zero to dense consts (#413)
YazZz1k Feb 2, 2024
7b4745e
[CIR][CodeGen] Initial support for dynamic_cast (#426)
Lancern Feb 2, 2024
323e0c1
[CIR][CIRGen] Add codegen for branch prediction info builtins (#439)
YazZz1k Feb 2, 2024
615a367
[CIR][CIRGen] Handle ternary op inside if cond (#440)
YazZz1k Feb 2, 2024
a010209
[CIR][CIRGen] Support check for zero-init pointers (#441)
YazZz1k Feb 2, 2024
c35b579
[CIR][CIRGen] Support dynamic_cast to void ptr (#442)
Lancern Feb 2, 2024
d54e041
[CIR][CodeGen][Lowering] Supports arrays with trailing zeros (#393)
gitoleg Feb 2, 2024
e7e05a8
[CIR][LibOpt] Extend std::find optimization to all calls with raw poi…
philnik777 Feb 2, 2024
6094902
[CIR][CIRGen] Implement "if consteval" code generation (#446)
keryell Feb 3, 2024
da3343a
[CIR] Allow mlir::UnknownLoc in function op (#448)
Lancern Feb 4, 2024
38bd933
[CIR][CodeGen] Const structs with bitfields (#412)
gitoleg Feb 5, 2024
113b787
[CIR][Lowering][Bugfix] Fix lowering of bool_to_int cast (#450)
YazZz1k Feb 5, 2024
cb53cf8
[CIR][CIRGen][Exceptions] Connect the unwind region to the rest of Ca…
bcardosolopes Feb 6, 2024
671ffc7
[CIR][CIRGen][Exceptions] Add support for catch_all
bcardosolopes Feb 6, 2024
72e9f23
[CIR][CIRGen] Add suppport for local typedefs (#451)
YazZz1k Feb 6, 2024
013a653
[CIR][CIRGen][BugFix] Fix building of calls (#452)
YazZz1k Feb 6, 2024
e95a5c4
[CIR][CIRGen][Exceptions] Handle a catch_all corner case
bcardosolopes Feb 6, 2024
c3e6388
[CIR][CIRGen] Implement "if constexpr" code generation (#436)
keryell Feb 7, 2024
4f89aa7
[CIR][CIRGen] Add codegen for global compound literals (#454)
YazZz1k Feb 8, 2024
6c29cd4
[CIR][CodeGen] VLA support next step (#453)
gitoleg Feb 8, 2024
06da08a
[CIR][CIRGen][Bugfix] Emit valid type for evaluated const (#456)
YazZz1k Feb 8, 2024
101c4c0
[CIR][CIRGen][Exceptions][NFC] Add skeleton for some missing function…
bcardosolopes Feb 9, 2024
b63a943
[CIR][CIRGen] Support for local const arrays (#458)
YazZz1k Feb 9, 2024
ad2de47
[CIR][CIRGen][NFC] Relax asserts for using decls and namespace alias
bcardosolopes Feb 10, 2024
877a15e
[CIR][CIRGen] Fix in replacing of no_proto func (#460)
YazZz1k Feb 12, 2024
c976e4b
[CIR][CIRGen][Exceptions][NFC] Re-arrange CallLikeOp building
bcardosolopes Feb 12, 2024
d7f09ca
[CIR][CIRGen][Exceptions][NFC] Reuse lexical scope instead of custom …
bcardosolopes Feb 12, 2024
a1d0b22
[CIR][Lowering] add lowering of bool attribute (#461)
YazZz1k Feb 13, 2024
49bcdd2
[CIR][CIRGen][Exceptions] Prep work for using cir.try_call outside ci…
bcardosolopes Feb 13, 2024
6d83a86
[CIR][CodeGen] Locally inited structures with bitfields (#463)
gitoleg Feb 14, 2024
d3b91b5
[CIR][CIRGen] Introduce cir.unreachable operation (#447)
Lancern Feb 14, 2024
19350cf
[CIR][CIRGen] Add missing case to VisitMemberExpr (#464)
YazZz1k Feb 14, 2024
e3d14fd
[CIR][CIRGen][Exceptions] Add unwind attribute
bcardosolopes Feb 14, 2024
e0dc80f
[CIR][CodeGen] Inline assembly: adds operands (#465)
gitoleg Feb 15, 2024
b5e684e
[CIR][NFC] Refactor more call related mechanisms
bcardosolopes Feb 15, 2024
da2e461
[CIR][CodeGen] Adds clobbers to inline assembly (#469)
gitoleg Feb 16, 2024
559da04
[CIR][NFC] Use an attribute alias for extra_func_attrs
bcardosolopes Feb 17, 2024
321ca2b
[CIR][Lowering] Handle unsupported types for CIR-MLIR type conversion…
mrsoliman Feb 20, 2024
e846fd2
[CIR][CIRGen] Support for zero initialization of arrays (#468)
YazZz1k Feb 20, 2024
72eccae
[CIR][CodeGen][Bugfix] Fix storage size for bitfields (#462)
gitoleg Feb 20, 2024
b82fdb0
[CIR] introduce CIR floating-point types (#385)
Lancern Feb 21, 2024
624f2be
[CIR][Codegen] Fix bitfields unary and binary ops (#477)
gitoleg Feb 22, 2024
876101b
[CIR][CIRGen] Fix calling a function through a function pointer (#467)
YazZz1k Feb 22, 2024
c2bca4a
[CIR] initial support for pointer-to-data-member type (#401)
Lancern Feb 22, 2024
85a48c7
[CIR][NFC] Add unimplemented feature guard for dialect code (#481)
Lancern Feb 29, 2024
9a69667
[CIR][Lowering] More cir.asm lowering (#472)
gitoleg Feb 29, 2024
0ba4f5a
[CIR][CIRGen] Emit `cir.unreachable` on implicit returns (#486)
Lancern Mar 5, 2024
116a86d
[CIR][CIRGen] Add support for builtin bit operations (#474)
Lancern Mar 5, 2024
19de5fc
[CIR] Vector types - part 4 (#490)
dkolsen-pgi Mar 5, 2024
9d55d0f
[CIR][CIRGen] Support for __builtin_expect (#478)
YazZz1k Mar 5, 2024
6191da3
[CIR][CIRGen] Partial support for `offsetof` (#492)
YazZz1k Mar 6, 2024
2ab8d1e
[CIR][CIRGen] Support for CStyleCastExprClass in buildCastLValue (#494)
YazZz1k Mar 6, 2024
bfc16da
[CIR] Add `cir.trap` operation (#496)
Lancern Mar 7, 2024
e10f9d9
[CIR][FrontendTool] Fix overly conservative compatible flags
bcardosolopes Mar 8, 2024
62e97a7
[CIR] Vector ternary operator (#500)
dkolsen-pgi Mar 9, 2024
062b69e
[CIR][CIRGen][NFC] Use proper help with shouldEmitRTTI and clean up
bcardosolopes Mar 9, 2024
460cffa
[CIR][CIRGen][RTTI] Handle vtables in face of -fno-rtti
bcardosolopes Mar 9, 2024
cc4fddd
[CIR][CIRGen] Emit more delete calls
bcardosolopes Mar 11, 2024
26e1ad1
[CIR][CIRGen][NFC] Expand skeleton for constructing array types
bcardosolopes Mar 11, 2024
1ee9340
[CIR][Lowering] Add LLVMIR lowering support for CIR bit operations (#…
Lancern Mar 12, 2024
829dd95
[CIR][CIRGen] Enable support of bool increment (#493)
YazZz1k Mar 12, 2024
d7d62a6
[CIR][CIRGen] Inline asm: operand attributes (#491)
gitoleg Mar 12, 2024
108d233
[CIR] Vector type cleanup and refactoring (#503)
dkolsen-pgi Mar 12, 2024
47c2e56
[CIR][Codegen][Lowering] Introduce new bitfield layout (#487)
gitoleg Mar 12, 2024
65f27ad
[CIR][CIRGen] Add support for ctor/dtor based array init/destroy
bcardosolopes Mar 12, 2024
a7910b8
[CIR][CIRGen] Lower C++ array init and destroy
bcardosolopes Mar 14, 2024
c550e90
[CIR][LoweringPrepare] Add a missing store for current array idx
bcardosolopes Mar 14, 2024
15903b6
[CIR][CIRGen][NFC] Skeleton for atomics support
bcardosolopes Mar 14, 2024
2c680f1
[CIR][CIRGen][Atomics][NFC] Skeleton for constant order codegen
bcardosolopes Mar 14, 2024
90786c8
[CIR][Codegen] Initial support for packed structures (#473)
gitoleg Mar 15, 2024
3d86b46
[CIR][CIRGen] Support for initialization of unions. (#495)
YazZz1k Mar 15, 2024
7c7c4ff
[CIR][CIRGen] Support for __builtin_prefetch (#504)
YazZz1k Mar 15, 2024
1f8f096
[CIR] Add MemRead/MemWrite markers to bitfield ops (#507)
gitoleg Mar 15, 2024
2a0fcd5
[CIR][CIRGen] Support for __builtin_constant_p (#506)
YazZz1k Mar 15, 2024
9fde505
[CIR][CIRGen] Support for C++20 three-way comparison (#485)
Lancern Mar 19, 2024
3896c0e
[CIR][Rebase] Add CountAttributed enum case in a switch
lanza Mar 21, 2024
fd354e5
[CIR][CIRGen] Support for compound literal lvalue (#515)
YazZz1k Mar 22, 2024
8d87565
[CIR][CIRGen] Support for __attribute__((fallthrough)) statement (#517)
YazZz1k Mar 22, 2024
c9dd759
[CIR][CIRGen] Add handling __extension__ keyword for lvalue (#519)
YazZz1k Mar 22, 2024
670f30d
[CIR] Add MLIRCIREnumsGen as a dep to MLIRCIRInterfaces
lanza Apr 2, 2024
49b609b
[CIR] Introduce a flattening pass (#516)
gitoleg Apr 3, 2024
d18777b
[CIR] shufflevector and convertvector built-ins (#530)
dkolsen-pgi Apr 5, 2024
e58a597
[CIR][CIRGen] Add support for __atomic_add_fetch
bcardosolopes Apr 3, 2024
84851f8
[CIR] Add support for byteswap intrinsic (#523)
Lancern Apr 6, 2024
4b49152
[CIR] GNU vector type cleanup (#531)
dkolsen-pgi Apr 6, 2024
a853799
[CIR][CIRGen] Add support for other __atomic_{binop}_fetch
bcardosolopes Apr 8, 2024
8ba2142
[CIR][CIRGen] Add a verifier to catch binop_fetch's that do not suppo…
bcardosolopes Apr 8, 2024
eaea071
[CIR][CIRGen] Add support for __atomic_fetch_binop
bcardosolopes Apr 8, 2024
a5c9aca
[CIR][CIRGen] Add min/max atomic fetch variants
bcardosolopes Apr 8, 2024
7f4768b
[CIR][CIRGen] Add atomic load support
bcardosolopes Apr 9, 2024
459f6f5
[CIR][CIRGen] Add missing CIRGen for generic bit operation builtins (…
Lancern Apr 10, 2024
7804db0
[CIR][CIRGen] Add atomic store support
bcardosolopes Apr 10, 2024
ccd551b
[CIR][CIRGen] Add support for __attribute__((constructor))
bcardosolopes Apr 10, 2024
06cf3c3
[CIR][CIRGen][NFC] Rename globalCtor to global_ctor
bcardosolopes Apr 11, 2024
17c8db6
[CIR][CIRGen][NFC] More prep work before global dtors
bcardosolopes Apr 11, 2024
58b8bc7
[CIR][NFC] Fixup a few changes requested from upstream PRs
lanza Apr 11, 2024
90710ce
[CIR][NFC] Remove `SYSTEM` from MLIR include_directories calls
lanza Apr 11, 2024
a0e3c1c
[CIR][CIRGen] Add support for __attribute__((destructor))
bcardosolopes Apr 11, 2024
91685f8
[CIR][CIRGen][NFC] Simplify global ctor/dtor priority handling
bcardosolopes Apr 11, 2024
6233ee0
[CIR][CIRGen][NFC] Add more skeleton to VisitOpaqueValueExpr
bcardosolopes Apr 12, 2024
a1bc344
[CIR][CIRGen] Scalar handling for part of VisitOpaqueValueExpr
bcardosolopes Apr 12, 2024
906c314
[CIR][CIRGen] Add skeleton for AggExprEmitter::VisitCompoundLiteralExpr
bcardosolopes Apr 12, 2024
7865351
[CIR][CIRGen] Add more variations of compound literal support
bcardosolopes Apr 12, 2024
84ebc8c
[CIR][CIRGen] Add TLS codegen skeleton while building globals
bcardosolopes Apr 12, 2024
440f02e
[CIR][Codegen] IfOp flattening (#537)
gitoleg Apr 15, 2024
12fb4ed
[CIR] Add initial support for bit-precise integer types (#538)
Lancern Apr 15, 2024
7380a63
[CIR] Add TLS models to CIR and teach GlobalOp about them
bcardosolopes Apr 15, 2024
275f0e4
[CIR][CIRGen] Add initial __thread support
bcardosolopes Apr 15, 2024
267dd72
[CIR][CIRGen][LLVMLowering] Add support retrieving thread local globa…
bcardosolopes Apr 15, 2024
a53950f
[CIR][LLVMLowering] Lower cir.objectsize (#545)
ghehg Apr 16, 2024
62c6a86
[CIR][LLVMLowering] Fix handling of dense array conversions from cons…
bcardosolopes Apr 17, 2024
2db13d8
[CIR][Rebase] Stub out error handling for Pass option initialization
lanza Apr 17, 2024
730ffda
[CIR][CodeGen] Inline assembly: store the results (#512)
gitoleg Apr 17, 2024
8b4c7e0
Revert "[CIR][LLVMLowering] Lower cir.objectsize (#545)"
bcardosolopes Apr 17, 2024
5348562
Re-introduce [CIR][LLVMLowering] Lower cir.objectsize
bcardosolopes Apr 17, 2024
043f8dc
[CIR][NFC] Fix few compiler warnings
bcardosolopes Apr 17, 2024
7740a8d
[CIR][CodeGen] Flattening for ScopeOp and LoopOpInterface (#546)
gitoleg Apr 17, 2024
080f276
[CIR][Codegen] Fix union init with constant (#548)
gitoleg Apr 17, 2024
95e11a5
[CIR][CodeGen][Lowering] Support Integer overflow with fwrap (#539)
gitoleg Apr 17, 2024
4c07a3c
[CIR][CIRGen] Clean up call arrangement
bcardosolopes Apr 18, 2024
4361c2d
[CIR][CIRGen][NFC] Update atomic libcall skeleton to match upstream
bcardosolopes Apr 18, 2024
c1311f5
[CIR][CIRGen][NFC] Make createRuntimeFunction use proper function cre…
bcardosolopes Apr 18, 2024
dce1725
[CIR][CIRGen][NFC] Add entry points for later addition of more functi…
bcardosolopes Apr 18, 2024
c0061fc
[CIR][CIRGen][NFC] Update other remainig parts of buildAtomicExpr to …
bcardosolopes Apr 19, 2024
b5429f1
[CIR] Add `cir.dyn_cast` operation (#483)
Lancern Apr 19, 2024
73da668
[CIR][Codegen] TernaryOp flattening (#550)
gitoleg Apr 19, 2024
536d4c2
[CIR][CIRGen][NFC] Update buildPointerWithAlignment with LLVM upstrea…
bcardosolopes Apr 19, 2024
8daf005
[CIR] Add support for long double type (#536)
Lancern Apr 19, 2024
1c3cd0a
[CIR][CIRGen] Introduce initial support for ASTAllocaAddressSpace (#551)
orbiri Apr 19, 2024
9327912
[CIR] Introduce StructLayoutAttr
bcardosolopes Apr 20, 2024
8ef3b36
[CIR] Extend StructLayoutAttr to support querying offset for members
bcardosolopes Apr 20, 2024
9c305cb
[CIR][CodeGen] Adds SwitchOp flattening (#549)
gitoleg Apr 22, 2024
b51fcf7
[CIR][NFC] Improve verifier related error messages (#553)
gxsoar Apr 22, 2024
b64cb19
[CIR][NFC] Fix warnings, remove redudant comments and cleanup helpers
bcardosolopes Apr 22, 2024
5d9a961
[CIR][CIRGen][LLVMLowering] Support atomic exchange
bcardosolopes Apr 22, 2024
b61cf01
[CIR][CIRGen] Add support for more variations of __atomic_exchange
bcardosolopes Apr 23, 2024
77f4a0c
[CIR] Lower certain `cir.cmp3way` operations to LLVM intrinsics (#556)
Lancern Apr 23, 2024
da1dd0f
[CIR][CIRGen] Atomics: Add skeleton for compare and exchange
bcardosolopes Apr 23, 2024
68fe3ed
[CIR][CIRGen] Atomics: initial compare and exchange support
bcardosolopes Apr 24, 2024
9daae1b
[CIR][LLVMLowering][NFC] Refactor and share getLLVMAtomicOrder
bcardosolopes Apr 24, 2024
7402372
[CIR][CIRGen] Fix follow up stores for atomic loads
bcardosolopes Apr 25, 2024
96722f7
[CIR][CIRGen] Add dynamic builtin alloca intrinsics support (#547)
orbiri Apr 25, 2024
7cda6e9
[CIR[CIRGen][NFC] Refactor build switch op (#552)
wenpen Apr 25, 2024
116e184
[CIR][NFC] Create LLVM intrinsic calls through `createCallLLVMIntrins…
Lancern Apr 25, 2024
ded2fa7
[CIR][Lowering] Add MLIR lowering support for CIR cos operations (#565)
zhoujingya Apr 25, 2024
5718db5
[CIR] Remove redundant error from parseConstantValue (#567)
orbiri Apr 25, 2024
a1cb2c0
[CIR][CIRGen] Add more testcases for atomic xchg/cmp_xchg
bcardosolopes Apr 26, 2024
80f74eb
[CIR][CIRGen] Atomics: handle atomic_compare_exchange_strong
bcardosolopes Apr 26, 2024
26a5b07
[CIR][Lowering] Add long double types for cos operation lowering (#568)
zhoujingya Apr 26, 2024
67fa2b7
[CIR][CIRGen] Atomics: make cir.atomic.cmp_xchg a bit more lower level
bcardosolopes Apr 26, 2024
426233f
[CIR][CIRGen] Atomics: add one more testcase
bcardosolopes Apr 26, 2024
ccddaa4
[CIR][CIRGen] Atomics: improve docs and constraints
bcardosolopes Apr 26, 2024
e197d4e
[CIR][CodeGen] Fix a usage of volatile -> volatileQualified
lanza Apr 27, 2024
97b7280
[CIR] Support lowering GlobalOp and GetGlobalOp to memref (#574)
ShivaChen Apr 30, 2024
f780f38
TO BE UPSTREAMED !! [MLIR] Extend floating point parsing support
orbiri Apr 28, 2024
d3d3988
[CIR] Extend support for floating point attributes
orbiri Apr 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 38 additions & 0 deletions .github/workflows/clang-cir-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Clang CIR Tests

permissions:
contents: read

on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'clang/**'
- '.github/workflows/clang-cir-tests.yml'
- '.github/workflows/llvm-project-tests.yml'
- '!llvm/**'
pull_request:
branches:
- 'main'
paths:
- 'clang/**'
- '.github/workflows/clang-cir-tests.yml'
- '.github/workflows/llvm-project-tests.yml'
- '!llvm/**'

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
check_clang_cir:
name: Test clang-cir
uses: ./.github/workflows/llvm-project-tests.yml
with:
build_target: check-clang-cir
projects: clang;mlir
extra_cmake_args: -DCLANG_ENABLE_CIR=ON
2 changes: 1 addition & 1 deletion .github/workflows/pr-code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
code_formatter:
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
if: github.repository == 'llvm/clangir'
steps:
- name: Fetch LLVM sources
uses: actions/checkout@v4
Expand Down
45 changes: 2 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,3 @@
# The LLVM Compiler Infrastructure
# ClangIR (CIR)

[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/llvm/llvm-project/badge)](https://securityscorecards.dev/viewer/?uri=github.com/llvm/llvm-project)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8273/badge)](https://www.bestpractices.dev/projects/8273)
[![libc++](https://github.com/llvm/llvm-project/actions/workflows/libcxx-build-and-test.yaml/badge.svg?branch=main&event=schedule)](https://github.com/llvm/llvm-project/actions/workflows/libcxx-build-and-test.yaml?query=event%3Aschedule)

Welcome to the LLVM project!

This repository contains the source code for LLVM, a toolkit for the
construction of highly optimized compilers, optimizers, and run-time
environments.

The LLVM project has multiple components. The core of the project is
itself called "LLVM". This contains all of the tools, libraries, and header
files needed to process intermediate representations and convert them into
object files. Tools include an assembler, disassembler, bitcode analyzer, and
bitcode optimizer.

C-like languages use the [Clang](https://clang.llvm.org/) frontend. This
component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode
-- and from there into object files, using LLVM.

Other components include:
the [libc++ C++ standard library](https://libcxx.llvm.org),
the [LLD linker](https://lld.llvm.org), and more.

## Getting the Source Code and Building LLVM

Consult the
[Getting Started with LLVM](https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm)
page for information on building and running LLVM.

For information on how to contribute to the LLVM project, please take a look at
the [Contributing to LLVM](https://llvm.org/docs/Contributing.html) guide.

## Getting in touch

Join the [LLVM Discourse forums](https://discourse.llvm.org/), [Discord
chat](https://discord.gg/xS7Z362),
[LLVM Office Hours](https://llvm.org/docs/GettingInvolved.html#office-hours) or
[Regular sync-ups](https://llvm.org/docs/GettingInvolved.html#online-sync-ups).

The LLVM project has adopted a [code of conduct](https://llvm.org/docs/CodeOfConduct.html) for
participants to all modes of communication within the project.
Check https://clangir.org for general information, build instructions and documentation.
8 changes: 7 additions & 1 deletion clang-tools-extra/clang-tidy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_clang_library(clangTidy
ClangSACheckers
omp_gen
ClangDriverOptions
)
)

clang_target_link_libraries(clangTidy
PRIVATE
Expand Down Expand Up @@ -77,6 +77,9 @@ add_subdirectory(performance)
add_subdirectory(portability)
add_subdirectory(readability)
add_subdirectory(zircon)
if(CLANG_ENABLE_CIR)
add_subdirectory(cir)
endif()
set(ALL_CLANG_TIDY_CHECKS
clangTidyAndroidModule
clangTidyAbseilModule
Expand Down Expand Up @@ -105,6 +108,9 @@ set(ALL_CLANG_TIDY_CHECKS
if(CLANG_TIDY_ENABLE_STATIC_ANALYZER)
list(APPEND ALL_CLANG_TIDY_CHECKS clangTidyMPIModule)
endif()
if(CLANG_ENABLE_CIR)
list(APPEND ALL_CLANG_TIDY_CHECKS clangTidyCIRModule)
endif()
set(ALL_CLANG_TIDY_CHECKS ${ALL_CLANG_TIDY_CHECKS} PARENT_SCOPE)

# Other subtargets. These may reference ALL_CLANG_TIDY_CHECKS
Expand Down
4 changes: 4 additions & 0 deletions clang-tools-extra/clang-tidy/ClangTidy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
#include "ClangTidyModuleRegistry.h"
#include "ClangTidyProfiling.h"
#include "ExpandModularHeadersPPCallbacks.h"
#ifndef CLANG_TIDY_CONFIG_H
#include "clang-tidy-config.h"
#endif
#include "utils/OptionsUtils.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Format/Format.h"
Expand Down Expand Up @@ -466,6 +469,7 @@ ClangTidyASTConsumerFactory::createASTConsumer(
Consumers.push_back(std::move(AnalysisConsumer));
}
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER

return std::make_unique<ClangTidyASTConsumer>(
std::move(Consumers), std::move(Profiling), std::move(Finder),
std::move(Checks));
Expand Down
22 changes: 22 additions & 0 deletions clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
#include "llvm/Support/Regex.h"
#include <optional>

// Workaround unitests not needing to change unittests to require
// "clang-tidy-config.h" being generated.
#if __has_include("clang-tidy-config.h")
#ifndef CLANG_TIDY_CONFIG_H
#include "clang-tidy-config.h"
#endif
#endif

#if CLANG_ENABLE_CIR
#include "clang/Basic/CodeGenOptions.h"
#endif

namespace clang {

class ASTContext;
Expand Down Expand Up @@ -137,6 +149,12 @@ class ClangTidyContext {
/// Gets the language options from the AST context.
const LangOptions &getLangOpts() const { return LangOpts; }

#if CLANG_ENABLE_CIR
/// Get and set CodeGenOpts
CodeGenOptions &getCodeGenOpts() { return CodeGenOpts; };
void setCodeGenOpts(CodeGenOptions &CGO) { CodeGenOpts = CGO; }
#endif

/// Returns the name of the clang-tidy check which produced this
/// diagnostic ID.
std::string getCheckName(unsigned DiagnosticID) const;
Expand Down Expand Up @@ -242,6 +260,10 @@ class ClangTidyContext {

LangOptions LangOpts;

#if CLANG_ENABLE_CIR
CodeGenOptions CodeGenOpts;
#endif

ClangTidyStats Stats;

std::string CurrentBuildDirectory;
Expand Down
9 changes: 9 additions & 0 deletions clang-tools-extra/clang-tidy/ClangTidyForceLinker.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H

#ifndef CLANG_TIDY_CONFIG_H
#include "clang-tidy-config.h"
#endif
#include "llvm/Support/Compiler.h"

namespace clang::tidy {
Expand Down Expand Up @@ -137,6 +139,13 @@ extern volatile int ZirconModuleAnchorSource;
static int LLVM_ATTRIBUTE_UNUSED ZirconModuleAnchorDestination =
ZirconModuleAnchorSource;

#if CLANG_ENABLE_CIR
// This anchor is used to force the linker to link the CIRModule.
extern volatile int CIRModuleAnchorSource;
static int LLVM_ATTRIBUTE_UNUSED CIRModuleAnchorDestination =
CIRModuleAnchorSource;
#endif

} // namespace clang::tidy

#endif
50 changes: 50 additions & 0 deletions clang-tools-extra/clang-tidy/cir-tidy/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )

set(LLVM_LINK_COMPONENTS
AllTargetsAsmParsers
AllTargetsDescs
AllTargetsInfos
FrontendOpenMP
support
)

# Needed by LLVM's CMake checks because this file defines multiple targets.
set(LLVM_OPTIONAL_SOURCES CIRTidyMain.cpp CIRTidyToolMain.cpp)

add_clang_library(CIRTidyMain
CIRTidyMain.cpp

LINK_LIBS
CIRTidy
clangTidy
MLIRIR
${ALL_CLANG_TIDY_CHECKS}
MLIRIR

DEPENDS
omp_gen
)

clang_target_link_libraries(CIRTidyMain
PRIVATE
clangBasic
clangTooling
clangToolingCore
)

add_clang_tool(cir-tidy
CIRTidyToolMain.cpp
)
add_dependencies(cir-tidy
clang-resource-headers
)

target_link_libraries(cir-tidy
PRIVATE
CIRTidyMain
CIRTidy
)

install(TARGETS cir-tidy
DESTINATION bin
)
34 changes: 34 additions & 0 deletions clang-tools-extra/clang-tidy/cir/CIRTidyModule.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//===--- CIRTidyModule.cpp - clang-tidy -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "../ClangTidy.h"
#include "../ClangTidyModule.h"
#include "../ClangTidyModuleRegistry.h"
#include "Lifetime.h"

namespace clang::tidy {
namespace cir {

class CIRModule : public ClangTidyModule {
public:
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
CheckFactories.registerCheck<Lifetime>("cir-lifetime-check");
}
};

} // namespace cir

// Register the CIRTidyModule using this statically initialized variable.
static ClangTidyModuleRegistry::Add<cir::CIRModule>
X("cir-module", "Adds ClangIR (CIR) based clang-tidy checks.");

// This anchor is used to force the linker to link in the generated object file
// and thus register the CIRModule.
volatile int CIRModuleAnchorSource = 0;

} // namespace clang::tidy
57 changes: 57 additions & 0 deletions clang-tools-extra/clang-tidy/cir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
set(LLVM_LINK_COMPONENTS
FrontendOpenMP
Support
)

include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
include_directories( ${LLVM_MAIN_SRC_DIR}/../mlir/include )
include_directories( ${CMAKE_BINARY_DIR}/tools/mlir/include )

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)

add_clang_library(clangTidyCIRModule
Lifetime.cpp
CIRTidyModule.cpp

LINK_LIBS
clangASTMatchers
clangCIR
clangFrontend
clangSerialization
clangTidy
clangTidyUtils
${dialect_libs}
MLIRCIR
MLIRCIRTransforms
MLIRAffineToStandard
MLIRAnalysis
MLIRIR
MLIRLLVMCommonConversion
MLIRLLVMDialect
MLIRLLVMToLLVMIRTranslation
MLIRMemRefDialect
MLIRMemRefToLLVM
MLIRParser
MLIRPass
MLIRSideEffectInterfaces
MLIRSCFToControlFlow
MLIRFuncToLLVM
MLIRSupport
MLIRMemRefDialect
MLIRTargetLLVMIRExport
MLIRTransforms

DEPENDS
omp_gen
)

clang_target_link_libraries(clangTidyCIRModule
PRIVATE
clangAnalysis
clangAST
clangASTMatchers
clangBasic
clangLex
clangTooling
clangToolingCore
)