Commit Graph

149136 Commits

Author SHA1 Message Date
Kyle Butt
e6202480d9 CodeGen: BlockPlacement: Increase tail duplication size for O3.
At O3 we are more willing to increase size if we believe it will improve
performance. The current threshold for tail-duplication of 2 instructions is
conservative, and can be relaxed at O3.

Benchmark results:
llvm test-suite:
6% improvement in aha, due to duplication of loop latch
3% improvement in hexxagon

2% slowdown in lpbench. Seems related, but couldn't completely diagnose.

Internal google benchmark:
Produces 4% improvement on internal google protocol buffer serialization
benchmarks.

Differential-Revision: https://reviews.llvm.org/D32324

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303084 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 17:30:47 +00:00
Simon Pilgrim
2223371da5 [NVPTX] Don't flag StoreParam/LoadParam memory chain operands as ReadMem/WriteMem (PR32146)
Follow up to D33147

NVPTXTargetLowering::LowerCall was trusting the default argument values.

Fixes another 17 of the NVPTX '-verify-machineinstrs with EXPENSIVE_CHECKS' errors in PR32146.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303082 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 17:17:44 +00:00
Hans Wennborg
528105d20c build_llvm_package.bat: Minor updates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 16:50:48 +00:00
Rafael Espindola
699b16c47c Add an extra test for archive symbol tables.
The table should include only defined symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303075 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 15:56:23 +00:00
Simon Pilgrim
0536db2f70 [SLPVectorizer][X86] Add vectorization tests for vXi64/vXi32/vXi16/VXi8 add/sub/mul
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303074 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 15:48:15 +00:00
Florian Hahn
eb48e7d58f [AArch64] Enable FeatureFuseAES on Cortex-A72.
This patch enables fusing dependent AESE/AESMC and AESD/AESIMC
instruction pairs on Cortex-A72, as recommended in the Software
Optimization Guide, section 4.10.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303073 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 15:15:22 +00:00
Dmitry Preobrazhensky
232c3d52ea [AMDGPU][MC] Corrected several VI opcodes to avoid printing _e64
See bug 32936: https://bugs.llvm.org//show_bug.cgi?id=32936

Reviewers: artem.tamazov, vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303070 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 14:28:23 +00:00
Simon Pilgrim
d9a18c3114 [SLPVectorizer][X86] Add vectorization tests for vXi64/vXi32/vXi16/VXi8 shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 14:27:11 +00:00
Dinar Temirbulatov
8632b74d7d Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303059 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 13:14:04 +00:00
Dmitry Preobrazhensky
c42d54906e [AMDGPU][MC] Removed V_MQSAD_U16_U8
This instruction does not really exist

See Bug 33018: https://bugs.llvm.org//show_bug.cgi?id=33018

Reviewers: vpykhtin, artem.tamazov

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303055 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 12:37:03 +00:00
John Brawn
57bb7925b5 [ARM] Mark LEApcrel instructions as isAsCheapAsAMove
Doing this means that if an LEApcrel is used in two places we will rematerialize
instead of generating two MOVs. This is particularly useful for printfs using
the same format string, where we want to generate an address into a register
that's going to get corrupted by the call.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303054 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 11:57:54 +00:00
John Brawn
91719efd8f [ARM] Mark LEApcrel as not having side effects
Doing this lets us hoist it out of loops, and I've also marked it as
rematerializable the same as the thumb1 and thumb2 counterparts.

It looks like it being marked as such was just a mistake, as the commit that
made that change only mentions LEApcrelJT and in thumb1 and thumb2 only the
LEApcrelJT instructions were marked as having side-effects, so it looks like
the intent was to only mark LEApcrelJT as having side-effects but LEApcrel was
accidentally marked as such also.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303053 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 11:50:21 +00:00
George Rimar
fbe48085e6 [DWARF] - Speedup handling of relocations in DWARFContextInMemory.
I am working on a speedup of building .gdb_index in LLD and 
noticed that relocations that are proccessed in DWARFContextInMemory often uses
the same symbol in a row. This patch introduces caching to reduce the relocations
proccessing time.

For benchmark,
I took debug LLC binary objects configured with -ggnu-pubnames and linked it using LLD.

Link time without --gdb-index is about 4,45s.
Link time with --gdb-index: a) Without patch: 19,16s b) With patch: 15,52s
That means time spent on --gdb-index in this configuration is 
19,16s - 4,45s = 14,71s (without patch) vs 15,52s - 4,45s = 11,07s (with patch).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303051 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 11:45:28 +00:00
Ayman Musa
eadb58fda7 [X86] Relocate code of replacement of subtarget unsupported masked memory intrinsics to run also on -O0 option.
Currently, when masked load, store, gather or scatter intrinsics are used, we check in CodeGenPrepare pass if the subtarget support these intrinsics, if not we replace them with scalar code - this is a functional transformation not an optimization (not optional).

CodeGenPrepare pass does not run when the optimization level is set to CodeGenOpt::None (-O0).

Functional transformation should run with all optimization levels, so here I created a new pass which runs on all optimization levels and does no more than this transformation.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303050 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 11:30:54 +00:00
Simon Pilgrim
a7e79eeb41 [NVPTX] Don't rely on default arguments to SelectionDAG::getMemIntrinsicNode. NFC.
NFC followup to D33147, this explicitly sets all the arguments (instead of relying on the defaults) to SelectionDAG::getMemIntrinsicNode to help identify -verify-machineinstrs issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303047 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 10:47:48 +00:00
Sam Kolton
5188cfa18e [TableGen] Add EncoderMethod to RegisterOperand
Reviewers: stoklund, grosbach, vpykhtin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303044 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 10:13:07 +00:00
Tom Stellard
d0d956ae31 [RegisterBankInfo] Remove overly-agressive asserts
Summary:
We were asserting in RegisterBankInfo if RBI.copyCost() returns
UINT_MAX.  This is OK for RegBankSelect::Mode::Fast since we only
try one instruction mapping and can't recover from this, but for
RegBankSelect::Mode::Greedy we will be considering multiple
instruction mappings, so we can recover if we see a UNIT_MAX copy
cost.

The copy cost for one pair of register banks in the AMDGPU backend
will be UNIT_MAX, so this patch will prevent AMDGPU tests from
breaking.

Reviewers: ab, qcolombet, t.p.northover, dsanders

Reviewed By: qcolombet

Subscribers: tpr, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303043 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 09:52:33 +00:00
Tom Stellard
af79e4116c CMake: Fix docs-llvm-man target when clang+llvm is in the same source tree
Summary:
This was broken by r302499.  Configuring with -DLLVM_BUILD_DOCS=ON would
cause the docs-llvm-man target not to be created.

Reviewers: anemet, beanz

Reviewed By: anemet

Subscribers: llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 09:34:23 +00:00
Arnaud A. de Grandmaison
d49739e03c MCObjectStreamer : fail with a diagnostic when emitting an out of range value.
We were previously silently emitting bogus data in release mode,
making it very hard to diagnose the error, or crashing with an
assert in debug mode. A proper diagnostic is now always emitted
when the value to be emitted is out of range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 08:43:27 +00:00
Igor Breger
4448b5e925 [GlobalISel][X86] G_BR instruction select test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303036 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 07:03:38 +00:00
Craig Topper
32a237d8c0 [ValueTracking] Replace all uses of ComputeSignBit with computeKnownBits.
This patch finishes off the conversion of ComputeSignBit to computeKnownBits.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303035 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 06:39:41 +00:00
Daniel Jasper
89bddde655 Add '#' to test regex that I forgot in r303025.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303034 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 04:58:27 +00:00
Craig Topper
66563ce6a9 [ConstantRange] Fix what appear to be copy and paste mistakes in the unittest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 04:40:19 +00:00
Sanjoy Das
eb82b46cf4 Move some code into ScalarEvolution.cpp; NFC
I need to add some asserts to these constructors that are easier to
add once they're in the .cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303032 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 04:22:09 +00:00
Craig Topper
b2bc907841 [InstCombine] Merge duplicate functionality between InstCombine and ValueTracking
Summary:
Merge overflow computation for signed add,
appearing both in InstCombine and ValueTracking.

As part of the merge,
cleanup the interface for overflow checks in InstCombine.

Patch by Yoav Ben-Shalom.

Reviewers: craig.topper, majnemer

Reviewed By: craig.topper

Subscribers: takuto.ikuta, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 02:44:08 +00:00
Craig Topper
28de70efae [InstCombine] Remove 'return' of a called function that also returned void. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303028 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 02:30:27 +00:00
Daniel Jasper
a0f2a7c2de Fix two tests that weren't correctly copied.
One didn't correctly fine the regex variable, the other still had a RUN
line for FNOBUILTIN-checks, which weren't copied to the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303025 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 22:07:50 +00:00
Zvi Rackover
1e086f7a92 [X86] Utilize SelectionDAG::getSelect(). NFC.
Replace SelectionDAG::getNode(ISD::SELECT, ...)
and SelectionDAG::getNode(ISD::VSELECT, ...)
with SelectionDAG::getSelect(...)
Saves a few lines of code and in some cases saves the need to explicitly
check the type of the desired node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303024 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 21:30:38 +00:00
Simon Pilgrim
18a1f6e5cf [X86][AVX1] Account for cost of extract/insert of 256-bit shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303023 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 20:52:11 +00:00
Simon Pilgrim
0086ec9443 [X86][AVX2] Fix costs for v4i64 ashr by splat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303022 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 20:25:42 +00:00
Simon Pilgrim
1ce51ae933 [X86][AVX1] Account for cost of extract/insert of 256-bit shifts by splat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303021 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 20:02:34 +00:00
Craig Topper
ac7c8ceef7 [X86] Add avx512vl command lines to the 128/256-bit vector-lzcnt tests so we can see what compare instructions are being used in the lookup table code.
I noticed the 512-bit lzcnts don't use the X86 specific lookup table code and instead use the EXPAND case in LegalizeDAG. I was toying around with fixing this and noticed it would require compare instructions that generate i1 masks and then converting from mask to vector. Then I noticed that we don't test which compares are used with avx512vl and no avx512cd.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303020 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 19:38:11 +00:00
Craig Topper
eba544c71c [X86] Cleanup some of the check-prefixes in the vector-lzcnt tests.
Remove an unneeded prefix from the 32-bit command line. Make all the 64-bit triples match. Replace ALL with X64 and remove it from the 32-bit test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303019 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 19:38:09 +00:00
Craig Topper
3cf7734d13 [X86] Remove unused value from IntrinsicType enum. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303018 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 19:38:06 +00:00
Simon Pilgrim
3f74b0ee2c [X86][AVX1] Account for cost of extract/insert of 256-bit SDIV/UDIV by mul sequences
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303017 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 18:52:15 +00:00
Dimitry Andric
a435f21458 Fix DynamicLibraryTest.cpp on FreeBSD and NetBSD
Summary:

After rL301562, on FreeBSD the DynamicLibrary unittests fail, because
the test uses getMainExecutable("DynamicLibraryTests", Ptr), and since
the path does not contain any slashes, retrieving the main executable
will not work.

Reimplement getMainExecutable() for FreeBSD and NetBSD using sysctl(3),
which is more reliable than fiddling with relative or absolute paths.

Also add retrieval of the original argv[] from the GoogleTest framework,
to use as a fallback for other OSes.

Reviewers: emaste, marsupial, hans, krytarowski

Reviewed By: krytarowski

Subscribers: krytarowski, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303015 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 18:35:38 +00:00
Shoaib Meenai
61e19cf8a4 [COFF] Gracefully handle empty .drectve sections
Running `llvm-readobj -coff-directives msvcrt.lib` resulted in this error:

    Invalid data was encountered while parsing the file

This happened because some of the object files in the archive have empty
`.drectve` sections. These empty sections result in a `parse_failed` error being
returned from `COFFObjectFile::getSectionContents()`, which in turn caused
`llvm-readobj` to stop. With this change, `getSectionContents` now returns
success, and like before the resulting array is empty.

Patch by Dave Lee.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 18:34:56 +00:00
Simon Pilgrim
40a0941bb9 [X86][XOP] XOP's general v16i8 shifts will be used instead of v8i16 shift + mask.
Tweak cost model to match what lowering actually does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303013 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 17:59:46 +00:00
Simon Pilgrim
7adcab9058 [X86][SSE] Account for cost of extract/insert of v32i8 vector shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 17:36:07 +00:00
Zachary Turner
1ccd7cfa2b [StringExtras] Add llvm::to_integer.
This is a very thin wrapper around StringRef::getAsInteger.
It serves three purposes.

1) It allows a cleaner syntax when you have something other than
   a StringRef - for example, a std::string or an llvm::SmallString.
   Previously, in this case you would have to write something like:
      StringRef(MyStr).getAsInteger(0, Result)
   by explicitly constructing a temporary StringRef.  This can be
   done implicitly however with the new function by just writing:
      to_integer(MyStr, ...).
2) Correcting the travesty that is getAsInteger's return value.
   This function returns true on success, and false on failure.
   While this may cause confusion with people familiar with the
   getAsInteger API, there seems to be widespread agreement that
   the return semantics of getAsInteger was a mistake.
3) It allows the Radix to be deduced as a default argument by
   putting it last in the parameter list.  Most uses of getAsInteger
   pass 0 for the first argument.  With this syntax it can just be
   omitted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303011 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 17:11:05 +00:00
Simon Pilgrim
90e60b5e99 [X86][XOP] Account for cost of extract/insert of 256-bit vector shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303010 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 13:38:53 +00:00
Simon Pilgrim
8390fe6ccf [X86][AVX] Allow 32-bit targets to peek through subvectors to extract constant splats for vXi64 shifts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303009 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 11:46:26 +00:00
Simon Pilgrim
dc5d066e45 [X86][AVX] Add additional 32-bit target vector shift tests
Shows issue with 32-bits not being able to peek through subvectors to extract constant splats

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303008 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 11:13:03 +00:00
Sylvestre Ledru
9775111940 update of the url
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303005 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 07:55:01 +00:00
Craig Topper
462d5d6cc2 [InstSimplify] Add patterns for folding (A & B) | (~A ^ B) -> (~A ^ B) and its commuted variants.
We already had (A & ~B) | (A ^ B), but we missed the cases where the not was part of the xor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303004 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 07:54:43 +00:00
Craig Topper
b72b7c24b7 foo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303003 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 07:54:40 +00:00
Craig Topper
94b63a884e [BasicAA] Alphabetize includes. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303002 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 06:18:34 +00:00
Xinliang David Li
d72fa38136 Renable test that was disabled due to cost analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 02:58:39 +00:00
Xinliang David Li
affec73618 Fix test failure on windows -- do not return deleted func
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 02:54:02 +00:00
Zachary Turner
4afda8f7b6 [llvm-pdbdump] Add the option to sort functions and data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302998 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-14 01:13:40 +00:00