Arthur Eubanks [Wed, 8 Dec 2021 21:57:25 +0000 (13:57 -0800)]
Revert "A new hidden option test-changed=exe that calls exe after each time IR changes"
This reverts commit
f9235e45fd1f5ca21f95105427184a6afd0f9d95.
Causes breakages on Windows: http://45.33.8.238/win/50453/step_11.txt.
Duncan P. N. Exon Smith [Wed, 8 Dec 2021 00:20:18 +0000 (16:20 -0800)]
ADT: Add SmallVectorImpl::truncate() to replace uses of set_size()
Add `SmallVectorImpl::truncate()`, a variant of `resize()` that cannot
increase the size.
- Compared to `resize()`, this has no code path for growing the
allocation and can be better optimized.
- Compared to `set_size()`, this formally calls destructors, and does
not skip any constructors.
- Compared to `pop_back_n()`, this takes the new desired size, which in
many contexts is more intuitive than the number of elements to remove.
The immediate motivation is to pair this with `resize_for_overwrite()`
to remove uses of `set_size()`, which can then be made private.
Differential Revision: https://reviews.llvm.org/D115383
Anna Thomas [Wed, 8 Dec 2021 21:53:09 +0000 (16:53 -0500)]
Update sink instruction testcase
Add inferable writeonly attribute. Simplify testcase.
Arthur O'Dwyer [Thu, 7 Oct 2021 00:12:27 +0000 (20:12 -0400)]
[libc++] [test] Refactor range.prim/empty.pass.cpp.
No decrease in test coverage intended. The original goal here
was just to get rid of the global name `sentinel` so that we can
rename the `sentinel_wrapper` in "test_iterators.h" to `sentinel`;
but then I took a closer look at the offending tests and saw
that some of them probably weren't testing what they intended.
Also, add one `/*explicit*/` and one #if'ed out test indicating
bugs in the current ranges::empty (to be fixed by D115312 or
some equivalent patch).
Reviewed as part of D115272.
Arthur O'Dwyer [Thu, 7 Oct 2021 00:23:10 +0000 (20:23 -0400)]
[libc++] [test] Use sized_sentinel<int*> in range.prim/ssize.pass.cpp.
Reviewed as part of D115272.
Arthur O'Dwyer [Tue, 7 Dec 2021 19:08:23 +0000 (14:08 -0500)]
[libc++] [test_iterators] Make all ADL base() functions into hidden friends. NFCI.
This follows up on my addition of base(cpp20_input_iterator) in D115177,
making all the ADL base() functions consistent.
Also align cpp20_input_iterator with the other test iterators' style.
Reviewed as part of D115272.
Martin Storsjö [Wed, 8 Dec 2021 18:42:40 +0000 (20:42 +0200)]
[lit] Pass the COMSPEC variable through to test processes on Windows
This variable is necessary for the system() function for running
external processes.
This is needes for some libcxx tests. With the current libcxx test
infrastructure, all OS environment variables are passed through, but
with the new "from scratch" libcxx test setup, we only pass through
the variables listed here.
Differential Revision: https://reviews.llvm.org/D115363
wlei [Wed, 8 Dec 2021 21:18:16 +0000 (13:18 -0800)]
[llvm-profgen] fix build failure in cs-extbinary.test
Kirill Stoimenov [Wed, 8 Dec 2021 20:16:14 +0000 (20:16 +0000)]
[ASan] Added __cplusplus guard around the C++ code so it is safe to include asan_mapping.h in assembly files.
This will avoid addind asan_shadow_defines.h in D114558.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D115348
Anna Thomas [Mon, 6 Dec 2021 21:31:02 +0000 (16:31 -0500)]
Update with additional tests for sinking calls to uses
Precommitted from D109917.
Note that the log call is already handled by instCombine.
Vitaly Buka [Tue, 23 Nov 2021 05:24:10 +0000 (21:24 -0800)]
[sanitizer] Run Stack compression in background thread
Depends on D114495.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D114498
wlei [Wed, 8 Dec 2021 20:53:19 +0000 (12:53 -0800)]
[llvm-profgen] fix to use profile-summary-hot-count instead of profile-summary-cold-count for CS profile
Petr Hosek [Wed, 1 Dec 2021 09:07:14 +0000 (01:07 -0800)]
[compiler-rt] Use the runtimes build for custom libc++
Some of the compiler-rt runtimes use custom instrumented libc++ build.
Use the runtimes build for building this custom libc++.
Differential Revision: https://reviews.llvm.org/D114922
Duncan P. N. Exon Smith [Wed, 8 Dec 2021 00:16:45 +0000 (16:16 -0800)]
ADT: Reduce nesting in resize_for_overwrite(), NFC
Use an early return in SmallVectorImpl::resize_for_overwite() to reduce
nesting. This also makes it easier to visually compare against the
two-argument version of resize().
Vitaly Buka [Wed, 8 Dec 2021 20:28:12 +0000 (12:28 -0800)]
[asan] Run background thread for asan only on THUMB
As in D114934, or lsan crashes on the same bot.
Vitaly Buka [Wed, 8 Dec 2021 19:53:14 +0000 (11:53 -0800)]
[NFC][sanitizer] Move/rename macro into sanitizer_platform.h
Folloup for D114934
Vitaly Buka [Wed, 8 Dec 2021 20:22:47 +0000 (12:22 -0800)]
[compiler-rt] Disabled tests and benchmarks for libc++
We don't run tests or benchmarks from this build anyway.
Benchmarks in custom libc++ break my local build.
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D115375
wlei [Fri, 3 Dec 2021 00:51:42 +0000 (16:51 -0800)]
[llvm-profgen] Fix total samples related issues
Since total sample and body sample are used to compute hotness threshold in compiler, we found in some services changing the total samples computation will cause noticeable regression. Hence, here we will revert the changes and just keep all total samples number identical to the old tool.
Three changes in this diff:
1. Revert previous diff(https://reviews.llvm.org/D112672: [llvm-profgen] Update total samples by accumulating all its body samples) and put it under a switch.
2. Keep the negative line number. Although compiler doesn't consume the count but it will be used to compute hot threshold.
3. Change to accumulate total samples per byte instead of per instruction.
Reviewed By: hoy, wenlei
Differential Revision: https://reviews.llvm.org/D115013
Fabian Wolff [Wed, 8 Dec 2021 20:28:06 +0000 (21:28 +0100)]
[InstCombine] Add tests for D114272
Philip Reames [Wed, 8 Dec 2021 20:21:10 +0000 (12:21 -0800)]
[instcombine] A couple style tweaks to visitExtractElementInst [nfc]
wlei [Mon, 29 Nov 2021 07:43:11 +0000 (23:43 -0800)]
[llvm-profgen] Trim cold function profiles for non-CS AutoFDO
This change allows to trim the profile if it's considered to be cold for baseline AutoFDO. We reuse the cold threshold from `ProfileSummaryBuilder::getColdCountThreshold(..)` which can be set by percent(--profile-summary-cutoff-cold) or by value(--profile-summary-cold-count).
Reviewed By: hoy, wenlei
Differential Revision: https://reviews.llvm.org/D113785
Kirill Stoimenov [Wed, 8 Dec 2021 19:47:12 +0000 (19:47 +0000)]
[ASan] Ran clang-format on asan_mapping.h.
Reviewed By: kstoimenov
Differential Revision: https://reviews.llvm.org/D115371
Siva Chandra Reddy [Wed, 8 Dec 2021 07:03:35 +0000 (07:03 +0000)]
[libc][Obvious] Fix variable naming in the generic sqrt implementations.
Florian Hahn [Wed, 8 Dec 2021 19:39:45 +0000 (19:39 +0000)]
[MemoryLocation] Support memset_pattern{4,8} in getForArgument.
memset_pattern{4,8} behave as memset_pattern16, with the only difference
being the size of the pattern location.
Reviewed By: ab
Differential Revision: https://reviews.llvm.org/D114905
Jamie Schmeiser [Wed, 8 Dec 2021 19:22:54 +0000 (14:22 -0500)]
A new hidden option test-changed=exe that calls exe after each time IR changes
Summary:
A new option test-changed is defined that allows one to specify an
exe that is called after each pass in the opt pipeline that changes the IR.
The test-changed=exe option saves the IR in a temporary file and calls exe
with the name of the file and the name of the pass that just changed it after
each pass alters the IR. exe is also called with the initial IR. This
can be used, for example, to determine which pass corrupts the IR by having
exe as a script that calls llc and runs a test to see after which pass the
results change. The print-changed filtering options are respected.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks)
Differential Revision: https://reviews.llvm.org/D110776
Butygin [Thu, 28 Oct 2021 16:04:35 +0000 (19:04 +0300)]
[mlir][spirv] math.erf OpenCL lowering
Differential Revision: https://reviews.llvm.org/D115335
Nico Weber [Wed, 8 Dec 2021 18:55:57 +0000 (13:55 -0500)]
Noah Shutty [Wed, 8 Dec 2021 18:49:12 +0000 (18:49 +0000)]
Revert "[Symbolizer][Debuginfo] Add debuginfod client to llvm-symbolizer."
This reverts commit
02cc8d698c4941f8f0120ea1a5d7205fb33a312d because it
caused buildbot failures. The issue appears to be simply that we need to
only enable debuginfod when the HTTPClient has been initialized by the
running tool, since InitLLVM does not do the initialization step anymore.
Simon Pilgrim [Wed, 8 Dec 2021 18:44:45 +0000 (18:44 +0000)]
[CostModel][X86] Split MUL/SDIV+SREM/UDIV+UREM PowerOf2 handling. NFC.
This is a NFC cleanup to simplify some upcoming refactoring required to address the regressions in D111968.
Nico Weber [Wed, 8 Dec 2021 18:45:54 +0000 (13:45 -0500)]
[gn build] (manually) port
02cc8d698c49
Benjamin Kramer [Wed, 8 Dec 2021 18:36:33 +0000 (19:36 +0100)]
Silence format string warning harder.
This can be unsigned long or unsigned long long depending on where it's
compiled. Use the ugly portable way.
PlatformWindows.cpp:397:63: warning: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long')
Adrian Vogelsgesang [Wed, 8 Dec 2021 18:31:30 +0000 (13:31 -0500)]
Don't offer partial fix-its for `modernize-pass-by-value`
This commit improves the fix-its of modernize-pass-by-value by
no longer proposing partial fixes. In the presence of using/typedef,
we failed to rewrite the function signature but still adjusted the
function body. This led to incorrect, partial fix-its. Instead, the
check now simply doesn't offer any fixes at all in such a situation.
Nikolas Klauser [Wed, 8 Dec 2021 09:57:12 +0000 (10:57 +0100)]
[libc++] `= delete` member functions with // = delete;
Use `= delete` for member functions that are marked with `// = delete;`
Reviewed By: ldionne, Quuxplusone, #libc
Spies: jloser, libcxx-commits
Differential Revision: https://reviews.llvm.org/D115291
Philip Reames [Wed, 8 Dec 2021 18:02:17 +0000 (10:02 -0800)]
[unroll] Add test coverage for loops with small estimated trip counts and multiple exits
Noah Shutty [Wed, 8 Dec 2021 17:52:40 +0000 (17:52 +0000)]
[Symbolizer][Debuginfo] Add debuginfod client to llvm-symbolizer.
Adds a fallback to use the debuginfod client library (386655) in `findDebugBinary`.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D113717
Thomas Raoux [Wed, 8 Dec 2021 03:28:14 +0000 (19:28 -0800)]
[mlir][nvvm] Add async copy ops to nvvm dialect
Differential Revision: https://reviews.llvm.org/D115314
Petr Hosek [Wed, 8 Dec 2021 17:13:03 +0000 (09:13 -0800)]
Revert "[compiler-rt] Use the runtimes build for custom libc++"
This reverts commit
bda3f2dd763b06427dd2713aa062e356c9d7bdc6 since
it broke MSan tests.
Kirill Bobyrev [Wed, 8 Dec 2021 17:07:39 +0000 (18:07 +0100)]
[clangd] Suppress IncludeCleaner warnings for headers behind pragma keep
D114072 allows filtering out the warnings for headers behind `// IWYU pragma:
keep`. This is the first step towards more useful IWYU pragmas support and
fine-grained control over the IncludeCleaner warnings.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D115345
David Sherwood [Tue, 23 Nov 2021 17:15:53 +0000 (17:15 +0000)]
[NFC][CodeGen] Remove rarely used DL variable from SelectionDAGBuilder
There is a pointer to the DataLayout in SelectionDAGBuilder called
'DL' that is hardly ever used. In most cases the code seems to just
use `DAG.getDataLayout()` instead. Given that DL is also often used
as a shadowed variable for the debug location it seems sensible to
just kill off the few remaining uses and be consistent with the rest
of the code.
Differential Revision: https://reviews.llvm.org/D114451
Saleem Abdulrasool [Tue, 7 Dec 2021 18:34:28 +0000 (10:34 -0800)]
lldb: silence a warning on the Windows error path (NFCI)
This corrects the printf specifier for the `error_code` parameter that
was reported by @thakis.
Mark de Wever [Wed, 8 Dec 2021 16:58:51 +0000 (17:58 +0100)]
Revert "[libc++][ci] Disable generating debug information."
The bug this patch works around prevents D70631 to land.
Remove the work-around since it's no longer needed.
Peter Klausler [Tue, 7 Dec 2021 22:38:17 +0000 (14:38 -0800)]
[flang] Add CALL FLUSH(n) legacy extension
Prior to the introduction of the FLUSH statement in Fortran 2003,
implementations provided a FLUSH subroutine.
We can't yet put Fortran code into the runtime, so this subroutine
is in C++ with a Fortran-mangled entry point name.
Differential Revision: https://reviews.llvm.org/D115289
Sanjay Patel [Wed, 8 Dec 2021 16:39:36 +0000 (11:39 -0500)]
[Support] improve known bits analysis for multiply by power-of-2 (1 set bit)
This can be viewed as recognizing that multiply-by-power-of-2 doesn't
have a carry into the top bit of an M-bit * N-bit number.
Enhancing canonicalization of mul -> select might also handle some of
these if we were ok with increasing instruction count with casts in
some cases.
This doesn't help https://llvm.org/PR49055 , but it's a simpler
pattern that we miss.
Note: "-sccp" already gets these examples using a constant
range analysis.
Differential Revision: https://reviews.llvm.org/D114962
Sander de Smalen [Wed, 8 Dec 2021 15:54:05 +0000 (15:54 +0000)]
[LV] NFC: Add check for VF to vector_ptr_load_store.ll.
This just adds some extra CHECK lines to show the effect
of a follow-up patch.
Louis Dionne [Wed, 22 Sep 2021 16:09:07 +0000 (12:09 -0400)]
[libc++][release] Do not force building the runtimes with -fPIC
There's a lot of history behind this, so here's a summary:
1. I stopped forcing -fPIC when building the runtimes in
30f305efe279,
before the LLVM 9 release back in 2019.
2. Someone complained that libc++.a couldn't be used in shared libraries
built without -fPIC (http://llvm.org/PR43604) since the LLVM 9 release.
This had been caused by my removal of -fPIC when building libc++.a in (1).
3. I suggested two ways of fixing the issue, the first being to force
-fPIC back unconditionally (http://llvm.org/D104328), and the second
being to specify that option explicitly when building the LLVM release
(http://llvm.org/D104327). We converged on the first solution.
4. I landed D104328, which forced building the runtimes with -fPIC.
This was included in the LLVM 13.0 release.
5. People complained about that and requested that we be able to
customize this setting (basically we should have done the second
solution).
This patch makes it such that the LLVM release script will specifically
ask for building with -fPIC using CMAKE_POSITION_INDEPENDENT_CODE,
however by default the runtimes will not force that option onto users.
This patch has the unintended effect that Clang and the LLVM libraries
(not only the runtime ones like libc++) will also be built with -fPIC
in the release. It would be better if we could specify that -fPIC is to
be used only when building the runtimes, however this is left as a
future improvement. The release should probably be using a bootstrapping
build and passing those options to the stage that builds the runtimes
only, see https://reviews.llvm.org/D112748 for that change.
Differential Revision: https://reviews.llvm.org/D110261
Valentin Clement [Wed, 8 Dec 2021 16:27:59 +0000 (17:27 +0100)]
[fir] Add fir ragged array builder
This patch introduces a bunch of builder functions
to create function calls to runtime ragged arrays functions.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D114535
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Jon Chesterfield [Wed, 8 Dec 2021 16:00:41 +0000 (16:00 +0000)]
[amdgpu][nfc] Move non-shared code out of LDSUtils
Peter Waller [Wed, 8 Dec 2021 14:37:44 +0000 (14:37 +0000)]
[NFC][SVE] s/fast/contract/ in test sve-fp-combine.ll
These tests doesn't currently make use of any fast math flag other than
contract. This will change in D109525 when a dependency on nsz will be
introduced where negation is involved.
AndreyChurbanov [Wed, 8 Dec 2021 16:02:57 +0000 (19:02 +0300)]
[OpenMP] libomp: Fix crash if application send us negative thread_limit value
Regardless that specification requires thread_limit to be positive,
it is better to warn user instead of crash in case the value is negative.
Differential Revision: https://reviews.llvm.org/D115340
Tom Weaver [Wed, 8 Dec 2021 15:35:48 +0000 (15:35 +0000)]
[dexter] Fix source-root-dir unittests on Windows
These tests were spuriously failing on Windows due to path separators getting
flipped from `/` to `\\` in various parts of dexter:
test_add_breakpoint_with_source_root_dir
test_get_step_info
test_get_step_info_no_source_root_dir
Tested on Windows and Linux.
Patch written by @TWeaver.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D115338
David Green [Wed, 8 Dec 2021 15:40:23 +0000 (15:40 +0000)]
[ARM] Peek through And 1 in IsCMPZCSINC
We can be in situations where And 1 zext nodes will not have been yet,
preventing us from detecting removable cmpz/csinc patterns. This peeks
through those nodes allowing us to simplify more code.
Differential Revision: https://reviews.llvm.org/D115176
Sanjay Patel [Wed, 8 Dec 2021 15:03:52 +0000 (10:03 -0500)]
[InstCombine] try to fold div with constant dividend and select-of-constants divisor
We avoid this fold in the more general cases where we use FoldOpIntoSelect.
That's because -- unlike most binary opcodes -- 'div' can't usually be
speculated with a variable divisor since it can have immediate UB. But in
the case where both arms of the select are constants, we can safely evaluate
both sides and eliminate 'div' completely.
This is a follow-up to the equivalent fold for 'rem' opcodes:
D115173 /
f65be726ab50
Sam McCall [Sat, 27 Nov 2021 23:33:11 +0000 (00:33 +0100)]
[clangd] Add fixes for clang "include <foo.h>" diagnostics
Clang doesn't offer these fixes I guess for a couple of reasons:
- where to insert includes is a formatting concern, and clang shouldn't
depend on clang-format
- the way clang prints diagnostics, we'd show a bunch of basically irrelevant
context of "this is where we'd want to insert the include"
Maybe it's possible to hack around 1, but 2 is still a concern.
Meanwhile, bolting this onto include-fixer gets the job done.
Fixes https://github.com/clangd/clangd/issues/355
Fixes https://github.com/clangd/clangd/issues/937
Differential Revision: https://reviews.llvm.org/D114667
Jake Egan [Wed, 8 Dec 2021 15:10:30 +0000 (10:10 -0500)]
[DWARF] Fix consistency and AIX compatibility of checks in DWARF test
This patch removes the white space and trailing bracket to make the checks consistent and verbose direct/indirect string agnostic for AIX compatibility.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D115287
Jolanta Jensen [Mon, 6 Dec 2021 11:44:03 +0000 (11:44 +0000)]
[LAA] Use type sizes when determining dependence.
In the isDependence function the code does not try hard enough
to determine the dependence between types. If the types are
different it simply gives up, whereas in fact what we really
care about are the type sizes. I've changed the code to compare
sizes instead of types.
Reviewed By: fhahn, sdesmalen
Differential Revision: https://reviews.llvm.org/D108763
Pavel Labath [Wed, 8 Dec 2021 14:51:31 +0000 (15:51 +0100)]
[lldb/qemu] Sort entries in QEMU_(UN)SET_ENV
The test for this functionality was failing on the darwin bot, because
the entries came out in opposite order. While this does not impact
functionality, and the algorithm that produces it is technically
deterministic (the nondeterminism comes from the contents of the host
environment), it seems like it would be more user-friendly if the
entries came out in a more predictible order.
Therefore I am adding the sort call to the actual code instead of
relaxing test expectations.
Kirill Bobyrev [Wed, 8 Dec 2021 14:55:39 +0000 (15:55 +0100)]
[clangd] Record IWYU pragma keep in the IncludeStructure
This will allow the IncludeCleaner to suppress warnings on the lines with "IWYU
pragma: keep".
Clang APIs are not very convinient, so the code has to navigate around it.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D114072
Matthias Springer [Wed, 8 Dec 2021 14:26:22 +0000 (23:26 +0900)]
[mlir][linalg][bufferize] Add dialect filter to BufferizationOptions
This adds a new option `dialectFilter` to BufferizationOptions. Only ops from dialects that are allow-listed in the filter are bufferized. Other ops are left unbufferized. Note: This option requires `allowUnknownOps = true`.
To make use of `dialectFilter`, BufferizationOptions or BufferizationState must be passed to various helper functions.
The purpose of this change is to provide a better infrastructure for partial bufferization, which will be fully activated in a subsequent change.
Differential Revision: https://reviews.llvm.org/D114691
Jamie Schmeiser [Wed, 8 Dec 2021 14:50:07 +0000 (09:50 -0500)]
Remove Colours array in -print-changed=dot-cfg
Summary:
The Colours array is apparently the source of TSAN errors. It is
unnecessary and was there to ease readability of the code. Remove it to
clean up the TSAN errors.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks)
Differential Revision: https://reviews.llvm.org/D115175
Jake Egan [Wed, 8 Dec 2021 14:16:58 +0000 (09:16 -0500)]
[LTO] Remove default_triple requirement from tests that specify the triple
The `default_triple` requirement is redundant if the test specifies the triple, so this patch removes it.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D115048
Haojian Wu [Wed, 8 Dec 2021 14:12:32 +0000 (15:12 +0100)]
[libc] Fix two missing cases in
1c92911e9e1d503c0dfc4367da7f15d0dff50587
Fix the broken build.
Louis Dionne [Wed, 8 Dec 2021 13:57:19 +0000 (08:57 -0500)]
[libc++] Bump Dockerfile
Hasyimi Bahrudin [Wed, 8 Dec 2021 13:21:44 +0000 (08:21 -0500)]
[InstCombine][InstSimplify] Add baseline tests for icmp bool with not on LHS; NFC
See D114666 for proposed code change to instsimplify.
The difference between the CHECK result of these 2 tests
highlights missed folds in instsimplify
(e.g. (icmp eq (xor X, true), false) -> X) that are
already being handled by instcombine.
The tests are based on:
llvm/test/Transforms/InstSimplify/icmp-bool-constant.ll
Differential Revision: https://reviews.llvm.org/D115209
LLVM GN Syncbot [Wed, 8 Dec 2021 13:42:16 +0000 (13:42 +0000)]
[gn build] Port
81eda008e952
Aaron Ballman [Wed, 8 Dec 2021 13:34:38 +0000 (08:34 -0500)]
Removing some unused parameters from this test; NFC
Louis Dionne [Tue, 7 Dec 2021 21:34:13 +0000 (16:34 -0500)]
[libc++] Extract __clamp_to_integral to its own header
In addition to being more consistent with our approach for helpers, this
solves an actual issue where <cmath> was using numeric_limits but never
including the <limits> header directly. In a normal setup, this is not
an issue because the <math.h> header included by <cmath> does include
<limits>. However, I did stumble upon some code where that didn't work,
most likely because they were placing their own <math.h> header in front
of ours. I didn't bother investigating further.
Differential Revision: https://reviews.llvm.org/D115282
Jun Zhang [Wed, 8 Dec 2021 13:29:33 +0000 (08:29 -0500)]
Add __builtin_elementwise_ceil
This patch implements one of the missing builtin functions specified
in https://reviews.llvm.org/D111529.
Pavel Labath [Wed, 8 Dec 2021 12:38:35 +0000 (13:38 +0100)]
[lldb] Fix TestDataFormatterGenericList
Test is using "next" commands to make progress in the process. D115137
added an additional statement to the program, without adding a command
to step over it. This only seemed to matter for the libc++ flavour of
the test, possibly because libstdc++ list is "empty" in its
uninitialized state.
Since moving with step commands is a treacherous, this patch adds a
run-to-breakpoint command to the test. It only does this for the
affected step, but one may consider doing it elsewhere too.
Pavel Labath [Wed, 8 Dec 2021 12:25:30 +0000 (13:25 +0100)]
[lldb] Unify two versions of TestMemoryRead
Our test infrastructure does not like two tests with the same name, but
it makes sense to do it regardless, as they are testing the same
command.
Henry Linjamäki [Wed, 8 Dec 2021 07:47:25 +0000 (10:47 +0300)]
[HIPSPV] Convert HIP kernels to SPIR-V kernels
This patch translates HIP kernels to SPIR-V kernels when the HIP
compilation mode is targeting SPIR-S. This involves:
* Setting Cuda calling convention to CC_OpenCLKernel (which maps to
SPIR_KERNEL in LLVM IR later on).
* Coercing pointer arguments with default address space (AS) qualifier
to CrossWorkGroup AS (__global in OpenCL). HIPSPV's device code is
ultimately SPIR-V for OpenCL execution environment (as
starter/default) where Generic or Function (OpenCL's private) is not
supported as storage class for kernel pointer types. This leaves the
CrossWorkGroup to be the only reasonable choice for HIP buffers.
Reviewed By: yaxunl
Differential Revision: https://reviews.llvm.org/D109818
Pavel Labath [Mon, 29 Nov 2021 10:30:23 +0000 (11:30 +0100)]
[lldb/qemu] Separate host and target environments
Qemu normally forwards its (host) environment variables to the emulated
process. While this works fine for most variables, there are some (few, but
fairly important) variables where this is not possible. LD_LIBRARY_PATH
is the probably the most important of those -- we don't want the library
search path for the emulated libraries to interfere with the libraries
that the emulator itself needs.
For this reason, qemu provides a mechanism (QEMU_SET_ENV,
QEMU_UNSET_ENV) to set variables only for the emulated process. This
patch makes use of that functionality to pass any user-provided
variables to the emulated process. Since we're piggy-backing on the
normal lldb environment-handling mechanism, all the usual mechanism to
provide environment (target.env-vars setting, SBLaunchInfo, etc.) work
out-of-the-box, and the only thing we need to do is to properly
construct the qemu environment variables.
This patch also adds a new setting -- target-env-vars, which represents
environment variables which are added (on top of the host environment)
to the default launch environments of all (qemu) targets. The reason for
its existence is to enable the configuration (e.g., from a startup
script) of the default launch environment, before any target is created.
The idea is that this would contain the variables (like the
aforementioned LD_LIBRARY_PATH) common to all targets being debugged on
the given system. The user is, of course, free to customize the
environment for a particular target in the usual manner.
The reason I do not want to use/recommend the "global" version of the
target.env-vars setting for this purpose is that the setting would apply
to all targets, whereas the settings (their values) I have mentioned
would be specific to the given platform.
Differential Revision: https://reviews.llvm.org/D115246
Kazushi (Jam) Marukawa [Sun, 5 Dec 2021 17:25:44 +0000 (02:25 +0900)]
[VE] Change error handling of data references
Change to use Ctx.reportError() instead of llvm_unreachable for
better error handling. Also correct evaluateAsRelocatableImpl().
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D115251
Simon Pilgrim [Wed, 8 Dec 2021 11:54:43 +0000 (11:54 +0000)]
[X86] LowerRotate - split 512-bit integers on non 512-bit BWI targets.
David Spickett [Wed, 1 Dec 2021 14:56:18 +0000 (14:56 +0000)]
[lldb] Add missing space in C string format memory read warning
Also add tests to check that we print the warning in the right
circumstances.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D114877
Paul Walker [Fri, 3 Dec 2021 14:36:54 +0000 (14:36 +0000)]
[SVE][InstCombine] Support more cases where ld1/st1 can be lowered to load/store instructions.
This patch extends the "is all active predicate" check to cover
cases where the predicate is casted but in a way that doesn't
change its "all active" status.
Differential Revision: https://reviews.llvm.org/D115047
Jan Svoboda [Wed, 8 Dec 2021 10:43:43 +0000 (11:43 +0100)]
[llvm] Remove out-of-date fixme from SmallVectorMemoryBuffer
This fixme first appeared in the codebase with the introduction of `ObjectMemoryBuffer` in rG93de2a12a36feaf1e6d8ff28c76db9b6cda4e844, but the constructor appears to never have been templated.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D115044
Jan Svoboda [Wed, 8 Dec 2021 10:00:15 +0000 (11:00 +0100)]
[clang][deps] Reset some benign codegen options
Some command-line codegen arguments are likely to differ between identical modules discovered from different translation units. This patch removes them to make builds deterministic and/or reduce the number of built modules.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D112923
Hans Wennborg [Tue, 7 Dec 2021 16:09:44 +0000 (17:09 +0100)]
Add note about inlining dllimport functions to the attribute docs
Differential revision: https://reviews.llvm.org/D115252
David Green [Wed, 8 Dec 2021 10:13:25 +0000 (10:13 +0000)]
[SDAG] Refine MMO size when converting masked load/store to normal load/store
After D113888 /
32b6c17b29079e7d the MMO size of a masked loads/store is
unknown. When we are converting back to a standard load/store because
the mask is known all ones, we can refine that to the correct size from
the size of the vector being loaded/stored.
Differential Revision: https://reviews.llvm.org/D114582
Ties Stuij [Wed, 8 Dec 2021 09:44:45 +0000 (09:44 +0000)]
[ARM][libunwind] add PACBTI-M support for libunwind
This patch implements the following:
- Emit PACBTI-M build attributes in libunwind asm files
- Authenticate LR in DWARF32 using PACBTI
Use Armv8.1-M.Main PACBTI extension to authenticate the return address
(stored in the LR register) before moving it to the PC (IP) register.
The AUTG instruction is used with the candidate return address, the CFA,
and the authentication code that is retrieved from the saved
pseudo-register RA_AUTH_CODE.
- Authenticate LR in EHABI using PACBTI
Authenticate the contents of the LR register using Armv8.1-M.Main PACBTI
extension.
A new frame unwinding instruction is introduced (0xb4). This
instruction pops out of the stack the return address authentication
code, which is then used in conjunction with the SP and the next-to-be
instruction pointer to perform authentication.
This authentication code is popped into a new register,
UNW_ARM_PSEUDO_PAC, which is a pseudo-register.
This patch is part of a series that adds support for the PACBTI-M extension of
the Armv8.1-M architecture, as detailed here:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension
The PACBTI-M specification can be found in the Armv8-M Architecture Reference
Manual:
https://developer.arm.com/documentation/ddi0553/latest
The following people contributed to this patch:
- Momchil Velikov
- Victor Campos
- Ties Stuij
Reviewed By: #libunwind, danielkiss, mstorsjo
Differential Revision: https://reviews.llvm.org/D112430
Chuanqi Xu [Wed, 8 Dec 2021 09:11:40 +0000 (17:11 +0800)]
[NFC] Only attach a declaration to global module fragment if it appears in a module
Jon Chesterfield [Wed, 8 Dec 2021 08:23:12 +0000 (08:23 +0000)]
Revert "[OpenMP][AMDGPU] Switch host-device memory copy to asynchronous version"
This reverts commit
6de698bf10996b532632bb9dfa9fd420c5af62af.
It didn't build in the dynamic_hsa configuration
Stephen Neuendorffer [Fri, 19 Nov 2021 05:54:47 +0000 (21:54 -0800)]
Allow DataLayout to support arbitrary pointer sizes
Currently, it is impossible to specify a DataLayout with pointer
size and index size that is not a whole number of bytes.
This patch modifies
the DataLayout class to accept arbitrary pointer sizes and to
store the size as a number of bits, rather than as a number of bytes.
Generally speaking, the external interface of the class as used
by in-tree architectures remains the same and shouldn't affect the
behavior of architecures with pointer sizes equal to a whole number
of bytes.
Note the interface of setPointerAlignment has changed and takes
a pointer and index size that is a number of bits, rather than a number
of bytes.
Patch originally by Ajit Kumar Agarwal
Differential Revision: https://reviews.llvm.org/D114141
Petr Hosek [Wed, 8 Dec 2021 07:06:12 +0000 (23:06 -0800)]
[CMake] Specify byproducts for custom libcxx builds
These were removed in
bda3f2dd763b06427dd2713aa062e356c9d7bdc6 but
are needed as it turned out for the MSan tests.
Chuanqi Xu [Wed, 8 Dec 2021 06:58:44 +0000 (14:58 +0800)]
[C++20] [Modules] [Concepts] Recognize same concepts more precisely in Serialization
The compiler would judge two concepts is same by their addresses.
However, when we use modules, the addresses wouldn't be the same all the
time since one is parsed in their TU and another is imported in another
TU.
This patch fixes this by using isSameEntity to judge the two concepts.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D114769
Vitaly Buka [Wed, 8 Dec 2021 06:39:12 +0000 (22:39 -0800)]
[lsan] Replace atomic_store/atomic_load with atomic_fetch_add
Vitaly Buka [Wed, 8 Dec 2021 06:35:39 +0000 (22:35 -0800)]
[NFC][asan] Remove -std=c++20 from test
Fails after D110215
with errors like
/usr/include/x86_64-linux-gnu/sys/types.h:33:9: error: unknown type name '__u_char'
typedef __u_char u_char;
Chuanqi Xu [Wed, 8 Dec 2021 06:25:42 +0000 (14:25 +0800)]
[NFC] Fix C++20 module test in PPC and warning
lh123 [Wed, 8 Dec 2021 05:52:15 +0000 (13:52 +0800)]
[clangd] Make a.k.a printing configurable.
Currently, a.k.a printing is closed by default.
Reviewed By: sammccall, kadircet
Differential Revision: https://reviews.llvm.org/D114665
Mehdi Amini [Tue, 7 Dec 2021 18:27:58 +0000 (18:27 +0000)]
Adjust "end namespace" comment in MLIR to match new agree'd coding style
See D115115 and this mailing list discussion:
https://lists.llvm.org/pipermail/llvm-dev/2021-December/154199.html
Differential Revision: https://reviews.llvm.org/D115309
Mehdi Amini [Wed, 8 Dec 2021 05:14:01 +0000 (05:14 +0000)]
Build MLIR with -Werror=mismatched-tags (NFC)
This is a defensive action to catch at build time on Linux failures that
may happen only on Windows otherwise.
Differential Revision: https://reviews.llvm.org/D115316
Chuanqi Xu [Wed, 8 Dec 2021 05:49:02 +0000 (13:49 +0800)]
[C++20] [Modules] Namespace Declaration shouldn't have module linkage
According to [basic.namespace.general]/p2, a namespace declaration
shouldn't have a module linkage.
> A namespace is never attached to a named module and never has a name
> with module linkage.
Without this patch, the compiler would crash for the test in assertion
enabled build due to inconsistent linkage for redeclaration for
namespaces.
Reviewed by: rsmith
Differential Revision: https://reviews.llvm.org/D115132
Vitaly Buka [Wed, 8 Dec 2021 05:34:57 +0000 (21:34 -0800)]
[NFC][lsan] Move method implementation up
Vitaly Buka [Wed, 8 Dec 2021 05:34:06 +0000 (21:34 -0800)]
[NFC][lsan] Clang-format lsan_common.cpp
Chuanqi Xu [Wed, 8 Dec 2021 03:34:18 +0000 (11:34 +0800)]
[C++20] [Module] Support extern C/C++ semantics
According to [module.unit]p7.2.3, a declaration within a linkage-specification
should be attached to the global module.
This let user to forward declare types across modules.
Reviewed by: rsmith, aaron.ballman
Differential Revision: https://reviews.llvm.org/D110215
lh123 [Wed, 8 Dec 2021 04:31:00 +0000 (12:31 +0800)]
[clangd] Add desugared type to hover
Add desugared type to hover when the desugared type and the pretty-printed type are different.
```c++
template<typename T>
struct TestHover {
using Type = T;
};
int main() {
TestHover<int>::Type a;
}
```
```
variable a
Type: TestHover<int>::Type (aka int)
```
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D114522
Mehdi Amini [Wed, 8 Dec 2021 04:30:43 +0000 (04:30 +0000)]
Fix flang tests after MLIR changes on the handling of declarative assembly
Vitaly Buka [Wed, 8 Dec 2021 03:49:44 +0000 (19:49 -0800)]
[NFC][lsan] Use kIgnored in MarkInvalidPCCb
kIgnored didn't exist when the code was added, but it should be
equivalent to kReachable.
The goal is to refactor MarkInvalidPCCb to avoid StackDepotGet
in StopTheWorld.
Haohai Wen [Tue, 7 Dec 2021 02:15:38 +0000 (10:15 +0800)]
[CostModel][X86] Add i64 mul cost for avx512 as 1cy
i64 mul cost is 1cy for all cpu that support avx512. Currently
all X86 cpu uses i64 mul cost in X64 cost table which is not
true for cpu that support avx512 (skx, icx).
Reviewed By: pengfei, RKSimon
Differential Revision: https://reviews.llvm.org/D115016
Lang Hames [Tue, 7 Dec 2021 21:10:41 +0000 (08:10 +1100)]
[ORC] Add a MaterializationUnit::Interface struct.
MaterializationUnit::Interface holds the values that make up the interface
(for ORC's purposes) of a materialization unit: the symbol flags map and
initializer symbol.
Having a type for this will make functions that build materializer interfaces
more readable and maintainable.