- Sep 03, 2021
-
-
peter klausler authored
Ticking off a Parser TODO: Preprocessor::Directive()'s Prescanner argument should be a reference, not a pointer. Differential Revision: https://reviews.llvm.org/D109094
-
Stuart Brady authored
These functions are not part of the OpenCL C specification. See https://github.com/KhronosGroup/OpenCL-Docs/issues/648 for a clarification regarding the vloada_half declarations. Reviewed By: Anastasia Differential Revision: https://reviews.llvm.org/D108761
-
Alex Zinenko authored
The translation to LLVM IR used to construct sequential constants by recurring down to individual elements, creating constant values for them, and wrapping them into aggregate constants in post-order. This is highly inefficient for large constants with known data such as DenseElementsAttr. Use LLVM's ConstantData for the innermost dimension instead. LLVM does seem to support data constants for nested sequential constants so the outer dimensions are still handled recursively. Nevertheless, this speeds up the translation of large constants with equal dimensions by up to 30x. Users are advised to rewrite large constants to use flat types before translating to LLVM IR if more efficiency in translation is necessary. This is not done automatically as the translation is not aware of the expectations of the overall compilation flow about type changes and indexing, in particular for global constants with external linkage. Reviewed By: silvas Differential Revision: https://reviews.llvm.org/D109152
-
Dávid Bolvanský authored
-
Arthur O'Dwyer authored
The `insert_iterator::iter` member is defined as `Container::iterator` but the standard requires `iter` to be defined in terms of `ranges::iterator_t` as of C++20. So, if in C++20 or later, define the `iter` member as `ranges::iterator_t`. Original patch by Joe Loser! Differential Revision: https://reviews.llvm.org/D108575
-
Arthur Eubanks authored
-
Arthur Eubanks authored
Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D109177
-
Arthur Eubanks authored
As specified by https://llvm.org/docs/LangRef.html#invariant-group-metadata. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D109182
-
Arthur Eubanks authored
To any downstream users broken by this change, please examine your uses of these methods and see if you can use a better method. For example, getAttribute(AttributeList::FunctionIndex) => getFnAttr(), or addAttribute(AttributeList::FirstArgIndex + ArgNo) => addParamAttribute(ArgNo). 0 corresponds to ReturnIndex, ~0 corresponds to FunctionIndex. This may make future cleanups less painful. I've made the mistake of assuming that these indexes are for parameters multiple times, but actually they're based off of a weird indexing scheme AttributeList::AttrIndex where 0 is the return value and ~0 is the function. Hopefully renaming these methods will make this clearer. Ideally users should use more specific methods like AttributeList::getFnAttr(). This touches all relevant methods in AttributeList, CallBase, and Function. This hopefully will make easier a future change to cleanup AttrIndex. A previous worry about cleaning up AttrIndex was that too many downstream users would have to look through all uses of AttrIndex and relevant attribute method calls to see if anything was unintentionally hardcoded (e.g. using 0 instead of ReturnIndex). With this change hopefully downstream users will look at existing usages of these methods and clean them up. Reviewed By: rnk, MaskRay Differential Revision: https://reviews.llvm.org/D108614
-
Wenlei He authored
We merge cold context by default to save profile size. However trimming cold context after merging doesn't save size much, so default to off to reflect how it's commonly used. Differential Revision: https://reviews.llvm.org/D109166
-
Arthur Eubanks authored
Differential Revision: https://reviews.llvm.org/D109180
-
Sam Clegg authored
I added this back in https://reviews.llvm.org/D54647 but it wasn't actually needed. Differential Revision: https://reviews.llvm.org/D109176
-
Nico Weber authored
-
Geoffrey Martin-Noble authored
Breaks the build and failed pre-merge checks: https://buildkite.com/llvm-project/premerge-checks/builds/54930#07373971-3d37-49cf-9def-22c0d724ee23 > llvm-project/lld/wasm/Writer.cpp:521:16: error: non-const lvalue reference to > type 'llvm::StringRef' cannot bind to a temporary of type 'llvm::StringRef' > for (auto &feature : used.keys()) { This reverts commit 5881dcff.
-
Nico Weber authored
Looks like the MS STL wants StringMapKeyIterator::operator*() to be const. Return the result by copy instead of reference to do that. Assigning to a hash map key iterator doesn't make sense anyways. Also reverts 123f811f which is now hopefully no longer needed. Differential Revision: https://reviews.llvm.org/D109167
-
Arthur Eubanks authored
-
Arthur Eubanks authored
Only tests in llvm/test/Analysis. -analyze is legacy PM-specific. This only touches files with `-passes`. I looked through everything and made sure that everything had a new PM equivalent. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D109040
-
Wenlei He authored
When preinliner is used for CSSPGO, we try to honor global preinliner decision as much as we can except for uninlinable callees. We rely on InlineCost::Never to prevent us from illegal inlining. However, it turns out that we use InlineCost::Never for both illeagle inlining and some of the "not-so-beneficial" inlining. The most common one is recursive inlining, while it can bloat size a lot during CGSCC bottom-up inlining, it's less of a problem when recursive inlining is guided by profile and done in top-down manner. Ideally it'd be better to have a clear separation between inline legality check vs cost-benefit check, but that requires a bigger change. This change enables InlineCost computation to allow inlining recursive calls, controlled by InlineParams. In SampleLoader, we now enable recursive inlining for CSSPGO when global preinliner decision is used. With this change, we saw a few perf improvements on SPEC2017 with CSSPGO and preinliner on: 2% for povray_r, 6% for xalancbmk_s, 3% omnetpp_s, while size is about the same (no noticeable perf change for all other benchmarks) Differential Revision: https://reviews.llvm.org/D109104
-
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.
-