Fangrui Song [Wed, 18 Jul 2018 22:02:48 +0000 (22:02 +0000)]
[ELF] Error if -r --gdb-index are used together
Reviewers: ruiu, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D49513
llvm-svn: 337427
Sam Clegg [Wed, 18 Jul 2018 21:46:09 +0000 (21:46 +0000)]
[WebAssembly] Fix archive member display in error messages
Add a test for this by causing a symbol collision
between archive members.
Differential Revision: https://reviews.llvm.org/D49343
llvm-svn: 337426
Heejin Ahn [Wed, 18 Jul 2018 21:42:22 +0000 (21:42 +0000)]
[WebAssembly] Add missing -mattr=+exception-handling guards
Summary:
The use of exception handling instructions should only be enabled with
`-mattr=+exception-handling` option.
Reviewers: jgravelle-google
Subscribers: dschuff, sbc100, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D49391
llvm-svn: 337425
Tim Northover [Wed, 18 Jul 2018 21:32:49 +0000 (21:32 +0000)]
Revert "ARM: switch armv7em triple to hard-float defaults and libcalls."
This reverts commit r337385 until it can be targeted at MachO only.
llvm-svn: 337424
David Blaikie [Wed, 18 Jul 2018 20:37:01 +0000 (20:37 +0000)]
Fix some tests that had (implied) duplicate mtriple
I 'fixed' one of these to use %llc_dwarf unnecessarily, so switch them
both back to using llc directly.
llvm-svn: 337423
Richard Smith [Wed, 18 Jul 2018 20:13:36 +0000 (20:13 +0000)]
DR330: when determining whether a cast casts away constness, consider
qualifiers from all levels matching a multidimensional array.
For example, this allows casting from
pointer to array of array of const volatile int
to
pointer to const pointer to volatile pointer to int
because the multidimensional array part of the source type corresponds
to a part of the destination type that contains both 'const' and
'volatile'.
Differential Revision: https://reviews.llvm.org/D49457
llvm-svn: 337422
Vedant Kumar [Wed, 18 Jul 2018 20:10:43 +0000 (20:10 +0000)]
Revert "[CMake] Sort dependency list and add safestack to it"
This reverts commit r337412.
An Apple-internal bot cannot find the safestack dependency, and fails to
configure with this change.
llvm-svn: 337421
Erich Keane [Wed, 18 Jul 2018 20:04:48 +0000 (20:04 +0000)]
Add support for __declspec(code_seg("segname"))
This patch uses CodeSegAttr to represent __declspec(code_seg) rather than
building on the existing support for #pragma code_seg.
The code_seg declspec is applied on functions and classes. This attribute
enables the placement of code into separate named segments, including compiler-
generated codes and template instantiations.
For more information, please see the following:
https://msdn.microsoft.com/en-us/library/dn636922.aspx
This patch fixes the regression for the support for attribute ((section).
https://github.com/llvm-mirror/clang/commit/
746b78de7812bc785fbb5207b788348040b23fa7
Patch by Soumi Manna (Manna)
Differential Revision: https://reviews.llvm.org/D48841
llvm-svn: 337420
Simon Pilgrim [Wed, 18 Jul 2018 19:55:19 +0000 (19:55 +0000)]
[X86][SSE] Canonicalize scalar fp arithmetic shuffle patterns
As discussed on PR38197, this canonicalizes MOVS*(N0, OP(N0, N1)) --> MOVS*(N0, SCALAR_TO_VECTOR(OP(N0[0], N1[0])))
This returns the scalar-fp codegen lost by rL336971.
Additionally it handles the OP(N1, N0)) case for commutable (FADD/FMUL) ops.
Differential Revision: https://reviews.llvm.org/D49474
llvm-svn: 337419
Petr Hosek [Wed, 18 Jul 2018 19:20:47 +0000 (19:20 +0000)]
[Fuzzer] Improve crash unwinding on Fuchsia
Fuchsia doesn't have signals; instead it expects processes to have a
dedicated exception thread that binds to the process' exception port and
waits for exception packets to be delivered. On the other hand,
libFuzzer and sanitizer_common use expect to collect crash information
via libunwind from the same thread that caused the exception.
The long term fix is to improve support for remote unwinding in
libunbwind, plumb this through sanitizer_common and libFuzzer, and
handle the exception exclusively on the exception thread. In the
meantime, this revision has the exception thread "resurrect" the
crashing thread by:
* saving its general purpose register state onto the crashing thread's
stack,
* setting the crashing thread's program counter to an assembly trampoline
with the CFI information needed by libunwind, and
* resuming the crashed thread.
Patch By: aarongreen
Differential Revision: https://reviews.llvm.org/D48509
llvm-svn: 337418
Artem Dergachev [Wed, 18 Jul 2018 18:44:40 +0000 (18:44 +0000)]
[analyzer] Remove a debug print that was accidentally left around.
No functional change intended.
llvm-svn: 337417
Xin Tong [Wed, 18 Jul 2018 18:40:45 +0000 (18:40 +0000)]
Skip debuginfo intrinsic in markLiveBlocks.
Summary:
The optimizer is 10%+ slower with vs without debuginfo. I started checking where
the difference is coming from.
I compiled sqlite3.c with and without debug info from CTMark and compare the time difference.
I use Xcode Instrument to find where time is spent. This brings about 20ms, out of ~20s.
Reviewers: davide, hfinkel
Reviewed By: hfinkel
Subscribers: hfinkel, aprantl, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D49337
llvm-svn: 337416
Roman Lebedev [Wed, 18 Jul 2018 18:35:27 +0000 (18:35 +0000)]
Add (very partial) Kate syntax highlighting definition for TableGen
This is very clearly not very good, and is very partial.
But this is better than nothing at all, and shouldn't
hurt those who don't need it.
If there are others interested in this functionality,
it will be great to further improve this.
{
F6253091}
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D47080
llvm-svn: 337415
Nirav Dave [Wed, 18 Jul 2018 18:34:52 +0000 (18:34 +0000)]
[DAG] Add testcase.
llvm-svn: 337414
Rui Ueyama [Wed, 18 Jul 2018 18:24:46 +0000 (18:24 +0000)]
Revert r336609: Fix direct calls to __wrap_sym when it is relocated.
This reverts commit r336609 as it doesn't seem to work with AArch64
thunk creation when used with ASan.
llvm-svn: 337413
Vedant Kumar [Wed, 18 Jul 2018 18:17:39 +0000 (18:17 +0000)]
[CMake] Sort dependency list and add safestack to it
The 'safestack.c' test requires safestack as a dependency.
llvm-svn: 337412
David Blaikie [Wed, 18 Jul 2018 18:04:42 +0000 (18:04 +0000)]
[DebugInfo] Dwarfv5: Avoid unnecessary base_address specifiers in rnglists
Since DWARFv5 rnglists are self descriptive and have distinct encodings
for base-relative (offset_pair) and absolute (start_length) entries,
there's no need to use a base address specifier when describing a lone
address range in a section.
Use that, and improve the test coverage a bit here to include cases like
this and others.
llvm-svn: 337411
JF Bastien [Wed, 18 Jul 2018 18:01:41 +0000 (18:01 +0000)]
Support implicit _Atomic struct load / store
Summary:
Using _Atomic to do implicit load / store is just a seq_cst atomic_load / atomic_store. Stores currently assert in Sema::ImpCastExprToType with 'can't implicitly cast lvalue to rvalue with this cast kind', but that's erroneous. The codegen is fine as the test shows.
While investigating I found that Richard had found the problem here: https://reviews.llvm.org/D46112#1113557
<rdar://problem/
40347123>
Reviewers: dexonsmith
Subscribers: cfe-commits, efriedma, rsmith, aaron.ballman
Differential Revision: https://reviews.llvm.org/D49458
llvm-svn: 337410
Nirav Dave [Wed, 18 Jul 2018 18:01:03 +0000 (18:01 +0000)]
[ScheduleDAG] Fix unfolding of SUnits to already existent nodes.
Summary:
If unfolding an SUnit results in both load or the operation using it which
already exist in the DAG, abort the unfold if they are already scheduled.
If not, make sure we don't add duplicate dependencies.
This fixes PR37916.
Reviewers: davide, eli.friedman, fhahn, bogner
Subscribers: MatzeB, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D48666
llvm-svn: 337409
Paul Semel [Wed, 18 Jul 2018 18:00:41 +0000 (18:00 +0000)]
[llvm-readobj] Generic -string-dump option
Differential Revision: https://reviews.llvm.org/D49470
llvm-svn: 337408
Rui Ueyama [Wed, 18 Jul 2018 17:48:14 +0000 (17:48 +0000)]
Look for an entry point function if /nodefaultlib is given.
Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=38018
Reviewers: thakis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48990
llvm-svn: 337407
Marshall Clow [Wed, 18 Jul 2018 17:37:51 +0000 (17:37 +0000)]
Update the synopsis for <chrono> for C++20. No functional change.
llvm-svn: 337406
Rui Ueyama [Wed, 18 Jul 2018 17:19:17 +0000 (17:19 +0000)]
Fix `ld.lld --help` message.
llvm-svn: 337405
Teresa Johnson [Wed, 18 Jul 2018 17:10:17 +0000 (17:10 +0000)]
[docs] Update GoldPlugin documentation
Summary:
Updated and reorganized. Made the following additions:
1) How to see if ld.gold is installed, and whether it is the current
default.
2) How to install ld.gold as the default or alternatively use
-fuse-ld=gold.
3) Move the part about installing the newly built ld-new as the default
to the prior section and how to use --enable-gold=default to do it
automatically on install.
4) Add a note about ld.bfd supporting plugins but indicate that it is
not tested by the LLVM project and gold is the recommended linker for
use with the gold plugin.
Fixes PR32760.
Reviewers: davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49490
llvm-svn: 337404
Max Moroz [Wed, 18 Jul 2018 17:03:27 +0000 (17:03 +0000)]
[libFuzzer] Create single template for visiting Inline8bitCounters
Summary:
Created IterateInline8bitCounters, a single template for visiting Inline8bitCounters (nested for loop)
Made InitializeUnstableCounters and UpdateUnstableCounters both send a lambda to IterateInline8bitCounters.
Patch by Kyungtak Woo (@kevinwkt).
Reviewers: Dor1s, metzman, kcc, morehouse
Reviewed By: metzman, morehouse
Subscribers: delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D49453
llvm-svn: 337403
Wei Mi [Wed, 18 Jul 2018 16:56:33 +0000 (16:56 +0000)]
[RegAlloc][NFC] Fix the help string of the option "huge-size-for-split".
llvm-svn: 337402
Paul Semel [Wed, 18 Jul 2018 16:39:21 +0000 (16:39 +0000)]
[llvm-objdump] Add -demangle (-C) option
Differential Revision: https://reviews.llvm.org/D49043
llvm-svn: 337401
Roman Lebedev [Wed, 18 Jul 2018 16:19:06 +0000 (16:19 +0000)]
[NFC][X86][AArch64][DAGCombine] More tests for optimizeSetCCOfSignedTruncationCheck()
At least one of these cases is more canonical,
so we really do have to handle it.
https://godbolt.org/g/pkzP3X
https://rise4fun.com/Alive/pQyh
llvm-svn: 337400
Benjamin Kramer [Wed, 18 Jul 2018 16:17:53 +0000 (16:17 +0000)]
[llvm-objcopy] %python wants to be in quotes, because it might contain spaces
llvm-svn: 337399
Nirav Dave [Wed, 18 Jul 2018 16:17:03 +0000 (16:17 +0000)]
[MC] Fix nested macro body parsing
Add missing .rep case in nestlevel checking for macro body parsing.
llvm-svn: 337398
Stella Stamenova [Wed, 18 Jul 2018 15:50:24 +0000 (15:50 +0000)]
Fix variables.test after D49018
Summary: This one fixes variables.test after D49018. The test was broken because D49018 adds a location information to variables, but I hadn't noticed that, because I used 32-bit build to run tests, so the test looked to me already broken before that commit (the test relies on mangled names, but the mangling schemes are different for 32-bit and 64-bit).
Reviewers: stella.stamenova, lldb-commits
Reviewed By: stella.stamenova
Patch By: Aleksandr Urakov
Differential Revision: https://reviews.llvm.org/D49475
llvm-svn: 337397
Eric Liu [Wed, 18 Jul 2018 15:31:14 +0000 (15:31 +0000)]
[clangd] Also get scope for RK_pattern completion results.
For exmaple, clas field candidates in constructor initializers can be
RK_Pattern, but they can still have scopes.
llvm-svn: 337396
Stella Stamenova [Wed, 18 Jul 2018 15:21:54 +0000 (15:21 +0000)]
[windows] Use a well-known path for ComSpec if we fail to retrieve it
Summary: Right now we always try to retrieve ComSpec and if we fail, we give up. This rarely fails, but we can update the logic so that we fail even less frequently. Since there is a well-known path (albeit not always correct), try the path when we failed to retrieve it. Note that on other platforms, we generally just return a well-known path without any checking.
Reviewers: asmith, zturner, labath
Reviewed By: zturner, labath
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49451
llvm-svn: 337395
Eric Liu [Wed, 18 Jul 2018 15:17:52 +0000 (15:17 +0000)]
[CodeComplete] Allow getDeclaration on RK_Pattern result.
Summary:
RK_Pattern results can also have associated declarations e.g. field
decls in constructor initializers.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49484
llvm-svn: 337394
Stella Stamenova [Wed, 18 Jul 2018 15:16:54 +0000 (15:16 +0000)]
[lit, lldbsuite] Remove tests that are duplicated between lit and lldb-suite
Summary: Several tests exist in both lit and lldbsuite. This removes the lit version of the duplicated tests.
Reviewers: asmith, zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49450
llvm-svn: 337393
Simon Atanasyan [Wed, 18 Jul 2018 14:11:22 +0000 (14:11 +0000)]
[mips] Fix predicate for the MipsTruncIntFP pattern
This is a follow-up to the rL337171. This patch fixes regression
introduced by the r337171 and enables MipsTruncIntFP pattern.
Differential revision: https://reviews.llvm.org/D49469
llvm-svn: 337392
Chandler Carruth [Wed, 18 Jul 2018 14:05:14 +0000 (14:05 +0000)]
[x86/SLH] Add the design document for Speculative Load Hardening,
a Spectre v1 mitigation.
This was initially posted w/ the patch implementing this, got some basic
review there. Also, it is generated from a the Google doc that I shared
as part of the Speculative Load Hardening RFC and which has seen pretty
widespread review at this point.
However, as the patches are landing in LLVM, I wanted to land the docs
as well. But it seemed like a bad idea to have them in the same commit
in case of reverts or other things. So the docs are split out here.
Thanks for all the review so far, and further review and improvements to
the documentation here welcome. Please feel free to keep hammering on
the code review or Google document.
Note that this is a markdown document which Sphinx doesn't yet process.
But we can add support for that after and this should get picked up
(and I'm preparing patches for that). Also, this gets the document
itself into a nice shared place where we can iterate on it.
Differential Revision: https://reviews.llvm.org/D49433
llvm-svn: 337391
Simon Pilgrim [Wed, 18 Jul 2018 13:53:55 +0000 (13:53 +0000)]
[SLPVectorizer] Avoid duplicate scalar cost calculations in BoUpSLP::getEntryCost. NFCI.
Pulled out from D49225, we have a lot of repeated scalar cost calculations, often with arguments that don't look the same but turn out to be.
llvm-svn: 337390
Tim Northover [Wed, 18 Jul 2018 13:42:18 +0000 (13:42 +0000)]
[Support] Build fix for Haiku when checking for a local filesystem
Haiku does not expose information about local versus remote mounts, so just
return false, like Cygwin.
Patch by Niels Sascha Reedijk.
llvm-svn: 337389
Erich Keane [Wed, 18 Jul 2018 13:07:13 +0000 (13:07 +0000)]
Clear properties inadvertantly added to tests in R336379
llvm-svn: 337388
Simon Pilgrim [Wed, 18 Jul 2018 13:01:20 +0000 (13:01 +0000)]
[X86][SSE] Remove BLENDPD canonicalization from combineTargetShuffle
When rL336971 removed the scalar-fp isel patterns, we lost the need for this canonicalization - commutation/folding can handle everything else.
llvm-svn: 337387
Tim Northover [Wed, 18 Jul 2018 12:37:43 +0000 (12:37 +0000)]
ARM: stop explicitly marking armv7k libcalls as hard-float. NFC.
Since the triple's default is hard float, the libcalls will already use VFP
registers.
llvm-svn: 337386
Tim Northover [Wed, 18 Jul 2018 12:37:04 +0000 (12:37 +0000)]
ARM: switch armv7em triple to hard-float defaults and libcalls.
We were emitting incorrect calls to libm functions that LLVM had decided it
knew about because the default is soft-float.
llvm-svn: 337385
Tim Northover [Wed, 18 Jul 2018 12:36:25 +0000 (12:36 +0000)]
ARM: deduplicate hard-float detection code. NFC.
ARMSubtarget had a copy/pasted block to determine whether the target was
hard-float, but it just delegated to triple features anyway so it's better at
the TargetMachine level.
llvm-svn: 337384
Sander de Smalen [Wed, 18 Jul 2018 11:59:12 +0000 (11:59 +0000)]
[AArch64][SVE] Asm: Support for unpredicated FP operations.
This patch adds support for the following unpredicated
floating-point instructions:
FADD Floating point add
FSUB Floating point subtract
FMUL Floating point multiplication
FTSMUL Floating point trigonometric starting value
FRECPS Floating point reciprocal step
FRSQRTS Floating point reciprocal square root step
The instructions have the following assembly format:
fadd z0.h, z1.h, z2.h
and have variants for 16, 32 and 64-bit FP elements.
llvm-svn: 337383
George Rimar [Wed, 18 Jul 2018 11:56:53 +0000 (11:56 +0000)]
[ELF] - Stop silently producing a broken .eh_frame_hdr.
Currently, getFdePC() returns uint64_t. Its because the following
encodings might use 8 bytes: DW_EH_PE_absptr and DW_EH_PE_udata8.
But caller assigns returned value to uint32_t field:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L508
Value is used for building .eh_frame_hdr section.
We use DW_EH_PE_sdata4 encoding for building it at this moment:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L2545
And that means that an overflow issue might happen if
DW_EH_PE_absptr/DW_EH_PE_udata8 address encodings are present
in .eh_frame. In that case, before this patch, we silently would
truncate the address and produced broken .eh_frame_hdr section.
It would be not hard to support real 64-bit values for
DW_EH_PE_absptr/DW_EH_PE_udata8 encodings, but it is
unclear if it is usefull and if we should do it.
Since nobody faced/reported it, int this patch I only implement
a check to stop producing broken output silently for now.
llvm-svn: 337382
Nico Weber [Wed, 18 Jul 2018 11:55:03 +0000 (11:55 +0000)]
Mention clang-cl improvements from r335466 and r336379 in ReleaseNotes.rst
llvm-svn: 337381
Andrea Di Biagio [Wed, 18 Jul 2018 11:16:31 +0000 (11:16 +0000)]
[TargetInstPredicate] Add definition of CheckInvalidRegisterOperand.
This should have been part of r337378. I forgot to svn add it before committing
the change.
llvm-svn: 337380
Max Kazantsev [Wed, 18 Jul 2018 11:03:40 +0000 (11:03 +0000)]
[NFC] Make a test more neat
llvm-svn: 337379
Andrea Di Biagio [Wed, 18 Jul 2018 11:03:22 +0000 (11:03 +0000)]
[Tablegen][PredicateExpander] Add the ability to define checks for invalid registers.
This was discussed in review D49436.
llvm-svn: 337378
George Rimar [Wed, 18 Jul 2018 11:02:37 +0000 (11:02 +0000)]
[ELF] - Add a test case to check DW_EH_PE_absptr address encoding.
This covers the following line of the code:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L525
llvm-svn: 337377
Roman Lebedev [Wed, 18 Jul 2018 10:55:17 +0000 (10:55 +0000)]
[InstCombine] Re-commit: Fold 'check for [no] signed truncation' pattern
Summary:
[[ https://bugs.llvm.org/show_bug.cgi?id=38149 | PR38149 ]]
As discussed in https://reviews.llvm.org/D49179#1158957 and later,
the IR for 'check for [no] signed truncation' pattern can be improved:
https://rise4fun.com/Alive/gBf
^ that pattern will be produced by Implicit Integer Truncation sanitizer,
https://reviews.llvm.org/D48958 https://bugs.llvm.org/show_bug.cgi?id=21530
in signed case, therefore it is probably a good idea to improve it.
The DAGCombine will reverse this transform, see
https://reviews.llvm.org/D49266
This transform is surprisingly frustrating.
This does not deal with non-splat shift amounts, or with undef shift amounts.
I've outlined what i think the solution should be:
```
// Potential handling of non-splats: for each element:
// * if both are undef, replace with constant 0.
// Because (1<<0) is OK and is 1, and ((1<<0)>>1) is also OK and is 0.
// * if both are not undef, and are different, bailout.
// * else, only one is undef, then pick the non-undef one.
```
This is a re-commit, as the original patch, committed in rL337190
was reverted in rL337344 as it broke chromium build:
https://bugs.llvm.org/show_bug.cgi?id=38204 and
https://crbug.com/864832
Proofs that the fixed folds are ok: https://rise4fun.com/Alive/VYM
Differential Revision: https://reviews.llvm.org/D49320
llvm-svn: 337376
Simon Pilgrim [Wed, 18 Jul 2018 10:54:13 +0000 (10:54 +0000)]
[X86][SSE] Add extra scalar fop + blend tests for commuted inputs
While working on PR38197, I noticed that we don't make use of FADD/FMUL being able to commute the inputs to support the addps+movss -> addss style combine
llvm-svn: 337375
George Rimar [Wed, 18 Jul 2018 10:42:10 +0000 (10:42 +0000)]
[ELF] - Improve eh-frame-value-format7.s test case.
This adds .eh_frame_hdr content checking to test
that DW_EH_PE_udata2 address was decoded correctly.
llvm-svn: 337374
Daniel Cederman [Wed, 18 Jul 2018 10:05:30 +0000 (10:05 +0000)]
Revert "[Sparc] Use the IntPair reg class for r constraints with value type f64"
This reverts commit
55222c9183c6e07f53a54c4061677734f54feac1.
I missed that this patch has a dependency on https://reviews.llvm.org/D49219
that has not been approved yet.
llvm-svn: 337373
Sander de Smalen [Wed, 18 Jul 2018 09:37:51 +0000 (09:37 +0000)]
[AArch64][SVE] Asm: Support for UDOT/SDOT instructions.
The signed/unsigned DOT instructions perform a dot-product on
quadtuplets from two source vectors and accumulate the result in
the destination register. The instructions come in two forms:
Vector form, e.g.
sdot z0.s, z1.b, z2.b - signed dot product on four 8-bit quad-tuplets,
accumulating results in 32-bit elements.
udot z0.d, z1.h, z2.h - unsigned dot product on four 16-bit quad-tuplets,
accumulating results in 64-bit elements.
Indexed form, e.g.
sdot z0.s, z1.b, z2.b[3] - signed dot product on four 8-bit quad-tuplets
with specified quadtuplet from second
source vector, accumulating results in 32-bit
elements.
udot z0.d, z1.h, z2.h[1] - dot product on four 16-bit quad-tuplets
with specified quadtuplet from second
source vector, accumulating results in 64-bit
elements.
llvm-svn: 337372
George Rimar [Wed, 18 Jul 2018 09:25:36 +0000 (09:25 +0000)]
[llvm-objdump] - An attempt to fix BB after r337361.
Seems r337361 is the reason of the following ARM BB failures:
http://lab.llvm.org:8011/builders/clang-cmake-armv8-quick
http://lab.llvm.org:8011/builders/clang-cmake-armv8-full/builds/4633
Reason is unclear to me, other bots are OK.
If this will not help, I'll revert r337361.
llvm-svn: 337371
Daniel Cederman [Wed, 18 Jul 2018 09:25:33 +0000 (09:25 +0000)]
[Sparc] Use the IntPair reg class for r constraints with value type f64
Summary: This is how it appears to be handled in GCC and it prevents a
"Unknown mismatch" error in the SelectionDAGBuilder.
Reviewers: venkatra, jyknight, jrtc27
Reviewed By: jyknight, jrtc27
Subscribers: eraman, fedor.sergeev, jrtc27, llvm-commits
Differential Revision: https://reviews.llvm.org/D49218
llvm-svn: 337370
Sander de Smalen [Wed, 18 Jul 2018 09:17:29 +0000 (09:17 +0000)]
[AArch64][SVE] Asm: Integer divide instructions.
This patch adds the following predicated instructions:
UDIV Unsigned divide active elements
UDIVR Unsigned divide active elements, reverse form.
SDIV Signed divide active elements
SDIVR Signed divide active elements, reverse form.
e.g.
udiv z0.s, p0/m, z0.s, z1.s
(unsigned divide active elements in z0 by z1, store result in z0)
sdivr z0.s, p0/m, z0.s, z1.s
(signed divide active elements in z1 by z0, store result in z0)
llvm-svn: 337369
Simon Pilgrim [Wed, 18 Jul 2018 09:10:18 +0000 (09:10 +0000)]
Fix -Wdocumentation warning. NFCI.
llvm-svn: 337368
Simon Pilgrim [Wed, 18 Jul 2018 09:07:54 +0000 (09:07 +0000)]
Fix -Wdocumentation warning. NFCI.
llvm-svn: 337367
Philip Pfaffe [Wed, 18 Jul 2018 08:53:31 +0000 (08:53 +0000)]
[CMake] Export the LLVM_LINK_LLVM_DYLIB setting
Summary:
When building out-of-tree tools, there are several macros available to
automate linking against llvm. An examples is `add_llvm_executable`, or
the clang variant of this.
These macros use the LLVM_LINK_LLVM_DYLIB option to decide whether to
link against libraries defined by setting LLVM_LINK_COMPONENTS or to
link against libLLVM instead. Currently this is problematic in
out-of-tree targets, because they cannot identify whether this option is
required or even available. If the option was enabled in LLVM's own
build, the clang libraries are built against libLLVM, so a client
linking against those must link against it too. On the other hand the
client can't just always link against it, because it might not be
available.
This is related to D44391, but that change assumed the client knew
whether they wanted the dylib or not.
Reviewers: mgorny, beanz, labath
Reviewed By: mgorny
Subscribers: bollu, llvm-commits
Differential Revision: https://reviews.llvm.org/D49193
llvm-svn: 337366
George Rimar [Wed, 18 Jul 2018 08:52:09 +0000 (08:52 +0000)]
[ELF] - Improve relocatable-many-sections.s test case. NFC.
This adds a check for .shstrtab section index.
llvm-svn: 337365
Roman Lebedev [Wed, 18 Jul 2018 08:49:51 +0000 (08:49 +0000)]
[NFC][InstCombine] i65 tests for 'check for [no] signed truncation' pattern
Those initially broke chromium build:
https://bugs.llvm.org/show_bug.cgi?id=38204 and
https://crbug.com/864832
llvm-svn: 337364
George Rimar [Wed, 18 Jul 2018 08:44:38 +0000 (08:44 +0000)]
[ELF] - Do not produce broken output when amount of sections is > ~65k
This is a part of ttps://bugs.llvm.org//show_bug.cgi?id=38119
We produce broken ELF header now when the number of output sections is >= SHN_LORESERVE (0xff00).
ELF spec says (http://www.sco.com/developers/gabi/2003-12-17/ch4.eheader.html):
e_shnum:
If the number of sections is greater than or equal to SHN_LORESERVE (0xff00), this member has the value zero
and the actual number of section header table entries is contained in the sh_size field of the section header at index 0.
(Otherwise, the sh_size member of the initial entry contains 0.)
e_shstrndx
If the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00), this member has the
value SHN_XINDEX (0xffff) and the actual index of the section name string table section is contained in the sh_link field of
the section header at index 0. (Otherwise, the sh_link member of the initial entry contains 0.)
We did not set these fields correctly earlier. The patch fixes the issue.
Differential revision: https://reviews.llvm.org/D49371
llvm-svn: 337363
George Rimar [Wed, 18 Jul 2018 08:39:31 +0000 (08:39 +0000)]
[ELF] — Add a test case for DW_EH_PE_udata2 encoding.
This adds a test to check LLD can handle such address format correctly.
Test case covers the following line:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L519
llvm-svn: 337362
George Rimar [Wed, 18 Jul 2018 08:34:35 +0000 (08:34 +0000)]
[llvm-objdump] - Stop reporting bogus section IDs.
Imagine we have a file with few sections, and one of them is .foo
with index N != 0.
Problem is that when llvm-objdump is given a -section=.foo parameter
it lists .foo as a section at index 0. That makes impossible to write
test cases which needs to find the index of the particular section,
while ignoring dumping of others.
The patch fixes that.
Differential revision: https://reviews.llvm.org/D49372
llvm-svn: 337361
George Rimar [Wed, 18 Jul 2018 08:19:58 +0000 (08:19 +0000)]
[llvm-readobj] - Teach tool to dump objects with >= SHN_LORESERVE of sections.
http://www.sco.com/developers/gabi/2003-12-17/ch4.eheader.html
says that e_shnum and/or e_shstrndx may have special values if
"the number of sections is greater than or equal to SHN_LORESERVE" or
"the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00)"
Previously llvm-readobj was unable to dump such files, patch changes that.
I had to add a precompiled test case because it does not seem possible to
prepare a test using yaml2obj or llvm-mc (not clear how to make .shstrtab
to have index >= SHN_LORESERVE).
Differential revision: https://reviews.llvm.org/D49369
llvm-svn: 337360
Roman Lebedev [Wed, 18 Jul 2018 08:15:13 +0000 (08:15 +0000)]
Revert test changes part of "Revert "[InstCombine] Fold 'check for [no] signed truncation' pattern""
We want the test to remain good anyway.
I think the fix is incoming.
This reverts part of commit rL337344.
llvm-svn: 337359
Sander de Smalen [Wed, 18 Jul 2018 08:10:03 +0000 (08:10 +0000)]
[AArch64][SVE] Asm: Support for integer MUL instructions.
This patch adds the following instructions:
MUL - multiply vectors, e.g.
mul z0.h, p0/m, z0.h, z1.h
- multiply with immediate, e.g.
mul z0.h, z0.h, #127
SMULH - signed multiply returning high half, e.g.
smulh z0.h, p0/m, z0.h, z1.h
UMULH - unsigned multiply returning high half, e.g.
umulh z0.h, p0/m, z0.h, z1.h
llvm-svn: 337358
Craig Topper [Wed, 18 Jul 2018 07:31:32 +0000 (07:31 +0000)]
[X86] Enable commuting of VUNPCKHPD to VMOVLHPS to enable load folding by using VMOVLPS with a modified address.
This required an annoying amount of tablegen multiclass changes to make only VUNPCKHPDZ128rr commutable.
llvm-svn: 337357
Craig Topper [Wed, 18 Jul 2018 07:31:30 +0000 (07:31 +0000)]
[X86] Add test case for missed opportunity to commute vunpckhpd to enable use of vmovlps to fold a load.
We do this transform for SSE, but not AVX or AVX512VL.
llvm-svn: 337356
Joachim Protze [Wed, 18 Jul 2018 07:23:46 +0000 (07:23 +0000)]
[libomptarget] Also support several images for elf
In revision r336569 (D49036) libomptarget support for multiple nvidia images
has been fixed in case a target region resides inside one or multiple
libraries and in the compiled application. But the issues is still present
for elf images.
This fix will also support multiple images for elf.
Patch by Jannis Klinkenberg
Reviewers: protze.joachim, ABataev, grokos
Reviewed By: protze.joachim, ABataev, grokos
Subscribers: openmp-commits
Differential Revision: https://reviews.llvm.org/D49418
llvm-svn: 337355
Craig Topper [Wed, 18 Jul 2018 07:08:28 +0000 (07:08 +0000)]
[X86] Regenerate fma.ll checks using current version of the script which produces different regular expressions on spills and reloads. NFC
llvm-svn: 337354
Vassil Vassilev [Wed, 18 Jul 2018 06:49:33 +0000 (06:49 +0000)]
[modules] Print input files when -module-file-info file switch is passed.
This patch improves traceability of duplicated header files which end
up in multiple pcms.
Differential Revision: https://reviews.llvm.org/D47118
llvm-svn: 337353
Martin Storsjo [Wed, 18 Jul 2018 06:15:09 +0000 (06:15 +0000)]
[AArch64] Define TARGET_HEADER_BUILTIN
Without it, the new intrinsics became available for all language
variants. This was missed in SVN r337327.
llvm-svn: 337352
Hiroshi Inoue [Wed, 18 Jul 2018 06:04:43 +0000 (06:04 +0000)]
[NFC] fix trivial typos in comments
llvm-svn: 337351
Justin Hibbits [Wed, 18 Jul 2018 05:19:25 +0000 (05:19 +0000)]
Fix build failures from r337347, found by clang
* Delete a no-longer-used override, and mark the other
getRegisterTypeForCallingConv() as override.
* SPE only supports i32, not i64, as the internal type, so simply remove
the type check, so that DestReg and Opc are provably always set.
GCC 6.4 did not warn about either of the above.
llvm-svn: 337350
Craig Topper [Wed, 18 Jul 2018 05:10:53 +0000 (05:10 +0000)]
[X86] Remove patterns that mix X86ISD::MOVLHPS/MOVHLPS with v2i64/v2f64 types.
The X86ISD::MOVLHPS/MOVHLPS should now only be emitted in SSE1 only. This means that the v2i64/v2f64 types would be illegal thus we don't need these patterns.
llvm-svn: 337349
Craig Topper [Wed, 18 Jul 2018 05:10:51 +0000 (05:10 +0000)]
[X86] Generate v2f64 X86ISD::UNPCKL/UNPCKH instead of X86ISD::MOVLHPS/MOVHLPS for unary v2f64 {0,0} and {1,1} shuffles with SSE2.
I'm trying to restrict the MOVLHPS/MOVHLPS ISD nodes to SSE1 only. With SSE2 we can use unpcks. I believe this will allow some patterns to be cleaned up to require fewer bitcasts.
I've put in an odd isel hack to still select MOVHLPS instruction from the unpckh node to avoid changing tests and because movhlps is a shorter encoding. Ideally we'd do execution domain switching on this, but the operands are in the wrong order and are tied. We might be able to try a commute in the domain switching using custom code.
We already support domain switching for UNPCKLPD and MOVLHPS.
llvm-svn: 337348
Justin Hibbits [Wed, 18 Jul 2018 04:25:10 +0000 (04:25 +0000)]
Introduce codegen for the Signal Processing Engine
Summary:
The Signal Processing Engine (SPE) is found on NXP/Freescale e500v1,
e500v2, and several e200 cores. This adds support targeting the e500v2,
as this is more common than the e500v1, and is in SoCs still on the
market.
This patch is very intrusive because the SPE is binary incompatible with
the traditional FPU. After discussing with others, the cleanest
solution was to make both SPE and FPU features on top of a base PowerPC
subset, so all FPU instructions are now wrapped with HasFPU predicates.
Supported by this are:
* Code generation following the SPE ABI at the LLVM IR level (calling
conventions)
* Single- and Double-precision math at the level supported by the APU.
Still to do:
* Vector operations
* SPE intrinsics
As this changes the Callee-saved register list order, one test, which
tests the precise generated code, was updated to account for the new
register order.
Reviewed by: nemanjai
Differential Revision: https://reviews.llvm.org/D44830
llvm-svn: 337347
Justin Hibbits [Wed, 18 Jul 2018 04:24:57 +0000 (04:24 +0000)]
Complete the SPE instruction set patterns
This is the lead-up to having SPE codegen. Add the rest of the
instructions, along with MC tests.
Differential Revision: https://reviews.llvm.org/D44829
llvm-svn: 337346
Justin Hibbits [Wed, 18 Jul 2018 04:24:49 +0000 (04:24 +0000)]
Add PowerPC e500(v2) core scheduler and directives.
Differential Revision: https://reviews.llvm.org/D44828
llvm-svn: 337345
Bob Haarman [Wed, 18 Jul 2018 02:18:28 +0000 (02:18 +0000)]
Revert "[InstCombine] Fold 'check for [no] signed truncation' pattern"
This reverts r337190 (and a few follow-up commits), which caused the
Chromium build to fail. See
https://bugs.llvm.org/show_bug.cgi?id=38204 and
https://crbug.com/864832
llvm-svn: 337344
Dean Michael Berris [Wed, 18 Jul 2018 02:08:39 +0000 (02:08 +0000)]
[XRay][compiler-rt] Segmented Array: Simplify and Optimise
Summary:
This is a follow-on to D49217 which simplifies and optimises the
implementation of the segmented array. In this patch we co-locate the
book-keeping for segments in the `__xray::Array<T>` with the data it's
managing. We take the chance in this patch to actually rename `Chunk` to
`Segment` to better align with the high-level description of the
segmented array.
With measurements using benchmarks landed in D48879, we've identified
that calls to `pthread_getspecific` started dominating the cycles, which
led us to revert the change made in D49217 to use C++ thread_local
initialisation instead (it reduces the cost by a huge margin, since we
save one PLT-based call to pthread functions in the hot path). In
particular, this is in `__xray::getThreadLocalData()`.
We also took the opportunity to remove the least-common-multiple based
calculation and instead pack as much data into segments of the array.
This greatly simplifies the API of the container which hides as much of
the implementation details as possible. For instance, we calculate the
number of elements we need for the each segment internally in the Array
instead of making it part of the type.
With the changes here, we're able to get a measurable improvement on the
performance of profiling mode on top of what D48879 already provides.
Depends on D48879.
Reviewers: kpw, eizan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49363
llvm-svn: 337343
Dean Michael Berris [Wed, 18 Jul 2018 01:53:39 +0000 (01:53 +0000)]
[XRay][compiler-rt] Simplify Allocator Implementation
Summary:
This change simplifies the XRay Allocator implementation to self-manage
an mmap'ed memory segment instead of using the internal allocator
implementation in sanitizer_common.
We've found through benchmarks and profiling these benchmarks in D48879
that using the internal allocator in sanitizer_common introduces a
bottleneck on allocating memory through a central spinlock. This change
allows thread-local allocators to eliminate contention on the
centralized allocator.
To get the most benefit from this approach, we also use a managed
allocator for the chunk elements used by the segmented array
implementation. This gives us the chance to amortize the cost of
allocating memory when creating these internal segmented array data
structures.
We also took the opportunity to remove the preallocation argument from
the allocator API, simplifying the usage of the allocator throughout the
profiling implementation.
In this change we also tweak some of the flag values to reduce the
amount of maximum memory we use/need for each thread, when requesting
memory through mmap.
Depends on D48956.
Reviewers: kpw, eizan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49217
llvm-svn: 337342
Dean Michael Berris [Wed, 18 Jul 2018 01:31:30 +0000 (01:31 +0000)]
[XRay][compiler-rt] FDR Mode: Allow multiple runs
Summary:
Fix a bug in FDR mode which didn't allow for re-initialising the logging
in the same process. This change ensures that:
- When we flush the FDR mode logging, that the state of the logging
implementation is `XRAY_LOG_UNINITIALIZED`.
- Fix up the thread-local initialisation to use aligned storage and
`pthread_getspecific` as well as `pthread_setspecific` for the
thread-specific data.
- Actually use the pointer provided to the thread-exit cleanup handling,
instead of assuming that the thread has thread-local data associated
with it, and reaching at thread-exit time.
In this change we also have an explicit test for two consecutive
sessions for FDR mode tracing, and ensuring both sessions succeed.
Reviewers: kpw, eizan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49359
llvm-svn: 337341
Sterling Augustine [Wed, 18 Jul 2018 00:33:25 +0000 (00:33 +0000)]
Workaround warning bug in old versions of gcc.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
llvm-svn: 337340
Peter Collingbourne [Wed, 18 Jul 2018 00:27:07 +0000 (00:27 +0000)]
Re-land r337333, "Teach Clang to emit address-significance tables.",
which was reverted in r337336.
The problem that required a revert was fixed in r337338.
Also added a missing "REQUIRES: x86-registered-target" to one of
the tests.
Original commit message:
> Teach Clang to emit address-significance tables.
>
> By default, we emit an address-significance table on all ELF
> targets when the integrated assembler is enabled. The emission of an
> address-significance table can be controlled with the -faddrsig and
> -fno-addrsig flags.
>
> Differential Revision: https://reviews.llvm.org/D48155
llvm-svn: 337339
Peter Collingbourne [Wed, 18 Jul 2018 00:21:40 +0000 (00:21 +0000)]
CodeGen: Don't create address significance table entries for thread-local variables.
The presence of these symbols in the symbol table can cause symbol type
mismatch errors (or undefined symbol errors on emulated TLS targets)
and they can't be ICF'd anyway.
llvm-svn: 337338
Puyan Lotfi [Wed, 18 Jul 2018 00:10:51 +0000 (00:10 +0000)]
[NFC][llvm-objcopy] Cleanup namespace usage in llvm-objcopy.
Nest any classes not used outside of a file into anon. Nest any classes used
across files in llvm-objcopy into namespace llvm::objcopy.
Differential Revision: https://reviews.llvm.org/D49449
llvm-svn: 337337
Peter Collingbourne [Tue, 17 Jul 2018 23:56:30 +0000 (23:56 +0000)]
Revert r337333, "Teach Clang to emit address-significance tables."
Causing multiple failures on sanitizer bots due to TLS symbol errors,
e.g.
/usr/bin/ld: __msan_origin_tls: TLS definition in /home/buildbots/ppc64be-clang-test/clang-ppc64be/stage1/lib/clang/7.0.0/lib/linux/libclang_rt.msan-powerpc64.a(msan.cc.o) section .tbss.__msan_origin_tls mismatches non-TLS reference in /tmp/lit_tmp_0a71tA/mallinfo-3ca75e.o
llvm-svn: 337336
Jason Molenda [Tue, 17 Jul 2018 23:44:09 +0000 (23:44 +0000)]
Link the lldb driver ("lldb") against the llvm static
libraries because of the new prettystackprinter dependency.
llvm-svn: 337335
Craig Topper [Tue, 17 Jul 2018 23:26:20 +0000 (23:26 +0000)]
[X86] Remove the vector alignment requirement from the patterns added in r337320.
The resulting instruction will only load 64 bits so alignment isn't required.
llvm-svn: 337334
Peter Collingbourne [Tue, 17 Jul 2018 23:17:16 +0000 (23:17 +0000)]
Teach Clang to emit address-significance tables.
By default, we emit an address-significance table on all ELF
targets when the integrated assembler is enabled. The emission of an
address-significance table can be controlled with the -faddrsig and
-fno-addrsig flags.
Differential Revision: https://reviews.llvm.org/D48155
llvm-svn: 337333
Sterling Augustine [Tue, 17 Jul 2018 23:16:02 +0000 (23:16 +0000)]
Implement framework for linking split-stack object files, and x86_64 support.
llvm-svn: 337332
Peter Collingbourne [Tue, 17 Jul 2018 22:40:08 +0000 (22:40 +0000)]
CodeGen: Add a target option for emitting .addrsig directives for all address-significant symbols.
Differential Revision: https://reviews.llvm.org/D48143
llvm-svn: 337331
Richard Smith [Tue, 17 Jul 2018 22:24:11 +0000 (22:24 +0000)]
Replace LLVM_ALIGNAS with just alignas.
Various places in Clang and LLVM are already using alignas; it seems
our minimum host configuration now requires it.
llvm-svn: 337330
Richard Smith [Tue, 17 Jul 2018 22:24:09 +0000 (22:24 +0000)]
Restructure checking for, and warning on, lifetime extension.
This change implements C++ DR1696, which makes initialization of a
reference member of a class from a temporary object ill-formed. The
standard wording here is imprecise, but we interpret it as meaning that
any time a mem-initializer would result in lifetime extension, the
program is ill-formed.
This reinstates r337226, reverted in r337255, with a fix for the
InitializedEntity alignment problem that was breaking ARM buildbots.
llvm-svn: 337329
Peter Collingbourne [Tue, 17 Jul 2018 22:17:18 +0000 (22:17 +0000)]
MC: Implement support for new .addrsig and .addrsig_sym directives.
Part of the address-significance tables proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-May/123514.html
Differential Revision: https://reviews.llvm.org/D47744
llvm-svn: 337328