Commit Graph

150299 Commits

Author SHA1 Message Date
Peter Collingbourne
9283a09c18 IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.
The new metadata is easier to manipulate than module flags.

Differential Revision: https://reviews.llvm.org/D31349

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:10:48 +00:00
David Blaikie
fd2310ef5b Remove unneeded conditionals - the code is already conditional on the same condition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:09:53 +00:00
Tim Hammerquist
ce1a1091e2 Add EOL at EOF to appease source utils like unifdef
<rdar://problem/32511256>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:08:55 +00:00
Reid Kleckner
0e34c3597c [llvm-ar] Make llvm-lib behave more like the MSVC archiver
Summary:
Use the filepath used to open the archive member as the archive member
name instead of the file basename. This path might be absolute or
relative.  This is important because the archive member name will show
up in the PDB, and we want our PDBs to look as much like MSVC's as
possible.

This also helps avoid an issue in our PDB module descriptor writing
code, which assumes that all module names are unique. Relative paths
still aren't guaranteed to be unique, but they're much better than
basenames, which definitely aren't unique.

Reviewers: ruiu, zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33575

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 19:45:35 +00:00
Galina Kistanova
b31b7dcdb5 Addressed Takumi's comment about redundancy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 19:17:55 +00:00
Spyridoula Gravani
ef10827246 [DWARF] Added a blank line in llvm-dwarfdump to test commit access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305220 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 19:04:28 +00:00
Sylvestre Ledru
b12244c42f Same expressions on both sides of the return
Summary:
I guess we want PointerToMemberFunction & PointerToDataMember


Fix coverity cid 1376038 


Reviewers: zturner

Reviewed By: zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34110

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305219 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 18:53:46 +00:00
Tony Jiang
759cec2ab3 [PowerPC] Match vec_revb builtins to P9 instructions.
Power9 has instructions that will reverse the bytes within an element for all
sizes (half-word, word, double-word and quad-word). These can be used for the
vec_revb builtins in altivec.h. However, we implement these to match vector
shuffle nodes as that will cover both the builtins and vector shuffles that
occur in the SDAG through other means.

Differential Revision: https://reviews.llvm.org/D33690

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 18:24:36 +00:00
Tony Jiang
e3ae196e24 [Power9] Added support for the modsw, moduw, modsd, modud hardware instructions.
Note that if we need the result of both the divide and the modulo then we
compute the modulo based on the result of the divide and not using the new
hardware instruction.

Commit on behalf of STEFAN PINTILIE.
Differential Revision: https://reviews.llvm.org/D33940

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305210 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:58:42 +00:00
Reid Kleckner
20e04578a8 [llvm-ar] Fix AddNewMember typo in enum
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:44:42 +00:00
Sanjay Patel
59e73620b8 [utils] remove ability to generate llc check lines from update_test_checks.py
The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing just causes confusion. Now, this script will only work with 
opt to produce check lines for IR transforms.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305208 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:44:30 +00:00
Sanjay Patel
3a1a366906 [x86] regenerate checks with update_llc_test_checks.py
The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing is just causing confusion.

We can rip out the llc ability in update_test_checks.py next and rename it, so it will
be clear that we have one script for llc check auto-generation and another for opt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:31:36 +00:00
Matt Arsenault
9cae1d2455 AMDGPU: Don't add same implicit use multiple times
For the last component, the same register use
was added as an implicit use and another implicit kill use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:19:20 +00:00
Geoff Berry
57098b0fe9 [SelectionDAG] Allow sin/cos -> sincos optimization on GNU triples w/ just -fno-math-errno
Summary:
This change enables the sin(x) cos(x) -> sincos(x) optimization on GNU
target triples.  This optimization was being inhibited when -ffast-math
wasn't set because sincos in GLibC does not set errno, while sin and cos
do.  However, this optimization will only run if the attributes on the
sin/cos calls include readnone, which is how clang represents the fact
that it doesn't care about the errno values set by these functions (via
the -fno-math-errno flag).

Reviewers: hfinkel, bogner

Subscribers: mcrosier, javed.absar, llvm-commits, paul.redmond

Differential Revision: https://reviews.llvm.org/D32921

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305204 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:15:41 +00:00
Matt Arsenault
24acabd9f9 AMDGPU: Teach isLegalAddressingMode about flat offsets
Also fix reporting r+r as a valid addressing mode without
offsets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305203 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:06:35 +00:00
Sanjay Patel
e371fe36cc [x86] regenerate checks with update_llc_test_checks.py
The dream of a unified check-line auto-generator for all phases of compilation is dead.
The llc script has already diverged to be better at its goal, so having 2 scripts that
do almost the same thing is just causing confusion for newcomers. I plan to fix up more
x86 tests in a next commit. We can rip out the llc ability in update_test_checks.py after
that. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305202 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 17:05:43 +00:00
Matt Arsenault
23ef7ef4e3 AMDGPU: Start selecting flat instruction offsets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305201 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 16:53:51 +00:00
Matt Arsenault
37ebc3a859 AMDGPU: Verify that flat offsets aren't used pre-GFX9
For convenience the operand is always present in the instruction,
but it isn't valid to use except on GFX9.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 16:37:55 +00:00
Haicheng Wu
e66f5f3fdd [Falkor] Enable SW Prefetch.
SW prefetch is good for Falkor.

Differential Revision: http://reviews.llvm.org/D34084

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305199 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 16:34:19 +00:00
Matt Arsenault
4923776ab2 AMDGPU: Start adding offset fields to flat instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 15:55:58 +00:00
Than McIntosh
8e83a79a93 StackColoring: smarter check for slot overlap
Summary:
The old check for slot overlap treated 2 slots `S` and `T` as
overlapping if there existed a CFG node in which both of the slots could
possibly be active. That is overly conservative and caused stack blowups
in Rust programs. Instead, check whether there is a single CFG node in
which both of the slots are possibly active *together*.

Fixes PR32488.

Patch by Ariel Ben-Yehuda <ariel.byd@gmail.com>

Reviewers: thanm, nagisa, llvm-commits, efriedma, rnk

Reviewed By: thanm

Subscribers: dotdash

Differential Revision: https://reviews.llvm.org/D31583

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305193 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:56:02 +00:00
Sanjay Patel
98a050b9c0 [DAG] add helper to bind memop chains; NFCI
This step is just intended to reduce code duplication rather than change any functionality.

A follow-up would be to replace PPCTargetLowering::spliceIntoChain() usage with this new helper.

Differential Revision: https://reviews.llvm.org/D33649


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305192 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:41:48 +00:00
Sanjay Patel
c099bec884 [InstCombine] lshr (sext iM X to iN), N-M --> zext (ashr X, min(N-M, M-1)) to iN
This is a follow-up to https://reviews.llvm.org/D33879 / https://reviews.llvm.org/rL304939 ,
and was discussed in https://reviews.llvm.org/D33338.

We prefer this form because a narrower shift may be cheaper, and we can more easily fold a
zext than a sext.

http://rise4fun.com/Alive/slVe

Name: shz
%s = sext i8 %x to i12
%r = lshr i12 %s, 4
=>
%a = ashr i8 %x, 4
%r = zext i8 %a to i12 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:23:43 +00:00
Daniel Neilson
8909d38320 Const correctness for TTI::getRegisterBitWidth
Summary: The method TargetTransformInfo::getRegisterBitWidth() is declared const, but the type erasing implementation classes (TargetTransformInfo::Concept & TargetTransformInfo::Model) that were introduced by Chandler in https://reviews.llvm.org/D7293 do not have the method declared const. This is an NFC to tidy up the const consistency between TTI and its implementation.

Reviewers: chandlerc, rnk, reames

Reviewed By: reames

Subscribers: reames, jfb, arsenm, dschuff, nemanjai, nhaehnle, javed.absar, sbc100, jgravelle-google, llvm-commits

Differential Revision: https://reviews.llvm.org/D33903

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305189 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:22:21 +00:00
Francis Ricci
23427ae672 [ADT] Don't use __used__ attribute on struct members in unit test
On some compilers, __used__ can only be applied to variables
or functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:19:25 +00:00
Simon Pilgrim
f6d6d2b0f7 [X86][SSE] Change memop fragment to inherit from vec128load with local alignment controls
First possible step towards merging SSE/AVX memory folding pattern fragments.

Also allows us to remove the duplicate non-temporal load logic.

Differential Revision: https://reviews.llvm.org/D33902

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305184 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 10:01:27 +00:00
Roger Ferrer Ibanez
0158aaf614 Export the required symbol from DynamicLibraryTests
Running unittests/Support/DynamicLibrary/DynamicLibraryTests fails
when LLVM is configured with -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON, because
the test's version script only contains symbols extracted from the static libraries,
that the test links with, but not those from the main object/executable itself.

The patch moves the one symbol, needed by the test, to a static library.

Fixes https://bugs.llvm.org/show_bug.cgi?id=32893

Patch by Momchil Velikov.

Differential Revision: https://reviews.llvm.org/D33789



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 07:22:15 +00:00
Craig Topper
4f29cdd59f [AVX-512] Add VPCONFLICT and VPLZCNT to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305180 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 04:57:31 +00:00
Yaron Keren
eb2b31dd7a Address http://bugs.llvm.org/pr32207 by making BannerPrinted local to runOnSCC and skipping banner for function declarations.
Reviewed By: Mehdi AMINI

Differential Revision: https://reviews.llvm.org/D34086



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305179 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 02:18:50 +00:00
Kamil Rytarowski
c034fe3bb5 Initialize SubArch in class Triple
Summary:
LLDB built with asan on NetBSD detected issues in the following code:

```
void ArchSpec::Clear() {
  m_triple = llvm::Triple();
  m_core = kCore_invalid;
  m_byte_order = eByteOrderInvalid;
  m_distribution_id.Clear();
  m_flags = 0;
}
```

  --- lldb/source/Core/ArchSpec.cpp

Runtime error messages:

/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 32639, which is not a valid value for type 'SubArchType'
/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 3200171710, which is not a valid value for type 'SubArchType'
/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 3200171710, which is not a valid value for type 'SubArchType'

Correct this issue with initialization of SubArch() in the class Triple constructor.

Sponsored by <The NetBSD Foundation>

Reviewers: chandlerc, zturner

Reviewed By: zturner

Subscribers: llvm-commits, zturner

Differential Revision: https://reviews.llvm.org/D33845

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305178 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 00:28:14 +00:00
Sanjay Patel
108ba46942 [x86] use vperm2f128 rather than vinsertf128 when there's a chance to fold a 32-byte load
I was looking closer at the x86 test diffs in D33866, and the first change seems like it 
shouldn't happen in the first place. So this patch will resolve that.

Using Agner's tables and AMD docs, vperm2f128 and vinsertf128 have identical timing for 
any given CPU model, so we should be able to interchange those without affecting perf. 
But as we can see in some of the diffs here, using vperm2f128 allows load folding, so 
we should take that opportunity to reduce code size and register pressure.

A secondary advantage is making AVX1 and AVX2 codegen more similar. Given that vperm2f128 
was introduced with AVX1, we should be selecting it in all of the same situations that we 
would with AVX2. If there's some reason that an AVX1 CPU would not want to use this 
instruction, that should be fixed up in a later pass.

Differential Revision: https://reviews.llvm.org/D33938


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305171 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 21:18:58 +00:00
Xinliang David Li
165d46dd6e [PartialInlining] Support shrinkwrap life_range markers
Differential Revision: http://reviews.llvm.org/D33847




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305170 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 20:46:05 +00:00
Francis Ricci
030e5fedd7 [ADT] Use LLVM_ATTRIBUTE_USED instead of __attribute__ for unit test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305168 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 19:28:21 +00:00
Francis Ricci
a097b34ef7 [ADT] Suppress unused attribute warning in unit test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 18:52:25 +00:00
Simon Pilgrim
415e36dc36 Fix unused variable warning on non-debug EXPENSIVE_CHECKS builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305163 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 12:49:29 +00:00
Amaury Sechet
ddcf5ab29b [DAGCombine] Make sure we check the ResNo from UADDO before combining
Summary: UADDO has 2 result, and one must check the result no before doing any kind of combine. Without it, the transform is invalid.

Reviewers: joerg

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34088

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305162 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 11:36:38 +00:00
Davide Italiano
8177dcd104 [MemorySSA] preservesAll() implies preserves<MemorySSA>(). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305160 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 01:05:45 +00:00
NAKAMURA Takumi
53954f798e TableGen.cmake: Try to fix build breakage introduce in r305142.
LLVM_TABLEGEN_TARGET is undefined in clang standalone build.
STREQUAL cannot omit LHS. Then I saw an error;

  CMake Error at /path/to/install/llvm/lib/cmake/llvm/TableGen.cmake:40 (if):
      if given arguments:
        "STREQUAL" "/path/to/install/llvm/bin/llvm-tblgen.exe"
      Unknown arguments specified

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 00:57:30 +00:00
Davide Italiano
e2f333b1c3 [SmallVector] Reinstate the typedefs.
They're unused with recent versions of libstdc++ but older ones
(e.g. libstdc++ 4.9 still requires them). Maybe we should bump
the requirements on the minimum version to make GCC 7 happy, but
in the meanwhile we need to live with the warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305158 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 23:18:32 +00:00
Davide Italiano
7ba5765d89 [SmallVector] Remove unused typedefs, spotted by GCC 7. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 23:00:23 +00:00
Brian Gesiak
23ff0950e1 [opt-viewer] Include default values in help output
Summary:
Python's argparse module includes a `%(default)s` format specifier that
can be used to print the default value of an option in its help text.
Use this for opt-viewer utilities' `--jobs` arguments.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits, fhahn

Differential Revision: https://reviews.llvm.org/D34081

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305155 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 21:33:27 +00:00
Simon Pilgrim
1af74782db [X86][SSE] Extended PR32368 to SSE/AVX1/AVX2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305154 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 21:13:01 +00:00
Simon Pilgrim
c8aab0d95a [X86][AVX512] Added test case for PR32368
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305153 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 20:58:43 +00:00
David Blaikie
f79912032b dwarfdump: Handle relocs to zlib (.zdebug*) compressed sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305152 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 19:32:50 +00:00
Simon Pilgrim
b1984510d5 [X86][SLM] Add SLM arithmetic vectorization tests
As discussed on D33983, as SLM has so many custom costs its worth testing as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305151 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 19:16:09 +00:00
Galina Kistanova
831f8f80c2 Break seems serve better here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305150 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 18:26:19 +00:00
Vedant Kumar
ce478a5667 Fix a ubsan failure introduced by r305092
lib/Object/WindowsResource.cpp:578:3: runtime error: store to
misaligned address 0x7fa09aedebbe for type 'unsigned int', which
requires 4 byte alignment
0x7fa09aedebbe: note: pointer points here
00 00 03 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00
            ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 18:07:24 +00:00
Geoff Berry
47e23552c8 [EarlyCSE] Add option to use MemorySSA for function simplification run of EarlyCSE (off by default).
Summary:
Use MemorySSA for memory dependency checking in the EarlyCSE pass at the
start of the function simplification portion of the pipeline.  We rely
on the fact that GVNHoist runs just after this pass of EarlyCSE to
amortize the MemorySSA construction cost since GVNHoist uses MemorySSA
and EarlyCSE preserves it.

This is turned off by default.  A follow-up change will turn it on to
allow for easier reversion in case it breaks something.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305146 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 15:20:03 +00:00
Galina Kistanova
04f04da96c Added llvm_unreachable to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 08:04:51 +00:00
Galina Kistanova
c4d4524f23 Added llvm_unreachable as ReportError cannot be specified as noreturn.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 07:50:14 +00:00