platform/upstream/llvm.git
6 years ago[TableGen] Add a general-purpose JSON backend.
Simon Tatham [Wed, 11 Jul 2018 08:40:19 +0000 (08:40 +0000)]
[TableGen] Add a general-purpose JSON backend.

The aim of this backend is to output everything TableGen knows about
the record set, similarly to the default -print-records backend. But
where -print-records produces output in TableGen's input syntax
(convenient for humans to read), this backend produces it as
structured JSON data, which is convenient for loading into standard
scripting languages such as Python, in order to extract information
from the data set in an automated way.

The output data contains a JSON representation of the variable
definitions in output 'def' records, and a few pieces of metadata such
as which of those definitions are tagged with the 'field' prefix and
which defs are derived from which classes. It doesn't dump out
absolutely every piece of knowledge it _could_ produce, such as type
information and complicated arithmetic operator nodes in abstract
superclasses; the main aim is to allow consumers of this JSON dump to
essentially act as new backends, and backends don't generally need to
depend on that kind of data.

The new backend is implemented as an EmitJSON() function similar to
all of llvm-tblgen's other EmitFoo functions, except that it lives in
lib/TableGen instead of utils/TableGen on the basis that I'm expecting
to add it to clang-tblgen too in a future patch.

To test it, I've written a Python script that loads the JSON output
and tests properties of it based on comments in the .td source - more
or less like FileCheck, except that the CHECK: lines have Python
expressions after them instead of textual pattern matches.

Reviewers: nhaehnle

Reviewed By: nhaehnle

Subscribers: arichardson, labath, mgorny, llvm-commits

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

llvm-svn: 336771

6 years ago[WebAssembly] Only call llvm::value::dump() in debug build.
Eric Liu [Wed, 11 Jul 2018 08:16:47 +0000 (08:16 +0000)]
[WebAssembly] Only call llvm::value::dump() in debug build.

This fixes compile error in r336759. llvm::value::dump is not available
in released build.

llvm-svn: 336770

6 years ago[XRay] basic mode PID and TID always fetch
Dean Michael Berris [Wed, 11 Jul 2018 07:14:27 +0000 (07:14 +0000)]
[XRay] basic mode PID and TID always fetch

Summary: XRayRecords now includes a PID field. Basic handlers fetch pid and tid each time they are called instead of caching the value. Added a testcase that calls fork and checks if the child TID is different from the parent TID to verify that the processes' TID are different in the trace.

Reviewers: dberris, Maknee

Reviewed By: dberris, Maknee

Subscribers: kpw, llvm-commits, #sanitizers

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

llvm-svn: 336769

6 years ago[X86] The TEST instruction is eliminated when BSF/TZCNT is used
Craig Topper [Wed, 11 Jul 2018 06:57:42 +0000 (06:57 +0000)]
[X86] The TEST instruction is eliminated when BSF/TZCNT is used

Summary:
These changes cover the PR#31399.
Now the ffs(x) function is lowered to (x != 0) ? llvm.cttz(x) + 1 : 0
and it corresponds to the following llvm code:
  %cnt = tail call i32 @llvm.cttz.i32(i32 %v, i1 true)
  %tobool = icmp eq i32 %v, 0
  %.op = add nuw nsw i32 %cnt, 1
  %add = select i1 %tobool, i32 0, i32 %.op
and x86 asm code:
  bsfl     %edi, %ecx
  addl     $1, %ecx
  testl    %edi, %edi
  movl     $0, %eax
  cmovnel  %ecx, %eax
In this case the 'test' instruction can't be eliminated because
the 'add' instruction modifies the EFLAGS, namely, ZF flag
that is set by the 'bsf' instruction when 'x' is zero.

We now produce the following code:
  bsfl     %edi, %ecx
  movl     $-1, %eax
  cmovnel  %ecx, %eax
  addl     $1, %eax

Patch by Ivan Kulagin

Reviewers: davide, craig.topper, spatel, RKSimon

Reviewed By: craig.topper

Subscribers: llvm-commits

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

llvm-svn: 336768

6 years agoRevert r336760: "[ORC] Add unit tests for the reexports utility that were..."
Lang Hames [Wed, 11 Jul 2018 06:46:17 +0000 (06:46 +0000)]
Revert r336760: "[ORC] Add unit tests for the reexports utility that were..."

This patch broke a few buildbots. I will investigate and re-apply when I have
a fix.

llvm-svn: 336767

6 years ago[X86] Remove some composite MOVSS/MOVSD isel patterns.
Craig Topper [Wed, 11 Jul 2018 04:51:40 +0000 (04:51 +0000)]
[X86] Remove some composite MOVSS/MOVSD isel patterns.

These patterns looked for a MOVSS/SD followed by a scalar_to_vector. Or a scalar_to_vector followed by a load.

In both cases we emitted a MOVSS/SD for the MOVSS/SD part, a REG_CLASS for the scalar_to_vector, and a MOVSS/SD for the load.

But we have patterns that do each of those 3 things individually so there's no reason to build large patterns.

Most of the test changes are just reorderings. The one test that had a meaningful change is pr30430.ll and it appears to be a regression. But its doing -O0 so I think it missed a lot of opportunities and was just getting lucky before.

llvm-svn: 336762

6 years ago[ORC] Remove a shadowing definition.
Lang Hames [Wed, 11 Jul 2018 04:39:12 +0000 (04:39 +0000)]
[ORC] Remove a shadowing definition.

There is already a VSO member V in the CoreAPIsStandardTest test fixture.

llvm-svn: 336761

6 years ago[ORC] Add unit tests for the reexports utility that were left out of r336741,
Lang Hames [Wed, 11 Jul 2018 04:39:11 +0000 (04:39 +0000)]
[ORC] Add unit tests for the reexports utility that were left out of r336741,
and fix a bug that these exposed.

llvm-svn: 336760

6 years ago[WebAssembly] Add pass to infer prototypes for prototype-less functions
Sam Clegg [Wed, 11 Jul 2018 04:29:36 +0000 (04:29 +0000)]
[WebAssembly] Add pass to infer prototypes for prototype-less functions

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

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

llvm-svn: 336759

6 years ago[ORC] Drop constexpr in unit test to appease a bot.
Lang Hames [Wed, 11 Jul 2018 03:58:47 +0000 (03:58 +0000)]
[ORC] Drop constexpr in unit test to appease a bot.

llvm-svn: 336758

6 years ago[ORC] Use a gtest fixture to remove a bunch of boilerplate in CoreAPIsTest.cpp.
Lang Hames [Wed, 11 Jul 2018 03:09:36 +0000 (03:09 +0000)]
[ORC] Use a gtest fixture to remove a bunch of boilerplate in CoreAPIsTest.cpp.

llvm-svn: 336757

6 years ago[analyzer] Fix bots by changing the analyzer-config tests.
George Karpenkov [Wed, 11 Jul 2018 02:01:18 +0000 (02:01 +0000)]
[analyzer] Fix bots by changing the analyzer-config tests.

To be investigated.

llvm-svn: 336756

6 years ago[analyzer] Partial revert of https://reviews.llvm.org/D49050
George Karpenkov [Wed, 11 Jul 2018 01:58:08 +0000 (01:58 +0000)]
[analyzer] Partial revert of https://reviews.llvm.org/D49050

llvm-svn: 336755

6 years ago[Power9] Add remaining __flaot128 builtin support for FMA round to odd
Stefan Pintilie [Wed, 11 Jul 2018 01:42:22 +0000 (01:42 +0000)]
[Power9] Add remaining __flaot128 builtin support for FMA round to odd

Implement this as it is done on GCC:

__float128 a, b, c, d;
a = __builtin_fmaf128_round_to_odd (b, c, d);         // generates xsmaddqpo
a = __builtin_fmaf128_round_to_odd (b, c, -d);        // generates xsmsubqpo
a = - __builtin_fmaf128_round_to_odd (b, c, d);       // generates xsnmaddqpo
a = - __builtin_fmaf128_round_to_odd (b, c, -d);      // generates xsnmsubpqp

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

llvm-svn: 336754

6 years ago[analyzer] Pass through all arguments from the registerChecker() to the checker const...
George Karpenkov [Wed, 11 Jul 2018 01:23:27 +0000 (01:23 +0000)]
[analyzer] Pass through all arguments from the registerChecker() to the checker constructor

A lot of checkers could be cleaned up in a similar way

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

llvm-svn: 336753

6 years ago [test cases] add test cases for find more abs pattern
Chen Zheng [Wed, 11 Jul 2018 01:07:21 +0000 (01:07 +0000)]
  [test cases] add test cases for find more abs pattern

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

llvm-svn: 336752

6 years ago[TableGen] Fix some bad formatting. NFC
Craig Topper [Wed, 11 Jul 2018 01:01:55 +0000 (01:01 +0000)]
[TableGen] Fix some bad formatting. NFC

llvm-svn: 336751

6 years ago[SemaCXX] Remove comment from coroutines test, NFC
Brian Gesiak [Wed, 11 Jul 2018 01:00:53 +0000 (01:00 +0000)]
[SemaCXX] Remove comment from coroutines test, NFC

Summary:
The file name was accidentally included when the test file was added.

Test Plan: check-clang

llvm-svn: 336750

6 years agoAdd libcxxabi option back for sanitizer use.
Stephen Hines [Wed, 11 Jul 2018 00:50:03 +0000 (00:50 +0000)]
Add libcxxabi option back for sanitizer use.

Summary:
A prior refactoring accidentally dropped the case for using libc++abi as
the out-of-tree C++ runtime library for sanitizers. This patch restores
that functionality, which is used by Android, which can't depend on the
full libc++ for these libraries.

Reviewers: phosek, EricWF

Reviewed By: phosek

Subscribers: meikeb, kongyi, chh, mgorny, delcypher, llvm-commits, #sanitizers, pirama

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

llvm-svn: 336749

6 years agoRemove qualtype qualifier in coroutine error to prevent assert in debug
Brian Gesiak [Wed, 11 Jul 2018 00:45:48 +0000 (00:45 +0000)]
Remove qualtype qualifier in coroutine error to prevent assert in debug

Summary:
A forward-declared coroutine_traits should trip an error; we need
a complete type.

Unfortunately, in debug mode only, we trip an assert when attempting
to provide the fully qualified type for the error message.
If you try to compile a program with a forward-declared
coroutine_traits in debug mode, clang will crash.

I've included a test for the behavior and removed the q modifier
on the error message. This prevents the crash in debug mode and
does not change the behavior for the error message on a
forward-declaration of a coroutine_traits type.

Test Plan:
I've included a test for the forward-declaration.

Patch by Tanoy Sinha!

Reviewers: modocache, GorNishanov

Reviewed By: modocache

Subscribers: cfe-commits

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

llvm-svn: 336748

6 years ago[docs] List correct default for -ftemplate-depth; also add missing
Richard Smith [Wed, 11 Jul 2018 00:34:54 +0000 (00:34 +0000)]
[docs] List correct default for -ftemplate-depth; also add missing
documentation for -fconstexpr-steps.

llvm-svn: 336747

6 years agoPR38095: Allow constant-folding of loads through bitcasted pointers if
Richard Smith [Wed, 11 Jul 2018 00:29:05 +0000 (00:29 +0000)]
PR38095: Allow constant-folding of loads through bitcasted pointers if
the bitcast only changed cvr-qualifications within the pointer type.

llvm-svn: 336746

6 years agoDR330: look through array types when forming the cv-decomposition of a type.
Richard Smith [Wed, 11 Jul 2018 00:19:19 +0000 (00:19 +0000)]
DR330: look through array types when forming the cv-decomposition of a type.

This allows more qualification conversions, eg. conversion from
   'int *(*)[]' -> 'const int *const (*)[]'
is now permitted, along with all the consequences of that: more types
are similar, more cases are permitted by const_cast, and conversely,
fewer "casting away constness" cases are permitted by reinterpret_cast.

llvm-svn: 336745

6 years ago[LangRef] Clarify alloca of zero bytes.
Eli Friedman [Wed, 11 Jul 2018 00:02:01 +0000 (00:02 +0000)]
[LangRef] Clarify alloca of zero bytes.

Let's be conservative here; it matches what we actually implemented, and
it should be rare in practice anyway.

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

llvm-svn: 336744

6 years agoRefactor GdbIndexSection. NFC.
Rui Ueyama [Tue, 10 Jul 2018 23:48:27 +0000 (23:48 +0000)]
Refactor GdbIndexSection. NFC.

This patch merges createGdbIndex function and GdbIndexSection's
constructor into a single static member function of the class.

This patch also change how we keep CU vectors. Previously, CuVector
and GdbSymbols were parallel arrays, but there's no reason to choose that
design. Now, CuVector is a member of GdbSymbol class.

A lot of members are removed from GdbIndexSection. Previously, it has
members that need to be kept in sync over several phases. I belive the new
design is less error-prone, and the new code is much easier to read
than before.

llvm-svn: 336743

6 years ago[ARM] Treat cmn immediates as legal in isLegalICmpImmediate.
Eli Friedman [Tue, 10 Jul 2018 23:44:37 +0000 (23:44 +0000)]
[ARM] Treat cmn immediates as legal in isLegalICmpImmediate.

The original code attempted to do this, but the std::abs() call didn't
actually do anything due to implicit type conversions.  Fix the type
conversions, and perform the correct check for negative immediates.

This probably has very little practical impact, but it's worth fixing
just to avoid confusion in the future, I think.

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

llvm-svn: 336742

6 years ago[ORC] Generalize alias materialization to support re-exports (i.e. aliasing of
Lang Hames [Tue, 10 Jul 2018 23:34:56 +0000 (23:34 +0000)]
[ORC] Generalize alias materialization to support re-exports (i.e. aliasing of
symbols in another VSO).

Also fixes a bug where chained aliases within a single VSO would deadlock on
materialization.

llvm-svn: 336741

6 years ago[X86] Also fix the test for _mm512_mullo_epi64 to test the intrinsic instead of a...
Craig Topper [Tue, 10 Jul 2018 23:28:05 +0000 (23:28 +0000)]
[X86] Also fix the test for _mm512_mullo_epi64 to test the intrinsic instead of a copy of the intrinsic implementation.

This had the same issue I just fixed in r336739. Apparently I copy pasted _mm512_mullo_epi64 when I added _mm512_mullox_epi64.

llvm-svn: 336740

6 years ago[X86] Fix the test for _mm512_mullox_epi64 to test the intrinsic instead of a copy...
Craig Topper [Tue, 10 Jul 2018 23:13:01 +0000 (23:13 +0000)]
[X86] Fix the test for _mm512_mullox_epi64 to test the intrinsic instead of a copy of the intrinsic implementation.

llvm-svn: 336739

6 years agoFix determination of whether a reinterpret_cast casts away constness.
Richard Smith [Tue, 10 Jul 2018 23:04:35 +0000 (23:04 +0000)]
Fix determination of whether a reinterpret_cast casts away constness.

The "casts away constness" check doesn't care at all how the different
layers of the source and destination type were formed: for example, if
the source is a pointer and the destination is a pointer-to-member, the
types are still decomposed and their pointee qualifications are still
checked.

This rule is bizarre and somewhat ridiculous, so as an extension we
accept code making use of such reinterpret_casts with a warning outside
of SFINAE contexts.

llvm-svn: 336738

6 years agoUse ExprMutationAnalyzer in performance-for-range-copy
Shuai Wang [Tue, 10 Jul 2018 22:51:06 +0000 (22:51 +0000)]
Use ExprMutationAnalyzer in performance-for-range-copy

Summary:
This gives better coverage to the check as ExprMutationAnalyzer is more
accurate comparing to isOnlyUsedAsConst.

Majority of wins come from const usage of member field, e.g.:
for (auto widget : container) { // copy of loop variable
  if (widget.type == BUTTON) { // const usage only recognized by ExprMutationAnalyzer
    // ...
  }
}

Reviewers: george.karpenkov

Subscribers: a.sidorin, cfe-commits

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

llvm-svn: 336737

6 years agoSort includes + include a missing `extern "C"` header
George Burgess IV [Tue, 10 Jul 2018 22:48:13 +0000 (22:48 +0000)]
Sort includes + include a missing `extern "C"` header

If we don't include Initialization.h,
`LLVMInitializeAggressiveInstCombiner` won't see its `extern "C"` decl.
This causes sadness, name mangling, and linker errors.

Reported on the mailing lists by Vladimir Vissoultchev. Thanks!

llvm-svn: 336736

6 years ago[X86] Remove AddedComplexity from all patterns that use X86vzmovl as their root.
Craig Topper [Tue, 10 Jul 2018 22:23:54 +0000 (22:23 +0000)]
[X86] Remove AddedComplexity from all patterns that use X86vzmovl as their root.

Some added 20 and some added 15. Its unclear when to use which value and whether they are required at all.

This patch removes them all. If we start finding real world issues we may need to add them back with proper tests.

llvm-svn: 336735

6 years agoRefactor ClangUserExpression::Parse [NFC]
Raphael Isemann [Tue, 10 Jul 2018 22:12:39 +0000 (22:12 +0000)]
Refactor ClangUserExpression::Parse [NFC]

Summary:
This patch splits out functionality from the `Parse` method into different methods.
This benefits the code completion work (which should reuse those methods) and makes the
code a bit more readable.

Note that this patch is as minimal as possible. Some of the code in the new methods definitely
needs more refactoring.

Subscribers: lldb-commits

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

llvm-svn: 336734

6 years agoFix -Wmismatched-tags warning
Richard Trieu [Tue, 10 Jul 2018 22:09:33 +0000 (22:09 +0000)]
Fix -Wmismatched-tags warning

class -> struct in forward declaration.

llvm-svn: 336733

6 years ago[windows] LLDB shows the wrong values when register read is executed at a frame other...
Stella Stamenova [Tue, 10 Jul 2018 22:05:33 +0000 (22:05 +0000)]
[windows] LLDB shows the wrong values when register read is executed at a frame other than zero

Summary:
This is a clean version of the change suggested here: https://bugs.llvm.org/show_bug.cgi?id=37495

The main change is to follow the same pattern as non-windows targets and use an unwinder object to retrieve the register context. I also changed a couple of the comments to actually log, so that issues with unsupported scenarios can be tracked down more easily. Lastly, ClearStackFrames is implemented in the base class, so individual thread implementations don't have to override it.

Reviewers: asmith, zturner, aleksandr.urakov

Reviewed By: aleksandr.urakov

Subscribers: emaste, stella.stamenova, tatyana-krasnukha, llvm-commits

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

llvm-svn: 336732

6 years ago[X86] Teach X86InstrInfo::commuteInstructionImpl to use MOVSD/MOVSS for BLEND under...
Craig Topper [Tue, 10 Jul 2018 22:02:23 +0000 (22:02 +0000)]
[X86] Teach X86InstrInfo::commuteInstructionImpl to use MOVSD/MOVSS for BLEND under optsize when the immediate allows it.

Isel currently emits movss/movsd a lot of the time and an accidental double commute turns it into a blend.

Ideally we'd select blend directly in isel under optspeed and not rely on the double commute to create blend.

llvm-svn: 336731

6 years ago[NFC] typo
JF Bastien [Tue, 10 Jul 2018 21:52:39 +0000 (21:52 +0000)]
[NFC] typo

llvm-svn: 336730

6 years ago[NFC] Switch CodeGenFunction to use value init instead of member init lists
Erich Keane [Tue, 10 Jul 2018 21:07:50 +0000 (21:07 +0000)]
[NFC] Switch CodeGenFunction to use value init instead of member init lists

The member init list for the sole constructor for CodeGenFunction
has gotten out of hand, so this patch moves the non-parameter-dependent
initializations into the member value inits.

Note: This is what was intended to be committed in r336726
llvm-svn: 336729

6 years ago[X86] Remove X86ISD::MOVLPS and X86ISD::MOVLPD. NFCI
Craig Topper [Tue, 10 Jul 2018 21:00:22 +0000 (21:00 +0000)]
[X86] Remove X86ISD::MOVLPS and X86ISD::MOVLPD. NFCI

These ISD nodes try to select the MOVLPS and MOVLPD instructions which are special load only instructions. They load data and merge it into the lower 64-bits of an XMM register. They are logically equivalent to our MOVSD node plus a load.

There was only one place in X86ISelLowering that used MOVLPD and no places that selected MOVLPS. The one place that selected MOVLPD had to choose between it and MOVSD based on whether there was a load. But lowering is too early to tell if the load can really be folded. So in isel we have patterns that use MOVSD for MOVLPD if we can't find a load.

We also had patterns that select the MOVLPD instruction for a MOVSD if we can find a load, but didn't choose the MOVLPD ISD opcode for some reason.

So it seems better to just standardize on MOVSD ISD opcode and manage MOVSD vs MOVLPD instruction with isel patterns.

llvm-svn: 336728

6 years agoRevert -r336726, which included more files than intended.
Erich Keane [Tue, 10 Jul 2018 20:51:41 +0000 (20:51 +0000)]
Revert -r336726, which included more files than intended.

llvm-svn: 336727

6 years ago[NFC] Switch CodeGenFunction to use value init instead of member init lists
Erich Keane [Tue, 10 Jul 2018 20:46:46 +0000 (20:46 +0000)]
[NFC] Switch CodeGenFunction to use value init instead of member init lists

The member init list for the sole constructor for CodeGenFunction
has gotten out of hand, so this patch moves the non-parameter-dependent
initializations into the member value inits.

llvm-svn: 336726

6 years ago[libFuzzer] Disable dataflow.test on AArch64.
Matt Morehouse [Tue, 10 Jul 2018 20:45:36 +0000 (20:45 +0000)]
[libFuzzer] Disable dataflow.test on AArch64.

Summary:
After my recent change to allow MSan + libFuzzer, the
ExplodeDFSanLabelsTest.cpp test started to overflow the stack with
recursive function SetBytesForLabel() on an AArch64 bot.  Perhaps that
bot has a smaller stack size, or maybe AArch64 has larger stack frames
for this particular function.

Reviewers: kcc, javed.absar

Reviewed By: kcc

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 336725

6 years ago[testsuite] Implement a category to skip libstdcxx tests
Davide Italiano [Tue, 10 Jul 2018 20:37:24 +0000 (20:37 +0000)]
[testsuite] Implement a category to skip libstdcxx tests

On systems where it's not supported.
As far as I understand Linux is the only systems which now ships
with libstdcxx (maybe NetBSD?, but I'm not entirely sure of the
state of lldb on the platform).
We could make this more fine grained looking for the header as
we do for libcxx. This is a little tricky as there's no such
thing as /usr/include/c++/v1, but libstdcxx encodes the version
number in the path (i.e. /usr/include/c++/5.4). I guess we might
match a regex, but it seems fragile to me.

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

llvm-svn: 336724

6 years agoRefactor parsing of option lists with a raw string suffix.
Raphael Isemann [Tue, 10 Jul 2018 20:17:38 +0000 (20:17 +0000)]
Refactor parsing of option lists with a raw string suffix.

Summary:
A subset of the LLDB commands follows this command line interface style:
   <command name> [arguments] -- <string suffix>
The parsing code for this interface has been so far been duplicated into the different
command objects which makes it hard to maintain and reuse elsewhere.

This patches improves the situation by adding a OptionsWithRaw class that centralizes
the parsing logic and allows easier testing. The different commands now just call this class to
extract the arguments and the raw suffix from the provided user input.

Reviewers: jingham

Reviewed By: jingham

Subscribers: mgorny, lldb-commits

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

llvm-svn: 336723

6 years ago[AMDGPU] Fix layering issue with AMDGPUHSAMetadataStreamer (NFC)
Scott Linder [Tue, 10 Jul 2018 20:07:22 +0000 (20:07 +0000)]
[AMDGPU] Fix layering issue with AMDGPUHSAMetadataStreamer (NFC)

llvm-svn: 336722

6 years ago[ThinLTO] Use std::map to get determistic imports files
Teresa Johnson [Tue, 10 Jul 2018 20:06:04 +0000 (20:06 +0000)]
[ThinLTO] Use std::map to get determistic imports files

Summary:
I noticed that the .imports files emitted for distributed ThinLTO
backends do not have consistent ordering. This is because StringMap
iteration order is not guaranteed to be deterministic. Since we already
have a std::map with this information, used when emitting the individual
index files (ModuleToSummariesForIndex), use it for the imports files as
well.

This issue is likely causing some unnecessary rebuilds of the ThinLTO
backends in our distributed build system as the imports files are inputs
to those backends.

Reviewers: pcc, steven_wu, mehdi_amini

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 336721

6 years ago[X86] Remove dead SDNode object from X86InstrFragmentsSIMD.td. NFC
Craig Topper [Tue, 10 Jul 2018 20:03:51 +0000 (20:03 +0000)]
[X86] Remove dead SDNode object from X86InstrFragmentsSIMD.td. NFC

It points to an opcode that doesn't exist.

llvm-svn: 336720

6 years agoRevert "[Fuzzer] Afl driver changing iterations handling"
Matt Morehouse [Tue, 10 Jul 2018 19:58:42 +0000 (19:58 +0000)]
Revert "[Fuzzer] Afl driver changing iterations handling"

This reverts rL334510 due to breakage of afl_driver's command line
interface.

Patch By: Jonathan Metzman

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

llvm-svn: 336719

6 years agoRevert r336653 "[VPlan] Add VPlanTestBase.h with helper class to build VPlan for...
Evgeniy Stepanov [Tue, 10 Jul 2018 19:56:10 +0000 (19:56 +0000)]
Revert r336653 "[VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests."

Memory leaks in tests.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/6289/steps/check-llvm%20asan/logs/stdio

Direct leak of 192 byte(s) in 1 object(s) allocated from:
    #0 0x554ea8 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:106
    #1 0x56cef1 in llvm::VPlanTestBase::doAnalysis(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h:53:14
    #2 0x56bec4 in llvm::VPlanTestBase::buildHCFG(llvm::BasicBlock*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h:57:3
    #3 0x571f1e in llvm::(anonymous namespace)::VPlanHCFGTest_testVPInstructionToVPRecipesInner_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp:119:15
    #4 0xed2291 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #5 0xed44c8 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #6 0xed5890 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #7 0xef3634 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #8 0xef27e0 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #9 0xebbc23 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #10 0xebbc23 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:51
    #11 0x7f65569592e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

and more.

llvm-svn: 336718

6 years agoPatch to fix pragma metadata for do-while loops
Bjorn Pettersson [Tue, 10 Jul 2018 19:55:02 +0000 (19:55 +0000)]
Patch to fix pragma metadata for do-while loops

Summary:
Make sure that loop metadata only is put on the backedge
when expanding a do-while loop.
Previously we added the loop metadata also on the branch
in the pre-header. That could confuse optimization passes
and result in the loop metadata being associated with the
wrong loop.

Fixes https://bugs.llvm.org/show_bug.cgi?id=38011

Committing on behalf of deepak2427 (Deepak Panickal)

Reviewers: #clang, ABataev, hfinkel, aaron.ballman, bjope

Reviewed By: bjope

Subscribers: bjope, rsmith, shenhan, zzheng, xbolva00, lebedev.ri, cfe-commits

Tags: #clang

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

llvm-svn: 336717

6 years agoRevert r336590 "[libclang] evalute compound statement cursors before trying to evaluate"
Evgeniy Stepanov [Tue, 10 Jul 2018 19:49:07 +0000 (19:49 +0000)]
Revert r336590 "[libclang] evalute compound statement cursors before trying to evaluate"

New memory leaks in
LibclangParseTest_EvaluateChildExpression_Test::TestBody()

llvm-svn: 336716

6 years agoRevert r336591 "[libclang] NFC, simplify clang_Cursor_Evaluate"
Evgeniy Stepanov [Tue, 10 Jul 2018 19:48:53 +0000 (19:48 +0000)]
Revert r336591 "[libclang] NFC, simplify clang_Cursor_Evaluate"

This change is blocking r336590 which is being reverted due to memory leaks.

llvm-svn: 336715

6 years agoLimit ASan non-executable-pc test case to x86 bots
Vlad Tsyrklevich [Tue, 10 Jul 2018 19:34:46 +0000 (19:34 +0000)]
Limit ASan non-executable-pc test case to x86 bots

The test case fails on the big-endian PPC bot, probably because PowerPC
uses function descriptors. More over other architectures don't support
NX mappings. (This test case was not being exercised prior to r336633.)

llvm-svn: 336714

6 years ago[CMake] Set per-runtime library directory suffix in runtimes build
Petr Hosek [Tue, 10 Jul 2018 19:13:33 +0000 (19:13 +0000)]
[CMake] Set per-runtime library directory suffix in runtimes build

Do not use LLVM_RUNTIMES_LIBDIR_SUFFIX variable which is an internal
variable used by the runtimes build from individual runtimes, instead
set per-runtime librarhy directory suffix variable which is necessary
for the sanitized runtimes build to install libraries into correct
location.

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

llvm-svn: 336713

6 years ago[X86] Remove AddedComplexity from register form of NOT. NFCI
Craig Topper [Tue, 10 Jul 2018 19:09:00 +0000 (19:09 +0000)]
[X86] Remove AddedComplexity from register form of NOT. NFCI

I believe isProfitableToFold will stop the load folding that this was intended to overcome.

Given an (xor load, -1), isProfitableToFold will see that the immediate can be folded with the xor using a one byte immediate since it can be sign extended. It doesn't know about NOT, but the one byte immediate check is enough to stop the fold.

llvm-svn: 336712

6 years ago[X86] Remove AddedComplexity from MMX_X86movw2d patterns.
Craig Topper [Tue, 10 Jul 2018 18:41:58 +0000 (18:41 +0000)]
[X86] Remove AddedComplexity from MMX_X86movw2d patterns.

There were only 3 patterns with this node as a root and they all the same AddedComplexity. So this doesn't really do anything.

llvm-svn: 336711

6 years agoFix a typo/regression in r335495.
John Baldwin [Tue, 10 Jul 2018 17:44:08 +0000 (17:44 +0000)]
Fix a typo/regression in r335495.

Use getTriple.isMIPS64() to detect 64-bit MIPS ABIs in
FreeBSD::getSupportedSanitizers() instead of getTriple.isMIPS32().

Reviewed By: atanasyan

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

llvm-svn: 336710

6 years ago[libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITY
Louis Dionne [Tue, 10 Jul 2018 17:38:30 +0000 (17:38 +0000)]
[libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITY

Summary:
It was defined with the right visibility, but declared without any visibility.
This function was left out of a prior revision that did the same to several
functions in <compare> (r336665) because the compiler I used didn't support
coroutines. This reinforces the need for automated checks -- there might
still be several cases of this throughout the library.

Reviewers: EricWF

Subscribers: modocache, christof, dexonsmith, llvm-commits

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

llvm-svn: 336709

6 years ago[CMake] Teach the build system to codesign built products
Justin Bogner [Tue, 10 Jul 2018 17:32:48 +0000 (17:32 +0000)]
[CMake] Teach the build system to codesign built products

Automatically codesign all executables and dynamic libraries if a
codesigning identity is given (via LLVM_CODESIGNING_IDENTITY). This
option is darwin only for now.

Also update platforms/iOS.cmake to pick up the right versions of
codesign and codesign_allocate.

llvm-svn: 336708

6 years ago[AMDGPU] Refactor HSAMetadataStream::emitKernel (NFC)
Scott Linder [Tue, 10 Jul 2018 17:31:32 +0000 (17:31 +0000)]
[AMDGPU] Refactor HSAMetadataStream::emitKernel (NFC)

Move all metadata construction into AMDGPUHSAMetadataStreamer.

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

llvm-svn: 336707

6 years ago[gcov] Fix fallout from r336693
Ulrich Weigand [Tue, 10 Jul 2018 17:08:05 +0000 (17:08 +0000)]
[gcov] Fix fallout from r336693

Fix building GCDAProfiling.c with pre-C99 compilers.
This caused a build bot failure.

llvm-svn: 336706

6 years ago[asan] Disable non-execute test on s390
Ulrich Weigand [Tue, 10 Jul 2018 16:55:27 +0000 (16:55 +0000)]
[asan] Disable non-execute test on s390

Processors before z14 don't support non-execute protection,
so they will start execution random memory contents, causing
the test to randomly fail or succeed.

llvm-svn: 336705

6 years ago[ELF][MIPS] Add mote tests on MipsArchTree routines, fix typos in error messages
Simon Atanasyan [Tue, 10 Jul 2018 16:51:17 +0000 (16:51 +0000)]
[ELF][MIPS] Add mote tests on MipsArchTree routines, fix typos in error messages

This fix add more test cases for routines check MIPS ELF header flags and
flags from .MIPS.abiflags sections. The tests use yaml2obj for object
files generation because not all combinations of flags can be produced
by LLVM tools.

llvm-svn: 336704

6 years ago[GlobalISel][X86_64] Support for G_SITOFP
Alexander Ivchenko [Tue, 10 Jul 2018 16:38:35 +0000 (16:38 +0000)]
[GlobalISel][X86_64] Support for G_SITOFP

The instruction selection is automatically handled by tablegen

llvm-svn: 336703

6 years ago[Evaluator] Examine alias when evaluating function call
Eugene Leviant [Tue, 10 Jul 2018 16:34:23 +0000 (16:34 +0000)]
[Evaluator] Examine alias when evaluating function call

This fixes PR38120

llvm-svn: 336702

6 years ago[DAGCombiner] Add special case fast paths for udiv x,1 and udiv x,-1
Simon Pilgrim [Tue, 10 Jul 2018 16:33:07 +0000 (16:33 +0000)]
[DAGCombiner] Add special case fast paths for udiv x,1 and udiv x,-1

udiv x,-1 was going down the (slow) BuildUDIV route resulting in unnecessary shifts.

llvm-svn: 336701

6 years agoInitialize a variable properly to fix buildbots.
Rui Ueyama [Tue, 10 Jul 2018 16:26:15 +0000 (16:26 +0000)]
Initialize a variable properly to fix buildbots.

llvm-svn: 336700

6 years agoTry to fix broken build due to r336663.
Dan Liew [Tue, 10 Jul 2018 16:22:05 +0000 (16:22 +0000)]
Try to fix broken build due to r336663.

It turns out that the `${XRAY_HEADERS}` CMake variable was already
in use and was used for public headers. It seems that
`lib/xray/tests/CMakeLists.txt` was depending on this.

To fix rename the new `${XRAY_HEADERS}` to `${XRAY_IMPL_HEADERS}`.

llvm-svn: 336699

6 years agoRevert "[AccelTable] Provide abstraction for emitting DWARF5 accelerator tables."
Jonas Devlieghere [Tue, 10 Jul 2018 16:18:56 +0000 (16:18 +0000)]
Revert "[AccelTable] Provide abstraction for emitting DWARF5 accelerator tables."

This reverts r336529 because an alternative approach turned out to be a
better fit for dsymuil.

llvm-svn: 336698

6 years agoAMDGPU: Make hidden argument metadata consistent with
Konstantin Zhuravlyov [Tue, 10 Jul 2018 16:12:51 +0000 (16:12 +0000)]
AMDGPU: Make hidden argument metadata consistent with
amdgpu-implicitarg-num-bytes attribute

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

llvm-svn: 336697

6 years ago[InstCombine] allow flag propagation when using safe constant
Sanjay Patel [Tue, 10 Jul 2018 16:09:49 +0000 (16:09 +0000)]
[InstCombine] allow flag propagation when using safe constant

This corresponds with the code for the single binop pattern
added in rL336684.

llvm-svn: 336696

6 years agoRemove s390x XFAILs now that gcov profiling works.
Ulrich Weigand [Tue, 10 Jul 2018 16:09:24 +0000 (16:09 +0000)]
Remove s390x XFAILs now that gcov profiling works.

llvm-svn: 336695

6 years ago[X86] Add srem/udiv/urem by constant tests
Simon Pilgrim [Tue, 10 Jul 2018 16:08:28 +0000 (16:08 +0000)]
[X86] Add srem/udiv/urem by constant tests

Match the tests in combine-sdiv.ll

llvm-svn: 336694

6 years ago[gcov] Fix gcov profiling on big-endian machines
Ulrich Weigand [Tue, 10 Jul 2018 16:08:27 +0000 (16:08 +0000)]
[gcov] Fix gcov profiling on big-endian machines

Two fixes required to handle big-endian systems:

- 64-bit counter values are stored in a mixed-endian format in the
gcov files: a 32-bit low-part followed by a 32-bit high part. Note that
this is already implemented correctly on the LLVM side, see
GCOVBuffer::readInt64.

- The tag values (e.g. arcs tag, object summary tag, ...) are aways
written as the same sequence of bytes independent of byte order. But
when *reading* them back in, the code reads them as 32-bit values in
host byte order. For the comparisons to work correctly, this should
instead always read them as little-endian values.

Fixes PR 38121.

Reviewed By: marco-c

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

llvm-svn: 336693

6 years ago[gcov] Fix ABI when calling llvm_gcov_... routines from instrumentation code
Ulrich Weigand [Tue, 10 Jul 2018 16:05:47 +0000 (16:05 +0000)]
[gcov] Fix ABI when calling llvm_gcov_... routines from instrumentation code

The llvm_gcov_... routines in compiler-rt are regular C functions that
need to be called using the proper C ABI for the target. The current
code simply calls them using plain LLVM IR types. Since the type are
mostly simple, this happens to just work on certain targets. But other
targets still need special handling; in particular, it may be necessary
to sign- or zero-extended sub-word values to comply with the ABI. This
caused gcov failures on SystemZ in particular.

Now the very same problem was already fixed for the llvm_profile_ calls
here: https://reviews.llvm.org/D21736

This patch uses the same method to fix the llvm_gcov_ calls, in
particular calls to llvm_gcda_start_file, llvm_gcda_emit_function, and
llvm_gcda_emit_arcs.

Reviewed By: marco-c

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

llvm-svn: 336692

6 years ago[WebAssembly] Add missing a few {{$}}s to a test
Heejin Ahn [Tue, 10 Jul 2018 16:00:43 +0000 (16:00 +0000)]
[WebAssembly] Add missing a few {{$}}s to a test

llvm-svn: 336691

6 years agoMake a struct type declaration private. NFC.
Rui Ueyama [Tue, 10 Jul 2018 15:57:25 +0000 (15:57 +0000)]
Make a struct type declaration private. NFC.

llvm-svn: 336690

6 years agoAMDGPU/NFC: Fix typo in test name
Konstantin Zhuravlyov [Tue, 10 Jul 2018 15:54:46 +0000 (15:54 +0000)]
AMDGPU/NFC: Fix typo in test name

hsa-metadata-enqueu-kernel.ll ->
hsa-metadata-enqueue-kernel.ll

llvm-svn: 336689

6 years ago[MC] Add interface to finish pending labels.
Jonas Devlieghere [Tue, 10 Jul 2018 15:32:17 +0000 (15:32 +0000)]
[MC] Add interface to finish pending labels.

When manually finishing the object writer in dsymutil, it's possible
that there are pending labels that haven't been resolved. This results
in an assertion when the assembler tries to fixup a label that doesn't
have an address yet.

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

llvm-svn: 336688

6 years agoUpdate test to work on Windows
Paul Robinson [Tue, 10 Jul 2018 15:23:10 +0000 (15:23 +0000)]
Update test to work on Windows

llvm-svn: 336687

6 years agoSimplify. NFC.
Rui Ueyama [Tue, 10 Jul 2018 15:15:56 +0000 (15:15 +0000)]
Simplify. NFC.

llvm-svn: 336686

6 years agoSupport -fdebug-prefix-map for assembler source (pass to cc1as). This
Paul Robinson [Tue, 10 Jul 2018 15:15:24 +0000 (15:15 +0000)]
Support -fdebug-prefix-map for assembler source (pass to cc1as).  This
is useful to omit the debug compilation dir when compiling assembly
files with -g.  Part of PR38050.

Patch by Siddhartha Bagaria!

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

llvm-svn: 336685

6 years ago[InstCombine] safely allow non-commutative binop identity constant folds
Sanjay Patel [Tue, 10 Jul 2018 15:12:31 +0000 (15:12 +0000)]
[InstCombine] safely allow non-commutative binop identity constant folds

This was originally intended with D48893, but as discussed there, we
have to make the folds safe from producing extra poison. This should
give the single binop folds the same capabilities as the existing
folds for 2-binops+shuffle.

LLVM binary opcode review: there are a total of 18 binops. There are 7
commutative binops (add, mul, and, or, xor, fadd, fmul) which we already
fold. We're able to fold 6 more opcodes with this patch (shl, lshr, ashr,
fdiv, udiv, sdiv). There are no folds for srem/urem/frem AFAIK. We don't
bother with sub/fsub with constant operand 1 because those are
canonicalized to add/fadd. 7 + 6 + 3 + 2 = 18.

llvm-svn: 336684

6 years agoAdd CachedHashStringRef::data().
Rui Ueyama [Tue, 10 Jul 2018 15:10:49 +0000 (15:10 +0000)]
Add CachedHashStringRef::data().

This accessor is useful and could be slightly more efficient than
Str.val().data() because you can avoid StringRef instantiation.

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

llvm-svn: 336683

6 years ago[Hexagon] Change .mir testcase to make sure function is not in SSA form
Krzysztof Parzyszek [Tue, 10 Jul 2018 14:49:54 +0000 (14:49 +0000)]
[Hexagon] Change .mir testcase to make sure function is not in SSA form

If a machine function satisfies SSA, the IsSSA property is assumed even
if the pass to be executed runs after existing from SSA. If the pass
output then does not conform to SSA, a verifier error will be flagged
(with expensive checks enabled).

llvm-svn: 336682

6 years agoAMDGPU: Try to fix test again
Matt Arsenault [Tue, 10 Jul 2018 14:47:31 +0000 (14:47 +0000)]
AMDGPU: Try to fix test again

llvm-svn: 336681

6 years agoSupport -fdebug-prefix-map in llvm-mc. This is useful to omit the
Paul Robinson [Tue, 10 Jul 2018 14:41:54 +0000 (14:41 +0000)]
Support -fdebug-prefix-map in llvm-mc.  This is useful to omit the
debug compilation dir when compiling assembly files with -g.
Part of PR38050.

Patch by Siddhartha Bagaria!

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

llvm-svn: 336680

6 years ago[InstCombine] drop poison flags when shuffle mask undef propagates to constant
Sanjay Patel [Tue, 10 Jul 2018 14:27:55 +0000 (14:27 +0000)]
[InstCombine] drop poison flags when shuffle mask undef propagates to constant

llvm-svn: 336679

6 years agoReapply "Make __gcov_flush flush counters for all shared libraries"
Marco Castelluccio [Tue, 10 Jul 2018 14:12:03 +0000 (14:12 +0000)]
Reapply "Make __gcov_flush flush counters for all shared libraries"

This reapplies r336365, after marking tests as failing on various
configurations.

llvm-svn: 336678

6 years ago[AArch64][SVE] Asm: Support for predicated unary operations.
Sander de Smalen [Tue, 10 Jul 2018 14:05:55 +0000 (14:05 +0000)]
[AArch64][SVE] Asm: Support for predicated unary operations.

This patch adds support for the following instructions:
  CLS  (Count Leading Sign bits)
  CLZ  (Count Leading Zeros)
  CNT  (Count non-zero bits)
  CNOT (Logically invert boolean condition in vector)
  NOT  (Bitwise invert vector)
  FABS (Floating-point absolute value)
  FNEG (Floating-point negate)

All operations are predicated and unary, e.g.
  clz  z0.s, p0/m, z1.s

- CLS, CLZ, CNT, CNOT and NOT have variants for 8, 16, 32
  and 64 bit elements.

- FABS and FNEG have variants for 16, 32 and 64 bit elements.

llvm-svn: 336677

6 years agoUpdate test for backend error message change
Matt Arsenault [Tue, 10 Jul 2018 14:03:50 +0000 (14:03 +0000)]
Update test for backend error message change

llvm-svn: 336676

6 years agoReapply "AMDGPU: Force inlining if LDS global address is used"
Matt Arsenault [Tue, 10 Jul 2018 14:03:41 +0000 (14:03 +0000)]
Reapply "AMDGPU: Force inlining if LDS global address is used"

This reverts commit r336623

llvm-svn: 336675

6 years agoRename a variable for consistency. NFC.
Rui Ueyama [Tue, 10 Jul 2018 14:03:39 +0000 (14:03 +0000)]
Rename a variable for consistency. NFC.

llvm-svn: 336674

6 years ago[scudo] Use mkdir -p when creating directories for a test
Filipe Cabecinhas [Tue, 10 Jul 2018 13:59:59 +0000 (13:59 +0000)]
[scudo] Use mkdir -p when creating directories for a test

llvm-svn: 336673

6 years agoReduce memory usage when creating .gdb_index. NFC.
Rui Ueyama [Tue, 10 Jul 2018 13:49:13 +0000 (13:49 +0000)]
Reduce memory usage when creating .gdb_index. NFC.

.gdb_index sections can be very large. When you are compiling
multi-gibibyte executables, they can be larger than 1 GiB. The previous
implementation of .gdb_index seems to consume too much memory.

This patch reduces memory consumption by eliminating temporary objects.
In one experiment, memory consumption of GdbIndexSection class is
reduced from 962 MiB to 228 MiB when creating a .gdb_index of 1350 GiB.

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

llvm-svn: 336672

6 years ago[analyzer] Add option to set maximum symbol complexity threshold
Mikhail R. Gadelha [Tue, 10 Jul 2018 13:46:05 +0000 (13:46 +0000)]
[analyzer] Add option to set maximum symbol complexity threshold

Summary:
This adds an option, max-symbol-complexity, so an user can set the maximum symbol complexity threshold.

Note that the current behaviour is equivalent to max complexity = 0, when taint analysis is not enabled and tests show that in a number of tests, having complexity = 25 yields the same results as complexity = 10000.

This patch was extracted and modified from Dominic Chen's patch, D35450.

Reviewers: george.karpenkov, NoQ, ddcc

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin

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

llvm-svn: 336671

6 years ago[ELF] - Add a test for readCallGraph() code.
George Rimar [Tue, 10 Jul 2018 13:42:21 +0000 (13:42 +0000)]
[ELF] - Add a test for readCallGraph() code.

This is to test the following untested line:
https://github.com/llvm-mirror/lld/blob/master/ELF/Driver.cpp#L643

llvm-svn: 336670

6 years ago[LibFuzzer] Disable MSan test on Darwin which was added by r336619. The MemorySanitiz...
Dan Liew [Tue, 10 Jul 2018 13:35:35 +0000 (13:35 +0000)]
[LibFuzzer] Disable MSan test on Darwin which was added by r336619. The MemorySanitizer is
not supported on Darwin currently and so Clang refuses to compile with
`-fsanitize=memory`.

llvm-svn: 336669

6 years ago[InstCombine] allow more shuffle-binop folds with safe constants
Sanjay Patel [Tue, 10 Jul 2018 13:33:26 +0000 (13:33 +0000)]
[InstCombine] allow more shuffle-binop folds with safe constants

The case with 2 variables is more complicated than the case where
we eliminate the shuffle entirely because a shuffle with an undef
mask element creates an undef result.

I'm not aware of any current analysis/transform that recognizes that
undef propagating to a div/rem/shift, but we have to guard against
the possibility.

llvm-svn: 336668