OSDN Git Service

android-x86/external-llvm.git
7 years ago[AVX-512] Remove masked pmin/pmax intrinsics and autoupgrade to native IR.
Craig Topper [Mon, 24 Oct 2016 04:04:16 +0000 (04:04 +0000)]
[AVX-512] Remove masked pmin/pmax intrinsics and autoupgrade to native IR.

Clang patch to replace 512-bit vector and 64-bit element versions with native IR will follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284955 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] enhance computeKnownBits to handle SRL/SRA with vector splat constant
Sanjay Patel [Sun, 23 Oct 2016 23:13:31 +0000 (23:13 +0000)]
[DAG] enhance computeKnownBits to handle SRL/SRA with vector splat constant

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284953 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse SDValue::getConstantOperandVal() helper. NFCI.
Simon Pilgrim [Sun, 23 Oct 2016 20:17:21 +0000 (20:17 +0000)]
Use SDValue::getConstantOperandVal() helper. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284949 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove LLVM_CONSTEXPR.
Justin Lebar [Sun, 23 Oct 2016 19:39:16 +0000 (19:39 +0000)]
Remove LLVM_CONSTEXPR.

Summary: With MSVC 2013 and GCC < 4.8 gone, we can use the "constexpr" keyword.

Reviewers: bkramer, mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284947 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CostModel][X86] Added tests for current integer signed/unsigned remainder costs
Simon Pilgrim [Sun, 23 Oct 2016 18:35:02 +0000 (18:35 +0000)]
[CostModel][X86] Added tests for current integer signed/unsigned remainder costs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284940 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Add SSE41/AVX1 costs for vector shifts.
Simon Pilgrim [Sun, 23 Oct 2016 16:49:04 +0000 (16:49 +0000)]
[X86][SSE] Add SSE41/AVX1 costs for vector shifts.

We were defaulting to SSE2 costs which weren't taking into account the availability of PBLENDW/PBLENDVB to improve merging of per-element shift results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284939 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CostModel][X86] Added tests for current integer trunc costs
Simon Pilgrim [Sun, 23 Oct 2016 15:17:52 +0000 (15:17 +0000)]
[CostModel][X86] Added tests for current integer trunc costs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284938 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse APInt::isAllOnesValue instead of popcnt. NFCI.
Simon Pilgrim [Sun, 23 Oct 2016 15:09:44 +0000 (15:09 +0000)]
Use APInt::isAllOnesValue instead of popcnt. NFCI.

More obvious implementation and faster too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284937 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVR] Add the machine code disassembler
Dylan McKay [Sat, 22 Oct 2016 23:57:59 +0000 (23:57 +0000)]
[AVR] Add the machine code disassembler

This adds a super basic implementation of a machine code disassembler.

It doesn't support any operands with custom encoding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284930 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512VL] Added support for combining target 256-bit shuffles to AVX512VL VPERMV3
Simon Pilgrim [Sat, 22 Oct 2016 20:15:39 +0000 (20:15 +0000)]
[X86][AVX512VL] Added support for combining target 256-bit shuffles to AVX512VL VPERMV3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284922 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512] Added support for combining target shuffles to AVX512 VPERMV3
Simon Pilgrim [Sat, 22 Oct 2016 19:53:59 +0000 (19:53 +0000)]
[X86][AVX512] Added support for combining target shuffles to AVX512 VPERMV3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284921 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[lit] Add more testing instructions to README
Brian Gesiak [Sat, 22 Oct 2016 17:27:31 +0000 (17:27 +0000)]
[lit] Add more testing instructions to README

Summary:
r283710 introduced two regressions, one to llvm-lit, and the other to
lit executables that were installed via setuptools. Add instructions on
how to test for these regressions in the future.

Reviewers: ddunbar, delcypher, beanz, chapuni, cmatthews, echristo

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284919 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] Fix crash in ConstantIslands
James Molloy [Sat, 22 Oct 2016 09:58:37 +0000 (09:58 +0000)]
[ARM] Fix crash in ConstantIslands

tPCRelJT may not be the first instruction in a block. Check that instead of dereferencing a broken iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284917 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Apply the Update LLC Test Checks tool on the mmx-bitcast test
Zvi Rackover [Sat, 22 Oct 2016 07:15:00 +0000 (07:15 +0000)]
[X86] Apply the Update LLC Test Checks tool on the mmx-bitcast test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284916 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add support for printing shuffle comments for VALIGN instructions.
Craig Topper [Sat, 22 Oct 2016 06:51:56 +0000 (06:51 +0000)]
[X86] Add support for printing shuffle comments for VALIGN instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284915 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add support for lowering v4i64 and v8i64 shuffles directly to PALIGNR. I think...
Craig Topper [Sat, 22 Oct 2016 06:51:52 +0000 (06:51 +0000)]
[X86] Add support for lowering v4i64 and v8i64 shuffles directly to PALIGNR. I think shuffle combine can figure it out later, but we should try to get it right up front.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284914 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Remove unnecessary AVX2 check that was already covered by an assertion earlier...
Craig Topper [Sat, 22 Oct 2016 06:51:49 +0000 (06:51 +0000)]
[X86] Remove unnecessary AVX2 check that was already covered by an assertion earlier in the function. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284913 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Remove 128-bit lane handling from the main loop of matchVectorShuffleAsByteRota...
Craig Topper [Sat, 22 Oct 2016 06:51:44 +0000 (06:51 +0000)]
[X86] Remove 128-bit lane handling from the main loop of matchVectorShuffleAsByteRotate. Instead check for is128LaneRepeatedSuffleMask before the loop and just loop over the repeated mask.

I plan to use the loop to support VALIGND/Q shuffles so this makes it easier to reuse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284912 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Use getConstVector helper for VPERMV mask generation. NFCI.
Simon Pilgrim [Sat, 22 Oct 2016 06:18:36 +0000 (06:18 +0000)]
[X86][SSE] Use getConstVector helper for VPERMV mask generation. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284911 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNow that VS2013 is gone, make a memoryssa structure an anonymous union again
Daniel Berlin [Sat, 22 Oct 2016 04:15:41 +0000 (04:15 +0000)]
Now that VS2013 is gone, make a memoryssa structure an anonymous union again

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284910 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] mutation: insert the size of the input in bytes as one of the ways to...
Kostya Serebryany [Sat, 22 Oct 2016 03:48:53 +0000 (03:48 +0000)]
[libFuzzer] mutation: insert the size of the input in bytes as one of the ways to mutate a binary integer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284909 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[BasicAA] Fix - missed alias in GEP expressions
Gerolf Hoflehner [Sat, 22 Oct 2016 02:41:39 +0000 (02:41 +0000)]
[BasicAA] Fix -  missed alias in GEP expressions

In BasicAA GEP operand values get adjusted ("wrap-around") based on the
pointersize. Otherwise, in non-64b modes, AA could report false negatives.
However, a wrap-around is valid only for a fully evaluated expression.
It had been introduced to fix an alias problem in
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160118/326163.html.
This commit restricts the wrap-around to constant gep operands only where the
value is known at compile-time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284908 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CtorUtils] Modernize. No functional changes intended.
Davide Italiano [Sat, 22 Oct 2016 01:21:24 +0000 (01:21 +0000)]
[CtorUtils] Modernize. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284904 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] typo in a test
Kostya Serebryany [Sat, 22 Oct 2016 01:07:38 +0000 (01:07 +0000)]
[libFuzzer] typo in a test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284903 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] add a test for asan's strict_string_checks=1
Kostya Serebryany [Sat, 22 Oct 2016 00:05:44 +0000 (00:05 +0000)]
[libFuzzer] add a test for asan's strict_string_checks=1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284902 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix map insertion that is elided in release build.
David L. Jones [Fri, 21 Oct 2016 23:30:39 +0000 (23:30 +0000)]
Fix map insertion that is elided in release build.

The assert() macro doesn't actually execute its body in Release builds, so using
it to check cache invariants requires that the insertion be outside of the
assert() statement. This change does that, and also makes sure to return the
actual map contents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284898 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] add test for missing vector SRA combine via computeKnownBits
Sanjay Patel [Fri, 21 Oct 2016 23:02:31 +0000 (23:02 +0000)]
[x86] add test for missing vector SRA combine via computeKnownBits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284896 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Don't rely on string literals not being convertible to non-const char* in Cache...
Justin Lebar [Fri, 21 Oct 2016 22:10:23 +0000 (22:10 +0000)]
[ADT] Don't rely on string literals not being convertible to non-const char* in CachedHashString.

The build was breaking on some platforms because we assumed that
CachedHashString("foo") would match the CachedHashString(StringRef)
constructor rather than the CachedHashString(char*) constructor.

To fix this, provide a CachedHashString(const char*) constructor, and
add a dummy argument to the old CachedHashString(char*) constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284892 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Perform uchar to float combine for ISD::SINT_TO_FP
Konstantin Zhuravlyov [Fri, 21 Oct 2016 22:10:03 +0000 (22:10 +0000)]
[AMDGPU] Perform uchar to float combine for ISD::SINT_TO_FP

This will prevent following regression when enabling i16 support (D18049):
  test/CodeGen/AMDGPU/cvt_f32_ubyte.ll

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284891 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSwitch SmallSetVector to use DenseSet when it overflows its inline space.
Justin Lebar [Fri, 21 Oct 2016 21:45:01 +0000 (21:45 +0000)]
Switch SmallSetVector to use DenseSet when it overflows its inline space.

Summary:
SetVector already used DenseSet, but SmallSetVector used std::set.  This
leads to surprising performance differences.  Moreover, it means that
the set of key types accepted by SetVector and SmallSetVector are
quite different!

In order to make this change, we had to convert some callsites that used
SmallSetVector<std::string, N> to use SmallSetVector<CachedHashString, N>
instead.

Reviewers: timshen

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284887 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSupport: Annotate Error and Expected<> with LLVM_NODISCARD
Justin Bogner [Fri, 21 Oct 2016 21:01:12 +0000 (21:01 +0000)]
Support: Annotate Error and Expected<> with LLVM_NODISCARD

It's always a mistake to ignore return values with Error or Expected
types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284884 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agofixed typo in InstrProf.h; NFC
Bob Haarman [Fri, 21 Oct 2016 20:38:37 +0000 (20:38 +0000)]
fixed typo in InstrProf.h; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284880 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Get rid of use of LLVM_NOEXCEPT in CachedHashString.h.
Justin Lebar [Fri, 21 Oct 2016 20:28:00 +0000 (20:28 +0000)]
[ADT] Get rid of use of LLVM_NOEXCEPT in CachedHashString.h.

LLVM_NOEXCEPT is no longer necessary (yay).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284876 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU/SI: Fix crash caused by r284267
Tom Stellard [Fri, 21 Oct 2016 20:25:11 +0000 (20:25 +0000)]
AMDGPU/SI: Fix crash caused by r284267

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284875 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] enhance computeKnownBits to handle SHL with vector splat constant
Sanjay Patel [Fri, 21 Oct 2016 20:16:27 +0000 (20:16 +0000)]
[DAG] enhance computeKnownBits to handle SHL with vector splat constant

Also, use APInt to avoid crashing on types larger than vNi64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284874 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Compare strings' hashes first before comparing their values.
Justin Lebar [Fri, 21 Oct 2016 20:10:51 +0000 (20:10 +0000)]
[ADT] Compare strings' hashes first before comparing their values.

Summary:
We already have the hashes in hand, and comparing hashes should be much
more discriminatory than comparing the StringRefs' sizes.

Reviewers: rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284872 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ADT] Add CachedHashString.
Justin Lebar [Fri, 21 Oct 2016 20:10:48 +0000 (20:10 +0000)]
[ADT] Add CachedHashString.

Summary:
This is like CachedHashStringRef, but owns its data.

This lets us use strings inside of DenseMaps.

Reviewers: timshen

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284871 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IR] Add DenseMapInfo<CallSite>.
Justin Lebar [Fri, 21 Oct 2016 20:10:44 +0000 (20:10 +0000)]
[IR] Add DenseMapInfo<CallSite>.

Summary:
A CallSite is basically an Instruction*, and you can put Instruction*s
into DenseMaps, so you should be able to do the same with CallSites.

This is used in a later patch.

Reviewers: timshen

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284870 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SCEV] Memoize visitMulExpr results in SCEVRewriteVisitor.
Li Huang [Fri, 21 Oct 2016 20:05:21 +0000 (20:05 +0000)]
[SCEV] Memoize visitMulExpr results in SCEVRewriteVisitor.

Summary:
When SCEVRewriteVisitor traverses the SCEV DAG, it may visit the same SCEV
multiple times if this SCEV is referenced by multiple other SCEVs. This has
exponential time complexity in the worst case. Memoizing the results will
avoid re-visiting the same SCEV. Add a map to save the results, and override
the visit function of SCEVVisitor. Now SCEVRewriteVisitor only visit each
SCEV once and thus returns the same result for the same input SCEV.

This patch fixes PR18606, PR18607.

Reviewers: Sanjoy Das, Mehdi Amini, Michael Zolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284868 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix a bug in the code of llvm-cxxdump in dumpArchive() when
Kevin Enderby [Fri, 21 Oct 2016 20:03:14 +0000 (20:03 +0000)]
Fix a bug in the code of llvm-cxxdump in dumpArchive() when
iterating over an archive with object and non-object members that
would cause an Abort because to was not calling consumeError()
when the code was wanting to ignore a non-object file.

Found by Justin Bogner!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284867 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] mention one more trophie
Kostya Serebryany [Fri, 21 Oct 2016 20:01:45 +0000 (20:01 +0000)]
[libFuzzer] mention one more trophie

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284866 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAnalysis: Move llvm::getConstantRangeFromMetadata to IR library.
Peter Collingbourne [Fri, 21 Oct 2016 19:59:26 +0000 (19:59 +0000)]
Analysis: Move llvm::getConstantRangeFromMetadata to IR library.

We're about to start using it there.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284865 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoX86: Improve BT instruction selection for 64-bit values.
Peter Collingbourne [Fri, 21 Oct 2016 19:57:55 +0000 (19:57 +0000)]
X86: Improve BT instruction selection for 64-bit values.

If a 64-bit value is tested against a bit which is known to be in the range
[0..31) (modulo 64), we can use the 32-bit BT instruction, which has a slightly
shorter encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284864 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512BWVL] Added support for lowering v16i16 shuffles to AVX512BWVL vpermw
Simon Pilgrim [Fri, 21 Oct 2016 19:54:38 +0000 (19:54 +0000)]
[X86][AVX512BWVL] Added support for lowering v16i16 shuffles to AVX512BWVL vpermw

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284863 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[pdb] added support for dumping globals stream
Bob Haarman [Fri, 21 Oct 2016 19:43:19 +0000 (19:43 +0000)]
[pdb] added support for dumping globals stream

Summary: This adds support for dumping the globals stream from PDB files using llvm-pdbdump, similar to the support we have for the publics stream.

Reviewers: ruiu, zturner

Subscribers: beanz, mgorny, modocache

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284861 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512BWVL] Added support for combining target v16i16 shuffles to AVX512BWVL...
Simon Pilgrim [Fri, 21 Oct 2016 19:40:29 +0000 (19:40 +0000)]
[X86][AVX512BWVL] Added support for combining target v16i16 shuffles to AVX512BWVL vpermw

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284860 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512] Added support for combining target shuffles to AVX512 vpermpd/vpermq...
Simon Pilgrim [Fri, 21 Oct 2016 19:18:09 +0000 (19:18 +0000)]
[X86][AVX512] Added support for combining target shuffles to AVX512 vpermpd/vpermq/vpermps/vpermd/vpermw

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284858 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[RDF] Use RegisterId typedef more consistently, NFC
Krzysztof Parzyszek [Fri, 21 Oct 2016 19:12:13 +0000 (19:12 +0000)]
[RDF] Use RegisterId typedef more consistently, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284857 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[StripGCRelocates] New pass to remove gc.relocates added by RS4GC
Anna Thomas [Fri, 21 Oct 2016 18:43:16 +0000 (18:43 +0000)]
[StripGCRelocates] New pass to remove gc.relocates added by RS4GC

Summary:
Utility pass to remove gc.relocates created by rewrite statepoints for GC.
With respect to safepoint verification, the IR generated would be incorrect, and cannot run
as such.

This would be a single transformation on the final optimized IR.
The benefit of the pass is for easy analysis when the IRs are 'polluted' by too
many gc.relocates.
Added tests.

test run: All RS4GC tests with -verify option. Local downstream tests on large
IR files. This also works when the pointer being gc.relocated is another
gc.relocate.

Reviewers: sanjoy, reames

Subscribers: beanz, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284855 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFor llvm-objdump for Mach-O files add printing of
Kevin Enderby [Fri, 21 Oct 2016 18:22:35 +0000 (18:22 +0000)]
For llvm-objdump for Mach-O files add printing of
the ARM_THREAD_STATE in the same format as
otool-classic(1) on darwin.

Also remove an extra space in printing the initprot to make
the output match otool-classic(1) on darwin.

rdar://28851457

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284852 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] fold negation of sign-bit
Sanjay Patel [Fri, 21 Oct 2016 17:24:26 +0000 (17:24 +0000)]
[DAG] fold negation of sign-bit

0 - X --> 0, if the sub is NUW
0 - X --> 0, if X is 0 or the minimum signed value and the sub is NSW
0 - X --> X, if X is 0 or the minimum signed value

This is the DAG equivalent of:
https://reviews.llvm.org/rL284649

plus the fold for the NUW case which already existed in InstSimplify.

Note that we miss a vector fold because of a deficiency in the DAG version of
computeKnownBits().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284844 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[x86] add tests for potential negation folds
Sanjay Patel [Fri, 21 Oct 2016 16:56:29 +0000 (16:56 +0000)]
[x86] add tests for potential negation folds

These are the backend equivalents for the tests added in r284627.
The patterns may emerge late, so we should have folds for these in the DAG too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284842 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Handle spills of partially defined double vector registers
Krzysztof Parzyszek [Fri, 21 Oct 2016 16:38:29 +0000 (16:38 +0000)]
[Hexagon] Handle spills of partially defined double vector registers

After register allocation it is possible to have a spill of a register
that is only partially defined. That in itself it fine, but creates a
problem for double vector registers. Stores of such registers are pseudo
instructions that are expanded into pairs of individual vector stores,
and in case of a partially defined source, one of the stores may use
an entirely undefined register. To avoid this, track the defined parts
and only generate actual stores for those.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284841 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Fix for 0xc call_indirect changes
Derek Schuff [Fri, 21 Oct 2016 16:38:07 +0000 (16:38 +0000)]
[WebAssembly] Fix for 0xc call_indirect changes

Summary:
Need to reorder the operands to have the callee as the last argument.
Adds a pseudo-instruction, and a pass to lower it into a real
call_indirect.

This is the first of two options for how to fix the problem.

Reviewers: dschuff, sunfish

Subscribers: jfb, beanz, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284840 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSet the vectorizer MaxInterleaveFactor for Exynos.
Abderrazek Zaafrani [Fri, 21 Oct 2016 16:28:27 +0000 (16:28 +0000)]
Set the vectorizer MaxInterleaveFactor for Exynos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284839 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix -Wunused-variable warning in libFuzzer
Reid Kleckner [Fri, 21 Oct 2016 16:26:27 +0000 (16:26 +0000)]
Fix -Wunused-variable warning in libFuzzer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284838 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Regenerated sext/zext constant folding tests and added i686 tests
Simon Pilgrim [Fri, 21 Oct 2016 16:22:16 +0000 (16:22 +0000)]
[X86][SSE] Regenerated sext/zext constant folding tests and added i686 tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284837 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Use DAG::getBuildVector helper wrapper where possible. NFCI.
Simon Pilgrim [Fri, 21 Oct 2016 16:07:51 +0000 (16:07 +0000)]
[X86] Use DAG::getBuildVector helper wrapper where possible. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284835 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MachineMemOperand][AtomicSDNode] Remove getSuccessOrdering()
Konstantin Zhuravlyov [Fri, 21 Oct 2016 16:02:35 +0000 (16:02 +0000)]
[MachineMemOperand][AtomicSDNode] Remove getSuccessOrdering()

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284834 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][SSE] Regenerated chained pmovsx store tests and added i686 tests
Simon Pilgrim [Fri, 21 Oct 2016 15:51:24 +0000 (15:51 +0000)]
[X86][SSE] Regenerated chained pmovsx store tests and added i686 tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284833 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTest commit
Abderrazek Zaafrani [Fri, 21 Oct 2016 15:24:08 +0000 (15:24 +0000)]
Test commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284832 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LVI] Fix a bug with a guard being the very first instruction in a BB not taken into...
Artur Pilipenko [Fri, 21 Oct 2016 15:02:21 +0000 (15:02 +0000)]
[LVI] Fix a bug with a guard being the very first instruction in a BB not taken into account

While looking for guards use reverse iterator and scan up to rend() not to begin()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284827 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agofix variable names; NFCI
Sanjay Patel [Fri, 21 Oct 2016 14:58:30 +0000 (14:58 +0000)]
fix variable names; NFCI

Because we're just 'or-ing' these 2 variables later in the code, I
don't think there's a logical bug here, but of course the string with
"no size" is the one that should have the size suffix stripped off.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284826 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU][mc] Fix ds_min/max[_rtn]_f32 - extra source operand removed.
Artem Tamazov [Fri, 21 Oct 2016 14:49:22 +0000 (14:49 +0000)]
[AMDGPU][mc] Fix ds_min/max[_rtn]_f32 - extra source operand removed.

Fixes Bug 28215. Lit tests updated.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284825 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] use SDNode flags 'nsz' to enable fadd/fsub with zero folds
Sanjay Patel [Fri, 21 Oct 2016 14:36:58 +0000 (14:36 +0000)]
[DAG] use SDNode flags 'nsz' to enable fadd/fsub with zero folds

As discussed in D24815, let's start the process of killing off the broken fast-math global
state housed in TargetOptions and eliminate the need for function-level fast-math attributes.

Here we enable two similar folds that are possible when we don't care about signed-zero:
fadd nsz x, 0 --> x
fsub nsz 0, x --> -x

Note that although the test cases include a 'sin' function call, I'm side-stepping the
FMF-on-calls question (and lack of support in the DAG) for now. It's not needed for these
tests - isNegatibleForFree/GetNegatedExpression just look through a ISD::FSIN node.

Also, when we create an FNEG node and propagate the Flags of the FSUB to it, this doesn't
actually do anything today because Flags are silently dropped for any node that is not a
binary operator.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284824 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX2] Begun generalizing lowering to VPERMD/VPERMPS in preparation for AVX512...
Simon Pilgrim [Fri, 21 Oct 2016 13:00:47 +0000 (13:00 +0000)]
[X86][AVX2] Begun generalizing lowering to VPERMD/VPERMPS in preparation for AVX512 support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284823 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoWdocumentation fix
Simon Pilgrim [Fri, 21 Oct 2016 12:51:16 +0000 (12:51 +0000)]
Wdocumentation fix

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284822 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX512] Add mask/maskz writemask support to subvector broadcast shuffle decode...
Simon Pilgrim [Fri, 21 Oct 2016 12:14:24 +0000 (12:14 +0000)]
[X86][AVX512] Add mask/maskz writemask support to subvector broadcast shuffle decode comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284821 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LoopUnroll] Keep the loop test only on the first iteration of max-or-zero loops
John Brawn [Fri, 21 Oct 2016 11:08:48 +0000 (11:08 +0000)]
[LoopUnroll] Keep the loop test only on the first iteration of max-or-zero loops

When we have a loop with a known upper bound on the number of iterations, and
furthermore know that either the number of iterations will be either exactly
that upper bound or zero, then we can fully unroll up to that upper bound
keeping only the first loop test to check for the zero iteration case.

Most of the work here is in plumbing this 'max-or-zero' information from the
part of scalar evolution where it's detected through to loop unrolling. I've
also gone for the safe default of 'false' everywhere but howManyLessThans which
could probably be improved.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284818 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][AVX] Add 32-bit target tests for vector lzcnt/tzcnt to demonstrate missed foldi...
Simon Pilgrim [Fri, 21 Oct 2016 10:50:52 +0000 (10:50 +0000)]
[X86][AVX] Add 32-bit target tests for vector lzcnt/tzcnt to demonstrate missed folding opportunities

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284816 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Corrected spill size for DDD register class. NFCI
Bjorn Pettersson [Fri, 21 Oct 2016 09:53:42 +0000 (09:53 +0000)]
[AArch64] Corrected spill size for DDD register class. NFCI

Summary:
The spill size was incorrectly set to 196 bits,
which isn't a multiple of 8. This problem was detected when
experimenting with asserts that the spill size should be a
multiple of the byte size.

New corrected value for the spill size is set to 192 bits.

Note that tablegen (RegisterInfoEmitter) will divide the
size set in the RegisterClass definition by 8. So this
change should not have any impact on the tablegen output
(trunc(192/8) == trunc(196/8) == 24 bytes).

Reviewers: t.p.northover

Subscribers: llvm-commits, aemerson, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284814 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix WebAssembly test after r284757.
Benjamin Kramer [Fri, 21 Oct 2016 09:51:41 +0000 (09:51 +0000)]
Fix WebAssembly test after r284757.

The change to MachineSink shuffles code around, disable it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284813 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Support] Fix AlignOf test on i386-linux.
Benjamin Kramer [Fri, 21 Oct 2016 09:15:57 +0000 (09:15 +0000)]
[Support] Fix AlignOf test on i386-linux.

On i386 alignof(double) = 8 is not the same as alignof(struct { double
}) = 4. This used to be not an issue because the old implementation
always measured alignment inside of structs. Wrap a dummy struct around
the test to avoid this issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284812 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX-512] Add tests to show opportunities for commuting vpermi2/vpermt2 instructions.
Craig Topper [Fri, 21 Oct 2016 05:55:40 +0000 (05:55 +0000)]
[AVX-512] Add tests to show opportunities for commuting vpermi2/vpermt2 instructions.

Commuting will be added in a future commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284808 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[GVN/PRE] Hoist global values outside of loops."
Davide Italiano [Fri, 21 Oct 2016 01:37:02 +0000 (01:37 +0000)]
Revert "[GVN/PRE] Hoist global values outside of loops."

There's no agreement about this patch. I personally find the
PRE machinery of the current GVN hard enough to reason about
that I'm not sure I'll try to land this again, instead of working
on the rewrite).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284796 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix cross-endianness RuntimeDyld relocation for ARM
Keno Fischer [Thu, 20 Oct 2016 22:15:56 +0000 (22:15 +0000)]
Fix cross-endianness RuntimeDyld relocation for ARM

rL284780 fixed the PREL31 relocation and added a test for it. Being
the first such test for ARM relocations, it exposed incorrect endianness
assumptions (causing buildbot failures on big-endian hosts). Fix that by
using the same helpers used for the x86 case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284789 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SCEV] Add a threshold to restrict number of mul operands to be inlined into SCEV
Li Huang [Thu, 20 Oct 2016 21:38:39 +0000 (21:38 +0000)]
[SCEV] Add a threshold to restrict number of mul operands to be inlined into SCEV

This is to avoid inlining too many multiplication operands into a SCEV, which could
take exponential time in the worst case.

Reviewers: Sanjoy Das, Mehdi Amini, Michael Zolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284784 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix PREL31 relocation on ARM
Keno Fischer [Thu, 20 Oct 2016 21:15:29 +0000 (21:15 +0000)]
Fix PREL31 relocation on ARM

Summary:
This is a 31bits relative relocation instead of a 32bits absolute relocation.

Reviewers: t.p.northover, peter.smith, rengolin

Subscribers: aemerson, llvm-commits, samparker

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284780 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Enable interleaved memory access by default
Michael Kuperstein [Thu, 20 Oct 2016 21:04:31 +0000 (21:04 +0000)]
[X86] Enable interleaved memory access by default

This lets the loop vectorizer generate interleaved memory accesses on x86.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284779 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MSSA] Avoid unnecessary use walks when calling getClobberingMemoryAccess
Daniel Berlin [Thu, 20 Oct 2016 20:13:45 +0000 (20:13 +0000)]
[MSSA] Avoid unnecessary use walks when calling getClobberingMemoryAccess

Summary:
This allows us to mark when uses have been optimized.
This lets us avoid rewalking (IE when people call getClobberingAccess on everything), and also
enables us to later relax the requirement of use optimization during updates with less cost.

Reviewers: george.burgess.iv

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284771 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAnother additional error check for invalid Mach-O files for the
Kevin Enderby [Thu, 20 Oct 2016 20:10:30 +0000 (20:10 +0000)]
Another additional error check for invalid Mach-O files for the
load commands that use the MachO::twolevel_hints_command type
which includes only the LC_TWOLEVEL_HINTS load command.

This is not used in llvm libObject code or in llvm tool code.  But
does appear in one of the binary test files.  While this load command is
obsolete it is easier to add code for it in libObject than edit or change
the binary test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284769 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix case of file include path.
Zachary Turner [Thu, 20 Oct 2016 18:34:37 +0000 (18:34 +0000)]
Fix case of file include path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284763 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeView] Refactor serialization to use StreamInterface.
Zachary Turner [Thu, 20 Oct 2016 18:31:19 +0000 (18:31 +0000)]
[CodeView] Refactor serialization to use StreamInterface.

This was all using ArrayRef<>s before which presents a problem
when you want to serialize to or deserialize from an actual
PDB stream.  An ArrayRef<> is really just a special case of
what can be handled with StreamInterface though (e.g. by using
a ByteStream), so changing this to use StreamInterface allows
us to plug in a PDB stream and get all the record serialization
and deserialization for free on a MappedBlockStream.

Subsequent patches will try to remove TypeTableBuilder and
TypeRecordBuilder in favor of class that operate on
Streams as well, which should allow us to completely merge
the reading and writing codepaths for both types and symbols.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284762 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Make note record name a static const member of target streamer
Konstantin Zhuravlyov [Thu, 20 Oct 2016 18:22:36 +0000 (18:22 +0000)]
[AMDGPU] Make note record name a static const member of target streamer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284760 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Emit constant address space data in .rodata section and use relocations...
Konstantin Zhuravlyov [Thu, 20 Oct 2016 18:12:38 +0000 (18:12 +0000)]
[AMDGPU] Emit constant address space data in .rodata section and use relocations instead of fixups (amdhsa only)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284759 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUsing branch probability to guide critical edge splitting.
Dehao Chen [Thu, 20 Oct 2016 18:06:52 +0000 (18:06 +0000)]
Using branch probability to guide critical edge splitting.

Summary:
The original heuristic to break critical edge during machine sink is relatively conservertive: when there is only one instruction sinkable to the critical edge, it is likely that the machine sink pass will not break the critical edge. This leads to many speculative instructions executed at runtime. However, with profile info, we could model the splitting benefits: if the critical edge has 50% taken rate, it would always be beneficial to split the critical edge to avoid the speculated runtime instructions. This patch uses profile to guide critical edge splitting in machine sink pass.

The performance impact on speccpu2006 on Intel sandybridge machines:

spec/2006/fp/C++/444.namd                  25.3  +0.26%
spec/2006/fp/C++/447.dealII               45.96  -0.10%
spec/2006/fp/C++/450.soplex               41.97  +1.49%
spec/2006/fp/C++/453.povray               36.83  -0.96%
spec/2006/fp/C/433.milc                   23.81  +0.32%
spec/2006/fp/C/470.lbm                    41.17  +0.34%
spec/2006/fp/C/482.sphinx3                48.13  +0.69%
spec/2006/int/C++/471.omnetpp             22.45  +3.25%
spec/2006/int/C++/473.astar               21.35  -2.06%
spec/2006/int/C++/483.xalancbmk           36.02  -2.39%
spec/2006/int/C/400.perlbench              33.7  -0.17%
spec/2006/int/C/401.bzip2                  22.9  +0.52%
spec/2006/int/C/403.gcc                   32.42  -0.54%
spec/2006/int/C/429.mcf                   39.59  +0.19%
spec/2006/int/C/445.gobmk                 26.98  -0.00%
spec/2006/int/C/456.hmmer                 24.52  -0.18%
spec/2006/int/C/458.sjeng                 28.26  +0.02%
spec/2006/int/C/462.libquantum            55.44  +3.74%
spec/2006/int/C/464.h264ref               46.67  -0.39%

geometric mean                                   +0.20%

Manually checked 473 and 471 to verify the diff is in the noise range.

Reviewers: rengolin, davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284757 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CostModel][X86] Fixed AVX1/AVX512 sdiv/udiv uniformconst costs for 256/512 bit integ...
Simon Pilgrim [Thu, 20 Oct 2016 18:00:35 +0000 (18:00 +0000)]
[CostModel][X86] Fixed AVX1/AVX512 sdiv/udiv uniformconst costs for 256/512 bit integer vectors

We weren't checking for uniform const costs before the general cost, resulting in very high estimates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284755 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix *_EXTEND_VECTOR_INREG legalization
Pirama Arumuga Nainar [Thu, 20 Oct 2016 17:56:36 +0000 (17:56 +0000)]
Fix *_EXTEND_VECTOR_INREG legalization

Summary:
While promoting *_EXTEND_VECTOR_INREG nodes whose inputs are already
promoted, perform the appropriate sign extension for the promoted node
before doing the *_EXTEND_VECTOR_INREG operation.  If not, the undefined
high-order bits of the promoted operand may (a) be garbage inc ase of
zext) or (b) contribute the wrong sign-bit (in case of sext)

Updated the promote-vec3.ll test after this change.  The diff shows
explicit zeroing in case of zext and intermediate sign extension in case
of sext.

Reviewers: RKSimon

Subscribers: llvm-commits, srhines

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284752 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CostModel][X86] Added tests for sdiv/udiv costs for uniform const and uniform const...
Simon Pilgrim [Thu, 20 Oct 2016 17:16:38 +0000 (17:16 +0000)]
[CostModel][X86] Added tests for sdiv/udiv costs for uniform const and uniform const power-of-2

Shows poor costings in AVX1/AVX512BW for certain vector types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284748 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Target] remove TargetRecip class; 2nd try
Sanjay Patel [Thu, 20 Oct 2016 16:55:45 +0000 (16:55 +0000)]
[Target] remove TargetRecip class; 2nd try

This is a retry of r284495 which was reverted at r284513 due to use-after-scope bugs
caused by faulty usage of StringRef.

This version also renames a pair of functions:
getRecipEstimateDivEnabled()
getRecipEstimateSqrtEnabled()
as suggested by Eric Christopher.

original commit msg:

[Target] remove TargetRecip class; move reciprocal estimate isel functionality to TargetLowering

This is a follow-up to https://reviews.llvm.org/D24816 - where we changed reciprocal estimates to be function attributes
rather than TargetOptions.

This patch is intended to be a structural, but not functional change. By moving all of the
TargetRecip functionality into TargetLowering, we can remove all of the reciprocal estimate
state, shield the callers from the string format implementation, and simplify/localize the
logic needed for a target to enable this.

If a function has a "reciprocal-estimates" attribute, those settings may override the target's
default reciprocal preferences for whatever operation and data type we're trying to optimize.
If there's no attribute string or specific setting for the op/type pair, just use the target
default settings.

As noted earlier, a better solution would be to move the reciprocal estimate settings to IR
instructions and SDNodes rather than function attributes, but that's a multi-step job that
requires infrastructure improvements. I intend to work on that, but it's not clear how long
it will take to get all the pieces in place.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284746 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoPut the move ctor for PassManager back for now, it breaks some builds.
Benjamin Kramer [Thu, 20 Oct 2016 16:50:07 +0000 (16:50 +0000)]
Put the move ctor for PassManager back for now, it breaks some builds.

For some reason using the default move ctor creates undefined references
to it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284745 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CostModel][X86] Fixed AVX1/AVX512 sdiv/udiv general costs for 256/512 bit integer...
Simon Pilgrim [Thu, 20 Oct 2016 16:39:11 +0000 (16:39 +0000)]
[CostModel][X86] Fixed AVX1/AVX512 sdiv/udiv general costs for 256/512 bit integer vectors

We weren't accounting for legal types on every subtarget, meaning that many of the costs were using defaults.

We still don't correctly cost (or test) the 512-bit sdiv/udiv by uniform const cases, nor the power-of-2 cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284744 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] add fcopysign(f64, f32) pattern
Valery Pykhtin [Thu, 20 Oct 2016 16:17:54 +0000 (16:17 +0000)]
[AMDGPU] add fcopysign(f64, f32) pattern

Differential revision: https://reviews.llvm.org/D25827

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284743 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Support] Put back the MSVC hack for AlignedCharArray.
Benjamin Kramer [Thu, 20 Oct 2016 15:53:04 +0000 (15:53 +0000)]
[Support] Put back the MSVC hack for AlignedCharArray.

MSVC 2015 still errors when passing an alignas'd object by value as an
argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284738 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Support] Remove llvm::alignOf now that all uses are gone.
Benjamin Kramer [Thu, 20 Oct 2016 15:36:38 +0000 (15:36 +0000)]
[Support] Remove llvm::alignOf now that all uses are gone.

Also clean up the legacy hacks for AlignedCharArray. I'm keeping
LLVM_ALIGNAS alive for a bit longer because GCC 4.8.0 (which we still
support apparently) shipped a buggy alignas(). All other supported
compilers have a working alignas.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284736 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRetire llvm::alignOf in favor of C++11 alignof.
Benjamin Kramer [Thu, 20 Oct 2016 15:02:18 +0000 (15:02 +0000)]
Retire llvm::alignOf in favor of C++11 alignof.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284733 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GVN] Use defaulted members. No functional change.
Benjamin Kramer [Thu, 20 Oct 2016 13:09:12 +0000 (13:09 +0000)]
[GVN] Use defaulted members. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284726 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips][mcjit] Add the majority of N32 support.
Simon Dardis [Thu, 20 Oct 2016 13:02:23 +0000 (13:02 +0000)]
[mips][mcjit] Add the majority of N32 support.

The missing piece is relocation composition for %hi(%neg(%gp_rel(x))) and
similar.

Patch by: Daniel Sanders

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284724 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CostModel][X86] Added tests for sdiv/udiv costs for scalar and 128/256/512 bit integ...
Simon Pilgrim [Thu, 20 Oct 2016 12:34:00 +0000 (12:34 +0000)]
[CostModel][X86] Added tests for sdiv/udiv costs for scalar and 128/256/512 bit integer vectors

Shows current bug in AVX1/AVX512BW costs for 256 bit vector types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284723 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDo a sweep over move ctors and remove those that are identical to the default.
Benjamin Kramer [Thu, 20 Oct 2016 12:20:28 +0000 (12:20 +0000)]
Do a sweep over move ctors and remove those that are identical to the default.

All of these existed because MSVC 2013 was unable to synthesize default
move ctors. We recently dropped support for it so all that error-prone
boilerplate can go.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284721 91177308-0d34-0410-b5e6-96231b3b80d8