platform/upstream/llvm.git
7 years agoWhitespace.
NAKAMURA Takumi [Tue, 11 Jul 2017 02:31:54 +0000 (02:31 +0000)]
Whitespace.

llvm-svn: 307614

7 years agoRevert r307581, "Avoid doing conservative phi checks in aliasSameBasePointerGEPs...
NAKAMURA Takumi [Tue, 11 Jul 2017 02:31:51 +0000 (02:31 +0000)]
Revert r307581, "Avoid doing conservative phi checks in aliasSameBasePointerGEPs() if no phis have been visited yet."

It broke stage2 tests in selfhosting.

llvm-svn: 307613

7 years ago[WebAssembly] Fix use of cast vs dyn_cast
Sam Clegg [Tue, 11 Jul 2017 02:21:57 +0000 (02:21 +0000)]
[WebAssembly] Fix use of cast vs dyn_cast

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

llvm-svn: 307612

7 years ago[libcxxabi][CMake] Add install path variable to allow overriding the destination
Petr Hosek [Tue, 11 Jul 2017 01:42:26 +0000 (01:42 +0000)]
[libcxxabi][CMake] Add install path variable to allow overriding the destination

This is going to be used by the runtime build in the multi-target
setup to allow using different install prefix for each target.

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

llvm-svn: 307611

7 years ago[llvm-cov] Disable threading in a test. NFC.
Vedant Kumar [Tue, 11 Jul 2017 01:42:12 +0000 (01:42 +0000)]
[llvm-cov] Disable threading in a test. NFC.

PR30735 reports an issue where llvm-cov hangs with a worker thread
waiting on a condition, and the main thread waiting to join() the
workers. While this doesn't appear to be a bug in llvm-cov or the
ThreadPool implementation, it would be helpful to disable the use of
threading in the llvm-cov tests where no test coverage is added.

More context: https://bugs.llvm.org/show_bug.cgi?id=30735

llvm-svn: 307610

7 years ago[llvm-cov] Add a cl::opt to control the number of threads
Vedant Kumar [Tue, 11 Jul 2017 01:23:29 +0000 (01:23 +0000)]
[llvm-cov] Add a cl::opt to control the number of threads

When an output directory is specified, llvm-cov spawns some threads to
speed up the process of writing out file reports. Add an option which
allows users to control how many threads llvm-cov uses.

A CommandGuide.rst update + test is included.

llvm-svn: 307609

7 years agollvm-profdata: Improve memory usage by tuning SmallDenseMap size
David Blaikie [Tue, 11 Jul 2017 01:18:28 +0000 (01:18 +0000)]
llvm-profdata: Improve memory usage by tuning SmallDenseMap size

This takes memory usage from 5.1GB to 970MB - it could go further by
using a small size of 2 instead of the default of 4, but given the
rather high cost of going over this limit by much, I figured a little
slosh would be worth the ~130MB of memory usage.

& this'll might not be such a big deal if we use a custom slab allocator
for the DenseMaps here anyway

While the vast majority (99.9%) of records use only 1 entry, the tuning
parameter to SmallDenseMap is the the number of buckets, not the number
of entries - so a small size of 1 wasn't useful, even for 1 element, it
would tip over into allocating (much, 64 slots worth) more space - none
of them ended up small.

llvm-svn: 307608

7 years ago[cmake] Check for Haiku when setting LIB_NAMES for GNU ld
Andrew Wilkins [Tue, 11 Jul 2017 01:17:44 +0000 (01:17 +0000)]
[cmake] Check for Haiku when setting LIB_NAMES for GNU ld

Haiku uses GNU ld for linking, but is not captured in the
conditional when setting LIB_NAMES. This causes a shared
library with no symbols on Haiku. This patch simply adds
a check for whether the CMake system name is Haiku in
addition to the existing checks.

Patch by Jérôme Duval.

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

llvm-svn: 307607

7 years ago[libunwind][CMake] Add install path variable to allow overriding the destination
Petr Hosek [Tue, 11 Jul 2017 01:12:09 +0000 (01:12 +0000)]
[libunwind][CMake] Add install path variable to allow overriding the destination

This is going to be used by the runtime build in the multi-target
setup to allow using different install prefix for each target.

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

llvm-svn: 307606

7 years agoRemove circular dependency from runtimes/CMakeLists
George Karpenkov [Tue, 11 Jul 2017 00:48:00 +0000 (00:48 +0000)]
Remove circular dependency from runtimes/CMakeLists

llvm-svn: 307605

7 years ago[analyzer] Start fixing modeling of bool based types
Alexander Shaposhnikov [Tue, 11 Jul 2017 00:30:14 +0000 (00:30 +0000)]
[analyzer] Start fixing modeling of bool based types

This is a follow up for one of
the previous diffs https://reviews.llvm.org/D32328.
getTypeSize and with getIntWidth are not equivalent for bool
(see https://clang.llvm.org/doxygen/ASTContext_8cpp_source.html#l08444),
this causes a number of issues
(for instance, if APint X representing a bool is created
with the wrong bit width then X is not comparable against Min/Max
(because of the different bit width), that results in crashes
(triggered asserts) inside assume* methods),
for examples see the newly added test cases.

Test plan: make check-all

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

llvm-svn: 307604

7 years ago[clang-import-test] Test that enumerators and their values are found.
Sean Callanan [Tue, 11 Jul 2017 00:29:37 +0000 (00:29 +0000)]
[clang-import-test] Test that enumerators and their values are found.

llvm-svn: 307603

7 years ago[clang-import-test] Committed missed update to clang-import-test.cpp
Sean Callanan [Tue, 11 Jul 2017 00:27:57 +0000 (00:27 +0000)]
[clang-import-test] Committed missed update to clang-import-test.cpp

I didn't commit clang-import-test.cpp in r307600, but it had some
changes that were part of https://reviews.llvm.org/D35220

Corrected that now.

llvm-svn: 307602

7 years ago[CMake] Use tools template for clangd and modularize
Petr Hosek [Tue, 11 Jul 2017 00:18:07 +0000 (00:18 +0000)]
[CMake] Use tools template for clangd and modularize

This makes them usable as distribution components in the build.

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

llvm-svn: 307601

7 years agoclang-import-test had some dead code. I did the following to eliminate it:
Sean Callanan [Mon, 10 Jul 2017 23:47:00 +0000 (23:47 +0000)]
clang-import-test had some dead code. I did the following to eliminate it:

- eliminated error handling for the indirect CompilerInstance, which should
  never generate an error as it is created;
- added a new test for direct importation; and
- removed an unused implementation of the CompleteType() API.

This brings clang-import-test.cpp and ExternalASTMerge.cpp back to 100%
coverage on all metrics measured by DLLVM_BUILD_INSTRUMENTED_COVERAGE.

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

llvm-svn: 307600

7 years ago[lld/pdb] Create an empty public symbol record stream.
Zachary Turner [Mon, 10 Jul 2017 22:40:20 +0000 (22:40 +0000)]
[lld/pdb] Create an empty public symbol record stream.

This is part of the continuing effort to increase parity between
LLD and MSVC PDBs.  link still doesn't like our PDBs, so the most
obvious thing to check was whether adding an empty publics stream
would get it to do something else.  It still fails in the same way
but at least this removes one more variable from the equation.
The next logical step would be to try creating an empty globals
stream.

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

llvm-svn: 307598

7 years agoDoxygen formatting. NFCI
Joel Jones [Mon, 10 Jul 2017 22:11:50 +0000 (22:11 +0000)]
Doxygen formatting. NFCI

llvm-svn: 307597

7 years agoInstrProf: Fix unit test which accidentally used a duplicate name
Vedant Kumar [Mon, 10 Jul 2017 21:44:43 +0000 (21:44 +0000)]
InstrProf: Fix unit test which accidentally used a duplicate name

This unit test constructed some profile records incorrectly. One of the
records had a duplicate name: adding that record into the writer caused
an error unrelated to what needed to be tested.

Reported by David Blaikie!

llvm-svn: 307596

7 years ago[libc++] Refactoring __sync_* builtins; NFC (Reland)
Weiming Zhao [Mon, 10 Jul 2017 21:37:35 +0000 (21:37 +0000)]
[libc++] Refactoring __sync_* builtins; NFC (Reland)

Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets.

Reviewers: danalbert, EricWF, jroelofs

Subscribers: joerg, llvm-commits

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

llvm-svn: 307595

7 years agoIsSpecialLong was only ever set in release mode as all of the uses are in asserts...
Eric Christopher [Mon, 10 Jul 2017 21:28:54 +0000 (21:28 +0000)]
IsSpecialLong was only ever set in release mode as all of the uses are in asserts. Wrap in ifndef NDEBUG.

llvm-svn: 307594

7 years agoRevert "[libc++] Refactoring __sync_* builtins; NFC"
Weiming Zhao [Mon, 10 Jul 2017 21:23:32 +0000 (21:23 +0000)]
Revert "[libc++] Refactoring __sync_* builtins; NFC"

This reverts commit 72ff8866bca49ee7d24c87673293b4ce88a039ec.

llvm-svn: 307593

7 years agoFix pdb-linker-module test on linux.
Zachary Turner [Mon, 10 Jul 2017 21:09:11 +0000 (21:09 +0000)]
Fix pdb-linker-module test on linux.

lld-link is apparently a symlink to lld.  Our pdb writing code
uses llvm::sys::fs::getMainExecutable() and writes that value
into the PDB, which will resolve symlinks etc.  But what we
really want is the exact value of argv[0], which matches what
the MS linker does.  Fix this by just writing argv[0] instead
of calling getMainExecutable.

llvm-svn: 307592

7 years ago[libc++] Refactoring __sync_* builtins; NFC
Weiming Zhao [Mon, 10 Jul 2017 21:02:54 +0000 (21:02 +0000)]
[libc++] Refactoring __sync_* builtins; NFC

Summary: Wrap __sync_* builtins with __libcpp_ functions to facility future customizations as atomic operations are unavailable on some targets.

Reviewers: danalbert, EricWF, jroelofs

Subscribers: joerg, llvm-commits

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

llvm-svn: 307591

7 years ago[lld/pdb] Add some basic linker module symbols.
Zachary Turner [Mon, 10 Jul 2017 21:01:37 +0000 (21:01 +0000)]
[lld/pdb] Add some basic linker module symbols.

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

llvm-svn: 307590

7 years agoRevert "[DAG] Improve Aliasing of operations to static alloca"
Matthias Braun [Mon, 10 Jul 2017 20:51:30 +0000 (20:51 +0000)]
Revert "[DAG] Improve Aliasing of operations to static alloca"

Reverting as it breaks tramp3d-v4 in the llvm test-suite. I added some
comments to https://reviews.llvm.org/D33345 about it.

This reverts commit r307546.

llvm-svn: 307589

7 years ago[WebAssembly] Add more details to llvm-readobj for wasm files
Sam Clegg [Mon, 10 Jul 2017 20:47:12 +0000 (20:47 +0000)]
[WebAssembly] Add more details to llvm-readobj for wasm files

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

llvm-svn: 307588

7 years ago[ConstantHoisting] Remove dupliate logic in constant hoisting
Leo Li [Mon, 10 Jul 2017 20:45:34 +0000 (20:45 +0000)]
[ConstantHoisting] Remove dupliate logic in constant hoisting

Summary:
As metioned in https://reviews.llvm.org/D34576, checkings in
`collectConstantCandidates` can be replaced by using
`llvm::canReplaceOperandWithVariable`.

The only special case is that `collectConstantCandidates` return false for
all `IntrinsicInst` but it is safe for us to collect constant candidates from
`IntrinsicInst`.

Reviewers: pirama, efriedma, srhines

Reviewed By: efriedma

Subscribers: llvm-commits, javed.absar

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

llvm-svn: 307587

7 years ago[NewGVN] Simplify a lambda a little bit. NFCI.
Davide Italiano [Mon, 10 Jul 2017 20:45:00 +0000 (20:45 +0000)]
[NewGVN] Simplify a lambda a little bit. NFCI.

llvm-svn: 307586

7 years ago[WebAssembly] Be consistent in generating trivial test input files
Sam Clegg [Mon, 10 Jul 2017 20:43:26 +0000 (20:43 +0000)]
[WebAssembly] Be consistent in generating trivial test input files

For each checked-in wasm file, make sure the there is
corresponding .ll file that can be used to regenerate it
if needed.

Add test/Object/Inputs/trivial-object-test.wasm to match other
formats and add some new wasm tests in test/Object.

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

llvm-svn: 307585

7 years agoUse DenseMap instead std::map for GVSummaryMapTy
Dehao Chen [Mon, 10 Jul 2017 20:31:37 +0000 (20:31 +0000)]
Use DenseMap instead std::map for GVSummaryMapTy

Summary: Frontend change for https://reviews.llvm.org/D35148

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, cfe-commits

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

llvm-svn: 307584

7 years agoAdd DAG argument to canMergeStoresTo NFC.
Nirav Dave [Mon, 10 Jul 2017 20:25:54 +0000 (20:25 +0000)]
Add DAG argument to canMergeStoresTo NFC.

llvm-svn: 307583

7 years ago[Hexagon] Convert typed ISD opcodes to generic ones, NFC
Krzysztof Parzyszek [Mon, 10 Jul 2017 20:16:44 +0000 (20:16 +0000)]
[Hexagon] Convert typed ISD opcodes to generic ones, NFC

llvm-svn: 307582

7 years agoAvoid doing conservative phi checks in aliasSameBasePointerGEPs() if no phis have...
Farhana Aleen [Mon, 10 Jul 2017 20:15:40 +0000 (20:15 +0000)]
Avoid doing conservative phi checks in aliasSameBasePointerGEPs() if no phis have been visited yet.

Reviewers: Daniel Berlin

Subscribers: llvm-commits

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

llvm-svn: 307581

7 years ago[Hexagon] Remove unused ISD opcodes, NFC
Krzysztof Parzyszek [Mon, 10 Jul 2017 20:13:44 +0000 (20:13 +0000)]
[Hexagon] Remove unused ISD opcodes, NFC

llvm-svn: 307580

7 years ago[IslAst] Print memory accesses in AST dump
Tobias Grosser [Mon, 10 Jul 2017 20:13:06 +0000 (20:13 +0000)]
[IslAst] Print memory accesses in AST dump

When providing the option "-polly-ast-print-accesses" Polly also prints the
memory accesses that are generated:

    #pragma known-parallel
    for (int c0 = 0; c0 <= 1023; c0 += 4)
      #pragma simd
      for (int c1 = c0; c1 <= c0 + 3; c1 += 1)
        Stmt_for_body(
          /* read  */ &MemRef_B[0]
          /* write */  MemRef_A[c1]
        );

This makes writing and debugging memory layout transformations easier.

Based on a patch contributed by Thomas Lang (ETH Zurich)

llvm-svn: 307579

7 years agoUse DenseMap instead std::map for GVSummaryMapTy.
Dehao Chen [Mon, 10 Jul 2017 20:12:54 +0000 (20:12 +0000)]
Use DenseMap instead std::map for GVSummaryMapTy.

Summary: This speeds-up thin-link by ~47% for large programs.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits, mehdi_amini

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

llvm-svn: 307578

7 years agoDo not crash with missing symbolication when running in DEDUP mode
George Karpenkov [Mon, 10 Jul 2017 20:06:06 +0000 (20:06 +0000)]
Do not crash with missing symbolication when running in DEDUP mode

Printing stacktrace from ASAN crashes with a segfault in DEDUP mode when
symbolication is missing.

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

llvm-svn: 307577

7 years agoAMDGPU: Allow SIShrinkInstructions to fold FrameIndexes
Matt Arsenault [Mon, 10 Jul 2017 20:04:35 +0000 (20:04 +0000)]
AMDGPU: Allow SIShrinkInstructions to fold FrameIndexes

llvm-svn: 307576

7 years agoAMDGPU: Allow SIShrinkInstructions to work in non-SSA
Matt Arsenault [Mon, 10 Jul 2017 19:53:57 +0000 (19:53 +0000)]
AMDGPU: Allow SIShrinkInstructions to work in non-SSA

Immediates can be folded as long as the immediate is a vreg.

Also undo commuting instructions if it didn't fold an immediate.

llvm-svn: 307575

7 years agoAMDGPU: Remove unnecessary check for constant operands
Matt Arsenault [Mon, 10 Jul 2017 19:33:38 +0000 (19:33 +0000)]
AMDGPU: Remove unnecessary check for constant operands

An instruction that has an immediate operand can't reach
this point. This is only called for a freshly shrunk instruction,
which prevously couldn't have had a literal constant operand.
This was also not conservative enough since it woudl also have
had to filter other constant-like inputs like frame indexes.

llvm-svn: 307574

7 years agoAMDGPU: Do not test for SI in getIsaVersion
Konstantin Zhuravlyov [Mon, 10 Jul 2017 19:24:05 +0000 (19:24 +0000)]
AMDGPU: Do not test for SI in getIsaVersion

SI is being tested by isa version in the first two if statements of the function.

llvm-svn: 307573

7 years ago[CMake] Dependencies for tests in "runtimes"
George Karpenkov [Mon, 10 Jul 2017 19:23:28 +0000 (19:23 +0000)]
[CMake] Dependencies for tests in "runtimes"

Many of the test cases in the runtimes require LLVM's testing tools, to
facilitate this working as expected we need to have all the test targets
in the runtimes depend on all LLVM testing tools used in the runtimes.

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

llvm-svn: 307572

7 years agoResubmit "Add pdb-diff test."
Zachary Turner [Mon, 10 Jul 2017 19:16:49 +0000 (19:16 +0000)]
Resubmit "Add pdb-diff test."

This was originally reverted because of two issues.
  1) Printing ANSI color escape codes even when outputting to
     a file
  2) Module name comparisons were failing when comparing a PDB
     generated on one machine to a PDB generated on another
     machine.

I attempted to fix #2 by adding command line options which let
you specify prefixes to strip from the beginning of embedded
paths, which effectively lets us specify a path to "base" each
PDB from and only compare the parts under the base.  But this is
tricky because PDB paths always use Windows path syntax, even
when they are created on non-Windows hosts.  A problem still
existed when constructing the prefix to strip, where we were
accidentally using a host-specific path separator instead of
a Windows path separator.

This resubmission fixes the issue on Linux (and I have verified
that the test now passes on Linux).

llvm-svn: 307571

7 years ago[cmake] Remove obsolete unset in CMake.
George Karpenkov [Mon, 10 Jul 2017 18:58:05 +0000 (18:58 +0000)]
[cmake] Remove obsolete unset in CMake.

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

llvm-svn: 307569

7 years ago[docs] Remove obsolete section in CMake documentation.
George Karpenkov [Mon, 10 Jul 2017 18:56:51 +0000 (18:56 +0000)]
[docs] Remove obsolete section in CMake documentation.

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

llvm-svn: 307568

7 years agoAdd an #if SANITIZER_MAC and a comment to lsan_common's suppression for "_os_trace".
Kuba Mracek [Mon, 10 Jul 2017 18:55:33 +0000 (18:55 +0000)]
Add an #if SANITIZER_MAC and a comment to lsan_common's suppression for "_os_trace".

llvm-svn: 307567

7 years ago[Hexagon] Fix check for HMOTF_ConstExtend operand flag
Krzysztof Parzyszek [Mon, 10 Jul 2017 18:38:52 +0000 (18:38 +0000)]
[Hexagon] Fix check for HMOTF_ConstExtend operand flag

This fixes https://llvm.org/PR33718.

llvm-svn: 307566

7 years ago[WebAssembly] Use the correct size for MCFillFragment
Sam Clegg [Mon, 10 Jul 2017 18:36:34 +0000 (18:36 +0000)]
[WebAssembly] Use the correct size for MCFillFragment

Summary: When implementing MCFillFragment, use the size of the fragment,
rather than the size of the section.

Patch by Dan Gohman

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

llvm-svn: 307565

7 years ago[Hexagon] Handle Hexagon-specific machine operand target flags in MIR
Krzysztof Parzyszek [Mon, 10 Jul 2017 18:31:02 +0000 (18:31 +0000)]
[Hexagon] Handle Hexagon-specific machine operand target flags in MIR

llvm-svn: 307564

7 years ago[PPC CodeGen] Expand the bitreverse.i64 intrinsic.
Tony Jiang [Mon, 10 Jul 2017 18:11:23 +0000 (18:11 +0000)]
[PPC CodeGen] Expand the bitreverse.i64 intrinsic.

Differential Revision: https://reviews.llvm.org/D34908
Fix PR: https://bugs.llvm.org/show_bug.cgi?id=33093

llvm-svn: 307563

7 years ago[X86] Sync a few more things from llvm's Host.cpp to cpu_model.
Craig Topper [Mon, 10 Jul 2017 17:47:23 +0000 (17:47 +0000)]
[X86] Sync a few more things from llvm's Host.cpp to cpu_model.

This syncs the cpuid functions and adds breaks to the appropriate spots in the CPU decoding switches. Also a few formatting tweaks.

llvm-svn: 307561

7 years ago[Docs] Updating CMake docs to include LLVM_REVERSE_ITERATION
Mandeep Singh Grang [Mon, 10 Jul 2017 17:37:36 +0000 (17:37 +0000)]
[Docs] Updating CMake docs to include LLVM_REVERSE_ITERATION

Reviewers: beanz, mehdi_amini

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

llvm-svn: 307560

7 years agoRevert "Build fixes for pdb-diff test."
Zachary Turner [Mon, 10 Jul 2017 17:32:47 +0000 (17:32 +0000)]
Revert "Build fixes for pdb-diff test."

This reverts commit 180af3fdbdb17ec35b45ec1f925fd743b28d37e1.

This is still breaking due to linux-specific path differences.

llvm-svn: 307559

7 years ago[X86] Resync cpu_model.c with llvm's Host.cpp in preparation for making it compatible...
Craig Topper [Mon, 10 Jul 2017 17:30:20 +0000 (17:30 +0000)]
[X86] Resync cpu_model.c with llvm's Host.cpp in preparation for making it compatible with newer gcc.

llvm-svn: 307558

7 years agoFix-up for r307537: We need to #include stdint.h to get int32_t.
Kuba Mracek [Mon, 10 Jul 2017 17:11:52 +0000 (17:11 +0000)]
Fix-up for r307537: We need to #include stdint.h to get int32_t.

llvm-svn: 307557

7 years agoBuild fixes for pdb-diff test.
Zachary Turner [Mon, 10 Jul 2017 17:01:28 +0000 (17:01 +0000)]
Build fixes for pdb-diff test.

llvm-svn: 307556

7 years agoFix pdb-diff test.
Zachary Turner [Mon, 10 Jul 2017 16:52:15 +0000 (16:52 +0000)]
Fix pdb-diff test.

A test was checked in on Friday that worked by checking in an
object file and PDB generated locally by MSVC, and then having
the test run lld-link on the object file and diffing LLD's PDB
against the checked in PDB.

This failed because part of the diffing algorithm involves
determining if two modules are the same, and if so drilling into
the module and diffing individual fields of the module.  The
only thing we can use to make this determination though is the
"name" of the module, which is a path to where the module (obj
file) was read from on the machine where it was linked.  This
fails for obvious reasons when comparing a PDB generated on one
machine to a PDB on another machine.

The fix employed here is to add two command line options to the
diff subcommand, which allow the user to specify a "binary root
path".  The bin root path, if specified, is stripped from the
beginning of any embedded PDB paths.  The test is updated to
specify the user's local test output directory for the left
PDB, and is hardcoded to the location where the original PDB
was created for the right PDB.  This way all the equivalence
comparisons should succeed.

llvm-svn: 307555

7 years agoFix invalid cast in instcombine UMul/ZExt idiom
Serge Guelton [Mon, 10 Jul 2017 16:51:40 +0000 (16:51 +0000)]
Fix invalid cast in instcombine UMul/ZExt idiom

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

Do not assume IRBuilder creates Instruction where it can create Value.
Do not assume idiom operands are constant, leave generalisation ot the IRBuilder.

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

llvm-svn: 307554

7 years ago[PowerPC] Reduce register pressure by not materializing a constant just for use as...
Lei Huang [Mon, 10 Jul 2017 16:44:45 +0000 (16:44 +0000)]
[PowerPC] Reduce register pressure by not materializing a constant just for use as an index register for X-Form loads/stores.

For this example:
float test (int *arr) {
    return arr[2];
}

We currently generate the following code:
  li r4, 8
  lxsiwax f0, r3, r4
  xscvsxdsp f1, f0

With this patch, we will now generate:
  addi r3, r3, 8
  lxsiwax f0, 0, r3
  xscvsxdsp f1, f0

Originally reported in: https://bugs.llvm.org/show_bug.cgi?id=27204
Differential Revision: https://reviews.llvm.org/D35027

llvm-svn: 307553

7 years ago[X86] Model 256-bit AVX instructions in the AMD Jaguar scheduler Part-1 (PR28573).
Andrew V. Tischenko [Mon, 10 Jul 2017 16:36:03 +0000 (16:36 +0000)]
[X86] Model 256-bit AVX instructions in the AMD Jaguar scheduler Part-1 (PR28573).
The new version of the model is definitely faster.

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

llvm-svn: 307552

7 years agoAvoid white spaces in file names. NFC
Eric Liu [Mon, 10 Jul 2017 16:05:48 +0000 (16:05 +0000)]
Avoid white spaces in file names. NFC

Summary: White spaces in file names are causing Phabricator/SVN to crash.

Reviewers: bkramer

Subscribers: bogner, cfe-commits

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

llvm-svn: 307551

7 years ago[LLVM] Get rid of white spaces in file names in a DebugInfo test. NFC
Eric Liu [Mon, 10 Jul 2017 16:05:18 +0000 (16:05 +0000)]
[LLVM] Get rid of white spaces in file names in a DebugInfo test. NFC

Summary: White spaces in file names are causing Phabricator/SVN to crash.

Reviewers: bkramer

Subscribers: llvm-commits

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

llvm-svn: 307550

7 years agoFix a build failure due to r307541 (tsan_rtl_aarch64.S:54: Error: unknown pseudo...
Kuba Mracek [Mon, 10 Jul 2017 15:58:22 +0000 (15:58 +0000)]
Fix a build failure due to r307541 (tsan_rtl_aarch64.S:54: Error: unknown pseudo-op: `.').

llvm-svn: 307549

7 years ago[lsan] Add _os_trace into LSan's suppression list
Kuba Mracek [Mon, 10 Jul 2017 15:55:25 +0000 (15:55 +0000)]
[lsan] Add _os_trace into LSan's suppression list

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

llvm-svn: 307548

7 years agoFix-up for r307540.
Kuba Mracek [Mon, 10 Jul 2017 15:52:30 +0000 (15:52 +0000)]
Fix-up for r307540.

llvm-svn: 307547

7 years ago[DAG] Improve Aliasing of operations to static alloca
Nirav Dave [Mon, 10 Jul 2017 15:39:41 +0000 (15:39 +0000)]
[DAG] Improve Aliasing of operations to static alloca

Memory accesses offset from frame indices may alias, e.g., we
may merge write from function arguments passed on the stack when they
are contiguous. As a result, when checking aliasing, we consider the
underlying frame index's offset from the stack pointer.

Static allocs are realized as stack objects in SelectionDAG, but its
offset is not set until post-DAG causing DAGCombiner's alias check to
consider access to static allocas to frequently alias. Modify isAlias
to consider access between static allocas and access from other frame
objects to be considered aliasing.

Many test changes are included here. Most are fixes for tests which
indirectly relied on our aliasing ability and needed to be modified to
preserve their original intent.

The remaining tests have minor improvements due to relaxed
ordering. The exception is CodeGen/X86/2011-10-19-widen_vselect.ll
which has a minor degradation dispite though the pre-legalized DAG is
improved.

Reviewers: rnk, mkuper, jonpa, hfinkel, uweigand

Reviewed By: rnk

Subscribers: sdardis, nemanjai, javed.absar, llvm-commits

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

llvm-svn: 307546

7 years ago[tsan] Add comments for the bool argument of ThreadIgnoreBegin/ThreadIgnoreSyncBegin...
Kuba Mracek [Mon, 10 Jul 2017 15:37:13 +0000 (15:37 +0000)]
[tsan] Add comments for the bool argument of ThreadIgnoreBegin/ThreadIgnoreSyncBegin, NFC.

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

llvm-svn: 307545

7 years ago[tsan] Add a mapping for Darwin/AArch64
Kuba Mracek [Mon, 10 Jul 2017 15:35:04 +0000 (15:35 +0000)]
[tsan] Add a mapping for Darwin/AArch64

This patch defines the TSan memory map and offsets for Darwin on AArch64.

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

llvm-svn: 307544

7 years agoUse emplace_back to replace size() and resize().
Dehao Chen [Mon, 10 Jul 2017 15:31:53 +0000 (15:31 +0000)]
Use emplace_back to replace size() and resize().

Summary: This speeds-up thin-link for ~29% for large programs.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: grandinj, sanjoy, llvm-commits

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

llvm-svn: 307543

7 years ago[LoopUnrollRuntime] Remove strict assert about VMap requirement
Anna Thomas [Mon, 10 Jul 2017 15:29:38 +0000 (15:29 +0000)]
[LoopUnrollRuntime] Remove strict assert about VMap requirement

When unrolling under multiple exits which is under off-by-default option,
the assert that checks for VMap entry in loop exit values is too strong.
(assert if VMap entry did not exist, the value should be a
constant). However, values derived from
constants or from values outside loop, does not have a VMap entry too.

Removed the assert and added a testcase showcasing the property for
non-constant values.

llvm-svn: 307542

7 years ago[tsan] Port setjmp/longjmp assembly to Darwin/AArch64
Kuba Mracek [Mon, 10 Jul 2017 15:28:16 +0000 (15:28 +0000)]
[tsan] Port setjmp/longjmp assembly to Darwin/AArch64

This patch ports the assembly file implementing TSan's setjmp support to AArch64 on Darwin.

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

llvm-svn: 307541

7 years ago[tsan] Add a max VM address check for Darwin/AArch64
Kuba Mracek [Mon, 10 Jul 2017 15:24:48 +0000 (15:24 +0000)]
[tsan] Add a max VM address check for Darwin/AArch64

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

llvm-svn: 307540

7 years agoReverting an accidentally landed change.
Kuba Mracek [Mon, 10 Jul 2017 15:20:50 +0000 (15:20 +0000)]
Reverting an accidentally landed change.

llvm-svn: 307539

7 years agoFixup whitespace.
Kuba Mracek [Mon, 10 Jul 2017 15:19:14 +0000 (15:19 +0000)]
Fixup whitespace.

llvm-svn: 307538

7 years ago[tsan] Add support for running TSan tests on iOS simulator and devices
Kuba Mracek [Mon, 10 Jul 2017 15:00:55 +0000 (15:00 +0000)]
[tsan] Add support for running TSan tests on iOS simulator and devices

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

llvm-svn: 307537

7 years ago[PM] Fix a warning.
Philip Pfaffe [Mon, 10 Jul 2017 13:54:23 +0000 (13:54 +0000)]
[PM] Fix a warning.

The DebugLogging argument was unused in the EP callbacks registration.

llvm-svn: 307536

7 years agoImprove error message when run from a buffer that doesn't visit a file
Philipp Stephani [Mon, 10 Jul 2017 13:49:18 +0000 (13:49 +0000)]
Improve error message when run from a buffer that doesn't visit a file

Summary: In this case, users currently get a confusing type error.  Make the error message more obvious.

Reviewers: klimek

Reviewed By: klimek

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

llvm-svn: 307535

7 years ago[PM] Fix r307532: Get rid of a dangling reference.
Philip Pfaffe [Mon, 10 Jul 2017 12:48:51 +0000 (12:48 +0000)]
[PM] Fix r307532: Get rid of a dangling reference.

Escaping lambda by-reference capture of local variable caused a dangling
reference.

llvm-svn: 307534

7 years agofix typos in comments and error messages; NFC
Hiroshi Inoue [Mon, 10 Jul 2017 12:44:25 +0000 (12:44 +0000)]
fix typos in comments and error messages; NFC

llvm-svn: 307533

7 years ago[PM] Enable registration of out-of-tree passes with PassBuilder
Philip Pfaffe [Mon, 10 Jul 2017 10:57:55 +0000 (10:57 +0000)]
[PM] Enable registration of out-of-tree passes with PassBuilder

Summary:
This patch adds a callback registration API to the PassBuilder,
enabling registering out-of-tree passes with it.

Through the Callback API, callers may register callbacks with the
various stages at which passes are added into pass managers, including
parsing of a pass pipeline as well as at extension points within the
default -O pipelines.

Registering utilities like `require<>` and `invalidate<>` needs to be
handled manually by the caller, but a helper is provided.

Additionally, adding passes at pipeline extension points is exposed
through the opt tool. This patch adds a `-passes-ep-X` commandline
option for every extension point X, which opt parses into pipelines
inserted into that extension point.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: lksbhm, grosser, davide, mehdi_amini, llvm-commits, mgorny

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

llvm-svn: 307532

7 years ago[ARM] Tidy up ARMBaseRegisterInfo implementation. NFC
Javed Absar [Mon, 10 Jul 2017 10:42:55 +0000 (10:42 +0000)]
[ARM] Tidy up ARMBaseRegisterInfo implementation. NFC

Clean up ARMBaseRegisterInfo implementation a bit.
Differential Revision: https://reviews.llvm.org/D35116

llvm-svn: 307531

7 years ago[DWARF] - Rename variable. NFC.
George Rimar [Mon, 10 Jul 2017 10:04:51 +0000 (10:04 +0000)]
[DWARF] - Rename variable. NFC.

Variable was called 'Name' and contained text
name of relocation type. Problem was that
outside of this error handling scope we already
have different 'Name' variable that contains
section name.

Change helps to avoid confusion.

llvm-svn: 307530

7 years agoThis patch completely replaces the scheduling information for the SandyBridge archite...
Gadi Haber [Mon, 10 Jul 2017 09:53:16 +0000 (09:53 +0000)]
This patch completely replaces the scheduling information for the SandyBridge architecture target by modifying the file X86SchedSandyBridge.td located under the X86 Target.
The SandyBridge architects have provided us with a more accurate information about each instruction latency, number of uOPs and used ports and I used it to replace the existing estimated SNB instructions scheduling and to add missing scheduling information.

Please note that the patch extensively affects the X86 MC instr scheduling for SNB.

Also note that this patch will be followed by additional patches for the remaining target architectures HSW, IVB, BDW, SKL and SKX.

The updated and extended information about each instruction includes the following details:
•static latency of the instruction
•number of uOps from which the instruction consists of
•all ports used by the instruction's' uOPs

For example, the following code dictates that instructions, ADC64mr, ADC8mr, SBB64mr, SBB8mr have a static latency of 9 cycles. Each of these instructions is decoded into 6 micro operations which use ports 4, ports 2 or 3 and port 0 and ports 0 or 1 or 5:

def SBWriteResGroup94 : SchedWriteRes<[SBPort4,SBPort23,SBPort0,SBPort015]> {
let Latency = 9;
let NumMicroOps = 6;
let ResourceCycles = [1,2,2,1];

}
def: InstRW<[SBWriteResGroup94], (instregex "ADC64mr")>;
def: InstRW<[SBWriteResGroup94], (instregex "ADC8mr")>;
def: InstRW<[SBWriteResGroup94], (instregex "SBB64mr")>;
def: InstRW<[SBWriteResGroup94], (instregex "SBB8mr")>;

Note that apart for the header, most of the X86SchedSandyBridge.td file was generated by a script.

Reviewers: zvi, chandlerc, RKSimon, m_zuckerman, craig.topper, igorb

Differential Revision:  https://reviews.llvm.org/D35019#inline-304691

llvm-svn: 307529

7 years ago[DWARF] - Remove unused variables. NFC.
George Rimar [Mon, 10 Jul 2017 09:36:44 +0000 (09:36 +0000)]
[DWARF] - Remove unused variables. NFC.

llvm-svn: 307528

7 years ago[GlobalISel][X86] Support G_LOAD/G_STORE i1.
Igor Breger [Mon, 10 Jul 2017 09:26:09 +0000 (09:26 +0000)]
[GlobalISel][X86] Support G_LOAD/G_STORE i1.

Summary: Support G_LOAD/G_STORE i1.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 307527

7 years ago[GlobalISel][X86] extend G_ZEXT support.
Igor Breger [Mon, 10 Jul 2017 09:07:34 +0000 (09:07 +0000)]
[GlobalISel][X86] extend G_ZEXT support.

Summary:
Mark G_ZEXT/G_SEXT i1 to i8/i16,  i8 to i16 as legal.
Support G_ZEXT i1 to i8/i16 instruction selection ( C++ code).
This patch requred to support G_LOAD/G_STORE i1.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: rovka, llvm-commits, kristof.beyls

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

llvm-svn: 307526

7 years ago[docs] NFC: Fix links in the tutorial
Kirill Bobyrev [Mon, 10 Jul 2017 09:07:23 +0000 (09:07 +0000)]
[docs] NFC: Fix links in the tutorial

r274441 introduced Chapter 10 of "Implementing a Language with LLVM" tutorial,
which caused all files in the tutorial to start using two digit numbering. But
many links were not changed and therefore appear to be broken. This patch
addresses described issue.

As a result, following command does not produce any output anymore:

$ grep -nR '<LangImpl[0-9].html>' ./docs/tutorial/

llvm-svn: 307525

7 years agoX86 Intrinsics: _bit_scan_forward should not be under #ifdef __RDRND__
Zvi Rackover [Mon, 10 Jul 2017 07:13:56 +0000 (07:13 +0000)]
X86 Intrinsics: _bit_scan_forward should not be under #ifdef __RDRND__

Summary:
The _bit_scan_forward and _bit_scan_reverse intrinsics were accidentally
masked under the preprocessor checks that prune intrinsics definitions for the
benefit of faster compile-time on Windows. This patch moves the
definitons out of that region.

Fixes pr33722

Reviewers: craig.topper, aaboud, thakis

Reviewed By: craig.topper

Subscribers: cfe-commits

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

llvm-svn: 307524

7 years agofix formatting; NFC
Hiroshi Inoue [Mon, 10 Jul 2017 06:32:52 +0000 (06:32 +0000)]
fix formatting; NFC

llvm-svn: 307523

7 years ago[X86] Fix typo in comment. NFC
Craig Topper [Mon, 10 Jul 2017 06:09:22 +0000 (06:09 +0000)]
[X86] Fix typo in comment. NFC

llvm-svn: 307522

7 years ago[ArgumentPromotion] Change use of removed argument in llvm.dbg.value to undef
Mikael Holmen [Mon, 10 Jul 2017 06:07:24 +0000 (06:07 +0000)]
[ArgumentPromotion] Change use of removed argument in llvm.dbg.value to undef

Summary:
This solves PR33641.

When removing a dead argument we must also handle possibly existing calls
to llvm.dbg.value that use the removed argument. Now we change the use
of the otherwise dead argument to an undef for some other pass to cleanup
later.

If the calls are left untouched, they will later on cause errors:
 "function-local metadata used in wrong function"
since the ArgumentPromotion rewrites the code by creating a new function
with the wanted signature, but the metadata is not recreated so the new
function may then erroneously use metadata from the old function.

Reviewers: mstorsjo, rnk, arsenm

Reviewed By: rnk

Subscribers: wdng, llvm-commits

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

llvm-svn: 307521

7 years ago[X86] Remove asserts from getX86CpuIDAndInfo/getX86CpuIDAndInfoEx. Restore past behav...
Craig Topper [Mon, 10 Jul 2017 06:04:11 +0000 (06:04 +0000)]
[X86] Remove asserts from getX86CpuIDAndInfo/getX86CpuIDAndInfoEx. Restore past behavior of returning an unsupported indication to the caller instead.

These asserts could only occur if we fail to properly detect the compiler, but an assert is not a good way to do that because it doesn't work in release builds.

I wonder if we could use #error?

llvm-svn: 307520

7 years ago[ADT] Fix another "oops" spotted by eddyb and reported in IRC.
Chandler Carruth [Mon, 10 Jul 2017 05:41:14 +0000 (05:41 +0000)]
[ADT] Fix another "oops" spotted by eddyb and reported in IRC.

This test pretty clearly should be calling 'maxnum' here. =]

llvm-svn: 307519

7 years agoFix issues with UBSAN test configuration.
Eric Fiselier [Mon, 10 Jul 2017 04:32:21 +0000 (04:32 +0000)]
Fix issues with UBSAN test configuration.

On Apple the test feature 'sanitizer-new-delete' was incorrectly
getting added to the LIT feature set, which mistakenly caused tests
to be disabled when using UBSAN (the feature is only needed with ASAN/MSAN/TSAN).

llvm-svn: 307518

7 years agoWork around PR31864 - ATOMIC_LLONG_LOCK_FREE is incorrect in 32 bit builds
Eric Fiselier [Mon, 10 Jul 2017 04:16:50 +0000 (04:16 +0000)]
Work around PR31864 - ATOMIC_LLONG_LOCK_FREE is incorrect in 32 bit builds

llvm-svn: 307517

7 years agollvm-profdata: Reduce memory usage by using Error callback rather than member
David Blaikie [Mon, 10 Jul 2017 03:04:59 +0000 (03:04 +0000)]
llvm-profdata: Reduce memory usage by using Error callback rather than member

Reduces llvm-profdata memory usage on a large profile from 7.8GB to 5.1GB.

The ProfData API now supports reporting all the errors/warnings rather
than only the first, though llvm-profdata ignores everything after the
first for now to preserve existing behavior. (if there's a desire for
other behavior, happy to implement that - but might be as well left for
a separate patch)

Reviewers: davidxl

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

llvm-svn: 307516

7 years agoRemove incorrect FIXME comment; the FIXME was addressed before the changes were committed
Eric Fiselier [Mon, 10 Jul 2017 02:59:26 +0000 (02:59 +0000)]
Remove incorrect FIXME comment; the FIXME was addressed before the changes were committed

llvm-svn: 307515

7 years agoRemove non-ascii characters introduced in r307513
Eric Fiselier [Mon, 10 Jul 2017 02:52:34 +0000 (02:52 +0000)]
Remove non-ascii characters introduced in r307513

llvm-svn: 307514

7 years ago[coroutines] Include the implicit object parameter type when looking up coroutine_tra...
Eric Fiselier [Mon, 10 Jul 2017 01:27:22 +0000 (01:27 +0000)]
[coroutines] Include the implicit object parameter type when looking up coroutine_traits for member functions.

This patch was originally from Toby Allsopp, but I hijacked it and
fixed it up with his permission.

llvm-svn: 307513

7 years agoDon't access Python objects while not holding the GIL.
Zachary Turner [Sun, 9 Jul 2017 23:32:15 +0000 (23:32 +0000)]
Don't access Python objects while not holding the GIL.

Patch by Tatyana Krasnukha
Differential Revision: https://reviews.llvm.org/D34942

llvm-svn: 307512