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][ThroughMLIR] Support lowering SwitchOp without fallthrough to scf #986

Open
wants to merge 1,956 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1956 commits
Select commit Hold shift + click to select a range
43f84bd
[CIR][LowerToLLVM] Exceptions: lower cir.try_call to llvm's invoke
bcardosolopes Jul 31, 2024
92f4df7
[CIR][LowerToLLVM][NFC] Fix formatting error and add skeleton for EhI…
bcardosolopes Jul 31, 2024
582f06e
[CIR][LowerToLLVM] Exceptions: more lowering work for `cir.try_call` …
bcardosolopes Jul 31, 2024
c28af61
[CIR][LowerToLLVM] Exceptions: lower cir.eh.typeid
bcardosolopes Jul 31, 2024
ae91222
[CIR][LowerToLLVM] Exceptions: lower cir.catch_param
bcardosolopes Jul 31, 2024
ffe43e7
[CIR][NFC] Fix few unused vars and tablegen format
bcardosolopes Jul 31, 2024
256a8bb
[CIR][CodeGen][Lowering] Better handling of alloca address space with…
seven-mile Aug 1, 2024
c8fc5d5
[CIR][ThroughMLIR] Lowering cir.do to scf.while,and fix cir.while low…
GaoXiangYa Aug 1, 2024
f25c23e
[CIR][CIRGen] Add CIRGen for scalar co_yield expression (#761)
Lancern Aug 1, 2024
30bc050
[CIR] CIRGen for bit cast builtin (#762)
Lancern Aug 1, 2024
9fe2333
[CIR][ABI][NFCI] Enable SPIR-V return value and argument ABI to use D…
seven-mile Aug 1, 2024
cdea7af
[CIR][LowerToLLVM][NFC] Refactor `amendOperation` to dispatch differe…
seven-mile Aug 2, 2024
aa85d46
[CIR][Dialect] Emit OpenCL kernel argument metadata (#767)
seven-mile Aug 2, 2024
e2c3b82
[CIR][Dialect][Lowering] Add calling convention attribute to FuncOp (…
seven-mile Aug 2, 2024
a8c8d47
[CIR][ThroughMLIR] Support array type GlobalOp lowering with initial …
ShivaChen Aug 2, 2024
515a6bb
[CIR][LowerToLLVM][NFC] Add data layout verification of alloca as (#769)
seven-mile Aug 7, 2024
8f08c82
[CIR][CodeGen][NFC] Replace the calling convention in CodeGen with th…
seven-mile Aug 7, 2024
7f6a112
[CIR][Dialect] Add OpenCL C language in cir.lang (#774)
seven-mile Aug 7, 2024
8fe0460
[CIR][FlattenCFG][LowerToLLVM] Exceptions: lower cir.resume
bcardosolopes Aug 7, 2024
d196a1c
[CIR] Introduce CIR simplification (#696)
gitoleg Aug 7, 2024
4e0f6a3
[CIR][NFC] Cleanup whitespaces
bcardosolopes Aug 7, 2024
beb5cdf
[CIR][NFC] Fix warnings post rebase + from PRs
bcardosolopes Aug 7, 2024
5ee7f9f
[CIR] Add support for complex cast operations (#758)
Lancern Aug 8, 2024
fc230fb
[CIR][CodeGen][LowerToLLVM] Emit OpenCL version metadata for SPIR-V t…
seven-mile Aug 8, 2024
8ffb552
[CIR][Transforms] Add folders for complex operations (#775)
Lancern Aug 8, 2024
fdb48cb
[CIR][CodeGen][NFCI] Target-independent ABI handling for SpirKernel c…
seven-mile Aug 8, 2024
5e8b4a1
[CIR][Dialect] Add address space attribute to global op (#779)
seven-mile Aug 8, 2024
b4bc921
[CIR][CIRGen][NFC] Tide up cir.alloc.exception
bcardosolopes Aug 8, 2024
f7b6a49
[CIR][LowerToLLVM] Exceptions: lower cir.alloc.exception
bcardosolopes Aug 8, 2024
fc2ea65
[CIR][LowerToLLVM] Exceptions: lower cir.throw
bcardosolopes Aug 9, 2024
65817d7
[CIR][CodeGen] Set CIR function calling conventions (#780)
seven-mile Aug 9, 2024
5743391
[CIR][CodeGen][Dialect][NFC] Refactor OpenCL stuff to separate impl f…
seven-mile Aug 9, 2024
054485c
[CIR][ClangTidy][Lifetime] Update to newer dyn_cast usage and update …
bcardosolopes Aug 9, 2024
1ef4b45
[CIR][CIRGen][NFC] Add more missing feature tracking and cleanup warn…
bcardosolopes Aug 9, 2024
6912d20
[CIR][FrontendAction] Use ClangIR pipeline to emit LLVM bitcode (#782)
seven-mile Aug 9, 2024
ae5a97e
[CIR][NFC] Add missing feature for nodebug
bcardosolopes Aug 9, 2024
48a3782
[CIR][CIRGen] Emit constant global _Atomic's
bcardosolopes Aug 9, 2024
4bda394
[CIR][CIRGen] Builtins: focus on non fast math path
bcardosolopes Aug 10, 2024
04287e2
[CIR][LowerToLLVM] Support address space lowering for global ops (#783)
seven-mile Aug 12, 2024
84a486a
[CIR][ABI] Implement basic struct CC lowering for x86_64 (#784)
sitio-couto Aug 12, 2024
9c33243
[CIR][CIRGen] Implement VisitCXXStdInitializerListExpr to support use…
ghehg Aug 13, 2024
6949a3a
[CIR][CIRGen] Support more complex value casts (#786)
Lancern Aug 13, 2024
a0239aa
[CIR][Dialect] Add verification of address space to `get_global` (#787)
seven-mile Aug 13, 2024
0fb41a1
[CIR][CodeGen] Set address space for OpenCL globals (#788)
seven-mile Aug 14, 2024
1e9382e
[CIR] Fix wrong LLVMIR lowering of fp decrement (#789)
Lancern Aug 14, 2024
354e876
[CIR][CIRGen] Add new CIR visibility to represent Default, Hidden, Pr…
roro47 Aug 15, 2024
4eb034b
[CIR][CIRGen] Complex unary increment and decrement operator (#790)
Lancern Aug 15, 2024
34bc341
[CIR][CodeGen] Set address space for OpenCL static and local-qualifie…
seven-mile Aug 15, 2024
e487b83
[CIR][ABI][NFC] Follow-up to struct unpacking (#791)
sitio-couto Aug 15, 2024
63c6bdf
[CIR][CIRGen] Add CIRGen support for pointer-to-member-functions (#722)
Lancern Aug 20, 2024
970efe9
[CIR][CIRGen] Achieve union's bitfields additionally. (#742)
566hub Aug 20, 2024
2f82a2a
[CIR] Cleanup most recent warnings
bcardosolopes Aug 21, 2024
e6ac8e5
[CIR] More warning fixed by another fresh build
bcardosolopes Aug 21, 2024
253d1e3
[CIR] Add select operation (#796)
Lancern Aug 21, 2024
cb40fcc
[CIR][CIRGen] Inline variables processing (#794)
ivanmurashko Aug 22, 2024
8dc84ff
[CIR] Incorrect global view index and offset when neg index (#795)
HerrCai0907 Aug 22, 2024
2f86e11
[CIR][NFC] Replace ternary ops after lowering prepare to select ops (…
Lancern Aug 22, 2024
403f4dc
[CIR][CirGen][Bugfix] Fixes __sync_fetch_and_add for unsigned integer…
bruteforceboy Aug 23, 2024
d784759
[CIR][CIRGen] Support global initialization with new
bcardosolopes Aug 23, 2024
f13d2ec
[CIR][NFC] Fix sign-compare warning
bcardosolopes Aug 23, 2024
49ceda3
[CIR] Add missing testcase for previous commit
bcardosolopes Aug 23, 2024
307fd34
[CIR][CIRGen] Add minimal support for building invariant globals
bcardosolopes Aug 23, 2024
ddf7003
[CIR][Lowering] Add the concept of simple lowering and use it for una…
Lancern Aug 27, 2024
ec31a4a
[CIR][CIRGen] Exceptions: Use the surrounding scope (if available) fo…
bcardosolopes Aug 28, 2024
e9527a6
[CIR][NFC] Exceptions: introduce cleanup region to cir.try
bcardosolopes Aug 28, 2024
806b457
[CIR][CIRGen] Exceptions: handle cleanups and global initializers
bcardosolopes Aug 26, 2024
14dd633
[CIR][FlattenCFG] Exceptions: propagate cleanups to flat CIR
bcardosolopes Aug 28, 2024
c0c66d7
[CIR] Add new HLSLResource enum value coverage
lanza Aug 30, 2024
1529f0e
[CIR] Exceptions: propagate more cleanup info for LLVM lowering use
bcardosolopes Aug 29, 2024
8ef6fce
[CIR][CIRGen][NFC] Add more skeleton to make crashes fine grained on …
bcardosolopes Aug 29, 2024
672ade9
[CIR][NFC] Exceptions: Move a crash to an assert
bcardosolopes Aug 29, 2024
eefe053
[CIR][CIRGen] Handle paren list init and get dtors right
bcardosolopes Aug 29, 2024
91720d6
[CIR][CIRGen] Handle more cleanup situations and fix bug
bcardosolopes Aug 29, 2024
9682945
[CIR][NFC] Leftover from previous commit
bcardosolopes Aug 30, 2024
b6685a2
[CIR][NFC] Cleanup tests a bit to reflect tested platform
bcardosolopes Aug 30, 2024
5956abb
[CIR] Disable test temporatily
bcardosolopes Aug 30, 2024
f494178
[CIR] Another attempt to disable tests
bcardosolopes Aug 30, 2024
ef771a4
[CIR] Reland failing tests (#811)
bcardosolopes Aug 31, 2024
ecae00b
[CIR][CIRGen] Support pure and deleted virtual functions (#823)
smeenai Sep 5, 2024
cd0ca4c
[CIR][CIRGen][Lowering] Get alignment from frontend and pass it to LL…
ghehg Sep 9, 2024
99aef47
[CIR][CodeGen] Fix address space of result pointer type of array deca…
seven-mile Sep 9, 2024
410d638
[CIR][Transform] Add simplify transformation for select op (#816)
Lancern Sep 9, 2024
f32fe84
[CIR][NFC] Extend simple lowering to unary fp2int ops and binary fp2f…
Lancern Sep 9, 2024
7f528a8
[CIR][CIRGen] Add initial CIRGen support for local temporary material…
Lancern Sep 9, 2024
d6c0ec3
[CIR][CIRGen] Implement delegating constructors (#821)
smeenai Sep 9, 2024
8dc4fb4
[CIR][Dialect] Verify bitcast does not contain address space conversi…
seven-mile Sep 10, 2024
f8d1d9c
[CIR][Dialect] Remove 22 prefix and suffix from type aliases (#826)
smeenai Sep 10, 2024
a4fa59b
[CIR][Lowering] Fix BrCond Lowering (#819)
bruteforceboy Sep 10, 2024
dd9e883
[CIR] Add some extra dumping to help with intermitent bug
bcardosolopes Sep 10, 2024
ed1f9fd
[CIR][driver] Forward -fno-clangir-direct-lowering option to cc1 (#822)
keryell Sep 10, 2024
f2349c4
[CIR][CIRGen] Exceptions: handle synthetic cir.try within functions
bcardosolopes Sep 11, 2024
c1e80e1
[CIR][Transform] Add ternary simplification (#809)
Lancern Sep 11, 2024
127fb54
[CIR][CIRGen] Support a defined pure virtual destructor (#825)
smeenai Sep 11, 2024
a0ea3fb
[CIR][Dialect] Add calling convention attribute to cir.call op (#828)
seven-mile Sep 11, 2024
548a503
[CIR][CIRGen] Exception: get scope order right for try/catch with cle…
bcardosolopes Sep 11, 2024
9f26e4e
[CIR][LowerToLLVM] Exceptions: llvm.zero needed for landingpad should…
bcardosolopes Sep 11, 2024
972ca21
[CIR][CIRGen] Exceptions: support nested scope cleanup
bcardosolopes Sep 11, 2024
5214678
[CIR][CodeGen][NFCI] Unify attribute list handling of func / call by …
seven-mile Sep 12, 2024
dfc1677
[CIR][CodeGen] Refactor `setExtraAttributesForFunc` to better align w…
seven-mile Sep 12, 2024
e6fffd6
[CIR][Asm] Fix parsing of extra(...) attributes in cir.call (#835)
keryell Sep 13, 2024
6d07605
[CIR][CodeGen][LowerToLLVM] Set calling convention for call ops (#836)
seven-mile Sep 13, 2024
bc457d4
[CIR][Lowering] Fix static array lowering (#838)
bruteforceboy Sep 13, 2024
967ae69
[CIR][CIRGen][Lowering] Add support for attribute annotate (#804)
ghehg Sep 13, 2024
bae79ba
[CIR][CIRGen][NFC] Exceptions: add cleanups to cir.call
bcardosolopes Sep 13, 2024
9e13781
[CIR][CIRGen][NFC] Exceptions: refactor invoke checks to better align…
bcardosolopes Sep 13, 2024
8f820ed
[CIR][CIRGen][NFC] Exceptions: sink invoke logic closer to call emission
bcardosolopes Sep 13, 2024
06f96ca
[CIR][CIRGen][NFC] Exceptions: Move the logic to create surrounding t…
bcardosolopes Sep 13, 2024
665798d
[CIR][CIRGen][NFCI] Exceptions: change getEHDispatchBlock to create b…
bcardosolopes Sep 14, 2024
143e2a5
[CIR][NFC] Fix mismatch of argument type in IR tests (#837)
seven-mile Sep 14, 2024
bff487f
[CIR][Dialect] Add `convergent` attribute to functions for SIMT langu…
seven-mile Sep 16, 2024
7b4e3c7
[CIR][FlattenCFG] Fix use after free when flattening terminator (#843)
smeenai Sep 16, 2024
c01b543
[CIR][CodeGen][BugFix] Fixes structures name collisions (#844)
gitoleg Sep 16, 2024
229ebc1
[CIR][Bugfix] renames minor/major parameters of the OpenCLVersionAttr…
gitoleg Sep 16, 2024
3a95d58
[CIR][CodeGen] Support FullExpression storage duration cleanup (#846)
lanza Sep 16, 2024
12f12bf
[CIR][CIRGen] Properly link multiple level of cleanups
bcardosolopes Sep 14, 2024
25bf750
[CIR][CodeGen] Fix packed structures (#839)
bruteforceboy Sep 17, 2024
6eee944
[CIR][CIRGen] add CIRGen support for assume builtins (#841)
Lancern Sep 17, 2024
a64c961
[CIR][NFC] Change default LLVM output file extension (#849)
Lancern Sep 17, 2024
08b2e1e
[CIR][Asm] Parse extra attributes after calling convention (#847)
keryell Sep 17, 2024
efee5c0
[CIR][CIRGen][Lowering] Lower AArch64::BI__builtin_arm_ldrex to llvm …
ghehg Sep 17, 2024
07315cb
[CIR][FlattenCFG][NFC] Exceptions: refactor landing pad code and catches
bcardosolopes Sep 17, 2024
2950f36
[CIR][CIRGen][NFC] Exceptions: refactor more infra for handling multi…
bcardosolopes Sep 18, 2024
4038dff
[CIR][CIRGen][NFCI] Exceptions: generalize landing pad insertion
bcardosolopes Sep 18, 2024
39a2c08
[CIR][FlattenCFG][NFCI] Exceptions: more generalization for dispatch …
bcardosolopes Sep 18, 2024
86d5ca4
[CIR][FlattenCFG][NFCI] Exceptions: generalize catch dispatch emission
bcardosolopes Sep 18, 2024
3729f9f
[CIR][NFC] Move things around in try-catch-dtors.cpp
bcardosolopes Sep 18, 2024
e4eecd2
[CIR][FlattenCFG] Exceptions: enable many calls / many landing pads s…
bcardosolopes Sep 18, 2024
ae75127
[CIR][LowerToLLVM][NFC] Exceptions: use getOrCreateLLVMFuncOp to crea…
bcardosolopes Sep 18, 2024
74066a1
[CIR][Lowering] Erase op through rewriter instead of directly (#853)
smeenai Sep 18, 2024
e95f39b
[CIR] Exceptions: check LLVM output for more complex dtor order
bcardosolopes Sep 18, 2024
b981867
[CIR][ABI] Fix use after free from erasing while iterating (#854)
smeenai Sep 18, 2024
22bd691
Recommit [CIR][Pipeline] Support -fclangir-analysis-only (#832)
ChuanqiXu9 Sep 18, 2024
9980dbb
[CIR][Lowering] Fix lowering for multi dimensional array (#851)
bruteforceboy Sep 18, 2024
d88868e
[CIR][CodeGen] Support global temporaries
lanza Sep 18, 2024
92f3e1e
[CIR][CodeGen][NFC] Move GetUndefRValue to the right file
lanza Sep 18, 2024
789fb87
[CIR][CIRGen] Exceptions: lexical scope issue with global initializers
bcardosolopes Sep 18, 2024
9ec43b0
[CIR][CIRGen][Builtin][Neon] Lower __builtin_neon_vrndns_f32 (#858)
ghehg Sep 19, 2024
bdfa942
[CIR][CodeGen][NFC] Add TBAAAccessInfo stubbed out and many usages of…
lanza Sep 19, 2024
191ea78
[CIR][CodeGen] Stub out an empty CIRGenDebugInfo type
lanza Sep 19, 2024
3bf78fe
[CIR][CIRGen] Initialize more CGF member variables to nullptr (#863)
smeenai Sep 19, 2024
5c3e67b
[CIR][CIRGen] Implement Nullpointer arithmatic extension (#861)
ChuanqiXu9 Sep 19, 2024
48cab65
[CIR][Codegen] supports aarch64_be (#864)
gitoleg Sep 19, 2024
7cf7961
[CIR] Split cir-simplify into two passes (#868)
Lancern Sep 19, 2024
689a762
[CIR][CodeGen] Implement union cast (#867)
bruteforceboy Sep 19, 2024
b924002
[CIR][CIRGen] Exceptions: unlock nested try/catch support
bcardosolopes Sep 20, 2024
16991e3
[CIR][CodeGen] Fix array initialization in CIRGenExprAgg (#852)
bruteforceboy Sep 20, 2024
ab37943
[CIR][CIRGen] Correct isSized predicate for vector type (#869)
ghehg Sep 20, 2024
2e1febe
[CIR][CIRGen][Builtin][Neon] Lower builtin_neon_vrnda_v and builtin_n…
ghehg Sep 20, 2024
8412ead
[CIR][CIRGen] Handle VisitCXXRewrittenBinaryOperator for scalars
bcardosolopes Sep 20, 2024
5a290b6
[CIR][CIRGen][NFC] Cleanups: add skeleton for DominatingValue<RValue>…
bcardosolopes Sep 20, 2024
6ca5f24
[CIR][Infra] Run check-clang-cir against any branch based PR (#873)
lanza Sep 20, 2024
c99f210
[CIR][CIRGen][NFC] Cleanups: add more skeleton to pushFullExprCleanup
bcardosolopes Sep 21, 2024
73aebf4
[CIR][CodeGen][BugFix] don't place alloca before the label (#875)
gitoleg Sep 23, 2024
5334d5a
[CIR][CIRGen] Allow constant evaluation of int annotation (#874)
keryell Sep 23, 2024
831c229
[CIR][CIRGen] Cleanups: handle conditional cleanups
bcardosolopes Sep 21, 2024
ba03052
[CIR][CIRGen][NFC] Cleanups: Prepare for conditional cleanup
bcardosolopes Sep 23, 2024
2b97f7a
[CIR][CIRGen][NFC] Cleanups: more boilerplate work for conditional on…
bcardosolopes Sep 23, 2024
933f775
[CIR][CodeGen] Handling multiple stmt followed after a switch case (#…
ChuanqiXu9 Sep 24, 2024
8f96cfa
[CIR][CIRGen] Generate CIR for empty compound literal (#880)
ghehg Sep 24, 2024
669eaa9
[CIR][CIRGen] Generate CIR for vset_lane and vsetq_lane intrinsics (#…
ghehg Sep 24, 2024
348f18f
[CIR][CI] Remove libcxx tests
lanza Sep 25, 2024
5649a45
[CIR][Dialect][CodeGen] Add a unit attribute for OpenCL kernels (#877)
seven-mile Sep 25, 2024
d0fad9f
[CIR][CodeGen] Handle the case of 'case' after label statement after …
ChuanqiXu9 Sep 25, 2024
98586db
[CIR][CIRGen] Generate CIR for neon_vget and neon_vdup lane intrinsic…
ghehg Sep 25, 2024
64ae660
[CIR][CIRGen] Allow maybeSetTrivialComdat for GlobalOp (#885)
ghehg Sep 25, 2024
6fd7507
[CIR][CIRGen][Builtin][Neon] Lower neon vqadd_v (#890)
ghehg Sep 27, 2024
0a33748
[CIR][CIRGen][NFC] Split cir.scope creation on buildReturnStmt
bcardosolopes Sep 24, 2024
7e3d6e6
[CIR][NFC] Add helpers for cir.try and do some refactoring
bcardosolopes Sep 24, 2024
166af47
[CIR][CIRGen][Builtin] Allow CIRGen for builtin calls with math error…
ghehg Sep 27, 2024
ce7ccce
[CIR][CIRGen] Support __builtin_huge_val for float type (#889)
ghehg Sep 27, 2024
737e91b
[CIR][NFC] Rename test
bcardosolopes Sep 27, 2024
80814d6
[CIR][ABI] Apply CC lowering pass by default (#842)
sitio-couto Sep 28, 2024
d246854
[CIR][CIRGen][Builtin][Neon] Lower vqrshrun_n and add getAArch64SIMDI…
ghehg Sep 30, 2024
881c18a
[CIR][NFC] Silence unused warning
bcardosolopes Sep 28, 2024
41891e8
Revert "[CIR][ABI] Apply CC lowering pass by default (#842)"
bcardosolopes Sep 30, 2024
b59a2e7
[CIR][CIRGen] Add time trace to several CIRGen pieces (#898)
ChuanqiXu9 Sep 30, 2024
14970ad
[CIR][Dialect] Support OpenCL work group uniformity attribute (#896)
seven-mile Sep 30, 2024
ae40465
[CIR][CodeGen][NFC] Rename the confusing `buildGlobal` overload (#897)
seven-mile Sep 30, 2024
ce0aa5c
[CIR][CIRGen][Builtin][Neon] Lower neon vld1_lane and vld1q_lane (#901)
ghehg Sep 30, 2024
3e13daf
[CIR][CodeGen][NFC] Break the missing feature flag for OpenCL into sm…
seven-mile Oct 1, 2024
2322e2a
[CIR][CodeGen] Add `nothrow` for functions in OpenCL languages (#903)
seven-mile Oct 1, 2024
31cc156
[CIR][CodeGen] Set constant properly for global variables (#904)
seven-mile Oct 1, 2024
f9a83c8
[CIR][Test][NFC] Organize CIR CodeGen AArch64 neon tests (#910)
ghehg Oct 2, 2024
3966c67
[CIR][Lowering] Fix Global Attr Lowering (#906)
bruteforceboy Oct 2, 2024
088accd
[CIR][CIRGen][Builtin] Implement builtin __sync_fetch_and_sub (#932)
ghehg Oct 2, 2024
ef57d5f
[CIR][CIRGen] Cleanup: enable conditional cleanup with exceptions
bcardosolopes Sep 24, 2024
6885dd0
[CIR][CIRGen][Builtin][Neon] Lower BI__builtin_neon_vmovn_v (#909)
ghehg Oct 4, 2024
c9e5a9c
[CIR][CIRGen][Builtin][Neon] Lower neon vst1q_lane and vst1_lane (#935)
ghehg Oct 4, 2024
74d032f
[CIR] Derived-to-base conversions (#937)
dkolsen-pgi Oct 5, 2024
2ec2277
[CIR][NFC] Updates against -Wswitch after rebase
bcardosolopes Oct 5, 2024
366b4a3
[CIR][CIRGen] Exceptions: fix agg store for temporaries
bcardosolopes Oct 5, 2024
9cc1faf
[CIR][CIRGen] Lower cir.throw in absence of dtors
bcardosolopes Oct 7, 2024
eaacaf1
[CIR][NFC] Update wrong comments from previous commit
bcardosolopes Oct 7, 2024
cea946a
[CIR][CIRGen] Exceptions: support free'ing allocated exception resources
bcardosolopes Oct 7, 2024
4d2c56f
[Lowering][DirectToLLVM] Fix calling variadic functions (#945)
smeenai Oct 8, 2024
99a4590
[CIR] [CodeGen] Remove NYI in buildPointerWithAlignment (#949)
ChuanqiXu9 Oct 8, 2024
45fe4fd
[CIR][Lowering] Introduce HoistAllocasPass (#887)
ChuanqiXu9 Oct 9, 2024
f9ef59a
[CIR][CodeGen] Enable -fno-PIE (#940)
bruteforceboy Oct 9, 2024
04087b5
[CIR][CIRGen] Add support for __fp16 type (#950)
Lancern Oct 9, 2024
0bc6286
[CIR][CIRGen][Builtin] Support unsigned type for _sync_(bool/val)_com…
ghehg Oct 9, 2024
42f05b5
[CIR][CIRGen][NFC] Improve buildAutoVarAlloca skeleton and add hooks …
bcardosolopes Oct 9, 2024
19c9099
[CIR][CIRGen] Support annotations on local var decl
bcardosolopes Oct 9, 2024
8f61a4c
[CIR][LowerToLLVM][NFC] Move annotation lowering around
bcardosolopes Oct 9, 2024
7dd34cd
[CIR][NFC] Fix post-rebase warning
bcardosolopes Oct 9, 2024
d1b1222
[CIR][LowerToLLVM] Add support for local var annotations
bcardosolopes Oct 10, 2024
6d49e8b
Reapply and patch "[CIR][ABI] Apply CC lowering pass by default (#842…
sitio-couto Oct 11, 2024
a34d6e6
[CIR][CodeGen] kr-style for function arguments (#938)
gitoleg Oct 11, 2024
b2ad574
[CIR][CIRGen] Add const attribute to alloca operations (#892)
Lancern Oct 11, 2024
a6fd0d7
[CIR][Lowering] VecCreateOp and VecSplatOp lowering choose LLVM:Poiso…
ghehg Oct 11, 2024
6976c41
[CIR][NFC][Testing] Fix test failure (#963)
ghehg Oct 11, 2024
43f5b48
fixup! [CIR][LowerToLLVM] Fix crash in PtrStrideOp lowering
smeenai Oct 11, 2024
d8d2464
[CIR][CodeGen] Support static references to temporaries
lanza Sep 19, 2024
077ebe9
[CIR][CIRGen] Support CodeGen for vbase constructors
Laity000 May 21, 2024
c693c34
[CIR][CIRGen][Builtin][Neon] Lower neon_vtrn and neon_vtrnq (#942)
ghehg Oct 11, 2024
ffdbdc3
[CIR][CIRGen][Builtin][Neon] Lower neon_vext_v and neon_vextq_v (#951)
ghehg Oct 11, 2024
666dbcf
[CIR][Lowering] Handling Lowering of multiple dimension array correct…
ChuanqiXu9 Oct 14, 2024
90a9be6
[CIR][CIRGen][Builtin][Neon] Lower vld1_dup and vld1q_dup (#936)
ghehg Oct 14, 2024
244734d
[CIR][CIRGen][Builtin][Neon] Lower neon_vpadd_v and neon_vpaddq_v int…
ghehg Oct 14, 2024
4a8a588
[CIR] [Lowering] Fix handling of multiple array for ZeroAttr (#970)
ChuanqiXu9 Oct 14, 2024
a43cad3
[CIR][Driver] Fix -fclangir-call-conv-lowering behavior
bcardosolopes Oct 14, 2024
2b5947a
[CIR] Add more user facing messages for -fno-clangir-call-conv-lowering
bcardosolopes Oct 15, 2024
5f4a2ae
[CIR] Make the asserts to display suggestion for -fno-clangir-call-co…
bcardosolopes Oct 15, 2024
b4b6fbe
[CIR][NFC] Massively rename workarounds for callconv lowering
bcardosolopes Oct 15, 2024
3ef5e65
[CIR][CIRGen] Implement CIRGenModule::shouldEmitFunction (#984)
smeenai Oct 16, 2024
0c6d78b
[CIR][CIRGen] Port 1d0bd8e51be2627f79bede54735c38b917ea04ee (#983)
smeenai Oct 16, 2024
679b8ea
[CIR][LowerToLLVM] Lower cir.vtt.address_point
bcardosolopes Oct 16, 2024
7f1a689
[CIR][NFC] Rename function in a test
bcardosolopes Oct 16, 2024
4f3b99e
[CIR][CIRGen] Get more vtable and dtor working
bcardosolopes Oct 16, 2024
ffd2935
[CIR][CIRGen][NFC] Consolidate RUN lines for builtin tests (#968)
ghehg Oct 16, 2024
478deb6
[CIR] [Lowering] care trailing zero for lowering constant array (#976)
ChuanqiXu9 Oct 16, 2024
31fd4b7
[CIR] Add support for __int128 type (#980)
Lancern Oct 16, 2024
e865152
[CIR][CIRGen][Builtin][Neon] Lower neon_vrshrn_n to llvm intrinsic ca…
ghehg Oct 16, 2024
35ec8a6
[CIR][CIRGen][Builtin][Neon] Lower vqdmulhq_lane, vqdmulh_lane, vqrdm…
ghehg Oct 16, 2024
0d894e1
[CIR][CIRGen][Builtin][Type] Support for IEEE Quad (long double) adde…
mvvsmk Oct 16, 2024
f0c1120
[CIR][NFC] Fix some consistency issues with missing features
bcardosolopes Oct 16, 2024
ce33590
[CIR] Disable `-fclangir-call-conv-lowering` from default in the LLVM…
bcardosolopes Oct 16, 2024
ae4a7df
[CIR][CIRGen][Builtin] Implement builtin addressof (#987)
ghehg Oct 16, 2024
6e7779a
[CIR][NFC] Improve documentation about goto's
bcardosolopes Oct 16, 2024
da816c5
[CIR][NFC] Move code around to match OG
bcardosolopes Oct 16, 2024
2c3c8ef
[CIR][CIRGen][NFC] Add more skeleton for handling inheritance ctors
bcardosolopes Oct 18, 2024
e3ad862
[CIR][CIRGen] Ensure default visibility for local linkage functions (…
smeenai Oct 18, 2024
bb3b839
[CIR][CIRGen][Builtin][Neon] Lower neon_vshl_n_v and neon_vshlq_n_v (…
ghehg Oct 18, 2024
b24f6f6
[CIR][CIRGen] Use Clang Codegen's skeleton in CIRGenFunction::buildBu…
ghehg Oct 18, 2024
5b81555
[CIR][CIRGen][Builtin][Neon] Lower neon_vqaddq_v, neon_vqsubq and neo…
ghehg Oct 18, 2024
e198f7e
[CIR][CIRGen][Builtin][Neon] Lower neon_vmovl_v (#989)
ghehg Oct 18, 2024
92c7d8f
[CIR][CIRGen] Support initial cases of inheritance ctor/dtor
bcardosolopes Oct 18, 2024
cb0cb34
[CIR][CIRGen] Null init some inheritance components
bcardosolopes Oct 18, 2024
c1731b1
[CIR][CIRGen][NFC] More skeleton for building constants
bcardosolopes Oct 19, 2024
e744086
[CIR][CIRGen] Add missing testcase for null base class
bcardosolopes Oct 19, 2024
7f0c7f4
[CIR][ThroughMLIR] Support lowering SwitchOp without fallthrough to scf
Mochthon Oct 19, 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:
- '**'
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
3 changes: 0 additions & 3 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ on:
- 'runtimes/**'
- 'cmake/**'
- '.github/workflows/libcxx-build-and-test.yaml'
schedule:
# Run nightly at 08:00 UTC (aka 00:00 Pacific, aka 03:00 Eastern)
- cron: '0 8 * * *'

permissions:
contents: read # Default everything to read-only
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
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.
10 changes: 8 additions & 2 deletions clang-tools-extra/clang-tidy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/clang-tidy-config.h)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})

add_clang_library(clangTidy STATIC
add_clang_library(clangTidy
ClangTidy.cpp
ClangTidyCheck.cpp
ClangTidyModule.cpp
Expand All @@ -23,7 +23,7 @@ add_clang_library(clangTidy STATIC
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