- Aug 03, 2021
-
-
Simon Pilgrim authored
(cherry picked from commit 6569b7f9)
-
Dmitry Vyukov authored
This reverts commit 5d1df6d2. There is a strong objection to this change: https://reviews.llvm.org/D106436#2905618 Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D106847 (cherry picked from commit 440e936c)
-
Tom Stellard authored
This reverts commit ae6b4000. llvm.org/PR51300
-
Sanjay Patel authored
This transform was added with D58874, but there were no tests for overflow ops. We need to change this one way or another because it can crash as shown in: https://llvm.org/PR51238 Note that if there are no uses of an overflow op's bool overflow result, we reduce it to a regular math op, so we continue to fold that case either way. If we have uses of both the math and the overflow bool, then we are likely not saving anything by creating an independent sub instruction as seen in the test diffs here. This patch makes the behavior in SDAG consistent with what we do in instcombine AFAICT. Differential Revision: https://reviews.llvm.org/D106983 (cherry picked from commit fa6b2c99)
-
Sanjay Patel authored
There's a generic combine for these, but no test coverage. It's not clear if this is actually a good fold. The combine was added with D58874, but it has a bug that can cause crashing ( https://llvm.org/PR51238 ). (cherry picked from commit e427077e)
-
Sanjay Patel authored
This transform was added with e38b7e89 and as shown in: https://llvm.org/PR51241 ...it could crash without an extra check of the blocks. There might be a more compact way to write this constraint, but we can't just count the successors/predecessors without affecting a test that includes a switch instruction. (cherry picked from commit 5b83261c)
-
Craig Topper authored
The sign_extend we insert here can get turned into a zero_extend if the sign bit is known zero. This can enable a setcc combine that shrinks compares with zero_extend. This reduces the use count of the zero_extend allowing other combines to turn it back into an any_extend. This restricts the combine to only cases where the result is used by a CopyToReg. This works for my original motivating case. I hope the CopyToReg use will prevent any converted extends from turning back into an any_extend. Reviewed By: luismarques Differential Revision: https://reviews.llvm.org/D106754 (cherry picked from commit 54588bcc)
-
Tom Stellard authored
(cherry picked from commit 7546a34044ae28b62bd43e6dc0952622e1b6e77f)
-
Mateusz Mikuła authored
Postgresql uses `--stack=` in its Makefile. Downstream issue: https://github.com/msys2/MINGW-packages/pull/9167 Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D107237 (cherry picked from commit 05b025ed)
-
Martin Storsjö authored
Use `clang_target_link_libraries` to avoid duplicate libraries when the same symbol is provided both by a static library and a larger dylib, fixing linking with win32 dylibs. This fixes errors like these: ld.lld: error: duplicate symbol: llvm::createStringError(std::__1::error_code, char const*) >>> defined at libLLVMSupport.a(Error.cpp.obj) >>> defined at libLLVM-14git.dll This matches how other clang tools declare their dependencies. Differential Revision: https://reviews.llvm.org/D107231 (cherry picked from commit 25a288b0)
-
- Aug 02, 2021
-
-
Anton Zabaznov authored
'pipe' keyword is introduced in OpenCL C 2.0: so do checks for OpenCL C version while parsing and then later on check for language options to construct actual pipe. This feature requires support of __opencl_c_generic_address_space, so diagnostics for that is provided as well. This is the same patch as in D106748 but with a tiny fix in checking of diagnostic messages. Also added tests when program scope global variables are not supported. This is squashed cherry pick of D107154 and D107176
-
Mark de Wever authored
@tcanens pointed out the current behavior of the macro breaks the usage pattern described in http://wg21.link/SD6 ``` ``` To support this usage pattern the hard errror is removed. Instead the header includes nothing but the `<version>` header. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D107134 (cherry picked from commit d618a1cc)
-
Alexandros Lamprineas authored
This patch legalizes the Machine Value Type introduced in D94096 for loads and stores. A new target hook named getAsmOperandValueType() is added which maps i512 to MVT::i64x8. GlobalISel falls back to DAG for legalization. Differential Revision: https://reviews.llvm.org/D94097
-
Alexandros Lamprineas authored
Adds MVT::i64x8, a Machine Value Type needed for lowering inline assembly operands which materialize a sequence of eight general purpose registers. Differential Revision: https://reviews.llvm.org/D94096
-
Alexandros Lamprineas authored
In LLVM IR terms the ACLE type 'data512_t' is essentially an aggregate type { [8 x i64] }. When emitting code for inline assembly operands, clang tries to scalarize aggregate types to an integer of the equivalent length, otherwise it passes them by-reference. This patch adds a target hook to tell whether a given inline assembly operand is scalarizable so that clang can emit code to pass/return it by-value. Differential Revision: https://reviews.llvm.org/D94098 -
Anton Zabaznov authored
This feature requires support of __opencl_c_images, so diagnostics for that is provided as well. Also, ensure that cl_khr_3d_image_writes feature macro is set to the same value. Reviewed By: Anastasia Differential Revision: https://reviews.llvm.org/D106260 (cherry picked from commit f16a4fcb)
-
- Jul 30, 2021
-
-
Christopher Di Bella authored
Includes regression test for problem noted by @hans. This reverts commit 973de718. Differential Revision: https://reviews.llvm.org/D106898 (cherry picked from commit 08719541)
-
Fangrui Song authored
This option is a subset of -Bsymbolic-functions. It applies to STB_GLOBAL STT_FUNC definitions. The address of a vague linkage function (STB_WEAK STT_FUNC, e.g. an inline function, a template instantiation) seen by a -Bsymbolic-functions linked shared object may be different from the address seen from outside the shared object. Such cases are uncommon. (ELF/Mach-O programs may use `-fvisibility-inlines-hidden` to break such pointer equality. On Windows, correct dllexport and dllimport are needed to make pointer equality work. Windows link.exe enables /OPT:ICF by default so different inline functions may have the same address.) ``` // a.cc -> a.o -> a.so (-Bsymbolic-functions) inline void f() {} void *g() { return (void *)&f; } // b.cc -> b.o -> exe // The address is different! inline void f() {} ``` -Bsymbolic-non-weak-functions is a safer (C++ conforming) subset of -Bsymbolic-functions, which can make such programs work. Implementations usually emit a vague linkage definition in a COMDAT group. We could detect the group (with more code) but I feel that we should just check STB_WEAK for simplicity. A weak definition will thus serve as an escape hatch for rare cases when users want interposition on definitions. GNU ld feature request: https://sourceware.org/bugzilla/show_bug.cgi?id=27871 Longer write-up: https://maskray.me/blog/2021-05-16-elf-interposition-and-bsymbolic If Linux distributions migrate to protected non-vague-linkage external linkage functions by default, the linker option can still be handy because it allows rapid experiment without recompilation. Protected function addresses currently have deep issues in GNU ld. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D102570 (cherry picked from commit b06426da)
-
- Jul 29, 2021
-
-
Jeremy Morse authored
When we have a terminator sequence (i.e. a tailcall or return), MIIsInTerminatorSequence is used to work out where the preceding ABI-setup instructions end, i.e. the parts that were glued to the terminator instruction. This allows LLVM to split blocks safely without having to worry about ABI stuff. The function only ignores DBG_VALUE instructions, meaning that the two debug instructions I recently added can end terminator sequences early, causing various MachineVerifier errors. This patch promotes the test for debug instructions from "isDebugValue" to "isDebugInstr", thus avoiding any debug-info interfering with this function. Differential Revision: https://reviews.llvm.org/D106660 (cherry picked from commit 8612417e)
-
Bradley Smith authored
An incorrect mask type when lowering an SVE gather/scatter was causing a codegen fault which manifested as the incorrect predicate size being used for an SVE gather/scatter, (e.g.. p0.b rather than p0.d). Fixes PR51182. Differential Revision: https://reviews.llvm.org/D106943 (cherry picked from commit 191831e3)
-
Björn Schäpers authored
This amends c5243c63 to fix formatting continued function calls with BinPacking = false. Differential Revision: https://reviews.llvm.org/D106773 (cherry picked from commit 75f6a795)
-
Diana Picus authored
Don't prefer python2's virtualenv when setting up the test-suite. Always use python3 instead, since that's what we support everywhere else anyway. Differential Revision: https://reviews.llvm.org/D106941
-
Mark de Wever authored
Differential Revision: https://reviews.llvm.org/D106770
-
Chris Jackson authored
This was reverted due to a reported crash. This reverts commit 796b84d2.
-
- Jul 28, 2021
-
-
Whisperity authored
-
Jose M Monsalve Diaz authored
This patch fixes the error reported in D106751. When there is no CUDA SDK installed in the system, the build fails due to missing `CU_DEVICE_ATTRIBUTE` variables. Using @zsrkmyn sugested fix Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D106933
-
Jose M Monsalve Diaz authored
This patch introduces the `llvm-omp-device-info` tool, which uses the omptarget library and interface to query the device info from all the available devices as seen by OpenMP. This is inspired by PGI's `pgaccelinfo` Since omptarget usually requires a description structure with executable kernels, I split the initialization of the RTLs and Devices to be able to initialize all possible devices and query each of them. This revision relies on the patch that introduces the print device info. A limitation is that the order in which the devices are initialized, and the corresponding device ID is not necesarily the one seen by OpenMP. The changes are as follows: 1. Separate the RTL initialization that was performed in `RegisterLib` to its own `initRTLonce` function 2. Create an `initAllRTLs` method that initializes all available RTLs at runtime 3. Created the `llvm-deviceinfo.cpp` tool that uses `omptarget` to query each device and prints its information. Example Output: ``` Device (0): print_device_info not implemented Device (1): print_device_info not implemented Device (2): print_device_info not implemented Device (3): print_device_info not implemented Device (4): CUDA Driver Version: 11000 CUDA Device Number: 0 Device Name: Quadro P1000 Global Memory Size: 4236312576 bytes Number of Multiprocessors: 5 Concurrent Copy and Execution: Yes Total Constant Memory: 65536 bytes Max Shared Memory per Block: 49152 bytes Registers per Block: 65536 Warp Size: 32 Threads Maximum Threads per Block: 1024 Maximum Block Dimensions: 1024, 1024, 64 Maximum Grid Dimensions: 2147483647 x 65535 x 65535 Maximum Memory Pitch: 2147483647 bytes Texture Alignment: 512 bytes Clock Rate: 1480500 kHz Execution Timeout: Yes Integrated Device: No Can Map Host Memory: Yes Compute Mode: DEFAULT Concurrent Kernels: Yes ECC Enabled: No Memory Clock Rate: 2505000 kHz Memory Bus Width: 128 bits L2 Cache Size: 1048576 bytes Max Threads Per SMP: 2048 Async Engines: Yes (2) Unified Addressing: Yes Managed Memory: Yes Concurrent Managed Memory: Yes Preemption Supported: Yes Cooperative Launch: Yes Multi-Device Boars: No Compute Capabilities: 61 ``` Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D106752 -
Valentin Clement authored
Add basic translation of acc.data to LLVM IR with runtime calls. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D104301
-
Jim Ingham authored
The old code incorrectly calculated the start position for the search for the third (and subsequent) instance of a particular substitution pattern (e.g. %1). I also added a few test cases for this parsing covering this failure.
-
Fangrui Song authored
[[noreturn]] can be used since 2016 when the minimum compiler requirement was bumped to GCC 4.8/MSVC 2015.
-
Fangrui Song authored
[[noreturn]] can be used since 2016 when the minimum compiler requirement was bumped to GCC 4.8/MSVC 2015.
-
Jose M Monsalve Diaz authored
This patch introduces a function in the device's plugin to print the device information. This patch relates to another patch that introduces a CLI tool to obtain the device information from the omplibrary directly. It is inspired by PGI's pgaccelinfo. The modifications are as follows: 1. Introduce the optional `void __tgt_rtl_print_device_info(RTLdevID)` function into the RTL. 2. Introduce the `bool __tgt_print_device_info(devID)` function into `omptarget` interface. Returns false if the RTL is not implemented 3. Added `bool printDeviceInfo(RTLDevID)` to the `DeviceTy` 4. Implement the `__tgt_rtl_print_device_info` for CUDA. Added additional CUDA Runtime calls. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D106751
-
Jose M Monsalve Diaz authored
The device runtime contains several calls to `__kmpc_get_hardware_num_threads_in_block` and `__kmpc_get_hardware_num_blocks`. If the thread_limit and the num_teams are constant, these calls can be folded to the constant value. In this patch we use the already introduced `AAFoldRuntimeCall` and the `NumTeams` and `NumThreads` kernel attributes (to be introduced in a different patch) to fold these functions. The code checks all the kernels, and if their attributes match, the functions are folded. In the future we will explore specializing for multiple values of NumThreads and NumTeams. Depends on D106390 Reviewed By: jdoerfert, JonChesterfield Differential Revision: https://reviews.llvm.org/D106033
-
Matheus Izvekov authored
Signed-off-by:
Matheus Izvekov <mizvekov@gmail.com> Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D100733
-
George Burgess IV authored
At the moment, the revert ordering from this tool is unspecified (though it happens to be in `git log` order, so newest reverts come first). From the standpoint of tooling and users, this seems to be the opposite of what we want by default: tools and users will generally try to apply these reverts as cherry-picks. If two reverts in the list are close enough to each other, if the reverts get applied out of order, we'll get a merge conflict. Rather than having `reverse`s for all tools (and mental reverses for manual users), just guarantee an oldest-first output ordering for this function. Differential Revision: https://reviews.llvm.org/D106838
-
Juneyoung Lee authored
This patch adds a peephole optimization `SETCC(FREEZE(x),const)` => `FREEZE(SETCC(x,const))` if the SETCC is only used by BRCOND. Combined with `BRCOND(FREEZE(X)) => BRCOND(X)`, this leads to a nice improvement in the generated assembly when x is a masked loaded value. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D105344
-
Juneyoung Lee authored
-
Xiang1 Zhang authored
Differential Revision: https://reviews.llvm.org/D106780
-
Johannes Doerfert authored
This reapplies commit cbb709e2 and includes the use of the lookup method instead of operator[] to avoid accidentally setting (empty) simplification callbacks. This reverts commit aa27430a.
-
Xiang1 Zhang authored
This reverts commit 6ff73efe.
-