Matt Arsenault [Wed, 10 Jun 2020 19:11:19 +0000 (15:11 -0400)]
RegAllocFast: Avoid unused method warning in release builds
Leonard Chan [Wed, 10 Jun 2020 19:20:54 +0000 (12:20 -0700)]
[clang][Attribute] Fix noderef attribute false-negatives
`noderef` was failing to trigger warnings in some cases related to c++ style
casting. This patch addresses them.
Differential Revision: https://reviews.llvm.org/D77836
Arthur Eubanks [Wed, 10 Jun 2020 17:38:39 +0000 (10:38 -0700)]
[NFC] Rename variable to workaround old gcc bug
Summary:
gcc 5.1 is still supported according to
https://releases.llvm.org/10.0.0/docs/GettingStarted.html
We're hitting the following bug due to a variable created in the loop header being the same as a variable used in the loop header:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430
Reviewers: hctim, pcc
Subscribers: #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D81594
Michael Liao [Wed, 10 Jun 2020 19:04:47 +0000 (15:04 -0400)]
[hip] Fix the failed test case due to the additional backend phase.
Ayke van Laethem [Wed, 5 Feb 2020 14:04:47 +0000 (15:04 +0100)]
[AVR] Implement disassembly support for I/O instructions
The in, out, and sbi/cbi family of instructions seem to require a custom
decoder. I'm not exactly sure why and would prefer to convince TableGen
to provide the correct decoders for these, but I can't seem to convince
it to do so. They simply disassemble without any operands.
Differential Revision: https://reviews.llvm.org/D74049
Stanislav Mekhanoshin [Wed, 10 Jun 2020 18:22:59 +0000 (11:22 -0700)]
[AMDGPU] Fixed promote alloca with ptr/int casts
There is an invalid cast produced when a pointee is a pointer
and the alloca type is cast to a pointer to int.
Differential Revision: https://reviews.llvm.org/D81606
Leonard Chan [Wed, 10 Jun 2020 18:34:16 +0000 (11:34 -0700)]
[llvm][ELF][AArch64] Handle R_AARCH64_PLT32 relocation
This patch allows for usage of the @PLT modifier in AArch64 assembly which
lowers to an R_AARCH64_PLT32 relocation. See D81184 for handling this
relocation in lld.
Differential Revision: https://reviews.llvm.org/D81446
Marco Elver [Wed, 10 Jun 2020 18:20:23 +0000 (20:20 +0200)]
[ASan][Test] Fix expected strings for globals test
The expected strings would previously not catch bugs when redzones were
added when they were not actually expected. Fix by adding "global "
before the type.
Siva Chandra [Tue, 9 Jun 2020 18:34:11 +0000 (11:34 -0700)]
[libc] Add a simple linux aarch64 config.
Summary:
With this change, "ninja check-libc" on linux/aarch64 succeeds.
However, all entrypoints with machine dependent implementations
have been skipped. A good number of these skipped entrypoints can
be enabled once we have aarch64 syscall support available.
Reviewers: abrachet, asteinhauser
Differential Revision: https://reviews.llvm.org/D81533
Craig Topper [Wed, 10 Jun 2020 17:36:45 +0000 (10:36 -0700)]
[X86] Split imm handling out of selectMOV64Imm32 and add a separate isel pattern.
This makes the pattern available to global isel.
Siva Chandra [Wed, 10 Jun 2020 17:55:00 +0000 (10:55 -0700)]
[libc][NFC] Make cpu feature check tolerate non-x86 architectures.
The feature check should probably be enhanced for non-x86 architectures,
but this change shields them from x86 specific pieces until then.
This patch has been split out from https://reviews.llvm.org/D81533.
Michael Liao [Mon, 8 Jun 2020 19:37:06 +0000 (15:37 -0400)]
[hip] Fix device-only relocatable code compilation.
Summary:
- In HIP, just as the regular device-only compilation, the device-only
relocatable code compilation should not involve offload bundle.
- In addition, that device-only relocatable code compilation should have
the similar 3 steps, namely preprocessor, compile, and backend, to the
regular code generation with `-emit-llvm`.
Reviewers: yaxunl, tra
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81427
Saiyedul Islam [Wed, 10 Jun 2020 17:58:15 +0000 (17:58 +0000)]
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 2
Summary:
New file include to support platform dependent grid constants. It will be
used by clang, libomptarget plugins, and deviceRTLs to access constant
values consistently and with fast access in the deviceRTLs.
Originally authored by Greg Rodgers (@gregrodgers).
Reviewers: arsenm, sameerds, jdoerfert, yaxunl, b-sumner, scchan, JonChesterfield
Reviewed By: arsenm
Subscribers: llvm-commits, pdhaliwal, jholewinski, jvesely, wdng, nhaehnle, guansong, kerbowa, sstefan1, cfe-commits, ronlieb, gregrodgers
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D80917
Marco Elver [Wed, 10 Jun 2020 17:55:51 +0000 (19:55 +0200)]
[ASan][Test] Split out global alias test
Some platforms do not support aliases. Split the test, and pass explicit
triple to avoid test failure.
Reviewed By: thakis
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81591
Matt Arsenault [Wed, 10 Jun 2020 17:01:57 +0000 (13:01 -0400)]
AMDGPU: Stop using getSelectCC in division lowering
This was promoting booleans to i32 to perform a comparison against
them to feed to a select condition. Just use the booleans
directly. This produces the same final code, since the combiner is
unable to undo the mess this creates. I untangled this logic when I
ported this code to GlobalISel, so port the cleanups back.
Matt Arsenault [Tue, 9 Jun 2020 20:47:37 +0000 (16:47 -0400)]
GlobalISel: Move LegalizerHelper members around
MIRBuilder was in the middle of of a bunch of methods and not group
with the other member variables, which made it harder to see what
state this carries around. Move these to the top as is the usual
convention.
Heejin Ahn [Wed, 10 Jun 2020 16:51:21 +0000 (09:51 -0700)]
[WebAssembly] Fix a warning for an unused variable
`ErasedUncondBr` is used only in an `assert`, so it triggers a warning
on builds without assertions. Fixed.
Christopher Tetreault [Wed, 10 Jun 2020 16:41:42 +0000 (09:41 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from X86
Reviewers: efriedma, craig.topper, RKSimon, samparker, kmclaughlin, david-arm
Reviewed By: david-arm
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81520
David Green [Wed, 10 Jun 2020 10:22:10 +0000 (11:22 +0100)]
[ARM] Update fp16-insert-extract.ll test checks. NFC
Zequan Wu [Wed, 10 Jun 2020 16:37:58 +0000 (09:37 -0700)]
[AST] Mangle LambdaContextDecl for top level decl
Summary:
Bug filed here: https://bugs.llvm.org/show_bug.cgi?id=45213
To resolve it, we let the checks for mangling LambdaContextDecl to be analogous to ItaniumMangle strategy: https://github.com/llvm/llvm-project/blob/master/clang/lib/AST/ItaniumMangle.cpp#L1829
Differential Revision: https://reviews.llvm.org/D80153
Joel E. Denny [Wed, 10 Jun 2020 16:40:43 +0000 (12:40 -0400)]
[libc++] Work around gcc/Power9 bug in `include/thread`
This fixes PR39696, which breaks the libcxx build with gcc (I tested
7.5.0) on Power9. This fix was suggested at
https://bugs.llvm.org/show_bug.cgi?id=39696#c38
but never applied. It just reverts
0583d9ea8d5e, which reverses
components of the original fix in
3bf63cf3b366, which is correct.
Fixes https://llvm.org/PR39696
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D81438
Joel E. Denny [Wed, 10 Jun 2020 14:22:24 +0000 (10:22 -0400)]
[FileCheck] Add missing %ProtectFileCheckOutput to FileCheck tests
This is a continuation of D65121 (committed at
f471eb8e99b5).
Eric Schweitz [Fri, 5 Jun 2020 18:23:22 +0000 (11:23 -0700)]
[flang] Add the complex expression helper class.
The complex expression helper class can be used to generate small,
short-lived instances of a "helper" that can be used to aid the
construction of complex expressions in FIR. The helper class bundles
together these functionally related operations.
Included in this diff is the header for the FIR builder. The
implementation has other dependences and will follow.
Differential Revision: https://reviews.llvm.org/D81287
Mehdi Amini [Wed, 10 Jun 2020 15:58:10 +0000 (15:58 +0000)]
Fix MLIR test: -dump-input-on-failure is no longer a valid option
Endre Fülöp [Wed, 10 Jun 2020 15:34:41 +0000 (17:34 +0200)]
Revert "[analyzer] On-demand parsing capability for CTU"
This reverts commit
97e07d0c352ca469eb07a0cb3162c2807ff1099d.
Reason: OSX broke for a different reason, this really only seem to work
on linux and very generic windows builds
Simon Pilgrim [Wed, 10 Jun 2020 15:38:33 +0000 (16:38 +0100)]
[X86][SSE] Cleanup tests based on feedback from D81547
Simplify tests to return i1 bool, removing superfluous function calls.
Use nounwind to remove cfi
Pavel Labath [Wed, 10 Jun 2020 15:07:31 +0000 (17:07 +0200)]
[lldb] XFAIL TestForwardDeclaration.test_debug_names on windows
Before
539b47c9 this test was not actually using the debug_names section
because the -gdwarf added by Makefile.rules on windows overrode the
-gdwarf-5 flag from CFLAGS_EXTRAS. Now that -gdwarf-5 is respected, the
test is failing.
Matt Arsenault [Tue, 9 Jun 2020 20:57:53 +0000 (16:57 -0400)]
GlobalISel: Make default implementation of legalizeCustom unreachable
If the target explicitly requested custom legalization, it should be
required to implement this. Also move default legalizeIntrinsic
implementation into the header so it's next to the related
legalizeCustom.
Matt Arsenault [Sun, 31 May 2020 04:14:56 +0000 (00:14 -0400)]
AMDGPU/GlobalISel: Make G_IMPLICIT_DEF legality more consistent
Makes <6 x s16> legal, <4 x s8> illegal, and clamps the maximum size
to 1024.
Thomas Preud'homme [Wed, 17 Jul 2019 15:15:52 +0000 (16:15 +0100)]
FileCheck [11/12]: Add matching constraint specification
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support for specifying the
matching constraint for a numeric expression, ie. how the value being
matched should relate to the numeric expression.
This commit only adds the equality constraint where the numeric value
matched must be equal to the numeric expression. It is the default
matching constraint used when not specified. It is added to provision
other matching constraint (e.g. inequality relations).
Copyright:
- Linaro (changes up to diff 183612 of revision D55940)
- GraphCore (changes in later versions of revision D55940 and
in new revision created off D55940)
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D60391
serge-sans-paille [Thu, 4 Jun 2020 07:56:11 +0000 (09:56 +0200)]
Correctly update Changed status for SimplifyCFG
Interestingly, this leads to better output in one of the test case.
Differential Revision: https://reviews.llvm.org/D81237
Haojian Wu [Wed, 10 Jun 2020 14:51:54 +0000 (16:51 +0200)]
Fix the -Wsign-compare warning.
Raphael Isemann [Wed, 10 Jun 2020 14:35:42 +0000 (16:35 +0200)]
ADT: Fix that APSInt's string constructor claims it requires 5 bits to store a zero
Summary:
When constructing an APSInt from a string, the constructor doesn't correctly
truncate the bit width of the result if the passed in string was "0" (or any
alternative way to express 0 like "-0" or "000"). Instead of 1 (which is the
smallest allowed bit width) it returns an APSInt with a bit width of 5.
The reason is that the constructor checks that it never truncates the result to
the invalid bit width of 0, so when it calculates that storing a "0" doesn't
require any bits it just keeps the original overestimated bit width (which
happens to be 5).
This patch just sets the bit width of the result to 1 if the required bit width
is 0.
Reviewers: arphaman, dexonsmith
Reviewed By: dexonsmith
Subscribers: hiraditya, dexonsmith, JDevlieghere, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81329
Pavel Labath [Wed, 10 Jun 2020 14:34:56 +0000 (16:34 +0200)]
[lld] Fix test/ELF/undef.s for
6f55b5a1
There's been a slight change in wording for the warning message about
debug_line problems.
Raphael Isemann [Wed, 10 Jun 2020 14:34:54 +0000 (16:34 +0200)]
[lldb] Replace the LEB128 decoding logic in LLDB's DataExtractor with calls to LLVM's LEB128 implementation
Reviewers: labath, JDevlieghere
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D81453
Simon Pilgrim [Wed, 10 Jun 2020 14:14:24 +0000 (15:14 +0100)]
[CostModel][X86] Add broadcast costs for vXi1 bool vectors
Doesn't mean much on non-AVX512 targets but better to keep with the other shuffles
serge-sans-paille [Wed, 10 Jun 2020 14:16:14 +0000 (16:16 +0200)]
Fix version of c-general.profdata.v5 test case
de02a75e398415bad4df27b4547c25b896c8bf3b incorrectly upgraded it to v6
Pavel Labath [Thu, 2 Apr 2020 13:32:59 +0000 (15:32 +0200)]
[DWARFDebugLine] Use truncating data extractors for prologue parsing
Summary:
This makes the code easier to reason about, as it will behave the same
way regardless of whether there is any more data coming after the
presumed end of the prologue.
Reviewers: jhenderson, dblaikie, probinson, ikudrin
Subscribers: hiraditya, MaskRay, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77557
Sam McCall [Wed, 10 Jun 2020 07:36:58 +0000 (09:36 +0200)]
[clangd] Disable new errs()-tie behavior, it's racy.
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81538
Frederik Gossen [Wed, 10 Jun 2020 13:52:43 +0000 (13:52 +0000)]
[MLIR][Standard] Make the `dim` operation index an operand.
Allow for dynamic indices in the `dim` operation.
Rather than an attribute, the index is now an operand of type `index`.
This allows to apply the operation to dynamically ranked tensors.
The correct lowering of dynamic indices remains to be implemented.
Differential Revision: https://reviews.llvm.org/D81551
Louis Dionne [Wed, 10 Jun 2020 13:36:39 +0000 (09:36 -0400)]
[libc++] Install locales in the build bot Docker images
This allows running the locale tests on the build bots.
Mikhail Maltsev [Wed, 10 Jun 2020 13:26:58 +0000 (14:26 +0100)]
[libcxx] Fix std::vector construct_iter_iter.pass.cpp test (C++98/03)
The test is failing on 32-bit targets in C++03 mode. Clang produces
the following warning: 'integer literal is too large to be represented
in type 'long' and is subject to undefined behavior under C++98,
interpreting as 'unsigned long'; this literal will have type 'long
long' in C++11 onwards [-Wc++11-compat]' which is promoted to an error
and causes the test to fail.
There have been no changes in the test itself since 2019, so it looks
like the diagnostic has been updated.
Differential Revision: https://reviews.llvm.org/D81559
Kuter Dinel [Wed, 10 Jun 2020 13:08:56 +0000 (13:08 +0000)]
Reland: [Attributor] Split the Attributor::run() into multiple functions.
Summary:
This patch splits the Attributor::run() function into multiple
functions.
Simple Logic changes to make this possible:
# Moved iteration count verification earlier.
# NumFinalAAs get set a little bit later.
Reviewers: jdoerfert, sstefan1, uenoku
Reviewed By: jdoerfert
Subscribers: hiraditya, uenoku, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81022
Peter Smith [Mon, 8 Jun 2020 07:58:13 +0000 (08:58 +0100)]
[ELF][AArch64] Correct relocation codes for R_<CLS>_PLT32
The relocation codes for R_<CLS>_PLT32 are incorrectly in the dynamic
relocation range that starts at 1024 for AArch64 and 180 for AArch64_32.
Correct these so that they start at the next available static relocation
code in the non-TLS range. The R_<CLS>_PLT32 description is currently in
unpublished so this change corrects LLVM to match the values that will
appear in the final ELF for the 64-bit Arm Architecture document.
Differential Revision: https://reviews.llvm.org/D81410
Pavel Labath [Wed, 10 Jun 2020 13:04:31 +0000 (15:04 +0200)]
[lldb/Utility] Remove m_ieee_quad from Scalar
This field is unused (the only way to change its value is via a
constructor which is never called), and as far as I can tell it has been
unused since it was introduced in D12100. It also has some soundness
issues -- e.g. operator= does not reinitialize it, but uses the old
value from the overwritten object.
It sounds like this class should be able to support different floating
point semantics, but if that is needed, it would be better to start
afresh -- probably by passing in an APFloat::fltSemantics object instead
of a bool flag.
Ronald Wampler [Wed, 10 Jun 2020 12:55:42 +0000 (08:55 -0400)]
Create a warning flag for 'warn_conv_*_not_used'
These warnings are grouped under '-Wclass-conversion' to be compatiable with GCC 9.
Differential Revision: https://reviews.llvm.org/D78442
Marco Elver [Wed, 10 Jun 2020 13:01:40 +0000 (15:01 +0200)]
[KernelAddressSanitizer] Make globals constructors compatible with kernel [v2]
[ v1 was reverted by
c6ec352a6bde1995794c523adc2ebab802ccdf0a due to
modpost failing; v2 fixes this. More info:
https://github.com/ClangBuiltLinux/linux/issues/1045#issuecomment-
640381783 ]
This makes -fsanitize=kernel-address emit the correct globals
constructors for the kernel. We had to do the following:
* Disable generation of constructors that rely on linker features such
as dead-global elimination.
* Only instrument globals *not* in explicit sections. The kernel uses
sections for special globals, which we should not touch.
* Do not instrument globals that are prefixed with "__" nor that are
aliased by a symbol that is prefixed with "__". For example, modpost
relies on specially named aliases to find globals and checks their
contents. Unfortunately modpost relies on size stored as ELF debug info
and any padding of globals currently causes the debug info to cause size
reported to be *with* redzone which throws modpost off.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203493
Tested:
* With 'clang/test/CodeGen/asan-globals.cpp'.
* With test_kasan.ko, we can see:
BUG: KASAN: global-out-of-bounds in kasan_global_oob+0xb3/0xba [test_kasan]
* allyesconfig, allmodconfig (x86_64)
Reviewed By: glider
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D81390
gbreynoo [Wed, 10 Jun 2020 13:06:30 +0000 (14:06 +0100)]
[lld][test] Expand testing for dynamic-list and export-dynamic
- Expanded testing for --dynamic-list and --export-dynamic
- Fixed invalid-dynamic-list.test
Differential Revision: https://reviews.llvm.org/D80311
Sander de Smalen [Wed, 10 Jun 2020 08:15:13 +0000 (09:15 +0100)]
[AArch64][SVE] Change pointer type of struct load/store intrinsics.
Instead of loading from e.g. `<vscale x 16 x i8>*`, load from element
pointer `i8*`. This is more in line with the other load/store
intrinsics for SVE.
Reviewers: fpetrogalli, c-rhodes, rengolin, efriedma
Reviewed By: efriedma
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81458
Louis Dionne [Wed, 10 Jun 2020 12:46:49 +0000 (08:46 -0400)]
[libc++] Translate the enable_filesystem parameter to the DSL
Pavel Labath [Wed, 10 Jun 2020 11:38:35 +0000 (13:38 +0200)]
[lldb/Makefile.rules] Apply CFLAGS_EXTRAS after debug-info mode flags
This makes it possible to conditionally override some of these flags via
CFLAGS_EXTRAS. It should be NFC right now, but this seems the logical
order in which to apply these things, and I am going to make use of this
in another patch.
Georgii Rymar [Fri, 5 Jun 2020 12:50:59 +0000 (15:50 +0300)]
[yaml2obj] - Introduce a 10 Mb limit of the output by default and a --max-size option.
Multiple times we faced an issue of huge outputs due to unexpected behavior
or incorrect test cases. The last one was https://reviews.llvm.org/D80629#2073066.
This patch limits the output to 10 Mb for ELF and introduces the --max-size to change this
limit.
I've tried to keep the implementation non-intrusive.
The current logic we have is that we prepare section content in a buffer first and write
it to the output later. This patch checks the available limit on each writing attempt to this buffer
and stops writing when the limit is reached and raises the internal error flag.
Later, this flag is is checked before the actual writing to a file happens and
an error is reported.
Differential revision: https://reviews.llvm.org/D81258
Louis Dionne [Wed, 10 Jun 2020 12:03:51 +0000 (08:03 -0400)]
[libc++] Define the no-exceptions Lit feature using the DSL
Instead of using logic in config.py, use the DSL to grab the no-exceptions
user-configurable parameter from the Lit command-line invocation.
Louis Dionne [Tue, 9 Jun 2020 21:23:41 +0000 (17:23 -0400)]
[libc++] Allow picking Lit parameters from the config
Unlike parameters in litConfig.params, the config isn't shared across
all test suites. For example, if we want to enable exceptions in the
tests for libcxxabi, but not in the tests for libcxx, we can't set the
enable_exceptions parameter in the litConfig object, cause it will be
used by both. Instead, setting it inside the config object solves that
problem.
Frederik Gossen [Wed, 10 Jun 2020 11:43:30 +0000 (11:43 +0000)]
[MLIR][Shape] Make dimension an operand of `get_extent`
The operation `get_extent` now accepts the dimension as an operand and is no
longer limited to constant dimensions.
A helper function facilitates the common constant use case.
Differential Revision: https://reviews.llvm.org/D81248
Endre Fülöp [Wed, 10 Jun 2020 06:59:04 +0000 (08:59 +0200)]
[analyzer] On-demand parsing capability for CTU
Summary:
Introduce on-demand parsing of needed ASTs during CTU analysis.
The index-file format is extended, and analyzer-option CTUInvocationList
is added to specify the exact invocations needed to parse the needed
source-files.
Reviewers: martong, balazske, Szelethus, xazax.hun, whisperity
Reviewed By: martong, xazax.hun
Subscribers: gribozavr2, thakis, ASDenysPetrov, ormris, mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75665
Sergej Jaskiewicz [Wed, 10 Jun 2020 10:46:29 +0000 (13:46 +0300)]
[compiler-rt] [test] Fix NameError when loading lit.cfg.py for crt
Summary:
The `execute_external` global variable is defined in [`lit.common.cfg.py`](https://github.com/llvm/llvm-project/blob/
fcfb3170a776f89dde4de8ee105c99e10660f455/compiler-rt/test/lit.common.cfg.py#L18-L27) and used here (on lines 23 and 39). However, this variable is not visible in configs that are loaded independently.
Explicitly assign it to the correct value to avoid `NameError`.
Reviewers: compnerd, phosek
Reviewed By: compnerd, phosek
Subscribers: dberris, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D79892
Vitaly Buka [Wed, 10 Jun 2020 10:21:56 +0000 (03:21 -0700)]
[asan] Suppress lint warning in tests
Raphael Isemann [Wed, 10 Jun 2020 10:22:55 +0000 (12:22 +0200)]
[lldb][NFC] Rename ClangExpressionDeclMap::AddThisType and clarify documentation
Kazushi (Jam) Marukawa [Wed, 10 Jun 2020 10:22:19 +0000 (12:22 +0200)]
[VE] Support convert instructions in MC layer
Summary:
Add CVTSQ/CVTDQ/CVTQD/CVTQS instructions. Add regression tests for
them and other convert instructions of asmparser, mccodeemitter, and
disassembler. In order to add those instructions, support RD operands
in asmparser, mccodeemitter, and disassembler.
Differential Revision: https://reviews.llvm.org/D81536
David Green [Tue, 9 Jun 2020 15:21:38 +0000 (16:21 +0100)]
[ARM] MVE vectorizer reduction tests for each reduction type. NFC
sstefan1 [Wed, 10 Jun 2020 10:10:49 +0000 (10:10 +0000)]
Revert "[Attributor] Split the Attributor::run() into multiple functions."
This reverts commit
0ee47cc92f510e4f21b584dc265105f4d51776a0.
stefan [Wed, 10 Jun 2020 09:48:58 +0000 (09:48 +0000)]
[Attributor] Split the Attributor::run() into multiple functions.
Summary:
This patch splits the Attributor::run() function into multiple functions.
Simple Logic changes to make this possible:
# Moved iteration count verification earlier.
# NumFinalAAs get set a little bit later.
Reviewers: jdoerfert, sstefan1, uenoku
Reviewed By: jdoerfert
Subscribers: hiraditya, uenoku, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81022
Vitaly Buka [Mon, 1 Jun 2020 06:49:57 +0000 (23:49 -0700)]
[StackSafety] Add info into function summary
Summary:
This patch adds optional field into function summary,
implements asm and bitcode serialization. YAML
serialization is omitted and can be added later if
needed.
This patch includes this information into summary only
if module contains at least one sanitize_memtag function.
In a near future MTE is the user of the analysis.
Later if needed we can provede more direct control
on when information is included into summary.
Reviewers: eugenis
Subscribers: hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80908
Paul Walker [Thu, 14 May 2020 10:32:58 +0000 (10:32 +0000)]
[FileCheck] Add function call support to numerical expressions.
This patch extends numerical expressions to allow calls to
predefined functions. These calls can be combined with the
existing numerical operators, which includes nesting calls.
The call syntax is:
<func>(<args>)
Where <func> is a predefined string literal, currently limited to
one of add, max, min and sub. <arg> is a comma seperated list of
numerical expressions.
Subscribers: arichardson, hiraditya, thopre, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79936
Sam McCall [Wed, 10 Jun 2020 04:40:00 +0000 (06:40 +0200)]
[clangd] Log rather than assert on bad UTF-8.
Summary:
I don't love this behavior, but it prevents crashing when indexing boost
headers, and I can't think of a better practical alternative.
Fixes https://reviews.llvm.org/D81530
Based on a patch by AnakinZheng!
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits, AnakinZheng
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81530
Florian Hahn [Wed, 10 Jun 2020 09:23:37 +0000 (10:23 +0100)]
[DSE,MSSA] Relax post-dom restriction for objs visible after return.
This patch relaxes the post-dominance requirement for accesses to
objects visible after the function returns.
Instead of requiring the killing def to post-dominate the access to
eliminate, the set of 'killing blocks' (= blocks that completely
overwrite the original access) is collected.
If all paths from the access to eliminate and an exit block go through a
killing block, the access can be removed.
To check this property, we first get the common post-dominator block for
the killing blocks. If this block does not post-dominate the access
block, there may be a path from DomAccess to an exit block not involving
any killing block.
Otherwise we have to check if there is a path from the DomAccess to the
common post-dominator, that does not contain a killing block. If there
is no such path, we can remove DomAccess. For this check, we start at
the common post-dominator and then traverse the CFG backwards. Paths are
terminated when we hit a killing block or a block that is not executed
between DomAccess and a killing block according to the post-order
numbering (if the post order number of a block is greater than the one
of DomAccess, the block cannot be in in a path starting at DomAccess).
This gives the following improvements on the total number of stores
after DSE for MultiSource, SPEC2K, SPEC2006:
Tests: 237
Same hash: 206 (filtered out)
Remaining: 31
Metric: dse.NumRemainingStores
Program base new100 diff
test-suite...CFP2000/188.ammp/188.ammp.test 3624.00 3544.00 -2.2%
test-suite...ch/g721/g721encode/encode.test 128.00 126.00 -1.6%
test-suite.../Benchmarks/Olden/mst/mst.test 73.00 72.00 -1.4%
test-suite...CFP2006/433.milc/433.milc.test 3202.00 3163.00 -1.2%
test-suite...000/186.crafty/186.crafty.test 5062.00 5010.00 -1.0%
test-suite...-typeset/consumer-typeset.test 40460.00 40248.00 -0.5%
test-suite...Source/Benchmarks/sim/sim.test 642.00 639.00 -0.5%
test-suite...nchmarks/McCat/09-vor/vor.test 642.00 644.00 0.3%
test-suite...lications/sqlite3/sqlite3.test 35664.00 35563.00 -0.3%
test-suite...T2000/300.twolf/300.twolf.test 7202.00 7184.00 -0.2%
test-suite...lications/ClamAV/clamscan.test 19475.00 19444.00 -0.2%
test-suite...INT2000/164.gzip/164.gzip.test 2199.00 2196.00 -0.1%
test-suite...peg2/mpeg2dec/mpeg2decode.test 2380.00 2378.00 -0.1%
test-suite.../Benchmarks/Bullet/bullet.test 39335.00 39309.00 -0.1%
test-suite...:: External/Povray/povray.test 36951.00 36927.00 -0.1%
test-suite...marks/7zip/7zip-benchmark.test 67396.00 67356.00 -0.1%
test-suite...6/464.h264ref/464.h264ref.test 31497.00 31481.00 -0.1%
test-suite...006/453.povray/453.povray.test 51441.00 51416.00 -0.0%
test-suite...T2006/401.bzip2/401.bzip2.test 4450.00 4448.00 -0.0%
test-suite...Applications/kimwitu++/kc.test 23481.00 23471.00 -0.0%
test-suite...chmarks/MallocBench/gs/gs.test 6286.00 6284.00 -0.0%
test-suite.../CINT2000/254.gap/254.gap.test 13719.00 13715.00 -0.0%
test-suite.../Applications/SPASS/SPASS.test 30345.00 30338.00 -0.0%
test-suite...006/450.soplex/450.soplex.test 15018.00 15016.00 -0.0%
test-suite...ications/JM/lencod/lencod.test 27780.00 27777.00 -0.0%
test-suite.../CINT2006/403.gcc/403.gcc.test 105285.00 105276.00 -0.0%
There might be potential to pre-compute some of the information of which
blocks are on the path to an exit for each block, but the overall
benefit might be comparatively small.
On the set of benchmarks, 15738 times out of 20322 we reach the
CFG check, the CFG check is successful. The total number of iterations
in the CFG check is 187810, so on average we need less than 10 steps in
the check loop. Bumping the threshold in the loop from 50 to 150 gives a
few small improvements, but I don't think they warrant such a big bump
at the moment. This is all pending further tuning in the future.
Reviewers: dmgreen, bryant, asbirlea, Tyker, efriedma, george.burgess.iv
Reviewed By: george.burgess.iv
Differential Revision: https://reviews.llvm.org/D78932
Vitaly Buka [Wed, 10 Jun 2020 09:25:47 +0000 (02:25 -0700)]
Revert "[InstrProfiling] Use !associated metadata for counters, data and values"
This reverts commit
69c5ff4668cd4d1bfb6b45d71e15c12e3a23ae05.
This reverts commit
603d58b5e49c76e4a2e5bf1450b71b100a3396ba.
This reverts commit
ba10bedf5631eda3a17df428c88451c754633d23.
This reverts commit
39b3c41b65302a969fa5507402976a255a07c158.
Endre Fülöp [Wed, 10 Jun 2020 08:30:10 +0000 (10:30 +0200)]
Revert "[analyzer] On-demand parsing capability for CTU"
This reverts commit
020815fafd15ddac0f2b5539e7766107d7b25ddc.
Reason: PS4 buildbot broke
Alex Bradbury [Wed, 10 Jun 2020 08:16:09 +0000 (09:16 +0100)]
[RISCV] Make visibility of overridden methods in RISCVISelLowering match the parent
Currently, some fairly arbitrary subset of overriden methods in
RISCVISelLowering are private rather than public (which is the
visibility they have in TargetLowering). I suspect this is a holdover
from too closely copying another backend.
D78545 pointed out this can be difficult for some downstream patches,
and nobody has come forward to suggest a reason for keeping the
visibility as-is.
This commit simply makes all overridden methods match the public
visiblity of the parent.
Differential Revision: https://reviews.llvm.org/D79928
Sam Parker [Tue, 9 Jun 2020 08:04:53 +0000 (09:04 +0100)]
[CostModel] Unify Shuffle and InsertElement Costs
Extract the existing code from getInstructionThroughput into
TTImpl::getUserCost. The duplicated code in the AMDGPU backend has
also been removed.
Differential Revision: https://reviews.llvm.org/D81448
Sam Parker [Fri, 5 Jun 2020 07:42:03 +0000 (08:42 +0100)]
[CostModel] Unify getArithmeticInstrCost
Add the remaining arithmetic opcodes into the generic implementation
of getUserCost and then call this from getInstructionThroughput. Most
of the backends have been modified to return the base implementation
for cost kinds other RecipThroughput. The outlier here is AMDGPU
which already uses getArithmeticInstrCost for all the cost kinds.
This change means that most of the opcodes can be removed from that
backends implementation of getUserCost.
Differential Revision: https://reviews.llvm.org/D80992
Kazushi (Jam) Marukawa [Wed, 10 Jun 2020 08:01:56 +0000 (10:01 +0200)]
[VE] Support host memory access instructions in MC layer
Summary:
Add LHM/SHM instructions. Add regression tests for them of asmparser,
mccodeemitter, and disassembler. In order to add those instructions,
add new decode functions to disassembler, and add new print functions
to instprinter.
Differential Revision: https://reviews.llvm.org/D81535
Wang, Pengfei [Wed, 10 Jun 2020 06:52:54 +0000 (14:52 +0800)]
[MS] Copy the symbols assigned to the former instruction when memory folding.
The memory folding raplaced the old instruction without copying the symbols assigned. Which will resulted in built fail due to the lost symbols.
Reviewed by craig.topper
Differential Revision: https://reviews.llvm.org/D78471
Sander de Smalen [Tue, 9 Jun 2020 14:47:12 +0000 (15:47 +0100)]
[SveEmitter] NFC: Add missing ACLE tests
These ACLE tests were missing in previous patches:
- D79357: [SveEmitter] Add builtins for svdup and svindex
- D78747: [SveEmitter] Add builtins for compares and ReverseCompare flag.
- D76238: [SveEmitter] Implement builtins for contiguous loads/stores
Eli Friedman [Wed, 10 Jun 2020 07:26:35 +0000 (00:26 -0700)]
Revert "[SPARC] Lower fp16 ops to libcalls"
This reverts commit
28415e588f1c501967a9b596e6651787996f93ff. It's
causing buildbot failures. (Probably just need to fix the triple for the
test, but I'll look more tomorrow.)
Endre Fülöp [Wed, 10 Jun 2020 06:59:04 +0000 (08:59 +0200)]
[analyzer] On-demand parsing capability for CTU
Summary:
Introduce on-demand parsing of needed ASTs during CTU analysis.
The index-file format is extended, and analyzer-option CTUInvocationList
is added to specify the exact invocations needed to parse the needed
source-files.
Reviewers: martong, balazske, Szelethus, xazax.hun, whisperity
Reviewed By: martong, xazax.hun
Subscribers: gribozavr2, thakis, ASDenysPetrov, ormris, mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75665
LLVM GN Syncbot [Wed, 10 Jun 2020 06:34:38 +0000 (06:34 +0000)]
[gn build] Port
4f03c0b8066
LLVM GN Syncbot [Wed, 10 Jun 2020 06:34:37 +0000 (06:34 +0000)]
[gn build] Port
075890ca551
Amara Emerson [Wed, 10 Jun 2020 06:25:52 +0000 (23:25 -0700)]
[AArch64] Move RegisterBankInfo.cpp/h to GISel.
Missed this file in the recent reorg.
Fangrui Song [Wed, 10 Jun 2020 06:08:04 +0000 (23:08 -0700)]
[ELF] Fix --thinlto-index-only regression after D79300
After D79300, we don't rewrite InputFile::mb to an empty buffer.
In thinLTOCreateEmptyIndexFiles(), we should check LazyObjFile::fetched
as well as checking whether mb is a bitcode, otherwise we would overwrite (path + .thinlto.bc) with an empty index.
Siva Chandra Reddy [Fri, 29 May 2020 06:03:32 +0000 (23:03 -0700)]
[libc] Add implementations of round and roundf.
Reviewers: asteinhauser
Differential Revision: https://reviews.llvm.org/D80779
Shawn Landden [Sun, 7 Jun 2020 14:56:17 +0000 (18:56 +0400)]
[AArch64] custom lowering for i128 popcount
halves the number of CNT instructions generated
Stephen Neuendorffer [Sat, 23 Nov 2019 00:04:44 +0000 (16:04 -0800)]
[JitRunner] add support for i32 and i64 output
Differential Revision: https://reviews.llvm.org/D80675
Stephen Neuendorffer [Wed, 27 May 2020 04:11:01 +0000 (21:11 -0700)]
[MLIR] expose applyCmpPredicate
This is useful for manipulating the standard dialect from transformations
outside of the standard dialect.
Differential Revision: https://reviews.llvm.org/D80609
Siva Chandra Reddy [Tue, 9 Jun 2020 23:56:50 +0000 (16:56 -0700)]
[libc] Skip fuzzer as well if its dependent entrypoints are skipped.
Reviewers: asteinhauser
Subscribers: mgorny, tschuett, ecnelises, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D81519
LemonBoy [Wed, 10 Jun 2020 02:17:43 +0000 (19:17 -0700)]
[SPARC] Lower fp16 ops to libcalls
The fp16 ops are legalized by extending/chopping them as needed.
The tests are shamelessly stolen from the RISC-V backend.
Differential Revision: https://reviews.llvm.org/D77569
Fangrui Song [Wed, 10 Jun 2020 00:47:47 +0000 (17:47 -0700)]
[Support][unittest] Fix asan failure after D81156
Sterling Augustine [Wed, 10 Jun 2020 00:10:22 +0000 (17:10 -0700)]
Fix variables used only in asserts.
Summary: Fix variables used only in asserts.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81522
Amara Emerson [Tue, 9 Jun 2020 22:14:04 +0000 (15:14 -0700)]
[AArch64][GlobalISel] Select G_ADD_LOW into a MOVaddr pseudo.
This ensures that we match SelectionDAG behaviour by waiting until the expand
pseudos pass to generate ADRP + ADD pairs. Doing this at selection time for the
G_ADD_LOW is fine because by the time we get to selecting the G_ADD_LOW,
previous attempts to fold it into loads/stores must have failed.
Differential Revision: https://reviews.llvm.org/D81512
Craig Topper [Tue, 9 Jun 2020 22:25:46 +0000 (15:25 -0700)]
[X86] Assign a feature to tremont, goldmont, goldmont-plus, icelake-client, and icelake for target multiversioning priority.
Without this these CPUs all caused the compiler to assert when
used for multiversioning.
Vy Nguyen [Tue, 9 Jun 2020 01:14:14 +0000 (21:14 -0400)]
Make the diagnostic-missing-prototypes put the suggested `static` in front of `const` if exists.
Summary:
Consider: `const int* get_foo() {return nullptr;}`
The suggested fix should be `static const int* get_foo(){}`
and not `const static int* get_foo(){}`
Reviewers: gribozavr2
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81444
Siva Chandra Reddy [Tue, 9 Jun 2020 23:20:51 +0000 (16:20 -0700)]
[libc][NFC] Adjust sinf and cosf around -infinity inputs.
The current tests verify if the result of -infinity is a quiet NaN with
sign bit set. But, that need not be the case on all platforms. So, just
checking that the result is a quiet NaN and ignoring the sign bit is
good enough.
Jonas Devlieghere [Tue, 9 Jun 2020 23:17:29 +0000 (16:17 -0700)]
[lldb/Reproducers] Skip test_remove_placeholder_add_real_module with reproducers
Modules are not orphaned and it finds the existing module with the same
UUID from test_partial_uuid_match.
aartbik [Tue, 9 Jun 2020 21:08:51 +0000 (14:08 -0700)]
[mlir] [VectorOps] Handle 'vector.shape_cast' lowering for all cases
Summary:
Even though this operation is intended for 1d/2d conversions currently,
leaving a semantic hole in the lowering prohibits proper testing of this
operation. This CL adds a straightforward reference implementation for the
missing cases.
Reviewers: nicolasvasilache, mehdi_amini, ftynse, reidtatge
Reviewed By: reidtatge
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D81503
Akira Hatanaka [Tue, 9 Jun 2020 22:53:44 +0000 (15:53 -0700)]
Don't use a variable that isn't defined
The line defining CAPTURE was removed in r302270.
Siva Chandra Reddy [Tue, 9 Jun 2020 22:38:49 +0000 (15:38 -0700)]
[libc][NFC][Obvious] Tidy up some CMake files.
Conditionally adding subdirectories was missed in a few places previously.
This change adds the conditionals. A sub-directory was being added
needlessly in another place. That has been removed.
Siva Chandra Reddy [Tue, 9 Jun 2020 07:31:48 +0000 (00:31 -0700)]
[libc] Skip entrypoints not present in the entrypoints list.
Summary:
If a test depends on a skipped entrypoint, then the test is also
skipped. This setup will be useful as we gradually add support for
more operating systems and target architectures.
Reviewers: asteinhauser
Differential Revision: https://reviews.llvm.org/D81489
Whitney Tsang [Tue, 9 Jun 2020 21:12:51 +0000 (21:12 +0000)]
[LoopFusion] Update second loop guard non loop successor phis incoming
blocks.
Summary: The current LoopFusion forget to update the incoming block of
the phis in second loop guard non loop successor from second loop guard
block to first loop guard block. A test case is provided to better
understand the problem.
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D81421
Tim Keith [Tue, 9 Jun 2020 21:14:01 +0000 (14:14 -0700)]
[flang] Fix bug resolving type in type definition
When we encountered a type name in a derived type definition, we were
sometimes finding a component of that name rather than the type from
the enclosing scope. Fix this by introducing `NonDerivedTypeScope()` to
start the search in the right scope.
Differential Revision: https://reviews.llvm.org/D81493