Dmitry Vyukov [Tue, 10 Aug 2021 18:19:58 +0000 (20:19 +0200)]
tsan: extend MutexSet to memorize mutex address/stack_id
We currently memorize u64 id + epoch for each mutex.
The new tsan runtime will memorize address + stack_id instead.
But switching to address + stack_id requires new trace,
which in turn requires new MutexSet and some other changes.
Extend MutexSet to support both new and old info to break
the dependency cycles. The plan is to remove the old
info/methods after switching to the new runtime.
Reviewed By: vitalybuka, melver
Differential Revision: https://reviews.llvm.org/D107910
Stuart Ellis [Thu, 12 Aug 2021 10:42:08 +0000 (11:42 +0100)]
[flang][driver] Add support for Frontend Plugins
Introducing a plugin API and a simple HelloWorld Plugin example.
This patch adds the `-load` and `-plugin` flags to frontend driver and
the code around using custom frontend actions from within a plugin
shared library object.
It also adds to the Driver-help test to check the help option with the
updated driver flags.
Additionally, the patch creates a plugin-example test to check the
HelloWorld plugin example runs correctly. As part of this, a new CMake
flag (`FLANG_BUILD_EXAMPLES`) is added to allow the example to be built
and for the test to run.
This Plugin API has only been tested on Linux.
Reviewed By: awarzynski
Differential Revision: https://reviews.llvm.org/D106137
David Truby [Thu, 12 Aug 2021 10:29:12 +0000 (10:29 +0000)]
[llvm][sve] Fix erroneous tests for fixed length extending loads
Martin Storsjö [Wed, 11 Aug 2021 10:53:43 +0000 (13:53 +0300)]
[clang] [MinGW] Consider the per-target libc++ include directory too
The existing logic for per-target libc++ include directories only
seem to exist for the Gnu and Fuchsia drivers, added in
ea12d779bc238c387511fe7462020f4ecf4a8246 / D89013.
This is less generic than the corresponding case in the Gnu driver,
but matches the existing level of genericity in the MinGW driver
(and others too).
Differential Revision: https://reviews.llvm.org/D107893
Martin Storsjö [Wed, 11 Aug 2021 11:06:28 +0000 (14:06 +0300)]
[CMake] Make the vendor part of default mingw triples consistent
Consistently use 'w64' as vendor string; it was 'pc' for the original
i686 triple added in
91bd6c922d7cf, but the later x86_64 triple
used 'w64' as vendor, added in
d6c1f37f86440.
When the arm triples were added in
c84ad73a27da6, the differing
vendors were copied over accidentally to the arm targets too.
When using per-target runtime directories, having inconsistent vendor
parts of the target triples is fatal.
Differential Revision: https://reviews.llvm.org/D107894
Martin Storsjö [Wed, 11 Aug 2021 20:41:24 +0000 (23:41 +0300)]
[LLD] [MinGW] Add more options for disabling flags in the executable
In
e72403f96de7f1c681acd5968f72aa986412dfce, we added the flag
"--no-dynamicbase" for disabling the dynamicbase flag which we set
by default. At the time, ld.bfd didn't have any corresponding
option (as ld.bfd defaulted to not setting the flag). Almost at
the same time, corresponding options were added to ld.bfd for
disabling it (while it was being enabled by default), with a
different name, "--disable-dynamicbase".
Thus add the "--disable-dynamicbase" option. Make this default
one advertised in the help listing, but keep the "--no-dynamicbase"
form as an alias. Also improve checking for the last option set
if there are multiple ones on the same command line.
Also add corresponding disable options for a lot of other flags
that we set by default, also added in ld.bfd in the same commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=
514b4e191d5f46de8e142fe216e677a35fa9c4bb
Differential Revision: https://reviews.llvm.org/D107930
Florian Hahn [Thu, 12 Aug 2021 10:25:10 +0000 (11:25 +0100)]
[Matrix] Update column.major.load call in PPC test.
a1ef81de35a4bac6d3 adjusted the definition of the intrinsic, but did not
update a PowerPC test. Fix the test by updating the call & declaration
of @llvm.matrix.column.major.load.
Igor Kudrin [Thu, 12 Aug 2021 10:12:09 +0000 (17:12 +0700)]
[llvm-objcopy][ELF] Avoid reordering section headers
As for now, llvm-objcopy sorts section headers according to the offsets
of the sections in the input file. That can corrupt section references
in the dynamic symbol table because it is a loadable section and as such
is not updated by the tool. Even though the section references are not
required for loading the binary correctly, they are still handy for a
user who analyzes the file.
While the patch removes global reordering of section headers, it layouts
the sections in the same way as before, i.e. according to their original
offsets. All that helps the output file to resemble the input better.
Note that the patch removes sorting SHT_GROUP sections to the start of
the list, which was introduced in D62620 in order to ensure that they
come before the group members, along with the corresponding test. The
original issue was caused by the sorting of section headers, so dropping
the sorting also resolves the issue.
Differential Revision: https://reviews.llvm.org/D107653
Florian Hahn [Thu, 12 Aug 2021 08:53:04 +0000 (09:53 +0100)]
[Matrix] Overload stride arg in matrix.columnwise.load/store.
This patch adjusts the intrinsics definition of
llvm.matrix.column.major.load and llvm.matrix.column.major.store to
allow overloading the type of the stride. The bitwidth of the stride is
used to perform the offset computation.
This fixes a crash when using __builtin_matrix_column_major_load or
__builtin_matrix_column_major_store on 32 bit platforms. The stride argument
of the builtins are defined as `size_t`, which is 32 bits wide on 32 bit
platforms.
Note that we still perform offset computations with 64 bit width on 32
bit platforms for accesses that do not take a user-specified stride.
This can be fixed separately.
Fixes PR51304.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D107349
David Truby [Wed, 11 Aug 2021 14:59:00 +0000 (14:59 +0000)]
[llvm][sve] Lowering for VLS extending loads
This patch enables extending loads for fixed length SVE code generation.
There is a slight regression here in the mulh tests; since these tests
load the parameter and then extend it these are treated as extending
loads which are merged, preventing the mulh instruction from being
generated. As this affects scalable SVE codegen as well this should be
addressed in a separate patch.
Reviewed By: bsmith
Differential Revision: https://reviews.llvm.org/D107057
Whisperity [Thu, 12 Aug 2021 08:41:46 +0000 (10:41 +0200)]
[clang-tidy][docs] Remove the entry about 'cppcoreguidelines-init-variables' from the release notes
The patch in http://reviews.llvm.org/D106431 landed in commit
4a097efe7784767b7d12ffcb8f2b22b9f4d045e2 to the main branch.
However, this patch was also backported to upcoming release 13.0.0 in
commit
8dcdfc0de84f60b5b4af97ac5b357881af55bc6e, which makes this entry
in the release notes **NOT** a new thing for the purposes of 14.0.0.
Krasimir Georgiev [Thu, 12 Aug 2021 08:26:56 +0000 (10:26 +0200)]
[clang-format] improve distinction of K&R function definitions vs attributes
After
https://github.com/llvm/llvm-project/commit/
9da70ab3d43c79116f80fc06aa7cf517374ce42c
we saw a few regressions around trailing attribute definitions and in
typedefs (examples in the added test cases). There's some tension
distinguishing K&R definitions from attributes at the parser level,
where we have to decide if we need to put the type of the K&R definition
on a new unwrapped line before we have access to the rest of the line,
so we're scanning backwards and looking for a pattern like f(a, b). But
this type of pattern could also be an attribute macro, or the whole
declaration could be a typedef itself. I updated the code to check for a
typedef at the beginning of the line and to not consider raw identifiers
as possible first K&R declaration (but treated as an attribute macro
instead). This is not 100% correct heuristic, but I think it should be
reasonably good in practice, where we'll:
* likely be in some very C-ish code when using K&R style (e.g., stuff
that uses `struct name a;` instead of `name a;`
* likely be in some very C++-ish code when using attributes
* unlikely mix up the two in the same declaration.
Ideally, we should only decide to add the unwrapped line before the K&R
declaration after we've scanned the rest of the line an noticed the
variable declarations and the semicolon, but the way the parser is
organized I don't see a good way to do this in the current parser, which
only has good context for the previously visited tokens. I also tried
not emitting an unwrapped line there and trying to resolve the situation
later in the token annotator and the continuation indenter, and that
approach seems promising, but I couldn't make it to work without
messing up a bunch of other cases in unit tests.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D107950
Freddy Ye [Thu, 12 Aug 2021 08:24:16 +0000 (16:24 +0800)]
[X86] Reverse *_set_ph and *_setr_ph 's set order.
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D107946
David Spickett [Thu, 12 Aug 2021 08:24:47 +0000 (08:24 +0000)]
[compiler-rt][fuzzer] Mark flags test unsupported on AArch64 Linux
Previously I xfailed this but it's only failing in stage 2 so
we get xpasses for stage 1. Disable it completely.
Cullen Rhodes [Thu, 12 Aug 2021 07:28:56 +0000 (07:28 +0000)]
[AArch64] NFC: Remove register decoder tables in disassembler
The register classes are generated by TableGen, use them instead of
handwritten tables.
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D107763
Fangrui Song [Thu, 12 Aug 2021 07:05:04 +0000 (00:05 -0700)]
[Object] Add missing PPC_DYNAMIC_TAG macros
Krasimir Georgiev [Thu, 12 Aug 2021 06:51:58 +0000 (08:51 +0200)]
[clang-format] handle trailing comments in function definition detection
A follow-up to
https://github.com/llvm/llvm-project/commit/
f6bc614546e169bb1b17a29c422ebace038e6c62
where we handle the case where the semicolon is followed by a trailing
comment.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D107907
Dmitry Vyukov [Thu, 12 Aug 2021 06:14:22 +0000 (08:14 +0200)]
tsan: fix build breakage due to AppMemBeg
AppMemBeg was renamed to LoAppMemBeg in
3830c93478
("tsan: rename kAppMemBeg to kLoAppMemBeg").
Rename remaining uses of the old name in tsan_platform_mac.cpp.
Differential Revision: https://reviews.llvm.org/D107948
Fangrui Song [Thu, 12 Aug 2021 05:41:52 +0000 (22:41 -0700)]
[profile][test] Add -no-pie to make value profile merge work on Linux with default PIE
Alpine enables PIE by default.
Walter Erquinigo [Thu, 12 Aug 2021 03:05:31 +0000 (20:05 -0700)]
[tests] [trace] Add a more comprehensive test for `thread trace export ctf` command
Follow up on https://reviews.llvm.org/D105741
- Add new test that exhaustively checks the output file's content
- Fix typos in documentation and other minor fixes
Reviewed By: wallace
Original Author: jj10306
Differential Revision: https://reviews.llvm.org/D107674
Christudasan Devadasan [Tue, 10 Aug 2021 03:36:21 +0000 (23:36 -0400)]
Reapply "SROA: Enhance speculateSelectInstLoads"
Originally committed as
ffc3fb665d0a0dccd64cc8c803ad8cc1a0d5dfa1
Reverted in
fcf2d5f40296be4e0f0e954001beb7814f97a212 due to an
assertion failure.
Original commit message:
Allow the folding even if there is an
intervening bitcast.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D106667
Daniel Kolesa [Thu, 12 Aug 2021 01:25:41 +0000 (18:25 -0700)]
[CMake] Enable clang_rt.crt{begin,end} on ppc32/ppc64
Jason Molenda [Thu, 12 Aug 2021 00:34:52 +0000 (17:34 -0700)]
Update gdbremote_testcase.py to allow new k-v pair in qMemoryRegionInfo
Jason Molenda [Thu, 12 Aug 2021 00:17:39 +0000 (17:17 -0700)]
Fix two bugs with stack corefiles patch, restrict test built debugserver
These two tests, TestSkinnyCorefile.py and TestStackCorefile.py,
require a new debugserver on darwin systems to run correctly; for now,
skip them if the system debugserver is in use. There's no easy way to
test if the debugserver being used supports either of these memory
region info features. For end users, the fallback will be a full
corefile and that's not the worst thing, but for the tests it is a
problem.
Amara Emerson [Wed, 11 Aug 2021 23:26:51 +0000 (16:26 -0700)]
[AArch64][GlobalISel] Simplify/nuke the merge/unmerge legalizer rules.
These rules were originally written when the new predicate based legalizer
was introduced in an attempt to preserve existing behaviour. It wasn't
properly kept up to date as things like vector support was split out into
G_CONCAT_VECTORS, and frankly, even if it was, it was too complex.
It's much easier to start from scratch with what we can actually support,
which is just a few type combinations. Anything illegal we should either
legalize, or should be eliminated as a side effect of artifact combination.
Differential Revision: https://reviews.llvm.org/D107937
Michael Jones [Thu, 5 Aug 2021 21:06:08 +0000 (21:06 +0000)]
[libc] add strtoll function and backend
This change adds the stroll function, but most of the implementation is
in the new file str_conv_utils.h since many of the other integer
conversion functions are implemented through what are effectively calls
to strtoll.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D107792
Tyler Augustine [Wed, 11 Aug 2021 23:00:29 +0000 (23:00 +0000)]
Support post-processing Ops in unrolled loop iterations
This can be useful when one needs to know which unrolled iteration an Op belongs to, for example, conveying noalias information among memory-affecting ops in parallel-access loops.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D107789
wlei [Mon, 9 Aug 2021 18:44:33 +0000 (11:44 -0700)]
[CSSPGO][llvm-profgen] Trim and merge context beforehand to reduce memory usage
Currently we use a centralized string map(StringMap<FunctionSamples> ProfileMap) to store the profile while populating the sample, which might cause the memory usage bottleneck. I saw in an extreme case, there are thousands of samples whose context stack depth is >= 100. The memory consumption can be greater than 100GB.
As here the context is used for inlining, we can assume we won't have so many of inlinees keeping inlined at the same root function, so this change tried to cap the context stack and merge the samples for peak memory reduction and this is done after recursion compression.
The default value is -1 meaning no depth limit, in the future we can tune to a smaller one.
Reviewed By: hoy, wenlei
Differential Revision: https://reviews.llvm.org/D107800
Benjamin Kramer [Wed, 11 Aug 2021 22:58:52 +0000 (00:58 +0200)]
[mlir] Drop LLVM dialect from TestPolynomialApproximation
No longer needed after
c1ebefdf77f34cc0b23597071098c8f8a8d2839b
Mehdi Amini [Wed, 11 Aug 2021 22:50:44 +0000 (22:50 +0000)]
Add missing cmake dep to fix MLIR build with BUILD_SHARED_LIBS=ON (NFC)
Jonas Devlieghere [Wed, 11 Aug 2021 21:54:32 +0000 (14:54 -0700)]
[lldb] Fix TestFormattersBoolRefPtr on AS
BOOL is bool instead of signed char on ARM. See
https://reviews.llvm.org/D93421#inline-874116 for details.
Usman Nadeem [Wed, 11 Aug 2021 21:44:44 +0000 (14:44 -0700)]
[AArch64][SVE] Remove assertion/range check for i16 values during immediate selection
The assertion can fail in some cases when an i16 constant is promoted
to i32.
e.g. in the added test case the value `i16 -32768` is within the range
of i16 but the assert fails when the constant is promoted to positive
`i32 32768` by an earlier call to DAG.getConstant().
Differential Revision: https://reviews.llvm.org/D107880
Change-Id: I2f6179783cbc9630e6acab149a762b43c65664de
Jonas Devlieghere [Wed, 11 Aug 2021 21:40:15 +0000 (14:40 -0700)]
[lldb] Replace assertTrue(foo in bar) with assertIn(foo, bar)
The benefit of using assertIn is an improved error message when the
assertion fails:
AssertionError: False is not True
becomes
AssertionError: 'have ints 5 20 20 5' not found in '""'
Jonas Devlieghere [Wed, 11 Aug 2021 21:26:31 +0000 (14:26 -0700)]
[lldb] Skip TestConcurrent.* watchpoint tests for Darwin on ARM
All TestConcurrent.* tests that involve watchpoints are broken on
ARM-based Darwin platforms, including Apple Silicon.
rdar://
81811539
Jonas Devlieghere [Wed, 11 Aug 2021 21:13:28 +0000 (14:13 -0700)]
[lldb] Update MemoryRegionInfo ctors in unit tests
Louis Dionne [Wed, 11 Aug 2021 16:23:55 +0000 (12:23 -0400)]
[libc++] Avoid conflating stderr and stdout in the DSL
This is a workaround until https://reviews.llvm.org/D81892 is merged
and the internal Lit shell stops conflating error output with normal
output. Without this, any program that writes to stderr will trip up
the programOutput function, because it will pick up the '# command stderr:'
string and think it's part of the command's stdout.
rdar://
81056048
Differential Revision: https://reviews.llvm.org/D107912
Louis Dionne [Wed, 11 Aug 2021 14:34:51 +0000 (10:34 -0400)]
[libc++] Remove workarounds for missing __builtin_addressof
All supported compilers implement __builtin_addressof. Even MSVC implements
addressof as a simple call to __builtin_addressof, so it would work if we
were to port libc++ to that compiler.
Differential Revision: https://reviews.llvm.org/D107905
Amara Emerson [Wed, 11 Aug 2021 20:41:43 +0000 (13:41 -0700)]
[AArch64][GlobalISel] Add ptradd_immed_chain combine to post-legalizer combiner.
Akira Hatanaka [Wed, 11 Aug 2021 19:55:28 +0000 (12:55 -0700)]
[ObjC][ARC] Don't form a StoreStrong call if it is unsafe to move the
release call
findSafeStoreForStoreStrongContraction checks whether it's safe to move
the release call to the store by inspecting all instructions between the
two, but was ignoring retain instructions. This was causing objects to
be released and deallocated before they were retained.
rdar://
81668577
Jonas Devlieghere [Wed, 11 Aug 2021 20:05:47 +0000 (13:05 -0700)]
[lldb] Skip TestStepOverWatchpoint on AS
Include macosx in the list of operating systems for which this is broken
on arm64.
rdar://
34027183
Jason Molenda [Wed, 11 Aug 2021 20:37:31 +0000 (13:37 -0700)]
Add the ability to process save-core stack-memory-only corefiles
Add a field to the qMemoryRegionInfo packet where the remote stub
can describe the type of memory -- heap, stack. Keep track of
memory regions that are stack memory in lldb. Add a new "--style
stack" to process save-core to request that only stack memory be
included in the corefile.
Differential Revision: https://reviews.llvm.org/D107625
Emilio Cota [Wed, 11 Aug 2021 20:27:04 +0000 (22:27 +0200)]
[mlir] BUILD.bazel: remove LLVMDialect from MathTransforms
c1ebefdf77f3 "[mlir] Make polynomial approximation emit
std instead of LLVM ops" removed the dependence on LLVMDialect.
Remove the dependence also from BUILD.bazel.
Reviewed By: bkramer
Differential Revision: https://reviews.llvm.org/D107908
peter klausler [Tue, 10 Aug 2021 20:13:50 +0000 (13:13 -0700)]
[flang] Fix list-directed plural repeated null values at end of record
A repeated null value at the end of an input record with a count > 1
would incorrectly advance to the next record when resumed. Fix.
Improve some poor naming and code flow noticed while debugging, so
next time will be easier.
Extend a unit test to check this case.
Differential Revision: https://reviews.llvm.org/D107917
peter klausler [Tue, 10 Aug 2021 21:08:15 +0000 (14:08 -0700)]
[flang] Fix two typos in API names
Differential Revision: https://reviews.llvm.org/D107916
Stefan Pintilie [Wed, 4 Aug 2021 14:16:11 +0000 (09:16 -0500)]
[PowerPC] Do not define __PRIVILEGED__
We do not want to define __PRIVILEGED__. There is no use case for the
definition and gcc does not define it. This patch removes that definition.
Reviewed By: lei, NeHuang
Differential Revision: https://reviews.llvm.org/D107461
Aart Bik [Wed, 11 Aug 2021 17:22:12 +0000 (10:22 -0700)]
[mlir][linalg] fixed typo
Differential Revision: https://reviews.llvm.org/D107915
Reid Kleckner [Wed, 11 Aug 2021 18:52:37 +0000 (11:52 -0700)]
[lld] Add llvm-profdata to lld test deps
As of https://reviews.llvm.org/D104431, the test suite runs
llvm-profdata, so it must be added to the list of deps.
Reid Kleckner [Wed, 11 Aug 2021 18:42:20 +0000 (11:42 -0700)]
Simplify dllexport class member code, NFC
We can hoist the check for the dllexport attribute to before the check
if this is a static data member or method.
Usman Nadeem [Tue, 10 Aug 2021 00:21:24 +0000 (17:21 -0700)]
[InstSimplify] Eliminate vector reverse of a splat vector
experimental.vector.reverse(splat(X)) -> splat(X)
Differential Revision: https://reviews.llvm.org/D107793
Change-Id: Id29ba88fd669ff8686712e96b1bdc46dda5b853c
Rong Xu [Wed, 11 Aug 2021 17:56:03 +0000 (10:56 -0700)]
[SampleFDO] Add two passes of MIRAddFSDiscriminatorsPass
This patch adds Pass1 of MIRADDFSDiscriminatorsPass before register
allocation, and Pass2 of MIRAddFSDiscriminatorsPass before
Block-Placement. This is still under --enable-fs-discrmininator
option (default false).
This would reduce the turn-around time for FSAFDO transition.
Differential Revision: https://reviews.llvm.org/D104579
Rob Suderman [Wed, 11 Aug 2021 18:05:08 +0000 (11:05 -0700)]
[mlir][tosa] Migrate tosa to more efficient linalg.conv
Existing linalg.conv2d is not well optimized for performance. Changed to a
version that is more aligned for optimziation. Include the corresponding
transposes to use this optimized version.
This also splits the conv and depthwise conv into separate implementations
to avoid overly complex lowerings.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D107504
Arthur O'Dwyer [Fri, 6 Aug 2021 18:50:09 +0000 (14:50 -0400)]
[libc++] Restore `basic_ios`'s implicit conversion to `bool` in C++03 mode.
efriedma noted that D104682 broke this test case, reduced from SPEC2006.
#include <istream>
bool a(std::istream a) {
return a.getline(0,0) == 0;
}
We can unbreak it by restoring the conversion to something-convertible-to-bool.
We chose `void*` in order to match libstdc++.
For more ancient history, see PR19460: https://bugs.llvm.org/show_bug.cgi?id=19460
Differential Revision: https://reviews.llvm.org/D107663
Raphael Isemann [Wed, 11 Aug 2021 17:14:56 +0000 (19:14 +0200)]
[lldb][NFC] Define DWARFDIE::children out-of-line instead of using template magic
As pointed out by David in D103172 (thanks!)
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D106743
Kazu Hirata [Wed, 11 Aug 2021 16:55:00 +0000 (09:55 -0700)]
[DWARF] Remove extractFast (NFC)
The last use was removed on Dec 13, 2016 in commit
c8c1032c0c52d7f851ccfa29ec850b24047ebcb9. This patch repurposes the
function comment for the other variant of extractFast.
Sanjay Patel [Wed, 11 Aug 2021 16:41:47 +0000 (12:41 -0400)]
[InstCombine] avoid breaking up min/max (cmp+sel) idioms
This is a quick fix for a motivating case that looks like this:
https://godbolt.org/z/GeMqzMc38
As noted, we might be able to restore the min/max patterns
with select folds, or we just wait for this to become easier
with canonicalization to min/max intrinsics.
Sanjay Patel [Wed, 11 Aug 2021 16:09:03 +0000 (12:09 -0400)]
[InstCombine] add tests for inc/dec with min/max; NFC
Yolanda Chen [Wed, 11 Aug 2021 16:45:55 +0000 (09:45 -0700)]
[LTO][lld] Add lto-pgo-warn-mismatch option
When enable CSPGO for ThinLTO, there are profile cfg mismatch warnings that will cause lld-link errors (with /WX)
due to source changes (e.g. `#if` code runs for profile generation but not for profile use)
To disable it we have to use an internal "/mllvm:-no-pgo-warn-mismatch" option.
In contrast clang uses option ”-Wno-backend-plugin“ to avoid such warnings and gcc has an explicit "-Wno-coverage-mismatch" option.
Add "lto-pgo-warn-mismatch" option to lld COFF/ELF to help turn on/off the profile mismatch warnings explicitly when build with ThinLTO and CSPGO.
Differential Revision: https://reviews.llvm.org/D104431
Mitch Phillips [Wed, 11 Aug 2021 16:21:28 +0000 (09:21 -0700)]
[scudo] Add GWP-ASan state/metadata pointer proxies.
Provide accessor proxies for the gwp-asan regions that are useful in
symbolizing dumps offline. Should be useful for Fuchsia to be able to
locate these internal pointers to stash the data in a minidump.
Reviewed By: cryptoad
Differential Revision: https://reviews.llvm.org/D107909
Med Ismail Bennani [Wed, 11 Aug 2021 15:56:36 +0000 (16:56 +0100)]
[lldb/Commands] Fix heap-use-after-free error in CommandObjectProcess
This patch should fix the use-after-free error that was brought up by
the LLDB ASAN Green Dragon bot.
This is caused because the `StringRef` object was acquired too early
before being use and by the underlying memory was modified which caused
it to point to null memory.
Fetching back the string reference close to its usage location should
fix the issue.
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Fraser Cormack [Wed, 11 Aug 2021 11:12:17 +0000 (12:12 +0100)]
[LegalizeTypes][NFC] Remove else-after-return
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D107890
Mark de Wever [Wed, 11 Aug 2021 15:33:54 +0000 (17:33 +0200)]
[libc++][doc] Improve contributor documentation.
Addresses the post-commit review comments of D107596.
AndreyChurbanov [Wed, 11 Aug 2021 14:58:52 +0000 (17:58 +0300)]
[OpenMP][NFC] libomp: reduced timeouts in the test from 50 to 2 sec.
Arnold Schwaighofer [Tue, 10 Aug 2021 14:45:32 +0000 (07:45 -0700)]
CodeGen: No need to check for isExternC if HasStrictReturn is already false
NFC intended.
Differential Revision: https://reviews.llvm.org/D107841
Benjamin Kramer [Wed, 11 Aug 2021 12:09:41 +0000 (14:09 +0200)]
[mlir] Make polynomial approximation emit std instead of LLVM ops
This is a bit cleaner and removes issues with 2d vectors. It also has a
big impact on constant folding, hence the test changes.
Differential Revision: https://reviews.llvm.org/D107896
Alex Zinenko [Wed, 11 Aug 2021 11:23:40 +0000 (13:23 +0200)]
[mlir] Add std.bitcast -> llvm.bitcast conversion
The conversion is a straightforward one-to-one mapping with optional unrolling
for nD vectors, similarly to other cast operations.
Depends On D107889
Reviewed By: cota, akuegel
Differential Revision: https://reviews.llvm.org/D107891
Alex Zinenko [Wed, 11 Aug 2021 11:21:31 +0000 (13:21 +0200)]
[mlir] Tighten LLVM_AnyNonAggregate ODS type constraint
The constraint was checking that the type is not an LLVM structure or array
type, but was not checking that it is an LLVM-compatible type, making it accept
incorrect types. As a result, some LLVM dialect ops could process values that
are not compatible with the LLVM dialect leading to further issues with
conversions and translations that assume all values are LLVM-compatible. Make
LLVM_AnyNonAggregate only accept LLVM-compatible types.
Reviewed By: cota, akuegel
Differential Revision: https://reviews.llvm.org/D107889
LLVM GN Syncbot [Wed, 11 Aug 2021 14:16:15 +0000 (14:16 +0000)]
[gn build] Port
89a7bdb1f37a
Victor Huang [Wed, 11 Aug 2021 14:09:31 +0000 (09:09 -0500)]
[PowerPC][NFC] Update llvm/test/CodeGen/PowerPC/2010-05-03-retaddr1.ll with utils/update_llc_test_checks.py
Louis Dionne [Tue, 10 Aug 2021 15:35:27 +0000 (11:35 -0400)]
[libc++] Remove _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
All supported compilers have implemented __has_unique_object_representations
for a while, so it's reasonable to remove the workaround.
Differential Revision: https://reviews.llvm.org/D107834
Louis Dionne [Tue, 10 Aug 2021 16:44:20 +0000 (12:44 -0400)]
[libc++] Remove _LIBCPP_HAS_NO_IS_AGGREGATE
All supported compilers have been supporting __is_aggregate for a long
time now, so it's reasonable to remove this workaround.
Differential Revision: https://reviews.llvm.org/D107833
Louis Dionne [Mon, 9 Aug 2021 19:41:26 +0000 (15:41 -0400)]
[libc++] Add the __bind_back and __compose helpers
Those are going to be used to implement range adaptors,
see D107098 for details.
Differential Revision: https://reviews.llvm.org/D107785
David Spickett [Wed, 11 Aug 2021 13:53:18 +0000 (13:53 +0000)]
[compiler-rt][fuzzer] Xfail flags test on AArch64 Linux
This fails with:
/tmp/FlagsTest-5761bc.o: In function `sancov.module_ctor_8bit_counters':
FlagsTest.cpp:(.text.sancov.module_ctor_8bit_counters[sancov.module_ctor_8bit_counters]+0x14): undefined reference to `__start___sancov_cntrs'
FlagsTest.cpp:(.text.sancov.module_ctor_8bit_counters[sancov.module_ctor_8bit_counters]+0x18): undefined reference to `__stop___sancov_cntrs'
<...>
Since https://reviews.llvm.org/D107374. However the changes
there don't seem to be the real fault so xfail while I look into it.
Joseph Huber [Fri, 6 Aug 2021 21:11:13 +0000 (17:11 -0400)]
[OpenMP]Fix PR50336: Remove temporary files in the offload bundler tool
Temporary files created by the offloading device toolchain are not removed
after compilation when using a two-step compilation. The offload-bundler uses a
different filename for the device binary than the `.o` file present in the
Job's input list. This is not listed as a temporary file so it is never
removed. This patch explicitly adds the device binary as a temporary file to
consume it. This fixes PR50336.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D107668
Raphael Isemann [Wed, 11 Aug 2021 11:47:02 +0000 (13:47 +0200)]
[lldb][docs] Remove index entry to removed StructuredDataPlugins
This page was removed in
b2e25572d2a7b65a018580097b50910b3049ab65
Dmitry Vyukov [Wed, 11 Aug 2021 10:39:38 +0000 (12:39 +0200)]
tsan: fix active mapping selection
Fix bug introduced by commit
5d106f16b972.
SANITIZER_IOSSIM is always defined,
it's the value 0/1 that's meaningful.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D107888
Balázs Kéri [Wed, 11 Aug 2021 09:19:19 +0000 (11:19 +0200)]
[clang][analyzer] Improve bug report in alpha.security.ReturnPtrRange
Add some notes and track of bad return value.
Reviewed By: steakhal
Differential Revision: https://reviews.llvm.org/D107051
Raphael Isemann [Wed, 11 Aug 2021 10:26:22 +0000 (12:26 +0200)]
[lldb][NFC] Fix small format error in TestCppVirtualFunctions
Raphael Isemann [Wed, 11 Aug 2021 10:08:36 +0000 (12:08 +0200)]
[lldb] Rework 'lldb' substitution workaround in dwarf5-lazy-dwo.c
This test is specifying the lldb log channel via `ll""db` which only really works
because the command parser ends up parsing that as `lldb`. Just putting the
channel name in quotes is enough to avoid the lldb command substitution and
doesn't rely on this weird parser behaviour.
Stefan Gränitz [Fri, 6 Aug 2021 12:34:31 +0000 (12:34 +0000)]
[Orc] Enable debug object tests only on x86_64 hosts
These tests rely on running IR code with an explicit x86_64 target triple. They won't work on other architectures. (They won't work for 32-bit processes on x86_64 hosts either. We will take care of this later.)
Differential Revision: https://reviews.llvm.org/D107640
David Green [Wed, 11 Aug 2021 09:35:53 +0000 (10:35 +0100)]
[ARM] Add extra debug messages for validating live outs. NFC
We are running into more and more cases where the liveouts of low
overhead loops do not validate. Add some extra debug messages to make it
clearer why.
Florian Mayer [Tue, 10 Aug 2021 20:02:13 +0000 (21:02 +0100)]
[hwasan] Fix test with TCO eliminating free frame.
This broke https://lab.llvm.org/buildbot/#/builders/37/builds/6016/steps/10/logs/stdio
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D107864
Wang, Pengfei [Wed, 11 Aug 2021 08:25:42 +0000 (16:25 +0800)]
Revert "[lld] Add lto-pgo-warn-mismatch option"
This reverts commit
0cfb00a1c98f8ca3749b8d829b7301f397efa302.
Dmitry Vyukov [Wed, 11 Aug 2021 06:28:01 +0000 (08:28 +0200)]
tsan: fix Printf format string
Reported on D107745
Reported-by: Wolfgang Pieb (wolfgangp)
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107881
LLVM GN Syncbot [Wed, 11 Aug 2021 08:16:37 +0000 (08:16 +0000)]
[gn build] Port
Daniel Kiss [Wed, 11 Aug 2021 08:11:31 +0000 (10:11 +0200)]
[libunwind] Compile with -Wunused-but-set-variable
-Wunused-but-set-variable triggers a warning even the block of code is effectively dead.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D107835
Daniel Kiss [Wed, 11 Aug 2021 08:11:30 +0000 (10:11 +0200)]
[Arm][Unwind][libc++abi] Add _Unwind_ForcedUnwind to EHABI.
_Unwind_ForcedUnwind is not mandated by the EHABI but for compatibilty
reasons adding so the interface to higher layers would be the same.
Dropping EHABI specific _Unwind_Stop_Fn definition since it is not defined by EHABI.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D89570
Daniel Kiss [Wed, 11 Aug 2021 08:11:27 +0000 (10:11 +0200)]
[Unwind] Split unwind.h
Moving Itanium and ArmEHABI specific implementations to dedicated files.
This is a NFC patch.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D106461
Alexander Belyaev [Wed, 11 Aug 2021 08:04:12 +0000 (10:04 +0200)]
Revert "Bufferization for tiled loop."
This reverts commit
edaffebcb2a62b0195e23fe7d4ead005822865c3.
Alexander Belyaev [Wed, 11 Aug 2021 08:01:36 +0000 (10:01 +0200)]
Revert "[mlir] Change the pattern for TiledLoopOp bufferization."
This reverts commit
2f946eaa9d2648b883b2a1e567b23fff307f13d9.
Cullen Rhodes [Wed, 11 Aug 2021 07:07:32 +0000 (07:07 +0000)]
[AArch64][SME] Support ptrue(s) in streaming mode
The ptrue and ptrues instructions are legal in streaming mode, missed in
D106272.
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-06/SVE-Instructions
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D107807
Rainer Orth [Wed, 11 Aug 2021 07:27:51 +0000 (09:27 +0200)]
[ELF] Don't emit SHF_GNU_RETAIN on Solaris
The introduction of `SHF_GNU_RETAIN` has caused massive problems on Solaris.
Initially, as reported in Bug 49437, it caused dozens of testsuite failures
on both sparc and x86. The objects were marked as `ELFOSABI_NONE`, but
`SHF_GNU_RETAIN` is a GNU extension. In the native Solaris ABI, that flag
(in the range for OS-specific values) is `SHF_SUNW_ABSENT` with a
completely different semantics, which confuses Solaris `ld` very much.
Later, the objects became (correctly) marked `ELFOSABI_GNU`, which Solaris
`ld` doesn't support, causing it to SEGV and break the build. The linker
is currently being hardened to not accept non-native OS ABIs to avoid this.
The need for linker support is already documented in
`clang/include/clang/Basic/AttrDocs.td`, but not currently checked.
This patch avoids all this by not emitting `SHF_GNU_RETAIN` on Solaris at all.
Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86_64-pc-linux-gnu`.
Differential Revision: https://reviews.llvm.org/D107747
Matthias Springer [Wed, 11 Aug 2021 06:59:43 +0000 (15:59 +0900)]
[mlir][Analysis][NFC] Remove code duplication around getFlattenedAffineExprs
Remove code duplication in `addLowerOrUpperBound` and `composeMatchingMap`.
Differential Revision: https://reviews.llvm.org/D107814
Matthias Springer [Wed, 11 Aug 2021 06:48:21 +0000 (15:48 +0900)]
[mlir][Analysis][NFC] Reimplement FlatAffineConstraints::composeMap
Reimplement this function in terms of `composeMatchingMap`.
Also fix a bug in `composeMatchingMap` where local dims of `this` could be missing in `localCst`.
Differential Revision: https://reviews.llvm.org/D107813
madhur13490 [Tue, 10 Aug 2021 17:22:29 +0000 (22:52 +0530)]
[DAG] Reword comment for EnforceNodeIdInvariant and InvalidateNodeId. NFC.
Reviewed By: niravd
Differential Revision: https://reviews.llvm.org/D107845
Yolanda Chen [Wed, 11 Aug 2021 05:22:36 +0000 (13:22 +0800)]
[lld] Add lto-pgo-warn-mismatch option
When enable CSPGO for ThinLTO, there are profile cfg mismatch warnings that will cause lld-link errors (with /WX).
To disable it we have to use an internal "/mllvm:-no-pgo-warn-mismatch" option.
In contrast clang uses option ”-Wno-backend-plugin“ to avoid such warnings and gcc has an explicit "-Wno-coverage-mismatch" option.
Add this "lto-pgo-warn-mismatch" option to lld to help turn on/off the profile mismatch warnings explicitly when build with ThinLTO and CSPGO.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D104431
Matthias Springer [Wed, 11 Aug 2021 06:15:30 +0000 (15:15 +0900)]
[mlir][Analysis][NFC] Reimplement FlatAffineConstraints::addLowerOrUpperBound
Reimplement this function in terms of the function variant without Value semantics.
Differential Revision: https://reviews.llvm.org/D107729
Petr Hosek [Tue, 10 Aug 2021 18:03:07 +0000 (11:03 -0700)]
[InstrProfiling] Generate runtime hook for Fuchsia
When none of the translation units in the binary have been instrumented
we shouldn't need to link the profile runtime. However, because we pass
-u__llvm_profile_runtime on Linux and Fuchsia, the runtime would still
be pulled in and incur some overhead. On Fuchsia which uses runtime
counter relocation, it also means that we cannot reference the bias
variable unconditionally.
This change modifies the InstrProfiling pass to pull in the profile
runtime only when needed by declaring the __llvm_profile_runtime symbol
in the translation unit only when needed. For now we restrict this only
for Fuchsia, but this can be later expanded to other platforms. This
approach was already used prior to
9a041a75221ca, but we changed it
to always generate the __llvm_profile_runtime due to a TAPI limitation,
but that limitation may no longer apply, and it certainly doesn't apply
on platforms like Fuchsia.
Differential Revision: https://reviews.llvm.org/D98061
Petr Hosek [Tue, 10 Aug 2021 18:23:50 +0000 (11:23 -0700)]
Revert "[InstrProfiling] Emit bias variable eagerly"
This reverts commit
6660cec568504df47d9becb0c552c20577880df8 since
it was superseded by https://reviews.llvm.org/D98061.
Matthias Springer [Wed, 11 Aug 2021 06:08:02 +0000 (15:08 +0900)]
[mlir][Analysis] Add FlatAffineConstraints::addLowerOrUpperBound
This function overload is similar to the existing `FlatAffineConstraints::addLowerOrUpperBound`. It constrains a dimension based on an affine map. However, in contrast to the other overloading, it does not attempt to align dimensions/symbols of the affine map with the dimensions/symbols of the constraint set. Instead, dimensions/symbols are expected to already be aligned.
Differential Revision: https://reviews.llvm.org/D107727
Johannes Doerfert [Wed, 11 Aug 2021 06:10:13 +0000 (01:10 -0500)]
[Attributor][NFC] Try to make the windows build bots happy
Failed for some reason, potentially because of the inner type
declaration in combination with the `using`. This might help.
Failure:
https://lab.llvm.org/buildbot/#/builders/127/builds/15432