- Sep 22, 2021
-
-
Teresa Johnson authored
When setting the report path, recursively create the directory as needed. This brings the profile path support for memprof on par with normal PGO. The code was largely cloned from __llvm_profile_recursive_mkdir in compiler-rt/lib/profile/InstrProfilingUtil.c. Differential Revision: https://reviews.llvm.org/D109794
-
Toshihito Kikuchi authored
To intercept the functions in Win11's ntdll.dll, we need to use the trampoline technique because there are bytes other than 0x90 or 0xcc in the gaps between exported functions. This patch adds more patterns that appear in ntdll's functions. Bug: https://bugs.llvm.org/show_bug.cgi?id=51721 Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D109941
-
Usman Nadeem authored
Differential Revision: https://reviews.llvm.org/D109665 Change-Id: I9d2928688b80b804a16f52928e2057749ec2c0b2
-
Yuanfang Chen authored
The idiom helps with parameter unpacking so the return value is not important. Make it explicit.
-
Arthur Eubanks authored
And always print it. This makes some LLVM diagnostics match up better with Clang's diagnostics. Updated some AMDGPU uses of DiagnosticInfoResourceLimit and now we print better diagnostics for those. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D110204
-
Kirill Stoimenov authored
[asan] Fixed a bug causing a crash when redzone optimization kicked in on X86 with -asan-optimize-callbacks flag on. This change adds the ASan intrinsic to the list whihc are setting hasCopyImplyingStackAdjustment. Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D110012
-
Alex Zinenko authored
Previously, the translation to LLVM IR would emit IR that directly uses a scope metadata node in case only one scope was in use in alias.scopes or noalias metadata. It should always be a list of scopes. The verifier change in 8700f2bd enforced this and broke the test. Fix the translation to always create a list of scopes using a new metadata node, update and reenable the respective test. Fixes PR51919. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D110140
-
Craig Topper authored
This time with the right bug number. When we rewrite the setcc we replace set old setcc output register with the new CondReg. But since CondReg can be shared by other replacements, we don't know if the kill flags for the old register are valid for CondReg. So be conservative and remove them. The test case has a SETCCr and a SETCCm on the same condition so they end up sharing the same CondReg. The SETCCr had one use with a kill flag. This kill flag isn't valid after the replacement because CondReg needs a live range extending to the later SETCCm replacment. Fixes PR51903.
-
Xu Mingjie authored
Currently, the dead functions information getting from optimizations remarks does not contain debug location, but knowing where these dead functions locate could be useful for debugging or for detecting dead code. Cause in `LTO::addRegularLTO()` we use `BitcodeModule::getLazyModule()` to read the bitcode module, when we pass Function F to `ore::NV()`, F is not materialized, so `F->getSubprogram()` returns nullptr, and there is no debug location information of dead functions in optimizations remarks. This patch call `F->materialize()` before we pass Function F to `ore::NV()`, then debug location information will be emitted for dead functions in optimization remarks. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D109737
-
Joseph Huber authored
The new device runtime library currently lacks the `kmpc_get_hardware_thread_id_in_block` function which is currently used when doing the SPMDzation optimization. This call would be introduced through the optimization and then cause a linking error because it was not present. This patch adds support for this runtime call. Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D110195
-
Arthur Eubanks authored
Previously with -Rpass (and friends) we'd have remarks "enabled", but without an actual regex. As seen in the test change to line numbers, this can give us better diagnostics by properly enabling NeedLocTracking with -Rpass. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D110201
-
Craig Topper authored
This reverts commit 7550f146. I botched the bug number.
-
Craig Topper authored
When we rewrite the setcc we replace set old setcc output register with the new CondReg. But since CondReg can be shared by other replacements, we don't know if the kill flags for the old register are valid for CondReg. So be conservative and remove them. The test case has a SETCCr and a SETCCm on the same condition so they end up sharing the same CondReg. The SETCCr had one use with a kill flag. This kill flag isn't valid after the replacement because CondReg needs a live range extending to the later SETCCm replacment. Fixes PR51908. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D110046
-
Albion Fung authored
This patch implements support for the type vector bool int128 for arguments on vector comparison builtins listed below, which would otherwise crash due to ambiguity. The following builtins are added: vec_all_eq (vector bool __int128, vector bool __int128) vec_all_ne (vector bool __int128, vector bool __int128) vec_any_eq (vector bool __int128, vector bool __int128) vec_any_ne (vector bool __int128, vector bool __int128) vec_cmpne(vector bool __int128 a, vector bool __int128 b) vec_cmpeq(vector bool __int128 a, vector bool __int128 b) Differential revision: https://reviews.llvm.org/D110084
-
Sanjay Patel authored
This broke with 2f6b0731 because it wrongly runs the entire LLVM optimizer.
-
George Burgess IV authored
This comment references behavior that was removed in ccae43a2, which is a commit from 5 years ago. It seems safe to assume that that behavior won't be coming back soon. If it does, we can readd this part of the comment :)
-
Giorgis Georgakoudis authored
This reverts commit 1d66649a. Revert to fix AMG GPU issue.
-
Arthur O'Dwyer authored
Neither the current C++2b draft, nor any revision of [p1135], nor libstdc++, claims that `counting_semaphore` should be default-constructible. I think this was just a copy-paste issue somehow. Also, `explicit` was missing from the constructor. Also, `constexpr` remains missing; but that's probably more of a technical limitation, since apparently there are some platforms where we don't (can't??) use the atomic implementation and have to rely on pthreads, which obviously isn't constexpr. Differential Revision: https://reviews.llvm.org/D110042
-
Sanjay Patel authored
(masked) trunc (lshr X, C) --> (masked) lshr (trunc X), C Narrowing the shift should be better for analysis and can lead to follow-on transforms as shown. Attempt at a general proof in Alive2: https://alive2.llvm.org/ce/z/tRnnSF Here are a couple of the specific tests: https://alive2.llvm.org/ce/z/bCnTp- https://alive2.llvm.org/ce/z/TfaHnb Differential Revision: https://reviews.llvm.org/D110170
-
Antonio Frighetto authored
A logic incompleteness may lead MemorySSA to be too conservative in its results. Specifically, when dealing with a call of kind `call i32 bitcast (i1 (i1)* @test to i32 (i32)*)(i32 %1)`, where the function `test` is declared with readonly attribute, the bitcast is not looked through, obscuring function attributes. Hence, some methods of CallBase (e.g., doesNotReadMemory) could provide suboptimal results. Differential Revision: https://reviews.llvm.org/D109888
-
Usman Nadeem authored
Differential Revision: https://reviews.llvm.org/D110120 Change-Id: I9d39dacfab5b7fbab37ee4b4d960d51e0892b24d
-
Nikita Popov authored
-
Matheus Izvekov authored
See PR51862. The consumers of the Elidable flag in CXXConstructExpr assume that an elidable construction just goes through a single copy/move construction, so that the source object is immediately passed as an argument and is the same type as the parameter itself. With the implementation of P2266 and after some adjustments to the implementation of P1825, we started (correctly, as per standard) allowing more cases where the copy initialization goes through user defined conversions. With this patch we stop using this flag in NRVO contexts, to preserve code that relies on that assumption. This causes no known functional changes, we just stop firing some asserts in a cople of included test cases. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D109800
-
Dan F-M authored
In attempting to build JAX on Apple Silicon, we discovered an issue with the bazel configuration in llvm-project-overlay. This patch fixes the logic, at least when building JAX. More context is included on the following GitHub issue: https://github.com/google/jax/issues/5501 Differential Revision: https://reviews.llvm.org/D109839
-
Nikita Popov authored
MergeICmps will currently sort (by offset) all comparisons in a chain, including those that do not get merged. This is problematic in two ways: * We may end up moving the original first block into the middle of the chain, in which case the "extra work" instructions will also be in the middle of the chain, resulting in invalid IR (reported in https://reviews.llvm.org/D108782#3005583). * Reordering branches is generally not legal, because it may introduce branch on poison, which is UB (PR51845). The merging done by MergeICmps is legal as long as we assume that memcmp() works on frozen memory, but the reordering of unmerged comparisons is definitely incorrect (without inserting freeze instructions), so we should avoid it. There are easier ways to fix the first issue, but I figured it was worthwhile to do this properly to also fix the second one. What we now do is to restore the original relative order of (potentially merged) comparisons. I took the liberty of dropping the MERGEICMPS_DOT_ON functionality, because it would be more awkward to implement now (as the before and after representation is different) and it doesn't seem terribly useful nowadays. Differential Revision: https://reviews.llvm.org/D110024
-
David Blaikie authored
-
Christian Sigg authored
Add a PointerProxy similar to the existing iterator_facade_base::ReferenceProxy and return it from the arrow operator. This prevents iterator facades with a reference type that is not a true reference to take the address of a temporary. Forward the reference type of the mapped_iterator to the iterator adaptor which in turn forwards it to the iterator facade. This fixes mlir::op_iterator::operator->() to take the address of a temporary. Make some polishing changes to op_iterator and op_filter_iterator. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D109490
-
David Blaikie authored
Now that Clang's been changed to render nullptr types/template parameters as 'std::nullptr_t' do the same thing down here. (Clang commit: 131e8786 )
-
Michael Liao authored
-
David Blaikie authored
This improves diagnostic (& important to me, DWARF) accuracy - otherwise there could be ambiguities between "std::nullptr_t" and some user-defined type that's /actually/ "nullptr_t" defined in the global namespace. Differential Revision: https://reviews.llvm.org/D110044
-
alex-t authored
Normally, given that the DA results are kept consistent over the selection DAG, uniform comparisons get selected to S_CMP_* but divergent to V_CMP_*. Sometimes, for the sake of efficiency, SSA subgraphs may be converted to VALU to avoid repeatedly copying data back and forth. Hence we have to be able to sustain the correctness passing the i1 from VALU to SALU context and vice versa. VALU operations only process the active lanes of the VGPR and ignore inactive ones. Active lanes correspond to 1 bit in the EXEC mask register. SALU represents i1 as just one bit but VALU as 64bits: 0/1 and 0/(0xffffffffffffffff & EXEC) respectively. SALU uses one-bit conditional flag SCC but VALU - VCC that is a pair of 32-bit SGPRs To expose SCC to the VALU context we need to convert the one-bit boolean value to the appropriate 64bit. To return back to the SALU context we need to do the opposite. To correctly convert 64bit VALU boolean to either 0 or 1 we need to filter out the bits corresponding to the inactive lanes. Reviewed By: piotr Differential Revision: https://reviews.llvm.org/D109900
-
Owen Anderson authored
Reviewed By: majnemer Differential Revision: https://reviews.llvm.org/D109988
-
Brendon Cahoon authored
When adding alias.scope and noalias metadata to a memcpy function, the alias.scope and noalias metadata from the operands are merged. The rule for merging alias.scope is to take the intersection of the domains and the union of the scopes within those domains. The rule for merging noalias is to take the intersection. The bug is that AMDGPULowerModuleLDS was using concatenation for both alias.scope and noalias. For example, when f1 and f2 are added to the LDS structure and there is a memcpy(f2, f1, sizeof(f1)). Then, concatenation creates noalias metadata for the memcpy that includes both {f1, f2}. That means that the memcpy is assumed not to alias a prior load of f2, which enables the optimizer to remove a load of f2 that occurs after mempcy. The function MDNode::getmostGenericAliasScope defines the semantics for alias.scope. There is a function, combineMetadata in Local.cpp, that uses intersect for noalias. Differential Revision: https://reviews.llvm.org/D110049 -
Craig Topper authored
This helps the compiler generate better code.
-
Danila Malyutin authored
Fixes pr42770 Differential Revision: https://reviews.llvm.org/D108772
-
Giorgis Georgakoudis authored
Parallel regions are outlined as functions with capture variables explicitly generated as distinct parameters in the function's argument list. That complicates the fork_call interface in the OpenMP runtime: (1) the fork_call is variadic since there is a variable number of arguments to forward to the outlined function, (2) wrapping/unwrapping arguments happens in the OpenMP runtime, which is sub-optimal, has been a source of ABI bugs, and has a hardcoded limit (16) in the number of arguments, (3) forwarded arguments must cast to pointer types, which complicates debugging. This patch avoids those issues by aggregating captured arguments in a struct to pass to the fork_call. Reviewed By: jdoerfert, jhuber6 Differential Revision: https://reviews.llvm.org/D102107
-
Amy Kwan authored
This patch adds a prefixed load pattern involving v2f32 fpext v2f64, where we are dealing with a value with an offset that fits into a 34-bit signed immediate. A reduced test case is also added to patch that tests the pattern, in which the pattern is tested in the big endian CHECKs of the newly added test. Differential Revision: https://reviews.llvm.org/D109887
-
Ayal Zaks authored
This patch fixes the crash found by PR51614: whenever doing tail folding, interleave groups must be considered under mask. Another fix D108900 follows for targets that support masked loads and stores: when *deciding* to vectorize with masked interleave groups, check if the access is reverse - which is currently not supported; rather than (only) asserting when computing cost and generating code. Differential Revision: https://reviews.llvm.org/D108891
-
Craig Topper authored
This requires a minor change to CodeGenPrepare to ensure that shouldSinkOperands will be called for And. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D110106
-
Nico Weber authored
Trying to use the DIA SDK reader only to fail with "DIA SDK wasn't enabled" isn't very useful. The native PDB reader is missing some stuff, but it's still better than nothing. Reduces number of lldb-check-shell test failures with LLVM_ENABLE_DIA_SDK=NO from 27 to 15. Differential Revision: https://reviews.llvm.org/D110172
-