Davide Italiano [Tue, 12 Dec 2017 02:32:49 +0000 (02:32 +0000)]
[TestCppScope] This test now passes on Darwin.
I tested on x86-64 and Jason on embedded architectures.
This cleans up another couple of reported unexpected successes.
<rdar://problem/
28623427>
llvm-svn: 320452
Artem Dergachev [Tue, 12 Dec 2017 02:27:55 +0000 (02:27 +0000)]
[analyzer] In getSVal() API, disable auto-detection of void type as char type.
This is a follow-up from r314910. When a checker developer attempts to
dereference a location in memory through ProgramState::getSVal(Loc) or
ProgramState::getSVal(const MemRegion *), without specifying the second
optional QualType parameter for the type of the value he tries to find at this
location, the type is auto-detected from location type. If the location
represents a value beyond a void pointer, we thought that auto-detecting the
type as 'char' is a good idea. However, in most practical cases, the correct
behavior would be to specify the type explicitly, as it is available from other
sources, and the few cases where we actually need to take a 'char' are
workarounds rather than an intended behavior. Therefore, try to fail with an
easy-to-understand assertion when asked to read from a void pointer location.
Differential Revision: https://reviews.llvm.org/D38801
llvm-svn: 320451
Davide Italiano [Tue, 12 Dec 2017 02:10:23 +0000 (02:10 +0000)]
[testsuite] Remove even more testing vestiges.
With this one, the number of unexpected successes for the LLDB
test suite when building with clang ToT goes down to 18.
llvm-svn: 320450
Rafael Espindola [Tue, 12 Dec 2017 01:45:49 +0000 (01:45 +0000)]
Compact symbols from 96 to 88 bytes.
By using an index instead of a pointer for verdef we can put the index
next to the alignment field. This uses the otherwise wasted area and
reduces the shared symbol size.
By itself the performance change of this is in the noise, but I have a
followup patch to remove another 8 bytes that improves performance
when combined with this.
llvm-svn: 320449
Rafael Espindola [Tue, 12 Dec 2017 01:36:24 +0000 (01:36 +0000)]
Add an option for ICFing data.
An internal linker has support for merging identical data and in some
cases it can be a significant win.
This is behind an off by default flag so it has to be requested
explicitly.
llvm-svn: 320448
Davide Italiano [Tue, 12 Dec 2017 01:21:43 +0000 (01:21 +0000)]
Rollback [Testsuite] Rename this file from *m -> *mm.
After discussing this with Jim and Jason, I think my commit was
actually sweeping the issue under the carpet rather than fixing it.
I'll take a closer look between tonight and tomorrow.
llvm-svn: 320447
Petr Hosek [Tue, 12 Dec 2017 01:20:52 +0000 (01:20 +0000)]
[CMake] Support runtimes and monorepo layouts when looking for libcxx
This also slightly refactors the code that's checking the directory
presence which allows eliminating one unnecessary variable.
Differential Revision: https://reviews.llvm.org/D40637
llvm-svn: 320446
Petr Hosek [Tue, 12 Dec 2017 01:20:37 +0000 (01:20 +0000)]
[libcxxabi] Pass LIBCXXABI_SYSROOT and LIBCXXABI_GCC_TOOLCHAIN to lit
These are expected to be set by the shared lit scripts used from libc++.
Differential Revision: https://reviews.llvm.org/D40818
llvm-svn: 320445
Davide Italiano [Tue, 12 Dec 2017 01:14:11 +0000 (01:14 +0000)]
[testsuite] Remove testing failures vestiges.
Some tests are failing on macOS when building with the in-tree
clang, and this is because they're conditional on the version released.
Apple releases using a different versioning number, but as these are
conditional on clang < 7, they fail for clang ToT (which is 6.0).
As a general solution, we actually need either a mapping between
Apple internal release version and public ones.
That said, I discussed this with Fred , and Apple Clang 6.0 seems
to be old enough that we can remove this altogether (which means I
can delay implementing the general purpose solution for a bit).
Differential Revision: https://reviews.llvm.org/D41101
llvm-svn: 320444
Shoaib Meenai [Tue, 12 Dec 2017 00:47:07 +0000 (00:47 +0000)]
[lldb] Switch to add_llvm_install_targets
This adds the install-*-stripped targets to LLDB, which are required for
the install-distribution-stripped option. We also need to create some
install-*-stripped targets manually, which are modeled after their
corresponding install-* targets.
Differential Revision: https://reviews.llvm.org/D41099
llvm-svn: 320443
Petr Hosek [Tue, 12 Dec 2017 00:31:46 +0000 (00:31 +0000)]
[ELF] Use shell to check the file permissions
This is less error-prone to mask settings than stat.
Differential Revision: https://reviews.llvm.org/D41097
llvm-svn: 320442
Sam Clegg [Tue, 12 Dec 2017 00:22:21 +0000 (00:22 +0000)]
[WebAssembly] Check more details in call-indirect test. NFC.
Also make function bodies unique so they can be distinguished
in the output. This is helpful for adding support for --gc-sections.
Differential Revision: https://reviews.llvm.org/D41093
llvm-svn: 320441
Vedant Kumar [Mon, 11 Dec 2017 23:34:50 +0000 (23:34 +0000)]
[llvm-cov] Simplify a test case. NFC.
llvm-svn: 320439
Petr Hosek [Mon, 11 Dec 2017 23:30:54 +0000 (23:30 +0000)]
[ELF] Don't set the executable bit for relocatable files
These are not executable files so they shouldn't be marked as such.
Differential Revision: https://reviews.llvm.org/D41041
llvm-svn: 320438
Jake Ehrlich [Mon, 11 Dec 2017 23:25:27 +0000 (23:25 +0000)]
[ELF] Change default output section type to SHT_NOBITS
When an output section has no byte commands and has no input sections then it
would be ideal if the type of the section is SHT_NOBITS so that the file can
take up less space. This change sets the default type of of output sections to
SHT_NOBITS instead of SHT_PROGBITS to allow this. This required some minor test
changes (which double as tests for this new behavior) but extend-pt-load.s had
be changed in a non-trivial way. Since it seems to me that the point of the
test is to point out the consequences of how flags are assigned to output
sections that don't have input sections I changed the test to work and still
show how the memsize of the executable segment was changed.
Differential Revision: https://reviews.llvm.org/D41082
llvm-svn: 320437
Rui Ueyama [Mon, 11 Dec 2017 23:19:11 +0000 (23:19 +0000)]
Remove redundant local variables.
llvm-svn: 320436
Max Moroz [Mon, 11 Dec 2017 23:17:46 +0000 (23:17 +0000)]
[llvm-cov] Add an option for "export" command to emit only file summary data.
Summary:
That allows to get the same data as produced by "llvm-cov report",
but in JSON format, which is better for further processing by end users.
Reviewers: vsk
Reviewed By: vsk
Differential Revision: https://reviews.llvm.org/D41085
llvm-svn: 320435
Rui Ueyama [Mon, 11 Dec 2017 23:09:18 +0000 (23:09 +0000)]
Do not read the same .lib file more than once.
In the following command line,
lld-link foo/bar.lib /defaultlib:bar.lib
"/defaultlib:bar.lib" should be a nop even if a file with the same
name exists in other library search path.
Fixes https://bugs.llvm.org/show_bug.cgi?id=35476
Differential Revision: https://reviews.llvm.org/D41094
llvm-svn: 320434
Rui Ueyama [Mon, 11 Dec 2017 23:09:03 +0000 (23:09 +0000)]
Reduce indentation.
llvm-svn: 320433
Sam Clegg [Mon, 11 Dec 2017 23:03:38 +0000 (23:03 +0000)]
Reland "[WebAssembly] Import the linear memory and function table."
Original change: https://reviews.llvm.org/D40875
llvm-svn: 320432
Peter Collingbourne [Mon, 11 Dec 2017 22:47:43 +0000 (22:47 +0000)]
ELF: Do not follow relocation edges to output sections during GC.
This fixes an assertion error introduced by r320390.
Differential Revision: https://reviews.llvm.org/D41095
llvm-svn: 320431
Rafael Espindola [Mon, 11 Dec 2017 22:40:18 +0000 (22:40 +0000)]
Return R_PLT_PC for R_PPC_PLTREL24.
The PPC port doesn't support PLT yet, but the architecture independent
code optimizes PLT access for non preemptible symbols, which is
exactly what returning R_PC was trying to implement.
llvm-svn: 320430
Richard Trieu [Mon, 11 Dec 2017 22:25:04 +0000 (22:25 +0000)]
Revert r318704 - [Sparc] efficient pattern for UINT_TO_FP conversion
See bug https://bugs.llvm.org/show_bug.cgi?id=35631
r318704 is giving a fatal error on some code with unsigned to floating point
conversions.
llvm-svn: 320429
Sam Clegg [Mon, 11 Dec 2017 22:00:56 +0000 (22:00 +0000)]
[WebAssembly] De-dup indirect function table.
Create the indirect function table based on symbols rather
than just duplicating the input entries. This has the
effect of de-duplicating the table.
This is a followup to the equivalent change made for globals:
https://reviews.llvm.org/D40859
Partially based on a patch by Nicholas Wilson:
https://reviews.llvm.org/D40845
Differential Revision: https://reviews.llvm.org/D40989
llvm-svn: 320428
Sam Clegg [Mon, 11 Dec 2017 21:57:31 +0000 (21:57 +0000)]
Use ErrorOS for log messages as well as error
log are also diagnostics so it seems like they should to
the same place as errors and debug messages.
Without this change when I enable --verbose those messages
go to stdout, but when I enable "-mllvm -debug" those messages
go to stderr (because dbgs() goes to stderr by default).
So I end up having to do this a lot:
lld <args> > output_message 2>&1
Differential Revision: https://reviews.llvm.org/D41033
llvm-svn: 320427
Sam Clegg [Mon, 11 Dec 2017 21:52:21 +0000 (21:52 +0000)]
[WebAssembly] Preserve ordering of global symbols
This change restores the behavior that global indexes
are assigned in object file order. This was accidentally
changed in https://reviews.llvm.org/D40859.
Differential Revision: https://reviews.llvm.org/D41038
llvm-svn: 320426
Davide Italiano [Mon, 11 Dec 2017 21:52:02 +0000 (21:52 +0000)]
[test-suite] Un'XFAIL a test that's not failing anymore.
This is the first of a series of commits aiming to improve
overall LLDB's hygiene. Feel free to shout at me in case
I break something.
<rdar://problem/
30915340>
llvm-svn: 320425
Matt Arsenault [Mon, 11 Dec 2017 21:38:43 +0000 (21:38 +0000)]
LSR: Check more intrinsic pointer operands
llvm-svn: 320424
Hans Wennborg [Mon, 11 Dec 2017 21:25:22 +0000 (21:25 +0000)]
Fix x86-64-reloc-8.s test after r320416.
llvm-svn: 320423
Davide Italiano [Mon, 11 Dec 2017 21:21:53 +0000 (21:21 +0000)]
[Testsuite] Rename this file from *m -> *mm.
Should hopefully bring the bots back.
<rdar://problem/
35976115>
llvm-svn: 320422
Hans Wennborg [Mon, 11 Dec 2017 21:15:27 +0000 (21:15 +0000)]
Revert r320407 "[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast."
The tests fail (opt asserts) on Windows.
> Summary:
> If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
> &V2)))), bitcast)`, but the load is used in other instructions, it leads
> to looping in InstCombiner. Patch adds additional check that all users
> of the load instructions are stores and then replaces all uses of load
> instruction by the new one with new type.
>
> Reviewers: RKSimon, spatel, majnemer
>
> Subscribers: llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D41072
llvm-svn: 320421
Evandro Menezes [Mon, 11 Dec 2017 21:09:27 +0000 (21:09 +0000)]
[CodeGen] Improve the consistency of instruction fusion*
When either instruction in a fused pair has no other dependency, besides on
the other instruction, make sure that other instructions do not get
scheduled between them. Additionally, avoid fusing an instruction more than
once along the same dependency chain.
Differential revision: https://reviews.llvm.org/D36704
llvm-svn: 320420
Craig Topper [Mon, 11 Dec 2017 21:09:19 +0000 (21:09 +0000)]
[Driver][CodeGen] Add -mprefer-vector-width driver option and attribute during CodeGen.
This adds a new command line option -mprefer-vector-width to specify a preferred vector width for the vectorizers. Valid values are 'none' and unsigned integers. The driver will check that it meets those constraints. Specific supported integers will be managed by the targets in the backend.
Clang will take the value and add it as a new function attribute during CodeGen.
This represents the alternate direction proposed by Sanjay in this RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118734.html
The syntax here matches gcc, though gcc treats it as an x86 specific command line argument. gcc only allows values of 128, 256, and 512. I'm not having clang check any values.
Differential Revision: https://reviews.llvm.org/D40230
llvm-svn: 320419
Craig Topper [Mon, 11 Dec 2017 21:09:16 +0000 (21:09 +0000)]
[Docs] Regenerate command line documentation.
llvm-svn: 320418
Kostya Kortchinsky [Mon, 11 Dec 2017 21:03:12 +0000 (21:03 +0000)]
[sanitizer] Revert rL320409
Summary: D40679 broke a couple of builds, reverting while investigating.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, kubamracek, krytarowski, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D41088
llvm-svn: 320417
Alexander Richardson [Mon, 11 Dec 2017 20:47:21 +0000 (20:47 +0000)]
[ELF] When a relocation is out of range print the value and the range
Reviewers: ruiu, grimar
Reviewed By: ruiu
Subscribers: emaste, nemanjai, javed.absar, kbarton, llvm-commits
Differential Revision: https://reviews.llvm.org/D40962
llvm-svn: 320416
Adrian Prantl [Mon, 11 Dec 2017 20:43:21 +0000 (20:43 +0000)]
ASAN: Provide reliable debug info for local variables at -O0.
The function stack poisioner conditionally stores local variables
either in an alloca or in malloc'ated memory, which has the
unfortunate side-effect, that the actual address of the variable is
only materialized when the variable is accessed, which means that
those variables are mostly invisible to the debugger even when
compiling without optimizations.
This patch stores the address of the local stack base into an alloca,
which can be referred to by the debug info and is available throughout
the function. This adds one extra pointer-sized alloca to each stack
frame (but mem2reg can optimize it away again when optimizations are
enabled, yielding roughly the same debug info quality as before in
optimized code).
rdar://problem/
30433661
Differential Revision: https://reviews.llvm.org/D41034
llvm-svn: 320415
Tony Jiang [Mon, 11 Dec 2017 20:42:37 +0000 (20:42 +0000)]
[PowerPC] Partially enable the ISEL expansion pass.
The pass to expand ISEL instructions into if-then-else sequences in patch D23630
is currently disabled. This patch partially enable it by always removing the
unnecessary ISELs (all registers used by the ISELs are the same one) and folding
the ISELs which have the same input registers into unconditional copies.
Differential Revision: https://reviews.llvm.org/D40497
llvm-svn: 320414
Justin Bogner [Mon, 11 Dec 2017 19:53:23 +0000 (19:53 +0000)]
[cmake] Pass TARGETS_TO_BUILD through to host tools build
In r319620, the host build was changed to use Native for
TARGETS_TO_BUILD because passing semicolons through add_custom_command
is surprisingly difficult. However, Native really doesn't make any
sense here, and it only works because we don't technically do any
codegen in the host tools so pretty well anything will "work".
The problem here is that passing something other than the correct
value is very fragile - as evidence note how the llvm-config in the
host tools acts differently than the target one now, and misreports
the targets to build. Similarly, if there is any logic conditional on
the targets in tablegen (now or in the future), it will do the wrong
thing.
To fix this, we need to escape the semicolons in the targets string
and pass it through to the child cmake invocation.
llvm-svn: 320413
Rafael Espindola [Mon, 11 Dec 2017 19:45:36 +0000 (19:45 +0000)]
Handle symbols pointing to output sections.
Now that gc sections runs after linker defined symbols are added it
can see symbols that point to an OutputSection.
Should fix a bot failure.
llvm-svn: 320412
Erich Keane [Mon, 11 Dec 2017 19:44:28 +0000 (19:44 +0000)]
PR35586: Relax two asserts that are overly restrictive
The two asserts are too aggressive. In C++ mode, an
enum is NOT considered an integral type, but an enum value
is allowed to be an enum. This patch relaxes the two asserts
to allow the enum value as well (as typechecking does).
llvm-svn: 320411
Krzysztof Parzyszek [Mon, 11 Dec 2017 19:29:56 +0000 (19:29 +0000)]
[Hexagon] Remove unsupported vlut intrinsics
llvm-svn: 320410
Kostya Kortchinsky [Mon, 11 Dec 2017 19:23:12 +0000 (19:23 +0000)]
[sanitizer] Introduce a vDSO aware time function, and use it in the allocator [redo]
Summary:
Redo of D40657, which had the initial discussion. The initial code had to move
into a libcdep file, and things had to be shuffled accordingly.
`NanoTime` is a time sink when checking whether or not to release memory to
the OS. While reducing the amount of calls to said function is in the works,
another solution that was found to be beneficial was to use a timing function
that can leverage the vDSO.
We hit a couple of snags along the way, like the fact that the glibc crashes
when clock_gettime is called from a preinit_array, or the fact that
`__vdso_clock_gettime` is mangled (for security purposes) and can't be used
directly, and also that clock_gettime can be intercepted.
The proposed solution takes care of all this as far as I can tell, and
significantly improve performances and some Scudo load tests with memory
reclaiming enabled.
@mcgrathr: please feel free to follow up on
https://reviews.llvm.org/D40657#940857 here. I posted a reply at
https://reviews.llvm.org/D40657#940974.
Reviewers: alekseyshl, krytarowski, flowerhack, mcgrathr, kubamracek
Reviewed By: alekseyshl, krytarowski
Subscribers: #sanitizers, mcgrathr, srhines, llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D40679
llvm-svn: 320409
George Burgess IV [Mon, 11 Dec 2017 19:22:59 +0000 (19:22 +0000)]
Ensure moved-from container is cleared on move
In all cases except for this optimistic attempt to reuse memory, the
moved-from TinyPtrVector was left `empty()` at the end of this
assignment. Though using a container after it's been moved from can be a
bit sketchy, it's probably best to just be consistent here.
llvm-svn: 320408
Alexey Bataev [Mon, 11 Dec 2017 19:11:16 +0000 (19:11 +0000)]
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.
Summary:
If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
&V2)))), bitcast)`, but the load is used in other instructions, it leads
to looping in InstCombiner. Patch adds additional check that all users
of the load instructions are stores and then replaces all uses of load
instruction by the new one with new type.
Reviewers: RKSimon, spatel, majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41072
llvm-svn: 320407
Alexander Kornienko [Mon, 11 Dec 2017 19:02:26 +0000 (19:02 +0000)]
[clang-tidy] Correctly classify constant arrays and constant strings as constants when checking identifiers naming
Summary:
They are not locally const qualified so they weren't classified as
constants by the readability-identifier-naming check.
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: klimek, cfe-commits, xazax.hun
Patch by Beren Minor!
Differential Revision: https://reviews.llvm.org/D39363
llvm-svn: 320406
Hans Wennborg [Mon, 11 Dec 2017 18:58:18 +0000 (18:58 +0000)]
Fix warn-enum-compare.cpp on Windows
It's been failing since r319875.
llvm-svn: 320405
Krzysztof Parzyszek [Mon, 11 Dec 2017 18:57:54 +0000 (18:57 +0000)]
[Hexagon] Add support for Hexagon V65
llvm-svn: 320404
Simon Pilgrim [Mon, 11 Dec 2017 18:39:42 +0000 (18:39 +0000)]
[X86] Add LODS schedule tests
llvm-svn: 320403
Simon Pilgrim [Mon, 11 Dec 2017 18:32:59 +0000 (18:32 +0000)]
[X86] Add CMP/TEST schedule tests
llvm-svn: 320402
Zhihao Yuan [Mon, 11 Dec 2017 18:29:54 +0000 (18:29 +0000)]
P0620 follow-up: deducing `auto` from braced-init-list in new expr
Summary:
This is a side-effect brought in by p0620r0, which allows other placeholder types (derived from `auto` and `decltype(auto)`) to be usable in a `new` expression with a single-clause //braced-init-list// as its initializer (8.3.4 [expr.new]/2). N3922 defined its semantics.
References:
http://wg21.link/p0620r0
http://wg21.link/n3922
Reviewers: rsmith, aaron.ballman
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39451
llvm-svn: 320401
Simon Pilgrim [Mon, 11 Dec 2017 18:23:24 +0000 (18:23 +0000)]
[X86] Add AND/OR/XOR schedule tests
llvm-svn: 320400
Jonas Devlieghere [Mon, 11 Dec 2017 18:22:47 +0000 (18:22 +0000)]
[dwarfdump] Fix off-by-one bug in accelerator table extractor.
This fixes a bug where the verifier was complaining about empty
accelerator tables. When the table is empty, its size is not a valid
offset as it points after the end of the section.
This patch also makes the extractor return llvm:Error instead of bool
for better error reporting in the verifier.
Differential revision: https://reviews.llvm.org/D41063
rdar://
35932007
llvm-svn: 320399
Erich Keane [Mon, 11 Dec 2017 18:14:51 +0000 (18:14 +0000)]
Revert 320391: Certain targets are failing, pulling back to diagnose.
llvm-svn: 320398
Simon Pilgrim [Mon, 11 Dec 2017 18:13:40 +0000 (18:13 +0000)]
[X86] Add ADD/SUB schedule tests
llvm-svn: 320397
Malcolm Parsons [Mon, 11 Dec 2017 18:00:36 +0000 (18:00 +0000)]
[Sema] Fix crash in unused-lambda-capture warning for VLAs
Summary:
Clang was crashing when diagnosing an unused-lambda-capture for a VLA because
From.getVariable() is null for the capture of a VLA bound.
Warning about the VLA bound capture is not helpful, so only warn for the VLA
itself.
Fixes: PR35555
Reviewers: aaron.ballman, dim, rsmith
Reviewed By: aaron.ballman, dim
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D41016
llvm-svn: 320396
Simon Pilgrim [Mon, 11 Dec 2017 17:59:05 +0000 (17:59 +0000)]
[X86] Add ADC/SBB schedule tests
llvm-svn: 320395
Rui Ueyama [Mon, 11 Dec 2017 17:52:43 +0000 (17:52 +0000)]
Sort.
llvm-svn: 320394
Rui Ueyama [Mon, 11 Dec 2017 17:52:28 +0000 (17:52 +0000)]
Change function type more LLVM-ish.
Also fix variable naming style.
llvm-svn: 320393
Simon Pilgrim [Mon, 11 Dec 2017 17:37:08 +0000 (17:37 +0000)]
[X86] Add MOVSLQ schedule tests
llvm-svn: 320392
Erich Keane [Mon, 11 Dec 2017 17:36:42 +0000 (17:36 +0000)]
For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is available
As reported in llvm bugzilla 32377.
Here’s a patch to add preinclude of stdc-predef.h.
The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html;
The preinclude is inhibited with –ffreestanding.
Basically I fixed the failing test cases by adding –ffreestanding which inhibits this behavior.
I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here
Note: this is a recommit after a test failure took down the original (r318669)
Patch By: mibintc
Differential Revision: https://reviews.llvm.org/D34158
llvm-svn: 320391
Rafael Espindola [Mon, 11 Dec 2017 17:23:28 +0000 (17:23 +0000)]
Create reserved symbols early so they can be versioned.
This fixes pr35570.
We were creating these symbols after parsing version scripts, so they
could not be versioned.
We cannot move the version script parsing later because we need it for
lto.
One option is to move both addReservedSymbols and
createSyntheticSections earlier. The disadvantage is that some
sections created by createSyntheticSections replace other input
sections. For example, gdb index replaces .debug_gnu_pubnames, so it
wants to run after gc sections so that it can set S->Live to false.
What this patch does instead is to move just the ElfHeader creation
early.
llvm-svn: 320390
Simon Pilgrim [Mon, 11 Dec 2017 17:01:21 +0000 (17:01 +0000)]
Normalize line endings. NFCI.
llvm-svn: 320389
Amara Emerson [Mon, 11 Dec 2017 16:58:29 +0000 (16:58 +0000)]
[GlobalISel] Disable GISel for big endian.
This is due to PR26161 needing to be resolved before we can fix
big endian bugs like PR35359. The work to split aggregates into smaller LLTs
instead of using one large scalar will take some time, so in the mean time
we'll fall back to SDAG.
Some ARM BE tests xfailed for now as a result.
Differential Revision: https://reviews.llvm.org/D40789
llvm-svn: 320388
Simon Pilgrim [Mon, 11 Dec 2017 16:47:21 +0000 (16:47 +0000)]
[X86] Add LWP schedule tests
Tag LWP instructions as WriteSystem
llvm-svn: 320387
Simon Pilgrim [Mon, 11 Dec 2017 16:32:58 +0000 (16:32 +0000)]
[X86] Add INT/INTO schedule tests
llvm-svn: 320386
Simon Pilgrim [Mon, 11 Dec 2017 16:16:40 +0000 (16:16 +0000)]
[X86] Add IN/OUT schedule tests
llvm-svn: 320385
Simon Pilgrim [Mon, 11 Dec 2017 16:08:21 +0000 (16:08 +0000)]
[X86] Add IDIV schedule tests
llvm-svn: 320384
Simon Pilgrim [Mon, 11 Dec 2017 16:04:08 +0000 (16:04 +0000)]
[X86] Add CMPXCHG schedule tests
llvm-svn: 320383
Simon Pilgrim [Mon, 11 Dec 2017 15:53:12 +0000 (15:53 +0000)]
[X86] Add CLZERO schedule test
llvm-svn: 320382
Alexander Potapenko [Mon, 11 Dec 2017 15:48:56 +0000 (15:48 +0000)]
[MSan] Hotfix compilation
For some reason the override directives got removed in r320373.
I suspect this to be an unwanted effect of clang-format.
llvm-svn: 320381
Simon Pilgrim [Mon, 11 Dec 2017 15:41:52 +0000 (15:41 +0000)]
[X86] Add ADCX/ADOX/XADD/XLAT schedule tests
llvm-svn: 320380
Nirav Dave [Mon, 11 Dec 2017 15:35:40 +0000 (15:35 +0000)]
[X86] Modify Nontemporal tests to avoid deadstore optimization.
llvm-svn: 320379
Tony Tye [Mon, 11 Dec 2017 15:35:27 +0000 (15:35 +0000)]
[AMDGPU] Rename Bonaire target to be gfx704; update target feature handling
- Rename Bonaire target to be gfx704.
- Eliminate gfx800 and make Iceland and Tonga both use gfx802 as they use the same code.
- List target features supported by each processor in the processor table together with the default value.
- Add xnack flag to e_flags.
- Remove xnack from kernel metadata and kernel descriptor since it is now a whole code object property.
Differential Revision: https://reviews.llvm.org/D40051
llvm-svn: 320378
Pavel Labath [Mon, 11 Dec 2017 15:28:21 +0000 (15:28 +0000)]
dotest.py: Correctly annotate lldbinline tests with debug info categories
This enables one to run all dwo tests with dotest.py --category dwo, or
skip them with --skip-category.
llvm-svn: 320377
Simon Pilgrim [Mon, 11 Dec 2017 15:25:31 +0000 (15:25 +0000)]
[X86] Add SETCC/STC/STD/UD2 schedule tests
llvm-svn: 320376
Dmitry Preobrazhensky [Mon, 11 Dec 2017 15:23:20 +0000 (15:23 +0000)]
[AMDGPU][MC][GFX9] Corrected encoding of ttmp registers, disabled tba/tma
See bugs 35494 and 35559:
https://bugs.llvm.org/show_bug.cgi?id=35494
https://bugs.llvm.org/show_bug.cgi?id=35559
Reviewers: vpykhtin, artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D41007
llvm-svn: 320375
Sanjay Patel [Mon, 11 Dec 2017 15:19:31 +0000 (15:19 +0000)]
[DAGCombiner] protect against an infinite loop between shl <--> mul (PR35579)
At first, I tried to thread the x86 needle and use a target hook (isVectorShiftByScalarCheap())
to disable the transform only for non-splat pow-of-2 constants, but not AVX2, but only some
element types, but...it's difficult.
Here we just avoid the loop with the x86 vector transform that conflicts with the general DAG
combine and preserve all of the existing behavior AFAICT otherwise.
Some tests that will probably fail if someone does try to restrict this in a more targeted way
for x86-only may be found in:
test/CodeGen/X86/combine-mul.ll
test/CodeGen/X86/vector-mul.ll
test/CodeGen/X86/widen_arith-5.ll
This should prevent the infinite looping seen with:
https://bugs.llvm.org/show_bug.cgi?id=35579
Differential Revision: https://reviews.llvm.org/D41040
llvm-svn: 320374
Alexander Potapenko [Mon, 11 Dec 2017 15:05:22 +0000 (15:05 +0000)]
[MSan] introduce getShadowOriginPtr(). NFC.
This patch introduces getShadowOriginPtr(), a method that obtains both the shadow and origin pointers for an address as a Value pair.
The existing callers of getShadowPtr() and getOriginPtr() are updated to use getShadowOriginPtr().
The rationale for this change is to simplify KMSAN instrumentation implementation.
In KMSAN origins tracking is always enabled, and there's no direct mapping between the app memory and the shadow/origin pages.
Both the shadow and the origin pointer for a given address are obtained by calling a single runtime hook from the instrumentation,
therefore it's easier to work with those pointers together.
Reviewed at https://reviews.llvm.org/D40835.
llvm-svn: 320373
Peter Smith [Mon, 11 Dec 2017 15:00:58 +0000 (15:00 +0000)]
[ELF] Improve comments in aarch64 errata fix test [NFC]
Comment improvements split out from review D36749. No changes to any non
comment line.
llvm-svn: 320372
Simon Pilgrim [Mon, 11 Dec 2017 14:56:44 +0000 (14:56 +0000)]
[X86] Add SAR/SHL/SHR schedule tests
llvm-svn: 320371
Simon Pilgrim [Mon, 11 Dec 2017 14:46:42 +0000 (14:46 +0000)]
[X86] Add RCL/RCR schedule tests
llvm-svn: 320370
Krzysztof Parzyszek [Mon, 11 Dec 2017 14:46:06 +0000 (14:46 +0000)]
[Hexagon] Crash in instruction selection for insert_vector_elt for HVX
A wrong type was passed to insertVector, causing an out-of-bounds value
to be added an an operand to HexagonISD::INSERT. This later failed in
instruction selection.
llvm-svn: 320369
Nemanja Ivanovic [Mon, 11 Dec 2017 14:35:48 +0000 (14:35 +0000)]
[PowerPC] Sign-extend negative constant stores
Second part of https://reviews.llvm.org/D40348.
Revision r318436 has extended all constants feeding a store to 64 bits
to allow for CSE on the SDAG. However, negative constants were zero extended
which made the constant being loaded appear to be a positive value larger than
16 bits. This resulted in long sequences to materialize such constants
rather than simply a "load immediate". This patch just sign-extends those
updated constants so that they remain 16-bit signed immediates if they started
out that way.
llvm-svn: 320368
Pavel Labath [Mon, 11 Dec 2017 14:22:30 +0000 (14:22 +0000)]
Add a StringList constructor to Args class
Host::GetEnvironment returns a StringList, but the interface for
launching a process takes Args. The fact that we use two classes for
representing an environment is not ideal, but for now we should at least
have an easy way to convert between the two.
llvm-svn: 320366
Nemanja Ivanovic [Mon, 11 Dec 2017 14:16:02 +0000 (14:16 +0000)]
[DAGCombiner] Add combined indexed load to the work list
This commit is the first part of https://reviews.llvm.org/D40348.
In order to allow target combines to be performed on newly combined
indexed loads, add them back to the worklist. The remainder of the
above patch will be committed in subsequent revisions and will use
this. Test cases will be included with those follow-up commits.
llvm-svn: 320365
Roger Ferrer Ibanez [Mon, 11 Dec 2017 13:54:58 +0000 (13:54 +0000)]
[libcxx] Define istream_iterator equality comparison operators out-of-line
Currently libc++ defines operator== and operator!= as friend functions in the
definition of the istream_iterator class template. Such definition has a subtle
difference from an out-of-line definition required by the C++ Standard: these
functions can only be found by argument-dependent lookup, but not by qualified
lookup.
This patch changes the definition, so that it conforms to the C++ Standard and
adds a check involving qualified lookup to the test suite.
Patch contributed by Mikhail Maltsev.
Differential Revision: https://reviews.llvm.org/D40415
llvm-svn: 320363
Diana Picus [Mon, 11 Dec 2017 13:28:45 +0000 (13:28 +0000)]
[ARM GlobalISel] Add test for a MOVTi16 pattern. NFC
Add test for matching an OR with 0xFFFF0000 to a MOVTi16.
llvm-svn: 320362
Simon Pilgrim [Mon, 11 Dec 2017 13:25:02 +0000 (13:25 +0000)]
[X86] Add fsgsbase schedule tests.
llvm-svn: 320361
Michael Kruse [Mon, 11 Dec 2017 12:51:24 +0000 (12:51 +0000)]
[ScopBuilder] Split statements on encountering store instructions.
Introduce -polly-stmt-granularity=store option.
Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in>
Differential Revision: https://reviews.llvm.org/D37337
llvm-svn: 320360
Alex Bradbury [Mon, 11 Dec 2017 12:49:02 +0000 (12:49 +0000)]
[RISCV] Add custom CC_RISCV calling convention and improved call support
The TableGen-based calling convention definitions are inflexible, while
writing a function to implement the calling convention is very
straight-forward, and allows difficult cases to be handled more easily. With
this patch adds support for:
* Passing large scalars according to the RV32I calling convention
* Byval arguments
* Passing values on the stack when the argument registers are exhausted
The custom CC_RISCV calling convention is also used for returns.
This patch also documents the ABI lowering that a language frontend is
expected to perform. I would like to work to simplify these requirements over
time, but this will require further discussion within the LLVM community.
We add PendingArgFlags CCState, as a companion to PendingLocs.
The PendingLocs vector is used by a number of backends to handle arguments
that are split during legalisation. However CCValAssign doesn't keep track of
the original argument alignment. Therefore, add a PendingArgFlags vector which
can be used to keep track of the ISD::ArgFlagsTy for every value added to
PendingLocs.
Differential Revision: https://reviews.llvm.org/D39898
llvm-svn: 320359
Alex Bradbury [Mon, 11 Dec 2017 12:38:17 +0000 (12:38 +0000)]
[RISCV] Allow lowering of dynamic_stackalloc, stacksave, stackrestore
llvm-svn: 320358
Alex Bradbury [Mon, 11 Dec 2017 12:34:11 +0000 (12:34 +0000)]
[RISCV] Implement prolog and epilog insertion
As frame pointer elimination isn't implemented until a later patch and we make
extensive use of update_llc_test_checks.py, this changes touches a lot of the
RISC-V tests.
Differential Revision: https://reviews.llvm.org/D39849
llvm-svn: 320357
Simon Pilgrim [Mon, 11 Dec 2017 12:22:15 +0000 (12:22 +0000)]
[X86] Regenerate fsgsbase intrinsic tests. NFCI.
llvm-svn: 320356
Roger Ferrer Ibanez [Mon, 11 Dec 2017 12:13:45 +0000 (12:13 +0000)]
[ARM] Use ADDCARRY / SUBCARRY
This is a preparatory step for D34515.
This change:
- makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
- lowering is done by first converting the boolean value into the carry flag
using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
operations does the actual addition.
- for subtraction, given that ISD::SUBCARRY second result is actually a
borrow, we need to invert the value of the second operand and result before
and after using ARMISD::SUBE. We need to invert the carry result of
ARMISD::SUBE to preserve the semantics.
- given that the generic combiner may lower ISD::ADDCARRY and
ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
as well otherwise i64 operations now would require branches. This implies
updating the corresponding test for unsigned.
- add new combiner to remove the redundant conversions from/to carry flags
to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
- fixes PR34045
- fixes PR34564
- fixes PR35103
Differential Revision: https://reviews.llvm.org/D35192
llvm-svn: 320355
Aleksandar Beserminji [Mon, 11 Dec 2017 12:12:16 +0000 (12:12 +0000)]
[mips] Minor update to the comment (NFC)
llvm-svn: 320354
Alex Bradbury [Mon, 11 Dec 2017 11:53:54 +0000 (11:53 +0000)]
[RISCV] Support lowering FrameIndex
Introduces the AddrFI "addressing mode", which is necessary simply because
it's not possible to write a pattern that directly matches a frameindex.
Ensure callee-saved registers are accessed relative to the stackpointer. This
is necessary as callee-saved register spills are performed before the frame
pointer is set.
Move HexagonDAGToDAGISel::isOrEquivalentToAdd to SelectionDAGISel, so we can
make use of it in the RISC-V backend.
Differential Revision: https://reviews.llvm.org/D39848
llvm-svn: 320353
Diana Picus [Mon, 11 Dec 2017 11:44:23 +0000 (11:44 +0000)]
[ARM GlobalISel] Add tests for PKHBT and PKHTB
Test (some of) the patterns for selecting PKHBT and PKHTB. The others
are just very similar to the ones we're testing and there would be
little value in covering them as well.
llvm-svn: 320352
Aleksandar Beserminji [Mon, 11 Dec 2017 11:29:17 +0000 (11:29 +0000)]
[mips] Removal of microMIPS64R6
microMIPS64R6 is removed from backend, and therefore frontend
will show an error when target is microMIPS64R6.
This is Clang part of patch.
Differential Revision: https://reviews.llvm.org/D35624
llvm-svn: 320351
Aleksandar Beserminji [Mon, 11 Dec 2017 11:21:40 +0000 (11:21 +0000)]
[mips] Removal of microMIPS64R6
All files and parts of files related to microMIPS4R6 are removed.
When target is microMIPS4R6, errors are printed.
This is LLVM part of patch.
Differential Revision: https://reviews.llvm.org/D35625
llvm-svn: 320350