- Jul 11, 2021
-
-
Craig Topper authored
-
Craig Topper authored
-
Kazu Hirata authored
The last use was removed on Jan 21, 2021 in commit 0895b836.
-
Craig Topper authored
Some of these would produce better code if we used W instructions, but constant LHS currently prevents that.
-
Johannes Doerfert authored
AllocationInfo and DeallocationInfo objects themselves are allocated with the Attributor bump allocator and do not need to be deallocated. That said, the sets in AllocationInfo and DeallocationInfo need to be destroyed to avoid memory leaks.
-
Johannes Doerfert authored
In the spirit of TRegions [0], this patch analyzes a kernel and tracks if it can be executed in SPMD-mode. If so, we flip the arguments of the __kmpc_target_init and deinit call to enable the mode. We also update the `<kernel>_exec_mode` flag to indicate to the runtime we changed the mode to SPMD. The code analysis is done interprocedurally by extending the AAKernelInfo abstract attribute to track SPMD compatibility as well. [0] https://link.springer.com/chapter/10.1007/978-3-030-28596-8_11 Differential Revision: https://reviews.llvm.org/D102307
-
Johannes Doerfert authored
-
Johannes Doerfert authored
We had multiple functions to determine the execution mode (SPMD/Generic) and runtime status (initialized/uninitialized) but that just increased complexity without a real benefit. Especially with D102307 in mind it is helpful to reduce the dependence on the `ident_t` flags. Differential Revision: https://reviews.llvm.org/D105586
-
Johannes Doerfert authored
-
Johannes Doerfert authored
In the spirit of TRegions [0], this patch creates a custom state machine for a generic target region based on the potentially called parallel regions. The code analysis is done interprocedurally via an abstract attribute (AAKernelInfo). All outermost parallel regions are collected and we check if there might be unknown outermost parallel regions for which we need an indirect call. Other AAKernelInfo extensions are expected. [0] https://link.springer.com/chapter/10.1007/978-3-030-28596-8_11 Differential Revision: https://reviews.llvm.org/D101977
-
Johannes Doerfert authored
In the spirit of TRegions [0], this patch provides a simpler and uniform interface for a kernel to set up the device runtime. The OMPIRBuilder is used for reuse in Flang. A custom state machine will be generated in the follow up patch. The "surplus" threads of the "master warp" will not exit early anymore so we need to use non-aligned barriers. The new runtime will not have an extra warp but also require these non-aligned barriers. [0] https://link.springer.com/chapter/10.1007/978-3-030-28596-8_11 This was in parts extracted from D59319. Reviewed By: ABataev, JonChesterfield Differential Revision: https://reviews.llvm.org/D101976
-
Johannes Doerfert authored
When we talk to outside analyse, e.g., LVI and ScalarEvolution, we need to be careful with the query. The particular error occurred because we folded a PHI node before the LVI query but the context location was now not dominated by the value anymore. This is not supported by LVI so we have to filter these situations before we query the outside analyses.
-
Johannes Doerfert authored
If we can simplify the select condition we can avoid one value in the traversal. Differential Revision: https://reviews.llvm.org/D103861
-
Johannes Doerfert authored
-
Johannes Doerfert authored
In order to simplify future extensions, e.g., the merge of AAHeapToShared in to AAHeapToStack, we reorganize AAHeapToStack and the state we keep for each malloc-like call. The result is also less confusing as we only track malloc-like calls, not all calls. Further, we only perform the updates necessary for a malloc-like to argue it can go to the stack, e.g., we won't check all uses if we moved on to the "must-be-freed" argument. This patch also uses Attributor helps to simplify the allocated size, alignment, and the potentially freed objects. Overall, this is mostly a reorganization and only the use of the optimistic helpers should change (=improve) the capabilities a bit. Differential Revision: https://reviews.llvm.org/D104993
-
Johannes Doerfert authored
We have to be careful when we replace values to not use a non-dominating instruction. It makes sense that simplification offers those as "simplified values" but we can't manifest them in the IR without PHI nodes. In the future we should consider potentially adding those PHI nodes.
-
David Green authored
-
Johannes Doerfert authored
We should use AAValueSimplify for all value simplification, however there was some leftover logic that predates AAValueSimplify in AAReturnedValues. This remove the AAReturnedValues part and provides a replacement by making AAValueSimplifyReturned strong enough to handle all previously covered cases. Further, this improve AAValueSimplifyCallSiteReturned to handle returned arguments. AAReturnedValues is now much easier and the collected returned values/instructions are now from the associated function only, making it much more sane. We also do not have the brittle logic anymore that looks for unresolved calls. Instead, we use AAValueSimplify to handle recursion. Useful code has been split into helper functions, e.g., an Attributor interface to get a simplified value. Differential Revision: https://reviews.llvm.org/D103860
-
Johannes Doerfert authored
As the `llvm::getUnderlyingObjects` helper, the optimistic version collects objects that might be the base of a given pointer. In contrast to the llvm variant, the optimistic one will use assumed information, e.g., about select conditions or dead blocks, to provide a more precise result. Differential Revision: https://reviews.llvm.org/D103859
-
Johannes Doerfert authored
Not all attributes are able to handle the interprocedural step and follow the uses into a call site. Let them be able to combine call site uses instead. This might result in some unused values/arguments being leftover but it removes problems where we misused "is dead" even though it was actually "is simplified/replaced". We explicitly check for dead values due to constant propagation in `AAIsDeadValueImpl::areAllUsesAssumedDead` instead. Differential Revision: https://reviews.llvm.org/D103858
-
Nico Weber authored
Broke check-clang, see https://reviews.llvm.org/D102307#2869065 Ran `git revert -n ebbe149a..269416d4`
-
Vassil Vassilev authored
This reverts commit 3ec88ca6 which reverted e386871e due to a asan build failure. This patch removes the new lines in the test case which seem to introduce the failure. Differential revision: https://reviews.llvm.org/D104898
-
Nico Weber authored
This reverts commit 04c203e3. Test fails on Windows.
-
Johannes Doerfert authored
As with other Attributor interfaces we often want to know if assumed information was used to answer a query. This is important if only known information is allowed or if known information can lead to an early fixpoint. The users have been adjusted but none of them utilizes the new information yet.
-
Johannes Doerfert authored
In the spirit of TRegions [0], this patch analyzes a kernel and tracks if it can be executed in SPMD-mode. If so, we flip the arguments of the __kmpc_target_init and deinit call to enable the mode. We also update the `<kernel>_exec_mode` flag to indicate to the runtime we changed the mode to SPMD. The code analysis is done interprocedurally by extending the AAKernelInfo abstract attribute to track SPMD compatibility as well. [0] https://link.springer.com/chapter/10.1007/978-3-030-28596-8_11 Differential Revision: https://reviews.llvm.org/D102307
-
Johannes Doerfert authored
We had multiple functions to determine the execution mode (SPMD/Generic) and runtime status (initialized/uninitialized) but that just increased complexity without a real benefit. Especially with D102307 in mind it is helpful to reduce the dependence on the `ident_t` flags. Differential Revision: https://reviews.llvm.org/D105586
-
Johannes Doerfert authored
When we talk to outside analyse, e.g., LVI and ScalarEvolution, we need to be careful with the query. The particular error occurred because we folded a PHI node before the LVI query but the context location was now not dominated by the value anymore. This is not supported by LVI so we have to filter these situations before we query the outside analyses.
-
Johannes Doerfert authored
We have to be careful when we replace values to not use a non-dominating instruction. It makes sense that simplification offers those as "simplified values" but we can't manifest them in the IR without PHI nodes. In the future we should consider potentially adding those PHI nodes.
-
Johannes Doerfert authored
In the spirit of TRegions [0], this patch creates a custom state machine for a generic target region based on the potentially called parallel regions. The code analysis is done interprocedurally via an abstract attribute (AAKernelInfo). All outermost parallel regions are collected and we check if there might be unknown outermost parallel regions for which we need an indirect call. Other AAKernelInfo extensions are expected. [0] https://link.springer.com/chapter/10.1007/978-3-030-28596-8_11 Differential Revision: https://reviews.llvm.org/D101977
-
Johannes Doerfert authored
In the spirit of TRegions [0], this patch provides a simpler and uniform interface for a kernel to set up the device runtime. The OMPIRBuilder is used for reuse in Flang. A custom state machine will be generated in the follow up patch. The "surplus" threads of the "master warp" will not exit early anymore so we need to use non-aligned barriers. The new runtime will not have an extra warp but also require these non-aligned barriers. [0] https://link.springer.com/chapter/10.1007/978-3-030-28596-8_11 This was in parts extracted from D59319. Reviewed By: ABataev, JonChesterfield Differential Revision: https://reviews.llvm.org/D101976
-
Johannes Doerfert authored
If we can simplify the select condition we can avoid one value in the traversal. Differential Revision: https://reviews.llvm.org/D103861
-
Johannes Doerfert authored
In order to simplify future extensions, e.g., the merge of AAHeapToShared in to AAHeapToStack, we reorganize AAHeapToStack and the state we keep for each malloc-like call. The result is also less confusing as we only track malloc-like calls, not all calls. Further, we only perform the updates necessary for a malloc-like to argue it can go to the stack, e.g., we won't check all uses if we moved on to the "must-be-freed" argument. This patch also uses Attributor helps to simplify the allocated size, alignment, and the potentially freed objects. Overall, this is mostly a reorganization and only the use of the optimistic helpers should change (=improve) the capabilities a bit. Differential Revision: https://reviews.llvm.org/D104993
-
Johannes Doerfert authored
We should use AAValueSimplify for all value simplification, however there was some leftover logic that predates AAValueSimplify in AAReturnedValues. This remove the AAReturnedValues part and provides a replacement by making AAValueSimplifyReturned strong enough to handle all previously covered cases. Further, this improve AAValueSimplifyCallSiteReturned to handle returned arguments. AAReturnedValues is now much easier and the collected returned values/instructions are now from the associated function only, making it much more sane. We also do not have the brittle logic anymore that looks for unresolved calls. Instead, we use AAValueSimplify to handle recursion. Useful code has been split into helper functions, e.g., an Attributor interface to get a simplified value. Differential Revision: https://reviews.llvm.org/D103860
-
Johannes Doerfert authored
As the `llvm::getUnderlyingObjects` helper, the optimistic version collects objects that might be the base of a given pointer. In contrast to the llvm variant, the optimistic one will use assumed information, e.g., about select conditions or dead blocks, to provide a more precise result. Differential Revision: https://reviews.llvm.org/D103859
-
Johannes Doerfert authored
Not all attributes are able to handle the interprocedural step and follow the uses into a call site. Let them be able to combine call site uses instead. This might result in some unused values/arguments being leftover but it removes problems where we misused "is dead" even though it was actually "is simplified/replaced". We explicitly check for dead values due to constant propagation in `AAIsDeadValueImpl::areAllUsesAssumedDead` instead. Differential Revision: https://reviews.llvm.org/D103858
-
Itai Zukerman authored
Depends On D105300 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D105301
-
Itai Zukerman authored
This enables checking the printing flags when formatting names in SSANameState. Depends On D105299 Reviewed By: mehdi_amini, bondhugula Differential Revision: https://reviews.llvm.org/D105300
-
Itai Zukerman authored
`interfaces` is passed through to the `numberValuesIn*` functions with exactly the same value as when SSANameState is constructed. This just seems cleaner. Also, a dependent PR adds `printerFlags` which follows similar code paths. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D105299
-
Joel E. Denny authored
This patch is an attempt to do for `targetDataBegin` what D104924 does for `targetDataEnd`: * Eliminates a lock/unlock of the data mapping table. * Clarifies the logic that determines whether a struct member's host-to-device transfer occurs. The old logic, which checks the parent struct's reference count, is a leftover from back when we had a different map interface (as pointed out at <https://reviews.llvm.org/D104924#2846972>). Additionally, it eliminates the `DeviceTy::getMapEntryRefCnt`, which is no longer used after this patch. While D104924 does not change the computation of `IsLast`, I found I needed to change the computation of `IsNew` for this patch. As far as I can tell, the change is correct, and this patch does not cause any additional `openmp` tests to fail. However, I'm not sure I've thought of all use cases. Please advise. Reviewed By: jdoerfert, jhuber6, protze.joachim, tianshilei1992, grokos, RaviNarayanaswamy Differential Revision: https://reviews.llvm.org/D105121
-
Joel E. Denny authored
The patch has the following benefits: * Eliminates a lock/unlock of the data mapping table. * Clarifies the logic that determines whether a struct member's device-to-host transfer occurs. The old logic, which checks the parent struct's reference count, is a leftover from back when we had a different map interface (as pointed out at <https://reviews.llvm.org/D104924#2846972>). Reviewed By: grokos Differential Revision: https://reviews.llvm.org/D104924
-