platform/upstream/llvm.git
6 years ago[ASAN] Use the correct shadow offset for ASAN on FreeBSD/mips64.
John Baldwin [Wed, 1 Aug 2018 22:51:13 +0000 (22:51 +0000)]
[ASAN] Use the correct shadow offset for ASAN on FreeBSD/mips64.

Reviewed By: atanasyan

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

llvm-svn: 338650

6 years ago[ORC] Add a 'Callable' flag to JITSymbolFlags.
Lang Hames [Wed, 1 Aug 2018 22:42:23 +0000 (22:42 +0000)]
[ORC] Add a 'Callable' flag to JITSymbolFlags.

The callable flag can be used to indicate that a symbol is callable. If present,
the symbol is callable. If absent, the symbol may or may not be callable (the
client must determine this by context, for example by examining the program
representation that will provide the symbol definition).

This flag will be used in the near future to enable creation of lazy compilation
stubs based on SymbolFlagsMap instances only (without having to provide
additional information to determine which symbols need stubs).

llvm-svn: 338649

6 years ago[AST] Remove the static_assert check in ObjCMethodDecl::ObjCMethodDecl
Vlad Tsyrklevich [Wed, 1 Aug 2018 22:41:03 +0000 (22:41 +0000)]
[AST] Remove the static_assert check in ObjCMethodDecl::ObjCMethodDecl

Summary:
This check was introduced by r338641
but this broke some builds. For now remove it.

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 338648

6 years agoRe-submit r338596 with a bug fix and a test.
Rui Ueyama [Wed, 1 Aug 2018 22:31:31 +0000 (22:31 +0000)]
Re-submit r338596 with a bug fix and a test.

llvm-svn: 338647

6 years ago[ScopBuilder] Set domain to empty instead of NULL.
Michael Kruse [Wed, 1 Aug 2018 22:28:32 +0000 (22:28 +0000)]
[ScopBuilder] Set domain to empty instead of NULL.

The domain generation used nullptr to mark the domain of an error block
as never-executed. Later, nullptr domains are recreated with a
zero-tuple domain that then mismatches with the expected domain the
error block within the loop.

Instead of using nullptr, assign an empty domain which preserves the
expected space. Remove empty domains during SCoP simplification.

Fixes llvm.org/PR38218.

llvm-svn: 338646

6 years agoFix -Wcovered-switch-default uncovered after r338630
Reid Kleckner [Wed, 1 Aug 2018 22:10:03 +0000 (22:10 +0000)]
Fix -Wcovered-switch-default uncovered after r338630

llvm-svn: 338643

6 years agoUpdate for DWARF API change
Reid Kleckner [Wed, 1 Aug 2018 21:57:15 +0000 (21:57 +0000)]
Update for DWARF API change

llvm-svn: 338642

6 years ago[AST][4/4] Move the bit-fields from ObjCMethodDecl and ObjCContainerDecl into DeclContext
Erich Keane [Wed, 1 Aug 2018 21:31:08 +0000 (21:31 +0000)]
[AST][4/4] Move the bit-fields from ObjCMethodDecl and ObjCContainerDecl into DeclContext

This patch follows https://reviews.llvm.org/D49729,
https://reviews.llvm.org/D49732 and
https://reviews.llvm.org/D49733.

Move the bits from ObjCMethodDecl and ObjCContainerDecl
into DeclContext.

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

Patch By: bricci

llvm-svn: 338641

6 years ago[NFC][CodeGenCXX] Use -emit-llvm-only instead of -emit-llvm and ignoring it.
Roman Lebedev [Wed, 1 Aug 2018 21:20:58 +0000 (21:20 +0000)]
[NFC][CodeGenCXX] Use -emit-llvm-only instead of -emit-llvm and ignoring it.

As pointed out by Richard Smith in post-review of r338489.

llvm-svn: 338640

6 years ago[AST][3/4] Move the bit-fields from BlockDecl, LinkageSpecDecl and OMPDeclareReductio...
Erich Keane [Wed, 1 Aug 2018 21:16:54 +0000 (21:16 +0000)]
[AST][3/4] Move the bit-fields from BlockDecl, LinkageSpecDecl and OMPDeclareReductionDecl into DeclContext

This patch follows https://reviews.llvm.org/D49729
and https://reviews.llvm.org/D49732, and is
followed by https://reviews.llvm.org/D49734.

Move the bits from BlockDecl, LinkageSpecDecl and
OMPDeclareReductionDecl into DeclContext.

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

Patch By: bricci

llvm-svn: 338639

6 years ago[DWARFASTParser] Remove special cases for `llvm-gcc`
Davide Italiano [Wed, 1 Aug 2018 21:13:45 +0000 (21:13 +0000)]
[DWARFASTParser] Remove special cases for `llvm-gcc`

Reviewed by: aprantl, labath.

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

llvm-svn: 338638

6 years agoFix out-of-bounds read in Stream::PutCStringAsRawHex8
Raphael Isemann [Wed, 1 Aug 2018 21:07:18 +0000 (21:07 +0000)]
Fix out-of-bounds read in Stream::PutCStringAsRawHex8

Summary:
When I added the Stream unit test (r338488), the build bots failed due to an out-of-
bound reads when passing an empty string to the PutCStringAsRawHex8 method.
In r338491 I removed the test case to fix the bots.

This patch fixes this in PutCStringAsRawHex8 by always checking for the terminating
null character in the given string (instead of skipping it the first time). It also re-adds the
test case I removed.

Reviewers: vsk

Reviewed By: vsk

Subscribers: vsk, lldb-commits

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

llvm-svn: 338637

6 years ago[AST][2/4] Move the bit-fields from FunctionDecl and CXXConstructorDecl into DeclContext
Erich Keane [Wed, 1 Aug 2018 21:02:40 +0000 (21:02 +0000)]
[AST][2/4] Move the bit-fields from FunctionDecl and CXXConstructorDecl into DeclContext

This patch follows https://reviews.llvm.org/D49729
and is followed by https://reviews.llvm.org/D49733
and https://reviews.llvm.org/D49734.

Move the bits from FunctionDecl and CXXConstructorDecl
into DeclContext.

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

Patch By: bricci

llvm-svn: 338636

6 years ago[llvm-objcopy] Add missing -I command line flag alias for --input-target
Jordan Rupprecht [Wed, 1 Aug 2018 20:59:39 +0000 (20:59 +0000)]
[llvm-objcopy] Add missing -I command line flag alias for --input-target

llvm-svn: 338635

6 years ago[DebugInfo/DWARF] [4/4] Unify handling of compile and type units. NFC
Paul Robinson [Wed, 1 Aug 2018 20:54:11 +0000 (20:54 +0000)]
[DebugInfo/DWARF] [4/4] Unify handling of compile and type units. NFC

This is patch 4 of 4 NFC refactorings to handle type units and compile
units more consistently and with less concern about the object-file
section that they came from.

Patch 4 combines separate DWARFUnitVectors for compile and type units
into a single DWARFUnitVector that contains both.  For now the
implementation distinguishes compile units from type units by putting
all compile units at the front of the vector, reflecting the DWARF v4
distinction between .debug_info and .debug_types sections.  A future
patch will change this to allow the free mixing of unit kinds, as is
specified by DWARF v5.

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

llvm-svn: 338633

6 years ago[DebugInfo/DWARF] [3/4] Rename DWARFUnitSection to DWARFUnitVector. NFC
Paul Robinson [Wed, 1 Aug 2018 20:49:44 +0000 (20:49 +0000)]
[DebugInfo/DWARF] [3/4] Rename DWARFUnitSection to DWARFUnitVector. NFC

This is patch 3 of 4 NFC refactorings to handle type units and compile
units more consistently and with less concern about the object-file
section that they came from.

Patch 3 simply renames DWARFUnitSection to DWARFUnitVector, as the
object-file section of a unit is nearly irrelevant now.

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

llvm-svn: 338632

6 years agoAMDGPU: Use SPseudoInst helper
Matt Arsenault [Wed, 1 Aug 2018 20:49:00 +0000 (20:49 +0000)]
AMDGPU: Use SPseudoInst helper

llvm-svn: 338631

6 years ago[AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext
Erich Keane [Wed, 1 Aug 2018 20:48:16 +0000 (20:48 +0000)]
[AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

DeclContext has a little less than 8 bytes free due to the alignment
requirements on 64 bits archs. This set of patches moves the
bit-fields from classes deriving from DeclContext into DeclContext.

On 32 bits archs this increases the size of DeclContext by 4 bytes
but this is balanced by an equal or larger reduction in the size
of the classes deriving from it.

On 64 bits archs the size of DeclContext stays the same but
most of the classes deriving from it shrink by 8/16 bytes.
(-print-stats diff here https://reviews.llvm.org/D49728)
When doing an -fsyntax-only on all of Boost this result
in a 3.6% reduction in the size of all Decls and
a 1% reduction in the run time due to the lower cache
miss rate.

For now CXXRecordDecl is not touched but there is
an easy 6 (if I count correctly) bytes gain available there
by moving some bits from DefinitionData into the free
space of DeclContext. This will be the subject of another patch.

This patch sequence also enable the possibility of refactoring
FunctionDecl: To save space some bits from classes deriving from
FunctionDecl were moved to FunctionDecl. This resulted in a
lot of stuff in FunctionDecl which do not belong logically to it.
After this set of patches however it is just a simple matter of
adding a SomethingDeclBitfields in DeclContext and moving the
bits to it from FunctionDecl.

This first patch introduces the anonymous union in DeclContext
and all the *DeclBitfields classes holding the bit-fields, and moves
the bits from TagDecl, EnumDecl and RecordDecl into DeclContext.

This patch is followed by https://reviews.llvm.org/D49732,
https://reviews.llvm.org/D49733 and https://reviews.llvm.org/D49734.

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

Patch By: bricci

llvm-svn: 338630

6 years ago[DebugInfo/DWARF] [2/4] Type units no longer in a std::deque. NFC
Paul Robinson [Wed, 1 Aug 2018 20:46:46 +0000 (20:46 +0000)]
[DebugInfo/DWARF] [2/4] Type units no longer in a std::deque. NFC

This is patch 2 of 4 NFC refactorings to handle type units and compile
units more consistently and with less concern about the object-file
section that they came from.

Patch 2 takes the existing std::deque<DWARFUnitSection> for type units
and makes it a simple DWARFUnitSection, simplifying the handling of
type units and making it more consistent with compile units.

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

llvm-svn: 338629

6 years ago[DebugInfo/DWARF] [1/4] De-templatize DWARFUnitSection. NFC
Paul Robinson [Wed, 1 Aug 2018 20:43:47 +0000 (20:43 +0000)]
[DebugInfo/DWARF] [1/4] De-templatize DWARFUnitSection. NFC

This is patch 1 of 4 NFC refactorings to handle type units and compile
units more consistently and with less concern about the object-file
section that they came from.

Patch 1 replaces the templated DWARFUnitSection with a non-templated
version. That is, instead of being a SmallVector of pointers to a
specific unit kind, it is not a SmallVector of pointers to the base
class for both type and compile units.  Virtual methods are magic.

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

llvm-svn: 338628

6 years ago[test] Fix %hmaptool path for standalone builds
Michal Gorny [Wed, 1 Aug 2018 20:38:22 +0000 (20:38 +0000)]
[test] Fix %hmaptool path for standalone builds

Fix %hmaptool path to refer to clang_tools_dir instead of
llvm_tools_dir, in order to fix standalone builds.  The tool is built
as part of clang, so it won't be found in installed LLVM tools.

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

llvm-svn: 338627

6 years agoAMDGPU: Improve hack for packing conversion ops
Matt Arsenault [Wed, 1 Aug 2018 20:13:58 +0000 (20:13 +0000)]
AMDGPU: Improve hack for packing conversion ops

Mutate the node type during selection when it
doesn't matter. This avoids an intermediate bitcast
node on targets with legal i16/f16.

Also fixes missing output modifiers on v_cvt_pkrtz_f32_f16,
which I assume are OK.

llvm-svn: 338619

6 years agoAMDGPU: Partially fix handling of packed amdgpu_ps arguments
Matt Arsenault [Wed, 1 Aug 2018 19:57:34 +0000 (19:57 +0000)]
AMDGPU: Partially fix handling of packed amdgpu_ps arguments

Fixes annoying limitations when writing tests.
Also remove more leftover code for manually scalarizing arguments
and return values.

llvm-svn: 338618

6 years ago[WebAssembly] Support for a ternary atomic RMW instruction
Heejin Ahn [Wed, 1 Aug 2018 19:40:28 +0000 (19:40 +0000)]
[WebAssembly] Support for a ternary atomic RMW instruction

Summary: This adds support for a ternary atomic RMW instruction: cmpxchg.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 338617

6 years ago[DEBUGINFO] Disable emission of the dwarf sections, but allow directives.
Alexey Bataev [Wed, 1 Aug 2018 19:38:20 +0000 (19:38 +0000)]
[DEBUGINFO] Disable emission of the dwarf sections, but allow directives.

Summary:
Added an option that allows to emit only '.loc' and '.file' kind debug
directives, but disables emission of the DWARF sections. Required for
NVPTX target to support profiling. It requires '.loc' and '.file'
directives, but does not require any DWARF sections for the profiler.

Reviewers: probinson, echristo, dblaikie

Subscribers: aprantl, JDevlieghere, llvm-commits

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

llvm-svn: 338616

6 years agolld-link: Remove /msvclto option
Nico Weber [Wed, 1 Aug 2018 19:00:49 +0000 (19:00 +0000)]
lld-link: Remove /msvclto option

This was useful for LTO bringup in lld-link while lld couldn't write PDBs. Now
that it can, this should no longer be needed. Hopefully the flag is obscure
enough and recent enough, that nobody uses it – but if somebody should use it,
they should be able to just stop passing it and things should continue to work.

https://reviews.llvm.org/D50139

llvm-svn: 338615

6 years agoTry to fix FreeBSD build.
Zachary Turner [Wed, 1 Aug 2018 18:44:12 +0000 (18:44 +0000)]
Try to fix FreeBSD build.

It seems like perhaps because cstdio isn't directly included, the
compiler is accidentally picking up wprintf from somewhere else
and trying to call that.  Hopefully this fixes it.

llvm-svn: 338614

6 years ago[X86] Canonicalize the pattern for __builtin_ffs in a similar way to '__builtin_ffs...
Craig Topper [Wed, 1 Aug 2018 18:38:46 +0000 (18:38 +0000)]
[X86] Canonicalize the pattern for __builtin_ffs in a similar way to '__builtin_ffs + 5'

We now emit a move of -1 before the cmov and do the addition after the cmov just like the case with an extra addition.

This may be slightly worse for code size, but is more consistent with other compilers. And we might be able to hoist the mov -1 outside of loops.

llvm-svn: 338613

6 years ago[X86] Add test cases for the patterns used by __builtin_ffs.
Craig Topper [Wed, 1 Aug 2018 18:38:43 +0000 (18:38 +0000)]
[X86] Add test cases for the patterns used by __builtin_ffs.

We previously had tests for "__builtin_ffs + 5", but the SelectinoDAG without an extra addition came out slightly different.

llvm-svn: 338612

6 years agoFixed documentation for PutHex8 [NFC]
Raphael Isemann [Wed, 1 Aug 2018 18:38:19 +0000 (18:38 +0000)]
Fixed documentation for PutHex8 [NFC]

The previous documentation was just copied from PrintfAsRawHex8
but doesn't actually fit to the PutHex8 method.

llvm-svn: 338611

6 years agoAMDGPU/R600: Convert kernel param loads to use PARAM_I_ADDRESS
Jan Vesely [Wed, 1 Aug 2018 18:36:07 +0000 (18:36 +0000)]
AMDGPU/R600: Convert kernel param loads to use PARAM_I_ADDRESS

Non ext aligned i32 loads are still optimized to use CONSTANT_BUFFER (AS 8)

llvm-svn: 338610

6 years ago[llvm-undname Add an option to dump back references.
Zachary Turner [Wed, 1 Aug 2018 18:33:04 +0000 (18:33 +0000)]
[llvm-undname Add an option to dump back references.

This is useful for understanding how our demangler processes
back references and for investigating issues related to
back references.  But it's a feature only useful for debugging
the demangling process itself, so I'm marking it hidden.

llvm-svn: 338609

6 years ago[MS Demangler] Properly demangle templated operators.
Zachary Turner [Wed, 1 Aug 2018 18:32:47 +0000 (18:32 +0000)]
[MS Demangler] Properly demangle templated operators.

After we detected the presence of a template via ?$ we would proceed by
only demangling a simple unqualified name. This means we would fail on
templated operators (and perhaps other yet-to-be-determined things)

This was discovered while doing some refactoring to store richer
semantic information about the demangled types to pave the way for
overhauling the way we handle backreferences. (Specifically, we need to
defer recording or resolving back-references until a symbol has been
completely demangled, because we need to use information that only
occurs later in the mangled string to decide whether a back-reference
should be recorded.)

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

llvm-svn: 338608

6 years ago[MS Demangler] Don't crash as often when demangling.
Zachary Turner [Wed, 1 Aug 2018 18:32:28 +0000 (18:32 +0000)]
[MS Demangler] Don't crash as often when demangling.

We crash a lot on unrecognized inputs.  This adds some error
handling so we early out when we get unrecognized names.

llvm-svn: 338607

6 years agoFix sizeof(struct pthread) in glibc 2.14.
Kostya Serebryany [Wed, 1 Aug 2018 18:29:51 +0000 (18:29 +0000)]
Fix sizeof(struct pthread) in glibc 2.14.

Summary: Fixes: https://github.com/google/sanitizers/issues/966

Reviewers: kcc

Reviewed By: kcc

Subscribers: kubamracek

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

llvm-svn: 338606

6 years agoRemove outdated documentation for Stream's LEB128 methods
Raphael Isemann [Wed, 1 Aug 2018 18:28:54 +0000 (18:28 +0000)]
Remove outdated documentation for Stream's LEB128 methods

There is no format parameter for any of these methods.

llvm-svn: 338605

6 years ago[NFC] small addendum to r334242, FMF propagation
Michael Berg [Wed, 1 Aug 2018 18:06:49 +0000 (18:06 +0000)]
[NFC] small addendum to r334242, FMF propagation

llvm-svn: 338604

6 years ago[Android] Increase default new alignment for Android
Pirama Arumuga Nainar [Wed, 1 Aug 2018 17:55:34 +0000 (17:55 +0000)]
[Android] Increase default new alignment for Android

Summary:
Android's memory allocators also guarantee 8-byte alignment for 32-bit
architectures and 16-byte alignment for 64-bit.

Reviewers: rsmith

Subscribers: cfe-commits, srhines, enh

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

llvm-svn: 338603

6 years agoRevert r338455 "[constexpr] Support for constant evaluation of __builtin_memcpy and...
Hans Wennborg [Wed, 1 Aug 2018 17:51:23 +0000 (17:51 +0000)]
Revert r338455 "[constexpr] Support for constant evaluation of __builtin_memcpy and __builtin_memmove (in non-type-punning cases)."

It caused asserts during Chromium builds, see reply on the cfe-commits thread.

> This is intended to permit libc++ to make std::copy etc constexpr
> without sacrificing the optimization that uses memcpy on
> trivially-copyable types.
>
> __builtin_strcpy and __builtin_wcscpy are not handled by this change.
> They'd be straightforward to add, but we haven't encountered a need for
> them just yet.

llvm-svn: 338602

6 years agoRevert r338596: Simplify. NFC.
Rui Ueyama [Wed, 1 Aug 2018 17:50:09 +0000 (17:50 +0000)]
Revert r338596: Simplify. NFC.

This reverts commit r338596 because it contained a functional change.
The patch accidentally replaced StringRef::startswith with the exact match.

llvm-svn: 338600

6 years ago[X86] FastISel fall back on !absolute_symbol GVs
Vlad Tsyrklevich [Wed, 1 Aug 2018 17:44:37 +0000 (17:44 +0000)]
[X86] FastISel fall back on !absolute_symbol GVs

Summary:
D25878, which added support for !absolute_symbol for normal X86 ISel,
did not add support for materializing references to absolute symbols for
X86 FastISel. This causes build failures because FastISel generates
PC-relative relocations for absolute symbols. Fall back to normal ISel
for references to !absolute_symbol GVs. Fix for PR38200.

Reviewers: pcc, craig.topper

Reviewed By: pcc

Subscribers: hiraditya, llvm-commits, kcc

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

llvm-svn: 338599

6 years ago[X86] Assign from a brace initializer to match style guide. NFCI.
Simon Pilgrim [Wed, 1 Aug 2018 17:43:38 +0000 (17:43 +0000)]
[X86] Assign from a brace initializer to match style guide. NFCI.

llvm-svn: 338598

6 years ago[clangd] allow clients to control the compilation database by passing in
Alex Lorenz [Wed, 1 Aug 2018 17:39:29 +0000 (17:39 +0000)]
[clangd] allow clients to control the compilation database by passing in
compilationDatabaseChanges in the 'workspace/didChangeConfiguration' request

This commit allows clangd to use an in-memory compilation database that's
controlled from the LSP client (-compile_args_from=lsp). It extends the
'workspace/didChangeConfiguration' request to allow the client to pass in a
compilation database subset that needs to be updated in the workspace.

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

llvm-svn: 338597

6 years agoSimplify. NFC.
Rui Ueyama [Wed, 1 Aug 2018 17:33:00 +0000 (17:33 +0000)]
Simplify. NFC.

llvm-svn: 338596

6 years ago[llvm-mca][x86] Add CMPXCHG instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 17:25:11 +0000 (17:25 +0000)]
[llvm-mca][x86] Add CMPXCHG instruction resource tests

I've put CMPXCHG8B/CMPXCHG16B in the same file, even though technically they are under separate CPUID bits all targets seem to support both (or neither).

llvm-svn: 338595

6 years agoIntroduce install-lldb-framework target
Alex Langford [Wed, 1 Aug 2018 17:21:18 +0000 (17:21 +0000)]
Introduce install-lldb-framework target

Summary:
Previously, I thought that install-liblldb would fail because CMake had
a bug related to installing frameworks. In actuality, I misunderstood the
semantics of `add_custom_target`: the DEPENDS option refers to specific files,
not targets. Therefore `install-liblldb` should rely on the actual liblldb
getting generated rather than the target.

This means that the previous patch I committed (to stop relying on CMake's
framework support) is no longer needed and has been reverted. Using CMake's
framework support greatly simplifies the implementation.

`install-lldb-framework` (and the stripped variant) is as simple as
depending on `install-liblldb` because CMake knows that liblldb was built as a
framework and will install the whole framework for you. The stripped variant
will depend on the stripped variants of individual tools only to ensure they
actually are stripped as well.

Reviewers: labath, sas

Subscribers: mgorny, lldb-commits

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

llvm-svn: 338594

6 years ago[x86] remove stale FIXME note from test; NFC
Sanjay Patel [Wed, 1 Aug 2018 17:18:50 +0000 (17:18 +0000)]
[x86] remove stale FIXME note from test; NFC

This was fixed with rL338592.

llvm-svn: 338593

6 years ago[SelectionDAG] fix bug in translating funnel shift with non-power-of-2 type
Sanjay Patel [Wed, 1 Aug 2018 17:17:08 +0000 (17:17 +0000)]
[SelectionDAG] fix bug in translating funnel shift with non-power-of-2 type

The bug is visible in the constant-folded x86 tests. We can't use the
negated shift amount when the type is not power-of-2:
https://rise4fun.com/Alive/US1r

...so in that case, use the regular lowering that includes a select
to guard against a shift-by-bitwidth. This path is improved by only
calculating the modulo shift amount once now.

Also, improve the rotate (with power-of-2 size) lowering to use
a negate rather than subtract from bitwidth. This improves the
codegen whether we have a rotate instruction or not (although
we can still see that we're not matching to a legal rotate in
all cases).

llvm-svn: 338592

6 years agoDon't ignore byte_order in Stream::PutMaxHex64
Raphael Isemann [Wed, 1 Aug 2018 17:12:58 +0000 (17:12 +0000)]
Don't ignore byte_order in Stream::PutMaxHex64

Reviewers: labath

Reviewed By: labath

Subscribers: zturner, lldb-commits

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

llvm-svn: 338591

6 years ago[StackFrame] Add doxygen comments to the StackFrameList API (NFC)
Vedant Kumar [Wed, 1 Aug 2018 17:08:11 +0000 (17:08 +0000)]
[StackFrame] Add doxygen comments to the StackFrameList API (NFC)

Clarify how StackFrameList works by documenting its methods. Also,
delete some dead code and insert some TODOs.

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

llvm-svn: 338590

6 years ago[StackFrame] Use early returns in ResetCurrentInlinedDepth (NFC)
Vedant Kumar [Wed, 1 Aug 2018 17:07:56 +0000 (17:07 +0000)]
[StackFrame] Use early returns in ResetCurrentInlinedDepth (NFC)

Using early returns in this function substantially reduces the nesting
level, making the logic easier to understand.

llvm-svn: 338589

6 years ago[StackFrame] Factor GetOnlyConcreteFramesUpTo out of GetFramesUpTo (NFC)
Vedant Kumar [Wed, 1 Aug 2018 17:07:40 +0000 (17:07 +0000)]
[StackFrame] Factor GetOnlyConcreteFramesUpTo out of GetFramesUpTo (NFC)

Splitting GetOnlyConcreteFramesUpTo will make it easier to implement
support for synthetic tail call frames in backtraces. This is just a
prep change, no functionality is affected.

llvm-svn: 338588

6 years ago[x86] add tests to show miscompile for funnel shift with weird size; NFC
Sanjay Patel [Wed, 1 Aug 2018 16:59:54 +0000 (16:59 +0000)]
[x86] add tests to show miscompile for funnel shift with weird size; NFC

llvm-svn: 338587

6 years ago[SelectionDAG] Make binop reduction matcher available to all targets
Simon Pilgrim [Wed, 1 Aug 2018 16:52:28 +0000 (16:52 +0000)]
[SelectionDAG] Make binop reduction matcher available to all targets

There is nothing x86-specific about this code, so it'd be nice to make this available for other targets to use in the future (and get it out of X86ISelLowering!).

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

llvm-svn: 338586

6 years ago[NFC][FunctionAttrs] Remove duplication in old/new PM pipeline
Johannes Doerfert [Wed, 1 Aug 2018 16:37:51 +0000 (16:37 +0000)]
[NFC][FunctionAttrs] Remove duplication in old/new PM pipeline

This patch just extract code into a separate function to remove some
duplication between the old and new pass manager pipeline. Due to the
different CGSCC iterators used, not all code duplication was eliminated.

llvm-svn: 338585

6 years ago[llvm-mca][x86] Add PREFETCHW instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 16:34:39 +0000 (16:34 +0000)]
[llvm-mca][x86] Add PREFETCHW instruction resource tests

These aren't just available via 3DNow! so test for them separately as well.

llvm-svn: 338584

6 years ago[llvm-mca][x86] Add PCLMUL instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 16:25:50 +0000 (16:25 +0000)]
[llvm-mca][x86] Add PCLMUL instruction resource tests

Renamed the btver2 file that already contained them - the other targets were only testing the AVX versions

llvm-svn: 338583

6 years ago[llvm-objcopy] Add support for --rename-section flags from gnu objcopy
Jordan Rupprecht [Wed, 1 Aug 2018 16:23:22 +0000 (16:23 +0000)]
[llvm-objcopy] Add support for --rename-section flags from gnu objcopy

Summary:
Add support for --rename-section flags from gnu objcopy.

Not all flags appear to have an effect for ELF objects, but allowing them would allow easier drop-in replacement. Other unrecognized flags are rejected.

This was only tested by comparing flags printed by "readelf -e <.o>" against the output of gnu vs llvm objcopy, it hasn't been tested to be valid beyond that.

Reviewers: jakehehrlich, alexshap

Subscribers: llvm-commits, paulsemel, alexshap

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

llvm-svn: 338582

6 years ago[OMPT,tests] Fix taskloop testcase scheduling effects
Joachim Protze [Wed, 1 Aug 2018 16:15:18 +0000 (16:15 +0000)]
[OMPT,tests] Fix taskloop testcase scheduling effects

The taskloop testcase had scheduling effects. Tasks of the taskloop would
sometimes be scheduled before all task were created. The testing is now
split into two phases. First, the task creation on the master is tested,
than the scheduling events of the tasks are tested. Thus, the order of
creation and scheduling events is irrelavant.

Patch by Simon Convent

Reviewed by: protze.joachim, Hahnfeld

Subscribers: openmp-commits

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

llvm-svn: 338580

6 years ago[llvm-mca] Correctly update the rank in `Scheduler::select()`.
Andrea Di Biagio [Wed, 1 Aug 2018 16:06:33 +0000 (16:06 +0000)]
[llvm-mca] Correctly update the rank in `Scheduler::select()`.

Found by inspection.

llvm-svn: 338579

6 years ago[Format] Fix for bug 35641
Ilya Biryukov [Wed, 1 Aug 2018 15:32:56 +0000 (15:32 +0000)]
[Format] Fix for bug 35641

Summary:
Bug was caused due to comments at the start of scope. For a code like:
```
int func() { //
  int b;
  int c;
}
```
the comment at the first line gets IndentAndNestingLevel (1,1) whereas
the following declarations get only (0,1) which prevents them from insertion
of a new scope. So, I changed the AlignTokenSequence to look at previous
*non-comment* token when deciding whether to introduce a new scope into
stack or not.

Patch by Kadir Cetinkaya!

Reviewers: rsmith, djasper

Reviewed By: djasper

Subscribers: lebedev.ri, cfe-commits, klimek

Tags: #clang

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

llvm-svn: 338578

6 years agoAdd missing condition
Filipe Cabecinhas [Wed, 1 Aug 2018 15:30:14 +0000 (15:30 +0000)]
Add missing condition

llvm-svn: 338577

6 years ago[llvm-mca][x86] Add SET/TEST instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 15:29:47 +0000 (15:29 +0000)]
[llvm-mca][x86] Add SET/TEST instruction resource tests

llvm-svn: 338576

6 years agoBump version number to 8.0.0svn
Hans Wennborg [Wed, 1 Aug 2018 15:22:27 +0000 (15:22 +0000)]
Bump version number to 8.0.0svn

llvm-svn: 338570

6 years agoAMDGPU: Allow fp32-denormals feature for r600 targets
Jan Vesely [Wed, 1 Aug 2018 15:04:36 +0000 (15:04 +0000)]
AMDGPU: Allow fp32-denormals feature for r600 targets

This was accidentally removed in r335942.

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

llvm-svn: 338569

6 years ago[ARM] Armv8.2-A FP16 vector intrinsics tests
Sjoerd Meijer [Wed, 1 Aug 2018 14:43:59 +0000 (14:43 +0000)]
[ARM] Armv8.2-A FP16 vector intrinsics tests

Clang support for the Armv8.2-A FP16 vector intrinsic was committed in
rC328277, but this was never followed up, i.e. the LLVM part is missing.

I've raised PR38404, and this is the first step to address this. I.e.,
this adds tests for the Armv8.2-A FP16 vector intrinsic, and thus shows
which intrinsics already work, and which need further work.

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

llvm-svn: 338568

6 years ago[llvm-exegesis] Provide a way to handle memory instructions.
Guillaume Chatelet [Wed, 1 Aug 2018 14:41:45 +0000 (14:41 +0000)]
[llvm-exegesis] Provide a way to handle memory instructions.

Summary:
And implement memory instructions on X86.

This fixes PR36906.

Reviewers: gchatelet

Reviewed By: gchatelet

Subscribers: lebedev.ri, filcab, mgorny, tschuett, RKSimon, llvm-commits

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

llvm-svn: 338567

6 years ago[UnrollAndJam] Add unroll_and_jam pragma handling
David Green [Wed, 1 Aug 2018 14:36:12 +0000 (14:36 +0000)]
[UnrollAndJam] Add unroll_and_jam pragma handling

This adds support for the unroll_and_jam pragma, to go with the recently
added unroll and jam pass. The name of the pragma is the same as is used
in the Intel compiler, and most of the code works the same as for unroll.

#pragma clang loop unroll_and_jam has been separated into a different
patch. This part adds #pragma unroll_and_jam with an optional count, and
#pragma no_unroll_and_jam to disable the transform.

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

llvm-svn: 338566

6 years ago[llvm-mca][x86] Add LEA instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 14:25:33 +0000 (14:25 +0000)]
[llvm-mca][x86] Add LEA instruction resource tests

We already added these to btver2, now add them to other targets, even though none of their models treat them specially (yet).

llvm-svn: 338565

6 years agoUpdate version to 8.0.0svn
Hans Wennborg [Wed, 1 Aug 2018 14:25:03 +0000 (14:25 +0000)]
Update version to 8.0.0svn

llvm-svn: 338564

6 years ago[llvm-mca][x86] Add more x86-64 system instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 14:18:09 +0000 (14:18 +0000)]
[llvm-mca][x86] Add more x86-64 system instruction resource tests

CPUID, IN/OUT, INS/OUTS, INT, PAUSE, SCAS, UD2, XLAT

llvm-svn: 338563

6 years ago[FPEnv] Widen illegal width StrictFP vector operations as needed
Cameron McInally [Wed, 1 Aug 2018 14:17:19 +0000 (14:17 +0000)]
[FPEnv] Widen illegal width StrictFP vector operations as needed

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

llvm-svn: 338562

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:14:09 +0000 (14:14 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338561

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:11:32 +0000 (14:11 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338560

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:09:00 +0000 (14:09 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338559

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:07:20 +0000 (14:07 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338558

6 years agoUpdate docs version and clear release notes after 8.0.0 version bump
Hans Wennborg [Wed, 1 Aug 2018 14:01:27 +0000 (14:01 +0000)]
Update docs version and clear release notes after 8.0.0 version bump

llvm-svn: 338557

6 years agoClear release notes and update version
Hans Wennborg [Wed, 1 Aug 2018 13:58:00 +0000 (13:58 +0000)]
Clear release notes and update version

llvm-svn: 338556

6 years agoUpdate version to 8.0.0svn: cmake, includes files and docs
Hans Wennborg [Wed, 1 Aug 2018 13:54:28 +0000 (13:54 +0000)]
Update version to 8.0.0svn: cmake, includes files and docs

llvm-svn: 338555

6 years ago[AArch64] Fix FCCMP with FP16 operands
Bryan Chan [Wed, 1 Aug 2018 13:50:29 +0000 (13:50 +0000)]
[AArch64] Fix FCCMP with FP16 operands

Summary: This patch adds support for FCCMP instruction with FP16 operands, avoiding an assertion during instruction selection.

Reviewers: olista01, SjoerdMeijer, t.p.northover, javed.absar

Reviewed By: SjoerdMeijer

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 338554

6 years agoUse a dummy target so the test passes when default target is for a toolchain implemen...
Filipe Cabecinhas [Wed, 1 Aug 2018 13:41:42 +0000 (13:41 +0000)]
Use a dummy target so the test passes when default target is for a toolchain implements useIntegratedAs() -> true

llvm-svn: 338553

6 years agoAdd REQUIRES: native to a test that assumes it
Filipe Cabecinhas [Wed, 1 Aug 2018 13:41:11 +0000 (13:41 +0000)]
Add REQUIRES: native to a test that assumes it

llvm-svn: 338552

6 years ago[NFC] Silence warning about ptr-to-func to ptr-to-obj cast in clang-fuzzer/handle...
Andrei Elovikov [Wed, 1 Aug 2018 13:34:18 +0000 (13:34 +0000)]
[NFC] Silence warning about ptr-to-func to ptr-to-obj cast in clang-fuzzer/handle-llvm/handle_llvm.cpp.

Summary:
I don't have the whole list of GCC binaries available so I determined the exact
version where the warning disappeared via:

https://github.com/gcc-mirror/gcc/blob/gcc-4_9_0-release/gcc/cp/typeck.c#L6863
https://github.com/gcc-mirror/gcc/blob/gcc-4_8_5-release/gcc/cp/typeck.c#L6652

Reviewers: emmettneyman, erichkeane

Reviewed By: emmettneyman, erichkeane

Subscribers: cfe-commits

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

llvm-svn: 338551

6 years ago[llvm-mca][x86] Add CLFLUSHOPT instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 13:34:17 +0000 (13:34 +0000)]
[llvm-mca][x86] Add CLFLUSHOPT instruction resource tests

llvm-svn: 338550

6 years agoBump the trunk version to 8.0.0svn
Hans Wennborg [Wed, 1 Aug 2018 13:25:30 +0000 (13:25 +0000)]
Bump the trunk version to 8.0.0svn

llvm-svn: 338537

6 years ago[dsymutil] Convert recursion in lookForDIEsToKeep into worklist.
Jonas Devlieghere [Wed, 1 Aug 2018 13:24:39 +0000 (13:24 +0000)]
[dsymutil] Convert recursion in lookForDIEsToKeep into worklist.

The functions `lookForDIEsToKeep` and `keepDIEAndDependencies` can have
some very deep recursion. This tackles part of this problem by removing
the recursion from `lookForDIEsToKeep` by turning it into a worklist.

The difficulty in doing so is the computation of incompleteness, which
depends on the incompleteness of its children. To compute this, we
insert "continuation markers" into the worklist. This informs the work
loop to (re)compute the incompleteness property of the DIE associated
with it (i.e. the parent of the previously processed DIE).

This patch should generate byte-identical output. Unfortunately it also
has some impact of performance, regressing by about 4% when processing
clang on my machine.

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

llvm-svn: 338536

6 years agoTest: Enable exceptions for test that needs it
Filipe Cabecinhas [Wed, 1 Aug 2018 13:20:38 +0000 (13:20 +0000)]
Test: Enable exceptions for test that needs it

llvm-svn: 338535

6 years agoMake test/Frontend/clang-abi-compat.cpp pass when the version goes to 8
Hans Wennborg [Wed, 1 Aug 2018 13:19:14 +0000 (13:19 +0000)]
Make test/Frontend/clang-abi-compat.cpp pass when the version goes to 8

llvm-svn: 338534

6 years agoTest Commit
Owen Reynolds [Wed, 1 Aug 2018 13:16:48 +0000 (13:16 +0000)]
Test Commit

Removal of extra line

llvm-svn: 338533

6 years ago[llvm-mca][x86] Add CMPS/LODS/MOVS/STOS string instruction resource tests
Simon Pilgrim [Wed, 1 Aug 2018 13:14:45 +0000 (13:14 +0000)]
[llvm-mca][x86] Add CMPS/LODS/MOVS/STOS string instruction resource tests

llvm-svn: 338532

6 years ago[libc++] Fix GCC 7.2.0 macro redefinition warning
Louis Dionne [Wed, 1 Aug 2018 13:13:14 +0000 (13:13 +0000)]
[libc++] Fix GCC 7.2.0 macro redefinition warning

The warning happens when LIBCXX_ENABLE_EXCEPTIONS cmake option is not set,
and it fires every time __config is included, 33 in total.

Patch by Jason Lovett
Reviewed as https://reviews.llvm.org/D49997

llvm-svn: 338531

6 years ago[X86] Use isNullConstant helper. NFCI.
Simon Pilgrim [Wed, 1 Aug 2018 13:06:14 +0000 (13:06 +0000)]
[X86] Use isNullConstant helper. NFCI.

llvm-svn: 338530

6 years agoFix "not all control paths return a value" MSVC warning.
Simon Pilgrim [Wed, 1 Aug 2018 13:00:11 +0000 (13:00 +0000)]
Fix "not all control paths return a value" MSVC warning.

llvm-svn: 338529

6 years agoUserManual: Update with the latest clang-cl flags
Hans Wennborg [Wed, 1 Aug 2018 12:58:57 +0000 (12:58 +0000)]
UserManual: Update with the latest clang-cl flags

llvm-svn: 338528

6 years ago[MC] Report fatal error for DWARF types for non-ELF object files
Jonas Devlieghere [Wed, 1 Aug 2018 12:53:06 +0000 (12:53 +0000)]
[MC] Report fatal error for DWARF types for non-ELF object files

Getting the DWARF types section is only implemented for ELF object
files. We already disabled emitting debug types in clang (r337717), but
now we also report an fatal error (rather than crashing) when trying to
obtain this section in MC. Additionally we ignore the generate debug
types flag for unsupported target triples.

See PR38190 for more information.

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

llvm-svn: 338527

6 years ago[clangd] Correct the namespace of ParsedAST forward declaration, NFC.
Haojian Wu [Wed, 1 Aug 2018 12:50:44 +0000 (12:50 +0000)]
[clangd] Correct the namespace of ParsedAST forward declaration, NFC.

llvm-svn: 338526

6 years ago[AArch64][ARM] Add Armv8.4-A tests
Sjoerd Meijer [Wed, 1 Aug 2018 12:41:10 +0000 (12:41 +0000)]
[AArch64][ARM] Add Armv8.4-A tests

This adds tests for Armv8.4-A, and also some v8.2 and v8.3 tests that were
missing.

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

llvm-svn: 338525

6 years ago[clang-format] Add some text proto functions to Google style
Krasimir Georgiev [Wed, 1 Aug 2018 12:35:23 +0000 (12:35 +0000)]
[clang-format] Add some text proto functions to Google style

Summary: Adds 2 functions taking a text proto argument.

Reviewers: djasper, klimek

Reviewed By: djasper

Subscribers: acoomans, cfe-commits

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

llvm-svn: 338524

6 years ago[AMDGPU] Optimize _L image intrinsic to _LZ when lod is zero
Ryan Taylor [Wed, 1 Aug 2018 12:12:01 +0000 (12:12 +0000)]
[AMDGPU] Optimize _L image intrinsic to _LZ when lod is zero

Summary:
Add _L to _LZ image intrinsic table mapping to table gen.
In ISelLowering check if image intrinsic has lod and if it's equal
to zero, if so remove lod and change opcode to equivalent mapped _LZ.

Change-Id: Ie24cd7e788e2195d846c7bd256151178cbb9ec71

Subscribers: arsenm, mehdi_amini, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 338523

6 years agoFix build bot after r338521
Ulrich Weigand [Wed, 1 Aug 2018 12:07:32 +0000 (12:07 +0000)]
Fix build bot after r338521

llvm-svn: 338522