Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
Upstream the RTTI builder with helpers and used them in the VTable
Definitions
Issue https://github.com/llvm/llvm-project/issues/154992
|
|
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>
|
|
(#161393)
|
|
Implement the ChooseExpr for aggregate expr
|
|
Upstream ParenExpr support for AggregateExpr
|
|
(#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
|
|
|
|
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.
|
|
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.
|
|
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>
|
|
Fixed intrinsic VPDP[SS,SU,UU]D[,S]_128/256/512's argument types to match with the ISA.
Fixes part of #97271.
|
|
(#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
|
|
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.
|
|
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.
|
|
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>
|
|
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`.
|
|
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
|
|
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.
|
|
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.
|
|
This patch enables calling virtual functions of virtual base classes of
a derived class.
|
|
type. (#161231)
Fixes #160497
Fixes #56652
Fixes #116319
Fixes #161196
|
|
Upstream UnaryExtension for Scalar Expr
|
|
Implement UO real on the result from imag with type promotion
Issue: https://github.com/llvm/llvm-project/issues/141365
|
|
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.
|
|
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.
|
|
(#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>
|
|
constexpr (#161218)
Fixes #161204.
|
|
Adding a new builtin type for AMDGPU's image descriptor rsrc data type
This requires for https://github.com/llvm/llvm-project/pull/140210
|
|
(#161163)
We failed to check that the trivial constructor where eligible (this
implies non deleted).
Fixes #160610
|
|
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.
|
|
When -nostdlib is specified, Clang should not report any
library‑provided module manifest, even if a manifest for the default
standard library is present.
|
|
bytecode test coverage (#161182)
Part of #155814
|
|
bytecode test coverage (#161174)
Part of #155814
|
|
bytecode test coverage (#161172)
Part of #155814
|
|
|
|
|
|
See https://github.com/llvm/llvm-project/issues/71364 for details.
|
|
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.
|
|
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>
|
|
|
|
(#161032)
`clang -fno-slp-vectorize -O2` incorrectly enabled CC1 -vectorize-slp.
Make -fvectorize and -fslp-vectorize properly override -O, following the
convention.
Fix #160633
|
|
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.
|
|
(#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.
|
|
This change implements logical not for VectorType
|
|
Implement UO real on the result from real with type promotion
Issue: https://github.com/llvm/llvm-project/issues/141365
|
|
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.
|
|
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++.
|
|
Fixing codegen crash when compiling real/imag unary operators on scalar
with type promotion
Ref: #160583
|