platform/upstream/llvm.git
7 years ago[driver][mips] Use AddTargetFeature to check arguments and add feature flags. NFC
Simon Atanasyan [Wed, 5 Jul 2017 12:57:37 +0000 (12:57 +0000)]
[driver][mips] Use AddTargetFeature to check arguments and add feature flags. NFC

llvm-svn: 307152

7 years ago[driver][mips] Remove redundant curly brackets. NFC
Simon Atanasyan [Wed, 5 Jul 2017 12:57:32 +0000 (12:57 +0000)]
[driver][mips] Remove redundant curly brackets. NFC

llvm-svn: 307151

7 years agoCMake: Add LLVM_UTILS_INSTALL_DIR option
Tom Stellard [Wed, 5 Jul 2017 12:57:30 +0000 (12:57 +0000)]
CMake: Add LLVM_UTILS_INSTALL_DIR option

Summary:
This is like the LLVM_TOOLS_INSTALL_DIR option, but for the utils
that are installed when the LLVM_INSTALL_UTILS.  This option
defaults to 'bin' to remain consistent with the current behavior, but
distros may want to install these to libexec/llvm.

Reviewers: beanz

Reviewed By: beanz

Subscribers: llvm-commits, mgorny

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

llvm-svn: 307150

7 years ago[GlobalISel] Refactor Legalizer helpers for libcalls
Diana Picus [Wed, 5 Jul 2017 12:57:24 +0000 (12:57 +0000)]
[GlobalISel] Refactor Legalizer helpers for libcalls

We used to have a helper that replaced an instruction with a libcall.
That turns out to be too aggressive, since sometimes we need to replace
the instruction with at least two libcalls. Therefore, change our
existing helper to only create the libcall and leave the instruction
removal as a separate step. Also rename the helper accordingly.

llvm-svn: 307149

7 years ago[AsmParser] Mnemonic Spell Corrector
Sjoerd Meijer [Wed, 5 Jul 2017 12:39:13 +0000 (12:39 +0000)]
[AsmParser] Mnemonic Spell Corrector

This implements suggesting other mnemonics when an invalid one is specified,
for example:

$ echo "adXd r1,r2,#3" | llvm-mc -triple arm
<stdin>:1:1: error: invalid instruction, did you mean: add, qadd?
adXd r1,r2,#3
^

The implementation is target agnostic, but as a first step I have added it only
to the ARM backend; so the ARM backend is a good example if someone wants to
enable this too for another target.

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

llvm-svn: 307148

7 years ago[clang-format] Fix an uninitialized memory access
Krasimir Georgiev [Wed, 5 Jul 2017 12:24:01 +0000 (12:24 +0000)]
[clang-format] Fix an uninitialized memory access

llvm-svn: 307147

7 years ago[globalisel][tablegen] Fix the misuse of STATISTICS() on release builds (like r307088...
Daniel Sanders [Wed, 5 Jul 2017 12:14:18 +0000 (12:14 +0000)]
[globalisel][tablegen] Fix the misuse of STATISTICS() on release builds (like r307088) after r307133.

r307133 brought back a couple instances of the same mistake that was already
fixed by r307088. Fixed it again.

Using NumPatternEmitted as a unique id for the tables is not valid on release
builds since the counters don't count in that case.

llvm-svn: 307146

7 years ago[ARM] GlobalISel: Extract tiny helper. NFC
Diana Picus [Wed, 5 Jul 2017 11:53:51 +0000 (11:53 +0000)]
[ARM] GlobalISel: Extract tiny helper. NFC

Extract functionality for determining if the target uses AEABI.

llvm-svn: 307145

7 years ago[MachineIRBuilder] Fix formatting. NFC.
Diana Picus [Wed, 5 Jul 2017 11:47:23 +0000 (11:47 +0000)]
[MachineIRBuilder] Fix formatting. NFC.

llvm-svn: 307144

7 years agoAdd const to reference arguments of Diagnostic ctor
Alexander Kornienko [Wed, 5 Jul 2017 11:45:09 +0000 (11:45 +0000)]
Add const to reference arguments of Diagnostic ctor

llvm-svn: 307143

7 years ago[GlobalISel][X86] For now don't handle not trivial function arguments lowering.
Igor Breger [Wed, 5 Jul 2017 11:40:35 +0000 (11:40 +0000)]
[GlobalISel][X86] For now don't handle not trivial function arguments lowering.

llvm-svn: 307142

7 years ago[MachineIRBuilder] Add buildOr helper. NFC.
Diana Picus [Wed, 5 Jul 2017 11:32:12 +0000 (11:32 +0000)]
[MachineIRBuilder] Add buildOr helper. NFC.

This isn't used anywhere yet, but I need it for a future commit.

llvm-svn: 307141

7 years ago[GlobalIsel] allow x86_fp80 values to be dumped.
Igor Breger [Wed, 5 Jul 2017 11:11:10 +0000 (11:11 +0000)]
[GlobalIsel] allow x86_fp80 values to be dumped.

Summary:
Otherwise the fallback path fails with an assertion on x86_64 targets,
when "x86_fp80" is encountered.

Reviewers: t.p.northover, zvi, guyblank

Reviewed By: zvi

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 307140

7 years ago[MachineIRBuilder] Add buildBinaryOp helper. NFC
Diana Picus [Wed, 5 Jul 2017 11:02:31 +0000 (11:02 +0000)]
[MachineIRBuilder] Add buildBinaryOp helper. NFC

Add a helper for building simple binary ops like add, mul, sub, and.
This can be used in the future for quickly adding support for or, xor.

llvm-svn: 307139

7 years ago[globalisel][tablegen] Fix an unused variable warning in release builds after r307133
Daniel Sanders [Wed, 5 Jul 2017 10:16:48 +0000 (10:16 +0000)]
[globalisel][tablegen] Fix an unused variable warning in release builds after r307133

llvm-svn: 307138

7 years ago[ELF] Fix Windows build error
Peter Smith [Wed, 5 Jul 2017 10:15:46 +0000 (10:15 +0000)]
[ELF] Fix Windows build error

Attempt to fix Windows buildbots From 307131 Replaced return {ET, false};
with return std::make_pair(ET, false);

llvm-svn: 307137

7 years ago[ELF] Allow multiple thunks to be added for a symbol.
Peter Smith [Wed, 5 Jul 2017 09:53:33 +0000 (09:53 +0000)]
[ELF] Allow multiple thunks to be added for a symbol.

This change permits there to be more than one thunk to be associated with
a symbol. For interworking thunks we only require one thunk, but range
extension thunks may require more than one.

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

llvm-svn: 307136

7 years agoRevert "[IndVars] Canonicalize comparisons between non-negative values and indvars"
Max Kazantsev [Wed, 5 Jul 2017 09:44:41 +0000 (09:44 +0000)]
Revert "[IndVars] Canonicalize comparisons between non-negative values and indvars"

This patch seems to cause failures of test MathExtras.SaturatingMultiply on
multiple buildbots. Reverting until the reason of that is clarified.

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

llvm-svn: 307135

7 years agoFix invalid warnings for header guards in preambles
Erik Verbruggen [Wed, 5 Jul 2017 09:44:07 +0000 (09:44 +0000)]
Fix invalid warnings for header guards in preambles

Fixes https://bugs.llvm.org/show_bug.cgi?id=33574

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

llvm-svn: 307134

7 years ago[globalisel][tablegen] Added instruction emission to the state-machine-based matcher.
Daniel Sanders [Wed, 5 Jul 2017 09:39:33 +0000 (09:39 +0000)]
[globalisel][tablegen] Added instruction emission to the state-machine-based matcher.

Summary:
This further improves the compile-time regressions that will be caused by a
re-commit of r303259.

Also added included preliminary work in preparation for the multi-insn emitter
since I needed to change the relevant part of the API for this patch anyway.

Depends on D33758

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

Reviewed By: ab

Subscribers: kristof.beyls, igorb, llvm-commits

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

llvm-svn: 307133

7 years ago[ELF] Introduce Thunk reuse compatibility
Peter Smith [Wed, 5 Jul 2017 09:36:03 +0000 (09:36 +0000)]
[ELF] Introduce Thunk reuse compatibility

On ARM the interworking thunks are only produced for branch instructions
that can't be changed into a blx instruction so only Thumb callers would
call Thumb thunks and only ARM callers would call ARM thunks. With range
extension thunks branch and link instructions may need a Thunk. These
instructions can be rewritten as a blx and can use either ARM or Thumb
thunks.

We introduce an isCompatibleWith() function so that a caller can check if
an existing Thunk is compatible before reusing it.

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

llvm-svn: 307132

7 years ago[ELF] Extract allocateHeaders() from assignAddresses()
Peter Smith [Wed, 5 Jul 2017 09:12:54 +0000 (09:12 +0000)]
[ELF] Extract allocateHeaders() from assignAddresses()

The allocateHeaders() function is called at the end of assignAddresses(), it
decides whether the ELF header and program header table can be allocated to
a PT_LOAD program header. As the function alters state, it prevents
assignAddresses() from being called multiple times.

This change splits out the call to allocateHeaders() from assignAddresses()
this will permit assignAddresses() to be called while processing range
extension thunks without trying to allocateHeaders().

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

llvm-svn: 307131

7 years ago[clang-tidy] Add "MakeSmartPtrFunction" option to modernize-make-shared/unique checks.
Haojian Wu [Wed, 5 Jul 2017 07:49:00 +0000 (07:49 +0000)]
[clang-tidy] Add "MakeSmartPtrFunction" option to modernize-make-shared/unique checks.

Reviewers: alexfh, aaron.ballman

Reviewed By: alexfh

Subscribers: JDevlieghere, Eugene.Zelenko, xazax.hun, cfe-commits

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

llvm-svn: 307130

7 years ago[modules ts] Improve merging of module-private declarations.
Richard Smith [Wed, 5 Jul 2017 07:47:11 +0000 (07:47 +0000)]
[modules ts] Improve merging of module-private declarations.

These cases occur frequently for declarations in the global module (above the
module-declaration) in a Modules TS module interface. When we merge a
definition from another module into such a module-private definition, ensure
that we transitively make everything lexically within that definition visible
to that translation unit.

llvm-svn: 307129

7 years ago[asan] Remove check for stack size
Jonas Hahnfeld [Wed, 5 Jul 2017 06:54:43 +0000 (06:54 +0000)]
[asan] Remove check for stack size

This has been introduced in r304598 and fails for increased stack sizes.

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

llvm-svn: 307127

7 years ago[IndVars] Canonicalize comparisons between non-negative values and indvars
Max Kazantsev [Wed, 5 Jul 2017 06:38:49 +0000 (06:38 +0000)]
[IndVars] Canonicalize comparisons between non-negative values and indvars

-If there is a IndVar which is known to be non-negative, and there is a value which is also non-negative,
then signed and unsigned comparisons between them produce the same result. Both of those can be
seen in the same loop. To allow other optimizations to simplify them, we turn all instructions like

  %c = icmp slt i32 %iv, %b
to

  %c = icmp ult i32 %iv, %b

if both %iv and %b are known to be non-negative.

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

llvm-svn: 307126

7 years ago[GlobalISel][X86] Allow graceful fallback for struct/array argument/return value...
Igor Breger [Wed, 5 Jul 2017 06:24:13 +0000 (06:24 +0000)]
[GlobalISel][X86] Allow graceful fallback for struct/array argument/return value lowering. Going to support it in follow patch.

llvm-svn: 307125

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Wed, 5 Jul 2017 05:43:31 +0000 (05:43 +0000)]
fix trivial typos in comments; NFC

llvm-svn: 307124

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Wed, 5 Jul 2017 05:37:45 +0000 (05:37 +0000)]
fix trivial typos in comments; NFC

llvm-svn: 307123

7 years agoAdd the missing triple to the test case added as part of r307120.
Nemanja Ivanovic [Wed, 5 Jul 2017 05:14:43 +0000 (05:14 +0000)]
Add the missing triple to the test case added as part of r307120.

llvm-svn: 307122

7 years ago[AMDGPU] Fix size and alignment of size_t and pointer types
Yaxun Liu [Wed, 5 Jul 2017 04:58:24 +0000 (04:58 +0000)]
[AMDGPU] Fix size and alignment of size_t and pointer types

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

llvm-svn: 307121

7 years ago[PowerPC] Fix for PR33636
Nemanja Ivanovic [Wed, 5 Jul 2017 04:51:29 +0000 (04:51 +0000)]
[PowerPC] Fix for PR33636

Remove casts to a constant when a node can be an undef.

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

llvm-svn: 307120

7 years agoFix equivalent test on OS X and FreeBSD
Eric Fiselier [Wed, 5 Jul 2017 03:54:38 +0000 (03:54 +0000)]
Fix equivalent test on OS X and FreeBSD

llvm-svn: 307119

7 years agoAdd dummy CMake target for *.pass.cpp tests when LIBCXX_CONFIGURE_IDE=ON.
Eric Fiselier [Wed, 5 Jul 2017 03:50:03 +0000 (03:50 +0000)]
Add dummy CMake target for *.pass.cpp tests when LIBCXX_CONFIGURE_IDE=ON.

In order for IDE's like CLion to correctly parse and highlight the tests
it needs to know roughly how to build them. This patch adds a dummy CMake target
for each/all of the .pass.cpp tests in the test suite to solve this problem.
The target is only created when LIBCXX_CONFIGURE_IDE=ON, so it shouldn't affect
most users.

Originally I wasn't sure that this change deserved to live upstream, but it's
quite frustrating to edit libc++ tests using CLion or Visual Studio without it,
in particular the filesystem tests which rely heavily on macros. Even though the change
should have no effect on non-IDE users/configurations I decided to commit it upstream
with the hopes it will benefit somebody other than me.

llvm-svn: 307118

7 years agoImplement LWG 2937 - equivalent("dne", "exists") is not an error
Eric Fiselier [Wed, 5 Jul 2017 03:37:05 +0000 (03:37 +0000)]
Implement LWG 2937 - equivalent("dne", "exists") is not an error

This patch speculatively implements the PR for LWG 2937, which fixes
two issues with equivalent.

(1) It makes equivalent("dne", "exists") an error. Previously only
    equivalent("dne", "dne") was an error and the former case was not (it returned false).
    Now equivalent reports an error when either input doesn't exist.

(2) It makes equivalent(p1, p2) well-formed when `is_other(p1) && is_other(p2)`.
    Previously this was an error, but there is seemingly no reason why it should be on POSIX system.

llvm-svn: 307117

7 years ago[Bash-autocompletion] Show flags which has HelpText or GroupID
Yuka Takahashi [Wed, 5 Jul 2017 02:36:32 +0000 (02:36 +0000)]
[Bash-autocompletion] Show flags which has HelpText or GroupID

Summary: Otherwise internal flags will be also completed.

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

llvm-svn: 307116

7 years ago[modules ts] Declarations from a module interface unit are only visible outside
Richard Smith [Wed, 5 Jul 2017 01:42:07 +0000 (01:42 +0000)]
[modules ts] Declarations from a module interface unit are only visible outside
the module if declared in an export block.

llvm-svn: 307115

7 years agoRewrite areNonVolatileConsecutiveLoads to use BaseIndexOffset
Nirav Dave [Wed, 5 Jul 2017 01:21:23 +0000 (01:21 +0000)]
Rewrite areNonVolatileConsecutiveLoads to use BaseIndexOffset

Relanding after rewriting undef.ll test to avoid host-dependant
endianness.

As discussed in D34087, rewrite areNonVolatileConsecutiveLoads using
generic checks. Also, propagate missing local handling from there to
BaseIndexOffset checks.

Tests of note:

  * test/CodeGen/X86/build-vector* - Improved.
  * test/CodeGen/BPF/undef.ll - Improved store alignment allows an
    additional store merge

  * test/CodeGen/X86/clear_upper_vector_element_bits.ll - This is a
    case we already do not handle well. Here, the DAG is improved, but
    scheduling causes a code size degradation.

Reviewers: RKSimon, craig.topper, spatel, andreadb, filcab

Subscribers: nemanjai, llvm-commits

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

llvm-svn: 307114

7 years ago[profiledata] Avoid creating a temporary vector in getNumValueData
Alexander Shaposhnikov [Wed, 5 Jul 2017 01:20:52 +0000 (01:20 +0000)]
[profiledata] Avoid creating a temporary vector in getNumValueData

getValueSitesForKind returns ArrayRef which has a cast operator
to std::vector, as a result a temporary vector is created
if the type of the variable is const std::vector&
that is suboptimal in this case.

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

Test plan: make check-all

llvm-svn: 307113

7 years ago[SafepointIRVerifier] Add verifier pass for finding GC relocation bugs
Anna Thomas [Wed, 5 Jul 2017 01:16:29 +0000 (01:16 +0000)]
[SafepointIRVerifier] Add verifier pass for finding GC relocation bugs

Original Patch and summary by Philip Reames.

RewriteStatepointsForGC tries to rewrite a function in a manner where
the optimizer can't end up using a pointer value after it might have
been relocated by a safepoint. This pass checks the invariant that
RSForGC is supposed to establish and that (if we constructed semantics
correctly) later passes must preserve.

This has been a really useful diagnostic tool when initially developing
the rewriting scheme and has found numerous bugs.

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

Reviewed by: swaroop.sridhar, mjacob

Subscribers: llvm-commits
llvm-svn: 307112

7 years agoRevert "[AVR] Add the branch selection pass from the GitHub repository"
Dylan McKay [Wed, 5 Jul 2017 00:50:56 +0000 (00:50 +0000)]
Revert "[AVR] Add the branch selection pass from the GitHub repository"

This reverts commit 602ef067c1d58ecb425d061f35f2bc4c7e92f4f3.

llvm-svn: 307111

7 years agoFix PR33635.
Rafael Espindola [Wed, 5 Jul 2017 00:43:18 +0000 (00:43 +0000)]
Fix PR33635.

This is a semantic revert of r306036.

We have to change the names, otherwise dynamic relocations will point
to the wrong name.

llvm-svn: 307110

7 years ago[AVR] Add the branch selection pass from the GitHub repository
Dylan McKay [Wed, 5 Jul 2017 00:41:19 +0000 (00:41 +0000)]
[AVR] Add the branch selection pass from the GitHub repository

We should rewrite this using the generic branch relaxation pass, but for
the moment having this pass is better than hitting an assertion error.

llvm-svn: 307109

7 years agoNFC.
Gadi Haber [Tue, 4 Jul 2017 21:51:05 +0000 (21:51 +0000)]
NFC.
Made some updates to the half.ll test under CodeGen to make it friendly to the update_llc_test_checks .py tool as follows:
1.Removing the llc flag -asm-verbose=false
2.Grouping the multiple check-prefix directives
3.Apply update_llc_test_checks.py tool on the test

This change is needed to easily update scheduling changes in an upcoming patch.

Reviewers: zvi, RKSimon, craig.topper

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

llvm-svn: 307108

7 years agoMove clearOutputSections earlier. NFC.
Rafael Espindola [Tue, 4 Jul 2017 21:05:26 +0000 (21:05 +0000)]
Move clearOutputSections earlier. NFC.

This is finally getting to the point where output sections are
constructed.

createOrphanCommands and fabricateDefaultCommands are moved out so
they can be merged with existing code in followup commits.

llvm-svn: 307107

7 years agoRecommit r307064, "[InstCombine] Add test cases demonstrating creation of extra bswap...
Craig Topper [Tue, 4 Jul 2017 20:15:24 +0000 (20:15 +0000)]
Recommit r307064, "[InstCombine] Add test cases demonstrating creation of extra bswap instrinsic calls when when optimizing bswap and bitwise ops when the bswaps have additional uses. NFC"

The test check lines have now been fixed.

llvm-svn: 307106

7 years ago[AMDGPU] Fix regressions on mesa/clover with libclc due to address space
Yaxun Liu [Tue, 4 Jul 2017 19:57:18 +0000 (19:57 +0000)]
[AMDGPU] Fix regressions on mesa/clover with libclc due to address space

Currently AMDGPUTargetInfo does not initialize AddrSpaceMap in constructor, which causes regressions in mesa/clover with libclc.

This patch fixes that.

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

llvm-svn: 307105

7 years agoEnable LLVM asan support for NetBSD/amd64
Kamil Rytarowski [Tue, 4 Jul 2017 19:55:56 +0000 (19:55 +0000)]
Enable LLVM asan support for NetBSD/amd64

Summary:
Enable LLVM asan sanitizer for NetBSD/amd64.

Don't generate -ldl for dlopen(3)-like functions on NetBSD.
These features are available in libc on NetBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, eugenis, kcc, dim

Reviewed By: dim

Subscribers: #clang, #sanitizers

Tags: #clang, #sanitizers

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

llvm-svn: 307104

7 years ago[ARM][test] Added test/CodeGen/ARM/ror.ll test. NFC precommit for D12833.
Andrew Zhogin [Tue, 4 Jul 2017 19:50:22 +0000 (19:50 +0000)]
[ARM][test] Added test/CodeGen/ARM/ror.ll test. NFC precommit for D12833.

llvm-svn: 307103

7 years agoMove clearOutputSections earlier. NFC.
Rafael Espindola [Tue, 4 Jul 2017 19:08:40 +0000 (19:08 +0000)]
Move clearOutputSections earlier. NFC.

Now addSectionSymbols operates on the linker script.

llvm-svn: 307102

7 years agoMove clearOutputSections earlier. NFC.
Rafael Espindola [Tue, 4 Jul 2017 19:05:03 +0000 (19:05 +0000)]
Move clearOutputSections earlier. NFC.

Now all of finalizeSections works on the linker script.

llvm-svn: 307101

7 years agoMove clearOutputSections earlier. NFC.
Rafael Espindola [Tue, 4 Jul 2017 18:26:21 +0000 (18:26 +0000)]
Move clearOutputSections earlier. NFC.

Now addPredefinedSections operates only on the linker script.

llvm-svn: 307100

7 years ago[X86][SSE4A] Add support for combining from non-v16i8 EXTRQI/INSERTQI shuffles
Simon Pilgrim [Tue, 4 Jul 2017 18:11:02 +0000 (18:11 +0000)]
[X86][SSE4A] Add support for combining from non-v16i8 EXTRQI/INSERTQI shuffles

With the improved shuffle decoding we can now combine EXTRQI/INSERTQI shuffles from non-v16i8 vector types

llvm-svn: 307099

7 years agoFix signed/unsigned comparison warnings
Simon Pilgrim [Tue, 4 Jul 2017 17:42:01 +0000 (17:42 +0000)]
Fix signed/unsigned comparison warnings

llvm-svn: 307098

7 years ago[AMDGPU] Switch scalarize global loads ON by default
Alexander Timofeev [Tue, 4 Jul 2017 17:32:00 +0000 (17:32 +0000)]
[AMDGPU] Switch scalarize global loads ON by default
Differential revision: https://reviews.llvm.org/D34407

llvm-svn: 307097

7 years ago[LoopDeletion] NFC: Add loop being analyzed debug statement
Anna Thomas [Tue, 4 Jul 2017 17:00:03 +0000 (17:00 +0000)]
[LoopDeletion] NFC: Add loop being analyzed debug statement

llvm-svn: 307096

7 years ago[X86][SSE4A] Generalized EXTRQI/INSERTQI shuffle decodes
Simon Pilgrim [Tue, 4 Jul 2017 16:53:12 +0000 (16:53 +0000)]
[X86][SSE4A] Generalized EXTRQI/INSERTQI shuffle decodes

The existing decodes only worked for v16i8 vectors, this adds support for any 128-bit vector

llvm-svn: 307095

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Tue, 4 Jul 2017 16:35:26 +0000 (16:35 +0000)]
fix trivial typos in comments; NFC

llvm-svn: 307094

7 years ago[globalisel][tablegen] Fix the modules build after r307079
Daniel Sanders [Tue, 4 Jul 2017 16:29:38 +0000 (16:29 +0000)]
[globalisel][tablegen] Fix the modules build after r307079

Exclude InstructionSelectorImpl.h since DEBUG_TYPE may vary between includes.

llvm-svn: 307093

7 years agoELF: Only unlink regular files
Tom Stellard [Tue, 4 Jul 2017 16:03:34 +0000 (16:03 +0000)]
ELF: Only unlink regular files

Summary:
If the output file is a character file (e.g. /dev/null) unlinking it could
potentially destabilize the user's system.  For example,
unlinking causes `lld %input -o /dev/null` to replace /dev/null with a
regular file, which will lead to unexpected behavior in other programs
that read from /dev/null, and worse than expected peformance for
programs that write to /dev/null.

This makes it possible to run the test-release.sh script as root.
Prior to this patch, the ELF/basic.s test would replace
/dev/null with a regular file, which would cause crashes in llvm
test-suite programs that piped /dev/null to stdin.

For example, if you run the test-relase.sh script as root,

Reviewers: ruiu

Reviewed By: ruiu

Subscribers: emaste, llvm-commits

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

llvm-svn: 307092

7 years ago[DAGCombiner] Intermediate variables in visitRotate promoted to the function's begin...
Andrew Zhogin [Tue, 4 Jul 2017 15:57:39 +0000 (15:57 +0000)]
[DAGCombiner] Intermediate variables in visitRotate promoted to the function's begin. NFC precommit for D12833.

llvm-svn: 307091

7 years agoBump isl to isl-0.18-768-g033b61ae
Tobias Grosser [Tue, 4 Jul 2017 15:54:11 +0000 (15:54 +0000)]
Bump isl to isl-0.18-768-g033b61ae

Summary: This is a general maintenance update

Reviewers: grosser

Subscribers: srhines, fedor.sergeev, pollydev, llvm-commits

Contributed-by: Maximilian Falkenstein <falkensm@student.ethz.ch>
Differential Revision: https://reviews.llvm.org/D34903

llvm-svn: 307090

7 years agoImprove error message.
Rafael Espindola [Tue, 4 Jul 2017 15:53:57 +0000 (15:53 +0000)]
Improve error message.

Before we would sometimes not mention that the relocation was in a ro
area before.

llvm-svn: 307089

7 years ago[globalisel][tablegen] Fix release builds after r307079
Daniel Sanders [Tue, 4 Jul 2017 15:31:50 +0000 (15:31 +0000)]
[globalisel][tablegen] Fix release builds after r307079

Using NumPatternEmitted as a unique id for the tables is not valid on release
builds since the counters don't count in that case.

Also fix an unused variable warning.

llvm-svn: 307088

7 years agoclang-format: [JS] space between pseudo keywords and template literals.
Martin Probst [Tue, 4 Jul 2017 15:30:21 +0000 (15:30 +0000)]
clang-format: [JS] space between pseudo keywords and template literals.

Summary:
Before:
  yield`foo`;

After:
  yield `foo`;

This reinstates commit 71d3b5cd91 / r307023 and fixes the logic by
introducing an explicit table of JavaScript pseudo keywords.

Reviewers: djasper

Subscribers: klimek

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

llvm-svn: 307087

7 years ago[FastISel] Move gc intrinsic test to X86 directory
Anna Thomas [Tue, 4 Jul 2017 15:24:08 +0000 (15:24 +0000)]
[FastISel] Move gc intrinsic test to X86 directory

Move from generic to X86 directory since gc intrinsics only supposed in
X86 64 bit.
Add target triple as well.
Fixes build failure in i686-linux-RA  caused by rL307084.

llvm-svn: 307086

7 years agoFix dangling StringRefs found by clang-tidy misc-dangling-handle check.
Alexander Kornienko [Tue, 4 Jul 2017 15:13:02 +0000 (15:13 +0000)]
Fix dangling StringRefs found by clang-tidy misc-dangling-handle check.

llvm-svn: 307085

7 years ago[FastISel][SelectionDAG]Teach fastISel about GC intrinsics
Anna Thomas [Tue, 4 Jul 2017 15:09:09 +0000 (15:09 +0000)]
[FastISel][SelectionDAG]Teach fastISel about GC intrinsics

Summary:
We are crashing in LLC at O0 when gc intrinsics are present in the block.
The reason being FastISel performs basic block ISel by modifying GC.relocates
to be the first instruction in the block. This can cause us to visit the GC
relocate before it's corresponding GC.statepoint is visited, which is incorrect.
When we lower the statepoint, we record the base and derived pointers, along
with the gc.relocates. After this we can visit the gc.relocate.

This patch avoids fastISel from incorrectly creating the block with gc.relocate
as the first instruction.

Reviewers: qcolombet, skatkov, qikon, reames

Reviewed by: skatkov

Subscribers: llvm-commits

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

llvm-svn: 307084

7 years ago[ELF] Do not use `this` to access members of non-template class. NFC
Simon Atanasyan [Tue, 4 Jul 2017 15:04:30 +0000 (15:04 +0000)]
[ELF] Do not use `this` to access members of non-template class. NFC

llvm-svn: 307083

7 years agoMake the test more strict.
Rafael Espindola [Tue, 4 Jul 2017 14:59:28 +0000 (14:59 +0000)]
Make the test more strict.

We now don't produce "has undefined version" errors when producing
binaries even when there is a linker script.

llvm-svn: 307082

7 years ago[AMDGPU] Fix latency of MIMG instructions
Marek Olsak [Tue, 4 Jul 2017 14:43:38 +0000 (14:43 +0000)]
[AMDGPU] Fix latency of MIMG instructions

Patch by cwabbott (Connor Abbott).

llvm-svn: 307081

7 years agoNFC. Removed mention of missing script from build_docker_image.sh.
Ilya Biryukov [Tue, 4 Jul 2017 14:41:21 +0000 (14:41 +0000)]
NFC. Removed mention of missing script from build_docker_image.sh.

llvm-svn: 307080

7 years ago[globalisel][tablegen] Partially fix compile-time regressions by converting matcher...
Daniel Sanders [Tue, 4 Jul 2017 14:35:06 +0000 (14:35 +0000)]
[globalisel][tablegen] Partially fix compile-time regressions by converting matcher to state-machine(s)

Summary:
Replace the matcher if-statements for each rule with a state-machine. This
significantly reduces compile time, memory allocations, and cumulative memory
allocation when compiling AArch64InstructionSelector.cpp.o after r303259 is
recommitted.

The following patches will expand on this further to fully fix the regressions.

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

Reviewed By: ab

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

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

llvm-svn: 307079

7 years ago[LoopDeletion] NFC: Add debug statements to the optimization
Anna Thomas [Tue, 4 Jul 2017 14:05:19 +0000 (14:05 +0000)]
[LoopDeletion] NFC: Add debug statements to the optimization

We have a DEBUG option for loop deletion, but no related debug messages.
Added some debug messages to state why loop deletion failed.

llvm-svn: 307078

7 years ago[ELF] - Resolve references properly when using .symver directive
George Rimar [Tue, 4 Jul 2017 13:19:13 +0000 (13:19 +0000)]
[ELF] - Resolve references properly when using .symver directive

This is PR28414.
Previously LLD was unable to link following:
(failed with undefined symbol bar)

Version script:
SOME_VERSION { global: *; };

.global _start
.global bar
.symver _start, bar@@SOME_VERSION
_start:
  jmp bar
Manual has next description:

.symver name, name2@@nodename
In this case, the symbol name must exist and be defined within the file being assembled. It is similar to name2@nodename.
The difference is name2@@nodename will also be used to resolve references to name2 by the linker
https://sourceware.org/binutils/docs/as/Symver.html

Patch implements that. If we have name@@ver symbol and name is undefined, name@@ver is used to resolve references to name.
If name is defined then multiple definition error is emited, that is consistent with what bfd do.

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

llvm-svn: 307077

7 years ago[ELF] - Use llvm::find_if instead std::find_if where possible. NFC.
George Rimar [Tue, 4 Jul 2017 13:10:37 +0000 (13:10 +0000)]
[ELF] - Use llvm::find_if instead std::find_if where possible. NFC.

Two more places.

llvm-svn: 307076

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Tue, 4 Jul 2017 13:09:29 +0000 (13:09 +0000)]
fix trivial typos in comments; NFC

llvm-svn: 307075

7 years ago[index] Index nested name qualifiers in a forward declaration of a
Alex Lorenz [Tue, 4 Jul 2017 12:50:53 +0000 (12:50 +0000)]
[index] Index nested name qualifiers in a forward declaration of a
class template specialization

rdar://33122110

llvm-svn: 307074

7 years ago[X86] Add combine tests for vector rotates
Simon Pilgrim [Tue, 4 Jul 2017 12:33:53 +0000 (12:33 +0000)]
[X86] Add combine tests for vector rotates

Reference tests for D12833

llvm-svn: 307073

7 years agoUpdate lldb architecture docs
Pavel Labath [Tue, 4 Jul 2017 12:29:34 +0000 (12:29 +0000)]
Update lldb architecture docs

Summary:
Due to recent refactors, the descriptions of various modules were wildly
out of date. With this patch, I am not trying to legislate anything,
I am merely documenting the current state of affairs.

I am also deleting one copy of the architecture docs. AFAIK, this one is
not referenced from the web page.

Reviewers: zturner, jingham

Subscribers: lldb-commits

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

llvm-svn: 307072

7 years agoFix some warnings in ProcessorTraceTest.cpp
Pavel Labath [Tue, 4 Jul 2017 12:29:30 +0000 (12:29 +0000)]
Fix some warnings in ProcessorTraceTest.cpp

llvm-svn: 307071

7 years agoRevert r307064, "[InstCombine] Add test cases demonstrating creation of extra bswap...
NAKAMURA Takumi [Tue, 4 Jul 2017 12:13:27 +0000 (12:13 +0000)]
Revert r307064, "[InstCombine] Add test cases demonstrating creation of extra bswap instrinsic calls when when optimizing bswap and bitwise ops when the bswaps have additional uses. NFC"

Seems confused between %tmpN and unnamed %N to give same name.

llvm-svn: 307070

7 years agollvm/ExecutionEngine/Orc/ObjectTransformLayer.h: Add <memory> to appease libstdc...
NAKAMURA Takumi [Tue, 4 Jul 2017 12:12:37 +0000 (12:12 +0000)]
llvm/ExecutionEngine/Orc/ObjectTransformLayer.h: Add <memory> to appease libstdc++'s std::shared_ptr.

llvm-svn: 307069

7 years agoClangdServer.cpp: Suppress a warning. [-Wunused-lambda-capture]
NAKAMURA Takumi [Tue, 4 Jul 2017 12:12:14 +0000 (12:12 +0000)]
ClangdServer.cpp: Suppress a warning. [-Wunused-lambda-capture]

llvm-svn: 307068

7 years ago[OpenCL] Rename err_opencl_enqueue_kernel_expected_type
Joey Gouly [Tue, 4 Jul 2017 11:50:23 +0000 (11:50 +0000)]
[OpenCL] Rename err_opencl_enqueue_kernel_expected_type

Rename err_opencl_enqueue_kernel_expected_type so that other builtins
can use the same diagnostic.

https://reviews.llvm.org/D34948

llvm-svn: 307067

7 years agoNFC commit.
Gadi Haber [Tue, 4 Jul 2017 07:18:03 +0000 (07:18 +0000)]
NFC commit.
 Converting the Codegen test "extractelement-legalization-store-ordering.ll" to be "update_llc_test_checks" friendly.

The changes to the test are needed for an upcoming scheduling patch.

Reviewers: zvi, RKSimon

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

llvm-svn: 307066

7 years ago[InstCombine] Add TODOs for a couple things that should maybe be in InstSimplify...
Craig Topper [Tue, 4 Jul 2017 06:50:48 +0000 (06:50 +0000)]
[InstCombine] Add TODOs for a couple things that should maybe be in InstSimplify instead. NFC

llvm-svn: 307065

7 years ago[InstCombine] Add test cases demonstrating creation of extra bswap instrinsic calls...
Craig Topper [Tue, 4 Jul 2017 06:50:44 +0000 (06:50 +0000)]
[InstCombine] Add test cases demonstrating creation of extra bswap instrinsic calls when when optimizing bswap and bitwise ops when the bswaps have additional uses. NFC

I assume bswap intrinsics are somewhat costly so we should be making sure we are getting rid of them not creating more.

llvm-svn: 307064

7 years ago[tablegen] Avoid creating a temporary vector in getInstructionCase
Alexander Shaposhnikov [Tue, 4 Jul 2017 06:16:53 +0000 (06:16 +0000)]
[tablegen] Avoid creating a temporary vector in getInstructionCase

Record::getValues returns ArrayRef which has a cast operator
to std::vector, as a result a temporary vector is created
if the type of the variable is const std::vector&
that is suboptimal in this case.

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

Test plan: make check-all

llvm-svn: 307063

7 years ago[X86] Add comment string for broadcast loads from the constant pool.
Craig Topper [Tue, 4 Jul 2017 05:46:11 +0000 (05:46 +0000)]
[X86] Add comment string for broadcast loads from the constant pool.

Summary:
When broadcasting from the constant pool its useful to print out the final vector similar to what we do for normal moves from the constant pool.

I changed only a couple tests that were broadcast focused. One of them had been previously hand tweaked after running the script so that it could check the constant pool declaration. But I think this patch makes that unnecessary now since we can check the comment instead.

Reviewers: spatel, RKSimon, zvi

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 307062

7 years ago[llvm] Revert "[tablegen] Avoid creating a temporary vector in getInstructionCase"
Alexander Shaposhnikov [Tue, 4 Jul 2017 05:37:37 +0000 (05:37 +0000)]
[llvm] Revert "[tablegen] Avoid creating a temporary vector in getInstructionCase"

Revert rL307059 because of the incorrect commit message & patch,
will recommit later.

llvm-svn: 307061

7 years ago[X86] Add RDRAND feature to GLM CPU
Craig Topper [Tue, 4 Jul 2017 05:33:19 +0000 (05:33 +0000)]
[X86] Add RDRAND feature to GLM CPU

Summary: I believe this should be supported on GLM since RDSEED is.

Reviewers: m_zuckerman, zvi, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 307060

7 years ago[tablegen] Avoid creating a temporary vector in getInstructionCase
Alexander Shaposhnikov [Tue, 4 Jul 2017 05:11:30 +0000 (05:11 +0000)]
[tablegen] Avoid creating a temporary vector in getInstructionCase

Record::getValues returns ArrayRef which has a cast operator
to std::vector, as a result a temporary vector is created
if the type of the variable is const std::vector&
that was suboptimal in this case.

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

Test plan: make check-all

llvm-svn: 307059

7 years ago[Orc] Remove the memory manager argument to addModule, and de-templatize the
Lang Hames [Tue, 4 Jul 2017 04:42:30 +0000 (04:42 +0000)]
[Orc] Remove the memory manager argument to addModule, and de-templatize the
symbol resolver argument.

De-templatizing the symbol resolver is part of the ongoing simplification of
ORC layer API.

Removing the memory management argument (and delegating construction of memory
managers for RTDyldObjectLinkingLayer to a functor passed in to the constructor)
allows us to build JITs whose base object layers need not be compatible with
RTDyldObjectLinkingLayer's memory mangement scheme. For example, a 'remote
object layer' that sends fully relocatable objects directly to the remote does
not need a memory management scheme at all (that will be handled by the remote).

llvm-svn: 307058

7 years ago[AVR] Fix bug which caused assertion errors for some FRMIDX instructions
Dylan McKay [Tue, 4 Jul 2017 04:40:06 +0000 (04:40 +0000)]
[AVR] Fix bug which caused assertion errors for some FRMIDX instructions

Previously, if a basic block ended with a FRMIDX instruction, we would
end up doing something like this.

*std::next(MBB.end())

Which would hit an error:

"Assertion `!NodePtr->isKnownSentinel()' failed."

llvm-svn: 307057

7 years ago[AVR] Add a missing clobber declaration to LPMW
Dylan McKay [Tue, 4 Jul 2017 02:52:43 +0000 (02:52 +0000)]
[AVR] Add a missing clobber declaration to LPMW

llvm-svn: 307056

7 years ago[DAG] Fixed predicate for determining when two frame indices
Nirav Dave [Tue, 4 Jul 2017 02:20:17 +0000 (02:20 +0000)]
[DAG] Fixed predicate for determining when two frame indices
addresses are comparable. NFCI.

llvm-svn: 307055

7 years agoRevert r307026, "[AMDGPU] Switch scalarize global loads ON by default"
NAKAMURA Takumi [Tue, 4 Jul 2017 02:14:18 +0000 (02:14 +0000)]
Revert r307026, "[AMDGPU] Switch scalarize global loads ON by default"

It broke a testcase.

  Failing Tests (1):
      LLVM :: CodeGen/AMDGPU/alignbit-pat.ll

llvm-svn: 307054

7 years ago[legalize-types] Clean up softening machinery.
Anton Yartsev [Tue, 4 Jul 2017 01:08:55 +0000 (01:08 +0000)]
[legalize-types] Clean up softening machinery.

The patch makes SoftenFloatResult/Operand logic just the same as all other legalization routines have: SoftenFloatResult() now fills the SoftenFloats map and SoftenFloatOperand() perform all needed replacements. This prevents softening mashinery from leaving stale entries in SoftenFloats map (that resulted in errors during the legalize type checking) and clarifies softening. The patch replaces https://reviews.llvm.org/D29265.

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

llvm-svn: 307053

7 years ago[CodeGen] Check key function for typeinfo import
Shoaib Meenai [Tue, 4 Jul 2017 01:02:19 +0000 (01:02 +0000)]
[CodeGen] Check key function for typeinfo import

If the imported class does not have a key function, we should emit its
typeinfo locally instead of attempting to import it.

llvm-svn: 307052