OSDN Git Service
Kostya Serebryany [Thu, 20 Jul 2017 00:37:08 +0000 (00:37 +0000)]
[libFuzzer] add DeepRecursionTest, inspired by https://guidovranken.wordpress.com/2017/07/08/libfuzzer-gv-new-techniques-for-dramatically-faster-fuzzing/ (Stack-depth-guided fuzzing). libFuzzer does not solve it yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308571
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Thu, 20 Jul 2017 00:13:32 +0000 (00:13 +0000)]
Revert "[LLVM][llvm-objcopy] Added basic plumbing to get things started"
This reverts commit
98f9792e7ca5bbd9eb43bda72bf497957cfb6eb8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308569
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 20 Jul 2017 00:11:39 +0000 (00:11 +0000)]
Try to deflake fuzzer-oom.test on Windows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308568
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Thu, 20 Jul 2017 00:08:02 +0000 (00:08 +0000)]
Revert "[PEI] Separate saving and restoring CSRs into different functions. NFC"
This reverts commit
a84d1fa6847e70ebf63594d41a00b473c941bd72.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308562
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 19 Jul 2017 23:52:54 +0000 (23:52 +0000)]
[libFuzzer] simplify two more tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308560
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 19 Jul 2017 23:51:13 +0000 (23:51 +0000)]
[LLVM][llvm-objcopy] Added basic plumbing to get things started
As discussed on llvm-dev I've implemented the first basic steps towards
llvm-objcopy/llvm-objtool (name pending).
This change adds the ability to copy (without modification) 64-bit
little endian ELF executables that have SHT_PROGBITS, SHT_NOBITS,
SHT_NULL and SHT_STRTAB sections.
Patch by Jake Ehrlich
Differential Revision: https://reviews.llvm.org/D33964
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308559
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 19 Jul 2017 23:47:33 +0000 (23:47 +0000)]
[AsmPrinter] Constify needsCFIMoves. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308557
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 19 Jul 2017 23:47:32 +0000 (23:47 +0000)]
[PEI] Add basic opt-remarks support
Add optimization remarks support to the PrologueEpilogueInserter. For
now, emit the stack size as an analysis remark, but more additions wrt
shrink-wrapping may be added.
https://reviews.llvm.org/D35645
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308556
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 19 Jul 2017 23:47:32 +0000 (23:47 +0000)]
[PEI] Simplify handling of targets with no phys regs. NFC
Make doSpillCalleeSavedRegs a member function, instead of passing most
of the members of PEI as arguments.
Differential Revision: https://reviews.llvm.org/D35642
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308555
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 19 Jul 2017 23:47:31 +0000 (23:47 +0000)]
[PEI] Separate saving and restoring CSRs into different functions. NFC
Split insertCSRSpillsAndRestores into insertCSRSaves + insertCSRRestores.
This is mostly useful for future shrink-wrapping improvements where we
want to save / restore a specific part of the CSRs in a specific block.
Differential Revision: https://reviews.llvm.org/D35644
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308554
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 19 Jul 2017 23:45:46 +0000 (23:45 +0000)]
[libFuzzer] change several tests to not limit the max len: with reduce_inputs=1 they are now fast enough even w/o this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308553
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 19 Jul 2017 23:42:53 +0000 (23:42 +0000)]
Use llvm::make_unique once more to avoid ADL ambiguity with std::make_unique
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308552
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 19 Jul 2017 23:38:54 +0000 (23:38 +0000)]
Use llvm::make_unique to try to fix the windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308551
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 19 Jul 2017 23:34:59 +0000 (23:34 +0000)]
Remove some leftover DWARFContextInMemory.
Not sure how I missed these on the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308550
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 19 Jul 2017 23:22:06 +0000 (23:22 +0000)]
Fix fuzzer-flags.test on Windows
The optional external function callbacks have to be exported in order
for them to be called. The test was failing because libFuzzer wasn't
calling LLVMFuzzerInitialize.
We can reconsider if this is the best way to mark these optional
callbacks exported later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308548
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Wed, 19 Jul 2017 23:15:29 +0000 (23:15 +0000)]
Update module map for RuntimeLibcalls
The def file was created in r308531
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308547
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 19 Jul 2017 22:28:08 +0000 (22:28 +0000)]
[NFC] Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308545
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 19 Jul 2017 22:27:28 +0000 (22:27 +0000)]
Use delegation instead of inheritance.
This changes DwarfContext to delegate to DwarfObject instead of having
pure virtual methods.
With this DwarfContextInMemory is replaced with an implementation of
DwarfObject that is local to a .cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308543
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 19 Jul 2017 22:11:08 +0000 (22:11 +0000)]
GlobalISel: partially revert r308540.
An unfinished and untested implementation of ISel for G_UNMERGE_VALUES crept in
by mistake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308542
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 19 Jul 2017 22:10:30 +0000 (22:10 +0000)]
[libFuzzer] enable reduce_inputs=1 by default (seems to be a big win usually)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308541
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 19 Jul 2017 22:08:08 +0000 (22:08 +0000)]
GlobalISel: fix SUBREG_TO_REG implementation.
The first argument needs to be an immediate rather than a register. Should fix
some crashes in the verifier bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308540
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 19 Jul 2017 22:04:59 +0000 (22:04 +0000)]
[opt-viewer] Reduce memory consumption by another 20-25%
The Args field of the remark which consists of a list of mappings in YAML is
translated into a list of (small) dicts on Python. An empty dict is 280 bytes
on my system so we can save memory by using a tuple of tuples instead.
Making a tuple of tuples rather than a list of tuples allows Args to be shared
with the key of the remark. This is actually an even greater saving. (Keys
are alive throughout the entire run in all_remarks.)
Here are a few opt-stats runs with different input sizes while measuring heap
usage with heapy. Avg remark size is simply estimated as
heap-size / # of remarks:
| # of files | 60 | 114 | 308 | 605 | 1370 |
| # of remarks | 20K | 37K | 146K | 180K | 640K |
| total file size (MB) | 22 | 51 | 219 | 202 | 1034 |
|------------------------+------+------+------+------+------|
| Avg remark size before | 4339 | 4792 | 4761 | 4096 | 4607 |
| Avg remark size after | 3446 | 3641 | 3567 | 3146 | 3347 |
| Rate | 0.79 | 0.76 | 0.75 | 0.77 | 0.73 |
Differential Revision: https://reviews.llvm.org/D35611
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308538
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 19 Jul 2017 22:04:58 +0000 (22:04 +0000)]
[opt-viewer] Print allocated memory per remark in opt-stats.py
If heapy is installed print the "average" in-memory remark size. This is
estimated by dividing the total heap size by the number of unique remarks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308537
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 19 Jul 2017 22:04:56 +0000 (22:04 +0000)]
[opt-viewer] Reduce memory consumption
The observation is that we have a lot of similar remarks with lots of
identical strings (e.g. file paths, text from the remark). Storing a copy of
each of those strings in memory is wasteful. This makes all the strings in
the remark interned which maintains a single immutable instance that is
referenced everywhere.
I get an average 20% heap size reduction with this but it's possible that this
varies with the typical length of the file paths used. (I used heapy to
report the heap size.) Runtime is same or a tiny bit better.
| # of files | 60 | 114 | 308 | 605 | 1370 |
| # of remarks | 20K | 37K | 146K | 180K | 640K |
| total file size (MB) | 22 | 51 | 219 | 202 | 1034 |
|-----------------------+------+------+------+------+------|
| Heap size before (MB) | 106 | 226 | 894 | 934 | 3573 |
| Heap size after | 86 | 179 | 694 | 739 | 2798 |
| Rate | 0.81 | 0.79 | 0.78 | 0.79 | 0.78 |
|-----------------------+------+------+------+------+------|
| Average remark size | 4.30 | 4.84 | 4.75 | 4.11 | 4.37 |
| Mem2disk ratio | 3.91 | 3.51 | 3.17 | 3.66 | 2.71 |
Differential Revision: https://reviews.llvm.org/D35534
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308536
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Wed, 19 Jul 2017 21:53:30 +0000 (21:53 +0000)]
Move Runtime libcall definitions to a .def file
This will allow eliminating the duplication of the names, and allow adding
extra information such as signatures in a future commit.
Differential Revision: https://reviews.llvm.org/D35522
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308531
91177308-0d34-0410-b5e6-
96231b3b80d8
Wolfgang Pieb [Wed, 19 Jul 2017 21:45:21 +0000 (21:45 +0000)]
Forgot to add triple to test in r308513.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308527
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 19 Jul 2017 21:39:51 +0000 (21:39 +0000)]
[TRE] Add another test for OptRemark.
This shows we emit a remark for tail recursion -> loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308525
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 19 Jul 2017 21:13:22 +0000 (21:13 +0000)]
[TRE] Move to the new OptRemark API.
Fixes PR33788.
Differential Revision: https://reviews.llvm.org/D35570
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308524
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 19 Jul 2017 20:38:46 +0000 (20:38 +0000)]
[yaml2obj][ELF] Add support for program headers
This change adds basic support for program headers.
I need to do some testing which requires generating program headers but
I can't use ld.lld or clang to produce programs that have headers. I'd
also like to test some strange things that those programs may never
produce.
Patch by Jake Ehrlich
Differential Revision: https://reviews.llvm.org/D35276
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308520
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Wed, 19 Jul 2017 20:14:32 +0000 (20:14 +0000)]
[AArch64] Force relocations for all ADRP instructions
This generalizes an existing fix from ELF to MachO and COFF.
Test that an ADRP to a local symbol whose offset is known at assembly
time still produces relocations, both for MachO and COFF. Test that
an ADRP without a @page modifier on MachO fails (previously it
didn't).
Differential Revision: https://reviews.llvm.org/D35544
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308518
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Wed, 19 Jul 2017 20:14:24 +0000 (20:14 +0000)]
[AArch64, COFF] Interpret .align as power of two for COFF as well
Differential Revision: https://reviews.llvm.org/D35545
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308517
91177308-0d34-0410-b5e6-
96231b3b80d8
Wolfgang Pieb [Wed, 19 Jul 2017 19:36:40 +0000 (19:36 +0000)]
Fixing an issue with the initialization of LexicalScopes objects when mixing debug
and non-debug units.
Patch by Andrea DiBiagio.
Differential Revision: https://reviews.llvm.org/D35637
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308513
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 19 Jul 2017 19:17:32 +0000 (19:17 +0000)]
[Hexagon] Fix a bug in r308502: post-inc offset is always 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308510
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Wed, 19 Jul 2017 18:37:02 +0000 (18:37 +0000)]
[cmake] GetSVN.cmake takes a list of arguments
Summary:
GetSVN.cmake currently takes one or two pairs of <source directory path,
name>, then attempts to get the remote repository URL and source control
revision of the repositories at those one or two paths.
It takes two pairs in order for Clang to get the revision of both
itself, and its dependency LLVM.
For projects that rely upon both LLVM and Clang (Apple's Swift is one
example, but there are others), GetSVN.cmake is used to fetch *three*
revisions: Swift, Clang, and LLVM.
To support this use case, change GetSVN.cmake: instead of taking one or
two pairs (specified via `FIRST_SOURCE_DIR`/`FIRST_NAME`, have it take a list
of pairs (`SOURCE_DIRS`/`NAMES`).
In order to allow Clang to migrate, have GetSVN.cmake support both sets
of arguments for now. The old arguments can be removed once Clang begins
using the new arguments, and Swift can follow when it updates its
copy of LLVM.
Test Plan:
1. Perform a clean build of Clang, verify that `clang --version` still
prints the correct LLVM and Clang revision information.
2. Modify Clang's CMake to use the new arguments, then perform another
clean build. `clang --version` should still print the correct
revision information.
Reviewers: jordan_rose, beanz, probinson
Subscribers: echristo, chapuni, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D35132
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308507
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 19 Jul 2017 18:18:19 +0000 (18:18 +0000)]
LTO: Export functions referenced by the CFI jump table.
If the LowerTypeTests pass decides to add a function to a jump
table for CFI, it will add its name to the set cfiFunctionDefs,
which among other things will cause the function to be renamed in
the ThinLTO backend.
One other thing that we must do with such functions is to not
internalize them, because the jump table in the full LTO object will
contain a reference to the actual function body in the ThinLTO object.
This patch handles that by ensuring that we export any functions
whose names appear in the cfiFunctionDefs set.
Fixes PR33831.
Differential Revision: https://reviews.llvm.org/D35605
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308504
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 19 Jul 2017 18:09:46 +0000 (18:09 +0000)]
[X86] Don't try to scale down if that exceeds the bitwidth.
Fixes the crash reported in PR33844.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308503
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 19 Jul 2017 18:03:46 +0000 (18:03 +0000)]
[Hexagon] Handle subregisters in areMemAccessesTriviallyDisjoint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308502
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 19 Jul 2017 17:54:29 +0000 (17:54 +0000)]
ThinLTOBitcodeWriter: Do not rewrite intrinsic functions when splitting modules.
Changing the type of an intrinsic may invalidate the IR.
Differential Revision: https://reviews.llvm.org/D35593
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308500
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 19 Jul 2017 16:47:07 +0000 (16:47 +0000)]
GlobalISel: select G_EXTRACT and G_INSERT instructions on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308493
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Wed, 19 Jul 2017 16:07:51 +0000 (16:07 +0000)]
[Solaris] enable --whole-archive for shared-library build, disable --version-script for Solaris-ld
Shared-library build on Solaris requires --whole-archive to be specified (option accepted by all available linkers).
At the same time, --version-script can not be handled by Solaris-ld, so it should be skipped.
-M is of no use here, since there is no syntax in Solaris-ld mapfiles that allows to version all global symbols,
not just the named ones (at least this is my impression from digging deep into the docs).
Patch by Fedor Sergeev <fedor.sergeev@oracle.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308490
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 19 Jul 2017 15:39:28 +0000 (15:39 +0000)]
[Hexagon] Handle subregisters and non-immediates in getBaseAndOffset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308485
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 19 Jul 2017 15:06:31 +0000 (15:06 +0000)]
Defeat another -Wunused-but-set-variable warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308484
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 19 Jul 2017 15:03:38 +0000 (15:03 +0000)]
Defeat a GCC -Wunused-result warning
It was warning like:
../llvm-project/llvm/lib/Support/ErrorHandling.cpp:172:51: warning:
ignoring return value of ‘ssize_t write(int, const void*, size_t)’,
declared with attribute warn_unused_result [-Wunused-result]
(void)::write(2, OOMMessage, strlen(OOMMessage));
Work around the warning by storing the return value in a variable and
casting that to void instead. We already did this for the other write()
call in this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308483
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel Jones [Wed, 19 Jul 2017 14:10:42 +0000 (14:10 +0000)]
[docs] Document how to debug instruction scheduling model generation
Describe:
+ Exact tablegen command and how to get it
+ tablegen command debug option for subtarget generation
+ Use of schedcover.py on the debug output to determine coverage
Differential Revision: https://reviews.llvm.org/D35058
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308476
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 19 Jul 2017 14:09:16 +0000 (14:09 +0000)]
Clear release notes for 6.0.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308474
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 19 Jul 2017 13:39:58 +0000 (13:39 +0000)]
{DAGCombine] Convert (Val & Mask) == Mask to Mask.isSubsetof(Val). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308460
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Wed, 19 Jul 2017 12:57:16 +0000 (12:57 +0000)]
[ARM] Unify handling of M-Class system registers
This patch cleans up and fixes issues in the M-Class system register handling:
1. It defines the system registers and the encoding (SYSm values) in one place:
a new ARMSystemRegister.td using SearchableTable, thereby removing the
hand-coded values which existed in multiple places.
2. Some system registers e.g. BASEPRI_MAX_NS which do not exist were being allowed!
Ref: ARMv6/7/8M architecture reference manual.
Reviewed by: @t.p.northover, @olist01, @john.brawn
Differential Revision: https://reviews.llvm.org/D35209
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308456
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 19 Jul 2017 12:19:01 +0000 (12:19 +0000)]
Update trunk version to 6.0.0svn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308442
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 19 Jul 2017 11:27:31 +0000 (11:27 +0000)]
Recommit r274270, [CMake] Module builds depend on target intrinsics_gen to be built first.
The builder clang-x86_64-linux-selfhost-modules-2 complains. Investigating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308439
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 19 Jul 2017 10:47:38 +0000 (10:47 +0000)]
Revert r274270, "[CMake] Module builds depend on target intrinsics_gen to be built first."
I think modulemap is sufficient for intrinsics_gen in trunk. I won't find any issues around that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308434
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 19 Jul 2017 10:29:31 +0000 (10:29 +0000)]
[X86][XOP] Use default AVX2 lowering for v4i64 ashr by splat constants
XOP shifts only support 128-bit vectors, so we were ending up with less optimal codegen requiring constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308430
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Wed, 19 Jul 2017 10:19:21 +0000 (10:19 +0000)]
[SystemZ] Minor fixing in SystemZScheduleZ14.td
Some minor corrections for recently added instructions.
Review: Ulrich Weigand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308429
91177308-0d34-0410-b5e6-
96231b3b80d8
Dinar Temirbulatov [Wed, 19 Jul 2017 10:02:07 +0000 (10:02 +0000)]
[LoopUtils] Add an extra parameter OpValue to propagateIRFlags function,
If OpValue is non-null, we only consider operations similar to OpValue
when intersecting.
Differential Revision: https://reviews.llvm.org/D35292
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308428
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 19 Jul 2017 09:28:20 +0000 (09:28 +0000)]
[globalisel][tablegen] 80-col corrections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308424
91177308-0d34-0410-b5e6-
96231b3b80d8
Balaram Makam [Wed, 19 Jul 2017 08:53:34 +0000 (08:53 +0000)]
[SimplifyCFG] Defer folding unconditional branches to LateSimplifyCFG if it can destroy canonical loop structure.
Summary:
When simplifying unconditional branches from empty blocks, we pre-test if the
BB belongs to a set of loop headers and keep the block to prevent passes from
destroying canonical loop structure. However, the current algorithm fails if
the destination of the branch is a loop header. Especially when such a loop's
latch block is folded into loop header it results in additional backedges and
LoopSimplify turns it into a nested loop which prevent later optimizations
from being applied (e.g., loop unrolling and loop interleaving).
This patch augments the existing algorithm by further checking if the
destination of the branch belongs to a set of loop headers and defer
eliminating it if yes to LateSimplifyCFG.
Fixes PR33605: https://bugs.llvm.org/show_bug.cgi?id=33605
Reviewers: efriedma, mcrosier, pacxx, hsung, davidxl
Reviewed By: efriedma
Subscribers: ashutosh.nema, gberry, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D35411
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308422
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayal Zaks [Wed, 19 Jul 2017 05:16:39 +0000 (05:16 +0000)]
[LV] Test once if vector trip count is zero, instead of twice
Generate a single test to decide if there are enough iterations to jump to the
vectorized loop, or else go to the scalar remainder loop. This test compares the
Scalar Trip Count: if STC < VF * UF go to the scalar loop. If
requiresScalarEpilogue() holds, at-least one iteration must remain scalar; the
rest can be used to form vector iterations. So in this case the test checks
instead if (STC - 1) < VF * UF by comparing STC <= VF * UF, and going to the
scalar loop if so. Otherwise the vector loop is entered for at-least one vector
iteration.
This test covers the case where incrementing the backedge-taken count will
overflow leading to an incorrect trip count of zero. In this (rare) case we will
also avoid the vector loop and jump to the scalar loop.
This patch simplifies the existing tests and effectively removes the basic-block
originally named "min.iters.checked", leaving the single test in block
"vector.ph".
Original observation and initial patch by Evgeny Stupachenko.
Differential Revision: https://reviews.llvm.org/D34150
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308421
91177308-0d34-0410-b5e6-
96231b3b80d8
Serguei Katkov [Wed, 19 Jul 2017 04:49:17 +0000 (04:49 +0000)]
[CGP] Allow cycles during Phi traversal in OptimizaMemoryInst
Allowing cycles in Phi traversal increases the scope of optimize memory instruction
in case we are in loop.
The added test shows an example of enabling optimization inside a loop.
Reviewers: loladiro, spatel, efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35294
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308419
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 19 Jul 2017 04:15:30 +0000 (04:15 +0000)]
Revert r308273 to reinstate part of r308100.
That part was reverted because the underlying change necessitating it
(r308025) was reverted in r308271.
Nirav re-landed r308025 again in r308350, so re-landing this fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308418
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 19 Jul 2017 04:12:25 +0000 (04:12 +0000)]
[PM/LCG] Follow-up fix to r308088 to handle deletion of library
functions.
In the prior commit, we provide ordering to the LCG between functions
and library function definitions that they might begin to call through
transformations. But we still would delete these library functions from
the call graph if they became dead during inlining.
While this immediately crashed, it also exposed a loss of information.
We shouldn't remove definitions of library functions that can still
usefully participate in the LCG-powered CGSCC optimization process. If
new call edges are formed, we want to have definitions to be called.
We can still remove these functions if truly dead using global-dce, etc,
but removing them during the CGSCC walk is premature.
This fixes a crash in the new PM when optimizing some unusual libraries
that end up with "internal" lib functions such as the code in the "R"
language's libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308417
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Wed, 19 Jul 2017 04:08:42 +0000 (04:08 +0000)]
[SPARC] Add missing variable initialization after r308343.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308415
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 19 Jul 2017 02:45:14 +0000 (02:45 +0000)]
AMD znver1 Initial Scheduler model
Summary:
This patch adds the following
1. Adds a skeleton scheduler model for AMD Znver1.
2. Introduces the znver1 execution units and pipes.
3. Caters the instructions based on the generic scheduler classes.
4. Further additions to the scheduler model with instruction itineraries will be carried out incrementally based on
a. Instructions types
b. Registers used
5. Since itineraries are not added based on instructions, throughput information are bound to change when incremental changes are added.
6. Scheduler testcases are modified accordingly to suit the new model.
Patch by Ganesh Gopalasubramanian. With minor formatting tweaks from me.
Reviewers: craig.topper, RKSimon
Subscribers: javed.absar, shivaram, ddibyend, vprasad
Differential Revision: https://reviews.llvm.org/D35293
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308411
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 19 Jul 2017 02:09:37 +0000 (02:09 +0000)]
[llvm-readobj] Install llvm-readelf alias
Install an llvm-readelf symlink to llvm-readobj.
When invoked as *readelf*, default to -elf-output-style=GNU.
Patch by Roland McGrath
Differential Revision: https://reviews.llvm.org/D33869
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308408
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 19 Jul 2017 02:01:22 +0000 (02:01 +0000)]
Object: preserve more information about DEF file
Preserve the actual library name as provided by the user. This is
required to properly replicate link's behaviour about the module import
name handling. This requires an associated change to lld for updating
the tests for the proper behaviour for the import library module name
handling in various cases.
Associated tests will be part of the lld change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308406
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Wed, 19 Jul 2017 01:27:24 +0000 (01:27 +0000)]
Fix DebugLoc propagation for unreachable LoadInst
Summary: Currently, when GVN creates a load and when InstCombine creates a new store for unreachable Load, the DebugLoc info gets lost.
Reviewers: dberlin, davide, aprantl
Reviewed By: aprantl
Subscribers: davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D34639
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308404
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 19 Jul 2017 00:09:54 +0000 (00:09 +0000)]
Debug Info: Add a file: field to DIImportedEntity.
DIImportedEntity has a line number, but not a file field. To determine
the decl_line/decl_file we combine the line number from the
DIImportedEntity with the file from the DIImportedEntity's scope. This
does not work correctly when the parent scope is a DINamespace or a
DIModule, both of which do not have a source file.
This patch adds a file field to DIImportedEntity to unambiguously
identify the source location of the using/import declaration. Most
testcase updates are mechanical, the interesting one is the removal of
the FIXME in test/DebugInfo/Generic/namespace.ll.
This fixes PR33822. See https://bugs.llvm.org/show_bug.cgi?id=33822
for more context.
<rdar://problem/
33357889>
https://bugs.llvm.org/show_bug.cgi?id=33822
Differential Revision: https://reviews.llvm.org/D35583
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308398
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Tue, 18 Jul 2017 23:58:15 +0000 (23:58 +0000)]
[llvm-readobj] Accept (and ignore) --wide (-W) command-line switch
Accept and ignore --wide/-W. In GNU readelf this switch is
necessary to get the output format that's consistent between
32-bit and 64-bit targets. llvm-readobj always produces that
output format.
Patch by Roland McGrath
Differential Revision: https://reviews.llvm.org/D33873
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308396
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Tue, 18 Jul 2017 23:35:22 +0000 (23:35 +0000)]
[llvm-readobj] Accept -S as an alias for --sections
In GNU readelf, the short option for --sections is upper-case -S.
Note that GNU uses lower-case -s to mean --symbols, while LLVM
uses -s to mean --sections and -t to mean --symbols (-t has yet a
different meaning in GNU). So command-line uses with -S can now
be compatible, but uses with -s or -t are still incompatible.
Patch by Roland McGrath
Differential Revision: https://reviews.llvm.org/D33872
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308392
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Tue, 18 Jul 2017 22:51:25 +0000 (22:51 +0000)]
[AArch64] Adjust the feature set for Exynos M2
Add fusion of AES operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308388
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Tue, 18 Jul 2017 22:28:03 +0000 (22:28 +0000)]
[asan] Copy arguments passed by value into explicit allocas for ASan
Summary:
ASan determines the stack layout from alloca instructions. Since
arguments marked as "byval" do not have an explicit alloca instruction, ASan
does not produce red zones for them. This commit produces an explicit alloca
instruction and copies the byval argument into the allocated memory so that red
zones are produced.
Submitted on behalf of @morehouse (Matt Morehouse)
Reviewers: eugenis, vitalybuka
Reviewed By: eugenis
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D34789
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308387
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Tue, 18 Jul 2017 22:11:01 +0000 (22:11 +0000)]
Object: rename parameter from DLLName to ImportName
When I originally wrote this code, I neglected the fact that the import
library may be created for executables. This name is not the name of
the DLL, but rather the name for the imported module. It will be
embedded into the IAT/ILT reference. Rename it to make it more obvious.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308384
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Tue, 18 Jul 2017 22:11:00 +0000 (22:11 +0000)]
Object: handle extensions properly in def files
When given an extension as part of the `library` directive in a def
file, the extension is preserved/honoured by link/lib. Behave similarly
when parsing the def file. This requires checking if a native extension
is provided as a keyword parameter. If no extension is present, append
a standard `.dll` or `.exe` extension.
This is best tested via lld, and I will add tests there as a follow up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308383
91177308-0d34-0410-b5e6-
96231b3b80d8
Martell Malone [Tue, 18 Jul 2017 21:26:38 +0000 (21:26 +0000)]
llvm: add llvm-dlltool support to the archiver
A PE COFF spec compliant import library generator.
Intended to be used with mingw-w64.
Supports:
PE COFF spec (section 8, Import Library Format)
PE COFF spec (Aux Format 3: Weak Externals)
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D29892
This reapplies rL308329, which was reverted in rL308374
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308379
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 18 Jul 2017 21:12:03 +0000 (21:12 +0000)]
[RuntimeDyld][MachO/ARM] Don't add a redundant relocation entry.
We only need to add this entry once for it to be fixed up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308375
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Tue, 18 Jul 2017 21:07:13 +0000 (21:07 +0000)]
Revert r308329: llvm: add llvm-dlltool support to the archiver
This reverts commit r308329 because it broke buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308374
91177308-0d34-0410-b5e6-
96231b3b80d8
Martell Malone [Tue, 18 Jul 2017 20:58:21 +0000 (20:58 +0000)]
llvm: fix -Wcast gcc warn error from rL308329
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308360
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Tue, 18 Jul 2017 20:54:02 +0000 (20:54 +0000)]
[CMake] Set toolchain tools in cross-target runtimes build
This is needed for runtimes build to work on Darwin.
Differential Revision: https://reviews.llvm.org/D35343
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308359
91177308-0d34-0410-b5e6-
96231b3b80d8
Mandeep Singh Grang [Tue, 18 Jul 2017 20:41:33 +0000 (20:41 +0000)]
[COFF, ARM64] Reserve X18 register by default
Reviewers: compnerd, rnk, ruiu, mstorsjo
Reviewed By: mstorsjo
Subscribers: aemerson, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D35531
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308358
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Tue, 18 Jul 2017 20:19:52 +0000 (20:19 +0000)]
[Dominators] Improve error checking in deleteEdge
Summary: This patch improves error detection in deleteEdge. It asserts that the edge doesn't exist in the CFG and that DomTree knew about this edge before.
Reviewers: dberlin, grosser, brzycki, sanjoy
Reviewed By: dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35571
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308354
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Tue, 18 Jul 2017 20:06:24 +0000 (20:06 +0000)]
[DAG] Improve Aliasing of operations to static alloca
Re-recommiting after landing DAG extension-crash fix.
Recommiting after adding check to avoid miscomputing alias information
on addresses of the same base but different subindices.
Memory accesses offset from frame indices may alias, e.g., we
may merge write from function arguments passed on the stack when they
are contiguous. As a result, when checking aliasing, we consider the
underlying frame index's offset from the stack pointer.
Static allocs are realized as stack objects in SelectionDAG, but its
offset is not set until post-DAG causing DAGCombiner's alias check to
consider access to static allocas to frequently alias. Modify isAlias
to consider access between static allocas and access from other frame
objects to be considered aliasing.
Many test changes are included here. Most are fixes for tests which
indirectly relied on our aliasing ability and needed to be modified to
preserve their original intent.
The remaining tests have minor improvements due to relaxed
ordering. The exception is CodeGen/X86/2011-10-19-widen_vselect.ll
which has a minor degradation dispite though the pre-legalized DAG is
improved.
Reviewers: rnk, mkuper, jonpa, hfinkel, uweigand
Reviewed By: rnk
Subscribers: sdardis, nemanjai, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D33345
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308350
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Tue, 18 Jul 2017 19:49:20 +0000 (19:49 +0000)]
[DAG] Reverse node replacement in extension operation. NFCI.
Reorder replacements to be user first in preparation for multi-level
folding to premptively avoid inadvertantly deleting later nodes from
sharing found from replacement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308348
91177308-0d34-0410-b5e6-
96231b3b80d8
Brian Gesiak [Tue, 18 Jul 2017 19:25:34 +0000 (19:25 +0000)]
[opt-viewer] Handle file names that contain '#'
Summary:
When using opt-viewer.py with files with '#' in their name, such as
'foo#bar.cpp', opt-viewer.py would generate links such as
'/path/to/foo#bar.cpp.opt.yaml#L42'. In this case, the link is
interpreted by browsers as a link to the file '/path/to/foo', and to the
section within that file with ID 'bar.cpp.opt.yaml#L42'.
To work around this issue, replace '#' with '_' in file names and links
in opt-viewer.py.
Reviewers: anemet, davidxl
Reviewed By: davidxl
Subscribers: llvm-commits, fhahn
Differential Revision: https://reviews.llvm.org/D34646
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308346
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Tue, 18 Jul 2017 19:08:38 +0000 (19:08 +0000)]
[Sparc] Added software multiplication/division feature
Added a feature to the Sparc back-end that replaces the integer multiply and
divide instructions with calls to .mul/.sdiv/.udiv. This is a step towards
having full v7 support.
Patch by: Eric Kedaigle
Differential Revision: https://reviews.llvm.org/D35500
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308343
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 18 Jul 2017 18:47:36 +0000 (18:47 +0000)]
[libFuzzer] when adding a reduced input print REDUCED instead of NEW
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308336
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Tue, 18 Jul 2017 17:52:47 +0000 (17:52 +0000)]
fix typos in a document; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308331
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Tue, 18 Jul 2017 17:39:15 +0000 (17:39 +0000)]
[DAG] Avoid deleting nodes before combining them.
When replacing a node and it's operand, replacing the operand node may
cause the deletion of the original node leading to an assertion
failure. Case around these replacements to avoid this without relying
on inspecting the DELETED_NODE opcode in various extend
dagcombiner cases.
Fixes PR32515.
Reviewers: dbabokin, RKSimon, davide, chandlerc
Subscribers: chandlerc, llvm-commits
Differential Revision: https://reviews.llvm.org/D34095
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308330
91177308-0d34-0410-b5e6-
96231b3b80d8
Martell Malone [Tue, 18 Jul 2017 17:39:11 +0000 (17:39 +0000)]
llvm: add llvm-dlltool support to the archiver
A PE COFF spec compliant import library generator.
Intended to be used with mingw-w64.
Supports:
PE COFF spec (section 8, Import Library Format)
PE COFF spec (Aux Format 3: Weak Externals)
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D29892
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308329
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 18 Jul 2017 16:44:58 +0000 (16:44 +0000)]
AMDGPU: Annotate necessity of flat-scratch-init
As an approximation of the existing handling to avoid
regressions. Fixes using too many registers with calls
on subtargets with the SGPR allocation bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308326
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 18 Jul 2017 16:44:56 +0000 (16:44 +0000)]
AMDGPU: Figure out private memory regs after lowering
Introduce pseudo-registers for registers needed for stack
access, which are replaced during finalizeLowering.
Note these pseudo-registers are currently only used for the
used register location, and not for determining their
input argument register.
This is better because it avoids the need to try to predict
whether a call will be emitted from the IR, and also
detects stack objects introduced by legalization.
Test changes are from the HasStackObjects check being more
accurate since stack objects introduced during legalization
are now known.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308325
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Tue, 18 Jul 2017 16:14:22 +0000 (16:14 +0000)]
[AArch64][Falkor] Avoid HW prefetcher tag collisions (step 2)
Summary:
Avoid HW prefetcher instruction tag collisions in loops by inserting
MOVs to change the base address register of strided loads.
Reviewers: t.p.northover, mcrosier
Subscribers: aemerson, rengolin, javed.absar, kristof.beyls, hfinkel, llvm-commits
Differential Revision: https://reviews.llvm.org/D35366
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308324
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 18 Jul 2017 16:07:12 +0000 (16:07 +0000)]
[X86][AVX] Regenerate shift test to show constant broadcast comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308323
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 18 Jul 2017 15:55:30 +0000 (15:55 +0000)]
[x86, CGP] increase memcmp() expansion up to 4 load pairs
It should be a win to avoid going out to the system lib for all small memcmp() calls using scalar ops. For x86 32-bit, this means most everything up to 16 bytes. For 64-bit, that doubles because we can do 8-byte loads.
Notes:
Reduced from 4 to 2 loads for -Os behavior, which might not be optimal in all cases. It's effectively a question of how much do we trust the system implementation. Linux and macOS (and Windows I assume, but did not test) have optimized memcmp() code for x86, so it's probably not bad either way? PPC is using 8/4 for defaults on these. We do not expand at all for -Oz.
There are still potential improvements to make for the CGP expansion IR and/or lowering such as avoiding select-of-constants (D34904) and not doing zexts to the max load type before doing a compare.
We have special-case SSE/AVX codegen for (memcmp(x, y, 16/32) == 0) that will no longer be produced after this patch. I've shown the experimental justification for that change in PR33329:
https://bugs.llvm.org/show_bug.cgi?id=33329#c12
TLDR: While the vector code is a likely winner, we can't guarantee that it's a winner in all cases on all CPUs, so I'm willing to sacrifice it for the greater good of expanding all small memcmp(). If we want to resurrect that codegen, it can be done by adjusting the CGP params or poking a hole to let those fall-through the CGP expansion.
Committed on behalf of Sanjay Patel
Differential Revision: https://reviews.llvm.org/D35067
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308322
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederich Munch [Tue, 18 Jul 2017 15:50:28 +0000 (15:50 +0000)]
Make EHFrames available to sub-classes of RTDyldMemoryManager.
Summary: This information can be useful; and in the case of Win64, necessary for getting exceptions to work in the JIT.
Reviewers: lhames
Reviewed By: lhames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35102
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308321
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 18 Jul 2017 15:42:59 +0000 (15:42 +0000)]
[TRE] Simplify canTRE() a bit using all_of(). NFCI.
This has a ~11 years old FIXME, which may not be true today.
We might consider removing this code altogether.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308319
91177308-0d34-0410-b5e6-
96231b3b80d8
Sumanth Gundapaneni [Tue, 18 Jul 2017 15:31:37 +0000 (15:31 +0000)]
[Hexagon] Emit lookup tables in text section based on a flag
The flag "-hexagon-emit-lut-text" (defaulted to false) is added to decide
on where to keep the switch generated lookup table.
Differential Revision: https://reviews.llvm.org/D34818
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308316
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Tue, 18 Jul 2017 14:54:41 +0000 (14:54 +0000)]
AMDGPU: Fix crash when folding immediates into multiple uses
Summary:
When an immediate is folded by constant folding, we re-scan the entire
use list for two reasons:
1. The constant folding may have created a new use of the same reg.
2. The constant folding may have removed an additional use in the list
we're currently traversing (e.g., constant folding an S_ADD_I32 c, c).
However, this could previously lead to a crash when an unrelated use was
added twice into the FoldList. Since we re-scan the whole list anyway, we
might as well just clear the FoldList again before we do so.
Using a MIR test to show this because real code seems to trigger the issue
only in connection with some really subtle control flow structures.
Fixes GL45-CTS.shading_language_420pack.binding_images on gfx9.
Reviewers: arsenm
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D35416
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308314
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Tue, 18 Jul 2017 14:39:09 +0000 (14:39 +0000)]
[DAG] Allow base element type of store merge type to also be a vector.
Correctly calculate merged vector size if MemVT is already a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308312
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 18 Jul 2017 14:26:07 +0000 (14:26 +0000)]
[X86] Add optsize and minsize memcmp tests (D35067)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308311
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Kolton [Tue, 18 Jul 2017 14:23:26 +0000 (14:23 +0000)]
[AMDGPU] resubmit r308179: CodeGen: check dst operand type to determine if omod is supported for VOP3 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308310
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 18 Jul 2017 14:19:34 +0000 (14:19 +0000)]
[X86] Added cmov target to memcmp test
As discussed by @spatel on D35067:
"I added the cmov attribute to the 32-bit codegen test because it removes some noise for that file. I think the intent for the SSE vs no-SSE runs is to show the potential difference for the 16 and 32 byte cases rather than the lack of cmov (which has been available for all CPUs since SSE1, so that's why it shows up automatically with -mattr=sse2)."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308309
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Tue, 18 Jul 2017 14:10:07 +0000 (14:10 +0000)]
[globalisel][tablegen] Enable the import of rules involving fma.
Summary:
G_FMA was recently added to GlobalISel which enables the import of rules
involving fma. Add the mapping to allow it.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Reviewed By: rovka
Subscribers: kristof.beyls, javed.absar, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D35130
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308308
91177308-0d34-0410-b5e6-
96231b3b80d8