platform/upstream/llvm.git
6 years agoRegenerate partial vector fold test. NFCI.
Simon Pilgrim [Fri, 20 Jul 2018 13:58:57 +0000 (13:58 +0000)]
Regenerate partial vector fold test. NFCI.

llvm-svn: 337551

6 years agoesan: fix shadow setup
Dmitry Vyukov [Fri, 20 Jul 2018 13:40:08 +0000 (13:40 +0000)]
esan: fix shadow setup

r337531 changed return type of MmapFixedNoReserve, but esan wasn't updated.
As the result esan shadow setup always fails.
We probably need to make MmapFixedNoAccess signature consistent
with MmapFixedNoReserve. But this is just to unbreak tests.

llvm-svn: 337550

6 years ago[NFC][testcases] fold sdiv if two operands are negated and non-overflow
Chen Zheng [Fri, 20 Jul 2018 13:38:59 +0000 (13:38 +0000)]
[NFC][testcases] fold sdiv if two operands are negated and non-overflow

llvm-svn: 337549

6 years agoRecommit r328307: [IPSCCP] Use constant range information for comparisons of parameters.
Florian Hahn [Fri, 20 Jul 2018 13:29:12 +0000 (13:29 +0000)]
Recommit r328307: [IPSCCP] Use constant range information for comparisons of parameters.

This version contains a fix to add values for which the state in ParamState change
to the worklist if the state in ValueState did not change. To avoid adding the
same value multiple times, mergeInValue returns true, if it added the value to
the worklist. The value is added to the worklist depending on its state in
ValueState.

Original message:
For comparisons with parameters, we can use the ParamState lattice
elements which also provide constant range information. This improves
the code for PR33253 further and gets us closer to use
ValueLatticeElement for all values.

Also, as we are using the range information in the solver directly, we
do not need tryToReplaceWithConstantRange afterwards anymore.

Reviewers: dberlin, mssimpso, davide, efriedma

Reviewed By: mssimpso

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

llvm-svn: 337548

6 years ago[X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use SimplifyDemandedVe...
Simon Pilgrim [Fri, 20 Jul 2018 13:26:51 +0000 (13:26 +0000)]
[X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use SimplifyDemandedVectorElts

This is an early step towards using SimplifyDemandedVectorElts for target shuffle combining - this merely moves the existing X86ISD::VBROADCAST simplification code to use the SimplifyDemandedVectorElts mechanism.

Adds X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode to handle X86ISD::VBROADCAST - in time we can support all target shuffles (and other ops) here.

llvm-svn: 337547

6 years agoRegenerate remainder test.
Simon Pilgrim [Fri, 20 Jul 2018 13:14:29 +0000 (13:14 +0000)]
Regenerate remainder test.

llvm-svn: 337546

6 years ago[InstSimplify] fold srem instruction if its two operands are negated.
Chen Zheng [Fri, 20 Jul 2018 13:00:47 +0000 (13:00 +0000)]
[InstSimplify] fold srem instruction if its two operands are negated.

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

llvm-svn: 337545

6 years ago[DebugInfo] Generate .debug_names section when it makes sense
Pavel Labath [Fri, 20 Jul 2018 12:59:05 +0000 (12:59 +0000)]
[DebugInfo] Generate .debug_names section when it makes sense

Summary:
This patch makes us generate the debug_names section in response to some
user-facing commands (previously it was only generated if explicitly
selected via the -accel-tables option).

My goal was to make this work for DWARF>=5 (as it's an official part of
that standard), and also, as an extension, for DWARF<5 if one is
explicitly tuning for lldb as a debugger (because it brings a large
performance improvement there).

This is slightly complicated by the fact that the debug_names tables are
incompatible with the DWARF v4 type units (they assume that the type
units are in the debug_info section), and unfortunately, right now we
generate DWARF v4-style type units even for -gdwarf-5. For this reason,
I disable all accelerator tables if the user requested type unit
generation. I do this even for apple tables, as they have the same
problem (in fact generating type units for apple targets makes us crash
even before we get around to emitting the accelerator tables).

Reviewers: JDevlieghere, aprantl, dblaikie, echristo, probinson

Subscribers: llvm-commits

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

llvm-svn: 337544

6 years ago[NFC][testcases] more testcases for folding srem if its two operands are negatived.
Chen Zheng [Fri, 20 Jul 2018 12:53:45 +0000 (12:53 +0000)]
[NFC][testcases] more testcases for folding srem if its two operands are negatived.

llvm-svn: 337543

6 years ago[SystemZ] Test case formatting fixes
Ulrich Weigand [Fri, 20 Jul 2018 12:12:10 +0000 (12:12 +0000)]
[SystemZ] Test case formatting fixes

Fix systematically wrong whitespace from a prior automated change.

NFC.

llvm-svn: 337542

6 years agoRevert "[LSV] Refactoring + supporting bitcasts to a type of different size"
Sam McCall [Fri, 20 Jul 2018 12:03:00 +0000 (12:03 +0000)]
Revert "[LSV] Refactoring + supporting bitcasts to a type of different size"

This reverts commit r337489.
It causes asserts to fire in some TensorFlow tests, e.g.
tensorflow/compiler/tests/gather_test.py on GPU.

Example stack trace:
Start test case: GatherTest.testHigherRank
assertion failed at third_party/llvm/llvm/lib/Support/APInt.cpp:819 in llvm::APInt llvm::APInt::trunc(unsigned int) const: width && "Can't truncate to 0 bits"
    @     0x5559446ebe10  __assert_fail
    @     0x55593ef32f5e  llvm::APInt::trunc()
    @     0x55593d78f86e  (anonymous namespace)::Vectorizer::lookThroughComplexAddresses()
    @     0x55593d78f2bc  (anonymous namespace)::Vectorizer::areConsecutivePointers()
    @     0x55593d78d128  (anonymous namespace)::Vectorizer::isConsecutiveAccess()
    @     0x55593d78c926  (anonymous namespace)::Vectorizer::vectorizeInstructions()
    @     0x55593d78c221  (anonymous namespace)::Vectorizer::vectorizeChains()
    @     0x55593d78b948  (anonymous namespace)::Vectorizer::run()
    @     0x55593d78b725  (anonymous namespace)::LoadStoreVectorizer::runOnFunction()
    @     0x55593edf4b17  llvm::FPPassManager::runOnFunction()
    @     0x55593edf4e55  llvm::FPPassManager::runOnModule()
    @     0x55593edf563c  (anonymous namespace)::MPPassManager::runOnModule()
    @     0x55593edf5137  llvm::legacy::PassManagerImpl::run()
    @     0x55593edf5b71  llvm::legacy::PassManager::run()
    @     0x55593ced250d  xla::gpu::IrDumpingPassManager::run()
    @     0x55593ced5033  xla::gpu::(anonymous namespace)::EmitModuleToPTX()
    @     0x55593ced40ba  xla::gpu::(anonymous namespace)::CompileModuleToPtx()
    @     0x55593ced33d0  xla::gpu::CompileToPtx()
    @     0x55593b26b2a2  xla::gpu::NVPTXCompiler::RunBackend()
    @     0x55593b21f973  xla::Service::BuildExecutable()
    @     0x555938f44e64  xla::LocalService::CompileExecutable()
    @     0x555938f30a85  xla::LocalClient::Compile()
    @     0x555938de3c29  tensorflow::XlaCompilationCache::BuildExecutable()
    @     0x555938de4e9e  tensorflow::XlaCompilationCache::CompileImpl()
    @     0x555938de3da5  tensorflow::XlaCompilationCache::Compile()
    @     0x555938c5d962  tensorflow::XlaLocalLaunchBase::Compute()
    @     0x555938c68151  tensorflow::XlaDevice::Compute()
    @     0x55593f389e1f  tensorflow::(anonymous namespace)::ExecutorState::Process()
    @     0x55593f38a625  tensorflow::(anonymous namespace)::ExecutorState::ScheduleReady()::$_1::operator()()
*** SIGABRT received by PID 7798 (TID 7837) from PID 7798; ***

llvm-svn: 337541

6 years agoSema: Fix explicit address space cast in C++
Yaxun Liu [Fri, 20 Jul 2018 11:32:51 +0000 (11:32 +0000)]
Sema: Fix explicit address space cast in C++

Currently clang does not allow implicit cast of a pointer to a pointer type
in different address space but allows C-style cast of a pointer to a pointer
type in different address space. However, there is a bug in Sema causing
incorrect Cast Expr in AST for the latter case, which in turn results in
invalid LLVM IR in codegen.

This is because Sema::IsQualificationConversion returns true for a cast of
pointer to a pointer type in different address space, which in turn allows
a standard conversion and results in a cast expression with no op in AST.

This patch fixes that by let Sema::IsQualificationConversion returns false
for a cast of pointer to a pointer type in different address space, which
in turn disallows standard conversion, implicit cast, and static cast.
Finally it results in an reinterpret cast and correct conversion kind is set.

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

llvm-svn: 337540

6 years ago[UBSan] Also use blacklist for 'Address; Undefined' setting
Florian Hahn [Fri, 20 Jul 2018 10:12:31 +0000 (10:12 +0000)]
[UBSan] Also use blacklist for 'Address; Undefined' setting

It looks like currently the UBSan blacklist is only applied when "Undefined" is selected.
This patch updates the cmake file to apply it whenever Undefined is selected
 (e.g. 'Address; Undefined' ). This  allows us to use the workaround added in
rL335525 when using AddressSan and UBSan together.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis

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

llvm-svn: 337539

6 years ago[SystemZ] Reimplent SchedModel IssueWidth and WriteRes/ReadAdvance mappings.
Jonas Paulsson [Fri, 20 Jul 2018 09:40:43 +0000 (09:40 +0000)]
[SystemZ] Reimplent SchedModel IssueWidth and WriteRes/ReadAdvance mappings.

As a consequence of recent discussions
(http://lists.llvm.org/pipermail/llvm-dev/2018-May/123164.html), this patch
changes the SystemZ SchedModels so that the IssueWidth is 6, which is the
decoder capacity, and NumMicroOps become the number of decoder slots needed
per instruction.

In addition, the SchedWrite latencies now match the MachineInstructions
def-operand indexes, and ReadAdvances have been added on instructions with
one register operand and one memory operand.

Review: Ulrich Weigand
https://reviews.llvm.org/D47008

llvm-svn: 337538

6 years agoImproved sched model for X86 BSWAP* instrs.
Andrew V. Tischenko [Fri, 20 Jul 2018 09:39:14 +0000 (09:39 +0000)]
Improved sched model for X86 BSWAP* instrs.
Differential Revision: https://reviews.llvm.org/D49477

llvm-svn: 337537

6 years ago[Xray] fix c99 warning build about flexible array semantics
David Carlier [Fri, 20 Jul 2018 09:22:22 +0000 (09:22 +0000)]
[Xray] fix c99 warning build about flexible array semantics

Reviewers: dberris

Reviewed By: dberris

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

llvm-svn: 337536

6 years agoReapply "AMDGPU: Fix handling of alignment padding in DAG argument lowering"
Matt Arsenault [Fri, 20 Jul 2018 09:05:08 +0000 (09:05 +0000)]
Reapply "AMDGPU: Fix handling of alignment padding in DAG argument lowering"

Reverts r337079 with fix for msan error.

llvm-svn: 337535

6 years ago[AArch64][SVE] Asm: Support for bit/byte reverse operations.
Sander de Smalen [Fri, 20 Jul 2018 09:00:44 +0000 (09:00 +0000)]
[AArch64][SVE] Asm: Support for bit/byte reverse operations.

This patch adds the following instructions:

  RBIT      reverse bits within each active elemnt (predicated), e.g.
                rbit z0.d, p0/m, z1.d

            for 8, 16, 32 and 64 bit elements.

  REV       reverse order of elements in data/predicate vector
            (unpredicated), e.g.
                rev z0.d, z1.d
                rev p0.d, p1.d

            for 8, 16, 32 and 64 bit elements.

  REVB      reverse order of bytes within each active element, e.g.
                revb z0.d, p0/m, z1.d

            for 16, 32 and 64 bit elements.

  REVH      reverse order of 16-bit half-words within each active
            element, e.g.
                revh z0.d, p0/m, z1.d

            for 32 and 64 bit elements.

  REVW      reverse order of 32-bit words within each active element,
            e.g.
                revw z0.d, p0/m, z1.d

            for 64 bit elements.

llvm-svn: 337534

6 years ago[AArch64][SVE] Asm: Support for FTMAD instruction.
Sander de Smalen [Fri, 20 Jul 2018 08:47:26 +0000 (08:47 +0000)]
[AArch64][SVE] Asm: Support for FTMAD instruction.

Floating-point trigonometric multiply-add coefficient,
e.g.

  ftmad z0.h, z0.h, z1.h, #7

with variants for 16, 32 and 64-bit elements.

llvm-svn: 337533

6 years agoadjust incorrect comment
Eric Fiselier [Fri, 20 Jul 2018 08:36:45 +0000 (08:36 +0000)]
adjust incorrect comment

llvm-svn: 337532

6 years agosanitizers: consistently check result of MmapFixedNoReserve
Dmitry Vyukov [Fri, 20 Jul 2018 08:33:41 +0000 (08:33 +0000)]
sanitizers: consistently check result of MmapFixedNoReserve

MmapFixedNoReserve does not terminate process on failure.
Failure to check its result and die will always lead to harder
to debug crashes later in execution. This was observed in Go
processes due to some address space conflicts.

Consistently check result of MmapFixedNoReserve.
While we are here also add warn_unused_result attribute
to prevent such bugs in future and change return type to bool
as that's what all callers want.

Reviewed in https://reviews.llvm.org/D49367

llvm-svn: 337531

6 years agoChange \t to spaces
Fangrui Song [Fri, 20 Jul 2018 08:19:20 +0000 (08:19 +0000)]
Change \t to spaces

llvm-svn: 337530

6 years ago[Index] Set OrigD before D is changed.
Eric Liu [Fri, 20 Jul 2018 08:08:56 +0000 (08:08 +0000)]
[Index] Set OrigD before D is changed.

Reviewers: akyrtzi, arphaman

Reviewed By: akyrtzi

Subscribers: cfe-commits

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

llvm-svn: 337529

6 years ago[ELF] - Fix mistypes in test cases.
George Rimar [Fri, 20 Jul 2018 08:07:33 +0000 (08:07 +0000)]
[ELF] - Fix mistypes in test cases.

llvm-svn: 337528

6 years ago[clangd] FuzzyMatch exposes an API for its word segmentation. NFC
Sam McCall [Fri, 20 Jul 2018 08:01:37 +0000 (08:01 +0000)]
[clangd] FuzzyMatch exposes an API for its word segmentation. NFC

Summary: This is intended to be used for indexing, e.g. in D49417

Reviewers: ioeric, omtcyfz

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 337527

6 years ago[COFF] Write the debug directory and build id to a separate section for MinGW
Martin Storsjo [Fri, 20 Jul 2018 05:44:34 +0000 (05:44 +0000)]
[COFF] Write the debug directory and build id to a separate section for MinGW

For dwarf debug info, an executable normally either contains the debug
info, or it is stripped out. To reduce the storage needed (slightly)
for the debug info kept separately from the released, stripped binaries,
one can choose to only copy the debug data from the original executable
(essentially the reverse of the strip operation), producing a file with
only debug info.

When copying the debug data from an executable with GNU objcopy,
the build id and debug directory need to reside in a separate section,
as this will be kept while the rest of the .rdata section is removed.

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

llvm-svn: 337526

6 years agoDocument -fobjc-weak as an extension.
John McCall [Fri, 20 Jul 2018 05:40:12 +0000 (05:40 +0000)]
Document -fobjc-weak as an extension.

Fixes rdar://24091053.

llvm-svn: 337525

6 years agoFix and improve the ARC spec's wording about unmanaged objects.
John McCall [Fri, 20 Jul 2018 05:40:09 +0000 (05:40 +0000)]
Fix and improve the ARC spec's wording about unmanaged objects.

llvm-svn: 337524

6 years agoAdd x86_64-unkown triple to llc for x86 test.
Stephen Canon [Fri, 20 Jul 2018 03:50:55 +0000 (03:50 +0000)]
Add x86_64-unkown triple to llc for x86 test.

llvm-svn: 337523

6 years ago[libFuzzer] Use separate test directory for each config
Joel E. Denny [Fri, 20 Jul 2018 02:39:01 +0000 (02:39 +0000)]
[libFuzzer] Use separate test directory for each config

Previously, check-all failed many tests for me.  It was running the
X86_64DefaultLinuxConfig, X86_64LibcxxLinuxConfig, and
X86_64StaticLibcxxLinuxConfig configs out of
llvm-build/projects/compiler-rt/test/fuzzer.  Now, it runs them out of
separate subdirectories there, and most tests pass.

Reviewed By: morehouse, george.karpenkov

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

llvm-svn: 337521

6 years agoFix two test failures in <experimental/filesystem>
Eric Fiselier [Fri, 20 Jul 2018 01:51:48 +0000 (01:51 +0000)]
Fix two test failures in <experimental/filesystem>

First, <experimental/filesystem> didn't correctly guard
against min/max macros. This adds the proper push/pop macro guards.

Second, an internal time helper had been renamed but the test for
it hadn't been updated. This patch updates those tests.

llvm-svn: 337520

6 years agoUse _LIBCPP_UNREACHABLE to convince GCC that non-void functions actually always return
Eric Fiselier [Fri, 20 Jul 2018 01:44:33 +0000 (01:44 +0000)]
Use _LIBCPP_UNREACHABLE to convince GCC that non-void functions actually always return

llvm-svn: 337519

6 years ago[DAGCombiner] Fold X - (-Y *Z) -> X + (Y * Z)
Craig Topper [Fri, 20 Jul 2018 01:40:03 +0000 (01:40 +0000)]
[DAGCombiner] Fold X - (-Y *Z) -> X + (Y * Z)

llvm-svn: 337518

6 years agocleanup test assertion inside library
Eric Fiselier [Fri, 20 Jul 2018 01:25:06 +0000 (01:25 +0000)]
cleanup test assertion inside library

llvm-svn: 337517

6 years ago[libc++] Implement Directory Entry Caching -- Sort of.
Eric Fiselier [Fri, 20 Jul 2018 01:22:32 +0000 (01:22 +0000)]
[libc++] Implement Directory Entry Caching -- Sort of.

Summary:
This patch implements directory_entry caching *almost* as specified in P0317r1. However, I explicitly chose to deviate from the standard as I'll explain below.

The approach I decided to take is a fully caching one. When `refresh()` is called, the cache is populated by calls to `stat` and `lstat` as needed.
During directory iteration the cache is only populated with the `file_type` as reported by `readdir`.
The cache can be in the following states:

* `_Empty`: There is nothing in the cache (likely due to an error)
* `_IterSymlink`: Created by directory iteration when we walk onto a symlink only the symlink file type is known.
* `_IterNonSymlink`: Created by directory iteration when we walk onto a non-symlink. Both the regular file type and symlink file type are known.
* `_RefreshSymlink` and `_RefreshNonSymlink`: A full cache created by `refresh()`.  This case includes dead symlinks.
* `_RefreshSymlinkUnresolved`: A partial cache created by refresh when we fail to resolve the file pointed to by a symlink (likely due to permissions). Symlink attributes are cached, but attributes about the linked entity are not.

As mentioned, this implementation purposefully deviates from the standard. According to some readings of the specification, and the Windows filesystem implementation, the constructors and modifiers which don't pass an `error_code` must throw when the `directory_entry` points to a entity which doesn't exist. or when attribute resolution fails for another reason.

@BillyONeal  has proposed a more reasonable set of requirements, where modifiers other than refresh ignore errors. This is the behavior libc++ currently implements, with the expectation some form of the new language will be accepted into the standard.

Some additional semantics which differ from the Windows implementation:

1. `refresh` will not throw when the entry doesn't exist. In this case we can still meet the functions specification, so we don't treat it as an error.
2. We don't clear the path name when a constructor fails via refresh (this will hopefully be changed in the standard as well).

It should be noted that libstdc++'s current implementation has the same behavior as libc++, except for point (2).

If the changes to the specification don't get accepted, we'll be able to make the changes later.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0317r1.html

Reviewers: mclow.lists, gromer, ldionne, aaron.ballman

Subscribers: BillyONeal, christof, cfe-commits

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

llvm-svn: 337516

6 years agoDefend LoadImageUsingPaths against a path list
Jim Ingham [Fri, 20 Jul 2018 01:20:18 +0000 (01:20 +0000)]
Defend LoadImageUsingPaths against a path list
with empty paths on it.

llvm-svn: 337515

6 years agoReapply "ADT: Shrink size of SmallVector by 8B on 64-bit platforms"
Duncan P. N. Exon Smith [Fri, 20 Jul 2018 00:44:58 +0000 (00:44 +0000)]
Reapply "ADT: Shrink size of SmallVector by 8B on 64-bit platforms"

I'm optimistically reverting commit r337511, effectively reapplying
r337504 *without* changes.

The failing bots that had `SmallVector` in the backtrace recovered after
the unrelated commit r337508.  The backtraces looked bogus anyway, with
`SmallVector::size()` calling (e.g.) `ConstantArray::get()`.

Here's the original commit message:

    ADT: Shrink size of SmallVector by 8B on 64-bit platforms

    Represent size and capacity directly as unsigned and calculate
    `end()` using `begin() + size()`.

    This limits the maximum size/capacity of a vector to UINT32_MAX.

    https://reviews.llvm.org/D48518

llvm-svn: 337514

6 years agoRevert "[docs] Add support for Markdown documentation in Sphinx"
Michael J. Spencer [Fri, 20 Jul 2018 00:24:36 +0000 (00:24 +0000)]
Revert "[docs] Add support for Markdown documentation in Sphinx"

The buildbots have an old version of Sphinx (need at least 1.3).  Revert until they are upgraded.

llvm-svn: 337513

6 years ago[WebAssembly] Disable a test that violates DR1696
Heejin Ahn [Fri, 20 Jul 2018 00:13:42 +0000 (00:13 +0000)]
[WebAssembly] Disable a test that violates DR1696

Summary:
lifetime2.C violates DR1696, which prevents reference members from being
initialized to temporaries, whose lifetime would end at the end of ctor.

Reviewers: sbc100

Subscribers: dschuff, sunfish, llvm-commits

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

llvm-svn: 337512

6 years agoRevert "ADT: Shrink size of SmallVector by 8B on 64-bit platforms"
Duncan P. N. Exon Smith [Fri, 20 Jul 2018 00:09:56 +0000 (00:09 +0000)]
Revert "ADT: Shrink size of SmallVector by 8B on 64-bit platforms"

This reverts commit r337504 while I investigate a TSan bot failure that
seems related:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/26526

    #8 0x000055581f2895d8 (/b/sanitizer-x86_64-linux-autoconf/build/tsan_debug_build/bin/clang-7+0x1eb45d8)
    #9 0x000055581f294323 llvm::ConstantAggrKeyType<llvm::ConstantArray>::create(llvm::ArrayType*) const /b/sanitizer-x86_64-linux-autoconf/build/llvm/lib/IR/ConstantsContext.h:409:0
    #10 0x000055581f294323 llvm::ConstantUniqueMap<llvm::ConstantArray>::create(llvm::ArrayType*, llvm::ConstantAggrKeyType<llvm::ConstantArray>, std::pair<unsigned int, std::pair<llvm::ArrayType*, llvm::ConstantAggrKeyType<llvm::ConstantArray> > >&) /b/sanitizer-x86_64-linux-autoconf/build/llvm/lib/IR/ConstantsContext.h:635:0
    #11 0x000055581f294323 llvm::ConstantUniqueMap<llvm::ConstantArray>::getOrCreate(llvm::ArrayType*, llvm::ConstantAggrKeyType<llvm::ConstantArray>) /b/sanitizer-x86_64-linux-autoconf/build/llvm/lib/IR/ConstantsContext.h:654:0
    #12 0x000055581f2944cb llvm::ConstantArray::get(llvm::ArrayType*, llvm::ArrayRef<llvm::Constant*>) /b/sanitizer-x86_64-linux-autoconf/build/llvm/lib/IR/Constants.cpp:964:0
    #13 0x000055581fa27e19 llvm::SmallVectorBase::size() const /b/sanitizer-x86_64-linux-autoconf/build/llvm/include/llvm/ADT/SmallVector.h:53:0
    #14 0x000055581fa27e19 llvm::SmallVectorImpl<llvm::Constant*>::resize(unsigned long) /b/sanitizer-x86_64-linux-autoconf/build/llvm/include/llvm/ADT/SmallVector.h:347:0
    #15 0x000055581fa27e19 (anonymous namespace)::EmitArrayConstant(clang::CodeGen::CodeGenModule&, clang::ConstantArrayType const*, llvm::Type*, unsigned int, llvm::SmallVectorImpl<llvm::Constant*>&, llvm::Constant*) /b/sanitizer-x86_64-linux-autoconf/build/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp:669:0

llvm-svn: 337511

6 years ago[x86/SLH] Clean up helper naming for return instruction handling and
Chandler Carruth [Thu, 19 Jul 2018 23:46:24 +0000 (23:46 +0000)]
[x86/SLH] Clean up helper naming for return instruction handling and
remove dead declaration of a call instruction handling helper.

This moves to the 'harden' terminology that I've been trying to settle
on for returns. It also adds a really detailed comment explaining what
all we're trying to accomplish with return instructions and why.
Hopefully this makes it much more clear what exactly is being
"hardened".

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

llvm-svn: 337510

6 years ago[docs] Add support for Markdown documentation in Sphinx
Michael J. Spencer [Thu, 19 Jul 2018 23:40:58 +0000 (23:40 +0000)]
[docs] Add support for Markdown documentation in Sphinx

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

llvm-svn: 337509

6 years agoFix typo causing assert in self-host.
Richard Smith [Thu, 19 Jul 2018 23:24:41 +0000 (23:24 +0000)]
Fix typo causing assert in self-host.

llvm-svn: 337508

6 years ago[SCCP] Don't use markForcedConstant on branch conditions.
Eli Friedman [Thu, 19 Jul 2018 23:02:07 +0000 (23:02 +0000)]
[SCCP] Don't use markForcedConstant on branch conditions.

It's more aggressive than we need to be, and leads to strange
workarounds in other places like call return value inference. Instead,
just directly mark an edge viable.

Tests by Florian Hahn.

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

llvm-svn: 337507

6 years agoSkip out of SimplifyDemandedBits for BITCAST of f16 to i16
Stephen Canon [Thu, 19 Jul 2018 22:46:42 +0000 (22:46 +0000)]
Skip out of SimplifyDemandedBits for BITCAST of f16 to i16

Mirrors the existing exit path for f128, avoiding a crash later on.

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

llvm-svn: 337506

6 years ago[docs] Correct -fvisibility-inlines-hidden description
Fangrui Song [Thu, 19 Jul 2018 22:45:41 +0000 (22:45 +0000)]
[docs] Correct -fvisibility-inlines-hidden description

llvm-svn: 337505

6 years agoADT: Shrink size of SmallVector by 8B on 64-bit platforms
Duncan P. N. Exon Smith [Thu, 19 Jul 2018 22:29:47 +0000 (22:29 +0000)]
ADT: Shrink size of SmallVector by 8B on 64-bit platforms

Representing size and capacity directly as unsigned and calculate
`end()` using `begin() + size()`.

This limits the maximum size/capacity of a vector to UINT32_MAX.

https://reviews.llvm.org/D48518

llvm-svn: 337504

6 years ago[ThinLTO] Only emit referenced type id records in index files
Teresa Johnson [Thu, 19 Jul 2018 22:25:56 +0000 (22:25 +0000)]
[ThinLTO] Only emit referenced type id records in index files

Summary:
Currently all type ids are emitted into the index file when it is
written. For distributed ThinLTO, that meant that all type ids were
being duplicated into every single distributed index file, regardless of
whether they were referenced, leading to huge amounts of unnecessary
duplication and size bloat.

Keep track of the type id GUIDs actually referenced by the GV summary
records being emitted, and only emit those type IDs.

Add a new test, and fix test/Assembler/thinlto-summary.ll so that all
type ids are referenced to prevent deletion in that test.

Reviewers: pcc

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

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

llvm-svn: 337503

6 years ago[DAGCombiner] Teach DAGCombiner that A-(-B) is A+B.
Craig Topper [Thu, 19 Jul 2018 22:24:43 +0000 (22:24 +0000)]
[DAGCombiner] Teach DAGCombiner that A-(-B) is A+B.

We already knew A+(-B) is A-B in visitAdd. This does the opposite for visitSub.

llvm-svn: 337502

6 years ago[libFuzzer] when -print_coverage=1 is given, print more stats (the number of seeds...
Kostya Serebryany [Thu, 19 Jul 2018 22:00:48 +0000 (22:00 +0000)]
[libFuzzer] when -print_coverage=1 is given, print more stats (the number of seeds that hit every given function)

llvm-svn: 337501

6 years ago[X86][AVX] Use extract_subvector to reduce vector op widths (PR36761)
Simon Pilgrim [Thu, 19 Jul 2018 21:52:06 +0000 (21:52 +0000)]
[X86][AVX] Use extract_subvector to reduce vector op widths (PR36761)

We have a number of cases where we fail to reduce vector op widths, performing the op in a larger vector and then extracting a subvector. This is often because by default it would create illegal types.

This peephole patch attempts to handle a few common cases detailed in PR36761, which typically involved extension+conversion to vX2f64 types.

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

llvm-svn: 337500

6 years ago[CStringSyntaxChecker] Check strlcpy sizeof syntax
David Carlier [Thu, 19 Jul 2018 21:50:03 +0000 (21:50 +0000)]
[CStringSyntaxChecker] Check strlcpy sizeof syntax

The last argument is expected to be the destination buffer size (or less).

    Detects if it points to destination buffer size directly or via a variable.
    Detects if it is an integral, try to detect if the destination buffer can receive the source length.

Updating bsd-string.c unit tests as it make it fails now.

Reviewers: george.karpenpov, NoQ

Reviewed By: george.karpenkov

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

llvm-svn: 337499

6 years agoWhen we choose to use zeroinitializer for a trailing portion of an array
Richard Smith [Thu, 19 Jul 2018 21:38:56 +0000 (21:38 +0000)]
When we choose to use zeroinitializer for a trailing portion of an array
constant, don't convert the rest into a packed struct.

If an array constant has a large non-zero portion and a large zero
portion, we want to emit the first part as an array and the rest as a
zeroinitializer if possible. This fixes a memory usage regression from
r333141 when compiling PHP.

llvm-svn: 337498

6 years ago[Sema] Diagnose an invalid dependent function template specialization
Erik Pilkington [Thu, 19 Jul 2018 20:40:20 +0000 (20:40 +0000)]
[Sema] Diagnose an invalid dependent function template specialization

Previously, clang marked the specialization as invalid without emitting a
diagnostic. This lead to an assert in CodeGen.

rdar://41806724

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

llvm-svn: 337497

6 years ago[llvm-mca][docs] Add Timeline and How MCA works.
Matt Davis [Thu, 19 Jul 2018 20:33:59 +0000 (20:33 +0000)]
[llvm-mca][docs] Add Timeline and How MCA works.

For the most part, these changes were from the RFC.  I made a few minor
word/structure changes, but nothing significant.  I also regenerated the
example output, and adjusted the text accordingly.

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

llvm-svn: 337496

6 years agoWork around bug in mingw-w64 GCC 8.1.0
Reid Kleckner [Thu, 19 Jul 2018 20:32:45 +0000 (20:32 +0000)]
Work around bug in mingw-w64 GCC 8.1.0

This particular version of GCC seems to break bitfields when a method
appears between two bitfield members.

Personally, I think it's nice to keep bitfields close together so that
it's easy to check how things are packed, so I moved the method after
SubClassData.

Fixes PR38168.

llvm-svn: 337495

6 years ago[ELF][HEXAGON] Add support for R_HEX_B15_PCREL
Sid Manning [Thu, 19 Jul 2018 20:27:43 +0000 (20:27 +0000)]
[ELF][HEXAGON] Add support for R_HEX_B15_PCREL

Add support and update the testcase.

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

llvm-svn: 337494

6 years ago[profile] Fix typo in test
Teresa Johnson [Thu, 19 Jul 2018 20:18:37 +0000 (20:18 +0000)]
[profile] Fix typo in test

Noticed that this was causing a compiler warning in the test.

llvm-svn: 337493

6 years agoDisable GCC's -Wclass-memaccess warning
Reid Kleckner [Thu, 19 Jul 2018 20:14:46 +0000 (20:14 +0000)]
Disable GCC's -Wclass-memaccess warning

It fires on things like SmallVector<std::pair<int, int>>, where we
intentionally use memcpy instead of calling the assignment operator.
This warning fires in practically every LLVM TU, so we have to do
something about it, even if we aren't interested in being 100% warning
clean with GCC.

Reported as PR37337

llvm-svn: 337492

6 years ago[X86] Fix some 'return SDValue()' after DCI.CombineTo instead return the output of...
Craig Topper [Thu, 19 Jul 2018 20:10:44 +0000 (20:10 +0000)]
[X86] Fix some 'return SDValue()' after DCI.CombineTo instead return the output of CombineTo

Returning SDValue() means nothing was changed. Returning the result of CombineTo returns the first argument of CombineTo. This is specially detected by DAGCombiner as meaning that something changed, but worklist management was already taken care of.

I think the only real effect of this change is that we now properly update the Statistic the counts the number of combines performed. That's the only thing between the check for null and the check for N in the DAGCombiner.

llvm-svn: 337491

6 years agoFix -Wsign-compare in llvm-readobj
Reid Kleckner [Thu, 19 Jul 2018 19:58:22 +0000 (19:58 +0000)]
Fix -Wsign-compare in llvm-readobj

llvm-svn: 337490

6 years ago[LSV] Refactoring + supporting bitcasts to a type of different size
Roman Tereshin [Thu, 19 Jul 2018 19:42:43 +0000 (19:42 +0000)]
[LSV] Refactoring + supporting bitcasts to a type of different size

This is mostly a preparation work for adding a limited support for
select instructions. It proved to be difficult to do due to size and
irregularity of Vectorizer::isConsecutiveAccess, this is fixed here I
believe.

It also turned out that these changes make it simpler to finish one of
the TODOs and fix a number of other small issues, namely:

1. Looking through bitcasts to a type of a different size (requires
careful tracking of the original load/store size and some math
converting sizes in bytes to expected differences in indices of GEPs).

2. Reusing partial analysis of pointers done by first attempt in proving
them consecutive instead of starting from scratch. This added limited
support for nested GEPs co-existing with difficult sext/zext
instructions. This also required a careful handling of negative
differences between constant parts of offsets.

3. Handing a case where the first pointer index is not an add, but
something else (a function parameter for instance).

I observe an increased number of successful vectorizations on a large
set of shader programs. Only few shaders are affected, but those that
are affected sport >5% less loads and stores than before the patch.

Reviewed By: rampitec

Differential-Revision: https://reviews.llvm.org/D49342
llvm-svn: 337489

6 years ago[Power9] Code Cleanup - Remove needsAggressiveScheduling()
Stefan Pintilie [Thu, 19 Jul 2018 19:34:18 +0000 (19:34 +0000)]
[Power9] Code Cleanup - Remove needsAggressiveScheduling()

As we already return true from needsAggressiveScheduling() for the most recent
hardware it would be cleaner to just return true for all PowerPC hardware.

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

llvm-svn: 337488

6 years agoBlock library shutdown until unreaped threads finish spin-waiting
Jonathan Peyton [Thu, 19 Jul 2018 19:17:00 +0000 (19:17 +0000)]
Block library shutdown until unreaped threads finish spin-waiting

This change fixes possibly invalid access to the internal data structure during
library shutdown.  In a heavily oversubscribed situation, the library shutdown
sequence can reach the point where resources are deallocated while there still
exist threads in their final spinning loop.  The added loop in
__kmp_internal_end() checks if there are such busy-waiting threads and blocks
the shutdown sequence if that is the case. Two versions of kmp_wait_template()
are now used to minimize performance impact.

Patch by Hansang Bae

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

llvm-svn: 337486

6 years ago[Analysis] Fix typo in assert. NFC
Shoaib Meenai [Thu, 19 Jul 2018 19:11:29 +0000 (19:11 +0000)]
[Analysis] Fix typo in assert. NFC

Test commit to see if my mailing list woes have been resolved.

llvm-svn: 337485

6 years agoAdd support for R_HEX_B32_PCREL_X, R_HEX_B22_PCREL_X relocations
Sid Manning [Thu, 19 Jul 2018 19:10:56 +0000 (19:10 +0000)]
Add support for R_HEX_B32_PCREL_X, R_HEX_B22_PCREL_X relocations

A couple more basic relocations plus testcase.

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

llvm-svn: 337484

6 years agoFix failing testcase to actually be valid.
Richard Smith [Thu, 19 Jul 2018 19:05:13 +0000 (19:05 +0000)]
Fix failing testcase to actually be valid.

llvm-svn: 337483

6 years ago[profile] Add interface to get profile filename
Teresa Johnson [Thu, 19 Jul 2018 19:03:50 +0000 (19:03 +0000)]
[profile] Add interface to get profile filename

Summary:
Add __llvm_profile_get_filename interface to get the profile filename,
which can be used for identifying which profile file belongs to an app
when multiple binaries are instrumented and dumping profiles into the
same directory. The filename includes the path.

Reviewers: davidxl

Subscribers: delcypher, #sanitizers, llvm-commits

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

llvm-svn: 337482

6 years agoFix template argument deduction when a parameter pack has a value
Richard Smith [Thu, 19 Jul 2018 19:00:37 +0000 (19:00 +0000)]
Fix template argument deduction when a parameter pack has a value
provided by an outer template.

We made the incorrect assumption in various places that the only way we
can have any arguments already provided for a pack during template
argument deduction was from a partially-specified pack. That's not true;
we can also have arguments from an enclosing already-instantiated
template, and that can even result in the function template's own pack
parameters having a fixed length and not being packs for the purposes of
template argument deduction.

llvm-svn: 337481

6 years agofix typo in comment
Nico Weber [Thu, 19 Jul 2018 18:59:38 +0000 (18:59 +0000)]
fix typo in comment

llvm-svn: 337480

6 years ago[OpenEmbedded] Add a unittest for aarch64-oe-linux
Mandeep Singh Grang [Thu, 19 Jul 2018 18:10:03 +0000 (18:10 +0000)]
[OpenEmbedded] Add a unittest for aarch64-oe-linux

Summary: Added a unittest for aarch64-oe-linux which was missed in D48861.

Reviewers: compnerd, rengolin, javed.absar

Reviewed By: compnerd

Subscribers: kristof.beyls, dexonsmith, llvm-commits

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

llvm-svn: 337479

6 years ago[APInt] Keep the original bit width in quotient and remainder
Krzysztof Parzyszek [Thu, 19 Jul 2018 18:07:56 +0000 (18:07 +0000)]
[APInt] Keep the original bit width in quotient and remainder

Some trivial cases in udivrem were handled by directly assigning 0 or 1
to APInt objects. This would set the bit width to 1, instead of the bit
width of the inputs. A potentially undesirable side effect of that is
that with the bit width of 1, 1 equals -1.

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

llvm-svn: 337478

6 years ago[libc++] Allow running ABI list tests with different ABI versions
Louis Dionne [Thu, 19 Jul 2018 18:02:50 +0000 (18:02 +0000)]
[libc++] Allow running ABI list tests with different ABI versions

Summary:
Currently, the ABI list test only works for ABI version 1. This commit
allows running the ABI list test with ABI version 2. It also adds an
ABI list file for ABI v2 on Mac OS X.

Reviewers: EricWF

Subscribers: mgorny, christof, dexonsmith, llvm-commits, mclow.lists

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

llvm-svn: 337477

6 years ago[libFuzzer] Update documentation regarding MSan.
Matt Morehouse [Thu, 19 Jul 2018 17:59:11 +0000 (17:59 +0000)]
[libFuzzer] Update documentation regarding MSan.

Summary: -fsanitize=fuzzer,memory now works out-of-the-box.

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

llvm-svn: 337476

6 years agoAdded unit tests for Flags
Raphael Isemann [Thu, 19 Jul 2018 17:45:51 +0000 (17:45 +0000)]
Added unit tests for Flags

Reviewers: labath

Reviewed By: labath

Subscribers: labath, mgorny, lldb-commits

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

llvm-svn: 337475

6 years ago[analyzer] Fix memory sanitizer error in MallocChecker.
Reka Kovacs [Thu, 19 Jul 2018 17:43:09 +0000 (17:43 +0000)]
[analyzer] Fix memory sanitizer error in MallocChecker.

StringRef's data() returns a string that may be non-null-terminated.
Switch to using StringRefs from const char pointers in visitor notes
to avoid problems.

llvm-svn: 337474

6 years agoFix unused variable warning.
Erich Keane [Thu, 19 Jul 2018 17:19:16 +0000 (17:19 +0000)]
Fix unused variable warning.

llvm-svn: 337473

6 years ago[analyzer] Memoize complexity of SymExpr
Mikhail R. Gadelha [Thu, 19 Jul 2018 17:03:12 +0000 (17:03 +0000)]
[analyzer] Memoize complexity of SymExpr

Summary:
This patch introduces a new member to SymExpr, which stores the symbol complexity, avoiding recalculating it every time computeComplexity() is called.

Also, increase the complexity of conjured Symbols by one, so it's clear that it has a greater complexity than its underlying symbols.

Reviewers: NoQ, george.karpenkov

Reviewed By: NoQ, george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin

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

llvm-svn: 337472

6 years ago[LoadStoreVectorizer] Use getMinusScev() to compute the distance between two pointers.
Farhana Aleen [Thu, 19 Jul 2018 16:50:27 +0000 (16:50 +0000)]
[LoadStoreVectorizer] Use getMinusScev() to compute the distance between two pointers.

Summary: Currently, isConsecutiveAccess() detects two pointers(PtrA and PtrB) as consecutive by
         comparing PtrB with BaseDelta+PtrA. This works when both pointers are factorized or
         both of them are not factorized. But isConsecutiveAccess() fails if one of the
         pointers is factorized but the other one is not.

         Here is an example:
         PtrA = 4 * (A + B)
         PtrB = 4 + 4A + 4B

         This patch uses getMinusSCEV() to compute the distance between two pointers.
         getMinusSCEV() allows combining the expressions and computing the simplified distance.

Author: FarhanaAleen

Reviewed By: rampitec

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

llvm-svn: 337471

6 years ago[Sema] Add a new warning, -Wmemset-transposed-args
Erik Pilkington [Thu, 19 Jul 2018 16:46:15 +0000 (16:46 +0000)]
[Sema] Add a new warning, -Wmemset-transposed-args

This diagnoses calls to memset that have the second and third arguments
transposed, for example:

  memset(buf, sizeof(buf), 0);

This is done by checking if the third argument is a literal 0, or if the second
is a sizeof expression (and the third isn't). The first check is also done for
calls to bzero.

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

llvm-svn: 337470

6 years ago[X86][BtVer2] correctly model the latency/throughput of LEA instructions.
Andrea Di Biagio [Thu, 19 Jul 2018 16:42:15 +0000 (16:42 +0000)]
[X86][BtVer2] correctly model the latency/throughput of LEA instructions.

This patch fixes the latency/throughput of LEA instructions in the BtVer2
scheduling model.

On Jaguar, A 3-operands LEA has a latency of 2cy, and a reciprocal throughput of
1. That is because it uses one cycle of SAGU followed by 1cy of ALU1.  An LEA
with a "Scale" operand is also slow, and it has the same latency profile as the
3-operands LEA. An LEA16r has a latency of 3cy, and a throughput of 0.5 (i.e.
RThrouhgput of 2.0).

This patch adds a new TIIPredicate named IsThreeOperandsLEAFn to X86Schedule.td.
The tablegen backend (for instruction-info) expands that definition into this
(file X86GenInstrInfo.inc):
```
static bool isThreeOperandsLEA(const MachineInstr &MI) {
  return (
    (
      MI.getOpcode() == X86::LEA32r
      || MI.getOpcode() == X86::LEA64r
      || MI.getOpcode() == X86::LEA64_32r
      || MI.getOpcode() == X86::LEA16r
    )
    && MI.getOperand(1).isReg()
    && MI.getOperand(1).getReg() != 0
    && MI.getOperand(3).isReg()
    && MI.getOperand(3).getReg() != 0
    && (
      (
        MI.getOperand(4).isImm()
        && MI.getOperand(4).getImm() != 0
      )
      || (MI.getOperand(4).isGlobal())
    )
  );
}
```

A similar method is generated in the X86_MC namespace, and included into
X86MCTargetDesc.cpp (the declaration lives in X86MCTargetDesc.h).

Back to the BtVer2 scheduling model:
A new scheduling predicate named JSlowLEAPredicate now checks if either the
instruction is a three-operands LEA, or it is an LEA with a Scale value
different than 1.
A variant scheduling class uses that new predicate to correctly select the
appropriate latency profile.

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

llvm-svn: 337469

6 years agoThe patch adds support for the new map interface between clang and libomptarget....
Alexey Bataev [Thu, 19 Jul 2018 16:34:13 +0000 (16:34 +0000)]
The patch adds support for the new map interface between clang and libomptarget. The changes in the interface are the following:

device IDs are now 64-bit integers (as opposed to 32-bit)
map flags are 64-bit long (used to be 32-bit)
mappings for partially mapped structs are now calculated at compile time and members of partially mapped structs are flagged using the MEMBER_OF field
Support for is_device_ptr on struct members was dropped - this functionality is not supported by the OpenMP standard and its implementation is technically infeasible (however, use_device_ptr on struct members works as a non-standard extension of the compiler)

llvm-svn: 337468

6 years ago[compiler-rt] Only set lto_flags if lto_supported
Teresa Johnson [Thu, 19 Jul 2018 16:12:15 +0000 (16:12 +0000)]
[compiler-rt] Only set lto_flags if lto_supported

Fix bot failure from r37465. Move the new lto_flags append under the
check for whether lto_supported. Otherwise TestingConfig may not have
that member.

llvm-svn: 337467

6 years ago[analyzer] Fix disappearing notes in DanglingInternalBufferChecker tests
Reka Kovacs [Thu, 19 Jul 2018 15:44:46 +0000 (15:44 +0000)]
[analyzer] Fix disappearing notes in DanglingInternalBufferChecker tests

Correct a mistake of the exact same kind I am writing this checker for.

llvm-svn: 337466

6 years ago[compiler-rt] Add NewPM testing to CFI tests
Teresa Johnson [Thu, 19 Jul 2018 15:32:48 +0000 (15:32 +0000)]
[compiler-rt] Add NewPM testing to CFI tests

Summary:
Executes both LTO and ThinLTO CFI tests an additional time using the new
pass manager. I only bothered to add with gold and not lld as testing
with one linker should be sufficient. I didn't add for APPLE or WIN32
since I don't have a way to test those.

Depends on D49429.

Reviewers: pcc

Subscribers: dberris, mgorny, mehdi_amini, delcypher, dexonsmith, #sanitizers, llvm-commits

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

llvm-svn: 337465

6 years ago[X86][SSE] Add FPEXT vXf32 - vXf64 tests
Simon Pilgrim [Thu, 19 Jul 2018 15:32:45 +0000 (15:32 +0000)]
[X86][SSE] Add FPEXT vXf32 - vXf64 tests

Some basic subvector special cases based on PR36761

llvm-svn: 337464

6 years ago[analyzer] Add support for more basic_string API in
Reka Kovacs [Thu, 19 Jul 2018 15:10:06 +0000 (15:10 +0000)]
[analyzer] Add support for more basic_string API in
DanglingInternalBufferChecker.

A pointer referring to the elements of a basic_string may be invalidated
by calling a non-const member function, except operator[], at, front,
back, begin, rbegin, end, and rend. The checker now warns if the pointer
is used after such operations.

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

llvm-svn: 337463

6 years ago[llvm-readobj] - Do not report invalid amount of sections.
George Rimar [Thu, 19 Jul 2018 14:52:57 +0000 (14:52 +0000)]
[llvm-readobj] - Do not report invalid amount of sections.

When output style is GNU and amount of sections is >= SHN_LORESERVE,
llvm-readobj reports zero number of sections instead of actual value.

The patch fixes that.

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

llvm-svn: 337462

6 years ago[ThinLTO] Enable ThinLTO WholeProgramDevirt and LowerTypeTests in new PM
Teresa Johnson [Thu, 19 Jul 2018 14:51:32 +0000 (14:51 +0000)]
[ThinLTO] Enable ThinLTO WholeProgramDevirt and LowerTypeTests in new PM

Summary:
Enable these passes for CFI and WPD in ThinLTO and LTO with the new pass
manager. Add a couple of tests for both PMs based on the clang tests
tools/clang/test/CodeGen/thinlto-distributed-cfi*.ll, but just test
through llvm-lto2 and not with distributed ThinLTO.

Reviewers: pcc

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

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

llvm-svn: 337461

6 years ago[ELF] - Eliminate dead code. NFC.
George Rimar [Thu, 19 Jul 2018 14:39:56 +0000 (14:39 +0000)]
[ELF] - Eliminate dead code. NFC.

Code was dead because we call postThunkContents only for SHT_SYMTAB.

llvm-svn: 337460

6 years agoELF: Replace the header-extension unit test with a lit one
Pavel Labath [Thu, 19 Jul 2018 14:38:30 +0000 (14:38 +0000)]
ELF: Replace the header-extension unit test with a lit one

The new test checks that we are actually able to read data from these
kinds of elf headers correctly instead of just that we read the section
number correctly. It is also easier to figure out what's going on in the
test.

llvm-svn: 337459

6 years ago[ELF] - One more test case for .eh_frame_hdr.
George Rimar [Thu, 19 Jul 2018 14:27:19 +0000 (14:27 +0000)]
[ELF] - One more test case for .eh_frame_hdr.

This is to test the following error message:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L544

Which occurs when LLD meets unsupported address encoding when scans
.eh_frame to build .eh_frame_hdr section.

llvm-svn: 337458

6 years ago[Docs] Testing Debug Info Preservation in Optimizations
Anastasis Grammenos [Thu, 19 Jul 2018 14:08:54 +0000 (14:08 +0000)]
[Docs] Testing Debug Info Preservation in Optimizations

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

llvm-svn: 337457

6 years ago[CodeGen] Disable aggressive structor optimizations at -O0, take 3
Pavel Labath [Thu, 19 Jul 2018 14:05:22 +0000 (14:05 +0000)]
[CodeGen] Disable aggressive structor optimizations at -O0, take 3

The previous version of this patch (r332839) was reverted because it was
causing "definition with same mangled name as another definition" errors
in some module builds. This was caused by an unrelated bug in module
importing which it exposed. The importing problem was fixed in r336240,
so this recommits the original patch (r332839).

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

llvm-svn: 337456

6 years ago[OpenMP][libomptarget] New map interface: remove translation code and ensure proper...
George Rokos [Thu, 19 Jul 2018 13:41:03 +0000 (13:41 +0000)]
[OpenMP][libomptarget] New map interface: remove translation code and ensure proper alignment of struct members

This patch removes the translation code since this functionality is now implemented in the compiler.
target_data_begin and target_data_end are also patched to handle some special cases that used to be
handled by the obsolete translation function, namely ensure proper alignment of struct members when
we have partially mapped structs. Mapping a struct from a higher address (i.e. not from its beginning)
can result in distortion of the alignment for some of its member fields. Padding restores the original
(proper) alignment.

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

llvm-svn: 337455

6 years agoEnable C++2a Chrono Literals
Erich Keane [Thu, 19 Jul 2018 13:36:57 +0000 (13:36 +0000)]
Enable C++2a Chrono Literals

C++2a via http://wg21.link/p0355 permits the library
literals of 'd' and 'y'. This patch enables them in the
Lexer so that they can be properly parsed.

Note that 'd' gets confused with the hex character, so
modifications to how octal, binary, and decimal numbers are
parsed were required. Since this is simply making previously
invalid code legal, this should be fine.

Hex still greedily parses the 'd' as a hexit, since it would
a: violate [lex.ext]p1
b: break existing code.

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

llvm-svn: 337454

6 years ago[CodeComplete] Fix accessibilty of protected members from base class.
Eric Liu [Thu, 19 Jul 2018 13:32:00 +0000 (13:32 +0000)]
[CodeComplete] Fix accessibilty of protected members from base class.

Summary:
Currently, protected members from base classes are marked as
inaccessible when completing in derived class. This patch fixes the problem by
setting the naming class correctly when looking up results in base class
according to [11.2.p5].

Reviewers: aaron.ballman, sammccall, rsmith

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 337453

6 years agoFix whitespace formatting in DWARFExpression::DumpLocation
Pavel Labath [Thu, 19 Jul 2018 13:30:56 +0000 (13:30 +0000)]
Fix whitespace formatting in DWARFExpression::DumpLocation

we were printing an extra space before the start for the expression and
an extra space after some dwarf operators. This makes sure we only print
exactly one space **between** operators and nowhere else.

llvm-svn: 337452

6 years agoNFC: Remove extraneous semicolons as pointed out in the differential review
Nemanja Ivanovic [Thu, 19 Jul 2018 12:49:27 +0000 (12:49 +0000)]
NFC: Remove extraneous semicolons as pointed out in the differential review

The commit for
https://reviews.llvm.org/D49424
missed the comment about the extraneous semicolons. Remove them.

llvm-svn: 337451

6 years agoARM: switch armv7em MachO triple to hard-float defaults and libcalls.
Tim Northover [Thu, 19 Jul 2018 12:44:51 +0000 (12:44 +0000)]
ARM: switch armv7em MachO triple to hard-float defaults and libcalls.

We were emitting incorrect calls to libm functions that LLVM had decided it
knew about because the default is soft-float.

Recommitted without breaking ELF this time.

llvm-svn: 337450