aboutsummaryrefslogtreecommitdiff
path: root/clang/test
AgeCommit message (Collapse)AuthorFilesLines
7 hours[CIR] Upstream support for generating global ctor regions (#161298)Andy Kaylor1-0/+17
This adds support for handling global variables with non-trivial constructors. The constructor call is emitted in CIR as a 'ctor' region associated with the global definition. This form of global definition cannot be lowered to LLVM IR yet. A later change will add support in LoweringPrepare to move the ctor code into a __cxx_global_var_init() function and add that function to the list of global global ctors, but for now we must stop at the initial CIR generation.
9 hoursFix `run_clang_repl` output when not present (#161412)Jeaye Wilkerson1-2/+2
On the happy path, when `clang-repl` is present, we will invoke it in order to determine if the host supports JIT features. That will return a string containing "true". However, in cases where `clang-repl` is not present or we fail to invoke it, we previously returned `False`, which would then trigger a failure with our substring check. This PR updates the function to return `""` instead, so the substring check is still valid. This is related to https://github.com/llvm/llvm-project/pull/157359, where the original change was introduced.
10 hours[CIR] Upstream RTTI Builder & RTTI for VTable Definitions (#160002)Amr Hesham1-415/+484
Upstream the RTTI builder with helpers and used them in the VTable Definitions Issue https://github.com/llvm/llvm-project/issues/154992
10 hours[clang] Cleanup docs and code for legacy no_sanitize attributes (NFC). (#161311)Alexey Samsonov1-1/+3
Update generated docs for legacy attributes: * no_sanitize_(address|thread|memory) * no_address_safety_analysis Those are older forms of no_sanitize("list", "of", "sanitizers") attribute. They were previously as various spellings of the same attribute, which made the auto-generated documentation confusing. Fix this by explicitly making them three different attributes. This would also allow to simplify the delegation to the new no_sanitize form slightly, as we can instead rely on auto-generated code to check that TSan and MSan can't be disabled for globals. **HTML docs before:** <img width="1004" height="1175" alt="rendered-docs-before" src="https://github.com/user-attachments/assets/407b5fc1-799c-4882-8ff8-44a5ef3cf4f1" /> **HTML docs after:** <img width="1098" height="1118" alt="rendered-docs-after" src="https://github.com/user-attachments/assets/236ca93f-25f8-4d58-95ac-ede95ce18d01" /> --------- Co-authored-by: Erich Keane <ekeane@nvidia.com>
10 hours[RISCV] Add missing CHECK lines for Zkt to sifive-p450/p470/p670 test. NFC ↵Craig Topper1-0/+3
(#161393)
11 hours[CIR] Implement ChooseExpr for AggregateExpr (#160999)Amr Hesham1-0/+25
Implement the ChooseExpr for aggregate expr
11 hours[CIR] Upstream ParenExpr for AggregateExpr (#160998)Amr Hesham1-0/+36
Upstream ParenExpr support for AggregateExpr
13 hours[analyzer][NFC] Explain why operator new/delete should never be eval-called ↵Balázs Benics1-0/+17
(#161370) Downstream, some change triggered an investigation if we could move a checker callback from check::PostCall to eval::Call. After a lengthy investigation that lead to ExprEngine::VisitCXXNewExpr we realized that CXXNewExprs only trigger a PreCall and PostCall, but never an EvalCall. It also had a FIXME that maybe it should trigger it. Remember, it called `defaultEvalCall` which either inlines or conservatively evaluates aka. invalidates the call. But never probes the checker eval-calls to see if any would step in. After implementing the changes to trigger the eval call for the checkers, I realized that it doesn't really make sense because we are eval-calling user-provided functions, that we can't be really sure about their semantics, thus there is no generic way to properly implement the eval call callback. This touches on an important point. It only ever makes sense to eval call functions that has a clear spec. such as standard functions, as implementing the callback would prevent the inlining of that function, risking regressing analysis quality if the implemented model is not complete/correct enough. As a conclusion, I opted for not exposing the eval call event to checkers, in other words, keep everything as-is, but document my journey. CPP-6585
15 hours[RISCV][NFC] Update ratified extensions list in riscv-target-features.cLiao Chunyu1-13/+13
15 hours[Clang][PowerPC] Add __dmr2048 type and DMF crypto builtins (#157152)Maryam Moghadas6-15/+343
Define the __dmr2048 type to represent the DMR pair introduced by the Dense Math Facility on PowerPC, and add three Clang builtins corresponding to DMF cryptography: __builtin_mma_dmsha2hash __builtin_mma_dmsha3hash __builtin_mma_dmxxshapad The __dmr2048 type is required for the dmsha3hash crypto builtin, and, as withother PPC MMA and DMR types, its use is strongly restricted.
15 hours[OpenACC][CIR] Generate private recipe pointer/array 'alloca's (#160911)Erich Keane13-2/+712
As a next step to generating pointer/array recipes, this patch generates just the 'alloca' lines that are necessary. Copying pointers over to restore the structure is held off to the next patch. In the case of a pointer, we need to allocate the level 'below' it (if we index into it), then copy the values into the pointers. In the case of an array, we skip the alloca (since the array's alloca contains the value). After this, we'll need a patch that copies the pointers into place, and finally one that does the initialization of these values.
17 hours[clang-repl] Teach clang-repl how to load PCHs (reprise) (#157359)Jeaye Wilkerson2-3/+33
This is an updated version of @vgvassilev's PR from last year here: https://github.com/llvm/llvm-project/pull/94166 In short, it includes: 1. The fix for a blocking issue where `clang::Interpreter` (and thus `clang-repl`) cannot resolve symbols defined in a PCH 2. A test to prove this is working 3. A new hidden flag for `clang-repl` so that `llvm-lit` can match the host JIT triple between the PCH and `clang-repl`; previously, they may differ in some cases 4. Everything based on the latest LLVM main Shout out to @kylc for finding a logic issue which had us stumped for a while (and securing the [bounty](https://github.com/jank-lang/jank/issues/446)). --------- Co-authored-by: Vassil Vassilev <v.g.vassilev@gmail.com> Co-authored-by: Kyle Cesare <kcesare@gmail.com>
18 hours[x86][AVX-VNNI] Fix VPDPBXXD Argument Type (#159222)BaiXilin1-12/+12
Fixed intrinsic VPDP[SS,SU,UU]D[,S]_128/256/512's argument types to match with the ISA. Fixes part of #97271.
20 hours[Modules] Make -module-file-info print macro names in deterministic order ↵Hans Wennborg1-10/+10
(#161332) Developers reported non-deterministic output from `-module-file-info`, thinking this reflected non-determinism in the .pcm files themselves. However, it turned out it was the printing that was non-deterministic: ``` $ cat /tmp/a.h #define FOO 1 #define BAR 2 $ build/bin/clang -cc1 -std=c++20 -x c++ -emit-header-unit /tmp/a.h -o /tmp/a.pcm $ build/bin/clang -cc1 -module-file-info /tmp/a.pcm | grep -A2 Definitions Macro Definitions: FOO BAR $ build/bin/clang -cc1 -module-file-info /tmp/a.pcm | grep -A2 Definitions Macro Definitions: BAR FOO ``` Making the output deterministic also simplifies the test. This is a follow-up to 360c5fe54c0758c73bf85453fd2913f371adc7d5
21 hours[clang][libc++] Fix spelling of "synthesize" (#158523)halbi21-71/+71
There is a tradition to use U.S. English spellings for APIs. For example, it's uninitialized_fill and not uninitialised_fill, specialization not specialisation, etcetera.
23 hours[clang][Diags] Automatically format AP(S)Int values with separators (#161047)Timm Baeder1-1/+1
This adds an `operator<<` overload for `StreamingDiagnostic` that takes an `APInt`/`APSInt` and formats it with default options, including adding separators. This is still an opt-in mechanism since all callers that want to use this feature need to be changed from ```c++ Diag() << toString(MyInt, 10); ``` to ```c++ Diag() << MyInt; ``` This patch contains one example of a diagnostic making use of this.
25 hours[CUDA] Enable variadic argument support in front-end (#161305)Luo, Yuanke1-1/+1
Variadice argument for NVPTX as been support in https://github.com/llvm/llvm-project/commit/486d00eca6b6ab470e8324b52cdf9f32023c1c9a We can enable it in front-end. Co-authored-by: Yuanke Luo <ykluo@birentech.com>
26 hours[analyzer] Use sed from the ToolBox on AIX (NFC) (#161242)Kelvin Li2-2/+4
The change in commit 30402c7 breaks the tests on AIX. This patch is to change to use the `sed` from AIX Toolbox instead of the default one which does not support `-r` and `-E`.
29 hours[Clang] Avoid null deref in lambda attribute compat warning (#161096)Oleksandr T.1-6/+26
Fixes #161070 --- This PR addresses the issue in `ext_decl_attrs_on_lambda` by using `%0`=_attribute name_ and `%1`=_selector_, which prevents a null `IdentifierInfo*`. https://github.com/llvm/llvm-project/blob/48a6f2f85c8269d8326c185016801a4eb8d5dfd6/clang/lib/Parse/ParseExprCXX.cpp#L1299-L1302 https://github.com/llvm/llvm-project/blob/48a6f2f85c8269d8326c185016801a4eb8d5dfd6/clang/include/clang/Basic/DiagnosticParseKinds.td#L1143-L1145 https://github.com/llvm/llvm-project/blob/48a6f2f85c8269d8326c185016801a4eb8d5dfd6/clang/include/clang/Basic/DiagnosticParseKinds.td#L1149-L1152
29 hours[CIR] Add GlobalOp ctor and dtor regions (#160779)Andy Kaylor1-0/+48
This adds support for ctor and dtor regions in cir::GlobalOp. These regions are used to capture the code that initializes and cleans up the variable, keeping this initialization and cleanup code with the variable definition. This change only adds the CIR dialect support for these regions. Support for generating the code in these regions from source and lowering these to LLVM IR will be added in a later change, as will LoweringPrepare support to move the code into the __cxx_global_var_init() function.
30 hours[AMDGPU][SPIRV] Use SPIR-V syncscopes for some AMDGCN BIs (#154867)Alex Voicu5-25/+553
AMDGCN flavoured SPIR-V allows AMDGCN specific builtins, including those for scoped fences and some specific RMWs. However, at present we don't map syncscopes to their SPIR-V equivalents, but rather use the AMDGCN ones. This ends up pessimising the resulting code as system scope is used instead of device (agent) or subgroup (wavefront), so we correct the behaviour, to ensure that we do the right thing during reverse translation.
32 hours[CIR] Add virtual base support to getAddressOfBaseClass (#159162)Morris Hafner1-1/+81
This patch enables calling virtual functions of virtual base classes of a derived class.
32 hours[Clang] Instantiate variables referenced in `decltype` with an undeduced ↵Corentin Jabot2-0/+119
type. (#161231) Fixes #160497 Fixes #56652 Fixes #116319 Fixes #161196
33 hours[CIR] Upstream UnaryExtension for Scalar Expr (#160997)Amr Hesham2-0/+40
Upstream UnaryExtension for Scalar Expr
33 hours[CIR] Implement UO real on result from imag with type promotion (#160996)Amr Hesham1-0/+37
Implement UO real on the result from imag with type promotion Issue: https://github.com/llvm/llvm-project/issues/141365
34 hours[CIR] Add initial support for operator delete (#160574)Andy Kaylor1-0/+88
This adds basic operator delete handling in CIR. This does not yet handle destroying delete or array delete, which will be added later. It also does not insert non-null checks when not optimizing for size.
35 hours[CIR] Set the module name to the input filename (#160934)Andy Kaylor3-8/+19
This sets the MLIR module name to the main filename (according to the SourceManager), if one is available. The module name gets used when creating global init functions, so we will need it to be set.
35 hours[clang][OpenMP] Support for reduction clause with array elements as modifier ↵SunilKuravinakop1-1/+31
(#160846) Changes to support for array elements in reduction clause e.g. "reduction (+:a[1])" --------- Co-authored-by: Sunil Kuravinakop <kuravina@pe31.hpc.amslabs.hpecorp.net>
35 hours[Headers][X86] Allow AVX1 fixed extraction intrinsics to be used in ↵Chaitanya Koparkar1-0/+3
constexpr (#161218) Fixes #161204.
37 hours[AMDGPU] Add a new builtin type for image descriptor rsrc (#160258)Rana Pratap Reddy5-0/+66
Adding a new builtin type for AMDGPU's image descriptor rsrc data type This requires for https://github.com/llvm/llvm-project/pull/140210
38 hours[Clang] Fixes __builtin_is_implicit_lifetime for types with deleted ctrs ↵Corentin Jabot1-0/+43
(#161163) We failed to check that the trivial constructor where eligible (this implies non deleted). Fixes #160610
38 hours[analyzer] CStringChecker: Fix crash in `CheckOverlap` when arguments are ↵guillem-bartrina-sonarsource2-0/+30
not pointers (#160511) https://github.com/llvm/llvm-project/blob/main/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp#L675-L678 mistakenly assumes that target expressions are of pointer type. `CheckOverlap` has multiple call sites, most of which do not verify this assumption. Therefore, the simplest solution is to verify it just before that point.
39 hours[clang][modules] Ensure -nostdlib causes no manifest to be reported (#161110)Naveen Seth Hanig1-0/+8
When -nostdlib is specified, Clang should not report any library‑provided module manifest, even if a manifest for the default standard library is present.
40 hours[clang][X86] bmi-builtins.c - add -fexperimental-new-constant-interpreter ↵Simon Pilgrim1-0/+7
bytecode test coverage (#161182) Part of #155814
40 hours[clang][X86] tbm-builtins.c - add -fexperimental-new-constant-interpreter ↵Simon Pilgrim1-0/+5
bytecode test coverage (#161174) Part of #155814
40 hours[clang][X86] bmi2-builtins.c - add -fexperimental-new-constant-interpreter ↵Simon Pilgrim1-0/+5
bytecode test coverage (#161172) Part of #155814
40 hours[clang][x86] bmi-builtins.c - add i386 test coverage (#161171)Simon Pilgrim1-45/+47
41 hours[clang][x86] tbm-builtins.c - add i386 test coverage (#161169)Simon Pilgrim1-38/+40
45 hours[C++20] [Modules] Set the feature testing macro to 1 (#161034)Chuanqi Xu1-1/+1
See https://github.com/llvm/llvm-project/issues/71364 for details.
45 hours[clang] fix code synthesis context depth limit logic (#161103)Matheus Izvekov3-3/+4
This makes the instantation depth limit be checked whenever the code synthesis context is pushed, not only when creating a InstantiatingTemplate RAII object. Also fix the note suggesting the user increases `-ftemplate-depth` so it is printed even in a SFINAE context.
46 hours[Clang][OpenMP][LoopTransformations] Implement "#pragma omp fuse" loop ↵Walter J.T.V3-0/+2934
transformation directive and "looprange" clause (#139293) This change implements the fuse directive, `#pragma omp fuse`, as specified in the OpenMP 6.0, along with the `looprange` clause in clang. This change also adds minimal stubs so flang keeps compiling (a full implementation in flang of this directive is still pending). --------- Co-authored-by: Roger Ferrer Ibanez <roger.ferrer@bsc.es>
3 days[clang][bytecode] Diagnose volatile writes (#160350)Timm Baeder2-5/+58
3 days[Driver] Make -fvectorize and -fslp-vectorize override -O group options ↵Fangrui Song2-3/+3
(#161032) `clang -fno-slp-vectorize -O2` incorrectly enabled CC1 -vectorize-slp. Make -fvectorize and -fslp-vectorize properly override -O, following the convention. Fix #160633
3 days[clang] fix transformation of subst constant template parameter nodes (#161029)Matheus Izvekov3-1/+19
This simplifies those transforms a lot, removing a bunch of workarounds which were introducing problems. The transforms become independent of the template instantiator, so they are moved to TreeTransform instead. Fixes #131342 This PR was already reviewed and approved at https://github.com/llvm/llvm-project/pull/160777, but I accidentally merged that into another PR, instead of main.
3 days[clang] simplify placeholder type deduction for constant template parameters ↵Matheus Izvekov1-5/+5
(#160439) This makes the deduction for dependent types operate in more similar ways to the non-dependent one, such as when matching template template parameters, making errors in those generate similar diagnostics to the non-dependent ones. This also removes some superfluous implicit casts, simplifying the resulting AST a little bit.
4 days[CIR] Implement logical not for VectorType (#160762)Amr Hesham2-2/+80
This change implements logical not for VectorType
4 days[CIR] Implement UO real on result from real with type promotion (#160951)Amr Hesham1-0/+37
Implement UO real on the result from real with type promotion Issue: https://github.com/llvm/llvm-project/issues/141365
4 days[OpenMP][clang] Set num_threads 'strict' to unsupported on GPUs (#160659)Robert Imschweiler7-9603/+4608
Setting the prescriptiveness of the num_threads clause to 'strict' and having a corresponding check (with message and severity clauses) does not align well with how OpenMP should be handled for GPUs. The num_threads expression may be an arbitrary integer expression which is evaluated on the target, in correspondance to the OpenMP spec. This prevents the check from being done before launching the kernel, especially considering that the num_threads clause is associated with the parallel directive and that there may be multiple parallel directives with different num_threads clauses in a single target region. Acting on the result of the 'strict' check on the GPU would require doing I/O on the GPU, which can introduce performance regressions. Delaying any actions resulting from the 'strict' check and doing them on the host after executing the target region involves additional data copies and is not really semantically correct. For now, the 'strict' modifier for the num_threads clause and its associated message and severity clause are set to be unsupported on GPUs. Targets other than GPUs still support the aforementioned features in the context of an OpenMP target region.
4 days[SYCL] Add offload wrapping for SYCL kind (#147508)Maksim Sabianin2-1/+35
This patch adds an Offload Wrapper for the SYCL kind. This is an essential step for SYCL offloading and the compilation flow. The usage of offload wrapping is added to the clang-linker-wrapper tool. Modifications: Implemented `bundleSYCL()` function to handle SYCL image bundling. Implemented `wrapSYCLBinaries()` function that is invoked from clang-linker-wrapper. SYCL Offload Wrapping uses specific data structures such as `__sycl.tgt_device_image` and `__sycl.tgt_bin_desc`. Each SYCL image maintains its own symbol table (unlike shared global tables in other targets). Therefore, symbols are encoded explicitly during the offload wrapping. Also, images refer to their own Offloading Entries arrays unlike other targets. The proposed `__sycl.tgt_device_image` uses Version 3 to differentiate from images generated by Intel DPC++. The structure proposed in this patch doesn't have fields deprecated in DPC++.
4 days[Clang] Fix Codegen UO real/imag crash on scalar with type promotion (#160609)Amr Hesham1-1/+481
Fixing codegen crash when compiling real/imag unary operators on scalar with type promotion Ref: #160583