- May 12, 2022
-
-
Sanjay Patel authored
These are all cosmetic (value naming) diffs that would distract from real changes in this file.
-
Craig Topper authored
Type legalization will want to turn (srl X, Y) into RISCVISD::SRLW, which will prevent us from using a BEXT instruction. I don't think there is any precedent for type promotion checking users to decide how to promote. Instead, I've added this DAG combine to do it before type legalization. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D124109
-
Philip Reames authored
This patch is an alternative to a piece of D125270. If we have one vsetvli which is using as AVL the output of another, and the prior AVL can be proven to produce the same VL value as that defining one, we can use the AVL from the prior instruction. This has the effect of removing a state transition on AVL, and will let us use the cheaper 'vsetvli x0, x0, vtype1' form or possible even skip emitting it entirely. This builds on the same infrastructure as D125337, and does the analogous extension to working on abstract states instead of only prior explicit vsetvli instructions. This is where the (relatively minor) code improvements come from. More importantly, this fixes the last case where the state computed in phase 1 and 2 of the algorithm differs from the state computed during phase 3. Note that such differences can cause miscompiles by creating disagreements about contents of the VL and VTYPE registers at block boundaries. Doing this transform inside the dataflow can cause the compatibility of a later store to change with regards to the current state. test15 in the diff illustrates this case well. What we have is a vsetvli which is mutated by one following vector op, but whose GPR result is used by another. The compatibility logic walks back to the def in this case, and checks to see if it matches the immediate prior state. In phase 1 and 2, it doesn't, and in phase 3 (after mutation) it does because we remove a transition which caused it to differ. Differential Revision: https://reviews.llvm.org/D125392
-
Arthur Eubanks authored
Only applies linux for now. This prevents warnings with use_thinlto like bfd plugin: LLVM gold plugin has failed to create LTO module: Not an int attribute (Producer: 'LLVM15.0.0git' Reader: 'LLVM 13.0.1') Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D125399
-
Peter Klausler authored
The predicate that is used to detect an invalid assumed-size argument to the intrinsic functions SHAPE, SIZE, & LBOUND gives false results for arguments whose shapes are not calculatable at compilation time. Replace with an explicit test for an assumed-size array dummy argument symbol. Differential Revision: https://reviews.llvm.org/D125342
-
Philip Reames authored
These variations are chosen to exercise both FRE and PRE cases involving loops which don't change state in the iteration and can thus perform vsetvli in the preheader of the loop only. At the moment, these are essentially all TODOs.
-
David Tenty authored
D87451 added -mignore-xcoff-visibility for AIX targets and made it the default (which mimicked the behaviour of the XL 16.1 compiler on AIX). However, ignoring hidden visibility has unwanted side effects and some libraries depend on visibility to hide non-ABI facing entities from user headers and reserve the right to change these implementation details based on this (https://libcxx.llvm.org/DesignDocs/VisibilityMacros.html). This forces us to use internal linkage fallbacks for these cases on AIX and creates an unwanted divergence in implementations on the plaform. For these reasons, it's preferable to not add -mignore-xcoff-visibility by default, which is what this patch does. Reviewed By: DiggerLin Differential Revision: https://reviews.llvm.org/D125141
-
Mircea Trofin authored
Updated reference file for dev-mode-logging.ll and expected output.
-
Peter Klausler authored
Complex component references (z%RE, z%IM) of complex named constants should be evaluated at compilation time. Differential Revision: https://reviews.llvm.org/D125341
-
Sanjay Patel authored
As discussed in issue #37809, this transform is not safe if the input is an undefined value. There is no difference in codegen on the basic examples, but this could lead to regressions. We may need to improve freeze analysis or lowering if that happens.
-
Amir Ayupov authored
Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D125397
-
Joseph Huber authored
Summary: These sections need to be aligned correctly to be extracted later, add a check to indicate if they aren't.
-
Vibhuti Sawant authored
While executing the test suite for Tensorflow(v2.8.0), we encountered multiple TC failures with the below error ``` 'z14' is not a recognized processor for this target ``` This patch adds the s390x target to the build target list. It fixes TC failures in multiple modules of Tensorflow on s390x arch. It is also tested to have no effect on x86 machines. Reviewed By: GMNGeoffrey Differential Revision: https://reviews.llvm.org/D125096
-
Aaron Ballman authored
This should address: https://lab.llvm.org/buildbot/#/builders/92/builds/26609
-
- May 11, 2022
-
-
Matthias Braun authored
Avoid endless loop in degenerate case with an integer constant as switch condition as reported in https://reviews.llvm.org/D124552
-
Alban Bridonneau authored
-
python3kgae authored
A new pass DxilEmitMetadata is added to translate information saved in llvm ir into metadata to match DXIL spec. Only generate DXIL validator version in this PR. In llvm ir, validator version is saved in ModuleFlag with "dx.valver" as Key. !llvm.module.flags = !{!0, !1} !1 = !{i32 6, !"dx.valver", !2} !2 = !{i32 1, i32 1} DXIL validator version has major and minor versions that are specified as named metadata: !dx.valver = !{!2} !2 = !{i32 1, i32 7} Reviewed By: kuhar, beanz Differential Revision: https://reviews.llvm.org/D125158 -
Joe Nash authored
Refactor to pass a templatized size parameter to the decoder to allow wider than 64bit decodes in a later patch. Contributors: Jay Foad <jay.foad@amd.com> Depends on D125261 Patch 5/N for upstreaming of AMDGPU gfx11 architecture. Reviewed By: dp Differential Revision: https://reviews.llvm.org/D125316
-
Florian Hahn authored
Extra tests for D125264.
-
Joe Nash authored
Tablegen definitions for subtarget features and cpp predicate functions to access the features. New Sub-TargetProcessors and common latencies. Simple changes to MIR codegen tests which pass on gfx11 because they have the same output as previous subtargets or operate on pseudo instructions which are reused from previous subtargets. Contributors: Jay Foad <jay.foad@amd.com> Petar Avramovic <Petar.Avramovic@amd.com> Patch 4/N for upstreaming of AMDGPU gfx11 architecture Depends on D124538 Reviewed By: Petar.Avramovic, foad Differential Revision: https://reviews.llvm.org/D125261
-
Shao-Ce SUN authored
Reviewed By: asb Differential Revision: https://reviews.llvm.org/D125289
-
Nikita Popov authored
If there is a freeze %x, we currently replace all other uses of %x with freeze %x -- as long as they are dominated by the freeze instruction. This patch extends this behavior to cases where we did not originally dominate the use by moving the freeze instruction directly after the definition of the frozen value. The motivation can be seen in test @combine_and_after_freezing_uses: Canonicalizing everything to freeze %x allows folds that are based on value identity (i.e. same operand occurring in two places) to trigger. This also covers the case from D125248. Differential Revision: https://reviews.llvm.org/D125321
-
Philip Reames authored
This patch is an alternative to a piece of D125270. Its direct motivation is to fix a wrong code bug (described below), but somewhat unexpectedly, it also results in a significant code quality improvement for idiomatic fixed length vector patterns. The existing transform is simply wrong in its current location. We are correct about the fact that the scalar move itself can use the previous vsetvli, but we loose track of the fact that later instructions might depend on the state change represented. That is, the actual value of VL in the register is different than the abstract state thinks it is. Not simply due to precision of modeling, but e.g. the VL register could contain 3 when the abstract state says it is 1. This is annoying hard to demonstrate in practice due to differences in policy flags on the intrinsics, but this is at least a latent wrong code bug. The code quality benefit comes from the fact we don't need to tie this to explicit vsetvli instructions at all. We can propagate the abstract state, and reduce a) the number of transitions, or b) the cost of those transitions. It turns out we have a bunch of cases - in tests at least - where fixed length AVLs are known non-zero, and we can leave VL unchanged while changing VTYPE. Differential Revision: https://reviews.llvm.org/D125337
-
Matthias Springer authored
Move helper functions for creating allocs/deallocs/memcpys to BufferizationOptions. Differential Revision: https://reviews.llvm.org/D125375
-
Louis Dionne authored
We do it for libc++, and it's rather useful for debugging e.g. CI.
-
Nico Weber authored
-
Joseph Huber authored
In order to do offloading compilation we need to embed files into the host and create fatbainaries. Clang uses a special binary format to bundle several files along with their metadata into a single binary image. This is currently performed using the `-fembed-offload-binary` option. However this is not very extensibile since it requires changing the command flag every time we want to add something and makes optional arguments difficult. This patch introduces a new tool called `clang-offload-packager` that behaves similarly to CUDA's `fatbinary`. This tool takes several input files with metadata and embeds it into a single image that can then be embedded in the host. Reviewed By: tra Differential Revision: https://reviews.llvm.org/D125165
-
Matt Devereau authored
Enable function attribute aarch64_sve_pcs at the C level, which correspondes to aarch64_sve_vector_pcs at the LLVM IR level. This requirement was created by this addition to the ARM C Language Extension: https://github.com/ARM-software/acle/pull/194 Differential Revision: https://reviews.llvm.org/D124998
-
Alexey Bataev authored
Further improvement of the cost model for the scalars used in buildvectors sequences. The main functionality is outlined into a separate function. The cost is calculated in the following way: 1. If the Base vector is not undef vector, resizing the very first mask to have common VF and perform action for 2 input vectors (including non-undef Base). Other shuffle masks are combined with the resulting after the 1 stage and processed as a shuffle of 2 elements. 2. If the Base is undef vector and have only 1 shuffle mask, perform the action only for 1 vector with the given mask, if it is not the identity mask. 3. If > 2 masks are used, perform serie of shuffle actions for 2 vectors, combing the masks properly between the steps. The original implementation misses the very first analysis for the Base vector, so the cost might too optimistic in some cases. But it improves the cost for the insertelements which are part of the current SLP graph. Part of D107966. Differential Revision: https://reviews.llvm.org/D115750
-
Sanjay Patel authored
Without this, miscompiles go undetected here as shown in D125352.
-
Whisperity authored
-
Sergey Semushin authored
Due to how parseBracedList always stopped on the first closing angle bracket and was used in parsing angle bracketed expression inside concept definition, nested brackets inside concepts were parsed incorrectly. nextToken() call before calling parseBracedList is required because we were processing opening angle bracket inside parseBracedList second time leading to incorrect logic after my fix. Fixes https://github.com/llvm/llvm-project/issues/54943 Fixes https://github.com/llvm/llvm-project/issues/54837 Reviewed By: HazardyKnusperkeks, curdeius Differential Revision: https://reviews.llvm.org/D123896
-
Fraser Cormack authored
-
Fraser Cormack authored
-
Joseph Huber authored
This patch adds the necessary code generation to create the wrapper code that registers all the globals in CUDA. We create the necessary functions and iterate through the list of `__start_cuda_offloading_entries` to find which globals must be registered. This is very similar to the code generation done currently in Clang for non-rdc builds, but here we are registering a fully linked fatbinary and finding the globals via the above sections. With this we should be able to fully support basic RDC / LTO building of CUDA code. It's also worth noting that this does not include the necessary PTX to JIT the image, so to use this support the offloading architecture must match the system's architecture. Depends on D123810 Reviewed By: tra Differential Revision: https://reviews.llvm.org/D123812
-
Joseph Huber authored
This patch adds the initial support for wrapping CUDA images. This requires changing some of the logic for how we bundle images. We now need to copy the image for all kinds that are active for the architecture. Then we need to run a separate wrapping job if the Kind is Cuda. For cuda wrapping we need to use the `fatbinary` program from the CUDA SDK to bundle all the binaries together. This is then passed to a new function to perfom the actual module code generation that will be implemented in a later patch. Depends on D120273 D123471 Reviewed By: tra Differential Revision: https://reviews.llvm.org/D123810
-
Joseph Huber authored
The changes made in D123460 generalized the code generation for OpenMP's offloading entries. We can use the same scheme to register globals for CUDA code. This patch adds the code generation to create these offloading entries when compiling using the new offloading driver mode. The offloading entries are simple structs that contain the information necessary to register the global. The struct used is as follows: ``` Type struct __tgt_offload_entry { void *addr; // Pointer to the offload entry info. // (function or global) char *name; // Name of the function or global. size_t size; // Size of the entry info (0 if it a function). int32_t flags; int32_t reserved; }; ``` Currently CUDA handles RDC code generation by deferring the registration of globals in the current TU to a callback function containing the modules ID. Later all the module IDs will be used to register all of the globals at once. Rather than mimic this, offloading entries allow us to mimic the way OpenMP registers globals. That is, we create a simple global struct for each device global to be registered. These are placed at a special section `cuda_offloading_entires`. Because this section is a valid C-identifier, the linker will profide a `__start` and `__stop` pointer that we can use to iterate and register all globals at runtime. the registration requires a flag variable to indicate which registration function to use. I have assigned the flags somewhat arbitrarily, but these use the following values. Kernel: 0 Variable: 0 Managed: 1 Surface: 2 Texture: 3 Depends on D120272 Reviewed By: tra Differential Revision: https://reviews.llvm.org/D123471 -
Aaron Ballman authored
This fixes: https://lab.llvm.org/buildbot/#/builders/109/builds/38337
-
Ken Matsui authored
This adds the -Wgnu-line-marker diagnostic flag, grouped under -Wgnu, to warn about use of the GNU linemarker preprocessor extension. Fixes #55067 Differential Revision: https://reviews.llvm.org/D124534
-
Amir Ayupov authored
As BOLT support for monolithic and split DWARF5 is added, remove DWARF version override for BOLT tests. Reviewed By: ayermolo Differential Revision: https://reviews.llvm.org/D125366
-