- Sep 03, 2021
-
-
Nikita Popov authored
This is a followup to D104662 to generate slightly nicer code for pointer overflow checks. Bypass expandAddToGEP and instead explicitly generate i8 GEPs. This saves some bitcasts and negates the value in a more obvious way. In particular, this prevents SCEV from looking through the umul.with.overflow, same as in the integer case. The wrapping-pointer-ni.ll test deserves a comment: Previously, this generated a typed GEP which used the umulo argument rather than the multiplication result. This results in more compact IR in that case, but effectively does the multiplication twice, the second one is just hidden in the GEP. Reusing the umulo result seems pretty reasonable to me. Differential Revision: https://reviews.llvm.org/D109093
-
Sam Clegg authored
Other platforms all use CamelCase as normal for these wrapper nodes. Differential Revision: https://reviews.llvm.org/D109172
-
Heejin Ahn authored
This add support for SjLj using Wasm exception handling instructions: https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md This does not yet support the mixed use of EH and SjLj within a function. It will be added in a follow-up CL. This currently passes all SjLj Emscripten tests for wasm0/1/2/3/s, except for the below: - `test_longjmp_standalone`: Uses Node - `test_dlfcn_longjmp`: Uses NodeRAWFS - `test_longjmp_throw`: Mixes EH and SjLj - `test_exceptions_longjmp1`: Mixes EH and SjLj - `test_exceptions_longjmp2`: Mixes EH and SjLj - `test_exceptions_longjmp3`: Mixes EH and SjLj Reviewed By: dschuff, tlively Differential Revision: https://reviews.llvm.org/D108960
-
Nick Desaulniers authored
Similar to D108842 and D108844. __has_builtin(builtin_mul_overflow) returns true for 32b MIPS targets, but Clang is deferring to compiler RT when encountering long long types. This breaks MIPS malta_defconfig builds of the Linux kernel that are using __builtin_mul_overflow with these types for these targets. If the semantics of __has_builtin mean "the compiler resolves these, always" then we shouldn't conditionally emit a libcall. This will still need to be worked around in the Linux kernel in order to continue to support malta_defconfig builds of the Linux kernel for this target with older releases of clang. Link: https://bugs.llvm.org/show_bug.cgi?id=28629 Link: https://github.com/ClangBuiltLinux/linux/issues/1438 Reviewed By: rengolin Differential Revision: https://reviews.llvm.org/D108926
-
Daniil Suchkov authored
This patch introduces four new string attributes: function-inline-cost, function-inline-threshold, call-inline-cost and call-threshold-bonus. These attributes allow you to selectively override some aspects of InlineCost analysis. That would allow us to test inliner separately from the InlineCost analysis. That could be useful when you're trying to write tests for inliner and you need to test some very specific situation, like "the inline cost has to be this high", or "the threshold has to be this low". Right now every time someone does that, they have get creative to come up with a way to make the InlineCost give them the number they need (like adding ~30 load/add pairs for a trivial test). This process can be somewhat tedious which can discourage some people from writing enough tests for their changes. Also, that results in tests that are fragile and can be easily broken without anyone noticing it because the test writer can't explicitly control what input the inliner will get from the inline cost analysis. These new attributes will alleviate those problems to an extent. Reviewed By: mtrofin Differential Revision: https://reviews.llvm.org/D109033
-
Geoffrey Martin-Noble authored
Differential Revision: https://reviews.llvm.org/D109173
-
Jake Egan authored
%%% This patch defines the macros __powerpc and __PPC on AIX to be consistent with XL for AIX. See: https://www.ibm.com/docs/en/xl-c-and-cpp-aix/13.1.0?topic=macros-related-platform Note: GCC does not currently define __powerpc and __PPC so users should prefer the __powerpc__ and __PPC__ forms. %%% Reviewed By: cebowleratibm Differential Revision: https://reviews.llvm.org/D108917
-
Mark de Wever authored
Removed as suggested by @Quuxplusone during the review of D109075.
-
Craig Topper authored
https://reviews.llvm.org/D56686 was supposed to allow these to work on Windows without needing to enable the xsave feature to match MSVC. It seems this didn't work because the backend isel patterns would still block it. This patch removes the predicates from the isel patterns. Fixes PR51706. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D109097
-
Mark de Wever authored
D103357 added some new concepts. Since the header `<concepts>` has moved all its concepts to a separate header these new concepts feel out of place. Move them to the appropriate header. Reviewed By: #libc, Quuxplusone, ldionne Differential Revision: https://reviews.llvm.org/D109075
-
Evandro Menezes authored
Restore test for shrink wrapping disabled.
-
Jon Chesterfield authored
-
Geoffrey Martin-Noble authored
Update the Bazel build for https://github.com/llvm/llvm-project/commit/2f0750dd2e. Differential Revision: https://reviews.llvm.org/D109171
-
Louis Dionne authored
Those don't provide a lot of value, and they can easily be wrong anyway. Differential Revision: https://reviews.llvm.org/D109087
-
Louis Dionne authored
Differential Revision: https://reviews.llvm.org/D109121
-
Hans Wennborg authored
Follow-up to f5b997e6, see comment on https://reviews.llvm.org/D109047 Differential revision: https://reviews.llvm.org/D109168
-
Marius Brehler authored
-
Stanislav Mekhanoshin authored
These can be used for reversed conditions if result of the AND is unused except in the compare: s_cmp_eq_u32 (s_and_b32 $src, 1), 0 => s_bitcmp0_b32 $src, 0 s_cmp_eq_i32 (s_and_b32 $src, 1), 0 => s_bitcmp0_b32 $src, 0 s_cmp_eq_u64 (s_and_b64 $src, 1), 0 => s_bitcmp0_b64 $src, 0 s_cmp_lg_u32 (s_and_b32 $src, 1), 1 => s_bitcmp0_b32 $src, 0 s_cmp_lg_i32 (s_and_b32 $src, 1), 1 => s_bitcmp0_b32 $src, 0 s_cmp_lg_u64 (s_and_b64 $src, 1), 1 => s_bitcmp0_b64 $src, 0 Differential Revision: https://reviews.llvm.org/D109099
-
Simon Pilgrim authored
PMADDWD(v8i16 x, v8i16 y) == (v4i32) { (int)x[0]*y[0] + (int)x[1]*y[1], ..., (int)x[6]*y[6] + (int)x[7]*y[7] } Currently combineMulToPMADDWD only folds cases where the upper 17 bits of both vXi32 inputs are known zero (i.e. the first half is positive and the second half of the pair is zero in each 2xi16 pair), this can be relaxed to only require one zero-extended input if the other input has at least 17 sign bits. That way the sign of the result is still preserved, and the second half is still zero. Noticed while investigating PR47437. Differential Revision: https://reviews.llvm.org/D108522 -
Nico Weber authored
When using __readfsdword(), clang used to warn that one has to include <intrin.h> -- no matter if that was already included or not. Now it only warns if it's not yet included. To verify that this was the only intrin with this problem, I ran: $ for f in $(grep intrin.h clang/include/clang/Basic/BuiltinsX86* | egrep -o '\([^,]+,' | egrep -o '[^(,]*'); do if ! grep -q $f clang/lib/Headers/intrin.h; then echo $f; fi; done This printed 9 more functions, but those are all in emmintrin.h, xsaveintrin.h (which are included by intrin.h based on /arch: flags). So this is indeed the only built-in that was missing in intrin.h. Fixes PR51188. Differential Revision: https://reviews.llvm.org/D109085 -
Wenlei He authored
This change improves the warning for truncated context by: 1) deduplicate them as one call without probe can appear in many different context leading to duplicated warnings , 2) rephrase the message to make it easier to understand. The term "untracked frame" can be confusing. Differential Revision: https://reviews.llvm.org/D109115
-
Kazu Hirata authored
Identified with readability-redundant-string-cstr.
-
Nico Weber authored
Apparently some versions of the MS STL don't like constructing a vector from a StringMapKeyIterator<>: http://45.33.8.238/win/44999/step_4.txt It builds fine with the MS STL on my Windows box, so just sidestep the issue. Full error for posterity: VC\Tools\MSVC\14.14.26428\include\xmemory(218,75): error: indirection requires pointer operand ('const llvm::StringMapKeyIterator<llvm::StringRef>' invalid) _Uses_default_construct_t<_Alloc, decltype(_Unfancy(_UDest)), decltype(*_UFirst)>()))); VC\Tools\MSVC\14.14.26428\include\vector(1922,11): note: in instantiation of function template specialization 'std::_Uninitialized_copy<...>' requested here return (_Uninitialized_copy(_First, _Last, _Dest, this->_Getal())); VC\Tools\MSVC\14.14.26428\include\vector(757,22): note: in instantiation of function template specialization 'std::vector<llvm::StringRef>::_Ucopy<llvm::StringMapKeyIterator<llvm::StringRef>>' requested here this->_Mylast() = _Ucopy(_First, _Last, this->_Myfirst()); VC\Tools\MSVC\14.14.26428\include\vector(772,3): note: in instantiation of function template specialization 'std::vector<llvm::StringRef>::_Range_construct_or_tidy<llvm::StringMapKeyIterator<llvm::StringRef>>' requested here _Range_construct_or_tidy(_Unchecked(_First), _Unchecked(_Last), _Iter_cat_t<_Iter>{}); ../../clang/lib/Driver/ToolChains/Arch/X86.cpp(62,30): note: in instantiation of function template specialization 'std::vector<llvm::StringRef>::vector<llvm::StringMapKeyIterator<llvm::StringRef>, void>' requested here std::vector<StringRef> ValidArchs{ArchMap.keys().begin(),
-
- Sep 02, 2021
-
-
Craig Topper authored
Zba adds a zext.w pseudoinstruction using ADDUW. This can simplify the generated code for many of these tests. There are at least 2 suboptimal cases in this config that I've marked with TODOs.
-
Craig Topper authored
These were fixed by D106230.
-
Nico Weber authored
-
Wenlei He authored
When pre-inliner decision is used for CSSPGO, we should take that into account for ThinLTO importing as well, so post-link sample loader inliner can favor that decision. This is handled by a small tweak in this patch. It also includes a change to transfer preinliner decision when merging context. Differential Revision: https://reviews.llvm.org/D109088
-
Kristóf Umann authored
Revert "[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it" This reverts commit 7d0e62bf.
-
Ivan Zhechev authored
The evaluation order for the `|` operator is undefined (in contrast to the short-circuiting `||` operator). The arguments are stored in variables to force a specific evaluation order. A test in D107575 relies on this change. Reviewed By: kiranchandramohan, klausler Differential Revision: https://reviews.llvm.org/D108623
-
Bradley Smith authored
When lowering a fixed length gather/scatter the index type is assumed to be the same as the memory type, this is incorrect in cases where the extension of the index has been folded into the addressing mode. For now add a temporary workaround to fix the codegen faults caused by this by preventing the removal of this extension. At a later date the lowering for SVE gather/scatters will be redesigned to improve the way addressing modes are handled. As a short term side effect of this change, the addressing modes generated for fixed length gather/scatters will not be optimal. Differential Revision: https://reviews.llvm.org/D109145
-
Jinsong Ji authored
-
Kristóf Umann authored
[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it D105553 added NoStateChangeFuncVisitor, an abstract class to aid in creating notes such as "Returning without writing to 'x'", or "Returning without changing the ownership status of allocated memory". Its clients need to define, among other things, what a change of state is. For code like this: f() { g(); } foo() { f(); h(); } We'd have a path in the ExplodedGraph that looks like this: -- <g> --> / \ --- <f> --------> --- <h> ---> / \ / \ -------- <foo> ------ <foo> --> When we're interested in whether f neglected to change some property, NoStateChangeFuncVisitor asks these questions: ÷×~ -- <g> --> ß / \$ @&#* --- <f> --------> --- <h> ---> / \ / \ -------- <foo> ------ <foo> --> Has anything changed in between # and *? Has anything changed in between & and *? Has anything changed in between @ and *? ... Has anything changed in between $ and *? Has anything changed in between × and ~? Has anything changed in between ÷ and ~? ... Has anything changed in between ß and *? ... This is a rather thorough line of questioning, which is why in D105819, I was only interested in whether state *right before* and *right after* a function call changed, and early returned to the CallEnter location: if (!CurrN->getLocationAs<CallEnter>()) return; Except that I made a typo, and forgot to negate the condition. So, in this patch, I'm fixing that, and under the same hood allow all clients to decide to do this whole-function check instead of the thorough one. Differential Revision: https://reviews.llvm.org/D108695 -
Craig Topper authored
If a sext_inreg is up for isel, and all its users are W instructions, we can skip emitting the sext_inreg. This helpful if the producing instruction can't become a W instruction. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D108966
-
Evandro Menezes authored
Differential Revision: https://reviews.llvm.org/D109037
-
Craig Topper authored
X0 has special meaning for vsetvli, we need to make sure we never create it a vsetvli that uses it by accident. This could happen if the register coalescer coalesces a copy from X0 into this instruction. This patch splits the instruction so that we can have GPRNoX0 register class to use for the cases where we don't want the source to be X0. The verifier won't let us explicitly use X0 on a GPRNoX0 operand so we need a separate pseudo for those cases. I don't currently have a failing example for this. There was a failure in D107957, but the coalescable copy from that example should have been optimized away much earlier so I've fixed that. This is not a complete fix. We still need to prevent the same possible issue on the AVL operand of all of the vector instruction pseudos. I don't want to make two versions of all of those so we need to find a different solution for those. I have an idea I'm going to try. Differential Revision: https://reviews.llvm.org/D109110
-
Nico Weber authored
Now prints the list of known archs. This requires plumbing a Driver arg through a few functions. Also add two more convenience insert() overlods to StringMap. Differential Revision: https://reviews.llvm.org/D109105
-
Kiran Chandramohan authored
Add an operation omp.critical.declare to declare names/symbols of critical sections. Named omp.critical operations should use symbols declared by omp.critical.declare. Having a declare operation ensures that the names of critical sections are global and unique. In the lowering flow to LLVM IR, the OpenMP IRBuilder creates unique names for critical sections. Reviewed By: ftynse, jeanPerier Differential Revision: https://reviews.llvm.org/D108713
-
Piotr Sobczak authored
Extend SILoadStoreOptimizer to merge into DWORDX8 variant of S_BUFFER_LOAD. Merging into DWORDX2 and DWORDX4 variants is handled already. Differential Revision: https://reviews.llvm.org/D108909
-
Marius Brehler authored
This upstreams the Cpp emitter, initially presented with [1], from [2] to MLIR core. Together with the previously upstreamed EmitC dialect [3], the target allows to translate MLIR to C/C++. [1] https://reviews.llvm.org/D76571 [2] https://github.com/iml130/mlir-emitc [3] https://reviews.llvm.org/D103969 Co-authored-by:
Jacques Pienaar <jpienaar@google.com> Co-authored-by:
Simon Camphausen <simon.camphausen@iml.fraunhofer.de> Co-authored-by:
Oliver Scherf <oliver.scherf@iml.fraunhofer.de> Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D104632
-
Alex Zinenko authored
Use the recently introduced OpenMPIRBuilder facility to transate OpenMP workshare loops with reductions to LLVM IR calling OpenMP runtime. Most of the heavy lifting is done at the OpenMPIRBuilder. When other OpenMP dialect constructs grow support for reductions, the translation can be updated to operate on, e.g., an operation interface for all reduction containers instead of workshare loops specifically. Designing such a generic translation for the single operation that currently supports reductions is premature since we don't know how the reduction modeling itself will be generalized. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D107343
-