platform/upstream/llvm.git
6 years agoclang/test/SemaCXX/ms-iunknown-template-function.cpp: Appease for targeting *-win32.
NAKAMURA Takumi [Sat, 30 Sep 2017 09:16:41 +0000 (09:16 +0000)]
clang/test/SemaCXX/ms-iunknown-template-function.cpp: Appease for targeting *-win32.

This expects the warning;

  File clang/test/SemaCXX/ms-iunknown-template-function.cpp Line 19: __declspec attribute 'novtable' is not supported

But for targeting *-win32, the warning is not seen.

  error: 'warning' diagnostics expected but not seen:
    File clang\test\SemaCXX\ms-iunknown-template-function.cpp Line 19 (directive at clang\test\SemaCXX\ms-iunknown-template-function.cpp:18): __declspec attribute 'novtable'

llvm-svn: 314586

6 years agoFix buildbot failure -- tighten type check for matching phi
Xinliang David Li [Sat, 30 Sep 2017 05:27:46 +0000 (05:27 +0000)]
Fix buildbot failure -- tighten type check for matching phi

llvm-svn: 314585

6 years ago[X86] Support v64i8 mulhu/mulhs
Craig Topper [Sat, 30 Sep 2017 04:21:46 +0000 (04:21 +0000)]
[X86] Support v64i8 mulhu/mulhs

Implemented by splitting into two v32i8 mulhu/mulhs and concatenating the results.

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

llvm-svn: 314584

6 years ago[ODRHash] Add base classes to hashing CXXRecordDecl.
Richard Trieu [Sat, 30 Sep 2017 02:19:17 +0000 (02:19 +0000)]
[ODRHash] Add base classes to hashing CXXRecordDecl.

llvm-svn: 314581

6 years ago[Analyzer] Add dummy implementation to call_once to avoid linkage warnings in tests.
George Karpenkov [Sat, 30 Sep 2017 01:15:35 +0000 (01:15 +0000)]
[Analyzer] Add dummy implementation to call_once to avoid linkage warnings in tests.

llvm-svn: 314580

6 years agoRecommi r314561 after fixing over-debug assertion
Xinliang David Li [Sat, 30 Sep 2017 00:46:32 +0000 (00:46 +0000)]
Recommi r314561 after fixing over-debug assertion

llvm-svn: 314579

6 years ago[llvm-rc] Serialize DIALOG(EX) to .res files (serialization, pt 4).
Marek Sokolowski [Sat, 30 Sep 2017 00:38:52 +0000 (00:38 +0000)]
[llvm-rc] Serialize DIALOG(EX) to .res files (serialization, pt 4).

This is now able to serialize DIALOG and DIALOGEX resources to .res
files. It still can't parse dialog-specific CAPTION, FONT, and STYLE
optional statement - these will be added in the following patch.

A limited set of controls is included. However, more can be easily added
by extending SupportedCtls map defined in ResourceScriptStmt.cpp.

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

llvm-svn: 314578

6 years agotypos
Adrian Prantl [Sat, 30 Sep 2017 00:31:15 +0000 (00:31 +0000)]
typos

llvm-svn: 314577

6 years agollvm-dwarfdump: implement the --name lookup option.
Adrian Prantl [Sat, 30 Sep 2017 00:22:25 +0000 (00:22 +0000)]
llvm-dwarfdump: implement the --name lookup option.

llvm-svn: 314576

6 years agoFix 80 column violations
Adrian Prantl [Sat, 30 Sep 2017 00:22:24 +0000 (00:22 +0000)]
Fix 80 column violations

llvm-svn: 314575

6 years agoAdd comments
Adrian Prantl [Sat, 30 Sep 2017 00:22:21 +0000 (00:22 +0000)]
Add comments

llvm-svn: 314574

6 years ago[Analyzer] Document a gotcha: for C++ -analyze-function requires parameters in functi...
George Karpenkov [Sat, 30 Sep 2017 00:07:22 +0000 (00:07 +0000)]
[Analyzer] Document a gotcha: for C++ -analyze-function requires parameters in function name

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

llvm-svn: 314573

6 years ago[Analyzer] Add nullability to the list of tested checkers in SATestBuild
George Karpenkov [Sat, 30 Sep 2017 00:05:24 +0000 (00:05 +0000)]
[Analyzer] Add nullability to the list of tested checkers in SATestBuild

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

llvm-svn: 314572

6 years ago[Analyzer] Synthesize function body for std::call_once
George Karpenkov [Sat, 30 Sep 2017 00:03:22 +0000 (00:03 +0000)]
[Analyzer] Synthesize function body for std::call_once

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

llvm-svn: 314571

6 years agoAdd a "vexing parse" warning for ambiguity between a variable declaration and a
Richard Smith [Fri, 29 Sep 2017 23:57:25 +0000 (23:57 +0000)]
Add a "vexing parse" warning for ambiguity between a variable declaration and a
function-style cast.

This fires for cases such as

  T(x);

... where 'x' was previously declared and T is a type. This construct declares
a variable named 'x' rather than the (probably expected) interpretation of a
function-style cast of 'x' to T.

llvm-svn: 314570

6 years ago[AMDGPU] Set fast-math flags on functions given the options
Stanislav Mekhanoshin [Fri, 29 Sep 2017 23:40:19 +0000 (23:40 +0000)]
[AMDGPU] Set fast-math flags on functions given the options

We have a single library build without relaxation options.
When inlined library functions remove fast math attributes
from the functions they are integrated into.

This patch sets relaxation attributes on the functions after
linking provided corresponding relaxation options are given.
Math instructions inside the inlined functions remain to have
no fast flags, but inlining does not prevent fast math
transformations of a surrounding caller code anymore.

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

llvm-svn: 314568

6 years agoCodeGen: Fix pointer info in expandUnalignedLoad/Store
Yaxun Liu [Fri, 29 Sep 2017 23:31:14 +0000 (23:31 +0000)]
CodeGen: Fix pointer info in expandUnalignedLoad/Store

Currently expandUnalignedLoad/Store uses place holder pointer info for temporary memory operand
in stack, which does not have correct address space. This causes unaligned private double16 load/store to be
lowered to flat_load instead of buffer_load for amdgcn target.

This fixes failures of OpenCL conformance test basic/vload_private/vstore_private on target amdgcn---amdgizcl.

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

llvm-svn: 314566

6 years agofix 80 column violation.
Adrian Prantl [Fri, 29 Sep 2017 22:46:22 +0000 (22:46 +0000)]
fix 80 column violation.

llvm-svn: 314564

6 years agoRevert 314561 due to debug build assertion failure
Xinliang David Li [Fri, 29 Sep 2017 22:30:34 +0000 (22:30 +0000)]
Revert 314561 due to debug build assertion failure

llvm-svn: 314563

6 years ago[llvm-rc] Serialize MENU resources to .res files (serialization, pt 3).
Marek Sokolowski [Fri, 29 Sep 2017 22:25:05 +0000 (22:25 +0000)]
[llvm-rc] Serialize MENU resources to .res files (serialization, pt 3).

This allows MENU resources to be serialized.

MENU resource statement doc:
msdn.microsoft.com/en-us/library/windows/desktop/aa381025.aspx
POPUP sub-statement doc:
msdn.microsoft.com/en-us/library/windows/desktop/aa381030.aspx
MENUITEM sub-statement doc:
msdn.microsoft.com/en-us/library/windows/desktop/aa381024.aspx
MENUHEADER structure:
msdn.microsoft.com/en-us/library/windows/desktop/ms648018.aspx (and
NORMALMENUITEM, POPUPMENUITEM structs).

Thanks for Nico Weber for his original work in this area.

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

llvm-svn: 314562

6 years agoEliminate PHI (int typed) which has only one use by intptr
Xinliang David Li [Fri, 29 Sep 2017 22:10:15 +0000 (22:10 +0000)]
Eliminate PHI (int typed) which has only one use by intptr

This patch will eliminate redundant intptr/ptrtoint that pessimizes
analyses such as SCEV, AA and will make optimization passes such
as auto-vectorization more powerful.

Differential revision: http://reviews.llvm.org/D37832

llvm-svn: 314561

6 years agoRevert "Use the basic cost if a GEP is not used as addressing mode"
Alex Shlyapnikov [Fri, 29 Sep 2017 22:04:45 +0000 (22:04 +0000)]
Revert "Use the basic cost if a GEP is not used as addressing mode"

This reverts commit r314517.

This commit crashes sanitizer bots, for example:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/4167

Stack snippet:
...
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Support/Casting.h:255:0
llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::getGEPCost(llvm::GEPOperator const*, llvm::ArrayRef<llvm::Value const*>)
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:742:0
llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::getUserCost(llvm::User const*, llvm::ArrayRef<llvm::Value const*>)
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:782:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/lib/Analysis/TargetTransformInfo.cpp:116:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:116:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:343:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:864:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfo.h:285:0
...

llvm-svn: 314560

6 years ago[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Fri, 29 Sep 2017 21:55:49 +0000 (21:55 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 314559

6 years ago[PS4] Tidy up some debug-tuning v. triple decision-making.
Paul Robinson [Fri, 29 Sep 2017 21:25:07 +0000 (21:25 +0000)]
[PS4] Tidy up some debug-tuning v. triple decision-making.

llvm-svn: 314558

6 years ago[Sema] Correct IUnknown to support Unknwnbase.h Header.
Erich Keane [Fri, 29 Sep 2017 21:06:00 +0000 (21:06 +0000)]
[Sema] Correct IUnknown to support Unknwnbase.h Header.

Apparently, the MSVC SDK has a strange implementation that
causes a number of implicit functions as well as a template member
function of the IUnknown type. This patch allows these as InterfaceLike
types as well.

Additionally, it corrects the behavior where extern-C++ wrapped around an
Interface-Like type would permit an interface-like type to exist in a namespace.

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

llvm-svn: 314557

6 years agoMove LoadedModule list to a NoCtor vector and initialize on demand.
Francis Ricci [Fri, 29 Sep 2017 20:55:06 +0000 (20:55 +0000)]
Move LoadedModule list to a NoCtor vector and initialize on demand.

Unreverting this patch because llvm-clang-lld-x86_64-debian-fast started
passing again before the revert hit. Must've been just a flake.

llvm-svn: 314556

6 years agoRevert "Move LoadedModule list to a NoCtor vector and initialize on demand."
Francis Ricci [Fri, 29 Sep 2017 20:04:29 +0000 (20:04 +0000)]
Revert "Move LoadedModule list to a NoCtor vector and initialize on demand."

I think this may have introduced a failure on
llvm-clang-lld-x86_64-debian-fast

This reverts commit r314533

llvm-svn: 314552

6 years agoRevert "[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)"
Brian Gesiak [Fri, 29 Sep 2017 19:50:41 +0000 (19:50 +0000)]
Revert "[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)"

Summary:
It appears polly makes use of the `CMAKE_RUNTIME_OUTPUT_DIRECTORY` variable
when configuring its lit test suite. Reverting this for now.

llvm-svn: 314551

6 years ago[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)
Brian Gesiak [Fri, 29 Sep 2017 19:34:57 +0000 (19:34 +0000)]
[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)

Summary:
Three `CMAKE_.*_OUTPUT_DIRECTORY` variables used to be set in CMake and
referenced in various other parts of the project. However, in r198205
chapuni added a note to "don't set them anymore", and any remaining
references to them were subsequently removed in r198316 and r199592.

Now that the variables are no longer used anywhere, remove them, along
with the comments advising against using them any longer.

Test Plan:
I ran `check-all` and confirmed the tests built and passed.

Reviewers: beanz, chapuni

Reviewed By: beanz

Subscribers: mgorny

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

llvm-svn: 314550

6 years ago[llvm-rc] Serialize ACCELERATORS to .res files (serialization, pt 2).
Marek Sokolowski [Fri, 29 Sep 2017 19:07:44 +0000 (19:07 +0000)]
[llvm-rc] Serialize ACCELERATORS to .res files (serialization, pt 2).

This allows llvm-rc to serialize ACCELERATORS resources.

Additionally, as this is the first type of resource to support basic
optional resource statements (LANGUAGE, CHARACTERISTICS, VERSION),

ACCELERATORS statement documentation:
msdn.microsoft.com/en-us/library/windows/desktop/aa380610.aspx
Accelerator table structure documentation:
msdn.microsoft.com/en-us/library/windows/desktop/ms648010.aspx
Optional resource statement fields are described in:
msdn.microsoft.com/en-us/library/windows/desktop/ms648027.aspx

Thanks for Nico Weber for his original work in this area.

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

llvm-svn: 314549

6 years agoFix amdgcn-amdhsa on llvm-3.9
Jan Vesely [Fri, 29 Sep 2017 19:06:52 +0000 (19:06 +0000)]
Fix amdgcn-amdhsa on llvm-3.9

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 314548

6 years agotravis: Check built libraries on llvm-3.9
Jan Vesely [Fri, 29 Sep 2017 19:06:50 +0000 (19:06 +0000)]
travis: Check built libraries on llvm-3.9

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 314547

6 years agoAdd script to check for unresolved function calls
Jan Vesely [Fri, 29 Sep 2017 19:06:48 +0000 (19:06 +0000)]
Add script to check for unresolved function calls

v2: add shell shebang
    improve error checks and reporting
v3: fix typo

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 314546

6 years agogeometric: geometric functions are only supported for vector lengths <=4
Jan Vesely [Fri, 29 Sep 2017 19:06:47 +0000 (19:06 +0000)]
geometric: geometric functions are only supported for vector lengths <=4

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 314545

6 years agotravis: add build using llvm-3.9
Jan Vesely [Fri, 29 Sep 2017 19:06:45 +0000 (19:06 +0000)]
travis: add build using llvm-3.9

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 314544

6 years agoRestore support for llvm-3.9
Jan Vesely [Fri, 29 Sep 2017 19:06:41 +0000 (19:06 +0000)]
Restore support for llvm-3.9

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 314543

6 years ago[LV] Use correct insertion point when type shrinking reductions
Matthew Simpson [Fri, 29 Sep 2017 18:07:39 +0000 (18:07 +0000)]
[LV] Use correct insertion point when type shrinking reductions

When type shrinking reductions, we should insert the truncations and extends at
the end of the loop latch block. Previously, these instructions were inserted
at the end of the loop header block. The difference is only a problem for loops
with predicated instructions (e.g., conditional stores and instructions that
may divide by zero). For these instructions, we create new basic blocks inside
the vectorized loop, which cause the loop header and latch to no longer be the
same block. This should fix PR34687.

Reference: https://bugs.llvm.org/show_bug.cgi?id=34687
llvm-svn: 314542

6 years ago[llvm-rc] Refactoring needed for ACCELERATORS and MENU resources.
Marek Sokolowski [Fri, 29 Sep 2017 17:46:32 +0000 (17:46 +0000)]
[llvm-rc] Refactoring needed for ACCELERATORS and MENU resources.

This is a part of llvm-rc serialization patch set (serialization, pt 1.5).

This:

* Unifies the internal representation of flags in ACCELERATORS and MENU
   with the corresponding representation in .res files (noticed in
   https://reviews.llvm.org/D37828#inline-329828).
* Creates an RCResource subclass, OptStatementsRCResource, describing
   resource statements that can declare resource-local optional statements
   (proposed in https://reviews.llvm.org/D37824#inline-329775).

These modifications don't fit to any of the current patches, so I'm
submitting them as a separate patch.

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

llvm-svn: 314541

6 years agoUse LLVM_ENABLE_ABI_BREAKING_CHECKS correctly
Sanjoy Das [Fri, 29 Sep 2017 17:17:54 +0000 (17:17 +0000)]
Use LLVM_ENABLE_ABI_BREAKING_CHECKS correctly

llvm-svn: 314539

6 years ago[llvm-rc] Serialize HTML resources to .res files (serialization, pt 1).
Marek Sokolowski [Fri, 29 Sep 2017 17:14:09 +0000 (17:14 +0000)]
[llvm-rc] Serialize HTML resources to .res files (serialization, pt 1).

This allows to process HTML resources defined in .rc scripts and output
them to resulting .res files. Additionally, some infrastructure allowing
to output these files is created.

This is the first resource type we can operate on.

Thanks to Nico Weber for his original work in this area.

Differential Revision: reviews.llvm.org/D37283

llvm-svn: 314538

6 years agoDisplay relative hotness with two decimal digits after the decimal point
Adam Nemet [Fri, 29 Sep 2017 16:56:54 +0000 (16:56 +0000)]
Display relative hotness with two decimal digits after the decimal point

I've seen cases where tiny inlined functions have such a high execution count
that most everything would show up with a relative of hotness of 0%.  Since
the inlined functions effectively disappear you need to tune in the lower
range, thus we need more precision.

llvm-svn: 314537

6 years agoFix Wmismatched-tags warning.
Simon Pilgrim [Fri, 29 Sep 2017 16:52:27 +0000 (16:52 +0000)]
Fix Wmismatched-tags warning.

InlineAsmIdentifierInfo was declared a class in some places and a struct in others.

Partial reversion of rL314508

llvm-svn: 314536

6 years ago[test] Enable LeakSanitizer on 64-bit Darwin ASan llvm builds
Francis Ricci [Fri, 29 Sep 2017 16:51:50 +0000 (16:51 +0000)]
[test] Enable LeakSanitizer on 64-bit Darwin ASan llvm builds

Summary:
Also disables leak checking on lto tests, due to many leaks reported
in the system's ld64.

Reviewers: kcc, pcc, bogner, kubamracek

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 314535

6 years ago[WebAssembly] Allow each data segment to specify its own alignment
Sam Clegg [Fri, 29 Sep 2017 16:50:08 +0000 (16:50 +0000)]
[WebAssembly] Allow each data segment to specify its own alignment

Also, add a flags field as we will almost certainly
be needing that soon too.

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

llvm-svn: 314534

6 years agoMove LoadedModule list to a NoCtor vector and initialize on demand.
Francis Ricci [Fri, 29 Sep 2017 16:47:02 +0000 (16:47 +0000)]
Move LoadedModule list to a NoCtor vector and initialize on demand.

llvm-svn: 314533

6 years agoSmall clangd cleanups, NFC
Sam McCall [Fri, 29 Sep 2017 16:41:23 +0000 (16:41 +0000)]
Small clangd cleanups, NFC

 - remove old ASTUnit includes
 - fix typo (regiterCallbackHandlers)

llvm-svn: 314532

6 years ago[SimplifyIndVar] Do not fail when we constant fold an IV user to ConstantPointerNull
Hongbin Zheng [Fri, 29 Sep 2017 16:32:12 +0000 (16:32 +0000)]
[SimplifyIndVar] Do not fail when we constant fold an IV user to ConstantPointerNull

The type of a SCEVConstant may not match the corresponding LLVM Value.
In this case, we skip the constant folding for now.

TODO: Replace ConstantInt Zero by ConstantPointerNull
llvm-svn: 314531

6 years agoAMDGPU: fix bad test exposed by r314522
Nicolai Haehnle [Fri, 29 Sep 2017 16:07:05 +0000 (16:07 +0000)]
AMDGPU: fix bad test exposed by r314522

The test attempts to use -1 as carry-in for v_addc_*.

Before writing r314522, I did actually test this on real hardware,
and found that it doesn't work. So r314522 is correct in restricting
the carry-in operand: just remove those tests to make things pass
again.

llvm-svn: 314530

6 years agofixup, post rL314493
Coby Tayree [Fri, 29 Sep 2017 16:04:16 +0000 (16:04 +0000)]
fixup, post rL314493
'InlineAsmIdentifierInfo' is now a struct - notify Sema.h it isn't a class anymore

llvm-svn: 314529

6 years agoFix cmake file broken by D38277.
Alex Shlyapnikov [Fri, 29 Sep 2017 16:02:39 +0000 (16:02 +0000)]
Fix cmake file broken by D38277.

llvm-svn: 314528

6 years ago[ThinLTO] Use decimal suffix for promoted values to match demanglers
Teresa Johnson [Fri, 29 Sep 2017 15:55:42 +0000 (15:55 +0000)]
[ThinLTO] Use decimal suffix for promoted values to match demanglers

Summary:
Demanglers such as libiberty know how to strip suffixes of the form
\.[a-zA-Z]+\.\d+, but our current promoted value suffixes are
.llvm.${modulehash}, where the module hash is in hex. Change the
module hash to decimal to allow demanglers to handle this.

Reviewers: danielcdh

Subscribers: llvm-commits, inglorion

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

llvm-svn: 314527

6 years ago[test] Disable leak checking on a clang crash test on Darwin
Francis Ricci [Fri, 29 Sep 2017 15:46:27 +0000 (15:46 +0000)]
[test] Disable leak checking on a clang crash test on Darwin

Suspected failure due to LSan's atexit and exit interception behavior.

Reviewers: kcc, kubamracek, bogner, hfinkel, alekseyshl, Hahnfeld, gtbercea

Subscribers: llvm-commits

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

llvm-svn: 314526

6 years ago[Polly] Add dumpPw() and dumpExpanded() functions. NFC.
Michael Kruse [Fri, 29 Sep 2017 15:45:40 +0000 (15:45 +0000)]
[Polly] Add dumpPw() and dumpExpanded() functions. NFC.

These functions print a multi-line and sorted representation of unions
of polyhedra. Each polyhedron (basic_{ast/map}) has its own line.
First sort key is the polyhedron's hierachical space structure.
Secondary sort key is the lower bound of the polyhedron, which should
ensure that the polyhedral are printed in approximately ascending order.

Example output of dumpPw():
[p_0, p_1, p_2] -> {
  Stmt0[0] -> [0, 0];
  Stmt0[i0] -> [i0, 0] : 0 < i0 <= 5 - p_2;
  Stmt1[0] -> [0, 2] : p_1 = 1 and p_0 = -1;
  Stmt2[0] -> [0, 1] : p_1 >= 3 + p_0;
  Stmt3[0] -> [0, 3];
}

In contrast dumpExpanded() prints each point in the sets, unless there
is an unbounded dimension that cannot be expandend.
This is useful for reduced test cases where the loop counts are set to
some constant to understand a bug.

Example output of dumpExpanded(
{ [MemRef_A[i0] -> [i1]] : (exists (e0 = floor((1 + i1)/3): i0 = 1 and
3e0 <= i1 and 3e0 >= -1 + i1 and i1 >= 15 and i1 <= 25)) or (exists (e0
= floor((i1)/3): i0 = 0 and 3e0 < i1 and 3e0 >= -2 + i1 and i1 > 0 and
i1 <= 11)) }):

{
  [MemRef_A[0] ->[1]];
  [MemRef_A[0] ->[2]];
  [MemRef_A[0] ->[4]];
  [MemRef_A[0] ->[5]];
  [MemRef_A[0] ->[7]];
  [MemRef_A[0] ->[8]];
  [MemRef_A[0] ->[10]];
  [MemRef_A[0] ->[11]];
  [MemRef_A[1] ->[15]];
  [MemRef_A[1] ->[16]];
  [MemRef_A[1] ->[18]];
  [MemRef_A[1] ->[19]];
  [MemRef_A[1] ->[21]];
  [MemRef_A[1] ->[22]];
  [MemRef_A[1] ->[24]];
  [MemRef_A[1] ->[25]]
}

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

llvm-svn: 314525

6 years agoFix Modules/{builtin-import.mm,umbrella-header-include-builtin.mm} to be able to...
Filipe Cabecinhas [Fri, 29 Sep 2017 15:45:34 +0000 (15:45 +0000)]
Fix Modules/{builtin-import.mm,umbrella-header-include-builtin.mm} to be able to handle non-Darwin targets

Summary: Also makes them pass on Darwin, if the default target triple is a Linux triple.

Reviewers: bruno, rsmith

Subscribers: cfe-commits

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

llvm-svn: 314524

6 years ago[dwarfdump][NFC] Consistent printing of address ranges
Jonas Devlieghere [Fri, 29 Sep 2017 15:41:22 +0000 (15:41 +0000)]
[dwarfdump][NFC] Consistent printing of address ranges

This implement the insertion operator for DWARF address ranges so they
are consistently printed as [LowPC, HighPC).

While a dump method might have felt more consistent, it is used
exclusively for printing error messages in the verifier and never used
for actual dumping. Hence this approach is more intuitive and creates
less clutter at the call sites.

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

llvm-svn: 314523

6 years agoAMDGPU: VALU carry-in and v_cndmask condition cannot be EXEC
Nicolai Haehnle [Fri, 29 Sep 2017 15:37:31 +0000 (15:37 +0000)]
AMDGPU: VALU carry-in and v_cndmask condition cannot be EXEC

The hardware will only forward EXEC_LO; the high 32 bits will be zero.

Additionally, inline constants do not work. At least,

   v_addc_u32_e64 v0, vcc, v0, v1, -1

which could conceivably be used to combine (v0 + v1 + 1) into a single
instruction, acts as if all carry-in bits are zero.

The llvm.amdgcn.ps.live test is adjusted; it would be nice to combine

   s_mov_b64 s[0:1], exec
   v_cndmask_b32_e64 v0, v1, v2, s[0:1]

into

   v_mov_b32 v0, v3

but it's not particularly high priority.

Fixes dEQP-GLES31.functional.shaders.helper_invocation.value.*

llvm-svn: 314522

6 years agoAdd missing header definition
Francis Ricci [Fri, 29 Sep 2017 15:17:23 +0000 (15:17 +0000)]
Add missing header definition

llvm-svn: 314521

6 years agoRemove recursion from FindModuleForAddress. NFC.
Francis Ricci [Fri, 29 Sep 2017 15:14:31 +0000 (15:14 +0000)]
Remove recursion from FindModuleForAddress. NFC.

llvm-svn: 314520

6 years ago[ScopBuilder] Fix typo. NFC.
Michael Kruse [Fri, 29 Sep 2017 15:13:05 +0000 (15:13 +0000)]
[ScopBuilder] Fix typo. NFC.

Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in>
Differential Revision: https://reviews.llvm.org/D38322

llvm-svn: 314519

6 years agoRefactor android fallback procmaps init. NFC.
Francis Ricci [Fri, 29 Sep 2017 15:06:47 +0000 (15:06 +0000)]
Refactor android fallback procmaps init. NFC.

llvm-svn: 314518

6 years agoUse the basic cost if a GEP is not used as addressing mode
Jun Bum Lim [Fri, 29 Sep 2017 14:50:16 +0000 (14:50 +0000)]
Use the basic cost if a GEP is not used as addressing mode

Summary:
Currently, getGEPCost() returns TCC_FREE whenever a GEP is a legal addressing mode in the target.
However, since it doesn't check its actual users, it will return FREE even in cases
where the GEP cannot be folded away as a part of actual addressing mode.
For example, if an user of the GEP is a call instruction taking the GEP as a parameter,
then the GEP may not be folded in isel.

Reviewers: hfinkel, efriedma, mcrosier, jingyue, haicheng

Reviewed By: hfinkel

Subscribers: javed.absar, llvm-commits

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

llvm-svn: 314517

6 years ago[SystemZ] implement shouldCoalesce()
Jonas Paulsson [Fri, 29 Sep 2017 14:31:39 +0000 (14:31 +0000)]
[SystemZ]  implement shouldCoalesce()

Implement shouldCoalesce() to help regalloc avoid running out of GR128
registers.

If a COPY involving a subreg of a GR128 is coalesced, the live range of the
GR128 virtual register will be extended. If this happens where there are
enough phys-reg clobbers present, regalloc will run out of registers (if
there is not a single GR128 allocatable register available).

This patch tries to allow coalescing only when it can prove that this will be
safe by checking the (local) interval in question.

Review: Ulrich Weigand, Quentin Colombet
https://reviews.llvm.org/D37899
https://bugs.llvm.org/show_bug.cgi?id=34610

llvm-svn: 314516

6 years agoFix spelling in comments. NFCI.
Simon Pilgrim [Fri, 29 Sep 2017 14:13:47 +0000 (14:13 +0000)]
Fix spelling in comments. NFCI.

llvm-svn: 314515

6 years ago[X86] Improve codegen for inverted overflow checking intrinsics.
Amara Emerson [Fri, 29 Sep 2017 13:53:44 +0000 (13:53 +0000)]
[X86] Improve codegen for inverted overflow checking intrinsics.

Adds a new combine for: xor(setcc cc, val), 1 --> setcc (invert(cc), val)

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

llvm-svn: 314514

6 years ago[test] Fix uninitialized memory in omp_taskloop_grainsize.c
Jonas Hahnfeld [Fri, 29 Sep 2017 13:53:03 +0000 (13:53 +0000)]
[test] Fix uninitialized memory in omp_taskloop_grainsize.c

result was never initialized to zero which sometimes failed the test.

llvm-svn: 314513

6 years ago[CMake] Fix configuration on PowerPC with sanitizers
Jonas Hahnfeld [Fri, 29 Sep 2017 13:32:39 +0000 (13:32 +0000)]
[CMake] Fix configuration on PowerPC with sanitizers

TEST_BIG_ENDIAN() performs compile tests that will fail with
-nodefaultlibs when building under LLVM_USE_SANITIZER.

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

llvm-svn: 314512

6 years ago[ARM] v8.3-a complex number support
Sam Parker [Fri, 29 Sep 2017 13:11:33 +0000 (13:11 +0000)]
[ARM] v8.3-a complex number support

New instructions are added to AArch32 and AArch64 to aid
floating-point multiplication and addition of complex numbers, where
the complex numbers are packed in a vector register as a pair of
elements. The Imaginary part of the number is placed in the more
significant element, and the Real part of the number is placed in the
less significant element.

This patch adds assembler for the ARM target.

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

llvm-svn: 314511

6 years agoSmall modification <NFC>
Michael Zuckerman [Fri, 29 Sep 2017 12:45:54 +0000 (12:45 +0000)]
Small modification <NFC>

Change-Id: I360abccee12cae29bd2ac4f8399c9ecc92eb7f13
llvm-svn: 314510

6 years ago[docs][refactor] Add refactoring engine design documentation
Alex Lorenz [Fri, 29 Sep 2017 12:21:38 +0000 (12:21 +0000)]
[docs][refactor] Add refactoring engine design documentation

This commit adds a refactoring engine design document that talks about the
design and provides several example of how the engine can be used.

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

llvm-svn: 314509

6 years agoFix Wmismatched-tags warning.
Simon Pilgrim [Fri, 29 Sep 2017 11:42:05 +0000 (11:42 +0000)]
Fix Wmismatched-tags warning.

InlineAsmIdentifierInfo was declared a class in some places and a class in others.

llvm-svn: 314508

6 years ago[mips] Reordering callseq* nodes to be linear
Aleksandar Beserminji [Fri, 29 Sep 2017 11:05:02 +0000 (11:05 +0000)]
[mips] Reordering callseq* nodes to be linear

Fix nested callseq* nodes by moving callseq_start after the
arguments calculation to temporary registers, so that callseq* nodes
in resulting DAG are linear.

Recommitting r314497. This version does not contain test which fails
when compiler is not build in debug mode.

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

llvm-svn: 314507

6 years agoRevert "[mips] Reordering callseq* nodes to be linear"
Aleksandar Beserminji [Fri, 29 Sep 2017 10:52:03 +0000 (10:52 +0000)]
Revert "[mips] Reordering callseq* nodes to be linear"

Added test relies on the compiler being built in debug mode,
which may not be the case.

This reverts commit r314497.

llvm-svn: 314506

6 years ago[mips] Add missing license info, formatting changes. NFCI
Simon Dardis [Fri, 29 Sep 2017 10:08:06 +0000 (10:08 +0000)]
[mips] Add missing license info, formatting changes. NFCI

Add missing license information to MicroMipsInstrFPU.td and
fix most of the formatting errors present. Others will be
addressed in a follow up commits.

llvm-svn: 314505

6 years ago[X86][SSE] Added more tests for vector multiplications as utility for D37896
Simon Pilgrim [Fri, 29 Sep 2017 10:02:01 +0000 (10:02 +0000)]
[X86][SSE] Added more tests for vector multiplications as utility for D37896

Added additional tests for vector multiplications with multipliers that are:
 * powers of 2 displaced by 1,
 * product of a power of 2 displaced by one with another power of 2.

Patch by @pacxx (Michael Haidl)

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

llvm-svn: 314504

6 years ago[mips] Add test cases for dext/dins family of instructions
Aleksandar Beserminji [Fri, 29 Sep 2017 09:53:24 +0000 (09:53 +0000)]
[mips] Add test cases for dext/dins family of instructions

Add missing test cases for dext, dextm, dextu, dins, dinsm and
dinsu instructions.

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

llvm-svn: 314503

6 years ago[AMDGPU] calling conventions for AMDPAL OS type
Tim Renouf [Fri, 29 Sep 2017 09:51:22 +0000 (09:51 +0000)]
[AMDGPU] calling conventions for AMDPAL OS type

Summary:
This commit adds comments on how the AMDPAL OS type overloads the
existing AMDGPU_ calling conventions used by Mesa, and adds a couple of
new ones.

Reviewers: arsenm, nhaehnle, dstuttard

Subscribers: mehdi_amini, kzhuravl, wdng, yaxunl, t-tye, llvm-commits

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

llvm-svn: 314502

6 years ago[AMDGPU] AMDPAL scratch buffer support
Tim Renouf [Fri, 29 Sep 2017 09:49:35 +0000 (09:49 +0000)]
[AMDGPU] AMDPAL scratch buffer support

Summary:
Added support for scratch (including spilling) for OS type amdpal:
generates code to set up the scratch descriptor if it is needed.

With amdpal, the scratch resource descriptor is loaded from offset 0 of
the global information table. The low 32 bits of the address of the
global information table is passed in s0.

Added amdgpu-git-ptr-high function attribute to hard-wire the high 32
bits of the address of the global information table. If the function
attribute is not specified, or is 0xffffffff, then the backend generates
code to use the high 32 bits of pc.

The documentation for the AMDPAL ABI will be added in a later commit.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye

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

llvm-svn: 314501

6 years ago[Triple] Add AMDPAL operating system type
Tim Renouf [Fri, 29 Sep 2017 09:48:12 +0000 (09:48 +0000)]
[Triple] Add AMDPAL operating system type

Summary:
This operating system type represents the AMDGPU PAL runtime, and will
be required by the AMDGPU backend in order to generate correct code for
this runtime.

Currently it generates the same code as not specifying an OS at all.
That will change in future commits.

Patch from Tim Corringham.

Subscribers: arsenm, nhaehnle

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

llvm-svn: 314500

6 years ago[Sema] Suppress warnings for C's zero initializer
Daniel Marjamaki [Fri, 29 Sep 2017 09:44:41 +0000 (09:44 +0000)]
[Sema] Suppress warnings for C's zero initializer

Patch by S. Gilles!

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

llvm-svn: 314499

6 years ago[dwarfdump][NFC] Consistent errors and warnings with --verify
Jonas Devlieghere [Fri, 29 Sep 2017 09:33:31 +0000 (09:33 +0000)]
[dwarfdump][NFC] Consistent errors and warnings with --verify

This patch introduces 3 helper functions: error(), warn() and note() to
make printing  during verification more consistent. When supported, the
respective prefixes are printed in color using the same color scheme as
clang.

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

llvm-svn: 314498

6 years ago[mips] Reordering callseq* nodes to be linear
Aleksandar Beserminji [Fri, 29 Sep 2017 09:32:14 +0000 (09:32 +0000)]
[mips] Reordering callseq* nodes to be linear

Fix nested callseq* nodes by moving callseq_start after the
arguments calculation to temporary registers, so that callseq* nodes
in resulting DAG are linear.

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

llvm-svn: 314497

6 years ago[NFC] Removed accidenatally added file
Ben Dunbobbin [Fri, 29 Sep 2017 09:15:55 +0000 (09:15 +0000)]
[NFC] Removed accidenatally added file

llvm-svn: 314496

6 years ago[ELF] Simpler scheme for handling common symbols
Ben Dunbobbin [Fri, 29 Sep 2017 09:08:26 +0000 (09:08 +0000)]
[ELF] Simpler scheme for handling common symbols

Convert all common symbols to regular symbols after scan.
This means that the downstream code does not to handle common symbols as a special case.

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

llvm-svn: 314495

6 years ago[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediat...
Coby Tayree [Fri, 29 Sep 2017 07:02:49 +0000 (07:02 +0000)]
[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediate expressions

Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized.
supersedes D33278, D35774

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

llvm-svn: 314494

6 years ago[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediat...
Coby Tayree [Fri, 29 Sep 2017 07:02:46 +0000 (07:02 +0000)]
[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediate expressions

Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized.
supersedes D33278, D35774

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

llvm-svn: 314493

6 years agoSkip building x86 parts of UnwindRegisters*.S when targeting SjLj
Martin Storsjo [Fri, 29 Sep 2017 06:09:09 +0000 (06:09 +0000)]
Skip building x86 parts of UnwindRegisters*.S when targeting SjLj

This extends SVN r314197 from the arm parts to the whole file.

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

llvm-svn: 314492

6 years agoMake find_opt_files vararg
Adam Nemet [Fri, 29 Sep 2017 05:20:53 +0000 (05:20 +0000)]
Make find_opt_files vararg

This is slightly less verbose for the common case of a single build directory
and more intuitive when using this API directly from the interpreter.

llvm-svn: 314491

6 years ago[ORC] Replace decltype with a concrete type to make MSVC happy.
Lang Hames [Fri, 29 Sep 2017 05:03:43 +0000 (05:03 +0000)]
[ORC] Replace decltype with a concrete type to make MSVC happy.

This should fix some build failures on windows bots due to r314486.

llvm-svn: 314490

6 years ago[XRay][compiler-rt][NFC] Remove loggingInitialized() convenience function
Dean Michael Berris [Fri, 29 Sep 2017 04:28:11 +0000 (04:28 +0000)]
[XRay][compiler-rt][NFC] Remove loggingInitialized() convenience function

The function was introduced as a convenience that used to be called in
multiple places. Recent refactorings have removed the need to call this
function in multiple places, so inlined the implementation in the single
place it's defined.

Broken out from D38119.

llvm-svn: 314489

6 years agoFix Android remote debugging tests running on Windows
Eugene Zemtsov [Fri, 29 Sep 2017 03:25:25 +0000 (03:25 +0000)]
Fix Android remote debugging tests running on Windows

Use make based OS check, instad of relying on shell.

llvm-svn: 314488

6 years agoFix compilation error
Eugene Zemtsov [Fri, 29 Sep 2017 03:15:08 +0000 (03:15 +0000)]
Fix compilation error

llvm-svn: 314487

6 years ago[CMake] Fix typo "Wraning" (NFC)
Brian Gesiak [Fri, 29 Sep 2017 02:48:07 +0000 (02:48 +0000)]
[CMake] Fix typo "Wraning" (NFC)

Summary:
The typo was added in https://reviews.llvm.org/rL247151.
It should be "warning", not "wraning".

llvm-svn: 314486

6 years agollvm-readobj: fix a few typos (NFC)
Saleem Abdulrasool [Fri, 29 Sep 2017 02:45:44 +0000 (02:45 +0000)]
llvm-readobj: fix a few typos (NFC)

Correct the spelling of multiple in a couple of sites.

Patch by Alex Langford!

llvm-svn: 314485

6 years ago[NFC] Replace 'arguments' with 'parameters' in comments relating to lexing a macro...
Faisal Vali [Fri, 29 Sep 2017 02:43:22 +0000 (02:43 +0000)]
[NFC] Replace 'arguments' with 'parameters' in comments relating to lexing a macro definition.

llvm-svn: 314484

6 years ago[NFC] Rename variable 'Arguments' to 'Parameters' when lexing the Macro Definition.
Faisal Vali [Fri, 29 Sep 2017 02:17:31 +0000 (02:17 +0000)]
[NFC] Rename variable 'Arguments' to 'Parameters' when lexing the Macro Definition.

llvm-svn: 314483

6 years agoRevert "[BypassSlowDivision] Improve our handling of divisions by constants"
Sanjoy Das [Fri, 29 Sep 2017 00:54:16 +0000 (00:54 +0000)]
Revert "[BypassSlowDivision] Improve our handling of divisions by constants"

This reverts commit r314253.  It causes a miscompile on P100 in an internal
benchmark.  Reverting while I investigate.

llvm-svn: 314482

6 years agollvm-dwarfdump: support .apple-namespaces in --find
Adrian Prantl [Fri, 29 Sep 2017 00:52:33 +0000 (00:52 +0000)]
llvm-dwarfdump: support .apple-namespaces in --find

llvm-svn: 314481

6 years ago[llvm-rc] Import all make_unique invocations from llvm namespace.
Marek Sokolowski [Fri, 29 Sep 2017 00:33:57 +0000 (00:33 +0000)]
[llvm-rc] Import all make_unique invocations from llvm namespace.

Previous patch fixed one of LLVM buildbots (lld-x86_64-win7).
However, some others have already been failing because of make_unique
compilation error (llvm-clang-x86_64-expensive-checks-win).

llvm-svn: 314480

6 years agollvm-dwarfdump: add support for .apple_types in --find
Adrian Prantl [Fri, 29 Sep 2017 00:33:22 +0000 (00:33 +0000)]
llvm-dwarfdump: add support for .apple_types in --find

llvm-svn: 314479

6 years ago[llvm-rc] Add user-defined resources parsing ability. [8/8]
Marek Sokolowski [Fri, 29 Sep 2017 00:14:18 +0000 (00:14 +0000)]
[llvm-rc] Add user-defined resources parsing ability. [8/8]

This allows llvm-rc to parse user-defined resources (ref:
msdn.microsoft.com/en-us/library/windows/desktop/aa381054.aspx).
These statements either import files, or put the specified raw data in
the resulting resource file.

Thanks to Nico Weber for his original work in this area.

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

llvm-svn: 314478