142589 Commits

Author SHA1 Message Date
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
Matthias Braun
fe82f4a18b BranchRelaxation: Recompute live-ins when splitting a block
Factors out and reuses live-in computation code from BranchFolding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 23:55:37 +00:00
Paul Robinson
c8eb7f38e3 Allow "line 0" to be the first explicit debug location in a function.
Feedback on r289468 from Adrian Prantl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 23:54:33 +00:00
David Blaikie
980f5c56b4 GDB pretty printers: Basic DenseMap support
Still prints the empty/tombstone keys (which some people would prefer,
but I find pretty noisy) because I haven't yet found a reliable way to
skip them (it requires calling into the running process to do so, which
isn't ideal for a pretty printer (doesn't work on a core file, for
example) - and gdb's ability to do so (or my ability to figure out how
to get gdb to do so) is limited) left some breadcrumbs for the next
person who might try to address that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 23:53:14 +00:00
Peter Collingbourne
95a614c350 ModuleSummaryAnalysis: Remove some duplicate code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 23:19:02 +00:00
Kevin Enderby
398ecdfe0a Fix a bugs with using some Mach-O command line flags like "-arch armv7m".
The Mach-O command line flag like "-arch armv7m" does not match the
arch name part of its llvm Triple which is "thumbv7m-apple-darwin”.

I think the best way to fix this is to have
llvm::object::MachOObjectFile::getArchTriple() optionally return the
name of the Mach-O arch flag that would be used with -arch that
matches the CPUType and CPUSubType.  Then change
llvm::object::MachOUniversalBinary::ObjectForArch::getArchTypeName()
to use that and change it to getArchFlagName() as the type name is
really part of the Triple and the -arch flag name is a Mach-O thing
for a specific Triple with a specific Mcpu value.

rdar://29663637


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290001 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 22:54:02 +00:00
Zachary Turner
3b75dc7441 Resubmit "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."
The original patch was broken due to some undefined behavior
as well as warnings that were triggering -Werror.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 22:48:14 +00:00
Kostya Serebryany
c7ab3c7402 [libFuzzer] avoid msan false positives in more cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 22:45:25 +00:00
Kostya Serebryany
eb30028464 [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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289998 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 22:42:05 +00:00
Teresa Johnson
f638013746 [ThinLTO] Import composite types as declarations
Summary:
When reading the metadata bitcode, create a type declaration when
possible for composite types when we are importing. Doing this in
the bitcode reader saves memory. Also it works naturally in the case
when the type ODR map contains a definition for the same composite type
because it was used in the importing module (buildODRType will
automatically use the existing definition and not create a type
declaration).

For Chromium built with -g2, this reduces the aggregate size of the
generated native object files by 66% (from 31G to 10G). It reduced
the time through the ThinLTO link and backend phases by about 20% on
my machine.

Reviewers: mehdi_amini, dblaikie, aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 21:25:01 +00:00
Michael Kuperstein
569cd219c7 Preserve loop metadata when folding branches to a common destination.
Differential Revision: https://reviews.llvm.org/D27830


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289992 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 21:23:59 +00:00
Jun Bum Lim
4d9c93dc3f [CodeGenPrep] Skip merging empty case blocks
This is recommit of r287553 after fixing the invalid loop info after eliminating an empty block and unit test failures in AVR and WebAssembly :

Summary: Merging an empty case block into the header block of switch could cause ISel to add COPY instructions in the header of switch, instead of the case block, if the case block is used as an incoming block of a PHI. This could potentially increase dynamic instructions, especially when the switch is in a loop. I added a test case which was reduced from the benchmark I was targetting.

Reviewers: t.p.northover, mcrosier, manmanren, wmi, joerg, davidxl

Subscribers: joerg, qcolombet, danielcdh, hfinkel, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 20:38:39 +00:00
Sanjoy Das
0499c46012 Inline stripInvariantGroupMetadata out of existence
As a one liner function, I don't think it is pulling its weight in terms
of helping readability.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 20:29:39 +00:00
Adrian Prantl
096faa974a Revert "[IR] Remove the DIExpression field from DIGlobalVariable."
This reverts commit 289920 (again).
I forgot to implement a Bitcode upgrade for the case where a DIGlobalVariable
has not DIExpression. Unfortunately it is not possible to safely upgrade
these variables without adding a flag to the bitcode record indicating which
version they are.
My plan of record is to roll the planned follow-up patch that adds a
unit: field to DIGlobalVariable into this patch before recomitting.
This way we only need one Bitcode upgrade for both changes (with a
version flag in the bitcode record to safely distinguish the record
formats).

Sorry for the churn!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:39:01 +00:00
Zachary Turner
56bfe966c9 Revert "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."
This reverts commit r289978, which is failing due to some rebase/merge
issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:25:23 +00:00
Mehdi Amini
fa4c53ef2b Fix comment on the verifier (typo + doxygen) (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:24:13 +00:00
Zachary Turner
b6ef4f69db [CodeView] Hook CodeViewRecordIO for reading/writing symbols.
This is the 3rd of 3 patches to get reading and writing of
CodeView symbol and type records to use a single codepath.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:20:35 +00:00
Mehdi Amini
ce07e02348 Strip invalid TBAA when reading bitcode
This ensures backward compatibility on bitcode loading.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:16:29 +00:00
David Blaikie
4bdcc320cf GDB pretty printer for llvm::Optional
(some other implementations of an optional pretty printer print the full
name of the optional type (including template parameter) - but seems if
the template parameter isn't printed for std::vector, not sure why it
would be printed for optional, so erring on the side of consistency in
that direction here - compact, etc, as well)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:16:22 +00:00
Matthew Simpson
3499b6e23b Reapply "[LV] Enable vectorization of loops with conditional stores by default"
This patch reapplies r289863. The original patch was reverted because it
exposed a bug causing the loop vectorizer to crash in the Python runtime on
PPC. The underlying issue was fixed with r289958.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:12:02 +00:00
Krzysztof Parzyszek
308c60d0cb Implement LaneBitmask::any(), use it to replace !none(), NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 19:11:56 +00:00
Sanjoy Das
83c8485899 Fix CodeGenPrepare::stripInvariantGroupMetadata
`dropUnknownNonDebugMetadata` takes a list of "known" metadata IDs.  The
only reason it worked at all is that `getMetadataID` returns something
unrelated -- it returns the subclass ID of the receiver (which is used
in `dyn_cast` etc.).  That does not numerically match
`LLVMContext::MD_invariant_group` and ends up dropping `invariant_group`
along with every other metadata that does not numerically match
`LLVMContext::MD_invariant_group`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 18:52:33 +00:00
Eli Friedman
59768451f2 [ARM] Add ARMISD::VLD1DUP to match vld1_dup more consistently.
Currently, there are substantial problems forming vld1_dup even if the
VDUP survives legalization. The lack of an actual node
leads to terrible results: not only can we not form post-increment vld1_dup
instructions, but we form scalar pre-increment and post-increment
loads which force the loaded value into a GPR. This patch fixes that
by combining the vdup+load into an ARMISD node before DAGCombine
messes it up.

Also includes a crash fix for vld2_dup (see testcase @vld2dupi8_postinc_variable).

Recommiting with fix to avoid forming vld1dup if the type of the load
doesn't match the type of the vdup (see
https://llvm.org/bugs/show_bug.cgi?id=31404).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 18:44:08 +00:00
Joel Jones
a07f27643c Fix name typo in SelectonDAG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289969 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 18:22:54 +00:00
Matt Arsenault
af63556c06 AMDGPU: Fix name for v_ashrrev_i16
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-16 17:40:11 +00:00