Jon Chesterfield [Thu, 12 Aug 2021 16:44:36 +0000 (17:44 +0100)]
Revert "[openmp] Annotate tmp variables with omp_thread_mem_alloc"
This reverts commit
b6113548c9217fb8a6d0e9ac5bef5584c1aa614d.
Sanjay Patel [Thu, 12 Aug 2021 16:35:39 +0000 (12:35 -0400)]
[InstCombine] fold umax/umin intrinsics based on demanded bits
This is a direct translation of the select folds added with
D53033 / D53036 and another step towards canonicalization
using the intrinsics (see D98152).
Sanjay Patel [Thu, 12 Aug 2021 16:18:21 +0000 (12:18 -0400)]
[InstCombine] add test for umax/umin intrinsic demanded bits; NFC
peter klausler [Tue, 10 Aug 2021 19:16:40 +0000 (12:16 -0700)]
[flang] Fix crash in runtime-type-info.cpp
Recent work in runtime assignments failed an assertion in fir-dev
while running tests (flang/test/Semantics/defined-ops.f90). This
test didn't fail in llvm-project/main because only the "new" Arm
driver is used now, and that only builds runtime derived type information
tables when some debug dumping options are enabled.
So add a reproducing test case to another test that is run with
-fdebug-dump-symbols, and fix the crash by emitting special procedure
binding information only for type-bound generic ASSIGNMENT(=) bindings
that are relevant to the runtime support library for use in intrinsic
assignment of derived types.
Differential Revision: https://reviews.llvm.org/D107918
Fangrui Song [Thu, 12 Aug 2021 16:31:31 +0000 (09:31 -0700)]
[crt][test] Make ctor_dtor.c robust if DT_INIT/DT_FINI is disabled
New ports in glibc typically don't define ELF_INITFINI, so
DT_INIT/DT_FINI support is disabled.
(rhel ppc64le likely patches their glibc this way as well.)
musl can disable DT_INIT/DT_FINI via -DNO_LEGACY_INITFINI.
So we cannot guarantee ctor()/dtor() will be printed.
Jon Chesterfield [Thu, 12 Aug 2021 16:30:22 +0000 (17:30 +0100)]
[openmp] Annotate tmp variables with omp_thread_mem_alloc
Fixes miscompile of calls into ocml. Bug 51445.
The stack variable `double __tmp` is moved to dynamically allocated shared
memory by CGOpenMPRuntimeGPU. This is usually fine, but when the variable
is passed to a function that is explicitly annotated address_space(5) then
allocating the variable off-stack leads to a miscompile in the back end,
which cannot decide to move the variable back to the stack from shared.
This could be fixed by removing the AS(5) annotation from the math library
or by explicitly marking the variables as thread_mem_alloc. The cast to
AS(5) is still a no-op once IR is reached.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D107971
maekawatoshiki [Thu, 12 Aug 2021 15:53:03 +0000 (00:53 +0900)]
[LICM] Support sinking in LNICM
Currently, LNICM pass does not support sinking instructions out of loop nest.
This patch enables LNICM to sink down as many instructions to the exit block of outermost loop as possible.
Reviewed By: Whitney
Differential Revision: https://reviews.llvm.org/D107219
Aaron Ballman [Thu, 12 Aug 2021 15:55:32 +0000 (11:55 -0400)]
Speculatively fix the build bots.
This is a fix for commit
d2c5cbc3a856c2f8bbda05540fa761bb94ba32f6
Hongtao Yu [Wed, 11 Aug 2021 01:19:21 +0000 (18:19 -0700)]
[CSSPGO] Allow the use of debug-info-for-profiling and pseudo-probe-for-profiling together
Previoulsy debug-info-for-profiling and pseudo-probe-for-profiling are mutual exclusive because they compete the dwarf discrimnator for callsites on the IR. This changes allows to use the two switches together. The side effect is that callsite discriminators will be taken by pseudo probe, while discriminators for other instructions are still available for AutoFDO use. This is less than ideal, however, it still allows us a chance to smoothly transition from AutoFDO to CSSPGO, by collecting both profiles from a CSSPGO binary.
Reviewed By: wenlei, wmi
Differential Revision: https://reviews.llvm.org/D107876
Sanjay Patel [Thu, 12 Aug 2021 15:46:11 +0000 (11:46 -0400)]
[InstCombine] remove unused function argument; NFC
This was just added with
6de1dbbd09c1 , and I missed
pulling the extra arg from the final revision.
Johannes Doerfert [Thu, 12 Aug 2021 15:10:27 +0000 (10:10 -0500)]
[Attributor][FIX] Do not try to rewrite functions with casted call sites
If we cast a function at the call site it is hard(er) to get the rewrite
correct, let's not attempt it for now.
Fixes PR51448.
Johannes Doerfert [Thu, 12 Aug 2021 14:52:24 +0000 (09:52 -0500)]
[Attributor][FIX] Guard constant casts with type size checks
Johannes Doerfert [Wed, 11 Aug 2021 14:48:46 +0000 (09:48 -0500)]
[Attributor] Do not delete volatile stores to null/undef
See D106309.
Differential Revision: https://reviews.llvm.org/D107906
David Green [Thu, 12 Aug 2021 15:37:39 +0000 (16:37 +0100)]
[ARM] Fix DAG combine loop in reduction distribution
Given a constant operand, the MVE and DAGCombine combines could fight,
each redistributing in the opposite order. Add a guard to the MVE
vecreduce distribution to prevent that.
LLVM GN Syncbot [Thu, 12 Aug 2021 15:33:09 +0000 (15:33 +0000)]
[gn build] Port
d2c5cbc3a856
Florin Iucha [Thu, 12 Aug 2021 15:31:26 +0000 (11:31 -0400)]
Add a check for enforcing minimum length for variable names
Add a check for enforcing minimum length for variable names. A default
minimum length of three characters is applied to regular variables
(including function parameters). Loop counters and exception variables
have a minimum of two characters. Additionally, the 'i', 'j' and 'k'
are accepted as legacy values.
All three sizes, as well as the list of accepted legacy loop counter
names are configurable.
Sanjay Patel [Thu, 12 Aug 2021 15:27:22 +0000 (11:27 -0400)]
[InstCombine] remove shl(neg x), y transform
This diff was accidentally committed with:
1b5a195845e1
Sanjay Patel [Thu, 12 Aug 2021 12:34:30 +0000 (08:34 -0400)]
[InstCombine] factorize min/max intrinsic ops with common operand
This is an adaptation of D41603 and another step on the way
to canonicalizing to the intrinsic forms of min/max.
See D98152 for status.
Sanjay Patel [Thu, 12 Aug 2021 11:07:43 +0000 (07:07 -0400)]
[InstCombine] add tests for factorization of min/max intrinsics; NFC
Victor Huang [Thu, 12 Aug 2021 13:03:21 +0000 (08:03 -0500)]
[PowerPC] Fix return address computation for "__builtin_return_address"
When depth > 0, callee frame address is used to compute the return address of
callee producing improper return address. This patch adds the fix to use caller
frame address to compute the return address of callee.
Reviewed By: nemanjai, #powerpc
Differential revision: https://reviews.llvm.org/D107646
Liqiang Tao [Thu, 12 Aug 2021 14:19:45 +0000 (22:19 +0800)]
[llvm][Inline] Refactor out InlineOrder
Move InlineOrder to separated file.
Reviewed By: kazu
Differential Revision: https://reviews.llvm.org/D107831
Sven van Haastregt [Thu, 12 Aug 2021 13:51:20 +0000 (14:51 +0100)]
[OpenCL] Tidy up preserve_vec3 test
Add CHECK-LABELs and fix string substitution to actually match the
previous definition.
Michael Kruse [Thu, 12 Aug 2021 11:11:58 +0000 (06:11 -0500)]
[Polly] Simplify domains before gist.
The compilation of the file
526.blender_r/src/blender/source/blender/editors/space_logic/logic_ops.c
from the SPEC CPU 2017 benchmarks took excessive time to compute
InvalidDomain.gist_params(Ctx)
Simplifying beforehand, specifically using isl_set_detect_equalities,
reduces the computation time to a negible level again.
Dmitry Vyukov [Thu, 12 Aug 2021 12:47:47 +0000 (14:47 +0200)]
tsan: remove implicit memcpy in MutexSet::Desc::operator=()
The default compiler-generated MutexSet::Desc::operator=()
now contains memcpy() call since Desc become bigger.
This fails in debug mode since we call interceptor from within the runtime.
Define own operator=() using internal_memcpy().
This also makes copy ctor necessary, otherwise:
tsan_mutexset.h:33:11: warning: definition of implicit copy constructor for
'Desc' is deprecated because it has a user-declared copy assignment operator
And if we add copy ctor, we also need the default ctor
since it's called by MutexSet ctor.
Depends on D107911.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107959
Florian Hahn [Thu, 12 Aug 2021 12:13:52 +0000 (13:13 +0100)]
Revert "[Matrix] Update column.major.load call in PPC test."
Dependent commit
a1ef81de35a4 has been reverted in
a1ef81de35a4.
Mehdi Amini [Thu, 12 Aug 2021 11:57:19 +0000 (11:57 +0000)]
Revert "[Matrix] Overload stride arg in matrix.columnwise.load/store."
This reverts commit
a1ef81de35a4bac6d3b22e9d7186d880124d7a55.
Broke the MLIR buildbot.
Anton Afanasyev [Thu, 12 Aug 2021 11:40:27 +0000 (14:40 +0300)]
[Test] Move test for PR50555 from InstCombine to AggressiveInstCombine
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