platform/upstream/llvm.git
6 years ago[PowerPC] Relax the checking on AND/AND8 in isSignOrZeroExtended.
Sean Fertile [Wed, 29 Nov 2017 04:09:29 +0000 (04:09 +0000)]
[PowerPC] Relax the checking on AND/AND8 in isSignOrZeroExtended.

Separate the handling of AND/AND8 out from PHI/OR/ISEL checking. The reasoning
is the others need all their operands to be sign/zero extended for their output
to also be sign/zero extended. This is true for AND and sign-extension, but for
zero-extension we only need at least one of the input operands to be zero
extended for the result to also be zero extended.

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

llvm-svn: 319289

6 years ago[LibFuzzer] Add Android to LibFuzzer's supported OSes
Yi Kong [Wed, 29 Nov 2017 03:52:44 +0000 (03:52 +0000)]
[LibFuzzer] Add Android to LibFuzzer's supported OSes

... and a trivial fix that x86_64h arch should also be supported.

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

llvm-svn: 319288

6 years agoAMDGPU: Use stricter regexes for add instructions
Matt Arsenault [Wed, 29 Nov 2017 02:25:14 +0000 (02:25 +0000)]
AMDGPU: Use stricter regexes for add instructions

Match the entire _co as one optional piece rather than
a set of characters to match multiple times.

llvm-svn: 319275

6 years agoDelete dead code. NFC.
Rafael Espindola [Wed, 29 Nov 2017 01:55:03 +0000 (01:55 +0000)]
Delete dead code. NFC.

llvm-svn: 319274

6 years ago[Modules] Add textual headers for recently added .def files
Bruno Cardoso Lopes [Wed, 29 Nov 2017 01:53:49 +0000 (01:53 +0000)]
[Modules] Add textual headers for recently added .def files

Keep module.modulemap up to date and get rid of -Wincomplete-umbrella warnings

rdar://problem/35711925

llvm-svn: 319273

6 years agoDAG: Add nuw when splitting loads and stores
Matt Arsenault [Wed, 29 Nov 2017 01:25:12 +0000 (01:25 +0000)]
DAG: Add nuw when splitting loads and stores

The object can't straddle the address space
wrap around, so I think it's OK to assume any
offsets added to the base object pointer can't
overflow. Similar logic already appears to be
applied in SelectionDAGBuilder when lowering
aggregate returns.

llvm-svn: 319272

6 years agollvm-dwarfdump: honor the --show-children option when dumping a specific DIE.
Adrian Prantl [Wed, 29 Nov 2017 01:12:22 +0000 (01:12 +0000)]
llvm-dwarfdump: honor the --show-children option when dumping a specific DIE.

llvm-svn: 319271

6 years agoAMDGPU: Select DS insts without m0 initialization
Matt Arsenault [Wed, 29 Nov 2017 00:55:57 +0000 (00:55 +0000)]
AMDGPU: Select DS insts without m0 initialization

GFX9 stopped using m0 for most DS instructions. Select
a different instruction without the use. I think this will
be less error prone than trying to manually maintain m0
uses as needed.

llvm-svn: 319270

6 years agoReland "Fix vtable not receiving hidden visibility when using push(visibility)"
Jake Ehrlich [Wed, 29 Nov 2017 00:54:20 +0000 (00:54 +0000)]
Reland "Fix vtable not receiving hidden visibility when using push(visibility)"

I had to reland this change in order to make the test work on windows

This change should resolve https://bugs.llvm.org/show_bug.cgi?id=35022

https://reviews.llvm.org/D39627

llvm-svn: 319269

6 years agoRollback r319176.
Don Hinton [Wed, 29 Nov 2017 00:47:16 +0000 (00:47 +0000)]
Rollback r319176.

The ';' separators in LLVM_TARGETS_TO_BUILD disappear when list
variables are evaluated in custom commands.

llvm-svn: 319268

6 years ago[CMake] Support side-by-side checkouts in multi-stage build
Petr Hosek [Wed, 29 Nov 2017 00:34:46 +0000 (00:34 +0000)]
[CMake] Support side-by-side checkouts in multi-stage build

Passthrough LLVM_ENABLE_{PROJECTS,RUNTIMES} to followup stages to
support the side-by-side checkouts (aka monorepo layout).

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

llvm-svn: 319267

6 years ago[X86] Promote fp_to_sint v16f32->v16i16/v16i8 to avoid scalarization.
Craig Topper [Wed, 29 Nov 2017 00:32:09 +0000 (00:32 +0000)]
[X86] Promote fp_to_sint v16f32->v16i16/v16i8 to avoid scalarization.

llvm-svn: 319266

6 years agoReplace copyFrom with memcpy.
Rafael Espindola [Wed, 29 Nov 2017 00:31:39 +0000 (00:31 +0000)]
Replace copyFrom with memcpy.

It was only used for --wrap and I don't think the fields with special
treatment had a meaningful impact on that feature.

llvm-svn: 319265

6 years ago[CMake] Use LIST_SEPARATOR rather than escaping in ExternalProject_Add
Petr Hosek [Wed, 29 Nov 2017 00:23:10 +0000 (00:23 +0000)]
[CMake] Use LIST_SEPARATOR rather than escaping in ExternalProject_Add

Escaping ; in list arguments passed to ExternalProject_Add doesn't seem
to be working in newer versions of CMake (see
https://public.kitware.com/Bug/view.php?id=16137 for more details). Use
a custom LIST_SEPARATOR instead which is the officially supported way.

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

llvm-svn: 319264

6 years agoFix a warning.
Zachary Turner [Wed, 29 Nov 2017 00:13:44 +0000 (00:13 +0000)]
Fix a warning.

llvm-svn: 319263

6 years agoRevert "Add opt-viewer testing"
Adam Nemet [Wed, 29 Nov 2017 00:10:48 +0000 (00:10 +0000)]
Revert "Add opt-viewer testing"

This reverts commit r319188.

Breaks when c++filt is not available.

llvm-svn: 319262

6 years ago[X86] Add test cases for fptosi v16f32->v16i8/v16i16 to show scalarization.
Craig Topper [Wed, 29 Nov 2017 00:02:22 +0000 (00:02 +0000)]
[X86] Add test cases for fptosi v16f32->v16i8/v16i16 to show scalarization.

llvm-svn: 319261

6 years ago[NFC] Minor cleanups in CodeView TypeTableBuilder.
Zachary Turner [Tue, 28 Nov 2017 23:57:13 +0000 (23:57 +0000)]
[NFC] Minor cleanups in CodeView TypeTableBuilder.

llvm-svn: 319260

6 years ago[X86] Mark ISD::FP_TO_UINT v16i8/v16i16 as Promote under AVX512 instead of legal...
Craig Topper [Tue, 28 Nov 2017 23:56:02 +0000 (23:56 +0000)]
[X86] Mark ISD::FP_TO_UINT v16i8/v16i16 as Promote under AVX512 instead of legal. Fix infinite loop in op legalization when promotion requires 2 steps.

Previously we had an isel pattern to add the truncate. Instead use Promote to add the truncate to the DAG before isel.

The Promote legalization code had to be updated to prevent an infinite loop if promotion took multiple steps because it wasn't remembering the previously tried value.

llvm-svn: 319259

6 years ago[X86] Regenerate avx512-schedule test.
Craig Topper [Tue, 28 Nov 2017 23:55:59 +0000 (23:55 +0000)]
[X86] Regenerate avx512-schedule test.

For some reason some sqrt instructions were missing the scheduling comments.

llvm-svn: 319258

6 years ago[compiler-rt] Avoid unnecessarily hiding inline visibility [NFC]
Weiming Zhao [Tue, 28 Nov 2017 23:41:42 +0000 (23:41 +0000)]
[compiler-rt] Avoid unnecessarily hiding inline visibility [NFC]

Summary:
having fvisibility=hidden obviates the need for
fvisibility-inlines-hidden.

Reviewers: cryptoad, weimingz, mgorny, vsk, compnerd, peter.smith, nikhgupt

Reviewed By: vsk, nikhgupt

Subscribers: dberris, mgorny

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

llvm-svn: 319257

6 years agoAMDGPU: Enable IPRA
Matt Arsenault [Tue, 28 Nov 2017 23:40:12 +0000 (23:40 +0000)]
AMDGPU: Enable IPRA

llvm-svn: 319256

6 years ago[XRay][compiler-rt] Fix armhf build
Dean Michael Berris [Tue, 28 Nov 2017 23:38:18 +0000 (23:38 +0000)]
[XRay][compiler-rt] Fix armhf build

rL319241 was a bit too aggressive removing sources dependencies. This
restores the actual required dependency for armhf.

Follow-up to D39114.

llvm-svn: 319255

6 years ago[openmp] Set up .arcconfig to point to new Diffusion OMP repository
Ben Hamilton [Tue, 28 Nov 2017 23:28:45 +0000 (23:28 +0000)]
[openmp] Set up .arcconfig to point to new Diffusion OMP repository

Summary:
We want to automatically copy the appropriate mailing list
for review requests to the openmp repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40179, I set up a new Diffusion repository with callsign
"OMP" for OpenMP:

https://reviews.llvm.org/source/openmp/

This explicitly updates openmp's .arcconfig to point to the new
OMP repository in Diffusion, which will let us use Herald rule H272
to automatically subscribe openmp-commits to review requests.

Reviewers: hans, grokos, Hahnfeld

Reviewed By: grokos

Subscribers: sammccall, klimek, openmp-commits

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

llvm-svn: 319254

6 years ago[X86] Tag CLFLUSHOPT with same scheduling behaviour as CLFLUSH
Simon Pilgrim [Tue, 28 Nov 2017 23:25:42 +0000 (23:25 +0000)]
[X86] Tag CLFLUSHOPT with same scheduling behaviour as CLFLUSH

llvm-svn: 319253

6 years ago[globalisel][tablegen] Fix PR35375 by sign-extending the table value to match getCons...
Daniel Sanders [Tue, 28 Nov 2017 23:18:54 +0000 (23:18 +0000)]
[globalisel][tablegen] Fix PR35375 by sign-extending the table value to match getConstantVRegVal()

Summary:
From the bug report:
> The problem is that it fails when trying to compare -65536 (or 4294901760) to 0xFFFF,0000. This is because the
> constant in the instruction is sign extended to 64 bits (0xFFFF,FFFF,FFFF,0000) and then compared to the non
> extended 64 bit version expected by TableGen.
>
> In contrast, the DAGISelEmitter generates special code for AND immediates (OPC_CheckAndImm), which does not
> sign extend.

This patch doesn't introduce the special case for AND (and OR) immediates since the majority of it is related to handling known bits that have no effect on the result and GlobalISel doesn't detect known-bits at this time. Instead this patch just ensures that the immediate is extended consistently on both sides of the check.

Thanks to Diana Picus for the detailed bug report.

Reviewers: rovka

Reviewed By: rovka

Subscribers: kristof.beyls, javed.absar, llvm-commits

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

llvm-svn: 319252

6 years agoChange Requires to REQUIRES so that it works properly.
Douglas Yung [Tue, 28 Nov 2017 23:15:20 +0000 (23:15 +0000)]
Change Requires to REQUIRES so that it works properly.

llvm-svn: 319251

6 years ago[X86] Add CLFLUSHOPT schedule tests
Simon Pilgrim [Tue, 28 Nov 2017 23:12:12 +0000 (23:12 +0000)]
[X86] Add CLFLUSHOPT schedule tests

llvm-svn: 319250

6 years ago[X86][SSE] Add SSE_SHUFP OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 23:09:18 +0000 (23:09 +0000)]
[X86][SSE] Add SSE_SHUFP OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

llvm-svn: 319249

6 years agoCopy the visibility in copyFrom.
Rafael Espindola [Tue, 28 Nov 2017 23:06:09 +0000 (23:06 +0000)]
Copy the visibility in copyFrom.

This is simpler and matches bfd's behavior on the changed test.

llvm-svn: 319248

6 years ago[X86] Test clflushopt intrinsic on 32 and 64-bit targets
Simon Pilgrim [Tue, 28 Nov 2017 23:04:42 +0000 (23:04 +0000)]
[X86] Test clflushopt intrinsic on 32 and 64-bit targets

llvm-svn: 319247

6 years agoExpand test a bit.
Rafael Espindola [Tue, 28 Nov 2017 23:03:14 +0000 (23:03 +0000)]
Expand test a bit.

Also make it more reliable by not depending on the order of the
symbols.

This makes the next patch easier to read.

llvm-svn: 319246

6 years ago[X86][SSE] Add SSE_UNPCK/SSE_PUNPCK OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 22:55:08 +0000 (22:55 +0000)]
[X86][SSE] Add SSE_UNPCK/SSE_PUNPCK OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

llvm-svn: 319245

6 years agoCOFF: Simplify construction of safe SEH table. NFCI.
Peter Collingbourne [Tue, 28 Nov 2017 22:50:53 +0000 (22:50 +0000)]
COFF: Simplify construction of safe SEH table. NFCI.

Instead of building intermediate sets of exception handlers for each
object file, just create one for the final output file.

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

llvm-svn: 319244

6 years ago[X86][SSE] Use SSE_PACK OpndItins in PACKSS/PACKUS instruction definitions
Simon Pilgrim [Tue, 28 Nov 2017 22:47:45 +0000 (22:47 +0000)]
[X86][SSE] Use SSE_PACK OpndItins in PACKSS/PACKUS instruction definitions

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

SSE_PACK will be reused in the AVX512 equivalents.

llvm-svn: 319243

6 years agoRemove this test
Adam Nemet [Tue, 28 Nov 2017 22:39:38 +0000 (22:39 +0000)]
Remove this test

After r319235, we no longer generate this remark.

llvm-svn: 319242

6 years ago[XRay][compiler-rt] Fix runtime build
Dean Michael Berris [Tue, 28 Nov 2017 22:33:07 +0000 (22:33 +0000)]
[XRay][compiler-rt] Fix runtime build

This isolates the per-architecture files from the common files
implementing the XRay facilities. Because of the refactoring done in
D39114, we were including the definition of the sources in the archive
twice, causing link-time failures.

Follow-up to D39114.

llvm-svn: 319241

6 years agoFix VS2017 narrowing conversion warning. NFCI
Simon Pilgrim [Tue, 28 Nov 2017 22:32:43 +0000 (22:32 +0000)]
Fix VS2017 narrowing conversion warning. NFCI

llvm-svn: 319240

6 years ago[X86] Remove unused variable.
Craig Topper [Tue, 28 Nov 2017 22:28:23 +0000 (22:28 +0000)]
[X86] Remove unused variable.

llvm-svn: 319239

6 years agoFix spelling. NFC.
Rui Ueyama [Tue, 28 Nov 2017 22:17:39 +0000 (22:17 +0000)]
Fix spelling. NFC.

llvm-svn: 319238

6 years ago[LSan] Fix one source of stale segments in the process memory mapping.
Alex Shlyapnikov [Tue, 28 Nov 2017 22:15:27 +0000 (22:15 +0000)]
[LSan] Fix one source of stale segments in the process memory mapping.

Summary:
Load process memory map after updating the same cache to reflect the
umap happening in the process of updating.
Also clear out the buffer in case of failed read of /proc/self/maps (not
the source of stale segments, but can lead to the similar crash).

Reviewers: eugenis

Subscribers: llvm-commits, kubamracek

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

llvm-svn: 319237

6 years agoRemove unused `using`.
Rui Ueyama [Tue, 28 Nov 2017 22:14:13 +0000 (22:14 +0000)]
Remove unused `using`.

llvm-svn: 319236

6 years agoDemote this opt remark to DEBUG.
Adam Nemet [Tue, 28 Nov 2017 22:11:00 +0000 (22:11 +0000)]
Demote this opt remark to DEBUG.

From a random opt-stat output:

Top 10 remarks:
  tailcallelim/tailcall          53%
  inline/AlwaysInline            13%
  gvn/LoadClobbered              13%
  inline/Inlined                  8%
  inline/TooCostly                2%
  inline/NoDefinition             2%
  licm/LoadWithLoopInvariantAddressInvalidated  2%
  licm/Hoisted                    1%
  asm-printer/InstructionCount    1%
  prologepilog/StackSize          1%

llvm-svn: 319235

6 years ago[X86] Remove code from combineUIntToFP that tried to favor UINT_TO_FP if legal when...
Craig Topper [Tue, 28 Nov 2017 22:08:51 +0000 (22:08 +0000)]
[X86] Remove code from combineUIntToFP that tried to favor UINT_TO_FP if legal when zero extending from vXi8/vX816.

The UINT_TO_FP is immediately converted to SINT_TO_FP when the node is re-evaluated because we'll detect that the sign bit is zero.

llvm-svn: 319234

6 years ago[X86] Remove custom lowering for uint_to_fp from vXi8/vXi16.
Craig Topper [Tue, 28 Nov 2017 22:08:48 +0000 (22:08 +0000)]
[X86] Remove custom lowering for uint_to_fp from vXi8/vXi16.

We have a DAG combine that uses a zero extend that should prevent this from ever occurring now.

llvm-svn: 319233

6 years ago[globalisel][tablegen] Add support for importing G_ATOMIC_CMPXCHG, G_ATOMICRMW_*...
Daniel Sanders [Tue, 28 Nov 2017 22:07:05 +0000 (22:07 +0000)]
[globalisel][tablegen] Add support for importing G_ATOMIC_CMPXCHG, G_ATOMICRMW_* rules from SelectionDAG.

GIM_CheckNonAtomic has been replaced by GIM_CheckAtomicOrdering to allow it to support a wider
range of orderings. This has then been used to import patterns using nodes such
as atomic_cmp_swap, atomic_swap, and atomic_load_*.

llvm-svn: 319232

6 years agoSROA: Don't create variable fragments that are outside of the variable.
Adrian Prantl [Tue, 28 Nov 2017 21:30:38 +0000 (21:30 +0000)]
SROA: Don't create variable fragments that are outside of the variable.

An alloca may be larger than a variable that is described to be stored
there. Don't create a dbg.value for fragments that are outside of the
variable.

This fixes PR35447.
https://bugs.llvm.org/show_bug.cgi?id=35447

llvm-svn: 319230

6 years agoCOFF: Do not add symbols in discarded sections to SEH handler list.
Peter Collingbourne [Tue, 28 Nov 2017 21:30:05 +0000 (21:30 +0000)]
COFF: Do not add symbols in discarded sections to SEH handler list.

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

llvm-svn: 319229

6 years ago[cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
Don Hinton [Tue, 28 Nov 2017 21:23:30 +0000 (21:23 +0000)]
[cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
LLVM_OPTIMIZED_TABLEGEN=ON, and not crosscompiling.

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

llvm-svn: 319228

6 years ago[OPENMP] Generalize capturing of clauses expressions.
Alexey Bataev [Tue, 28 Nov 2017 21:11:44 +0000 (21:11 +0000)]
[OPENMP] Generalize capturing of clauses expressions.

The handling and capturing of the non-constant expressions of some of
the capturable clauses in combined directives is generalized.

llvm-svn: 319227

6 years agoAdd elf-core/RegisterUtilities.{cpp,h} to the project file.
Jim Ingham [Tue, 28 Nov 2017 21:11:15 +0000 (21:11 +0000)]
Add elf-core/RegisterUtilities.{cpp,h} to the project file.

llvm-svn: 319226

6 years agoAdd a new clang-tidy module for Fuchsia as an umbrella to diagnose issues with the...
Aaron Ballman [Tue, 28 Nov 2017 21:09:25 +0000 (21:09 +0000)]
Add a new clang-tidy module for Fuchsia as an umbrella to diagnose issues with the Fuschia and Zircon coding guidelines (https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md). Adds the first of such checkers, which detects when default arguments are declared in a function declaration or when default arguments are used at call sites.

Patch by Julie Hockett

llvm-svn: 319225

6 years ago[SLP] Additional test for PR35354, NFC.
Alexey Bataev [Tue, 28 Nov 2017 20:48:24 +0000 (20:48 +0000)]
[SLP] Additional test for PR35354, NFC.

llvm-svn: 319224

6 years ago[Hexagon] Use stable sort for HexagonShuffler to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 28 Nov 2017 20:48:10 +0000 (20:48 +0000)]
[Hexagon] Use stable sort for HexagonShuffler to remove non-deterministic ordering

Summary:
This fixes failures in the following tests uncovered by D39245:
        LLVM :: CodeGen/Hexagon/args.ll
        LLVM :: CodeGen/Hexagon/constp-extract.ll
        LLVM :: CodeGen/Hexagon/expand-condsets-basic.ll
        LLVM :: CodeGen/Hexagon/gp-rel.ll
        LLVM :: CodeGen/Hexagon/packetize_cond_inst.ll
        LLVM :: CodeGen/Hexagon/simple_addend.ll
        LLVM :: CodeGen/Hexagon/swp-stages4.ll
        LLVM :: CodeGen/Hexagon/swp-vmult.ll
        LLVM :: CodeGen/Hexagon/swp-vsum.ll
        LLVM :: MC/Hexagon/align.s
        LLVM :: MC/Hexagon/asmMap.s
        LLVM :: MC/Hexagon/dis-duplex-p0.s
        LLVM :: MC/Hexagon/double-vector-producer.s
        LLVM :: MC/Hexagon/inst_select.ll
        LLVM :: MC/Hexagon/instructions/j.s

Reviewers: colinl, kparzysz, adasgupt, slarin

Reviewed By: kparzysz

Subscribers: llvm-commits

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

llvm-svn: 319223

6 years ago[OpenMP] Stable sort Privates to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 28 Nov 2017 20:41:13 +0000 (20:41 +0000)]
[OpenMP] Stable sort Privates to remove non-deterministic ordering

Summary:
This fixes the following failures uncovered by D39245:
    Clang :: OpenMP/task_firstprivate_codegen.cpp
    Clang :: OpenMP/task_private_codegen.cpp
    Clang :: OpenMP/taskloop_firstprivate_codegen.cpp
    Clang :: OpenMP/taskloop_lastprivate_codegen.cpp
    Clang :: OpenMP/taskloop_private_codegen.cpp
    Clang :: OpenMP/taskloop_simd_firstprivate_codegen.cpp
    Clang :: OpenMP/taskloop_simd_lastprivate_codegen.cpp
    Clang :: OpenMP/taskloop_simd_private_codegen.cpp

Reviewers: rjmccall, ABataev, AndreyChurbanov

Reviewed By: rjmccall, ABataev

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 319222

6 years agoMove Memory.{h,cpp} to Common.
Rui Ueyama [Tue, 28 Nov 2017 20:39:17 +0000 (20:39 +0000)]
Move Memory.{h,cpp} to Common.

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

llvm-svn: 319221

6 years ago[aarch64][globalisel] Add missing tests from r319216
Daniel Sanders [Tue, 28 Nov 2017 20:27:59 +0000 (20:27 +0000)]
[aarch64][globalisel] Add missing tests from r319216

llvm-svn: 319220

6 years ago[WebAssembly] Remove initializers from Config.h
Sam Clegg [Tue, 28 Nov 2017 20:27:21 +0000 (20:27 +0000)]
[WebAssembly] Remove initializers from Config.h

These should get initialized in by Driver.cpp based on
command line options.

Also, sort entries.

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

llvm-svn: 319219

6 years ago[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions.
Sean Fertile [Tue, 28 Nov 2017 20:25:58 +0000 (20:25 +0000)]
[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions.

Allow fastcc callees to be tail-called from ccc callers.

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

llvm-svn: 319218

6 years agoBring r319051 back.
Rafael Espindola [Tue, 28 Nov 2017 20:21:44 +0000 (20:21 +0000)]
Bring r319051 back.

It had been reverted because it depended on r319008 which has been
recommitted.

Original message:

Add a missing test.

We were not testing that we correctly handled a .o with a weak symbol
after a .so.

llvm-svn: 319217

6 years ago[aarch64][globalisel] Define G_ATOMIC_CMPXCHG and G_ATOMICRMW_* and make them legal
Daniel Sanders [Tue, 28 Nov 2017 20:21:15 +0000 (20:21 +0000)]
[aarch64][globalisel] Define G_ATOMIC_CMPXCHG and G_ATOMICRMW_* and make them legal

The IRTranslator cannot generate these instructions at the moment so there's no
issue with not having implemented ISel for them yet. D40092 will add
G_ATOMIC_CMPXCHG_WITH_SUCCESS and G_ATOMICRMW_* to the IRTranslator and a
further patch will add support for lowering G_ATOMIC_CMPXCHG_WITH_SUCCESS into
G_ATOMIC_CMPXCHG with an external success check via the `Lower` action.

The separation of G_ATOMIC_CMPXCHG_WITH_SUCCESS and G_ATOMIC_CMPXCHG is
to import SelectionDAG rules while still supporting targets that prefer to
custom lower the original LLVM-IR-like operation.

llvm-svn: 319216

6 years agoBring back r319008.
Rafael Espindola [Tue, 28 Nov 2017 20:17:58 +0000 (20:17 +0000)]
Bring back r319008.

This includes a fix to mark copy reloc aliases as used.

Original message:

[ELF] Do not keep symbols if they referenced only from discarded sections.

This patch also ensures that in case of "--as-needed" is used,
DT_NEEDED entries are not created if they are required only by
these eliminated symbols.

llvm-svn: 319215

6 years agoAdd missing test.
Rafael Espindola [Tue, 28 Nov 2017 20:13:12 +0000 (20:13 +0000)]
Add missing test.

This would have found the issue with r319008.

llvm-svn: 319214

6 years agoUpdate remote debugging page with many more details.
Greg Clayton [Tue, 28 Nov 2017 20:04:43 +0000 (20:04 +0000)]
Update remote debugging page with many more details.

llvm-svn: 319213

6 years agoFix formatting.
Rui Ueyama [Tue, 28 Nov 2017 20:01:30 +0000 (20:01 +0000)]
Fix formatting.

llvm-svn: 319212

6 years agoFactor out more code to Common/Args.cpp.
Rui Ueyama [Tue, 28 Nov 2017 19:58:45 +0000 (19:58 +0000)]
Factor out more code to Common/Args.cpp.

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

llvm-svn: 319211

6 years ago[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 28 Nov 2017 19:55:54 +0000 (19:55 +0000)]
[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering

Summary:
Recommitting this with the correct sorting predicate. The Low field of Clusters is a ConstantInt and
cannot be directly compared. So we needed to invoke slt (signed less than) to compare correctly.

This fixes failures in the following tests uncovered by D39245:

LLVM :: CodeGen/ARM/ifcvt3.ll
LLVM :: CodeGen/ARM/switch-minsize.ll
LLVM :: CodeGen/X86/switch.ll
LLVM :: CodeGen/X86/switch-bt.ll
LLVM :: CodeGen/X86/switch-density.ll

Reviewers: hans, fhahn

Reviewed By: hans

Subscribers: aemerson, llvm-commits, kristof.beyls

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

llvm-svn: 319210

6 years ago[X86][SSE] Add SSE_HADDSUB/SSE_PABS/SSE_PALIGN OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 19:39:47 +0000 (19:39 +0000)]
[X86][SSE] Add SSE_HADDSUB/SSE_PABS/SSE_PALIGN OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

llvm-svn: 319209

6 years ago[X86] In lowerVectorShuffleAsElementInsertion, if were able to find a scalar i8 or...
Craig Topper [Tue, 28 Nov 2017 19:25:45 +0000 (19:25 +0000)]
[X86] In lowerVectorShuffleAsElementInsertion, if were able to find a scalar i8 or i16 and need to zero extend it, make sure we use a vXi32 type of the full vector width.

Previously, this was hardcoded to v4i32, but if the input type is 256 bits we need to use v8i32.

Fixes PR35443

llvm-svn: 319208

6 years ago[CodeGen] Fix doxygen \file comment style
Francis Visoiu Mistrih [Tue, 28 Nov 2017 19:23:39 +0000 (19:23 +0000)]
[CodeGen] Fix doxygen \file comment style

llvm-svn: 319207

6 years ago[CodeGen] Fix doxygen
Francis Visoiu Mistrih [Tue, 28 Nov 2017 19:15:46 +0000 (19:15 +0000)]
[CodeGen] Fix doxygen

llvm-svn: 319206

6 years ago[InstCombine] auto-generate complete test checks; NFC
Sanjay Patel [Tue, 28 Nov 2017 19:13:23 +0000 (19:13 +0000)]
[InstCombine] auto-generate complete test checks; NFC

llvm-svn: 319205

6 years ago[Hexagon] Make sure to zero-extend bytes before building a vector
Krzysztof Parzyszek [Tue, 28 Nov 2017 19:13:17 +0000 (19:13 +0000)]
[Hexagon] Make sure to zero-extend bytes before building a vector

llvm-svn: 319204

6 years ago[InstCombine] auto-generate complete test checks; NFC
Sanjay Patel [Tue, 28 Nov 2017 19:07:28 +0000 (19:07 +0000)]
[InstCombine] auto-generate complete test checks; NFC

llvm-svn: 319203

6 years ago[mir] Print/Parse both MOLoad and MOStore when they occur together.
Daniel Sanders [Tue, 28 Nov 2017 18:57:02 +0000 (18:57 +0000)]
[mir] Print/Parse both MOLoad and MOStore when they occur together.

Summary:
They're not always mutually exclusive. read-modify-write atomics are both
at the same time. One example of this is the SWP instructions on AArch64.
Another example is GlobalISel's G_ATOMICRMW_* generic instructions which
will be added in a later patch.

Reviewers: arphaman, aemerson

Reviewed By: aemerson

Subscribers: aemerson, javed.absar, kristof.beyls, llvm-commits

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

llvm-svn: 319202

6 years ago[CUDA] Report "unsupported VLA" errors only on device side.
Artem Belevich [Tue, 28 Nov 2017 18:51:42 +0000 (18:51 +0000)]
[CUDA] Report "unsupported VLA" errors only on device side.

This fixes erroneously reported CUDA compilation errors
in host-side code during device-side compilation.

I've also restricted OpenMP-specific checks to trigger only
if we're compiling with OpenMP enabled.

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

llvm-svn: 319201

6 years agoFix non assert build warnings.
Rafael Espindola [Tue, 28 Nov 2017 18:50:08 +0000 (18:50 +0000)]
Fix non assert build warnings.

llvm-svn: 319200

6 years agoEntryExitInstrumenter: set DebugLocs on the inserted call instructions (PR35412)
Hans Wennborg [Tue, 28 Nov 2017 18:44:26 +0000 (18:44 +0000)]
EntryExitInstrumenter: set DebugLocs on the inserted call instructions (PR35412)

Apparently the verifier requires that inlineable calls in a function
with debug info have debug locations.

llvm-svn: 319199

6 years ago[CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.
Zachary Turner [Tue, 28 Nov 2017 18:33:17 +0000 (18:33 +0000)]
[CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.

The motivation behind this patch is that future directions require us to
be able to compute the hash value of records independently of actually
using them for de-duplication.

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

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

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

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

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

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

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

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

llvm-svn: 319198

6 years ago[X86][X87] Tag FP_TO_INT_IN_MEM pseudos with hasNoSchedulingInfo
Simon Pilgrim [Tue, 28 Nov 2017 18:10:29 +0000 (18:10 +0000)]
[X86][X87] Tag FP_TO_INT_IN_MEM pseudos with hasNoSchedulingInfo

We don't need scheduling info for pseudos

llvm-svn: 319197

6 years agoHandle binding in --wrap.
Rafael Espindola [Tue, 28 Nov 2017 18:02:22 +0000 (18:02 +0000)]
Handle binding in --wrap.

Copying the binding seems reasonable and matches the bfd behavior.

llvm-svn: 319196

6 years ago[Target] Make a copy of TargetOptions feature list before sorting during CodeGen
Craig Topper [Tue, 28 Nov 2017 18:00:32 +0000 (18:00 +0000)]
[Target] Make a copy of TargetOptions feature list before sorting during CodeGen

Currently CodeGen is calling std::sort on the features vector in TargetOptions for every function, but I don't think CodeGen should be modifying TargetOptions.

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

llvm-svn: 319195

6 years ago[CodeGen] Separate MachineOperand implementation from MachineInstr
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:58:43 +0000 (17:58 +0000)]
[CodeGen] Separate MachineOperand implementation from MachineInstr

Move the implementation to its own file.

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

llvm-svn: 319194

6 years ago[CodeGen] Cleanup MachineOperand
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:58:38 +0000 (17:58 +0000)]
[CodeGen] Cleanup MachineOperand

* clang-format
* move doxygen from the implementation to headers
* remove duplicate doxygen

llvm-svn: 319193

6 years agoAMDGPU: Add num spilled s/vgprs to metadata
Konstantin Zhuravlyov [Tue, 28 Nov 2017 17:51:08 +0000 (17:51 +0000)]
AMDGPU: Add num spilled s/vgprs to metadata

This was requested by tools.

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

llvm-svn: 319192

6 years agoSimplify UUID constructors
Stephane Sezer [Tue, 28 Nov 2017 17:50:31 +0000 (17:50 +0000)]
Simplify UUID constructors

Summary: This remove a small amount of duplicated code.

Reviewers: clayborg, zturner, davide

Subscribers: lldb-commits

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

llvm-svn: 319191

6 years ago[LibFuzzer] Improve comments on `CounterToFeature()` function.
Dan Liew [Tue, 28 Nov 2017 17:41:58 +0000 (17:41 +0000)]
[LibFuzzer] Improve comments on `CounterToFeature()` function.

This is based on discussion in https://reviews.llvm.org/D40376 .

The comments try to explain the reason for the current implementation
and note that it might change in the future, so clients should not
rely on this particular implementation.

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

llvm-svn: 319190

6 years agoSupport the setjmp(3) family of functions in TSan/NetBSD
Kamil Rytarowski [Tue, 28 Nov 2017 17:35:35 +0000 (17:35 +0000)]
Support the setjmp(3) family of functions in TSan/NetBSD

Summary:
This change adds support for the setjmp(3)/longjmp(3)
family of functions on NetBSD.

There are three types of them on NetBSD:

 - setjmp(3) / longjmp(3)
 - sigsetjmp(3) / sigsetjmp(3)
 - _setjmp(3) / _longjmp(3)

Due to historical and compat reasons the symbol
names are mangled:

 - setjmp -> __setjmp14
 - longjmp -> __longjmp14
 - sigsetjmp -> __sigsetjmp14
 - siglongjmp -> __siglongjmp14
 - _setjmp -> _setjmp
 - _longjmp -> _longjmp

This leads to symbol renaming in the existing codebase.

There is no such symbol as __sigsetjmp/__longsetjmp
on NetBSD

Add a comment that GNU-style executable stack
note is not needed on NetBSD. The stack is not
executable without it.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dvyukov, vitalybuka

Reviewed By: dvyukov

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 319189

6 years agoAdd opt-viewer testing
Adam Nemet [Tue, 28 Nov 2017 17:26:28 +0000 (17:26 +0000)]
Add opt-viewer testing

Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

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

llvm-svn: 319188

6 years ago[CodeGen] Print register names in lowercase in both MIR and debug output
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:15:09 +0000 (17:15 +0000)]
[CodeGen] Print register names in lowercase in both MIR and debug output

As part of the unification of the debug format and the MIR format,
always print registers as lowercase.

* Only debug printing is affected. It now follows MIR.

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

llvm-svn: 319187

6 years ago[WebAssembly] Support bitcasted function addresses with varargs.
Dan Gohman [Tue, 28 Nov 2017 17:15:03 +0000 (17:15 +0000)]
[WebAssembly] Support bitcasted function addresses with varargs.

Generalize FixFunctionBitcasts to handle varargs functions. This in
particular fixes the case where clang bitcasts away a varargs when
calling a K&R-style function.

This avoids interacting with tricky ABI details because it operates
at the LLVM IR level before varargs ABI details are exposed.

This fixes PR35385.

llvm-svn: 319186

6 years agoDAG: Legalize truncstores to illegal int types
Matt Arsenault [Tue, 28 Nov 2017 17:11:30 +0000 (17:11 +0000)]
DAG: Legalize truncstores to illegal int types

Truncate to a legal int type, and produce a new
truncstore from a narrower type.

llvm-svn: 319185

6 years ago[X86][X87] Tag FTST x87 instruction scheduler class
Simon Pilgrim [Tue, 28 Nov 2017 16:57:20 +0000 (16:57 +0000)]
[X86][X87] Tag FTST x87 instruction scheduler class

Looking through Agner, FTST is very similar to generic float compare behaviour, so I've added them to the existing IIC_FCOMI (WriteFAdd) tags.

llvm-svn: 319184

6 years ago[clang-tidy] Move more checks from misc- to performance-
Alexander Kornienko [Tue, 28 Nov 2017 16:41:03 +0000 (16:41 +0000)]
[clang-tidy] Move more checks from misc- to performance-

Summary:
rename_check.py misc-move-const-arg performance-move-const-arg
rename_check.py misc-noexcept-move-constructor performance-noexcept-move-constructor

Reviewers: hokein, xazax.hun

Reviewed By: xazax.hun

Subscribers: rnkovacs, klimek, mgorny, xazax.hun, cfe-commits

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

llvm-svn: 319183

6 years ago[InstCombine] add tests from D39421 to show current transforms; NFC
Sanjay Patel [Tue, 28 Nov 2017 16:40:30 +0000 (16:40 +0000)]
[InstCombine] add tests from D39421 to show current transforms; NFC

llvm-svn: 319182

6 years ago[PowerPC][tsan] Update tsan to handle changed memory layouts in newer kernels
Bill Seurer [Tue, 28 Nov 2017 16:28:54 +0000 (16:28 +0000)]
[PowerPC][tsan] Update tsan to handle changed memory layouts in newer kernels

In more recent Linux kernels with 47 bit VMAs the layout of virtual memory
for powerpc64 changed causing the thread sanitizer to not work properly. This
patch adds support for 47 bit VMA kernels for powerpc64.

(second part)

Tested on several 4.x and 3.x kernel releases.

llvm-svn: 319180

6 years agoRefactor functions PrintTemplateArgumentList
Serge Pavlov [Tue, 28 Nov 2017 16:14:14 +0000 (16:14 +0000)]
Refactor functions PrintTemplateArgumentList

These functions were defined as static members of TemplateSpecializationType.
Now they are moved to namespace level. Previously there were different
implementations for lists containing TemplateArgument and TemplateArgumentLoc,
now these implementations share the same code.

This change is a result of refactoring patch D40508. NFC.

llvm-svn: 319178

6 years ago[Support] Add unit test for printLowerCase
Francis Visoiu Mistrih [Tue, 28 Nov 2017 16:11:56 +0000 (16:11 +0000)]
[Support] Add unit test for printLowerCase

Add test case for the function added in r319171.

llvm-svn: 319177

6 years ago[cmake] Remove redundant call to cmake when building host tools.
Don Hinton [Tue, 28 Nov 2017 16:08:57 +0000 (16:08 +0000)]
[cmake] Remove redundant call to cmake when building host tools.

Summary:
Remove the redundant, config-time call to cmake when
building host tools for cross compiles or optimized tablegen..

The config-time call to cmake is redundant because it will always get
called again when the CONFIGURE_LLVM_${target_name} target fires at
build-time.  This speeds up initial configuration, but has no affect
on build behavior.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

llvm-svn: 319176

6 years ago[X86][X87] Tag FABS/FCHS/FSQRT/FSIN/FCOS x87 instruction scheduler classes
Simon Pilgrim [Tue, 28 Nov 2017 15:03:42 +0000 (15:03 +0000)]
[X86][X87] Tag FABS/FCHS/FSQRT/FSIN/FCOS x87 instruction scheduler classes

Atom's FABS/FCHS/FSQRT latencies taken from Agner.

Note: I just added FSIN and FCOS to the existing IIC_FSINCOS itinerary, which is actually a more costly instruction.
llvm-svn: 319175