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][Lowering] Add the concept of simple lowering and use it to implement FP intrincis #434

Closed
wants to merge 1,362 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1362 commits
Select commit Hold shift + click to select a range
b139b4d
[CIR][Lowering] Lower constant arrays of structs
sitio-couto Aug 2, 2023
4786f2b
[CIR][Lowering] Partially lower local #cir.const_struct initializers
sitio-couto Aug 2, 2023
ebcfb07
[CIR][CIRTidy] Add config options for codegen manipulation
bcardosolopes Aug 3, 2023
6c3f2ea
[CIR][CIRGen] Static initialize global addresses
sitio-couto Aug 7, 2023
ef6ee1e
[CIR][Lowering] Lower globals with global_view initializer
sitio-couto Aug 7, 2023
26468c4
[CIR][Bugfix] Fix cir.array getTypeSizeInBits method
sitio-couto Aug 7, 2023
e9b8cfe
[CIR][CIRGen] Use #cir.zero on zero-initialized global arrays
sitio-couto Aug 7, 2023
894334a
[CIR][Lowering] Lower global multidimensional array initializers.
yugr Aug 4, 2023
20f4e86
[CIR][Lowering] Lower nested arrays of simple types to dense attribut…
yugr Aug 7, 2023
230a6b8
[CIR][Bugfix] Fix vtableAttr const struct usage
sitio-couto Aug 7, 2023
9e82b42
[CIR][CodeGen] Emit globals with constructor initializer (#197)
htyu Aug 7, 2023
8f2070e
[CIR][CIRTidy] Handle mlir::FusedLoc when translating to clang::Sourc…
bcardosolopes Aug 8, 2023
d6be1f6
[CIR][Lowering] Fixed break/continue lowering for loops (#211)
gitoleg Aug 9, 2023
7cd4eb5
[CIR][CodeGen] Fix generation of 'if statement' when begin and end lo…
rusyaev-roman Aug 3, 2023
376a938
[CIR][CIRGen] Fix heap-use-after-free in recordDeclTypes, found by ASAN
bcardosolopes Aug 11, 2023
e91e0f9
[CIR][CIRGen] Support for struct call arguments
sitio-couto Aug 8, 2023
d929c69
[CIR] Enable per-pass IR printing (#234)
htyu Aug 15, 2023
5c960ff
[ClR] Set optnone attribute for functions. (#115)
htyu Aug 15, 2023
5baedbc
[CIR][Lowering] Add an empty LoweringPrepare pass (#236)
htyu Aug 15, 2023
ea3dcc4
[CIR][Lowering] Add LoweringPrepare pass to pre-lower global initiali…
htyu Aug 16, 2023
56a8488
[CIR][ClangTidy] Add CIR support in clang-tidy (to deprecate cir-tidy)
bcardosolopes Aug 16, 2023
a92849b
[CIR][CIRTidy] Break CIRASTConsumer dep from clang::tidy::utils
bcardosolopes Aug 19, 2023
54f525c
[CIR][ClangTidy] Move dependence up and remove CIRASTConsumer files
bcardosolopes Aug 19, 2023
14f9a0d
[CIR][ClangTidy] Copy parseStringList function from clang::tidy::util…
bcardosolopes Aug 21, 2023
296ad65
[CIR][ClangTidy] Fix cmake remaining issues
bcardosolopes Aug 21, 2023
5b1769f
[CIR][CIRGen][Bugfix] Fixes switch-case sub statements (#232)
gitoleg Aug 21, 2023
36177bf
[CIR][CIRGen] Implicitly zero-initialize global arrays elements
sitio-couto Aug 21, 2023
929969d
[CIR][CIRGen] Update C++ codegen to use #cir.zero on structs
sitio-couto Aug 21, 2023
578991d
[CIR][Lowering] Implement cir.llvmir.zeroinit operation
sitio-couto Aug 21, 2023
5d5d2c3
[CIR][Lowering] Lower #cir.zero nested in initializer attributes
sitio-couto Aug 21, 2023
849528a
[CIR][Lowering][NFC] Rename LowerAttrToLLVMIR to LowerToLLVMIR
sitio-couto Aug 21, 2023
0d8f193
[CIR][Lowering] Deprecate attributes for LLVM zero-initialization
sitio-couto Aug 21, 2023
b8d9bec
[CIR] Implement cir.copy operation
sitio-couto Aug 21, 2023
46fad01
[CIR][CIRGen] Add support for basic struct assignment
sitio-couto Aug 21, 2023
475b911
[CIR][Lowering] Lower cir.copy operations
sitio-couto Aug 21, 2023
27cd4d9
[CIR] Implement cir.libc.memcpy operation
sitio-couto Aug 21, 2023
9c7c1f6
[CIR][CIRGen] Generate memcpy builtin
sitio-couto Aug 21, 2023
faf615c
[CIR][Lowering] Lower cir.libc.memcpy operation
sitio-couto Aug 21, 2023
b0080fa
[CIR][CIRTidy] Add workaround now that clang-tidy is taking place
bcardosolopes Aug 22, 2023
8fb583f
[CIR][CIRGen][Bugfix] Fix pointer subscript operator access
sitio-couto Jul 20, 2023
ff25376
[CIR][Lowering] Emit llvm.global_ctors list (#240)
htyu Aug 23, 2023
80e786d
[CIR][ClangTidy] Change the approach to running CIR passes
bcardosolopes Aug 24, 2023
35ee181
[CIR][ClangTidy] Remove CIR/MLIR dep from main cmakefile
bcardosolopes Aug 25, 2023
e2e4a3f
[CIR][ClangTidy] Add dep to clangTidyUtils
bcardosolopes Aug 25, 2023
d40819c
[CIR][CIRGen][NFC] Refactor struct type building
sitio-couto Aug 28, 2023
44430ba
[CIR] Refactor StructType printing/parsing
sitio-couto Aug 28, 2023
1eb527e
[CIR] Add record kind enum in StructType
sitio-couto Aug 28, 2023
f4fcccc
[CIR] Refactor StructElementAddr into GetMemberOp
sitio-couto Aug 28, 2023
05a94f6
[CIR][CIRGen][Bugfix] Update unions to track all members
sitio-couto Aug 28, 2023
97db1ae
[CIR][Lowering] Lower unions
sitio-couto Aug 28, 2023
afa51d4
[CIR][Codegen] Destructor support for global variable initialization …
htyu Aug 29, 2023
624223a
[CIR][CIRGen] fixes explicit cast and minor bug in unary & operator
gitoleg Aug 25, 2023
8fe9081
[CIR][Lowering] Support lowering of nested string ConstantArrays.
yugr Aug 24, 2023
7b3f877
[CIR][Lowering] Global destructor support (#249)
htyu Aug 30, 2023
920dcd6
[CIR][CIRGen] Add initial support for throw expression
bcardosolopes Aug 30, 2023
140b35c
[CIR][CIRGen] Add missing test for cir.throw
bcardosolopes Aug 31, 2023
b859a24
[CIR][CIRGen][NFC] Add more checks for detecting proper vtable linkage
bcardosolopes Sep 1, 2023
ac82b5d
[CIR][CIRGen] Add support for nullptr_t
bcardosolopes Sep 1, 2023
5bfecc1
[CIR][CIRGen][NFC] Try-catch support: skeleton
bcardosolopes Sep 1, 2023
bac5b1b
[CIR][CIRGen][NFC] Cleanup buildCall a bit and pave for CannotThrow
bcardosolopes Sep 2, 2023
bf89b5b
[CIR][CIRGen][NFC] Introduce ConstructAttributeList, to populate cir.…
bcardosolopes Sep 2, 2023
5f349e7
[CIR][CIRGen] Add skeleton to handle invoke / landing pad like logic
bcardosolopes Sep 2, 2023
7d4320b
[CIR][NFC] Add sketch for TryOp
bcardosolopes Sep 7, 2023
d46979c
[CIR][NFC] Add sketch for CatchOp
bcardosolopes Sep 7, 2023
ae18581
[CIR][CIRGen] Create catch op and track entry blocks for each clause
bcardosolopes Sep 7, 2023
1a0f501
[CIR][CIRGen][Lowering] Generate GlobalViewAttr for string literals (…
yugr Aug 24, 2023
bc8c25d
[CIR][CIRGen] Removes hasBooleanRepresentation (#251)
gitoleg Sep 7, 2023
c5bb2e8
[CIR] Introduce ConstPtrAttr for absolute pointer value initializatio…
htyu Sep 12, 2023
4c10875
[CIR][Lowering] Support endless loops (gh-161).
yugr Sep 12, 2023
f37da01
[CIR] Implement fabs operation. (#254)
yugr Sep 13, 2023
76f1fa4
[CIR][IR] Bypass get_member verifier for incomplete types
sitio-couto Sep 13, 2023
bea9906
[CIR][Codegen] VTT support for virtual class inheritance (#252)
htyu Sep 13, 2023
01b9dc6
[CIR][CIRGen] CIR generation for bitfields. Fixes #13 (#233)
gitoleg Sep 14, 2023
7e54191
Revert "[CIR][CIRGen] CIR generation for bitfields. Fixes #13 (#233)"
bcardosolopes Sep 15, 2023
cd67650
[CIR] Make AST attributes accessible via interfaces. (#250)
xlauko Sep 18, 2023
f5d0a0f
[CIR][CodeGen][Bugfix] Generate field index with respect to layout (…
gitoleg Sep 19, 2023
cef3df8
[CIR][Lowering] Add scf.scope lowering to standard dialects (#262)
Kuree Sep 19, 2023
4ea8de4
[CIR][CIRGen][Exception] Workaround internal testcase break
bcardosolopes Sep 7, 2023
3109e04
[CIR][Bugfix] adds clangAST dependency
gitoleg Sep 20, 2023
a0aed8c
[CIR] Remove cir-tidy
lanza Sep 22, 2023
5d69cff
[CIR][Lowering] use cir.int type in LIT tests (#266)
Kuree Sep 26, 2023
212d51c
[CIR][CIRGen] Revisiting CIR generation for bitfields. Fixes #13 (#268)
gitoleg Sep 26, 2023
569d88b
[CIR][Codegen][Bugfix] use record layout to generate index for a fiel…
gitoleg Sep 26, 2023
f3d2033
[CIR][Lowering] Deprecate typed LLVM dialect pointers (#271)
sitio-couto Sep 26, 2023
90ad669
[CIR][Lowering][Bugfix] Fix GetMemberOp lowering (#273)
sitio-couto Sep 26, 2023
3f4338a
[CIR][Rebasing] Add header for llvm::join
lanza Oct 6, 2023
c7e3740
[CIR][Rebasing] Account for OpenMPIsDevice renaming
lanza Oct 6, 2023
e429fd5
[CIR][Rebasing] Adapt a few fns for upstream and adjust some tests
lanza Oct 6, 2023
9c427bf
[CIR] Replace an assert with an unreachable
lanza Oct 6, 2023
52ab8d0
[CIR][Lowering] Add cir.brcond lowering (#278)
Kuree Oct 18, 2023
2e08b4e
[CIR][IR] Relax get_member verifier for incomplete types (#269)
gitoleg Oct 18, 2023
126ef4f
[CIR][CodeGen][Bugfix] supports local structs decl (#280)
gitoleg Oct 18, 2023
54a62ef
[CIR][CodeGen][Bugfix] fixes global vars initialization (#281)
gitoleg Oct 18, 2023
2ff3de7
[CIR][CIRGen] Ensure unique IDs for anonymous records (#274)
sitio-couto Oct 18, 2023
a751dff
[CIR] Rename StructType "typeName" attribute to "name" (#275)
sitio-couto Oct 18, 2023
53ee1f3
[CIR][Codegen] RTTI support for virtual class inheritence (#259)
htyu Oct 18, 2023
d4a20d8
[CIR][Lowering] Lower vtable and type info (#264)
htyu Oct 19, 2023
a450eed
[CIR][Lowering] Fix opaque pointer issue from recent merge
bcardosolopes Oct 19, 2023
454cdc7
[CIR][NFC] Refactor StructType body attribute
sitio-couto Sep 22, 2023
3be05c3
[CIR][NFC] Remove std::optional from StructType ast attribute
sitio-couto Sep 22, 2023
be846dd
[CIR][CIRGen][NFC] Fix redudancy while casting integers and remove wr…
bcardosolopes Oct 25, 2023
fa015ea
[CIR] Implement bool->int conversion (#292)
dkolsen-pgi Oct 27, 2023
68ff280
[CIR][Codegen] Support codegen for FP truncations. (#291)
yugr Oct 30, 2023
b4cb6ac
[CIR][CodeGen] Introduce CIRBaseBuilder (#297)
gitoleg Nov 1, 2023
51644be
[CIR][CodeGen] Support integer-to-pointer casts. (#298)
yugr Nov 1, 2023
9385689
[CIR][CIRGen] Ensure unique names for template specializations (#295)
sitio-couto Nov 1, 2023
907af96
[CIR][CIRGen] Refactor StructType builders (#294)
sitio-couto Nov 1, 2023
2c12f80
[CIR] Forbid identified structs with empty names (#301)
sitio-couto Nov 1, 2023
8ba9e09
[CIR] Honor disabling the verifier in lowerDirectlyFromCIRToLLVMIR
bcardosolopes Nov 3, 2023
adfef40
[CIR][IR][NFC] Redefine tablegen CIR StructType with C++
sitio-couto Nov 3, 2023
32aff4d
[CIR][CIRGen] Support mutable and recursive named records
sitio-couto Nov 3, 2023
776519a
[CIR][NFC] Refactor ScalarExprEmitter::buildScalarCast (#306)
dkolsen-pgi Nov 8, 2023
048199a
[CIR][CodeGen][Bugfix] fixes explicit cast in initialization (#309)
gitoleg Nov 14, 2023
21da5e1
[CIR] Support bool-to-float conversions (#307)
dkolsen-pgi Nov 15, 2023
7f73051
[CIR] Add validation tests for scalar casts (#317)
dkolsen-pgi Nov 15, 2023
35e9da0
[CIR] Fix bool-to-pointer conversions (#319)
dkolsen-pgi Nov 17, 2023
ffa498e
[CIR][CIRGen] Ensure proper tmp location for agg exprs (#320)
gitoleg Nov 18, 2023
03df997
[CIR][CodeGen] Support global variable offsets in initializers (gh-29…
yugr Nov 20, 2023
9eb6612
[CIR][CIRGen][Lowering] supports functions pointers (#316)
gitoleg Nov 20, 2023
611bc4c
[CIR][Lowering] fix lowering for the structs inited with zeros (#315)
gitoleg Nov 20, 2023
3628228
[CIR][Codegen] Fixes function ptrs in recursive types (#328)
gitoleg Nov 22, 2023
39694bf
[CIR][IR] Harden get_member verifier (#330)
gitoleg Nov 22, 2023
f8c1d43
[CIR][CodeGen] Support incomplete arrays (#333)
gitoleg Nov 22, 2023
d675625
[CIR][CodeGen][Lowering] Support global variables under -fcommon. (#334)
yugr Nov 22, 2023
d382404
[CIR][NFC] Move LexicalScope after RunCleanupsScope
bcardosolopes Nov 28, 2023
458dec8
[CIR][CIRGen] Generalize and run cleanups on lexical scopes
bcardosolopes Nov 28, 2023
935aca0
[CIR][NFC] Make test more portable on windows
bcardosolopes Nov 29, 2023
2ef8776
[CIR] Change GlobalViewAttr indices to use MLIR integers. (#327)
yugr Nov 29, 2023
a9a7c26
[CIR][IR] Fix ConstPtrAttr parsing (#341)
sitio-couto Nov 29, 2023
0aadb74
[CIR][Lowering] Fix vbase.cpp test (#342)
sitio-couto Nov 29, 2023
6554863
[CIR][CIRGen] Fix agg-init2.cpp test (#343)
sitio-couto Nov 29, 2023
c74aed1
[CIR][NFC] Remove XFAIL from ThroughMLIR tests (#344)
sitio-couto Nov 29, 2023
48572c3
[CIR][CogeGen] Support aggregate copy via assignment (#325)
gitoleg Nov 30, 2023
3cd2c56
[CIR][CodeGen] Bitfield operations (#279)
gitoleg Nov 30, 2023
d40e85d
[CIR][CIRGen] Fix zero-offset global view access
sitio-couto Nov 23, 2023
d1c6a4d
[CIR][github] Setup github test CIR workflow. (#332)
xlauko Nov 30, 2023
540517d
[CIR][CIRGen] Handle more variations on dtor emission
bcardosolopes Dec 2, 2023
463c780
[CIR][CIRGen] Enable more cases for dtor generation
bcardosolopes Dec 2, 2023
cd6e2de
[CIR][CIRGen][NFC] Refactor alias emission
bcardosolopes Dec 5, 2023
bd97626
[CIR][IR] Refactor parsing/printing of implicitly terminated regions
sitio-couto Dec 6, 2023
f94deb1
[CIR][IR] Refactor ScopeOp assembly format
sitio-couto Dec 6, 2023
a6c54fe
[CIR][NFC] Remove comment breadcrumb
bcardosolopes Dec 5, 2023
176e9a3
[CIR][CIRGen] Handle non-type template params during record printing
bcardosolopes Dec 6, 2023
478802d
[CIR][CIRGen] More non-type template param expr for std::array
bcardosolopes Dec 6, 2023
e9d6705
[CIR] Add a testcase for a usage of std::find
bcardosolopes Dec 7, 2023
bd87e2d
[CIR] Add cir.libc.memchr operation
bcardosolopes Dec 8, 2023
7af1085
[CIR] Add tablegen constraints for cir::IntType
bcardosolopes Dec 8, 2023
0fffb27
[CIR] Add tablgen constraints void pointers
bcardosolopes Dec 8, 2023
035dded
[CIR][CodeGen] Inline asm: CIR operation (#326)
gitoleg Dec 8, 2023
2e8461d
[CIR][CodeGen] Add dynamic AllocaOp support (#340)
gitoleg Dec 8, 2023
b89132d
[CIR][Lowering] Fix loop lowering for top-level break/continue (#349)
gitoleg Dec 8, 2023
85f6393
[CIR] Make cir.libc.memchr more constrained
bcardosolopes Dec 9, 2023
1caf67d
[CIR] Add skeleton for Idiom Recognizer pass
bcardosolopes Dec 9, 2023
8096e30
[CIR][NFC] Make ASTDecl more about AST than Decls
bcardosolopes Dec 9, 2023
bc47fa9
[CIR] Introduce mappings for clang::Expr
bcardosolopes Dec 9, 2023
7a46b55
[CIR][NFC] Add ASTCallExprInterface to CallOp
bcardosolopes Dec 9, 2023
8b60b9a
[CIR][CIRGen] Add CallExpr nodes to cir.call when possible
bcardosolopes Dec 9, 2023
e4ca377
[CIR][NFC] Add a isStdFunctionCall method to ASTCallExprInterface
bcardosolopes Dec 12, 2023
b3c3e8e
[CIR][NFC] Isolate ClangIR-specific options in Options.td
bcardosolopes Dec 12, 2023
ff44f50
[CIR] Add initial support for idiom recognizing std::find
bcardosolopes Dec 9, 2023
8bf7a43
[CIR] Add cir.std.find operation
bcardosolopes Dec 12, 2023
6a819c3
[CIR] Raise std::find call to cir.std.find
bcardosolopes Dec 12, 2023
031bf70
[CIR][Lowering] Fix function ptr field lowering in a global struct (#…
gitoleg Dec 13, 2023
15e0ad9
[CIR][NFC] Formatting
lanza Dec 14, 2023
f7d1590
[CIR] Vector types - part 1 (#347)
dkolsen-pgi Dec 14, 2023
bfae692
[CIR][CodeGen][Lowering] Support multi-block case/default clauses (#356)
gitoleg Dec 19, 2023
325c8b6
[CIR][NFC] Fix some copy n paste and update comments
bcardosolopes Dec 19, 2023
ec80621
[CIR][Passes] Introduce cir-lib-opt pass
bcardosolopes Dec 19, 2023
4e263f5
[CIR] Fix issues pointed by github CI
bcardosolopes Dec 20, 2023
3a81895
[CIR] Add iterator_{begin,end} ops
bcardosolopes Dec 20, 2023
76aeb7b
[CIR][IdiomRecognizer] Recognize few variations for begin/end iterators
bcardosolopes Dec 20, 2023
f8ff91a
[CIR][CodeGen] Use signed type for result of ptrdiff operation. (#355)
yugr Dec 21, 2023
58a6262
[CIR] support -std=gnu89 (#358)
gitoleg Dec 21, 2023
8034b97
[CIR][CodeGen] support extern var in function (#359)
gitoleg Dec 21, 2023
81be6d5
[CIR][Codegen] Adds Stack save-restore ops (#346)
gitoleg Dec 21, 2023
dbdd28b
[CIR][Lowering][Bugfix] Lower nested breaks in switch statements (#357)
gitoleg Dec 21, 2023
d0dd042
[CIR] Change mock std::array iterator definitions
bcardosolopes Dec 21, 2023
3c94e31
[CIR][IdiomRecognizer] Make iterator recognition more strict
bcardosolopes Dec 21, 2023
5ecc5b4
[CIR] Cleanup idiom-recognizer and lib-opt options
bcardosolopes Dec 22, 2023
c1fe1f2
[CIR][LibOpt] Add a first transformation: std::find to memchr
bcardosolopes Dec 22, 2023
66f7a40
[mlir][llvm] Fixes CallOp builder for the case of indirect call
gitoleg Dec 22, 2023
e53b5c9
[CIR] un-xfail two tests fixed by llvm #76420
lanza Dec 22, 2023
e8cf076
fixup! [mlir][llvm] Fixes CallOp builder for the case of indirect call
lanza Jan 29, 2024
7b1fd66
[CIR][CodeGen] Fix flat offset lowering code to consider field alignm…
yugr Dec 13, 2023
f8c6adb
[CIR][Lowering][Bugfix] Lower ScopeOp with return op (#364)
gitoleg Jan 4, 2024
ccf9c9b
[CIR][CodeGen] Support lowering of cir.const with ZeroAttr. (#365)
yugr Jan 4, 2024
f51cdec
[CIR][Lowering][Bugfix] explicit lowering for the indirect call
gitoleg Dec 26, 2023
043aa75
Revert "[mlir][llvm] Fixes CallOp builder for the case of indirect call"
gitoleg Dec 26, 2023
9bcfc1a
[CIR][CIRGen][NFC] Enhance alloca helpers (#367)
gitoleg Jan 4, 2024
dd1123f
[CIR][Lowering] add cir.ternary to scf.if lowering (#368)
Kuree Jan 4, 2024
5262dda
[CIR][CIRGen] supports struct copy from function call result (#369)
gitoleg Jan 4, 2024
fcd7462
[CIR][CodeGen] Fix lowering for class types (#378)
philnik777 Jan 4, 2024
4e8f97d
[CIR][Lowering] Support lowering of cir.const with GlobalViewAttr (gh…
yugr Jan 4, 2024
be1a251
[CIR][CIRGen] emit cir.zero for constant string literals (#373)
Lancern Jan 4, 2024
37732f8
[CIR][CIRGen] Lvalues and comma expression (#376)
Lancern Jan 4, 2024
96bb98f
[CIR] Replace AnyType with CIR_AnyType (#371)
Lancern Jan 9, 2024
b9e19a2
[CIR][CIRGen] Support array def after decl with unknown bound (#375)
Lancern Jan 9, 2024
8f21b49
[CIR][CIRGen] Implement constant evaluation for integral builtins (#381)
philnik777 Jan 9, 2024
373c887
[CIR][Transforms][NFC] Refactor MergeCleanups pass (#384)
sitio-couto Jan 9, 2024
7274cc5
[CIR][NFC] Enable the formatting workflow for llvm/clangir and format…
philnik777 Jan 10, 2024
6d7ab16
[CIR][Transforms][Bugfix] Do not use-after-free in MergeCleanups and …
yugr Jan 10, 2024
a37d71e
[CIR][IR] Implement loop's conditional operation (#391)
sitio-couto Jan 10, 2024
ece0e11
[CIR][NFC] Canonicalize the names of the lowering classes
philnik777 Jan 10, 2024
dced002
[CIR][CIRGen][NFC] Support yielding values in LexicalScope
sitio-couto Jan 10, 2024
01bdc1d
[CIR][CIRGen][NFC] Return scope result in compound stmt builders
sitio-couto Jan 10, 2024
5240538
[CIR][CIRGen] Partially support statement expressions return values
sitio-couto Jan 10, 2024
65ac181
[CIR] Introduce exception info type
bcardosolopes Nov 3, 2023
d30f499
Revert "[CIR][CIRGen][Exception] Workaround internal testcase break"
bcardosolopes Nov 3, 2023
57f5daa
[CIR][CIRGen][Exceptions] More on try statemet codegen: wrap with cir…
bcardosolopes Jan 11, 2024
62fa7e6
[CIR][NFC] Update comment for implemented fix
bcardosolopes Jan 11, 2024
126c22c
[CIR][CIRGen] Fix wrong assert
bcardosolopes Nov 13, 2023
4807a28
[CIR] Add a CIRCallOpInterface, on top of CallOpInterface
bcardosolopes Jan 11, 2024
a53f205
[CIR][NFC] Refactor cir.call into a tablegen helper class
bcardosolopes Jan 12, 2024
8306747
[CIR] Introduce cir.try_call operation
bcardosolopes Jan 12, 2024
807899f
[CIR][CIRGen] Add constraints to inline assembly (#351)
gitoleg Jan 16, 2024
dd7bc5c
[CIR][Lowering] Support lowering of const arrays of structs (#370)
gitoleg Jan 16, 2024
bf610f8
[CIR][CIRGen] Implement unary floating point builtins (#383)
philnik777 Jan 16, 2024
905a45a
[CIR] Fix int constant type verification (#386)
Lancern Jan 16, 2024
1497843
[CIR] Vector types, part 2 (#387)
dkolsen-pgi Jan 16, 2024
76c9f1a
[CIR][IR] Implement `cir.continue` operation
sitio-couto Jan 16, 2024
def74b9
[CIR][IR] Implement `cir.break` operation
sitio-couto Jan 16, 2024
596559f
[CIR][IR] Deprecate `cir.yield nosuspend`
sitio-couto Jan 16, 2024
2e01ec4
[CIR][IR] Deprecate `cir.yield fallthrough`
sitio-couto Jan 16, 2024
9a82c8a
[CIR] TryCallOp: add blocks, arguments, proper interface impl and tes…
bcardosolopes Jan 16, 2024
2b5cd69
[CIR][Exceptions] Simplify cir.try_call
bcardosolopes Jan 17, 2024
dbccdb1
[CIR] TryCallOp: improve printing
bcardosolopes Jan 17, 2024
14747d7
[CIR][CIRGen][Exceptions] More prep work on landing-pad like logic
bcardosolopes Jan 18, 2024
6d1d001
[CIR][CIRGen][Exceptions] Complete buildCatchDispatchBlock
bcardosolopes Jan 18, 2024
2af33f4
[CIR] Add cir.resume op and use it in cir.catch
bcardosolopes Jan 18, 2024
64efeb2
[CIR][CIRGen] Support wide string literals (#399)
Lancern Jan 19, 2024
d129b76
[CIR][OpenMP] Initial commit for OpenMP support in CIR (#382)
fabianmcg Jan 22, 2024
97c0a0b
[CIR][Interfaces] Implement LoopOpInterface
sitio-couto Jan 22, 2024
382c3fc
[CIR][Lowering][NFC] Refactor LoopOp lowering
sitio-couto Jan 22, 2024
25d62f0
[CIR][IR] Refactor do-while loops
sitio-couto Jan 22, 2024
82bd985
[CIR][IR] Refactor while loops
sitio-couto Jan 22, 2024
ca93268
[CIR][IR] Refactor for loops
sitio-couto Jan 22, 2024
1d3572b
[CIR][CIRGen][Exceptions] Populate catch clauses and fix order of ope…
bcardosolopes Jan 23, 2024
27e7d22
[CIR] Fix a few depends to only apply to ClangIR
lanza Jan 25, 2024
e9c1dc6
[CIR] Make MLIRCIR depend on MLIRCIRInterfaces
lanza Jan 27, 2024
d348a30
[CIR] Remove LLVM_ENABLE_PROJECTS support
lanza Jan 26, 2024
3a2e923
[CIR][Interfaces] Temporarily disable verifier to get out of circular…
lanza Jan 27, 2024
79d4dc7
[CIR] Move CI to CLANG_ENABLE_CIR
lanza Jan 29, 2024
38bc6fd
fixup! [CIR][Interfaces] Temporarily disable verifier to get out of c…
lanza Jan 30, 2024
9bc8b47
[CIR][CIRGen][Exceptions] Use cir.try instead of cir.scope
bcardosolopes Jan 30, 2024
095d1c5
[CIR][CIRGen][NFC] Make buildCall more generic by using CIRCallOpInte…
bcardosolopes Jan 30, 2024
aa157fe
[CIR][CIRGen][Exceptions] Use cir.try_call within cir.try regions
bcardosolopes Jan 30, 2024
afb7c68
[CIR] Add a new volatile flag to distinguish volatile accesses (#402)
Lancern Jan 31, 2024
f2ac9f5
[CIR] Vector types, comparison operators (#432)
dkolsen-pgi Jan 31, 2024
e7a6bba
[CIR][CIRGen] Add missing visitor for ParenExpr (#428)
YazZz1k Jan 31, 2024
2df5711
[CIR][Lowering] Add the concept of simple lowering and useit to imple…
philnik777 Jan 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
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 @@ -6,7 +6,7 @@ permissions:
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](http://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
)
Loading
Loading