Commit Graph

406840 Commits

Author SHA1 Message Date
wlei 5d66113afc [llvm-profgen] fix to use profile-summary-hot-count instead of profile-summary-cold-count for CS profile 2021-12-08 12:54:07 -08:00
Petr Hosek 458ead66dc [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
2021-12-08 12:52:48 -08:00
Duncan P. N. Exon Smith 36e7b8dd56 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().
2021-12-08 12:51:22 -08:00
Vitaly Buka 5c27740238 [asan] Run background thread for asan only on THUMB
As in D114934, or lsan crashes on the same bot.
2021-12-08 12:43:56 -08:00
Vitaly Buka 9b9ee34d0e [NFC][sanitizer] Move/rename macro into sanitizer_platform.h
Folloup for D114934
2021-12-08 12:43:56 -08:00
Vitaly Buka 8de23903e3 [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
2021-12-08 12:43:55 -08:00
wlei 484a569eea [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
2021-12-08 12:33:41 -08:00
Fabian Wolff 505a9007c5 [InstCombine] Add tests for D114272 2021-12-08 21:28:15 +01:00
Philip Reames 56fa334333 [instcombine] A couple style tweaks to visitExtractElementInst [nfc] 2021-12-08 12:23:50 -08:00
wlei 27cb3707db [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
2021-12-08 12:20:50 -08:00
Kirill Stoimenov 277f86d610 [ASan] Ran clang-format on asan_mapping.h.
Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D115371
2021-12-08 20:15:32 +00:00
Siva Chandra Reddy 45927444e7 [libc][Obvious] Fix variable naming in the generic sqrt implementations. 2021-12-08 19:57:46 +00:00
Florian Hahn 3c55acc4a6
[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
2021-12-08 19:39:45 +00:00
Jamie Schmeiser f9235e45fd 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
2021-12-08 14:23:31 -05:00
Butygin d8fce785de [mlir][spirv] math.erf OpenCL lowering
Differential Revision: https://reviews.llvm.org/D115335
2021-12-08 21:59:46 +03:00
Nico Weber 470c3d8ca3 Revert "[gn build] (manually) port 02cc8d698c49"
This reverts commit 0f865dc694.
02cc8d698c was reverted in aaec63d2a7.
2021-12-08 13:56:21 -05:00
Noah Shutty aaec63d2a7 Revert "[Symbolizer][Debuginfo] Add debuginfod client to llvm-symbolizer."
This reverts commit 02cc8d698c 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.
2021-12-08 18:49:12 +00:00
Simon Pilgrim 30e38d6771 [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.
2021-12-08 18:47:12 +00:00
Nico Weber 0f865dc694 [gn build] (manually) port 02cc8d698c 2021-12-08 13:45:54 -05:00
Benjamin Kramer 81f4874cbf 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')
2021-12-08 19:37:32 +01:00
Adrian Vogelsgesang 5d3b8956e8 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.
2021-12-08 13:31:30 -05:00
Nikolas Klauser feb80aa96b [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
2021-12-08 19:29:44 +01:00
Philip Reames ad4644acce [unroll] Add test coverage for loops with small estimated trip counts and multiple exits 2021-12-08 10:15:39 -08:00
Noah Shutty 02cc8d698c [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
2021-12-08 17:52:40 +00:00
Thomas Raoux 579c1ff67d [mlir][nvvm] Add async copy ops to nvvm dialect
Differential Revision: https://reviews.llvm.org/D115314
2021-12-08 09:42:20 -08:00
Petr Hosek 824ddeb994 Revert "[compiler-rt] Use the runtimes build for custom libc++"
This reverts commit bda3f2dd76 since
it broke MSan tests.
2021-12-08 09:14:26 -08:00
Kirill Bobyrev b673bc36ea [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
2021-12-08 18:07:40 +01:00
David Sherwood 3257f63bbd [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
2021-12-08 17:05:46 +00:00
Saleem Abdulrasool 906e60b9f9 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.
2021-12-08 09:01:10 -08:00
Mark de Wever ade336dee4 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.
2021-12-08 17:58:51 +01:00
Peter Klausler 627a8ac790 [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
2021-12-08 08:56:54 -08:00
Sanjay Patel e9179a6a02 [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
2021-12-08 11:50:05 -05:00
Sander de Smalen e1edec1ee6 [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.
2021-12-08 16:41:59 +00:00
Louis Dionne a6e5563dfa [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 30f305efe2,
   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
2021-12-08 11:34:35 -05:00
Valentin Clement de467afe18
[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>
2021-12-08 17:28:43 +01:00
Jon Chesterfield f0e3b39a5d [amdgpu][nfc] Move non-shared code out of LDSUtils 2021-12-08 16:23:03 +00:00
Peter Waller 0fa1dda5eb [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.
2021-12-08 16:06:05 +00:00
AndreyChurbanov 4dd8fccb71 [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
2021-12-08 19:02:57 +03:00
Tom Weaver 7c781621f8 [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
2021-12-08 15:43:02 +00:00
David Green d43c801d13 [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
2021-12-08 15:40:23 +00:00
Sanjay Patel a7ed21aa1e [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 / f65be726ab
2021-12-08 10:27:50 -05:00
Sam McCall 2676759bf2 [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
2021-12-08 16:16:53 +01:00
Jake Egan b73cf6207e [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
2021-12-08 10:10:42 -05:00
Jolanta Jensen 77b2bb5567 [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
2021-12-08 15:00:58 +00:00
Pavel Labath ae316ac66f [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.
2021-12-08 15:56:32 +01:00
Kirill Bobyrev eecfc73ae4
[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
2021-12-08 15:55:50 +01:00
Matthias Springer 847710f7b7 [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
2021-12-08 23:51:18 +09:00
Jamie Schmeiser 84687405ce 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
2021-12-08 09:50:51 -05:00
Jake Egan 158ac4a627 [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
2021-12-08 09:17:32 -05:00
Haojian Wu 5bb0a9075c [libc] Fix two missing cases in 1c92911e9e
Fix the broken build.
2021-12-08 15:14:21 +01:00