142413 Commits

Author SHA1 Message Date
Bjorn Pettersson
0fd1a2cc65 [CodeGen] Make MachineInstr::isIdenticalTo() symmetric.
Summary:
MachineInstr::isIdenticalTo() is for some reason not
symmetric when comparing bundles, which gives us the
property:

  I1->isIdenticalTo(*I2) != I2->isIdenticalTo(*I1)

when comparing bundles where one bundle is longer than
the other.

This patch makes sure that bundles of different length
always are considered as not being identical. Thus, the
result of the comparison will be the same regardless of
which side that happens to be to the left.

Reviewers: dexonsmith, jonpa, andrew.w.kaylor

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 11:20:57 +00:00
Dean Michael Berris
62e99e136f [XRay] Fix assertion failure on empty machine basic blocks (PR 31424)
The original version of the code in XRayInstrumentation.cpp assumed that
functions may not have empty machine basic blocks (or that the first one
couldn't be). This change addresses that by special-casing that specific
situation.

We provide two .mir test-cases to make sure we're handling this
appropriately.

Fixes llvm.org/PR31424.

Reviewers: chandlerc

Subscribers: varno, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 09:20:38 +00:00
Craig Topper
5d0801a268 [X86] When recognizing vector loads or VZEXT_LOAD in selectScalarSSELoad make sure we pass the load's user rather than load itself to the second operand of IsLegalToFold.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 08:35:56 +00:00
Craig Topper
7e2d9b02d8 [TableGen] Use 'unsigned' instead of 'bool' in a place where the code conditionally assigns numeric values. They happen to be 0 and 1 so this is NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 08:35:08 +00:00
Daniel Jasper
47d6abcc05 Add files I seem to have dropped in my revert (r290086).
Sorry!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 08:32:13 +00:00
Daniel Jasper
8de3a54f07 Revert @llvm.assume with operator bundles (r289755-r289757)
This creates non-linear behavior in the inliner (see more details in
r289755's commit thread).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 08:22:17 +00:00
Craig Topper
1caa82053c [X86] Remove all of the patterns that use X86ISD:FAND/FXOR/FOR/FANDN except for the ones needed for SSE1. Anything SSE2 or above uses the integer ISD opcode.
This removes 11721 bytes from the DAG isel table or 2.2%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 00:42:28 +00:00
Tom de Vries
717d868685 [FileCheck] Fix --strict-whitespace --match-full-lines -- add test-case
Add test-case that was missing in "[FileCheck] Fix --strict-whitespace
--match-full-lines" commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 21:04:47 +00:00
Tom de Vries
8d31c8a13a [FileCheck] Fix --strict-whitespace --match-full-lines
Make sure FileCheck --strict-whitespace --match-full-lines translates
'CHECK: bla ' into pattern '^ bla $' instead of pattern '^bla$'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 20:45:59 +00:00
David Majnemer
bd807b784e [PDB] Don't use the long type
Long is not the same size across a number of the platforms we support.
Use unsigned int here instead, it is more appropriate because
overflow/wrap-around is possible and, in this case, expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 20:10:50 +00:00
Sanjay Patel
6fd764e6d9 [InstCombine] use commutative matchers for patterns with commutative operators
Background/motivation - I was circling back around to:
https://llvm.org/bugs/show_bug.cgi?id=28296

I made a simple patch for that and noticed some regressions, so added test cases for
those with rL281055, and this is hopefully the minimal fix for just those cases.

But as you can see from the surrounding untouched folds, we are missing commuted patterns
all over the place, and of course there are no regression tests to cover any of those cases.

We could sprinkle "m_c_" dust all over this file and catch most of the missing folds, but 
then we still wouldn't have test coverage, and we'd still miss some fraction of commuted 
patterns because they require adjustments to the match order.

I'm aware of the concern about the potential compile-time performance impact of adding 
matches like this (currently being discussed on llvm-dev), but I don't think there's any
evidence yet to suggest that handling commutative pattern matching more thoroughly is not
a worthwhile goal of InstCombine.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290067 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 18:49:48 +00:00
Daniel Jasper
43d95abf3f Revert r289955 and r289962. This is causing lots of ASAN failures for us.
Not sure whether it causes and ASAN false positive or whether it
actually leads to incorrect code or whether it even exposes bad code.
Hans, I'll get you instructions to reproduce this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 14:36:38 +00:00
Michael Zuckerman
1a2b5e0641 [X86] [AVX512] Minor fix in encoding of scalar EVEX instructions. NFC.
Commit on behalf of Gadi Haber  

Removed EVEX_V512 prefix from scalar EVEX instructions since HW ignores L'L bits anyway (LIG). 4 instructions are modified.
The changed encodings are validated with XED.
Rviewers: delena, igorb

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 14:29:00 +00:00
Simon Pilgrim
06557aae22 [X86][SSE] Add support for combining target shuffles to SHUFPS.
As discussed on D27692, the next step will be to allow cross-domain shuffles once the combined shuffle depth passes a certain point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 14:26:02 +00:00
Tom de Vries
9cbd609664 [FileCheck] Fix comment in ReadCheckFile
The comment in ReadCheckFile claims that both leading and trailing whitespace
are removed, but the associated statement only removes leading whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290061 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 09:41:20 +00:00
Craig Topper
abfa815607 [X86][SSE][AVX-512] Convert FAND/FOR/FXOR/FANDN nodes to integer operations if they are available. This will allow a bunch of patterns to be removed.
These nodes are only emitted for lowering FABS/FNEG/FNABS/FCOPYSIGN. Ideally we just wouldn't create these nodes if SSE2 or higher is available, but it was simple to just convert them in DAG combine.

For SSE2, AVX, and AVX512 with DQI this is no functional change as the execution domain fixing pass ensures the right domain is selected regardless of the ISD opcode.

For AVX-512 without DQI we end up using integer instructions since the floating point versions aren't available. But we were already doing that for any logical operations in code that didn't come from FABS/FNEG/FNABS/FCOPYSIGN so this seems no worse. And we get the benefit of being able to fold broadcasts now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 07:54:23 +00:00
Craig Topper
f28829d488 [AVX-512] Use EVEX encoded XOR instruction for zeroing scalar registers when DQI and VLX instructions are available.
This can give the register allocator more registers to use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 06:23:14 +00:00
Craig Topper
cbfbeeef12 [AVX-512] Make sure VLX is also enabled before using EVEX encoded logic ops for scalars. I missed this in r290049.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290055 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 04:17:00 +00:00
David Majnemer
3ce578abed [PDB] Don't reimplement CRC32
We already have a CRC32 implementation which is compatible with the PDB
hash, reuse it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 00:41:15 +00:00
David Majnemer
9b671f3db3 [PDB] Validate superblock addresses
- Validate the address of the block map.
- Validate the address of the free block map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 00:41:10 +00:00
Matt Arsenault
0f11f29f4b AMDGPU: Fix broken check prefix in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 20:03:59 +00:00
Craig Topper
226ab62dea [AVX-512] Use EVEX encoded logic operations for scalar types when they are available. This gives the register allocator more registers to work with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 19:26:00 +00:00
Craig Topper
9f7b68dc8e [AVX-512] Update scalar logic test to show missed opportunity to use EVEX encoded logic instructions to get more registers to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 19:25:55 +00:00
Matthias Braun
9e6cedb0a4 Revert "AArch64CollectLOH: Rewrite as block-local analysis."
It is still breaking Chrome. http://llvm.org/PR31361

This reverts commit r290026.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290047 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 18:53:11 +00:00
Craig Topper
0f5f69acca [InstCombine] Simplify code slightly. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 18:10:04 +00:00
Daniel Jasper
a21e8a0091 Revert "[libFuzzer] add an experimental flag -experimental_len_control=1 that sets max_len to 1M and tries to increases the actual max sizes of mutations very gradually. Also remove a bit of dead code"
This reverts commit r289998.

See comment:
https://reviews.llvm.org/rL289998

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 12:27:49 +00:00
George Rimar
ffeebac4fe [DWARF] - Make PubIndexEntryDescriptor::toBits() to be const.
That is usefull when iterating over entries of new DWARFDebugPubTable class
via DWARFDebugPubTable::getData which returns ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290041 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 10:15:39 +00:00
George Rimar
4a6e931a93 [DWARF] - Introduce DWARFDebugPubTable class for dumping pub* sections.
Patch implements parser of pubnames/pubtypes tables instead of static 
function used before. It is now should be possible to reuse it
in LLD or other projects and clean up the duplication code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 09:10:32 +00:00
Kostya Serebryany
cc82ac2f3b [libFuzzer] use less memory for merge
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290039 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 08:20:24 +00:00
Tom Stellard
be186acae3 Add custom type for PseudoSourceValue
Summary:
PseudoSourceValue can be used to attach a target specific value for "well behaved" side-effects lowered from target specific intrinsics.
This is useful whenever there is not an LLVM IR Value around when representing such "well behaved" side-effected operations in backends by attaching a MachineMemOperand with a custom PseudoSourceValue as this makes the scheduler not treating them as "GlobalMemoryObjects" which triggers a logic that makes the operation act like a barrier in the Schedule DAG.

This patch adds another Kind to the PseudoSourceValue object which is "TargetCustom". It indicates a type of PseudoSourceValue that has a target specific meaning (aka. LLVM shouldn't assume any specific usage for such a PSV).

It supports the possibility of having many different kinds of "TargetCustom" PseudoSourceValues.

We had a discussion about if this was valuable or not (in particular because there was a believe that PSV were going away sooner or later) but seems like they are not going anywhere and I think they are useful backend side.

It is not clear the interaction of this with MIRParser (do we need a target hook to parse these?) and I would like a comment from Alex about that :)

Reviewers: arphaman, hfinkel, arsenm

Subscribers: Eugene.Zelenko, llvm-commits

Patch By: Marcello Maggioni

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 04:41:53 +00:00
Peter Collingbourne
67cf22546a ADT: Add a getArrayRef() accessor to MapVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 04:04:18 +00:00
Kostya Serebryany
dbf288304b [libFuzzer] speed up __sanitizer_cov_trace_switch a bit more (remove DIV)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 02:23:35 +00:00
Kostya Serebryany
99cbf23989 [libFuzzer] remove stale test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 02:18:59 +00:00
Matthias Braun
2d747dda15 Move test to correct directory
See also test/CodeGen/MIR/README

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290032 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 02:16:26 +00:00
Kostya Serebryany
fdff3a8925 [libFuzzer] when tracing switch statements, handle only one case at a time (to make things faster). Also ensure that the signals from value profile do not intersect with the regular coverage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 02:03:34 +00:00
Evgeniy Stepanov
0fe21065dd Revert "[GVNHoist] Move GVNHoist to function simplification part of pipeline."
This reverts r289696, which caused TSan perf regression.

See PR31382.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 01:53:15 +00:00
Evgeniy Stepanov
af2bc9ba6b Fix compilation.
unittests/ADT/TwineTest.cpp:106:38: error: field 'Count' will be initialized after base 'llvm::FormatAdapter<int>' [-Werror,-Wreorder]
    explicit formatter(int &Count) : Count(Count), FormatAdapter(0) {}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 01:31:46 +00:00
Eugene Zelenko
c961a1dd4b [Hexagon] Other attempt to fix build with enabled asserts broken in 290024 (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 01:29:35 +00:00
Eugene Zelenko
2fc0cc3ad9 [Hexagon] Fix build with enabled asserts broken in 290024 (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 01:17:18 +00:00
Matthias Braun
d5a8735657 AArch64CollectLOH: Rewrite as block-local analysis.
Re-apply r288561: Liveness tracking should be correct now after r290014.

Previously this pass was using up to 5% compile time in some cases which
is a bit much for what it is doing. The pass featured a full blown
data-flow analysis which in the default configuration was restricted to a
single block.

This rewrites the pass under the assumption that we only ever work on a
single block. This is done in a single pass maintaining a state machine
per general purpose register to catch LOH patterns.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 01:15:59 +00:00
Eugene Zelenko
d24b18f667 [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 01:09:05 +00:00
Vedant Kumar
318da2344f Retry: [BPI] Use a safer constructor to calculate branch probabilities
BPI may trigger signed overflow UB while computing branch probabilities for
cold calls or to unreachables. For example, with our current choice of weights,
we'll crash if there are >= 2^12 branches to an unreachable.

Use a safer BranchProbability constructor which is better at handling fractions
with large denominators.

Changes since the initial commit:
  - Use explicit casts to ensure that multiplication operands are 64-bit
    ints.

rdar://problem/29368161

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290022 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 01:02:08 +00:00
Zachary Turner
8739616ad2 Delete unused file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 00:58:19 +00:00
Zachary Turner
d69dfb10b7 Add support for formatv to llvm::Twine.
Differential Revision: https://reviews.llvm.org/D27835

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 00:38:15 +00:00
Vedant Kumar
a908bbaf8d Revert "[BPI] Use a safer constructor to calculate branch probabilities"
This reverts commit r290016. It breaks this bot, even though the test
passes locally:

  http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/32956/

AnalysisTests: /home/bb/ninja-x64-msvc-RA-centos6/llvm-project/llvm/lib/Support/BranchProbability.cpp:52: static llvm::BranchProbability llvm::BranchProbability::getBranchProbability(uint64_t, uint64_t): Assertion `Numerator <= Denominator && "Probability cannot be bigger than 1!"' failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 00:19:06 +00:00
Mike Aizatsky
48d47ae3d9 [libfuzzer] removing experimental FuzzerFnAdapter
Summary: This is superceded by protobuf mutation work.

Reviewers: kcc

Subscribers: mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 00:12:13 +00:00
Mike Aizatsky
77972972a3 [sancov] skip dead files from computations
Differential Revision: https://reviews.llvm.org/D27863

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 00:11:48 +00:00
Vedant Kumar
9d419abb73 [BPI] Use a safer constructor to calculate branch probabilities
BPI may trigger signed overflow UB while computing branch probabilities
for cold calls or to unreachables. For example, with our current choice
of weights, we'll crash if there are >= 2^12 branches to an unreachable.

Use a safer BranchProbability constructor which is better at handling
fractions with large denominators.

rdar://problem/29368161

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 00:09:51 +00:00
Lang Hames
67f0925dfd [ORC][RPC] Use more meaningful template parameter names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 00:04:24 +00:00
Matthias Braun
5a5039a237 AArch64: Enable post-ra liveness updates
Differential Revision: https://reviews.llvm.org/D27559

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290014 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 23:55:43 +00:00