- Sep 01, 2021
-
-
Joel E. Denny authored
This patch implements Clang support for an original OpenMP extension we have developed to support OpenACC: the `ompx_hold` map type modifier. The next patch in this series, D106510, implements OpenMP runtime support. Consider the following example: ``` #pragma omp target data map(ompx_hold, tofrom: x) // holds onto mapping of x { foo(); // might have map(delete: x) #pragma omp target map(present, alloc: x) // x is guaranteed to be present printf("%d\n", x); } ``` The `ompx_hold` map type modifier above specifies that the `target data` directive holds onto the mapping for `x` throughout the associated region regardless of any `target exit data` directives executed during the call to `foo`. Thus, the presence assertion for `x` at the enclosed `target` construct cannot fail. (As usual, the standard OpenMP reference count for `x` must also reach zero before the data is unmapped.) Justification for inclusion in Clang and LLVM's OpenMP runtime: * The `ompx_hold` modifier supports OpenACC functionality (structured reference count) that cannot be achieved in standard OpenMP, as of 5.1. * The runtime implementation for `ompx_hold` (next patch) will thus be used by Flang's OpenACC support. * The Clang implementation for `ompx_hold` (this patch) as well as the runtime implementation are required for the Clang OpenACC support being developed as part of the ECP Clacc project, which translates OpenACC to OpenMP at the directive AST level. These patches are the first step in upstreaming OpenACC functionality from Clacc. * The Clang implementation for `ompx_hold` is also used by the tests in the runtime implementation. That syntactic support makes the tests more readable than low-level runtime calls can. Moreover, upstream Flang and Clang do not yet support OpenACC syntax sufficiently for writing the tests. * More generally, the Clang implementation enables a clean separation of concerns between OpenACC and OpenMP development in LLVM. That is, LLVM's OpenMP developers can discuss, modify, and debug LLVM's extended OpenMP implementation and test suite without directly considering OpenACC's language and execution model, which can be handled by LLVM's OpenACC developers. * OpenMP users might find the `ompx_hold` modifier useful, as in the above example. See new documentation introduced by this patch in `openmp/docs` for more detail on the functionality of this extension and its relationship with OpenACC. For example, it explains how the runtime must support two reference counts, as specified by OpenACC. Clang recognizes `ompx_hold` unless `-fno-openmp-extensions`, a new command-line option introduced by this patch, is specified. Reviewed By: ABataev, jdoerfert, protze.joachim, grokos Differential Revision: https://reviews.llvm.org/D106509 -
Nikita Popov authored
-
Fangrui Song authored
Found by redfast00
-
Louis Dionne authored
Differential Revision: https://reviews.llvm.org/D108940
-
Louis Dionne authored
All supported versions of GCC now do the right thing. Differential Revision: https://reviews.llvm.org/D108997
-
Sylvestre Ledru authored
-
Michał Górny authored
-
Mehdi Amini authored
-
Chih-Ping Chen authored
-
Arthur O'Dwyer authored
-
peter klausler authored
It may not be great practice to pass a procedure (or procedure pointer) with an implicit interface as an actual argument to correspond with a dummy procedure (pointer), but it's not an error. Change to a warning, and modify tests accordingly. Differential Revision: https://reviews.llvm.org/D108932
-
Nick Desaulniers authored
Similar to D108842, D108844, D108926, D108928, and D108936. __has_builtin(builtin_mul_overflow) returns true for 32b RISCV targets, but Clang is deferring to compiler RT when encountering long long types. If the semantics of __has_builtin mean "the compiler resolves these, always" then we shouldn't conditionally emit a libcall. Link: https://bugs.llvm.org/show_bug.cgi?id=28629 Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D108939
-
Nikita Popov authored
-
Fangrui Song authored
Available and good in Clang 3.5/GCC 5.
-
MaheshRavishankar authored
The output tensor was added for tiling purposes. With use of `TilingInterface` for tiling pad operations, there is no need for an explicit operand for the shape of result of `linalg.pad_tensor` op. The interface allows the tiling pattern to query the value that can be used for the "init" needed for tiling dynamically. Differential Revision: https://reviews.llvm.org/D108613
-
Nick Desaulniers authored
Similar to D108842, D108844, and D108926. __has_builtin(builtin_mul_overflow) returns true for 32b PPC targets, but Clang is deferring to compiler RT when encountering long long types. This breaks ppc44x_defconfig + CONFIG_BLK_DEV_NBD=y builds of the Linux kernel that are using builtin_mul_overflow with these types for these targets. If the semantics of __has_builtin mean "the compiler resolves these, always" then we shouldn't conditionally emit a libcall. This will still need to be worked around in the Linux kernel in order to continue to support these builds of the Linux kernel for this target with older releases of clang. Link: https://bugs.llvm.org/show_bug.cgi?id=28629 Link: https://github.com/ClangBuiltLinux/linux/issues/1438 Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D108936
-
Philip Reames authored
Reduced from the ArchiveCommandLine.ll case seen in D108848.
-
Fangrui Song authored
For Clang, 3.5 is the minimum requirement which has fixed the bug. GCC 5 is good as well.
-
Joe Loser authored
Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D108967
-
Mehdi Amini authored
Currently the builtin dialect is the default namespace used for parsing and printing. As such module and func don't need to be prefixed. In the case of some dialects that defines new regions for their own purpose (like SpirV modules for example), it can be beneficial to change the default dialect in order to improve readability. Differential Revision: https://reviews.llvm.org/D107236
-
Mehdi Amini authored
Change ASM Op printer to print the operation name in the framework instead of leaving it up to each individual operation This aligns the printer with the parser contract: the operation isn't part of the user-controllable part of the syntax. Differential Revision: https://reviews.llvm.org/D108804
-
Mehdi Amini authored
This makes the hook return a printer if available, instead of using LogicalResult to indicate if a printer was available (and invoked). This allows the caller to detect that the dialect has a printer for a given operation without actually invoking the printer. It'll be leveraged in a future revision to move printing the op name itself under control of the ASMPrinter. Differential Revision: https://reviews.llvm.org/D108803
-
peter klausler authored
Implement compile-time constant folding for the transformational intrinsic function PACK. Differential Revision: https://reviews.llvm.org/D108956
-
Vedant Kumar authored
Newer Xcode toolchains ship a new otool implementation that prints out section contents in a slightly different way than otool-classic. Specify "-V" to otool to get the expected test output. Differential Revision: https://reviews.llvm.org/D108929
-
Joe Nash authored
Adds patterns for f64 ds_min/ds_max. Shrinks HasLDSFPAtomics scope to enable f32. Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D108994 Change-Id: Id890b677841ee588b20d42b1bb3f4cdbf6e9ba1a
-
Jessica Paquette authored
As noted in the comments in D108227, using G_FPTOSI produces wrong results for G_ISNAN. Drop the G_FPTOSI and perform the operation on integer types. Elsewhere in LLVM, a bitcast would be the appropriate choice (as it is in SDAG). GlobalISel does not distinguish between integer and FP types, so a bitcast would be meaningless here.
-
David Green authored
Apparently this was missing, preventing the generation of tail predication loops containing VMINNM, VMAXNM, VMINNMA and VMAXNMA.
-
David Green authored
-
Raphael Isemann authored
Right now running `expr` to start the multiline expression editor and then pressing enter causes an empty history empty to be created for the multiline editor. That doesn't seem very useful for users as pressing the 'up' key will now also bring up these empty expressions. I don't think there is ever a use case for recalling a completely empty expression from the history, so instead don't save those entries to the history file and make sure we never recall them when navigating over the expression history. Note: This is actually a Swift downstream patch that got shipped with Apple's LLDB for many years. However, this recently started conflicting with upstream LLDB as D100048 added a test that made sure that empty expression entries don't crash LLDB. Apple's LLDB was never affected by this crash as it never saved empty expressions in the first place. Reviewed By: augusto2112 Differential Revision: https://reviews.llvm.org/D108983
-
LLVM GN Syncbot authored
-
Mark de Wever authored
This move the helper types `chars_format`, `to_chars_result` and `from_chars_result` to a separate header. The first two are needed for D70631 the third for consistency. The header `__charconv/ryu.h` uses these types and it can't depend on the types in `<charconv>` in a modular build. Moving them to the ryu header would be an odd place and doesn't work since the header is included in the middle of `<charconv>`. Reviewed By: #libc, ldionne, Quuxplusone Differential Revision: https://reviews.llvm.org/D108927
-
Philip Reames authored
The runtime unroller will try to produce a non-loop if the unroll count is 2 and thus the prolog/epilog loop would only run at most one iteration. The old implementation did this by avoiding loop construction entirely. This patches instead constructs the trivial loop and then explicitly breaks the backedge and simplifies. This does result in some additional code churn when triggered, but a) results in better quality code and b) removes a codepath which didn't work properly for multiple exit epilogs. One oddity that I want to draw to reviewer attention is that this somehow changes revisit order. The new order looks equivalent to me, but I don't understand how creating and erasing an extra loop here creates this effect. Differential Revision: https://reviews.llvm.org/D108521
-
Philip Reames authored
This is a bailout for pr51680. This pass appears to assume that the alignment operand to an align tag on an assume bundle is constant. This doesn't appear to be required anywhere, and clang happily generates non-constant alignments for cases such as this case taken from the bug report: // clang -cc1 -triple powerpc64-- -S -O1 opal_pci-min.c extern int a[]; long *b; long c; void *d(long, int *, int, long, long, long) __attribute__((__alloc_align__(6))); void e() { b = d(c, a, 0, 0, 5, c); b[0] = 0; } This was exposed by a SCEV change which allowed a non-constant alignment to reach further into the pass' code. We could generalize the pass, but for now, let's fix the crash. -
Shilei Tian authored
As discussed in D107121, task wait doesn't work when a regular task T depends on a detached task or a hidden helper task T' in a serialized team. The root cause is, since the team is serialized, the last task will not be tracked by `td_incomplete_child_tasks`. When T' is finished, it first releases its dependences, and then decrements its parent counter. So far so good. For the thread that is running task wait, if at the moment it is still spinning and trying to execute tasks, it is fine because it can detect the new task and execute it. However, if it happends to finish the function `flag.execute_tasks(...)`, it will be broken because `td_incomplete_child_tasks` is 0 now. In this patch, we update the rule to track children tasks a little bit. If the task team encounters a proxy task or a hidden helper task, all following tasks will be tracked. Reviewed By: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D107496
-
Sanjay Patel authored
-
- Aug 31, 2021
-
-
Yaron Keren authored
Reviewed By: tstellar Differential Revision: https://reviews.llvm.org/D109000
-
Kazu Hirata authored
Identified with readability-redundant-string-cstr.
-
Fanbo Meng authored
Change OF_None to OF_Text flag in file creation, same reasoning as https://reviews.llvm.org/D97785 Reviewed By: abhina.sreeskantharajan Differential Revision: https://reviews.llvm.org/D108998
-
Philip Reames authored
This patch is specifically the howManyLessThan case. There will be a couple of followon patches for other codepaths. The subtle bit is explaining why the two codepaths have a difference while both are correct. The test case with modifications is a good example, so let's discuss in terms of it. * The previous exact bounds for this example of (-126 + (126 smax %n))<nsw> can evaluate to either 0 or 1. Both are "correct" results, but only one of them results in a well defined loop. If %n were 127 (the only possible value producing a trip count of 1), then the loop must execute undefined behavior. As a result, we can ignore the TC computed when %n is 127. All other values produce 0. * The max taken count computation uses the limit (i.e. the maximum value END can be without resulting in UB) to restrict the bound computation. As a result, it returns 0 which is also correct. WARNING: The logic above only holds for a single exit loop. The current logic for max trip count would be incorrect for multiple exit loops, except that we never call computeMaxBECountForLT except when we can prove either a) no overflow occurs in this IV before exit, or b) this is the sole exit. An alternate approach here would be to add the limit logic to the symbolic path. I haven't played with this extensively, but I'm hesitant because a) the term is optional and b) I'm not sure it'll reliably simplify away. As such, the resulting code quality from expansion might actually get worse. This was noticed while trying to figure out why D108848 wasn't NFC, but is otherwise standalone. Differential Revision: https://reviews.llvm.org/D108921
-
Paul Robinson authored
Tests in CodeGen/Generic should not depend on any specific target.
-