| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 365691
|
|
|
|
|
|
|
|
|
|
| |
The device should use the same float point representation as the host.
Previous patch fixed the handling of the sizes of the float point types,
but did not fixed the fp semantics. This patch makes target device to
use the host fp semantics. this is required for the correct data
transfer between host and device and correct codegen.
llvm-svn: 365485
|
|
|
|
|
|
|
| |
Provide more data to the user in the error message about unsupported
type for device compilation.
llvm-svn: 365374
|
|
|
|
|
|
| |
NFC.
llvm-svn: 365334
|
|
|
|
|
|
|
|
| |
Previously, lambda captures were processed in the function called during
capturing the variables. It leads to the recursive functions calls and
may result in the compiler crash.
llvm-svn: 364820
|
|
|
|
|
|
|
|
|
| |
If the variable is used in the OpenMP region implicitly, we need to
check the data-sharing attributes for such variables and generate
implicit clauses for them. Patch improves analysis of such variables for
better handling of data-sharing rules.
llvm-svn: 364683
|
|
|
|
|
|
|
|
|
| |
Fixed handling of the data-sharing attributes for static members when
requesting top most attribute. Previously, it might return the incorrect
attributes for static members if they were overriden in the outer
constructs.
llvm-svn: 364655
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the OpenMP 5.0 standard, the loop iteration variable in the associated
for-loop of a simd construct with just one associated for-loop may be
listed in a private, lastprivate, or linear clause with a linear-step
that is the increment of the associated for-loop. Also, the loop
teration variables in the associated for-loops of a simd construct with
multiple associated for-loops may be listed in a private or lastprivate
clause.
llvm-svn: 364650
|
|
|
|
|
|
|
|
| |
The errors for incorrectly specified data-sharing attributes for simd
constructs must be emitted only for the explicitly provided clauses, not
the predetermined ones.
llvm-svn: 364647
|
|
|
|
|
|
|
| |
Implicit flag must not be emitted for explicitly specified firstprivate
variables, but for implicitly captured sizes of the VLAs.
llvm-svn: 364575
|
|
|
|
|
|
|
| |
Target-based runtime functions use int64_t type for sizes, while the
compiler uses size_t type. It leads to miscompilation in 32 bit mode.
llvm-svn: 364327
|
|
|
|
| |
llvm-svn: 364189
|
|
|
|
|
|
|
|
| |
If the variably modified type is declared outside of the captured region
and then used in the cast expression along with array subscript
expression, the type is not captured and it leads to the compiler crash.
llvm-svn: 364080
|
|
|
|
|
|
|
| |
The threadprivate variables should not be captured in the outlined
regions, otherwise it leads to the compiler crash.
llvm-svn: 364061
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
memory is required
Summary:
This patch adds support for the handling of the variables under the declare target to clause.
The variables in this case are handled like link variables are. A pointer is created on the host and then mapped to the device. The runtime will then copy the address of the host variable in the device pointer.
Reviewers: ABataev, AlexEichenberger, caomhin
Reviewed By: ABataev
Subscribers: guansong, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63108
llvm-svn: 363959
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clauses NFC
Summary:
This patch strengthens the tests introduced in D63009 by:
- adding new test for default device ID.
- modifying existing tests to pass device ID local variable to the task allocation function.
Reviewers: ABataev, Hahnfeld, caomhin, jdoerfert
Reviewed By: ABataev
Subscribers: guansong, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63454
llvm-svn: 363809
|
|
|
|
|
|
| |
Device have to use the same mangling as the host for 128bit float types. Otherwise, the codegen for the device is unable to find the parent function when it tries to generate the outlined function for the target region and it leads to incorrect compilation and crash at the runtime.
llvm-svn: 363734
|
|
|
|
|
|
| |
If the host uses 128 bit long doubles, the compiler should generate correct code for NVPTX devices. If the return type has 128 bit long doubles, in LLVM IR this type must be coerced to int array instead.
llvm-svn: 363720
|
|
|
|
|
|
|
|
|
| |
The device code must use the same long double type as the host.
Otherwise the code cannot be linked and executed properly. Patch adds
only basic support and checks for supporting of the host long double
double on the device.
llvm-svn: 363717
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add a new call to Clang to perform task allocation for the target.
Reviewers: ABataev, AlexEichenberger, caomhin
Reviewed By: ABataev, AlexEichenberger
Subscribers: openmp-commits, Hahnfeld, guansong, jdoerfert, cfe-commits
Tags: #clang, #openmp
Differential Revision: https://reviews.llvm.org/D63009
llvm-svn: 363451
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is used
Summary: This patch avoids the emission of maps for target link variables when unified memory is present.
Reviewers: ABataev, caomhin
Reviewed By: ABataev
Subscribers: guansong, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60883
llvm-svn: 363435
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM IR recently added a Type parameter to the byval Attribute, so that
when pointers become opaque and no longer have an element type the
information will still be present in IR.
For now the Type parameter is optional (which is why Clang didn't need
this change at the time), but it will become mandatory soon.
llvm-svn: 362652
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the captured region scope.
This removes a case where we would build expressions (and mark
declarations odr-used) in the wrong scope.
Remove the now-unused 'capture initializer' field on sema::Capture
(except for 'this' captures, which still need to be cleaned up).
No functionality change intended (except that we now very slightly more
precisely determine whether we need to use a capture or not when another
captured region encloses an OpenMP captured region).
llvm-svn: 362179
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adjusts `PragmaOpenMPHandler` to set the location of
`tok::annot_pragma_openmp` to the `#pragma` location instead of the
`omp` location so that the former becomes the start location of the
OpenMP AST node. This can be useful when, for example, rewriting a
directive using Clang's Rewrite facility. Most of this patch updates
tests for changes to locations in diagnostics and `-ast-dump` output.
Reviewed By: ABataev, lebedev.ri, Meinersbur, aaron.ballman
Differential Revision: https://reviews.llvm.org/D61509
llvm-svn: 361867
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
target link
Summary:
This patch adds a test for requires with unified share memory clause when a declare target link is present.
This test needs to go in prior to changes to declare target link for comparison purposes.
Reviewers: ABataev, caomhin
Reviewed By: ABataev
Subscribers: guansong, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62407
llvm-svn: 361658
|
|
|
|
|
|
|
|
|
| |
If the variable is a firstprivate variable and it was not emitted beause
this a constant variable with the constant initializer, we can use the
initial value instead of the variable itself. It also fixes the problem
with the compiler crash in this case.
llvm-svn: 361564
|
|
|
|
|
|
|
| |
Simplified codegen for the outlined regions, excluding duplication code
for handling variables with the reference types.
llvm-svn: 361529
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch adds support for the registration of the requires directives with the runtime.
Each requires directive clause will enable a particular flag to be set.
The set of flags is passed to the runtime to be checked for compatibility with other such flags coming from other object files.
The registration function is called whenever OpenMP is present even if a requires directive is not present. This helps detect cases in which requires directives are used inconsistently.
Reviewers: ABataev, AlexEichenberger, caomhin
Reviewed By: ABataev, AlexEichenberger
Subscribers: jholewinski, guansong, jfb, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60568
llvm-svn: 361298
|
|
|
|
|
|
|
|
|
| |
Currently, we ignore all dso locality attributes/info when building for
the device and thus all symblos are externally visible and can be
preemted at the runtime. It may lead to incorrect results. We need to
follow the same logic, compiler uses for static/pie builds.
llvm-svn: 361283
|
|
|
|
|
|
|
|
|
|
|
| |
performance.
Internally generated functions must be marked as always_inlines in most
cases. Patch marks some extra reduction function + outlined parallel
functions as always_inline for better performance, but only if the
optimization is requested.
llvm-svn: 361269
|
|
|
|
|
|
|
|
|
| |
If the combined directive has default(none) clause and has clauses for
inner directive that reference some variables, for which data-sharing
attributes are not specified, the error messages should be emitted for
such variables.
llvm-svn: 360365
|
|
|
|
|
|
|
|
| |
If the default(none) was specified for the construct, we might miss
diagnostic for the globals without explicitly specified data-sharing
attributes. Patch fixes this problem.
llvm-svn: 360362
|
|
|
|
|
|
|
|
|
|
|
|
| |
clauses."
This has introduced (exposed?) a crash in clang sema,
that does not happen without this patch.
I'll followup in the original bugreport and commit with reproducer.
This reverts commit r360061.
llvm-svn: 360327
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
default(none)."
This implementation isn't sound as per the standard.
It erroneously diagnoses e.g. the following case:
```
$ cat test.cpp
void f(int n) {
#pragma omp parallel default(none) if(n)
;
}
```
```
$ ./bin/clang -fopenmp test.cpp
test.cpp:2:40: error: variable 'n' must have explicitly specified data sharing attributes
#pragma omp parallel default(none) if(n)
^
test.cpp:2:31: note: explicit data sharing attribute requested here
#pragma omp parallel default(none) if(n)
^
1 error generated.
```
As per OpenMP Application Programming Interface Version 5.0 November 2018:
* 2.19.4.1default Clause
The default clause explicitly determines the data-sharing attributes of
variables that are referenced *in a parallel, teams, or task generating
construct and would otherwise be implicitly determined
(see Section 2.19.1.1 on page 270).
* 2.6.1 Determining the Number of Threads for a parallel Region
Using a variable in an if or num_threads clause expression of a parallel
construct causes an implicit reference to the variable in all enclosing
constructs. The if clause expression and the num_threads clause expression
are evaluated in the context outside of the parallel construct,
This reverts commit r360073.
llvm-svn: 360326
|
|
|
|
|
|
|
|
|
|
|
| |
default(none).
If the combined directive has default(none) clause and has clauses for
inner directive that reference some variables, for which data-sharing
attributes are not specified, the error messages should be emitted for
such variables.
llvm-svn: 360073
|
|
|
|
|
|
|
|
| |
If the `default(none)` was specified for the construct, we might miss
diagnostic for the globals without explicitly specified data-sharing
attributes. Patch fixes this problem.
llvm-svn: 360061
|
|
|
|
|
|
|
| |
Fixed the crash on the template instantiation when trying to check the
data locality in the current instantiation scope.
llvm-svn: 359459
|
|
|
|
|
|
|
|
|
|
|
| |
counters.
According to the OpenMP 5.0, For any associated loop where the b or lb
expression is not loop invariant with respect to the outermost loop, the
var-outer that appears in the expression may not have a random access
iterator type.
llvm-svn: 359340
|
|
|
|
|
|
|
|
|
| |
loop nests.
Added a checks that the initializer/condition expressions depend only
only of the single previous loop iteration variable.
llvm-svn: 359200
|
|
|
|
|
|
|
| |
Renamed function a01 in the test to fix possible problems with the git
hash match during testing.
llvm-svn: 359193
|
|
|
|
|
|
|
| |
Added basic semantic analysis for the non-rectangular loop nests for
OpenMP 5.0 support.
llvm-svn: 359132
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without this patch, APSInt inherits APInt::isNegative, which merely
checks the sign bit without regard to whether the type is actually
signed. isNonNegative and isStrictlyPositive call isNegative and so
are also affected.
This patch adjusts APSInt to override isNegative, isNonNegative, and
isStrictlyPositive with implementations that consider whether the type
is signed.
A large set of Clang OpenMP tests are affected. Without this patch,
these tests assume that `true` is not a valid argument for clauses
like `collapse`. Indeed, `true` fails APInt::isStrictlyPositive but
not APSInt::isStrictlyPositive. This patch adjusts those tests to
assume `true` should be accepted.
This patch also adds tests revealing various other similar fixes due
to APSInt::isNegative calls in Clang's ExprConstant.cpp and
SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object
size based on `alloc_size`, `<<` and `>>` shift count validation, and
OpenMP array section validation.
Reviewed By: lebedev.ri, ABataev, hfinkel
Differential Revision: https://reviews.llvm.org/D59712
llvm-svn: 359012
|
|
|
|
|
|
|
|
|
| |
runtime.
target [teams distribute] simd costructs do not require full runtime for
the correct execution, we can run them without full runtime.
llvm-svn: 358766
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Fix requires target test.
Reviewers: ABataev
Subscribers: guansong, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60886
llvm-svn: 358711
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: The requires directive containing target related clauses must appear before any target region in the compilation unit.
Reviewers: ABataev, AlexEichenberger, caomhin
Reviewed By: ABataev
Subscribers: guansong, jfb, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60875
llvm-svn: 358709
|
|
|
|
|
|
|
|
| |
All target-parallel-based constructs can be run in SPMD mode from now
on. Even if num_threads clauses or if clauses are used, such constructs
can be executed in SPMD mode.
llvm-svn: 358595
|
|
|
|
|
|
|
|
|
| |
Combined constructs with parallel and if clauses without modifiers may
be executed in SPMD mode since if the condition is true for the target
region, it is also true for parallel region and the threads must be run
in parallel.
llvm-svn: 358503
|
|
|
|
| |
llvm-svn: 358493
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The name mangling scheme is defined in section 3.5 of the "Vector function application binary interface specification for AArch64" [1].
[1] https://developer.arm.com/products/software-development-tools/hpc/arm-compiler-for-hpc/vector-function-abi
Reviewers: rengolin, ABataev
Reviewed By: ABataev
Subscribers: sdesmalen, javed.absar, kristof.beyls, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60583
llvm-svn: 358490
|
|
|
|
|
|
|
|
|
|
| |
mode.
After the previous patch with the more correct handling of the number of
threads in parallel regions, the parallel regions with num_threads
clauses can be executed in SPMD mode.
llvm-svn: 358445
|