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

__unique_stable_name implementation. #16

Closed
wants to merge 2,856 commits into from

Conversation

erichkeane
Copy link
Collaborator

Rebased and cleaned up to the point I'm OK having this in use. I've added a test to validate the common problem situations.

Meinersbur and others added 30 commits May 24, 2019 15:44
isl_map_from_union_map cannot determine the map's space if the union_map
is empty. polly::singleton was designed for this case. We pass the
expected map space to avoid crashing in isl_map_from_union_map.

This fixes an issue found by the aosp buildbot. Thanks to Eli Friedman
for the reproducer.

llvm-svn: 361290
Register coalescer fails for the test in the patch with the assertion in
JoinVals::ConflictResolution `DefMI != nullptr'. It attempts to join
live intervals for two adjacent instructions and erase the copy:

    %2:vreg_256 = COPY %1
    %3:vreg_256 = COPY killed %1

The LI needs to be adjusted to kill subrange for the erased instruction
and extend the subrange of the original def. That was done for the main
interval only but not for the subrange. As a result subrange had a VNI
pointing to the erased slot resulting in the above failure.

Differential Revision: https://reviews.llvm.org/D62162

llvm-svn: 361293
Summary:
Target link variables are currently implemented by creating a copy of the variables on the device side and unified memory never gets exploited.

When the prgram uses the:

```
#pragma omp requires unified_shared_memory
```

directive in conjunction with a declare target link, the linked variable is no longer allocated on the device and the host version is used instead.

This behavior is overridden by performing an explicit mapping.

A Clang side patch is required.

Reviewers: ABataev, AlexEichenberger, grokos, Hahnfeld

Reviewed By: AlexEichenberger, grokos, Hahnfeld

Subscribers: Hahnfeld, jfb, guansong, jdoerfert, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D60223

llvm-svn: 361294
…time

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
…follow the same order as CSR saves in the prologue

llvm-svn: 361299
This permits an init-capture to introduce a new pack:

  template<typename ...T> auto x = [...a = T()] { /* a is a pack */ };

To support this, the mechanism for allowing ParmVarDecls to be packs has
been extended to support arbitrary local VarDecls.

llvm-svn: 361300
CLANG_DEFAULT_STDLIB is defined to libstdc++.

llvm-svn: 361301
…ugh add/sub

Looks we can transform all 8 variants of the pattern:
https://rise4fun.com/Alive/auH

This comes up as an issue on the path towards
https://bugs.llvm.org/show_bug.cgi?id=41952

llvm-svn: 361303
For consistency with nearby code and to avoid interceptors during reports.

llvm-svn: 361304
Enable CMake policy 77. This alters the behavior of option. The old behavior
would remove the value of the option from the cache and create a new one. The
new behavior does not create the variable if it is defined already. This ensures
that subsequent reconfigures will behave identically. This seems better than the
setting of OLD - the desire is to ensure that it is set to OLD or NEW.

llvm-svn: 361307
This change adds implementation to ompt_finalize_tool() and
ompt_get_task_memory().

Patch by Hansang Bae

Differential Revision: https://reviews.llvm.org/D61657

llvm-svn: 361309
Two tests having the same name creates a race condition when moving the
trace files.

llvm-svn: 361310
Also, disallow specifying -no-pie/-nopie along with -static-pie.

Differential Revision: https://reviews.llvm.org/D59841

llvm-svn: 361312
Double the number of files to merge, and use wait instead of sleep.

llvm-svn: 361313
Summary:
Values returned by GCCInstallation.getParentLibPath() and
GCCInstallation.getTriple() are not valid unless
GCCInstallation.isValid() returns true. This has previously been
ignored, and the former two values were used without checking whether
GCCInstallation is valid. This led to the bad path "/../bin" being added
to the list of program paths.

author: danielmentz "Daniel Mentz <[email protected]>"

Reviewers: #clang, tstellar, srhines

Reviewed By: srhines

Subscribers: danielmentz, ormris, nickdesaulniers, srhines, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D57930

llvm-svn: 361314
In these cases we would prefer a direct comparison over going through
a vector type.

llvm-svn: 361315
The SkipAppInitFiles setter was ignoring its import argument.

llvm-svn: 361316
As discussed in D62024, we want to limit any potential IR
transforms of shuffles to cases where we know the SDAG
conversion would result in equivalent patterns for these
IR variants.

llvm-svn: 361317
againull and others added 20 commits June 18, 2019 11:06
  * Warnings were fixed.
  * Bug in assertion was fixed.

Signed-off-by: Artur Gainullin <[email protected]>
There was strict-aliasing rules violation. It could produce undefined
behaviour.

Signed-off-by: Mariya Podchishchaeva <[email protected]>
Signed-off-by: Jeff Hammond <[email protected]>
Also added check that passed SYCL context represents the same underlying
OpenCL context associated with the OpenCL kernel object.

Signed-off-by: Mariya Podchishchaeva <[email protected]>
Generate a wrapped device binary that can be used independently with a host
link step.  Takes the provided fat objects or source, extracts or creates the
associated device binaries and wraps them to be used during a regular host
link step

Signed-off-by: Michael D Toguchi <[email protected]>
Use 0-dim accessors for scalar reductions .
For buffers, reduction variables inherit dimensionality from accessors.
For USM, reduction variables are assumed scalar without use of span.

Signed-off-by: John Pennycook <[email protected]>
Even when compiling for the device, code meant only for host execution
must be semantically analyzable. Existing wrapper headers were initially
created to resolve this problem. But now -aux-triple is used to pass
target triple of opposite side of compilation. Clang knows target triple
for both sides of compilation so that preprocessor macros and target
builtins from both sides are available. That is why there is no need in
existing wrapper headers with stub definitions since they break
compilation for cases when standard headers are included.

Approach with -aux-triple is not complete solution. Host headers might
provide definitions relying on host inline asm, intrinsics, using types
not lowerable in device code. So we will need to provide a solution to
overload some definitions for the device or to define only some macro
for host headers. This will be resolved in other commits.

Signed-off-by: Artur Gainullin <[email protected]>
Remove OpenCL cl_mem_fence_flags type/values definitions as the device compiler uses SPIR-V type/values now instead of OpenCL ones.

Signed-off-by: Vyacheslav N Klochkov <[email protected]>
This change unifies handling of sampler and accessor types during OpenCL kernel generation.

Signed-off-by: Mariya Podchishchaeva <[email protected]>
1) Fix error: "'detail::getSyclObjImpl': not a function".
2) Fix error: "subscript requires array or pointer type" for std::array use.
3) Fix few warnings caused by inconsistent usage of class-vs-struct keyword.

Signed-off-by: Vyacheslav N Klochkov <[email protected]>
Patch 1: Implementation of Constructors for image class.
Files Added:
image.hpp - Includes the interface for image class.
detail/image_impl.hpp - Includes the implementation of image_impl class.
detail/image_impl.cpp - For now includes the utility functions. Will be
	expanded later as accessor and other APIs are implemented.
test/basic_tests/image_constructors.cpp - test to check the image
constructors.
Next To Do:
SPIRV Code generation and accessors implementations.

Signed-off-by: Garima Gupta <[email protected]>
Signed-off-by: Kurt Chen <[email protected]>
Signed-off-by: Vladimir Lazarev <[email protected]>
 - Add development process description to contributing guide
 - Add info about skipping LIT tests targetting OpenCL device
   if corresponding RT is missed.

Signed-off-by: Vladimir Lazarev <[email protected]>
According to C++ spec:

Each enumerator becomes a named constant of the enumeration's type
(that is, name), visible in the enclosing scope, and can be used
whenever constants are required.

Having unscoped enumerations defined in global namespace reserve some
names and prohibits it's using in user's applications. For example,
'Device' might be used as user's class name and it might cause
ambiguity.

This patch aligns declaration of enums in spirv_types.hpp with ones from
SPIRV-Headers project to avoid declaring identifiers in global namespace
and simplify transition in the future. There are few exceptions:
* uint32_t is used as base type for enum instead of unsigned.
* '__spv' namespace is used instead of 'spv'.

Signed-off-by: Alexey Sachkov <[email protected]>
Remove CMake configuration expecting llvm-spirv and SYCL projects to be
located in LLVM source tree.
Location of external projects should be set via CMake variables.

Signed-off-by: Alexey Bader <[email protected]>
Current API spelling is get_linear, which is wrong - should be
get_linear_id according to spec.
Fix the unit test as well.

Signed-off-by: Konstantin Bobrovsky [email protected]
This implementation uses the keyword __unique_stable_name as an operator
that can take a type or expression, and will result in a constexpr
constant character array that (hopefully) uniquely represents the type
or type-of-expression being passed to it.

The unique representation is the normal mangled name of the type, except
in the cases of a lambda, where the ordinal "number" is just replaced
with LINE->COL.  Macro expansions are also appended with '~' followed by
the LINE->COL that it appears in.

For example, a lambda declared in
'main' would look like _ZTSZ4mainEUlvE25->12 (line 25, column 12).

A Lambda that comes from a macro looks like:
_ZTSZ4mainEUlvE45->3~18->32 (macro invoked on 45/3, lambda defined
inside the macro on line 18, column 32).

Template instantiations based on the lambda would result in a name that
contains the lambda mangling, for example:
_ZTSZ3bazIZ4mainEUlvE25->12EvvEUlvE14->12

A function template named 'baz' that is instantiated with a lambda
declared in 'main' on line 25/col 12 has another macro in it, declared
on line 14, column 12.

WIP

Signed-off-by: Erich Keane <[email protected]>
@erichkeane
Copy link
Collaborator Author

Hmm... I've managed to muck this up something terrible. Please ignore for now.

@erichkeane
Copy link
Collaborator Author

Ah, this was intended to be for SYCL, not this. sorry about that!

@erichkeane erichkeane closed this Jun 24, 2019
@repo-lockdown repo-lockdown bot locked and limited conversation to collaborators Jun 27, 2019
JordiChauzi referenced this pull request in upmem/llvm-project Aug 5, 2019
Sometimes the DWARF can omit information about a discriminant, for
example when an Option shares a discriminant slot with an enum that it
wraps.  In this case, lldb could crash, because the discriminant was
not found and because there was no default variant.

No test case because this relies on a compiler bug that will soon be
fixed.

Fixes #16
artemmukhin pushed a commit to artemmukhin/llvm-project that referenced this pull request Oct 16, 2019
Sometimes the DWARF can omit information about a discriminant, for
example when an Option shares a discriminant slot with an enum that it
wraps.  In this case, lldb could crash, because the discriminant was
not found and because there was no default variant.

No test case because this relies on a compiler bug that will soon be
fixed.

Fixes llvm#16
ggreif pushed a commit to ggreif/llvm-project that referenced this pull request Oct 9, 2020
Sometimes the DWARF can omit information about a discriminant, for
example when an Option shares a discriminant slot with an enum that it
wraps.  In this case, lldb could crash, because the discriminant was
not found and because there was no default variant.

No test case because this relies on a compiler bug that will soon be
fixed.

Fixes llvm#16

Signed-off-by: Gabor Greif <[email protected]>
cmtice referenced this pull request May 3, 2023
https://llvm.org/docs/LangRef.html#llvm-powi-intrinsic
The max length of the integer power of `llvm.powi` intrinsic is 32, and
the value can be negative. If we use `int32_t` to store this value, `-Val`
will underflow when it is `INT32_MIN`

The issue was reported in D149033.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.