- Jul 11, 2021
-
-
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
-
- Jul 10, 2021
-
-
Kazu Hirata authored
This patch fixes a testcase failure by requring x86_64-linux in a testcase.
-
Simon Pilgrim authored
Also, add matching i686 coverage to strict-fadd-combines.ll and regenerate checks.
-
Andrea Di Biagio authored
This patch addresses the last remaining problems reported in PR51008. Previous fixes for PR51008 worked under the wrong assumption that code regions are always named (except maybe for the default region, which was automatically named "main"). In reality, it is quite common for users to declare multiple anonymous regions. So we cannot really use the region name as the key string of a JSON object. In practice, code region names are completely optional. Using "main" for the default region was also problematic because there can be another region with that same name. This patch fixes these issues by introducing a json::array of regions. Each region has a "Name" field, which would default to the empty string for anonymous regions. Added a few more tests to verify that the JSON file format is still valid, and that multiple anonymous regions all appear in the final output.
-
Andrea Di Biagio authored
This patch renames object "Resources" to "TargetInfo". Moved the getJSONTargetInfo method from class InstructionView to the PipelinePrinter. Removed uses of std::stringstream. Removed unused method View::printViewJSON().
-
Sander de Smalen authored
Instead of performing the isMoreProfitable() operation on InstructionCost::CostTy the operation is performed on InstructionCost directly, so that it can handle the case where one of the costs is Invalid. This patch also changes the CostTy to be int64_t, so that the type is wide enough to deal with multiplications with e.g. `unsigned MaxTripCount`. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D105113
-
Sander de Smalen authored
This patch makes the operations on InstructionCost saturate, so that when costs are accumulated they saturate to <max value>. One of the compelling reasons for wanting to have saturation support is because in various places, arbitrary values are used to represent a 'high' cost, but when accumulating the cost of some set of operations or a loop, overflow is not taken into account, which may lead to unexpected results. By defining the operations to saturate, we can express the cost of something 'very expensive' as InstructionCost::getMax(). Reviewed By: kparzysz, dmgreen Differential Revision: https://reviews.llvm.org/D105108
-
Martin Storsjö authored
This reverts commit 9a9bc76c. That commit broke "ninja install" when building compiler-rt for mingw targets, building standalone (pointing cmake at the compiler-rt directory) with cmake 3.16.3 (the one shipped in ubuntu 20.04), with errors like this: -- Install configuration: "Release" CMake Error at cmake_install.cmake:44 (file): file cannot create directory: /include/sanitizer. Maybe need administrative privileges. Call Stack (most recent call first): /home/martin/code/llvm-mingw/src/llvm-project/compiler-rt/build-i686-sanitizers/cmake_install.cmake:37 (include) FAILED: include/CMakeFiles/install-compiler-rt-headers cd /home/martin/code/llvm-mingw/src/llvm-project/compiler-rt/build-i686-sanitizers/include && /usr/bin/cmake -DCMAKE_INSTALL_COMPONENT="compiler-rt-headers" -P /home/martin/code/llvm-mingw/src/llvm-project/compiler-rt/build-i686-sanitizers/cmake_install.cmake ninja: build stopped: subcommand failed.
-
Amara Emerson authored
Differential Revision: https://reviews.llvm.org/D103301
-
Eli Friedman authored
-
Amara Emerson authored
[GlobalISel] Add a new artifact combiner for unmerge which looks through general artifact expressions. The original motivation for this was to implement moreElementsVector of shuffles on AArch64, which resulted in complex sequences of artifacts like unmerge(unmerge(concat...)) which the combiner couldn't handle. It seemed here that the better option, instead of writing ever-more-complex combines, was to have a way to find the original "non-artifact" source registers for a given definition, walking through arbitrary expressions of unmerge/concat/insert. As long as the bits aren't extended or truncated, this is a pretty simple algorithm that avoids the need for lots of combines and instead jumps straight to the final result we want. I've only used this new technique in 2 places within tryCombineUnmerge, using it in more general situations resulted in infinite loops in AMDGPU. So for now it's used when we would otherwise fail to combine and that seems to work. In order to support looking through G_INSERTs, I also had to add it as an artifact in isArtifact(), which caused a whole lot of issues in tests. AMDGPU started infinite looping since full legalization of G_INSERT doensn't seem to be there. To work around this, I've temporarily added a CLI option to use the old behaviour so that the MIR tests will still run and terminate. Other minor changes include no longer making >128b G_MERGE/UNMERGE legal. We never had isel support for that anyway and it was a remnant of the legacy legalizer rules. However being legal prevented the combiner from checking if it was dead and deleting them. Differential Revision: https://reviews.llvm.org/D104355
-
Lang Hames authored
Renames CommonOrcRuntimeTypes.h to ExecutorAddress.h and moves ExecutorAddress into the 'orc' namespace (rather than orc::shared). Also makes ExecutorAddress a class, adds an ExecutorAddrDiff type and some arithmetic operations on the pair (subtracting two addresses yields an addrdiff, adding an addrdiff and an address yields an address).
-
Vy Nguyen authored
Two changess: - Drop assertions that all symbols are in GOT - Set allEntriesAreOmitted correctly Related bug: 50812 Differential Revision: https://reviews.llvm.org/D105364
-
Thomas Lively authored
Replace the clang builtin function and LLVM intrinsic previously used to select the f64x2.promote_low_f32x4 instruction with custom combines from standard SelectionDAG nodes. Implement the new combines to share code with the similar combines for f64x2.convert_low_i32x4_{s,u}. Resolves PR50232. Differential Revision: https://reviews.llvm.org/D105675 -
David Blaikie authored
A followup to the feature added in 69da27c7 that added the optional "start file name" to match "start line" - but this didn't work with Split DWARF because of the need for the decl file number resolution code to refer back to the skeleton unit to find its .debug_line contribution. So this patch adds the necessary infrastructure to track the skeleton unit corresponding to a split full unit for the purpose of this lookup.
-
Eli Friedman authored
Apparently ScalarEvolution::isImpliedCond tries to truncate a pointer in some obscure cases. Guard the code with a check for pointers.
-
Vitaly Buka authored
This makes sure we have support for MTE instructions. Later the check can be extended to support MTE on other compilers. Reviewed By: pcc Differential Revision: https://reviews.llvm.org/D105722
-
Eli Friedman authored
Rules: 1. SCEVUnknown is a pointer if and only if the LLVM IR value is a pointer. 2. SCEVPtrToInt is never a pointer. 3. If any other SCEV expression has no pointer operands, the result is an integer. 4. If a SCEVAddExpr has exactly one pointer operand, the result is a pointer. 5. If a SCEVAddRecExpr's first operand is a pointer, and it has no other pointer operands, the result is a pointer. 6. If every operand of a SCEVMinMaxExpr is a pointer, the result is a pointer. 7. Otherwise, the SCEV expression is invalid. I'm not sure how useful rule 6 is in practice. If we exclude it, we can guarantee that ScalarEvolution::getPointerBase always returns a SCEVUnknown, which might be a helpful property. Anyway, I'll leave that for a followup. This is basically mop-up at this point; all the changes with significant functional effects have landed. Some of the remaining changes could be split off, but I don't see much point. Differential Revision: https://reviews.llvm.org/D105510
-
Valery N Dmitriev authored
Differential Revision: https://reviews.llvm.org/D105752
-
Derek Schuff authored
This fix goes along with d1a96e90 and makes the fp128 alignment match clang's long double alignment. Differential Revision: https://reviews.llvm.org/D105749
-
Uday Bondhugula authored
Fix/improve documentation for wmma load/store matrix ops. Fix some broken and stale sentences. Differential Revision: https://reviews.llvm.org/D105678
-
Kazu Hirata authored
This patch teaches the sample profile loader to merge function attributes after inlining functions. Without this patch, the compiler could inline a function requiring the 512-bit vector width into its caller without merging function attributes, triggering a failure during instruction selection. Differential Revision: https://reviews.llvm.org/D105729
-
Kazu Hirata authored
-
Nico Weber authored
-
Fangrui Song authored
-
Andrea Di Biagio authored
Moved most of the printing logic into the PipelinePrinter. This patch also fixes the JSON output when flag -instruction-tables is specified.
-