platform/upstream/llvm.git
6 years agoPR19668, PR23034: Fix handling of move constructors and deleted copy
Richard Smith [Tue, 8 Aug 2017 19:12:28 +0000 (19:12 +0000)]
PR19668, PR23034: Fix handling of move constructors and deleted copy
constructors when deciding whether classes should be passed indirectly.

This fixes ABI differences between Clang and GCC:

 * Previously, Clang ignored the move constructor when making this
   determination. It now takes the move constructor into account, per
   https://github.com/itanium-cxx-abi/cxx-abi/pull/17 (this change may
   seem recent, but the ABI change was agreed on the Itanium C++ ABI
   list a long time ago).

 * Previously, Clang's behavior when the copy constructor was deleted
   was unstable -- depending on whether the lazy declaration of the
   copy constructor had been triggered, you might get different behavior.
   We now eagerly declare the copy constructor whenever its deletedness
   is unclear, and ignore deleted copy/move constructors when looking for
   a trivial such constructor.

This also fixes an ABI difference between Clang and MSVC:

 * If the copy constructor would be implicitly deleted (but has not been
   lazily declared yet), for instance because the class has an rvalue
   reference member, we would pass it directly. We now pass such a class
   indirectly, matching MSVC.

llvm-svn: 310401

6 years agoAdd NetBSD support in asan_interceptors.cc
Kamil Rytarowski [Tue, 8 Aug 2017 19:09:48 +0000 (19:09 +0000)]
Add NetBSD support in asan_interceptors.cc

Summary:
Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, vitalybuka, filcab, fjricci

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310400

6 years ago[AMDGPU] Add llvm.amdgpu.update.dpp intrinsic
Connor Abbott [Tue, 8 Aug 2017 18:52:22 +0000 (18:52 +0000)]
[AMDGPU] Add llvm.amdgpu.update.dpp intrinsic

Summary:
Now that we've made all the necessary backend changes, we can add a new
intrinsic which exposes the new capabilities to IR producers. Since
llvm.amdgpu.update.dpp is a strict superset of llvm.amdgpu.mov.dpp, we
should deprecate the former. We also add tests for all the functionality
that was added in previous changes, now that we can access it via an IR
construct.

Reviewers: tstellar, arsenm

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

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

llvm-svn: 310399

6 years ago[NewGVN] Use a cast instead of a dyn_cast.
Chad Rosier [Tue, 8 Aug 2017 18:41:49 +0000 (18:41 +0000)]
[NewGVN] Use a cast instead of a dyn_cast.

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

llvm-svn: 310397

6 years ago[PDB] Fix linking of function symbols and local variables.
Zachary Turner [Tue, 8 Aug 2017 18:34:44 +0000 (18:34 +0000)]
[PDB] Fix linking of function symbols and local variables.

The compiler outputs PROC32_ID symbols into the object files
for functions, and these symbols have an embedded type index
which, when copied to the PDB, refer to the IPI stream.  However,
the symbols themselves are also converted into regular symbols
(e.g. S_GPROC32_ID -> S_GPROC32), and type indices in the regular
symbol records refer to the TPI stream.  So this patch applies
two fixes to function records.
  1. It converts ID symbols to the proper non-ID record type.
  2. After remapping the type index from the object file's index
     space to the PDB file/IPI stream's index space, it then
     remaps that index to the TPI stream's index space by.

Besides functions, during the remapping process we were also
discarding symbol record types which we did not recognize.
In particular, we were discarding S_BPREL32 records, which is
what MSVC uses to describe local variables on the stack.  So
this patch fixes that as well by copying them to the PDB.

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

llvm-svn: 310394

6 years agodsymutil: support dwarf version mismatches between object and clang module
Adrian Prantl [Tue, 8 Aug 2017 18:26:12 +0000 (18:26 +0000)]
dsymutil: support dwarf version mismatches between object and clang module

This adds a missing call to maybeUpdateMaxDwarfVersion when visitng a
clang module. Failing to do so will cause a failure when emitting
DWARF 4 forms into a CU that AsmPrinter believes to be DWARF 2.

rdar://problem/33666528

llvm-svn: 310392

6 years agoNetBSD compatibility nit in asan_test_utils.h
Kamil Rytarowski [Tue, 8 Aug 2017 18:16:35 +0000 (18:16 +0000)]
NetBSD compatibility nit in asan_test_utils.h

Summary:
Do not include <malloc.h> on NetBSD, as this header
serves on this OS backward compatibility with K&R alias
for <stdlib.h>.

Sponsored by <The NetBSD Foundation>

Reviewers: vitalybuka, kcc, joerg, filcab, fjricci

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310391

6 years ago[LoopVectorize] Fix assertion failure in Fcmp vectorization
Anna Thomas [Tue, 8 Aug 2017 18:07:44 +0000 (18:07 +0000)]
[LoopVectorize] Fix assertion failure in Fcmp vectorization

Summary:
When vectorizing fcmps we can trip on incorrect cast assertion when setting the
FastMathFlags after generating the vectorized FCmp.
This can happen if the FCmp can be folded to true or false directly. The fix
here is to set the FastMathFlag using the FastMathFlagBuilder *before* creating
the FCmp Instruction. This is what's done by other optimizations such as
InstCombine.
Added a test case which trips on cast assertion without this patch.

Reviewers: Ayal, mssimpso, mkuper, gilr

Reviewed by: Ayal, mssimpso

Subscribers: llvm-commits, mzolotukhin

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

llvm-svn: 310389

6 years agoRestore previous structure ABI behavior for bit-fields with the packed attribute...
Aaron Ballman [Tue, 8 Aug 2017 18:07:17 +0000 (18:07 +0000)]
Restore previous structure ABI behavior for bit-fields with the packed attribute for PS4 targets.

An ABI change was introduced in r254596 that modified structure layouts when the 'packed' attribute was used on one-byte bitfields. Since the PS4 target needs to maintain backwards compatibility for all structure layouts, this change reintroduces the old behavior for PS4 targets only. It also introduces PS4 specific cases to the relevant test.

Patch by Matthew Voss.

llvm-svn: 310388

6 years ago[OPENMP][DEBUG] Set proper address space info if required by target.
Alexey Bataev [Tue, 8 Aug 2017 18:04:06 +0000 (18:04 +0000)]
[OPENMP][DEBUG] Set proper address space info if required by target.

Arguments, passed to the outlined function, must have correct address
space info for proper Debug info support. Patch sets global address
space for arguments that are mapped and passed by reference.

Also, cuda-gdb does not handle reference types correctly, so reference
arguments are represented as pointers.

llvm-svn: 310387

6 years ago[X86] Support 'avx5124vnniw' and 'avx5124fmaps' for __builtin_cpu_supports.
Craig Topper [Tue, 8 Aug 2017 17:43:44 +0000 (17:43 +0000)]
[X86] Support 'avx5124vnniw' and 'avx5124fmaps' for __builtin_cpu_supports.

They still need to be implemented in the intrinsics, the command line, and the backend. But this change isn't dependent on any of that and resolves a TODO.

llvm-svn: 310386

6 years ago[test] Add descriptions and pseudocode to tests. NFC.
Michael Kruse [Tue, 8 Aug 2017 17:26:19 +0000 (17:26 +0000)]
[test] Add descriptions and pseudocode to tests. NFC.

llvm-svn: 310385

6 years agoRevert "[ARM] Fix assembly and disassembly for VMRS/VMSR"
Tim Northover [Tue, 8 Aug 2017 17:16:46 +0000 (17:16 +0000)]
Revert "[ARM] Fix assembly and disassembly for VMRS/VMSR"

This reverts r310243. Only MVFR2 is actually restricted to v8 and it'll be a
little while before we can get a proper fix together. Better that we allow
incorrect code than reject correct in the meantime.

llvm-svn: 310384

6 years ago[DomTree] Use a non-recursive DFS instead of a recursive one; NFC
Sanjoy Das [Tue, 8 Aug 2017 17:15:29 +0000 (17:15 +0000)]
[DomTree] Use a non-recursive DFS instead of a recursive one; NFC

Summary: The recursive DFS can stack overflow in pathological cases.

Reviewers: kuhar

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 310383

6 years ago[Availability] Don't make an availability attribute imply default visibility on macOS
Erik Pilkington [Tue, 8 Aug 2017 17:09:09 +0000 (17:09 +0000)]
[Availability] Don't make an availability attribute imply default visibility on macOS

Fixes PR33796, rdar://33655115

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

llvm-svn: 310382

6 years ago[DeLICM/ZoneAlgo] Remove duplicate code. NFC.
Michael Kruse [Tue, 8 Aug 2017 17:00:27 +0000 (17:00 +0000)]
[DeLICM/ZoneAlgo] Remove duplicate code. NFC.

DeLICM and ZoneAlgo both implemented filterKnownValInst.

Declare ZoneAlgo's version in the header and let DeLCIM use it.

llvm-svn: 310381

6 years agoUse SCEV information for the second level aliasing
Roman Gareev [Tue, 8 Aug 2017 16:50:28 +0000 (16:50 +0000)]
Use SCEV information for the second level aliasing

We introduce another level of alias metadata to distinguish the individual
non-aliasing accesses that have inter iteration alias-free base pointers
marked with "Inter iteration alias-free" mark nodes. To distinguish two
accesses, the comparison of raw pointers representing base pointers is used.

In case of, for example, ublas's prod function that implements GEMM, and
DeLiCM we can get accesses to same location represented by different raw
pointers. Consequently, we create different alias sets that can prevent
accesses from, for example, being sinked or hoisted.

To avoid the issue, we compare the corresponding SCEV information instead
of the corresponding raw pointers.

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: https://reviews.llvm.org/D35761

llvm-svn: 310380

6 years agoRevert "[OPENMP][DEBUG] Set proper address space info if required by target."
Alexey Bataev [Tue, 8 Aug 2017 16:45:36 +0000 (16:45 +0000)]
Revert "[OPENMP][DEBUG] Set proper address space info if required by target."

This reverts commit r310377.

llvm-svn: 310379

6 years ago[KnownBits][ValueTracking] Move the math for calculating known bits for add/sub into...
Craig Topper [Tue, 8 Aug 2017 16:29:35 +0000 (16:29 +0000)]
[KnownBits][ValueTracking] Move the math for calculating known bits for add/sub into a static method in KnownBits object

I want to reuse this code in SimplifyDemandedBits handling of Add/Sub. This will make that easier.

Wonder if we should use it in SelectionDAG's computeKnownBits too.

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

llvm-svn: 310378

6 years ago[OPENMP][DEBUG] Set proper address space info if required by target.
Alexey Bataev [Tue, 8 Aug 2017 16:29:11 +0000 (16:29 +0000)]
[OPENMP][DEBUG] Set proper address space info if required by target.

Arguments, passed to the outlined function, must have correct address
space info for proper Debug info support. Patch sets global address
space for arguments that are mapped and passed by reference.

Also, cuda-gdb does not handle reference types correctly, so reference
arguments are represented as pointers.

llvm-svn: 310377

6 years agoUse "foo-12345.o.tmp" instead of "foo.o-12345" as temporary file name.
Nico Weber [Tue, 8 Aug 2017 16:21:23 +0000 (16:21 +0000)]
Use "foo-12345.o.tmp" instead of "foo.o-12345" as temporary file name.

This helps some tools that do things based on the output's extension.

For example, we got reports from users on Windows that have a tool that scan a
build output dir (but skip .obj files). The tool would keep the "foo.obj-12345"
file open, and then when clang tried to rename the temp file to the final
output filename, that would fail. By making the tempfile end in ".obj.tmp",
tools like this could now have a rule to ignore .tmp files.
This is a less ambitious reland of https://reviews.llvm.org/D36238

https://reviews.llvm.org/D36413

llvm-svn: 310376

6 years ago[RISCV] Fix warning about unused getSubtargetFeatureName()
Alex Bradbury [Tue, 8 Aug 2017 16:20:39 +0000 (16:20 +0000)]
[RISCV] Fix warning about unused getSubtargetFeatureName()

llvm-svn: 310375

6 years agoDo not use isl_set_project_out to get all loop prefixes
Roman Gareev [Tue, 8 Aug 2017 16:15:33 +0000 (16:15 +0000)]
Do not use isl_set_project_out to get all loop prefixes

Currently, only convex isolation sets can be efficiently processed by isl.
Consequently, as a temporary solution, we use a different algorithm for partial
tile isolation that helps to build convex isolation sets in some cases.

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: https://reviews.llvm.org/D36278

llvm-svn: 310374

6 years agoBasicAA: aliasGEP shouldn't get a PartialAlias response here
Nuno Lopes [Tue, 8 Aug 2017 16:13:24 +0000 (16:13 +0000)]
BasicAA: aliasGEP shouldn't get a PartialAlias response here
add an assert() to ensure that's the case (as I'm not convinced it won't happen)

llvm-svn: 310373

6 years ago[DAGCombiner] simplifyShuffleMask - handle UNDEF inputs from shuffles as well as...
Simon Pilgrim [Tue, 8 Aug 2017 16:10:33 +0000 (16:10 +0000)]
[DAGCombiner] simplifyShuffleMask - handle UNDEF inputs from shuffles as well as BUILD_VECTOR

Minor extension to D36393

llvm-svn: 310372

6 years ago[clang-tidy] Add new readability non-idiomatic static access check
Gabor Horvath [Tue, 8 Aug 2017 15:33:48 +0000 (15:33 +0000)]
[clang-tidy] Add new readability non-idiomatic static access check

Patch by: Lilla Barancsuk

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

llvm-svn: 310371

6 years agoEnable COMPILER_RT_HAS_SANITIZER_COMMON on NetBSD
Kamil Rytarowski [Tue, 8 Aug 2017 15:25:26 +0000 (15:25 +0000)]
Enable COMPILER_RT_HAS_SANITIZER_COMMON on NetBSD

Summary:
Temporarily keep disabled COMPILER_RT_HAS_ASAN on NetBSD.

Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, filcab, kcc, vitalybuka

Reviewed By: vitalybuka

Subscribers: srhines, mgorny, #sanitizers, llvm-commits

Tags: #sanitizers

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

llvm-svn: 310370

6 years ago[RegisterPasses] Run polly-simplify also right after scop modeling
Tobias Grosser [Tue, 8 Aug 2017 15:14:46 +0000 (15:14 +0000)]
[RegisterPasses] Run polly-simplify also right after scop modeling

This allows us to get rid of stores that are overwritten within the very same
basic block, without ever being read beforehand. This simplification is
necessary for delicm to run on pb4's correlation.

llvm-svn: 310369

6 years agoNon-functional change. Fix test for D29654.
Gheorghe-Teodor Bercea [Tue, 8 Aug 2017 15:13:07 +0000 (15:13 +0000)]
Non-functional change. Fix test for D29654.

llvm-svn: 310368

6 years agoclang-format: [JS] fix union type spacing in object & array types.
Martin Probst [Tue, 8 Aug 2017 15:00:58 +0000 (15:00 +0000)]
clang-format: [JS] fix union type spacing in object & array types.

Summary:
Previously, clang-format would insert whitespace in union types nested in object
and array types, as it wouldn't recognize those as a type operator:

    const x: {foo: number | null};
    const x: [number | null];

While this is correct for actual binary operators, clang-format should not
insert whitespace into union and intersection types to mark those:

    const x: {foo: number|null};
    const x: [number|null];

This change propagates that the context is not an expression by inspecting
the preceding token and marking as non-expression if it was a type colon.

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 310367

6 years ago[clang-tidy] 'implicit cast' -> 'implicit conversion'
Alexander Kornienko [Tue, 8 Aug 2017 14:53:52 +0000 (14:53 +0000)]
[clang-tidy] 'implicit cast' -> 'implicit conversion'

Summary:
This patch renames checks, check options and changes messages to use correct
term "implicit conversion" instead of "implicit cast" (which has been in use in
Clang AST since ~10 years, but it's still technically incorrect w.r.t. C++
standard).

  * performance-implicit-cast-in-loop -> performance-implicit-conversion-in-loop
  * readability-implicit-bool-cast -> readability-implicit-bool-conversion
    - readability-implicit-bool-cast.AllowConditionalIntegerCasts ->
      readability-implicit-bool-conversion.AllowIntegerConditions
    - readability-implicit-bool-cast.AllowConditionalPointerCasts ->
      readability-implicit-bool-conversion.AllowPointerConditions

Reviewers: hokein, jdennett

Reviewed By: hokein

Subscribers: mgorny, JDevlieghere, xazax.hun, cfe-commits

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

llvm-svn: 310366

6 years agoclang-format: [JS] handle single lines comments ending in `\\`.
Martin Probst [Tue, 8 Aug 2017 14:52:42 +0000 (14:52 +0000)]
clang-format: [JS] handle single lines comments ending in `\\`.

Summary:
Previously, clang-format would consider the following code line to be part of
the comment and incorrectly format the rest of the file.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 310365

6 years agoRevert "[OPENMP][DEBUG] Set proper address space info if required by target."
Alexey Bataev [Tue, 8 Aug 2017 14:44:43 +0000 (14:44 +0000)]
Revert "[OPENMP][DEBUG] Set proper address space info if required by target."

This reverts commit r310360.

llvm-svn: 310364

6 years ago[RISCV] Add basic RISCVAsmParser (missing files)
Alex Bradbury [Tue, 8 Aug 2017 14:43:36 +0000 (14:43 +0000)]
[RISCV] Add basic RISCVAsmParser (missing files)

This commit adds the files missing from rL310361. Apologies for the noise.

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

llvm-svn: 310363

6 years ago[OpenMP] OpenMP device offloading code generation produces a cubin file which is...
Gheorghe-Teodor Bercea [Tue, 8 Aug 2017 14:33:05 +0000 (14:33 +0000)]
[OpenMP] OpenMP device offloading code generation produces a cubin file which is then integrated in the host binary using the host linker.
Diff: D29654

llvm-svn: 310362

6 years ago[RISCV] Add basic RISCVAsmParser
Alex Bradbury [Tue, 8 Aug 2017 14:32:35 +0000 (14:32 +0000)]
[RISCV] Add basic RISCVAsmParser

This doesn't yet support parsing things like %pcrel_hi(foo), but will handle
basic instructions with register or immediate operands.

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

llvm-svn: 310361

6 years ago[OPENMP][DEBUG] Set proper address space info if required by target.
Alexey Bataev [Tue, 8 Aug 2017 14:25:14 +0000 (14:25 +0000)]
[OPENMP][DEBUG] Set proper address space info if required by target.

Arguments, passed to the outlined function, must have correct address
space info for proper Debug info support. Patch sets global address
space for arguments that are mapped and passed by reference.

Also, cuda-gdb does not handle reference types correctly, so reference
arguments are represented as pointers.

llvm-svn: 310360

6 years ago[libclang] Fix PR34055 (incompatible update of clang-c/Index.h)
Nikolai Bozhenov [Tue, 8 Aug 2017 14:13:50 +0000 (14:13 +0000)]
[libclang] Fix PR34055 (incompatible update of clang-c/Index.h)

Fixes a regression introduced by r308218.

llvm-svn: 310359

6 years ago[PowerPC] Don't crash on larger splats achieved through 1-byte splats
Nemanja Ivanovic [Tue, 8 Aug 2017 13:52:45 +0000 (13:52 +0000)]
[PowerPC] Don't crash on larger splats achieved through 1-byte splats

We've implemented a 1-byte splat using XXSPLTISB on P9. However, LLVM will
produce a 1-byte splat even for wider element BUILD_VECTOR nodes. This patch
prevents crashing in that situation.

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

llvm-svn: 310358

6 years ago[globalisel][tablegen] Remove unnecessary ; to satisfy ubuntu-gcc7.1-werror.
Daniel Sanders [Tue, 8 Aug 2017 13:21:26 +0000 (13:21 +0000)]
[globalisel][tablegen] Remove unnecessary ; to satisfy ubuntu-gcc7.1-werror.

llvm-svn: 310357

6 years agoAppease compilers that have the -Wcovered-switch-default switch.
Nemanja Ivanovic [Tue, 8 Aug 2017 12:41:56 +0000 (12:41 +0000)]
Appease compilers that have the -Wcovered-switch-default switch.

llvm-svn: 310356

6 years ago[NFC] [PPCGCodeGen] Add missing REQUIRES: pollyacc line.
Siddharth Bhat [Tue, 8 Aug 2017 12:26:37 +0000 (12:26 +0000)]
[NFC] [PPCGCodeGen] Add missing REQUIRES: pollyacc line.

llvm-svn: 310354

6 years ago[ScopInfo] [NFC] Typo fix.
Siddharth Bhat [Tue, 8 Aug 2017 12:26:32 +0000 (12:26 +0000)]
[ScopInfo] [NFC] Typo fix.

"to conservative" -> "too conservative".

llvm-svn: 310353

6 years ago[X86] Improved X86::CMOV to Branch heuristic.
Amjad Aboud [Tue, 8 Aug 2017 12:17:56 +0000 (12:17 +0000)]
[X86] Improved X86::CMOV to Branch heuristic.
Resolved PR33954.
This patch contains two more constraints that aim to reduce the noise cases where we convert CMOV into branch for small gain, and end up spending more cycles due to overhead.

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

llvm-svn: 310352

6 years agoReuse interception_linux for NetBSD
Kamil Rytarowski [Tue, 8 Aug 2017 12:10:08 +0000 (12:10 +0000)]
Reuse interception_linux for NetBSD

Summary:
Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, vitalybuka, filcab

Reviewed By: vitalybuka

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310351

6 years ago[Polly] [PPCGCodeGeneration] Handle failing of invariant load hoisting gracefully.
Siddharth Bhat [Tue, 8 Aug 2017 12:00:59 +0000 (12:00 +0000)]
[Polly] [PPCGCodeGeneration] Handle failing of invariant load hoisting gracefully.

To do this, we replicate what `CodeGeneration` does. We expose
`markNodeUnreachable` from `CodeGeneration` to `PPCGCodeGeneration`.

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

llvm-svn: 310350

6 years agoDefine OFF_T as 64-bit integer on NetBSD
Kamil Rytarowski [Tue, 8 Aug 2017 11:40:15 +0000 (11:40 +0000)]
Define OFF_T as 64-bit integer on NetBSD

Summary:
All 32 and 64 bit NetBSD platforms define off_t as 64-bit integer.

Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, filcab, kcc, vitalybuka

Reviewed By: vitalybuka

Subscribers: emaste, kubamracek, llvm-commits

Tags: #sanitizers

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

llvm-svn: 310349

6 years ago[DeLICM] Properly handle PHI writes becoming empty partial writes.
Michael Kruse [Tue, 8 Aug 2017 11:27:12 +0000 (11:27 +0000)]
[DeLICM] Properly handle PHI writes becoming empty partial writes.

It is possible that partial writes are empty (write is never executed).
In this case, when in PHINode's incoming edge is never taken such that
the incoming write becomes an empty partial write, if enabled. The
issue is that when converting the union_map to an map, it's space
cannot be derived from the union_map itself. Rather, we need to
determine its space independently.

This fixes test-suite's MultiSource/Benchmarks/ASC_Sequoia/CrystalMk.

llvm-svn: 310348

6 years agoDarwin's toolchain should be initialized before openmp offloading
Alex Lorenz [Tue, 8 Aug 2017 11:22:21 +0000 (11:22 +0000)]
Darwin's toolchain should be initialized before openmp offloading
is processed

This fixes an 'openmp-offload.c' test failure introduced by r310263.

llvm-svn: 310347

6 years ago[PowerPC] Eliminate compares - add i32 sext/zext handling for SETLE/SETGE
Nemanja Ivanovic [Tue, 8 Aug 2017 11:20:44 +0000 (11:20 +0000)]
[PowerPC] Eliminate compares - add i32 sext/zext handling for SETLE/SETGE

Adds handling for SETLE/SETGE comparisons on i32 values. Furthermore, it adds
the handling for the special case where RHS == 0.

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

llvm-svn: 310346

6 years agoRevert r310291, r310300 and r310332 because of test failure on Darwin
Alex Lorenz [Tue, 8 Aug 2017 11:20:17 +0000 (11:20 +0000)]
Revert r310291, r310300 and r310332 because of test failure on Darwin

The commit r310291 introduced the failure. r310332 was a test fix commit and
r310300 was a followup commit. I reverted these two to avoid merge conflicts
when reverting.

The 'openmp-offload.c' test is failing on Darwin because the following
run lines:
// RUN:   touch %t1.o
// RUN:   touch %t2.o
// RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -save-temps -no-canonical-prefixes %t1.o %t2.o 2>&1 \
// RUN:   | FileCheck -check-prefix=CHK-TWOCUBIN %s

trigger the following assertion:

Driver.cpp:3418:
    assert(CachedResults.find(ActionTC) != CachedResults.end() &&
           "Result does not exist??");

llvm-svn: 310345

6 years ago[DAGCombiner] Simplify shuffle mask index if the referenced input element is UNDEF
Simon Pilgrim [Tue, 8 Aug 2017 11:03:30 +0000 (11:03 +0000)]
[DAGCombiner] Simplify shuffle mask index if the referenced input element is UNDEF

Fixes one of the cases in PR34041.

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

llvm-svn: 310344

6 years ago[globalisel][tablegen] Add support for importing 'imm' operands.
Daniel Sanders [Tue, 8 Aug 2017 10:44:31 +0000 (10:44 +0000)]
[globalisel][tablegen] Add support for importing 'imm' operands.

Summary:
This patch enables the import of rules containing 'imm' operands that do not
constrain the acceptable values using predicates. Support for ImmLeaf will
arrive in a later patch.

Depends on D35681

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar

Reviewed By: rovka

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

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

llvm-svn: 310343

6 years ago[PM] Fix a likely more critical infloop bug in the CGSCC pass manager.
Chandler Carruth [Tue, 8 Aug 2017 10:13:23 +0000 (10:13 +0000)]
[PM] Fix a likely more critical infloop bug in the CGSCC pass manager.

This was just a bad oversight on my part. The code in question should
never have worked without this fix. But it turns out, there are
relatively few places that involve libfunctions that participate in
a single SCC, and unless they do, this happens to not matter.

The effect of not having this correct is that each time through this
routine, the edge from write_wrapper to write was toggled between a call
edge and a ref edge. First time through, it becomes a demoted call edge
and is turned into a ref edge. Next time it is a promoted call edge from
a ref edge. On, and on it goes forever.

I've added the asserts which should have always been here to catch silly
mistakes like this in the future as well as a test case that will
actually infloop without the fix.

The other (much scarier) infinite-inlining issue I think didn't actually
occur in practice, and I simply misdiagnosed this minor issue as that
much more scary issue. The other issue *is* still a real issue, but I'm
somewhat relieved that so far it hasn't happened in real-world code
yet...

llvm-svn: 310342

6 years agoChecking in files accidentally missed in later diffs of revision r310261
Abhishek Aggarwal [Tue, 8 Aug 2017 09:25:50 +0000 (09:25 +0000)]
Checking in files accidentally missed in later diffs of revision r310261

 -- 2 files were missing in this commit which should have been there.
    These files were submitted initially for review and were reviewed.
    However, while updating the revision with newer diffs, I accidentally
    forgot to include them in newer diffs. So commiting now.

llvm-svn: 310341

6 years ago[NFC] [GPUJIT] Print line number & size information on allocateMemoryForDeviceCuda...
Siddharth Bhat [Tue, 8 Aug 2017 09:03:27 +0000 (09:03 +0000)]
[NFC] [GPUJIT] Print line number & size information on allocateMemoryForDeviceCuda failure

- It's useful to know the amount of memory asked for since, for example,
  asking for `0` bytes of memory is illegal.

- Line number is helpful since we print the same message in the function
  at different points.

llvm-svn: 310340

6 years ago[InstCombine] Cast to BinaryOperator earlier in foldSelectIntoOp to simplify the...
Craig Topper [Tue, 8 Aug 2017 06:19:24 +0000 (06:19 +0000)]
[InstCombine] Cast to BinaryOperator earlier in foldSelectIntoOp to simplify the code.

We no longer need the explicit operand count check or the later dynamic cast.

llvm-svn: 310339

6 years ago[ScheduleOptimizer] Make matmul pattern detection work with delicm output
Tobias Grosser [Tue, 8 Aug 2017 06:15:15 +0000 (06:15 +0000)]
[ScheduleOptimizer] Make matmul pattern detection work with delicm output

In certain cases delicm might decide to not leave the original array write in
the loop body, but to remove it and instead leave a transformed phi node as
write access. This commit teached the matmul pattern detection to order the
memory accesses according to when the access actually happens and use this
information to detect the new pattern. This makes pattern based matmul
optimization work for 2mm and 3mm in polybench 4 after
polly-position=before-vectorizer has been enabled.

llvm-svn: 310338

6 years agoAMDGPU: Fix warnings introduced by r310336
Tom Stellard [Tue, 8 Aug 2017 05:52:00 +0000 (05:52 +0000)]
AMDGPU: Fix warnings introduced by r310336

llvm-svn: 310337

6 years agoAMDGPU: Move R600 parts of AMDGPUISelDAGToDAG into their own class
Tom Stellard [Tue, 8 Aug 2017 04:57:55 +0000 (04:57 +0000)]
AMDGPU: Move R600 parts of AMDGPUISelDAGToDAG into their own class

Summary: This refactoring is required in order to split the R600 and GCN tablegen files.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

llvm-svn: 310336

6 years agoAMDGPU: Also remove SI from docs
Konstantin Zhuravlyov [Tue, 8 Aug 2017 04:28:31 +0000 (04:28 +0000)]
AMDGPU: Also remove SI from docs

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

llvm-svn: 310335

6 years ago[PM] Relax the spelling of a pass name slightly in this test.
Chandler Carruth [Tue, 8 Aug 2017 02:27:49 +0000 (02:27 +0000)]
[PM] Relax the spelling of a pass name slightly in this test.

I forgot that MSVC doesn't preserve this typedef, my bad.

llvm-svn: 310334

6 years ago[PM] Fix new LoopUnroll function pass by invalidating loop analysis
Chandler Carruth [Tue, 8 Aug 2017 02:24:20 +0000 (02:24 +0000)]
[PM] Fix new LoopUnroll function pass by invalidating loop analysis
results when a loop is completely removed.

This is very hard to manifest as a visible bug. You need to arrange for
there to be a subsequent allocation of a 'Loop' object which gets the
exact same address as the one which the unroll deleted, and you need the
LoopAccessAnalysis results to be significant in the way that they're
stale. And you need a million other things to align.

But when it does, you get a deeply mysterious crash due to actually
finding a stale analysis result. This fixes the issue and tests for it
by directly checking we successfully invalidate things. I have not been
able to get *any* test case to reliably trigger this. Changes to LLVM
itself caused the only test case I ever had to cease to crash.

I've looked pretty extensively at less brittle ways of fixing this and
they are actually very, very hard to do. This is a somewhat strange and
unusual case as we have a pass which is deleting an IR unit, but is not
running within that IR unit's pass framework (which is what handles this
cleanly for the normal loop unroll). And where there isn't a definitive
way to clear *all* of the stale cache entries. And where the pass *is*
updating the core analysis that provides the IR units!

For example, we don't have any of these problems with Function analyses
because it is easy to clear out function analyses when the functions
themselves may have been deleted -- we clear an entire module's worth!
But that is too heavy of a hammer down here in the LoopAnalysisManager
layer.

A better long-term solution IMO is to require that AnalysisManager's
make their keys durable to this kind of thing. Specifically, when
caching an analysis for one IR unit that is conceptually "owned" by
a higher level IR unit, the AnalysisManager should incorporate this into
its data structures so that we can reliably clear these results without
having to teach each and every pass to do so manually as we do here. But
that is a change for another day as it will be a fairly invasive change
to the AnalysisManager infrastructure. Until then, this fortunately
seems to be quite rare.

llvm-svn: 310333

6 years agoFix openmp-offload.c test on Windows
Reid Kleckner [Tue, 8 Aug 2017 01:36:16 +0000 (01:36 +0000)]
Fix openmp-offload.c test on Windows

llvm-svn: 310332

6 years ago[codeview] Fix class name formatting
Reid Kleckner [Tue, 8 Aug 2017 01:33:53 +0000 (01:33 +0000)]
[codeview] Fix class name formatting

In particular, removes spaces between template arguments of class
templates to better match VS type visualizers.

llvm-svn: 310331

6 years ago[asan] Restore dead-code-elimination optimization for Fuchsia
Vitaly Buka [Tue, 8 Aug 2017 01:01:59 +0000 (01:01 +0000)]
[asan] Restore dead-code-elimination optimization for Fuchsia

Summary:
r310244 fixed a bug introduced by r309914 for non-Fuchsia builds.
In doing so it also reversed the intended effect of the change for
Fuchsia builds, which was to allow all the AllocateFromLocalPool
code and its variables to be optimized away entirely.

This change restores that optimization for Fuchsia builds, but
doesn't have the original change's bug because the comparison
arithmetic now takes into account the size of the elements.

Submitted on behalf of Roland McGrath.

Reviewers: vitalybuka, alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits, kubamracek

Tags: #sanitizers

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

llvm-svn: 310330

6 years ago[libc++abi] Use proper calling convention for TLS destructor
Shoaib Meenai [Tue, 8 Aug 2017 00:54:33 +0000 (00:54 +0000)]
[libc++abi] Use proper calling convention for TLS destructor

This is needed when using Windows threading.

llvm-svn: 310329

6 years ago[AMDGPU] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Tue, 8 Aug 2017 00:47:13 +0000 (00:47 +0000)]
[AMDGPU] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 310328

6 years ago[CMake] Allow overriding lib dir suffix independently from LLVM
Petr Hosek [Tue, 8 Aug 2017 00:37:59 +0000 (00:37 +0000)]
[CMake] Allow overriding lib dir suffix independently from LLVM

This matches the options already supported by libc++ and libc++abi.

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

llvm-svn: 310327

6 years ago[libFuzzer] simplify code, NFC
Kostya Serebryany [Tue, 8 Aug 2017 00:17:20 +0000 (00:17 +0000)]
[libFuzzer] simplify code, NFC

llvm-svn: 310326

6 years ago[libFuzzer] remove stale code
Kostya Serebryany [Tue, 8 Aug 2017 00:14:49 +0000 (00:14 +0000)]
[libFuzzer] remove stale code

llvm-svn: 310325

6 years ago[libFuzzer] simplify the implementation of -print_coverage=1
Kostya Serebryany [Tue, 8 Aug 2017 00:12:09 +0000 (00:12 +0000)]
[libFuzzer] simplify the implementation of -print_coverage=1

llvm-svn: 310324

6 years agoFix asan_test.cc build on NetBSD
Kamil Rytarowski [Mon, 7 Aug 2017 23:38:14 +0000 (23:38 +0000)]
Fix asan_test.cc build on NetBSD

Summary:
Include <stdarg.h> for variable argument list macros (va_list, va_start etc).

Add fallback definition of _LIBCPP_GET_C_LOCALE, this is required for
GNU libstdc++ compatibility. Define new macro SANITIZER_GET_C_LOCALE.
This value is currently required for FreeBSD and NetBSD for printf_l(3) tests.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, vitalybuka, filcab, fjricci

Reviewed By: vitalybuka

Subscribers: llvm-commits, emaste, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310323

6 years agoAdd NetBSD support in asan_stack.h
Kamil Rytarowski [Mon, 7 Aug 2017 23:34:45 +0000 (23:34 +0000)]
Add NetBSD support in asan_stack.h

Summary:
Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, kcc, vitalybuka, filcab, fjricci

Reviewed By: vitalybuka

Subscribers: davide, kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310322

6 years ago[KnownBits] Fix copy pasto in comment. NFC
Craig Topper [Mon, 7 Aug 2017 22:35:55 +0000 (22:35 +0000)]
[KnownBits] Fix copy pasto in comment. NFC

llvm-svn: 310320

6 years agoChange Polly's position to "before-vectorizer"
Tobias Grosser [Mon, 7 Aug 2017 22:33:34 +0000 (22:33 +0000)]
Change Polly's position to "before-vectorizer"

Polly has traditionally always been executed at the beginning of the pass
pipeline as LLVM's inliner and DeLICM passes introduced plenty of scalar
dependences which prevented any kind of useful high-level loop optimizations
later in the pass pipeline. With DeLICM now being available, Polly can also
run optimizations when folded into the pass pipeline. This has the benefit
that Polly should now be more effective on C++ code and as an additional bonus,
no additional early canonicalization phase must be run. As a result, Polly
touches the code only if it applies a transformation. Code that does not
benefit from Polly is not touched and consequently will have the very same
execution time as without Polly enabled. Random performance changes, as could
sometimes be observed with polly-position=early are consequently not possible
any more. If performance is changed, this is due to Polly is choosing to
perform a transformation. If this choice is wrong, it can be fixed directly
in Polly.

http://polly.llvm.org/docs/Architecture.html#polly-in-the-llvm-pass-pipeline

llvm-svn: 310319

6 years agoThis adds the argument --dump-ir to clang-import-test, which allows
Sean Callanan [Mon, 7 Aug 2017 22:27:30 +0000 (22:27 +0000)]
This adds the argument --dump-ir to clang-import-test, which allows
viewing of the final IR. This is useful for confirming that
structure layout was correct.

I've added two tests:

- A test that checks that structs in top-level code are completed
  correctly during struct layout (they are)
- A test that checks that structs defined in function bodies are
  cpmpleted correctly during struct layout (currently they are not,
  so this is XFAIL).

The second test fails because LookupSameContext()
(ExternalASTMerger.cpp) can't find the struct. This is an issue I
intend to resolve separately.

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

llvm-svn: 310318

6 years ago[X86][AVX] Added test for broadcast shuffle from binary sources with undefs (D36393)
Simon Pilgrim [Mon, 7 Aug 2017 22:20:06 +0000 (22:20 +0000)]
[X86][AVX] Added test for broadcast shuffle from binary sources with undefs (D36393)

llvm-svn: 310317

6 years ago[test] Add some missing options that become necessary after the recent default changes
Tobias Grosser [Mon, 7 Aug 2017 22:10:23 +0000 (22:10 +0000)]
[test] Add some missing options that become necessary after the recent default changes

llvm-svn: 310315

6 years ago[DeLICM] Enable partial writes
Tobias Grosser [Mon, 7 Aug 2017 22:06:07 +0000 (22:06 +0000)]
[DeLICM] Enable partial writes

This allows us to remove more scalar dependences. While this feature is still
rather experimental, we want to give it sufficient test coverage.

llvm-svn: 310314

6 years agoEnable delicm to automatically remove scalar loop carried dependences
Tobias Grosser [Mon, 7 Aug 2017 22:04:20 +0000 (22:04 +0000)]
Enable delicm to automatically remove scalar loop carried dependences

While this code is still rather we enable it by default to get better test
coverage.

llvm-svn: 310313

6 years ago[test] Add one more test case for the previous commit
Tobias Grosser [Mon, 7 Aug 2017 22:02:06 +0000 (22:02 +0000)]
[test] Add one more test case for the previous commit

llvm-svn: 310312

6 years ago[ZoneAlgo] Allow two writes that write identical values into same array slot
Tobias Grosser [Mon, 7 Aug 2017 22:01:29 +0000 (22:01 +0000)]
[ZoneAlgo] Allow two writes that write identical values into same array slot

Two write statements which write into the very same array slot generally are
conflicting. However, in case the value that is written is identical, this
does not cause any problem. Hence, allow such write pairs in this specific
situation.

llvm-svn: 310311

6 years agoAMDGPU: Implement getMinimumNopSize
Matt Arsenault [Mon, 7 Aug 2017 22:00:58 +0000 (22:00 +0000)]
AMDGPU: Implement getMinimumNopSize

llvm-svn: 310310

6 years ago[Object] Initialize LoadConfig member to null
Reid Kleckner [Mon, 7 Aug 2017 21:23:38 +0000 (21:23 +0000)]
[Object] Initialize LoadConfig member to null

Executables may not contain a load config, and clients should be able to
test for nullability. Previously we'd return uninitialized memory. Now
getLoadConfig32/64 return valid pointers or null.

Fixes PR34108

llvm-svn: 310308

6 years ago[OpenMP] Error when trying to offload to an unsupported architecture
Gheorghe-Teodor Bercea [Mon, 7 Aug 2017 21:11:10 +0000 (21:11 +0000)]
[OpenMP] Error when trying to offload to an unsupported architecture

Summary: Throw an error when offloading is unsupported for a particular target architecture.

Reviewers: sfantao, caomhin, carlo.bertolli, ABataev, Hahnfeld

Reviewed By: ABataev

Subscribers: cfe-commits, rengolin

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

llvm-svn: 310307

6 years ago[OpenMP] Prevent emission of exception handling code when using OpenMP to offload...
Gheorghe-Teodor Bercea [Mon, 7 Aug 2017 20:57:59 +0000 (20:57 +0000)]
[OpenMP] Prevent emission of exception handling code when using OpenMP to offload to NVIDIA devices.

Summary: For the OpenMP toolchain which offloads to NVIDIA GPUs make sure that no exception handling code is emitted.

Reviewers: arpith-jacob, sfantao, caomhin, carlo.bertolli, ABataev, Hahnfeld, hfinkel, tstellar

Reviewed By: ABataev, Hahnfeld

Subscribers: rengolin, Hahnfeld, cfe-commits

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

llvm-svn: 310306

6 years agoDo not instrument libFuzzer itself when built with -DLLVM_USE_SANITIZE_COVERAGE
George Karpenkov [Mon, 7 Aug 2017 20:56:11 +0000 (20:56 +0000)]
Do not instrument libFuzzer itself when built with -DLLVM_USE_SANITIZE_COVERAGE

Fixes regression from https://reviews.llvm.org/D36295

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

llvm-svn: 310305

6 years ago[Polly] Fully-Indexed static expansion
Andreas Simbuerger [Mon, 7 Aug 2017 20:54:20 +0000 (20:54 +0000)]
[Polly] Fully-Indexed static expansion

This commit implements the initial version of fully-indexed static
expansion.

```
 for(int i = 0; i<Ni; i++)
   for(int j = 0; j<Ni; j++)
S:     B[j] = j;
T: A[i] = B[i]
```

After the pass, we want this :
```
 for(int i = 0; i<Ni; i++)
   for(int j = 0; j<Ni; j++)
S:     B[i][j] = j;
T: A[i] = B[i][i]
```

For now we bail (fail) in the following cases:
  - Scalar access
  - Multiple writes per SAI
  - MayWrite Access
  - Expansion that leads to an access to the original array

Furthermore: We still miss checks for escaping references to the array
base pointers. A future commit will add the missing escape-checks to
stay correct in those cases. The expansion is still locked behind a
CLI-Option and should not yet be used.

Patch contributed by: Nicholas Bonfante <bonfante.nicolas@gmail.com>

Reviewers: simbuerg, Meinersbur, bollu

Reviewed By: Meinersbur

Subscribers: mgorny, llvm-commits, pollydev

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

llvm-svn: 310304

6 years ago[AArch64] Ignore stdcall and similar on aarch64/windows
Martin Storsjo [Mon, 7 Aug 2017 20:52:04 +0000 (20:52 +0000)]
[AArch64] Ignore stdcall and similar on aarch64/windows

This is similar to what's done on arm and x86_64, where
these calling conventions are silently ignored, as in
SVN r245076.

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

llvm-svn: 310303

6 years ago[OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by default
Gheorghe-Teodor Bercea [Mon, 7 Aug 2017 20:31:51 +0000 (20:31 +0000)]
[OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by default

Summary: When device offloading is enabled and the device is an NVIDIA GPU, OpenMP target regions must be compiled with relocation enabled by passing the "-c" flag to the PTXAS invocation.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar

Reviewed By: Hahnfeld

Subscribers: Hahnfeld, rengolin, mkuron, cfe-commits

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

llvm-svn: 310300

6 years agoMark static variables static; NFC.
George Burgess IV [Mon, 7 Aug 2017 20:26:33 +0000 (20:26 +0000)]
Mark static variables static; NFC.

llvm-svn: 310299

6 years ago[llvm-pdbutil] Don't crash when a section contrib's isect is invalid.
Zachary Turner [Mon, 7 Aug 2017 20:24:01 +0000 (20:24 +0000)]
[llvm-pdbutil] Don't crash when a section contrib's isect is invalid.

llvm-svn: 310298

6 years ago[lld] Write the DataCRC to the output PDB.
Zachary Turner [Mon, 7 Aug 2017 20:23:45 +0000 (20:23 +0000)]
[lld] Write the DataCRC to the output PDB.

llvm-svn: 310297

6 years agoMove the SampleProfileLoader right after EarlyFPM.
Dehao Chen [Mon, 7 Aug 2017 20:23:20 +0000 (20:23 +0000)]
Move the SampleProfileLoader right after EarlyFPM.

Summary: SampleProfileLoader pass do need to happen after some early cleanup passes so that inlining can happen correctly inside the SampleProfileLoader pass.

Reviewers: chandlerc, davidxl, tejohnson

Reviewed By: chandlerc, tejohnson

Subscribers: sanjoy, mehdi_amini, eraman, llvm-commits

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

llvm-svn: 310296

6 years ago[OpenMP] Pass -v to PTXAS if it was passed to the driver.
Gheorghe-Teodor Bercea [Mon, 7 Aug 2017 20:19:23 +0000 (20:19 +0000)]
[OpenMP] Pass -v to PTXAS if it was passed to the driver.

Summary: When compiling code being offloaded by OpenMP to an NVIDIA GPU, pass the -v to PTXAS if it was passed to the CLANG driver.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar

Reviewed By: jlebar

Subscribers: Hahnfeld, rengolin, cfe-commits

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

llvm-svn: 310295

6 years ago[OpenMP] Integrate OpenMP target region cubin into host binary
Gheorghe-Teodor Bercea [Mon, 7 Aug 2017 20:01:48 +0000 (20:01 +0000)]
[OpenMP] Integrate OpenMP target region cubin into host binary

Summary: OpenMP device offloading code generation produces a cubin file which is then integrated in the host binary using the host linker.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, rnk, hfinkel, tstellar

Reviewed By: hfinkel

Subscribers: sfantao, rnk, rengolin, cfe-commits

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

llvm-svn: 310291

6 years ago[libc++] Don't hardcode namespace in manual mangling
Shoaib Meenai [Mon, 7 Aug 2017 19:59:58 +0000 (19:59 +0000)]
[libc++] Don't hardcode namespace in manual mangling

libc++'s inline namespace can change depending on the ABI version.
Instead of hardcoding __1 in the manual Microsoft ABI manglings for the
iostream globals, stringify _LIBCPP_NAMESPACE and use that instead, to
work across all ABI versions.

llvm-svn: 310290

6 years agoReapply fix PR23384 (part 3 of 3) r304824 (was reverted in r305720).
Evgeny Stupachenko [Mon, 7 Aug 2017 19:56:34 +0000 (19:56 +0000)]
Reapply fix PR23384 (part 3 of 3) r304824 (was reverted in r305720).
The root cause of reverting was fixed - PR33514.

Summary:
The patch makes instruction count the highest priority for
 LSR solution for X86 (previously registers had highest priority).

Reviewers: qcolombet

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

From: Evgeny Stupachenko <evstupac@gmail.com>
                         <evgeny.v.stupachenko@intel.com>
llvm-svn: 310289

6 years agoRemoving an unused variable that was missed with the refactoring in r310272; NFC.
Aaron Ballman [Mon, 7 Aug 2017 19:26:17 +0000 (19:26 +0000)]
Removing an unused variable that was missed with the refactoring in r310272; NFC.

llvm-svn: 310285