150332 Commits

Author SHA1 Message Date
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
Galina Kistanova
044e64c53b Added dependency on the TableGen executable file.
For the case when LLVM_OPTIMIZED_TABLEGEN is ON (enables LLVM_USE_HOST_TOOLS),
we need both _TABLEGEN_TARGET and _TABLEGEN_EXE in the  DEPENDS list
to have .inc files rebuilt on a tablegen change, as cmake does not propagate
file-level dependencies of custom targets.

We could always have just one dependency on both the target and
the file, but the 2 cases would produce cleaner cmake files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305142 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 07:48:49 +00:00
Craig Topper
309f3a963a [IR] Remove stale comment from HungoffOperandTraits. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305141 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 06:58:26 +00:00
Craig Topper
b73a9334a3 [IR] Delete operator new(size_t, unsigned) for ShuffleVector making it consistent with other instructions that declare another operator new with a different signature. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305140 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 06:58:24 +00:00
Craig Topper
fb0cb71701 [IR] Put a comment back on a function it belongs to. NFC
Looks like the function was moved to a different part of the class in December, but the comment didn't move with it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 06:58:22 +00:00
Craig Topper
95270b9920 [IR] Remove unnecessary override of operator new in ExtractValueInst. It's already inherited from UnaryInstruction. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305138 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 06:58:19 +00:00
Wei Ding
2d0aa2e9ba AMDGPU : Fix ISA Version Definitions.
Differential Revision: http://reviews.llvm.org/D28531

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305137 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 03:53:19 +00:00
Andrew Kaylor
b8e9164d09 [InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin
Differential Revision: https://reviews.llvm.org/D33737

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 23:18:11 +00:00
Sanjay Patel
a1e0378901 [PowerPC] add memcmp test with one constant operand and equality cmp; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 23:15:14 +00:00
Sanjay Patel
672c64a527 [CGP] add a reference to DataLayout in MemCmpExpansion; NFCI
We're currently passing endian-ness around as a param (and not uniformly),
so this eliminates the need for that. I'd like to add a constant fold
call too, and that requires a DL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 23:01:05 +00:00
I-Jui (Ray) Sung
9ac60a697c [AArch64] Add fallback in FastISel fp16 conversions
Summary:
- Fix assertion failures on F16 to/from int types in FastISel by falling
  back to regular ISel
- Add a testcase of various conversion cases with FastISel (-O0)

Reviewers: kristof.beyls, jmolloy, SjoerdMeijer

Reviewed By: SjoerdMeijer

Subscribers: SjoerdMeijer, llvm-commits, srhines, pirama, aemerson, rengolin, javed.absar, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305127 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 22:40:50 +00:00
Vassil Vassilev
7bdba100fb Enable c++1z experimental builds.
Patch by David Abdurachmanov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305123 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 22:09:57 +00:00
Eugene Zelenko
af1531a5be [Support] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305119 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 21:41:54 +00:00
Craig Topper
24ed17e240 [LVI] Fix spelling error in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 21:21:17 +00:00
Craig Topper
f12aebdca5 [LVI] Const correct and rename the LVILatticeVal parameter to getPredicateResult. NFC
Previously it was non-const reference named Result which would tend to make someone think that it was an outparam when really its an input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305114 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 21:18:16 +00:00
Zachary Turner
bb67f7f534 [pdb] Support CoffSymbolRVA debug subsection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 20:46:52 +00:00
Yaxun Liu
6862a2be05 [SROA] Fix APInt size when load/store have different address space
Currently there is a bug in SROA::presplitLoadsAndStores which causes assertion in
GEPOperator::accumulateConstantOffset.

Basically it does not consider the situation that the pointer operand of load or store
may be in a non-zero address space and its size may be different from the size of
a pointer in address space 0.

This patch fixes assertion when compiling Blender Cycles kernels for amdgpu backend.

Diffferential Revision: https://reviews.llvm.org/D33298


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 20:46:29 +00:00
Zachary Turner
cfb1356863 Rename llvm-pdbdump -> llvm-pdbutil.
This is to reflect the evolving nature of the tool as being
useful for more than just dumping PDBs, as it can do many other
things.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 20:46:17 +00:00