platform/upstream/llvm.git
8 years ago[CMake] Make the runtimes directory work with bootstrap builds
Chris Bieneman [Wed, 19 Oct 2016 21:50:25 +0000 (21:50 +0000)]
[CMake] Make the runtimes directory work with bootstrap builds

This patch builds on clang r284648, and allows the runtime directory to make the bootstrap builds depend on the builtin libraries.

This patch also make the bootstrap build depend on configuring the other runtimes because the libcxx headers are copied during configuration. I have left a TODO in the code to remove that once I come up with a better solution.

llvm-svn: 284650

8 years ago[InstSimplify] fold negation of sign-bit
Sanjay Patel [Wed, 19 Oct 2016 21:23:45 +0000 (21:23 +0000)]
[InstSimplify] fold negation of sign-bit

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

I noticed this pattern might be created in the backend after the change from D25485,
so we'll want to add a similar fold for the DAG.

The use of computeKnownBits in InstSimplify may be something to investigate if the
compile time of InstSimplify is noticeable. We could replace computeKnownBits with
specific pattern matchers or limit the recursion.

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

llvm-svn: 284649

8 years ago[CMake] Add clang-bootstrap-deps target
Chris Bieneman [Wed, 19 Oct 2016 21:18:48 +0000 (21:18 +0000)]
[CMake] Add clang-bootstrap-deps target

Having this target allows other parts of the build system to add to the bootstrap dependencies without needing to be defined before the bootstrap targets are created.

This will specifically be used connect the builtins build from the LLVM runtimes directory as a dependency of the next build stage.

llvm-svn: 284648

8 years ago[CUDA] When we emit an error that might have been deferred, also print a callstack.
Justin Lebar [Wed, 19 Oct 2016 21:15:01 +0000 (21:15 +0000)]
[CUDA] When we emit an error that might have been deferred, also print a callstack.

Summary:
Previously, when you did something not allowed in a host+device function
and then caused it to be codegen'ed, we would print out an error telling
you that you did something bad, but we wouldn't tell you how we decided
that the function needed to be codegen'ed.

This change causes us to print out a callstack when emitting deferred
errors.  This is immensely helpful when debugging highly-templated code,
where it's often unclear how a function became known-emitted.

We only print the callstack once per function, after we print the all
deferred errors.

This patch also switches all of our hashtables to using canonical
FunctionDecls instead of regular FunctionDecls.  This prevents a number
of bugs, some of which are caught by tests added here, in which we
assume that two FDs for the same function have the same pointer value.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

llvm-svn: 284647

8 years ago[CMake] Support thin LTO in PGO CMake cache
Chris Bieneman [Wed, 19 Oct 2016 21:12:04 +0000 (21:12 +0000)]
[CMake] Support thin LTO in PGO CMake cache

This allows you to set PGO_INSTRUMENT_LTO=Thin and have it work correctly.

llvm-svn: 284646

8 years agoAvoid using grep command in a test.
Rui Ueyama [Wed, 19 Oct 2016 21:07:29 +0000 (21:07 +0000)]
Avoid using grep command in a test.

This test is failing on FreeBSD bots. This is an attempt to fix it
by not using grep command.

llvm-svn: 284645

8 years ago[AST] Add CanonicalDeclPtr<T>.
Justin Lebar [Wed, 19 Oct 2016 21:03:42 +0000 (21:03 +0000)]
[AST] Add CanonicalDeclPtr<T>.

Summary:
CanonicalDeclPtr<T> is just like a T*, except it calls
T::getCanonicalDecl() on construction.

This is useful as the key in a "set of canonical Decls" -- it's much
less error-prone than calling getCanonicalDecl() every time you touch
the set.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

llvm-svn: 284644

8 years ago[CUDA] Emit errors for wrong-side calls made on the same line as non-wrong-side calls.
Justin Lebar [Wed, 19 Oct 2016 21:03:38 +0000 (21:03 +0000)]
[CUDA] Emit errors for wrong-side calls made on the same line as non-wrong-side calls.

Summary:
This fixes two related bugs:

1) Previously, if you had a non-wrong side call at some source code
location L, we wouldn't emit errors for wrong-side calls that appeared
at L.

2) We'd only emit one wrong-side error per source code location, when we
actually want to emit it twice if we hit this line more than once due to
e.g. template instantiation.

Reviewers: tra

Subscribers: rnk, cfe-commits

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

llvm-svn: 284643

8 years ago[ubsan] Drop dependency on a 64-bit arch in a test (NFC)
Vedant Kumar [Wed, 19 Oct 2016 20:53:16 +0000 (20:53 +0000)]
[ubsan] Drop dependency on a 64-bit arch in a test (NFC)

This should fix:

    http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/46184

llvm-svn: 284642

8 years agoMove getVersionString to Core and simplify Version.cpp.
Rui Ueyama [Wed, 19 Oct 2016 20:53:07 +0000 (20:53 +0000)]
Move getVersionString to Core and simplify Version.cpp.

llvm-svn: 284641

8 years ago[ubsan] Re-work check lines to try to appease a bot (NFC)
Vedant Kumar [Wed, 19 Oct 2016 20:28:35 +0000 (20:28 +0000)]
[ubsan] Re-work check lines to try to appease a bot (NFC)

This bot does not produce the IR I expect -- it's missing some
'handler.dynamic_type_cache_miss:' labels. We don't need to rely on
those labels, so get rid of them in hopes of making the bot happy.

    http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55493

llvm-svn: 284639

8 years agoNew clang option -mpie-copy-relocations to use copy relocations for PIE builds.
Sriraman Tallam [Wed, 19 Oct 2016 20:24:06 +0000 (20:24 +0000)]
New clang option -mpie-copy-relocations to use copy relocations for PIE builds.

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

llvm-svn: 284638

8 years ago[BuildingAJIT] Make the chapter 5 server export symbols.
Lang Hames [Wed, 19 Oct 2016 20:22:12 +0000 (20:22 +0000)]
[BuildingAJIT] Make the chapter 5 server export symbols.

This will allow chapter 5 to work on Linux.

llvm-svn: 284637

8 years ago[ubsan] Use the object pointer's type info for devirtualized calls
Vedant Kumar [Wed, 19 Oct 2016 20:21:16 +0000 (20:21 +0000)]
[ubsan] Use the object pointer's type info for devirtualized calls

ubsan reports a false positive 'invalid member call' diagnostic on the
following example (PR30478):

  struct Base1 {
    virtual int f1() { return 1; }
  };

  struct Base2 {
    virtual int f1() { return 2; }
  };

  struct Derived2 final : Base1, Base2 {
    int f1() override { return 3; }
  };

  int t1() {
    Derived2 d;
    return static_cast<Base2 *>(&d)->f1();
  }

Adding the "final" attribute to a most-derived class allows clang to
devirtualize member calls into an instance of that class. We should pass
along the type info of the object pointer to avoid the FP. In this case,
that means passing along the type info for 'Derived2' instead of 'Base2'
when checking the dynamic type of static_cast<Base2 *>(&d2).

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

llvm-svn: 284636

8 years agoTypo: nomed struct -> named struct
Hans Wennborg [Wed, 19 Oct 2016 20:10:03 +0000 (20:10 +0000)]
Typo: nomed struct -> named struct

llvm-svn: 284635

8 years agoInclude ARGV[0] in error messages.
Rui Ueyama [Wed, 19 Oct 2016 20:05:43 +0000 (20:05 +0000)]
Include ARGV[0] in error messages.

This is what other linkers and clang driver do.

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

llvm-svn: 284634

8 years ago[GlobalMerge] Handle non-landingpad EH pads
Reid Kleckner [Wed, 19 Oct 2016 19:56:22 +0000 (19:56 +0000)]
[GlobalMerge] Handle non-landingpad EH pads

This code crashed on funclet-style EH instructions such as catchpad,
catchswitch, and cleanuppad. Just treat all EH pad instructions
equivalently and avoid merging the globals they reference through any
use.

llvm-svn: 284633

8 years ago[IndVarSimplify] Teach calculatePostIncRange to take guards into account
Artur Pilipenko [Wed, 19 Oct 2016 19:43:54 +0000 (19:43 +0000)]
[IndVarSimplify] Teach calculatePostIncRange to take guards into account

Reviewed By: sanjoy

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

llvm-svn: 284632

8 years ago[LV] Avoid emitting trivially dead instructions
Matthew Simpson [Wed, 19 Oct 2016 19:22:02 +0000 (19:22 +0000)]
[LV] Avoid emitting trivially dead instructions

Some instructions from the original loop, when vectorized, can become trivially
dead. This happens because of the way we structure the new loop. For example,
we create new induction variables and induction variable "steps" in the new
loop. Thus, when we go to vectorize the original induction variable update, it
may no longer be needed due to the instructions we've already created. This
patch prevents us from creating these redundant instructions. This reduces code
size before simplification and allows greater flexibility in code generation
since we have fewer unnecessary instruction uses.

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

llvm-svn: 284631

8 years ago[AliasSetTracker] Add support for memcpy and memmove.
Chad Rosier [Wed, 19 Oct 2016 19:09:03 +0000 (19:09 +0000)]
[AliasSetTracker] Add support for memcpy and memmove.

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

llvm-svn: 284630

8 years ago[IndVarSimplify] Use control-dependent range information to prove non-negativity
Artur Pilipenko [Wed, 19 Oct 2016 18:59:03 +0000 (18:59 +0000)]
[IndVarSimplify] Use control-dependent range information to prove non-negativity

This change is motivated by the case when IndVarSimplify doesn't widen a comparison of IV increment because it can't prove IV increment being non-negative. We end up with a redundant trunc of the widened increment on this example.

for.body:
  %i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.inc ]
  %within_limits = icmp ult i32 %i, 64
  br i1 %within_limits, label %continue, label %for.end

continue:
  %i.i64 = zext i32 %i to i64
  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
  %val = load i32, i32* %arrayidx, align 4
  br label %for.inc

for.inc:
  %i.inc = add nsw nuw i32 %i, 1
  %cmp = icmp slt i32 %i.inc, %limit
  br i1 %cmp, label %for.body, label %for.end

There is a range check inside of the loop which guarantees the IV to be non-negative. NSW on the increment guarantees that the increment is also non-negative. Teach IndVarSimplify to use the range check to prove non-negativity of loop increments.

Reviewed By: sanjoy

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

llvm-svn: 284629

8 years ago[AliasSetTracker] Return void for add() functions. NFC.
Chad Rosier [Wed, 19 Oct 2016 18:50:32 +0000 (18:50 +0000)]
[AliasSetTracker] Return void for add() functions. NFC.

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

llvm-svn: 284628

8 years ago[InstSimplify] move one and add more tests for potential negation folds
Sanjay Patel [Wed, 19 Oct 2016 18:42:12 +0000 (18:42 +0000)]
[InstSimplify] move one and add more tests for potential negation folds

llvm-svn: 284627

8 years agoAdd a macro for prefetching data.
Rafael Espindola [Wed, 19 Oct 2016 18:34:32 +0000 (18:34 +0000)]
Add a macro for prefetching data.

It will be used in lld.

llvm-svn: 284626

8 years agoRemove ending "." from an error message.
Rui Ueyama [Wed, 19 Oct 2016 18:09:52 +0000 (18:09 +0000)]
Remove ending "." from an error message.

Other error messages don't end with ".".

llvm-svn: 284625

8 years agoMS ABI: Fix assert when generating virtual function call with virtual bases and ...
Hans Wennborg [Wed, 19 Oct 2016 18:04:27 +0000 (18:04 +0000)]
MS ABI: Fix assert when generating virtual function call with virtual bases and -flto (PR30731)

getClassAtVTableLocation() was calling
ASTRecordLayout::getBaseClassOffset() on a virtual base, causing an
assert.

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

llvm-svn: 284624

8 years ago[ADT] Zip range adapter
Mehdi Amini [Wed, 19 Oct 2016 18:02:21 +0000 (18:02 +0000)]
[ADT] Zip range adapter

This augments the STLExtras toolset with a zip iterator and range
adapter. Zip comes in two varieties: `zip`, which will zip to the
shortest of the input ranges, and `zip_first`, which limits its
`begin() == end()` checks to just the first range.

Recommit r284035 after MSVC2013 support has been dropped.

Patch by: Bryant Wong <github.com/bryant>

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

llvm-svn: 284623

8 years ago[polly] Fix non-determinism in polly BlockGenerators
Mandeep Singh Grang [Wed, 19 Oct 2016 17:56:49 +0000 (17:56 +0000)]
[polly] Fix non-determinism in polly BlockGenerators

Summary: Iterating over SeenBlocks which is a SmallPtrSet results in non-determinism in codegen

Reviewers: jdoerfert, zinob, grosser

Tags: #polly

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

llvm-svn: 284622

8 years ago[llvm-cov] Don't spawn a thread unless ThreadCount > 1
Vedant Kumar [Wed, 19 Oct 2016 17:55:44 +0000 (17:55 +0000)]
[llvm-cov] Don't spawn a thread unless ThreadCount > 1

Initializing a ThreadPool with ThreadCount = 1 spawns a thread even
though we don't need to. This is at least slower than it needs to be,
and at worst may somehow be exacerbating PR30735 (llvm-cov times out
on ARM bots).

As a follow-up, I'll try to add logic to llvm::ThreadPool to avoid
spawning a thread when ThreadCount = 1.

llvm-svn: 284621

8 years ago[mips][msa] Range check MSA intrinsics with immediates
Simon Dardis [Wed, 19 Oct 2016 17:50:52 +0000 (17:50 +0000)]
[mips][msa] Range check MSA intrinsics with immediates

This patch teaches clang to range check immediates for MIPS MSA instrinsics.
This checking is done strictly in comparison to some existing GCC
implementations. E.g. msa_andvi_b(var, 257) does not result in andvi $wX, 1.
Similarily msa_ldi_b takes a range of -128 to 127.

As part of this effort, correct the existing MSA test as it has both illegal
types and immediates.

Reviewers: vkalintiris

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

llvm-svn: 284620

8 years ago[AMDGPU] Stop using MCRegisterClass::getSize()
Krzysztof Parzyszek [Wed, 19 Oct 2016 17:40:36 +0000 (17:40 +0000)]
[AMDGPU] Stop using MCRegisterClass::getSize()

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

llvm-svn: 284619

8 years ago[ThinLTO] Default backend threads to heavyweight_hardware_concurrency
Teresa Johnson [Wed, 19 Oct 2016 17:35:01 +0000 (17:35 +0000)]
[ThinLTO] Default backend threads to heavyweight_hardware_concurrency

Summary:
Changes default backend parallelism from thread::hardware_concurrency to
the new llvm::heavyweight_hardware_concurrency, which for X86 Linux
defaults to the number of physical cores (and will fall back to
thread::hardware_concurrency otherwise). This avoid oversubscribing
the physical cores using hyperthreading.

Reviewers: mehdi_amini, pcc

Subscribers: llvm-commits

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

llvm-svn: 284618

8 years ago[Myriad] Find libc++ headers next to clang binary
Douglas Katzman [Wed, 19 Oct 2016 17:30:40 +0000 (17:30 +0000)]
[Myriad] Find libc++ headers next to clang binary

llvm-svn: 284617

8 years agoMerged nested ifs. NFCI.
Simon Pilgrim [Wed, 19 Oct 2016 17:30:24 +0000 (17:30 +0000)]
Merged nested ifs. NFCI.

llvm-svn: 284616

8 years agoRevert "Add Chrono.h - std::chrono support header"
Pavel Labath [Wed, 19 Oct 2016 17:17:53 +0000 (17:17 +0000)]
Revert "Add Chrono.h - std::chrono support header"

This reverts commit r284590 as it fails on the mingw buildbot. I think I know the
fix, but I cannot test it right now. Will reapply when I verify it works ok.

This reverts r284590.

llvm-svn: 284615

8 years ago[ELF] Add `const` qualifier to functions. NFC
Simon Atanasyan [Wed, 19 Oct 2016 17:13:43 +0000 (17:13 +0000)]
[ELF] Add `const` qualifier to functions. NFC

llvm-svn: 284614

8 years ago[DAGCombiner] Add general constant vector support to (shl (add x, c1), c2) -> (add...
Simon Pilgrim [Wed, 19 Oct 2016 17:12:22 +0000 (17:12 +0000)]
[DAGCombiner] Add general constant vector support to (shl (add x, c1), c2) -> (add (shl x, c2), c1 << c2)

We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector

llvm-svn: 284613

8 years ago[WinEH] Allow catchpads to reuse the same catch object
Reid Kleckner [Wed, 19 Oct 2016 17:08:23 +0000 (17:08 +0000)]
[WinEH] Allow catchpads to reuse the same catch object

This code used a regular when it should have used a multimap.

llvm-svn: 284612

8 years ago[DAG] optimize negation of bool
Sanjay Patel [Wed, 19 Oct 2016 16:58:59 +0000 (16:58 +0000)]
[DAG] optimize negation of bool

Use mask and negate for legalization of i1 source type with SIGN_EXTEND_INREG.
With the mask, this should be no worse than 2 shifts. The mask can be eliminated
in some cases, so that should be better than 2 shifts.

This change exposed some missing folds related to negation:
https://reviews.llvm.org/rL284239
https://reviews.llvm.org/rL284395

There may be others, so please let me know if you see any regressions.

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

llvm-svn: 284611

8 years ago[pdb] Improve error messages when DIA is not found.
Zachary Turner [Wed, 19 Oct 2016 16:42:20 +0000 (16:42 +0000)]
[pdb] Improve error messages when DIA is not found.

llvm-svn: 284610

8 years ago[RDF] Switch RefMap in liveness calculation to use lane masks
Krzysztof Parzyszek [Wed, 19 Oct 2016 16:30:56 +0000 (16:30 +0000)]
[RDF] Switch RefMap in liveness calculation to use lane masks

This required reengineering of some of the part of liveness calculation,
including fixing some issues caused by the limitations of the previous
approach. The current code is not necessarily the fastest, but it should
be functionally correct (at least more so than before). The compile-time
performance will be addressed in the future.

llvm-svn: 284609

8 years ago[DAGCombiner] Add general constant vector support to (shl (sra x, c1), c1) -> (and...
Simon Pilgrim [Wed, 19 Oct 2016 16:15:30 +0000 (16:15 +0000)]
[DAGCombiner] Add general constant vector support to (shl (sra x, c1), c1) -> (and x, (shl -1, c1))

We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector

llvm-svn: 284608

8 years ago[DAGCombiner] Add general constant vector support to (shl (mul x, c1), c2) -> (mul...
Simon Pilgrim [Wed, 19 Oct 2016 15:59:28 +0000 (15:59 +0000)]
[DAGCombiner] Add general constant vector support to (shl (mul x, c1), c2) -> (mul x, c1 << c2)

We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector

llvm-svn: 284607

8 years agoRevert r284604. A.K.A. "TMP"
Tim Northover [Wed, 19 Oct 2016 15:56:12 +0000 (15:56 +0000)]
Revert r284604. A.K.A. "TMP"

Committed by mistake.

llvm-svn: 284606

8 years agoSparc: fix test.
Tim Northover [Wed, 19 Oct 2016 15:55:11 +0000 (15:55 +0000)]
Sparc: fix test.

llvm-svn: 284605

8 years agoTMP
Tim Northover [Wed, 19 Oct 2016 15:55:09 +0000 (15:55 +0000)]
TMP

llvm-svn: 284604

8 years agoGlobalISel: support translating volatile loads and stores.
Tim Northover [Wed, 19 Oct 2016 15:55:06 +0000 (15:55 +0000)]
GlobalISel: support translating volatile loads and stores.

llvm-svn: 284603

8 years agoImplement constexpr support for reverse_iterator. Reviewed as https://reviews.llvm...
Marshall Clow [Wed, 19 Oct 2016 15:12:50 +0000 (15:12 +0000)]
Implement constexpr support for reverse_iterator. Reviewed as https://reviews.llvm.org/D25534

llvm-svn: 284602

8 years agoSimplify GetGlobalProperties functions of Thread/Process/Target
Pavel Labath [Wed, 19 Oct 2016 15:12:45 +0000 (15:12 +0000)]
Simplify GetGlobalProperties functions of Thread/Process/Target

Summary:
"Initialization of function-local statics is guaranteed to occur only once even when called from
multiple threads, and may be more efficient than the equivalent code using std::call_once."
<http://en.cppreference.com/w/cpp/thread/call_once>

I'd add that it's also more readable.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D17710

llvm-svn: 284601

8 years ago[ELF] Choose default segment when it is not specified
Eugene Leviant [Wed, 19 Oct 2016 15:04:49 +0000 (15:04 +0000)]
[ELF] Choose default segment when it is not specified

Linker scripts may specify PHDRS, but not specify section to
segment assignments, i.e:

PHDRS { seg PT_LOAD; }
SECTIONS {
  .sec1 {} : seg
  .sec2 {}
}

In such case linker should still choose some segment for .sec2 section.
This patch will add .sec2 to previously opened segments (seg) or to the
very first PT_LOAD segment, if no section-to-segment assignments has been
made

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

llvm-svn: 284600

8 years agoRemove IntervalTimer class
Pavel Labath [Wed, 19 Oct 2016 15:01:22 +0000 (15:01 +0000)]
Remove IntervalTimer class

Summary:
it was added back in 2013, but there are no uses of it. I started refactoring
it, but then it occured to me it would better to delete it.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 284599

8 years agoDon't gc non-alloca non-string pieces.
Rafael Espindola [Wed, 19 Oct 2016 14:50:26 +0000 (14:50 +0000)]
Don't gc non-alloca non-string pieces.

We were already doing it for strings. This matches the behavior of
bfd and gold.

llvm-svn: 284598

8 years agoIntroduce ConstantRange.addWithNoSignedWrap
Artur Pilipenko [Wed, 19 Oct 2016 14:44:23 +0000 (14:44 +0000)]
Introduce ConstantRange.addWithNoSignedWrap

To be used by upcoming change to IndVarSimplify

Reviewed By: sanjoy

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

llvm-svn: 284597

8 years ago[clang-tidy] Add cert-err09-cpp check alias.
Marek Kurdej [Wed, 19 Oct 2016 14:28:19 +0000 (14:28 +0000)]
[clang-tidy] Add cert-err09-cpp check alias.

Summary: This adds cert-err09-cpp alias for completeness, similar to cert-err61-cpp.

Reviewers: alexfh, hokein

Subscribers: cfe-commits

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

llvm-svn: 284596

8 years agoRemove unused diagnostics. NFC.
Benjamin Kramer [Wed, 19 Oct 2016 14:22:38 +0000 (14:22 +0000)]
Remove unused diagnostics. NFC.

llvm-svn: 284595

8 years agoAdd a faster binary search.
Rafael Espindola [Wed, 19 Oct 2016 14:17:36 +0000 (14:17 +0000)]
Add a faster binary search.

Even with the hash table cache, binary search was still pretty
hot. This can be made even faster with prefetching.

Idea from http://cglab.ca/~morin/misc/arraylayout-v2/

I will suggest moving this to llvm.

llvm-svn: 284594

8 years agoMinidump plugin: functions parsing memory structures and filtering module list
Dimitar Vlahovski [Wed, 19 Oct 2016 14:14:18 +0000 (14:14 +0000)]
Minidump plugin: functions parsing memory structures and filtering module list

Summary:
Now the Minidump parser can parse the:
1) MemoryInfoList - containing region info about memory ranges (readable,
writable, executable)
2) Memory64List - this is the stuct used when the Minidump is a
full-memory one.
3) Adding filtering of the module list (shared libraries list) - there
can be mutliple records in the module list under the same name but with
different load address (e.g. when the binary has non contigious
sections). FilterModuleList eliminates the duplicated modules, leaving
the one with the lowest load addr.

Added unit tests for everything.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, modocache, lldb-commits, amccarth

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

llvm-svn: 284593

8 years ago[clang-move] Move using-decl in old cc.
Haojian Wu [Wed, 19 Oct 2016 14:13:21 +0000 (14:13 +0000)]
[clang-move] Move using-decl in old cc.

Summary:
Another fix is to move the whole anonymous namespace declaration
completely instead of moving fun/var declarations only.

Reviewers: ioeric

Subscribers: cfe-commits

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

llvm-svn: 284592

8 years ago[Sparc][LEON] Detects an erratum on UT699 LEON 3 processors involving rounding mode...
Chris Dewhurst [Wed, 19 Oct 2016 14:01:06 +0000 (14:01 +0000)]
[Sparc][LEON] Detects an erratum on UT699 LEON 3 processors involving rounding mode changes and issues an appropriate user error message.

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

llvm-svn: 284591

8 years agoAdd Chrono.h - std::chrono support header
Pavel Labath [Wed, 19 Oct 2016 13:58:55 +0000 (13:58 +0000)]
Add Chrono.h - std::chrono support header

Summary:
std::chrono mostly covers the functionality of llvm::sys::TimeValue and
lldb_private::TimeValue. This header adds a bit of utility functions and
typedefs, which make the usage of the library and porting code from TimeValues
easier.

Rationale:
- TimePoint typedef - precision of system_clock is implementation defined -
  using a well-defined precision helps maintain consistency between platforms,
  makes it interact better with existing TimeValue classes, and avoids cases
  there a time point is implicitly convertible to a specific precision on some
  platforms but not on others.
- system_clock::to_time_t only accepts time_points with the default system
  precision (even though time_t has only second precision on all platforms we
  support). To avoid the need for explicit casts, I have added a toTimeT()
  wrapper function. toTimePoint(time_t) was not strictly necessary, but I have
  added it for symmetry.

Reviewers: zturner, mehdi_amini

Subscribers: beanz, mgorny, llvm-commits, modocache

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

llvm-svn: 284590

8 years agoDon't copy replacements in for-range loop. NFC.
Benjamin Kramer [Wed, 19 Oct 2016 13:50:17 +0000 (13:50 +0000)]
Don't copy replacements in for-range loop. NFC.

llvm-svn: 284589

8 years agoReapply r284571 (with the new tests fixed).
Sjoerd Meijer [Wed, 19 Oct 2016 13:43:02 +0000 (13:43 +0000)]
Reapply r284571 (with the new tests fixed).

llvm-svn: 284588

8 years agollvm/test/MC/Mips/macro-ld-sd.s: Sweep a spurious character \xA0 in the test file.
NAKAMURA Takumi [Wed, 19 Oct 2016 13:41:12 +0000 (13:41 +0000)]
llvm/test/MC/Mips/macro-ld-sd.s: Sweep a spurious character \xA0 in the test file.

It might crash FileCheck.

llvm-svn: 284587

8 years ago[SystemZ] Add missing vector instructions for the assembler
Ulrich Weigand [Wed, 19 Oct 2016 13:03:18 +0000 (13:03 +0000)]
[SystemZ] Add missing vector instructions for the assembler

Most z13 vector instructions have a base form where the data type of
the operation (whether to consider the vector to be 16 bytes, 8
halfwords, 4 words, or 2 doublewords) is encoded into a mask field,
and then a set of extended mnemonics where the mask field is not
present but the data type is encoded into the mnemonic name.

Currently, LLVM only supports the type-specific forms (since those
are really the ones needed for code generation), but not the base
type-generic forms.

To complete the assembler support and make it fully compatible with
the GNU assembler, this commit adds assembler aliases for all the
base forms of the various vector instructions.

It also adds two more alias forms that are documented in the PoP:
VFPSO/VFPSODB/WFPSODB -- generic form of VFLCDB etc.
VNOT -- special variant of VNO

llvm-svn: 284586

8 years ago[SystemZ] Add optional argument to some vector string instructions
Ulrich Weigand [Wed, 19 Oct 2016 12:57:46 +0000 (12:57 +0000)]
[SystemZ] Add optional argument to some vector string instructions

The vfee[bhf], vfene[bhf], and vistr[bhf] assembler mnemonics are
documented in the Principles of Operation to have an optional last
operand to encode arbitrary values in a mask field.

This commit adds support for those optional operands, and cleans up
the patterns to generate vector string instruction as bit.  No change
to code generation intended.

llvm-svn: 284585

8 years ago[cmake] Use LLVM_CMAKE_PATH for GetSVN script
Michal Gorny [Wed, 19 Oct 2016 12:54:28 +0000 (12:54 +0000)]
[cmake] Use LLVM_CMAKE_PATH for GetSVN script

Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.

llvm-svn: 284584

8 years ago[cmake] Allow testing against installed LLVM with no sources
Michal Gorny [Wed, 19 Oct 2016 12:34:17 +0000 (12:34 +0000)]
[cmake] Allow testing against installed LLVM with no sources

Adjust the stand-alone build files to accept either CMake files from
LLVM_CMAKE_PATH or from LLVM_MAIN_SRC_DIR instead of requiring both.
This makes it possible to run libcxx tests on top of installed LLVM
and lit, without having to unpack a copy of LLVM sources. Furthermore,
it avoids adding duplicate paths.

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

llvm-svn: 284583

8 years ago[cmake] Use LLVM_CMAKE_PATH for GetSVN script
Michal Gorny [Wed, 19 Oct 2016 12:21:39 +0000 (12:21 +0000)]
[cmake] Use LLVM_CMAKE_PATH for GetSVN script

Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script.
The variable was already available in stand-alone builds, and is also
set by LLVM since r284581.

llvm-svn: 284582

8 years ago[cmake] Declare LLVM_CMAKE_PATH for use in subprojects
Michal Gorny [Wed, 19 Oct 2016 12:18:34 +0000 (12:18 +0000)]
[cmake] Declare LLVM_CMAKE_PATH for use in subprojects

Declare the LLVM_CMAKE_PATH to the source directory location of CMake
files, in order to make it possible to easily use them in subprojects.
Such a variable is already declared in most of LLVM projects
(and inconsistently mixed with direct source tree references), including
Clang, LLDB, compiler-rt, libcxx... Declaring it inside main LLVM tree
makes it possible to avoid having to declare fallback values or use
conditionals in those projects.

It should be noted that in some of the subprojects LLVM_CMAKE_PATH is
used to reference generated LLVMConfig.cmake file. However, these
references are conditional to stand-alone builds and explicitly
including this file is unnecessary in combined builds.

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

llvm-svn: 284581

8 years ago[Thumb-1] Synthesize TBB/TBH instructions to make use of compressed jump tables
James Molloy [Wed, 19 Oct 2016 12:06:49 +0000 (12:06 +0000)]
[Thumb-1] Synthesize TBB/TBH instructions to make use of compressed jump tables

The TBB and TBH instructions in Thumb-2 allow jump tables to be compressed into sequences of bytes or shorts respectively. These instructions do not exist in Thumb-1, however it is possible to synthesize them out of a sequence of other instructions.

It turns out this sequence is so short that it's almost never a lose for performance and is ALWAYS a significant win for code size.

TBB example:
Before: lsls r0, r0, #2    After: add  r0, pc
        adr  r1, .LJTI0_0         ldrb r0, [r0, #6]
        ldr  r0, [r0, r1]         lsls r0, r0, #1
        mov  pc, r0               add  pc, r0
  => No change in prologue code size or dynamic instruction count. Jump table shrunk by a factor of 4.

The only case that can increase dynamic instruction count is the TBH case:

Before: lsls r0, r4, #2    After: lsls r4, r4, #1
        adr  r1, .LJTI0_0         add  r4, pc
        ldr  r0, [r0, r1]         ldrh r4, [r4, #6]
        mov  pc, r0               lsls r4, r4, #1
                                  add  pc, r4
  => 1 more instruction in prologue. Jump table shrunk by a factor of 2.

So there is an argument that this should be disabled when optimizing for performance (and a TBH needs to be generated). I'm not so sure about that in practice, because on small cores with Thumb-1 performance is often tied to code size. But I'm willing to turn it off when optimizing for performance if people want (also note that TBHs are fairly rare in practice!)

llvm-svn: 284580

8 years ago[Sema] Gcc compatibility of vector shift
Andrey Bokhanko [Wed, 19 Oct 2016 12:06:10 +0000 (12:06 +0000)]
[Sema] Gcc compatibility of vector shift

Gcc prints error if elements of left and right parts of a shift have different
sizes. This patch is provided the GCC compatibility.

Patch by Vladimir Yakovlev.

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

llvm-svn: 284579

8 years ago[DAGCombiner] Just call isConstOrConstSplat directly. NFCI.
Simon Pilgrim [Wed, 19 Oct 2016 11:28:15 +0000 (11:28 +0000)]
[DAGCombiner] Just call isConstOrConstSplat directly. NFCI.

This will get the same ConstantSDNode scalar or vector splat value as the current separate dyn_cast<ConstantSDNode> / isVector() approach.

llvm-svn: 284578

8 years ago[modules] Do not report missing definitions of demoted constexpr variable templates.
Vassil Vassilev [Wed, 19 Oct 2016 11:19:30 +0000 (11:19 +0000)]
[modules] Do not report missing definitions of demoted constexpr variable templates.

This is a followup to regression introduced in r284284.

This should fix our libstdc++ modules builds.

https://reviews.llvm.org/D25678

Reviewed by Richard Smith!

llvm-svn: 284577

8 years agoFix line endings
Simon Pilgrim [Wed, 19 Oct 2016 11:16:58 +0000 (11:16 +0000)]
Fix line endings

llvm-svn: 284576

8 years ago[ELF] Add "error" and "warning" prefixes to linker messages
Eugene Leviant [Wed, 19 Oct 2016 09:35:19 +0000 (09:35 +0000)]
[ELF] Add "error" and "warning" prefixes to linker messages

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

llvm-svn: 284575

8 years ago[DAGCombine] Generalize distributeTruncateThroughAnd to work with any non-opaque...
Simon Pilgrim [Wed, 19 Oct 2016 08:57:37 +0000 (08:57 +0000)]
[DAGCombine] Generalize distributeTruncateThroughAnd to work with any non-opaque constant or constant vector

llvm-svn: 284574

8 years ago[clang-format] Add comment manipulation header
Eric Liu [Wed, 19 Oct 2016 08:19:46 +0000 (08:19 +0000)]
[clang-format] Add comment manipulation header

Summary:
Introduces a separate target for comment manipulation.
Currently, comment manipulation is in BreakableComment.cpp.
Towards implementing comment reflowing, we want to factor out the
comment-related functionality, so it can be reused.
Start simple by just moving out getLineCommentIndentPrefix.

Patch by Krasimir Georgiev!

Reviewers: djasper

Subscribers: klimek, beanz, mgorny, modocache

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

llvm-svn: 284573

8 years agoRevert of r284571 because of failing tests.
Sjoerd Meijer [Wed, 19 Oct 2016 07:45:48 +0000 (07:45 +0000)]
Revert of r284571 because of failing tests.

llvm-svn: 284572

8 years agoChecking FP function attribute values and adding more build attribute tests.
Sjoerd Meijer [Wed, 19 Oct 2016 07:25:06 +0000 (07:25 +0000)]
Checking FP function attribute values and adding more build attribute tests.

This renames the function for checking FP function attribute values and also
adds more build attribute tests (which are in separate files because build
attributes are set per file).

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

llvm-svn: 284571

8 years agoDenseSet: Appease msc18 to define derived constructors explicitly.
NAKAMURA Takumi [Wed, 19 Oct 2016 05:43:17 +0000 (05:43 +0000)]
DenseSet: Appease msc18 to define derived constructors explicitly.

msc18 doesn't recognize "using BaseT::BaseT;"

  llvm\include\llvm/ADT/DenseSet.h(213) : error C2875: using-declaration causes a multiple declaration of 'BaseT'
          llvm\include\llvm/ADT/DenseSet.h(214) : see reference to class template instantiation 'llvm::DenseSet<ValueT,ValueInfoT>' being compiled
  llvm\include\llvm/ADT/DenseSet.h(231) : error C2875: using-declaration causes a multiple declaration of 'BaseT'
          llvm\include\llvm/ADT/DenseSet.h(232) : see reference to class template instantiation 'llvm::SmallDenseSet<ValueT,InlineBuckets,ValueInfoT>' being compiled

llvm-svn: 284570

8 years ago[AVX-512] Teach isel lowering that a subvector broadcast being inserted into both...
Craig Topper [Wed, 19 Oct 2016 04:44:17 +0000 (04:44 +0000)]
[AVX-512] Teach isel lowering that a subvector broadcast being inserted into both halves of a 512-bit vector can be combined into a larger subvector broadcast.

Summary:
This allows us to create broadcasts of 128-bit vector loads into 512-bit vectors.

New patterns added to support 8-bit and 16-bit vector types and v2f64/v2i64->v8f64/v8i64 without DQI instructions.

There also fallback patterns when the load can't be folded. These patterns are a little complex as we first need to insert the lower 128-bits into the second 128-bits using a zmm subvector insert instruction. We need to use a zmm insert in case VLX isn't available. Then use another zmm sub vector insert to take those 256-bits and insert them into the upper bits. Since we used a zmm insert to create the 256-bits we also need to do a extract_subreg to get just the lower 256-bits to pass to the second insert.

The outer insert for the fallback patterns should have its type correct because eventually we should also supported masked operations here too. So we need a DQI and a NoDQI version of the v16f32/v16i32 patterns.

Reviewers: RKSimon, delena, igorb

Subscribers: llvm-commits

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

llvm-svn: 284567

8 years agoUpdate the section.ll to fix non-x86 failure.
Dehao Chen [Wed, 19 Oct 2016 03:53:41 +0000 (03:53 +0000)]
Update the section.ll to fix non-x86 failure.

llvm-svn: 284566

8 years agoRevert back to the state before r284550
Chris Bieneman [Wed, 19 Oct 2016 02:44:20 +0000 (02:44 +0000)]
Revert back to the state before r284550

This patch is causing a lot of issues on bots that I didn't see in local testing. I'm going to have to work on this. Reverting for now while I sort it out.

llvm-svn: 284565

8 years agoTrying to fix a few more missing LDFLAGS.
Chris Bieneman [Wed, 19 Oct 2016 02:31:31 +0000 (02:31 +0000)]
Trying to fix a few more missing LDFLAGS.

llvm-svn: 284564

8 years agoRevert r284545 again as the regression in ppc still exists. There is bug in MBPI...
Dehao Chen [Wed, 19 Oct 2016 01:18:25 +0000 (01:18 +0000)]
Revert r284545 again as the regression in ppc still exists. There is bug in MBPI exposed by th patch.

Also update the section.ll to fix non-x86 failure.

llvm-svn: 284563

8 years ago[asan] Replace std::to_string with llvm::to_string
Vitaly Buka [Wed, 19 Oct 2016 00:16:56 +0000 (00:16 +0000)]
[asan] Replace std::to_string with llvm::to_string

llvm-svn: 284557

8 years agoResolve exception specifications when selecting an overloaded operator.
Richard Smith [Wed, 19 Oct 2016 00:14:23 +0000 (00:14 +0000)]
Resolve exception specifications when selecting an overloaded operator.

llvm-svn: 284556

8 years agoFixing the linux bots I broke in r284550
Chris Bieneman [Wed, 19 Oct 2016 00:13:56 +0000 (00:13 +0000)]
Fixing the linux bots I broke in r284550

Need to gate cxx linker adding driver-mode flag based on the linker being clang.

llvm-svn: 284555

8 years ago[libFuzzer] extend -print_coverage to also print uncovered lines, functions, and...
Kostya Serebryany [Wed, 19 Oct 2016 00:12:03 +0000 (00:12 +0000)]
[libFuzzer] extend -print_coverage to also print uncovered lines, functions, and files.

Example of output:
COVERAGE:
COVERED: in DSO2(int) /pathto/DSO2.cpp:6
COVERED: in DSO2(int) /pathto/DSO2.cpp:8
COVERED: in DSO1(int) /pathto/DSO1.cpp:6
COVERED: in DSO1(int) /pathto/DSO1.cpp:8
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:16
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:19
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:25
COVERED: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:26
MODULE_WITH_COVERAGE: /pathto/libLLVMFuzzer-DSO1.so
UNCOVERED_LINE: in DSO1(int) /pathto/DSO1.cpp:9
UNCOVERED_FUNC: in Uncovered1()
MODULE_WITH_COVERAGE: /pathto/libLLVMFuzzer-DSO2.so
UNCOVERED_LINE: in DSO2(int) /pathto/DSO2.cpp:9
UNCOVERED_FUNC: in Uncovered2()
MODULE_WITH_COVERAGE: /pathto/LLVMFuzzer-DSOTest
UNCOVERED_LINE: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:21
UNCOVERED_LINE: in LLVMFuzzerTestOneInput /pathto/DSOTestMain.cpp:27
UNCOVERED_FILE: /pathto/DSOTestExtra.cpp

Several things are not perfect here:
* we are using objdump+awk instead of sancov because sancov does not support DSOs yet.
* this breaks in the presence of ASAN_OPTIONS=strip_path_prefix=...
  (need to implement another API to get the module name by PC)

llvm-svn: 284554

8 years ago[CUDA] Rework tests now that we emit deferred diagnostics during sema. Test-only...
Justin Lebar [Wed, 19 Oct 2016 00:06:49 +0000 (00:06 +0000)]
[CUDA] Rework tests now that we emit deferred diagnostics during sema.  Test-only change.

Summary:
Previously we had to split out a lot of our tests into a test that
checked only immediate errors and a test that checked only deferred
errors.  This was because, if you emitted any immediate errors, we
wouldn't run codegen, where the deferred errors were emitted.

We've fixed this, and now emit deferred errors during sema.  This lets
us merge a bunch of tests, and lets us convert some other tests to
-fsyntax-only.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 284553

8 years agoWhen invoking Terminal, don't assume the default shell
Chris Bieneman [Tue, 18 Oct 2016 23:55:34 +0000 (23:55 +0000)]
When invoking Terminal, don't assume the default shell

Summary:
If a user has their shell set to a non-POSIX conferment shell the TestTerminal.py tests fail because the shell blurb constructed here may not work in their shell.

In my specific case fish-shell (The Friendly Interactive Shell - http://fishshell.com) does not support $?, it instead uses $status (because it is friendly).

This patch removes the assumption of your default shell by running the constructed bash command via "/bin/bash -c ...". This should be safer for users mutating their shell environment.

Reviewers: tfiala

Subscribers: joerg, lldb-commits

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

llvm-svn: 284552

8 years ago[CMake] Don't include LLDB_TEST_COMPILER in cached variable
Chris Bieneman [Tue, 18 Oct 2016 23:54:28 +0000 (23:54 +0000)]
[CMake] Don't include LLDB_TEST_COMPILER in cached variable

Summary:
CMake has no builtin mechanism for cache invalidation. As a general convention you want to not expand user-specified variables in other cached variables because they will not get updated when the user changes their specified value.

This patch moves the "-C" option for dotest.py into the LLDB_TEST_COMMON_ARGS and out of the CMake cache. In order to prevent issues with out-of-date cache files on builders I've added code to scrub "-C ${LLDB_TEST_COMPILER}" out of the CMake caches, by Force writing the variable. This code can be removed in a few days once the change has trickled through CI systems.

Reviewers: tfiala, labath, zturner

Subscribers: lldb-commits, mgorny

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

llvm-svn: 284551

8 years agoUse clang --driver-mode instead of guessing c++ compiler path
Chris Bieneman [Tue, 18 Oct 2016 23:53:24 +0000 (23:53 +0000)]
Use clang --driver-mode instead of guessing c++ compiler path

Summary:
When building the LLDB test programs, if your CC is clang it actually isn't safe to make CXX a string replace of "clang -> clang++". This falls down on unix configurations if your compiler is clang-${version}.

A safer approach is to use the "--driver-mode=g++" option to tell clang to act like clang++.

Reviewers: tfiala, zturner, labath

Subscribers: lldb-commits

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

llvm-svn: 284550

8 years agoDR1330: instantiate exception-specifications when "needed". We previously did
Richard Smith [Tue, 18 Oct 2016 23:39:12 +0000 (23:39 +0000)]
DR1330: instantiate exception-specifications when "needed". We previously did
not instantiate exception specifications of functions if they were only used in
unevaluated contexts (other than 'noexcept' expressions).

In C++17 onwards, this becomes essential since the exception specification is
now part of the function's type.

Note that this means that constructs like the following no longer work:

  struct A {
    static T f() noexcept(...);
    decltype(f()) *p;
  };

... because the decltype expression now needs the exception specification of
'f', which has not yet been parsed.

llvm-svn: 284549

8 years ago[asan] Update test for D25715
Vitaly Buka [Tue, 18 Oct 2016 23:30:07 +0000 (23:30 +0000)]
[asan] Update test for D25715

Reviewers: eugenis

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 284548

8 years ago[asan] Simplify calculation of stack frame layout extraction calculation of stack...
Vitaly Buka [Tue, 18 Oct 2016 23:29:52 +0000 (23:29 +0000)]
[asan] Simplify calculation of stack frame layout extraction calculation of stack description into separate function.

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 284547

8 years ago[asan] Append line number to variable name if line is available and in the same file...
Vitaly Buka [Tue, 18 Oct 2016 23:29:41 +0000 (23:29 +0000)]
[asan] Append line number to variable name if line is available and in the same file as the function.

PR30498

Reviewers: eugenis

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

llvm-svn: 284546

8 years agoUsing branch probability to guide critical edge splitting.
Dehao Chen [Tue, 18 Oct 2016 23:24:02 +0000 (23:24 +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

llvm-svn: 284545

8 years agorevert r284541.
Dehao Chen [Tue, 18 Oct 2016 23:11:20 +0000 (23:11 +0000)]
revert r284541.

llvm-svn: 284544

8 years ago[test] Fix buildbot after SCEV change.
Michael Kruse [Tue, 18 Oct 2016 22:58:09 +0000 (22:58 +0000)]
[test] Fix buildbot after SCEV change.

Update test after commit r284501:
[SCEV] Make CompareValueComplexity a little bit smarter

Contributed-by: Sanjoy Das <sanjoy@playingwithpointers.com>
llvm-svn: 284543