3709 Commits

Author SHA1 Message Date
Paul Robinson
87764e1e35 Revert "Recommit "[DWARFv5] Dump an MD5 checksum in the line-table header.""
This reverts commit 0afef672f63f0e4e91938656bc73424a8c058bfc.
Still failing at runtime on bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15 23:21:52 +00:00
Paul Robinson
bee91d7634 Recommit "[DWARFv5] Dump an MD5 checksum in the line-table header."
Adds missing support for DW_FORM_data16.

Update of r320852, fixing the unittest to use a hand-coded struct
instead of std::array to guarantee data layout.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320886 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15 22:57:17 +00:00
Matthias Braun
dfcb4f5344 MachineFunction: Slight refactoring; NFC
Slight cleanup/refactor in preparation for upcoming commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15 22:22:46 +00:00
Paul Robinson
86e9c5d8a8 Revert "[DWARFv5] Dump an MD5 checksum in the line-table header."
Unit test fails on some bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15 20:29:25 +00:00
Paul Robinson
17486de5d0 [DWARFv5] Dump an MD5 checksum in the line-table header.
Adds missing support for DW_FORM_data16.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15 19:52:34 +00:00
Evandro Menezes
5ab8b4581e [Unit][AArch64] Additional tests for target parsing
Add Exynos M2/M3 to extension check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 23:13:04 +00:00
Francis Visoiu Mistrih
ee30ab7184 [CodeGen] Print MCSymbol operands as <mcsymbol sym> in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`<mcsymbol sym>` instead of `<MCSym=sym>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:03:23 +00:00
Francis Visoiu Mistrih
f726becf7c [CodeGen] Move printing MO_Metadata operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:03:18 +00:00
Francis Visoiu Mistrih
f6cd582907 [CodeGen] Print live-out register lists as liveout(...) in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`liveout(...)` instead of `<regliveout>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320683 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:03:14 +00:00
Francis Visoiu Mistrih
3f63013fb4 [CodeGen] Print global addresses as @foo in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`@foo` instead of `<ga:@foo>`.

Also print target flags in the MIR format since most of them are used on
global address operands.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:03:09 +00:00
Francis Visoiu Mistrih
d398775f54 [CodeGen] Print external symbols as $symbol in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`$symbol` instead of `<es:symbol>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:02:58 +00:00
Michael Zolotukhin
16872e2b56 Remove redundant includes from unittests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 21:31:05 +00:00
Igor Laevsky
a3d1ab8186 [FuzzMutate] Only generate loads and stores to the first class sized types
Differential Revision: https://reviews.llvm.org/D41109



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320573 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 11:49:04 +00:00
Igor Laevsky
95edead4fe [FuzzMutate] Avoid zero sized aggregates
Differential Revision: https://reviews.llvm.org/D41110



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320572 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 11:47:35 +00:00
Igor Laevsky
033683a63f [FuzzMutate] Correctly split landingpad blocks
Differential Revision: https://reviews.llvm.org/D41112



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 11:45:53 +00:00
Francis Visoiu Mistrih
d347e9783d [CodeGen] Print jump-table index operands as %jump-table.0 in both MIR and debug output
Work towards the unification of MIR and debug output by printing `%jump-table.0` instead of `<jt#0>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320566 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:30:59 +00:00
Francis Visoiu Mistrih
2b16863067 [CodeGen] Print target index operands as target-index(target-specific) + 8 in both MIR and debug output
Work towards the unification of MIR and debug output by printing `target-index(target-specific) + 8` instead of `<ti#0+8>` and `target-index(target-specific) + 8` instead of `<ti#0-8>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:30:51 +00:00
Francis Visoiu Mistrih
c84690975a [CodeGen] Print constant pool index operands as %const.0 + 8 in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`%const.0 + 8` instead of `<cp#0+8>` and `%const.0 - 8` instead of
`<cp#0-8>`.

Only debug syntax is affected.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:30:45 +00:00
Pavel Labath
1f8ac167fe [Testing/Support] Make the HasValue matcher composable
Summary:
This makes it possible to run an arbitrary matcher on the value
contained within the Expected<T> object.

To do this, I've needed to fully spell out the matcher, instead of using
the shorthand MATCHER_P macro.

The slight gotcha here is that standard template deduction will fail if
one tries to match HasValue(47) against an Expected<int &> -- the
workaround is to use HasValue(testing::Eq(47)).

The explanations produced by this matcher have changed a bit, since now
we delegate to the nested matcher to print the value. Since these don't
put quotes around the value, I've changed our PrintTo methods to match.

Reviewers: zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:00:38 +00:00
Matthias Braun
fa621d294f Rename LiveIntervalAnalysis.h to LiveIntervals.h
Headers/Implementation files should be named after the class they
declare/define.

Also eliminated an `#include "llvm/CodeGen/LiveIntervalAnalysis.h"` in
favor of `class LiveIntarvals;`

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320546 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 02:51:04 +00:00
Alexandre Ganea
68f6731be3 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 18:00:43 +00:00
George Burgess IV
1559083a44 Ensure moved-from container is cleared on move
In all cases except for this optimistic attempt to reuse memory, the
moved-from TinyPtrVector was left `empty()` at the end of this
assignment. Though using a container after it's been moved from can be a
bit sketchy, it's probably best to just be consistent here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320408 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 19:22:59 +00:00
Simon Dardis
1134b2a24b Infer lowest bits of an integer Multiply when the low bits of the operands are known
When the lowest bits of the operands to an integer multiply are known, the low bits of the result are deducible.
Code to deduce known-zero bottom bits already existed, but this change improves on that by deducing known-ones.

Patch by: Pedro Ferreira

Reviewers: craig.topper, sanjoy, efriedma

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320269 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09 23:25:57 +00:00
Francis Visoiu Mistrih
e28484a720 [CodeGen] Move printing MO_Immediate operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.

Add support for operand subreg index as an immediate to debug printing
and use ::print in the MIRPrinter.

Differential Review: https://reviews.llvm.org/D40965

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 22:53:21 +00:00
Adrian Prantl
0375b23748 Generalize llvm::replaceDbgDeclare and actually support the use-case that
is mentioned in the documentation (inserting a deref before the plus_uconst).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320203 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 21:58:18 +00:00
Evandro Menezes
789bf2ab8b [AArch64] Add Exynos to host detection
Differential revision: https://reviews.llvm.org/D40985

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 21:09:59 +00:00
Francis Visoiu Mistrih
ab9bb80575 [CodeGen] Move printing MO_CImmediate operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320140 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 11:40:06 +00:00
Igor Laevsky
2ccc42083e [FuzzMutate] Correctly insert sinks and sources around invoke instructions
Differential Revision: https://reviews.llvm.org/D40840



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 08:53:16 +00:00
Lang Hames
bbb0cb1b01 [ORC] Mark SymbolStringPool methods as inline to avoid linkage errors, add a
less-than comparison to SymbolStringPtr and a corresponding unit test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320116 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 23:32:11 +00:00
Zachary Turner
c32978de03 [DebugInfo] Fix register variables not showing up in pdb.
Previously, when linking against libcmt from the MSVC runtime,
lld-link /verbose would show "Ignoring unknown symbol record
with kind 0x1006".  It turns out this was because
TypeIndexDiscovery did not handle S_REGISTER records, so these
records were not getting properly remapped.

Patch by: Alexnadre Ganea
Differential Revision: https://reviews.llvm.org/D40919

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 22:51:16 +00:00
Alina Sbirlea
c94e896e67 [ModRefInfo] Make enum ModRefInfo an enum class [NFC].
Summary:
Make enum ModRefInfo an enum class. Changes to ModRefInfo values should
be done using inline wrappers.
This should prevent future bit-wise opearations from being added, which can be more error-prone.

Reviewers: sanjoy, dberlin, hfinkel, george.burgess.iv

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 22:41:34 +00:00
Igor Laevsky
9fb4bebf8e [FuzzMutate] Allow only sized pointers for the GEP instruction
Differential Revision: https://reviews.llvm.org/D40837



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320032 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 11:10:11 +00:00
Pavel Labath
b9b4df7d22 [Testing/Support] Make matchers work with Expected<T&>
Summary:
This did not work because the ExpectedHolder was trying to hold the
value in an Optional<T*>. Instead of trying to mimic the behavior of
Expected and try to make ExpectedHolder work with references and
non-references, I simply store the reference to the Expected object in
the holder.

I also add a bunch of tests for these matchers, which have helped me
flesh out some problems in my initial implementation of this patch, and
uncovered the fact that we are not consistent in quoting our values in
the matcher output (which I also fix).

Reviewers: zturner, chandlerc

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320025 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 10:54:23 +00:00
Francis Visoiu Mistrih
fd11bc0813 [CodeGen] Use MachineOperand::print in the MIRPrinter for MO_Register.
Work towards the unification of MIR and debug output by refactoring the
interfaces.

For MachineOperand::print, keep a simple version that can be easily called
from `dump()`, and a more complex one which will be called from both the
MIRPrinter and MachineInstr::print.

Add extra checks inside MachineOperand for detached operands (operands
with getParent() == nullptr).

https://reviews.llvm.org/D40836

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+)<def> ([^ ]+)/kill: \1 def \2 \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: \1 \2 def \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: def ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: def \1 \2 def \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/<def>//g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<kill>/killed \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use,kill>/implicit killed \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<dead>/dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<def[ ]*,[ ]*dead>/dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def[ ]*,[ ]*dead>/implicit-def dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def>/implicit-def \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use>/implicit \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<internal>/internal \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<undef>/undef \1/g'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320022 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 10:40:31 +00:00
Vedant Kumar
dea3d88348 [Coverage] Scan ahead for the most-recent completed count (PR35495)
This extends r319391. It teaches the segment builder to emit the right
completed segment when more than one region ends at the same location.

Fixes PR35495.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 00:01:15 +00:00
Zachary Turner
381f58e1f7 [CodeView] Add support for content hashing CodeView type records.
Currently nothing uses this, but this at least gets the core
algorithm in, and adds some test to demonstrate correctness.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:08:58 +00:00
Shoaib Meenai
4a6bb5316a [CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.

Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.

Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).

Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:49:56 +00:00
Lang Hames
96cfeb3474 [Orc] Add a SymbolStringPool data structure for efficient storage and fast
comparison of symbol names.

SymbolStringPool is a thread-safe string pool that will be used in upcoming Orc
APIs to facilitate efficient storage and fast comparison of symbol name strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:44:56 +00:00
Joel Galenson
0e19a2ac5c [ConstantRange] Support subtraction in makeGuaranteedNoWrapRegion.
Previously ConstantRange::makeGuaranteedNoWrapRegion only handled addition.  This adds support for subtraction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319806 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 18:14:23 +00:00
George Rimar
0112bbceb8 Fix build bot after r319750 "[Support/TarWriter] - Don't allow TarWriter to add the same file more than once."
Error was:
error: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare]

http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3469/steps/build-unified-tree/logs/stdio
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/7118/steps/build-stage2-compiler/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 10:35:11 +00:00
George Rimar
fa8338cb07 [Support/TarWriter] - Don't allow TarWriter to add the same file more than once.
This is for PR35460.

Currently when LLD adds files to TarWriter it may pass the same file
multiple times. For example it happens for clang reproduce file which specifies
archive (.a) files more than once in command line. 
Patch makes TarWriter to ignore files with the same path, so it will
add only the first one to archive.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319750 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 10:09:59 +00:00
Zachary Turner
47856b25a7 Split TypeTableBuilder into two classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 18:39:50 +00:00
Igor Laevsky
afc2161e86 [FuzzMutate] Correctly handle vector types in the insertvalue operation
Differential Revision: https://reviews.llvm.org/D40397



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319442 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 15:31:13 +00:00
Igor Laevsky
21b2a00254 [FuzzMutate] Don't use index operands as sinks
Differential Revision: https://reviews.llvm.org/D40396



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319441 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 15:29:16 +00:00
Igor Laevsky
59e987ce53 [FuzzMutate] Pick correct index for the insertvalue instruction
Differential Revision: https://reviews.llvm.org/D40395



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 15:26:48 +00:00
Igor Laevsky
703237d8da [FuzzMutate] Don't create load as a new source if it doesn't match with the descriptor
Differential Revision: https://reviews.llvm.org/D40394



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 15:24:41 +00:00
Igor Laevsky
c4f19979c7 [FuzzMutate] Don't crash when we can't remove instruction from empty function
Differential Revision: https://reviews.llvm.org/D40393



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 15:07:38 +00:00
Vedant Kumar
310bfccbbf [Coverage] Use the most-recent completed region count (PR35437)
This is a fix for the coverage segment builder.

If multiple regions must be popped off the active stack at once, and
more than one of them end at the same location, emit a segment using the
count from the most-recent completed region.

Fixes PR35437, rdar://35760630

Testing: invoked llvm-cov on a stage2 build of clang, additional unit
tests, check-profile

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319391 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 00:28:23 +00:00
Zachary Turner
ab45c0673e [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.
The motivation behind this patch is that future directions require us to
be able to compute the hash value of records independently of actually
using them for de-duplication.

The current structure of TypeSerializer / TypeTableBuilder being a
single entry point that takes an unserialized type record, and then
hashes and de-duplicates it is not flexible enough to allow this.

At the same time, the existing TypeSerializer is already extremely
complex for this very reason -- it tries to be too many things. In
addition to serializing, hashing, and de-duplicating, ti also supports
splitting up field list records and adding continuations. All of this
functionality crammed into this one class makes it very complicated to
work with and hard to maintain.

To solve all of these problems, I've re-written everything from scratch
and split the functionality into separate pieces that can easily be
reused. The end result is that one class TypeSerializer is turned into 3
new classes SimpleTypeSerializer, ContinuationRecordBuilder, and
TypeTableBuilder, each of which in isolation is simple and
straightforward.

A quick summary of these new classes and their responsibilities are:

- SimpleTypeSerializer : Turns a non-FieldList leaf type into a series of
  bytes. Does not do any hashing. Every time you call it, it will
  re-serialize and return bytes again. The same instance can be re-used
  over and over to avoid re-allocations, and in exchange for this
  optimization the bytes returned by the serializer only live until the
  caller attempts to serialize a new record.

- ContinuationRecordBuilder : Turns a FieldList-like record into a series
  of fragments. Does not do any hashing. Like SimpleTypeSerializer,
  returns references to privately owned bytes, so the storage is
  invalidated as soon as the caller tries to re-use the instance. Works
  equally well for LF_FIELDLIST as it does for LF_METHODLIST, solving a
  long-standing theoretical limitation of the previous implementation.

- TypeTableBuilder : Accepts sequences of bytes that the user has already
  serialized, and inserts them by de-duplicating with a hash table. For
  the sake of convenience and efficiency, this class internally stores a
  SimpleTypeSerializer so that it can accept unserialized records. The
  same is not true of ContinuationRecordBuilder. The user is required to
  create their own instance of ContinuationRecordBuilder.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28 18:33:17 +00:00
Francis Visoiu Mistrih
aa2d682087 [Support] Add unit test for printLowerCase
Add test case for the function added in r319171.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28 16:11:56 +00:00