- Feb 01, 2022
-
-
Johannes Doerfert authored
genericValueTraversal can look through arguments and allow value simplification across function boundaries. In fact, the latter already happened unchecked. With this change we allow the user of genericValueTraversal to opt-out of interprocedural traversal if required. We explicitly look through arguments now which helps to do various things, incl. the propagation of constants into OpenMP parallel regions (on the host).
-
Christian Sigg authored
Following the discussion in D118318, mark `arith.addf/mulf` commutative. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D118600
-
Mogball authored
Part 2 of 3 of unifying the assembly formats of attributes/types and operations.The last patch that introduced attribute/type formats (D111594) factored out the format lexer entirely. This patch factors out most of the format parsers such that the attribute/type and op parsers only need to implement handling for specific elements. Certain things could be factored better (element verification, 'seen' variables) but the primary goal of factoring is so that features can be used across both assembly formats. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D117971
-
Johannes Doerfert authored
This fixes a conceptual problem with our AAIsDead usage which conflated call site liveness with call site return value liveness. Without the fix tests would obviously miscompile as we make genericValueTraversal more powerful (in a follow up). The effects on the tests are mixed but mostly marginal. The most prominent one is the lack of `noreturn` for functions. The reason is that we make entire blocks live at the same time (for time reasons). Now that we actually look at the block liveness, which we need to do, the return instructions are live and will survive. As an example, `noreturn_async.ll` has been modified to retain the `noreturn` even with block granularity. We could address this easily but there is little need in practice.
-
Johannes Doerfert authored
We moved to the edge API a while back, not all uses were adjusted. Edge liveness is more precise.
-
Johannes Doerfert authored
No tests as these were found browsing the code and I'm not sure how to test them properly.
-
Johannes Doerfert authored
-
Johannes Doerfert authored
We have two attributes that can answer readnone queries. While there is a dependence between them, it seems best to not force the users to know what AA to ask. The helpers also allow to check for readonly nicely. Test changes show where we now deduce readnone but haven't before, mostly because we only asked AAMemoryBehavior and not AAMemoryLocation. AANoAlias has not been ported to the new API yet.
-
Johannes Doerfert authored
Since D104432 we can look through memory by analyzing all writes that might interfere with a load. This patch provides some logic to exclude writes that cannot interfere with a location, due to CFG reasoning. We make sure to avoid multi-thread write-read situations properly while we ignore writes that cannot reach a load or writes that will be overwritten before the load is reached. Differential Revision: https://reviews.llvm.org/D106397
-
Johannes Doerfert authored
-
Johannes Doerfert authored
Due to num_threads (probably also other reasons) we cannot assume explicit barriers are always executed by all threads in an aligned fashion. We can optimize them if that property can be proven but that is different.
-
Johannes Doerfert authored
No-sync is a property that we need in more places as complex transformations emerge. To simplify the query we provide an `AA::isNoSyncInst` helper now and expose two existing helpers through the `AANoSync` class.
-
Johannes Doerfert authored
The namespaces made it more complicate to implement static helpers, among other things. We should not need them at all.
-
Johannes Doerfert authored
Patch originally by Giorgis Georgakoudis (@ggeorgakoudis), typos and bugs introduced later by me. This patch allows us to remove redundant barriers if they are part of a "consecutive" pair of barriers in a basic block with no impacted memory effect (read or write) in-between them. Memory accesses to local (=thread private) or constant memory are allowed to appear. Technically we could also allow any other memory that is not used to share information between threads, e.g., the result of a malloc that is also not captured. However, it will be easier to do more reasoning once the code is put into an AA. That will also allow us to look through phis/selects reasonably. At that point we should also deal with calls, barriers in different blocks, and other complexities. Differential Revision: https://reviews.llvm.org/D118002
-
Johannes Doerfert authored
We used to remove noinline from known OpenMP runtime functions (which are declared in OMPKinds.td). Now we remove noinline from all functions with the proper prefixes: __kmpc, _ZN4_OMP (= namespace omp), omp_
-
Amir Ayupov authored
Only enable --emit-relocs linker option for merge-fdata target if tests are enabled. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D118580
-
Siva Chandra Reddy authored
Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D118641
-
Jez Ng authored
Reviewed By: keith Differential Revision: https://reviews.llvm.org/D118646
-
Serguei Katkov authored
PointerToBase is a mapping between potentially derived pointer to its base. As soon as we are in SSA form if there is a base of derived pointer and it is available at def of derived pointer, the same base will be available at any point where derived pointer is alive. So the mapping of derived pointer to base pointer is not a property of a call site but the same on function level. Reviewers: reames, yrouban Reviewed By: reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D118604
-
Joseph Huber authored
Some of the new driver tests are flaky on AMDGPU, remove for now.
-
Joseph Huber authored
This patch adds a new target to the tests to run using the new driver as the method for generating offloading code. Depends on D116541 Differential Revision: https://reviews.llvm.org/D118637
-
Joseph Huber authored
The LTO support for OpenMP offloading allows us to run the OpenMPOpt pass during the LTO pipeline. This patch introduces an early run of the Module pass and a late run of the CGSCC pass. These are quick no-ops if there is no OpenMP in the module. Depends on D118198 Differential Revision: https://reviews.llvm.org/D118611
-
Joseph Huber authored
Summary: This patch removes the system call to the `clang-offload-wrapper` tool by replicating its functionality in a new file. This improves performance and makes the future wrapping functionality easier to change. Differential Revision: https://reviews.llvm.org/D118198
-
Joseph Huber authored
Summary: This patch replaces the system call to the `llc` binary with a library call to the target machine interface. This should be faster than relying on an external system call to compile the final wrapper binary. Differential Revision: https://reviews.llvm.org/D118197
-
Joseph Huber authored
Summary: Various changes and cleanup for the Linker Wrapper tool.
-
Joseph Huber authored
Summary: This parses the executable name out of the linker arguments so we can use it to give more informative temporary file names and so we don't accidentally use it for device linking.
-
Joseph Huber authored
Summary: This patch implements the `-save-temps` flag for the linker wrapper. This allows the user to inspect the intermeditary outpout that the linker wrapper creates.
-
Joseph Huber authored
Summary: Various changes to the linker wrapper, and the bitcode embedding is not done after the optimizations have run rather than after linking is done. This saves time when doing JIT.
-
Joseph Huber authored
This patch improves the symbol resolution done for LTO with offloading applications. The symbol resolution done here allows the LTO backend to internalize more functions. The symbol resoltion done is a simplified view that does not take into account various options like `--wrap` or `--dyanimic-list` and always assumes we are creating a shared object. The actual target may be an executable, but semantically it is used as a shared object because certain objects need to be visible outside of the executable when they are read by the OpenMP plugin. Depends on D117246 Differential Revision: https://reviews.llvm.org/D118155
-
Joseph Huber authored
This patch adds support for linking AMDGPU images using the LLD binary. AMDGPU files are always bitcode images and will always use the LTO backend. Additionally we now pass the default architecture found with the `amdgpu-arch` tool to the argument list. Depends on D117156 Differential Revision: https://reviews.llvm.org/D117246
-
Joseph Huber authored
This patch adds support for a few extra flags in the linker wrapper, such as debugging flags, verbose output, and passing arguments to ptxas. We also now forward pass remarks to the LLVM backend so they will show up in the LTO passes. Depends on D117049 Differential Revision: https://reviews.llvm.org/D117156
-
Joseph Huber authored
Summary; This patch adds support for embedding device images in the linker wrapper tool. This will be used for performing JIT functionality in the future. Depends on D117048 Differential Revision: https://reviews.llvm.org/D117049
-
Joseph Huber authored
Summary: This patch adds support for linking the OpenMP device bitcode library late when doing LTO. This simply passes it in as an additional device file when doing the final device linking phase with LTO. This has the advantage that we don't link it multiple times, and the device references do not get inlined and prevent us from doing needed OpenMP optimizations when we have visiblity of the whole module. Fix some failings where the implicit conversion of an Error to an Expected triggered the deleted copy constructor. Depends on D116675 Differential revision: https://reviews.llvm.org/D117048
-
Joseph Huber authored
This patch implements the fist support for handling LTO in the offloading pipeline. The flag `-foffload-lto` is used to control if bitcode is embedded into the device. If bitcode is found in the device, the extracted files will be sent to the LTO pipeline to be linked and sent to the backend. This implementation does not separately link the device bitcode libraries yet. Depends on D116675 Differential Revision: https://reviews.llvm.org/D116975
-
Joseph Huber authored
This patch adds support for searching through the linker library paths to identify static libraries that may contain device code. If device code is present it will be extracted. This should ideally fully support static linking with OpenMP offloading. Depends on D116627 Differential Revision: https://reviews.llvm.org/D116675
-
Joseph Huber authored
This patch adds the initial support for linking NVPTX offloading code using the clang-linker-wrapper tool. This uses the extracted device files and runs `nvlink` on them. Currently this is then passed to the existing toolchain for creating linkable OpenMP offloading programs using `clang-offload-wrapper` and compiling it manually using `llc`. More work is required to support LTO, Bitcode linking, AMDGPU, and x86 offloading. Depends on D116545 Differential Revision: https://reviews.llvm.org/D116627
-
Joseph Huber authored
This patchs add support for extracting device offloading code from the linker's input files. If the file contains a section with the name `.llvm.offloading.<triple>.<arch>` it will be extracted to a new temporary file to be linked. Addtionally, the host file containing it will have the section stripped so it does not remain in the executable once linked. Depends on D116544 Differential Revision: https://reviews.llvm.org/D116545
-
Sam Clegg authored
Differential Revision: https://reviews.llvm.org/D117747
-
River Riddle authored
This matches the same API usage as attributes/ops/types. For example: ```c++ Dialect *dialect = ...; // Instead of this: if (auto *interface = dialect->getRegisteredInterface<DialectInlinerInterface>()) // You can do this: if (auto *interface = dyn_cast<DialectInlinerInterface>(dialect)) ``` Differential Revision: https://reviews.llvm.org/D117859
-
Fangrui Song authored
-