platform/upstream/llvm.git
7 years ago[OPENMP] Do not capture private variables in the target regions.
Alexey Bataev [Thu, 7 Dec 2017 19:49:28 +0000 (19:49 +0000)]
[OPENMP] Do not capture private variables in the target regions.

Private variables are completely redefined in the outlined regions, so
we don't need to capture them. Patch adds this behavior to the
target-based regions.

llvm-svn: 320078

7 years agoThese tests don't depend on debug info format.
Jim Ingham [Thu, 7 Dec 2017 19:44:09 +0000 (19:44 +0000)]
These tests don't depend on debug info format.

Mark them as such.

llvm-svn: 320077

7 years agoRevert "Temporarily pin tests to DWARF v2 until a more recent version of LLDB"
Adrian Prantl [Thu, 7 Dec 2017 19:40:31 +0000 (19:40 +0000)]
Revert "Temporarily pin tests to DWARF v2 until a more recent version of LLDB"

This reverts commit 319790.

We worked around the bug in LLVM instead.

llvm-svn: 320076

7 years agoupdate hwasan docs
Kostya Serebryany [Thu, 7 Dec 2017 19:21:30 +0000 (19:21 +0000)]
update hwasan docs

Summary:
* use more readable name
* document the hwasan attribute

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, cfe-commits

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

llvm-svn: 320075

7 years ago[clangd-fuzzer] Update contruction of LSPServer.
Matt Morehouse [Thu, 7 Dec 2017 19:04:27 +0000 (19:04 +0000)]
[clangd-fuzzer] Update contruction of LSPServer.

The constructor for ClangdLSPServer changed in r318412 and r318925,
breaking the clangd-fuzzer build.

llvm-svn: 320074

7 years ago[driver] Set the 'simulator' environment for Darwin when compiling for
Alex Lorenz [Thu, 7 Dec 2017 19:04:10 +0000 (19:04 +0000)]
[driver] Set the 'simulator' environment for Darwin when compiling for
iOS/tvOS/watchOS simulator

rdar://35135215

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

llvm-svn: 320073

7 years agoFurther simplify .gnu.hash writing. NFC.
Rafael Espindola [Thu, 7 Dec 2017 18:59:29 +0000 (18:59 +0000)]
Further simplify .gnu.hash writing. NFC.

llvm-svn: 320072

7 years agoDisable warnings related to anonymous types in the ObjC plugin
Vedant Kumar [Thu, 7 Dec 2017 18:57:09 +0000 (18:57 +0000)]
Disable warnings related to anonymous types in the ObjC plugin

This part of lldb make use of anonymous structs and unions. The usage is
idiomatic and doesn't deserve a warning. Logic in the NSDictionary and NSSet
plugins use anonymous structs in a manner consistent with the relevant Apple
frameworks.

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

llvm-svn: 320071

7 years agoSimplify .gnu.hash writing. NFC.
Rafael Espindola [Thu, 7 Dec 2017 18:51:19 +0000 (18:51 +0000)]
Simplify .gnu.hash writing. NFC.

llvm-svn: 320070

7 years agoAvoid using a temporary std::vector.
Rafael Espindola [Thu, 7 Dec 2017 18:46:03 +0000 (18:46 +0000)]
Avoid using a temporary std::vector.

With this memory usage when linking clang goes from 174.62MB to
172.77MB.

llvm-svn: 320069

7 years ago[InstCombine] add tests for abs using bit hackery; NFC
Sanjay Patel [Thu, 7 Dec 2017 18:13:33 +0000 (18:13 +0000)]
[InstCombine] add tests for abs using bit hackery; NFC

llvm-svn: 320068

7 years ago[SBBreakpointOptionCommon] Give this class an explicit destructor.
Davide Italiano [Thu, 7 Dec 2017 18:06:06 +0000 (18:06 +0000)]
[SBBreakpointOptionCommon] Give this class an explicit destructor.

llvm-svn: 320067

7 years ago[SBBreakpoint] Outline some functions to prevent to be exported.
Davide Italiano [Thu, 7 Dec 2017 18:06:06 +0000 (18:06 +0000)]
[SBBreakpoint] Outline some functions to prevent to be exported.

They're hidden, so all they cause is a linker warning.

ld: warning: cannot export hidden symbol
lldb::SBBreakpointNameImpl::operator==(lldb::SBBreakpointNameImpl const&) from
tools/lldb/source/API/CMakeFiles/liblldb.dir/SBBreakpointName.cpp.o

llvm-svn: 320066

7 years ago[X86] Replace tabs with spaces. NFCI.
Simon Pilgrim [Thu, 7 Dec 2017 17:55:19 +0000 (17:55 +0000)]
[X86] Replace tabs with spaces. NFCI.

llvm-svn: 320065

7 years ago[X86] Tag BMI/BMI2/TBM instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 17:37:39 +0000 (17:37 +0000)]
[X86] Tag BMI/BMI2/TBM instructions scheduler classes

Put these under UNARY/BINOP ALU itinerary classes for now - seems to be a good average value

llvm-svn: 320064

7 years ago[Hexagon] Generate HVX code for basic arithmetic operations
Krzysztof Parzyszek [Thu, 7 Dec 2017 17:37:28 +0000 (17:37 +0000)]
[Hexagon] Generate HVX code for basic arithmetic operations

Handle and, or, xor, add, sub, mul for vectors of i8, i16, and i32.

llvm-svn: 320063

7 years ago[X86][TBM] Add TBM scheduling tests
Simon Pilgrim [Thu, 7 Dec 2017 17:23:00 +0000 (17:23 +0000)]
[X86][TBM] Add TBM scheduling tests

llvm-svn: 320062

7 years ago[CodeGen] Fix index when printing tied machine operands
Francis Visoiu Mistrih [Thu, 7 Dec 2017 17:12:30 +0000 (17:12 +0000)]
[CodeGen] Fix index when printing tied machine operands

llvm-svn: 320061

7 years ago[Target] Remove commented out code. Found by inspection. NFCI.
Davide Italiano [Thu, 7 Dec 2017 17:05:56 +0000 (17:05 +0000)]
[Target] Remove commented out code. Found by inspection. NFCI.

llvm-svn: 320060

7 years ago[X86] Rename function in recently added test case to not be 'main' returning 'void...
Craig Topper [Thu, 7 Dec 2017 17:02:49 +0000 (17:02 +0000)]
[X86] Rename function in recently added test case to not be 'main' returning 'void'. NFC

llvm-svn: 320059

7 years agoFix the test from r320056 on Windows
Alexander Richardson [Thu, 7 Dec 2017 16:41:43 +0000 (16:41 +0000)]
Fix the test from r320056 on Windows

llvm-svn: 320058

7 years ago[DebugInfo] Move this test to X86/ now that it specifies a triple.
Davide Italiano [Thu, 7 Dec 2017 16:10:39 +0000 (16:10 +0000)]
[DebugInfo] Move this test to X86/ now that it specifies a triple.

Should bring back the arm/arm64 bots. Reported by Yvan Roux.

llvm-svn: 320057

7 years ago[ELF][mips] Print the full file path for files with incompatible ISA
Alexander Richardson [Thu, 7 Dec 2017 16:08:59 +0000 (16:08 +0000)]
[ELF][mips] Print the full file path for files with incompatible ISA

Summary:
I also changed the message to print both the ISA and the the architecture
name for incompatible files. Previously it would be quite hard to find the
actual path of the incompatible object files in projects that have many
object files with the same name in different directories.

Reviewers: atanasyan, ruiu

Reviewed By: atanasyan

Subscribers: emaste, sdardis, llvm-commits

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

llvm-svn: 320056

7 years ago[X86] Tag SALC instructions scheduler class
Simon Pilgrim [Thu, 7 Dec 2017 16:07:06 +0000 (16:07 +0000)]
[X86] Tag SALC instructions scheduler class

Treat these the same as LAHF/SAHF (although its not a x86_64 instruction)

llvm-svn: 320055

7 years ago[X86] Add LAHF/SAHF scheduling test
Simon Pilgrim [Thu, 7 Dec 2017 16:04:20 +0000 (16:04 +0000)]
[X86] Add LAHF/SAHF scheduling test

llvm-svn: 320054

7 years ago[X86][VMX] Tag VMX instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 15:57:32 +0000 (15:57 +0000)]
[X86][VMX] Tag VMX instructions scheduler classes

Tagged all as system instructions

llvm-svn: 320053

7 years ago[X86] Add SALC scheduling test
Simon Pilgrim [Thu, 7 Dec 2017 15:46:58 +0000 (15:46 +0000)]
[X86] Add SALC scheduling test

llvm-svn: 320052

7 years ago[X86] Tag LZCNT/TZCNT instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 15:24:14 +0000 (15:24 +0000)]
[X86] Tag LZCNT/TZCNT instructions scheduler classes

Tagged as IMUL instructions for a reasonable approximation (ALU tends to be a lot faster) - POPCNT is currently tagged as FAdd which I think should be replaced with IMUL as well

llvm-svn: 320051

7 years ago[DAGCombiner] eliminate shuffle of insert element
Sanjay Patel [Thu, 7 Dec 2017 15:17:58 +0000 (15:17 +0000)]
[DAGCombiner] eliminate shuffle of insert element

I noticed this pattern in D38316 / D38388. We failed to combine a shuffle that is either
repeating a scalar insertion at the same position in a vector or translated to a different
element index.

Like the earlier patch, this could be an instcombine too, but since we opted to make this
a DAG transform earlier, I've made this one a DAG patch too.

We do not need any legality checking because the new insert is identical to the existing
insert except that it may have a different constant insertion operand.

The constant insertion test in test/CodeGen/X86/vector-shuffle-combining.ll was the
motivation for D38756.

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

llvm-svn: 320050

7 years ago[InstCombine] Don't crash on out of bounds index in the insertelement
Igor Laevsky [Thu, 7 Dec 2017 15:00:52 +0000 (15:00 +0000)]
[InstCombine] Don't crash on out of bounds index in the insertelement

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

llvm-svn: 320049

7 years ago[X86][FMA] Regenerate fma schedule tests
Simon Pilgrim [Thu, 7 Dec 2017 14:51:47 +0000 (14:51 +0000)]
[X86][FMA] Regenerate fma schedule tests

llvm-svn: 320048

7 years ago[X86][SVM] Tag SVM instructions scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 14:35:17 +0000 (14:35 +0000)]
[X86][SVM] Tag SVM instructions scheduler classes

Tagged all as system instructions

llvm-svn: 320047

7 years ago[CodeGen] Use more getMFIfAvailable
Francis Visoiu Mistrih [Thu, 7 Dec 2017 14:32:15 +0000 (14:32 +0000)]
[CodeGen] Use more getMFIfAvailable

llvm-svn: 320046

7 years ago[X86] Tag RDRAND/RDSEED instruction scheduler classes
Simon Pilgrim [Thu, 7 Dec 2017 14:18:48 +0000 (14:18 +0000)]
[X86] Tag RDRAND/RDSEED instruction scheduler classes

llvm-svn: 320045

7 years ago[X86][X87] X87 math binop pseudo instructions don't need scheduling info
Simon Pilgrim [Thu, 7 Dec 2017 14:07:18 +0000 (14:07 +0000)]
[X86][X87] X87 math binop pseudo instructions don't need scheduling info

llvm-svn: 320044

7 years ago[X86][SSE42] SSE42 string pseudo instructions don't need scheduling info
Simon Pilgrim [Thu, 7 Dec 2017 13:52:07 +0000 (13:52 +0000)]
[X86][SSE42] SSE42 string pseudo instructions don't need scheduling info

llvm-svn: 320043

7 years ago[X86] Regenerate RDTSC codegen tests
Simon Pilgrim [Thu, 7 Dec 2017 13:50:29 +0000 (13:50 +0000)]
[X86] Regenerate RDTSC codegen tests

llvm-svn: 320042

7 years ago[WebAssemby] Support main functions with alternate signatures.
Dan Gohman [Thu, 7 Dec 2017 13:49:27 +0000 (13:49 +0000)]
[WebAssemby] Support main functions with alternate signatures.

WebAssembly requires caller and callee signatures to match, so the usual
C runtime trick of calling main and having it just work regardless of
whether main is defined as '()' or '(int argc, char *argv[])' doesn't
work. Extend the FixFunctionBitcasts pass to rewrite main to use the
latter form.

llvm-svn: 320041

7 years ago[X86][RDSEED] Add rdseed scheduling tests
Simon Pilgrim [Thu, 7 Dec 2017 13:47:17 +0000 (13:47 +0000)]
[X86][RDSEED] Add rdseed scheduling tests

llvm-svn: 320040

7 years ago[X86][RDRAND] Add rdrand scheduling tests
Simon Pilgrim [Thu, 7 Dec 2017 13:46:47 +0000 (13:46 +0000)]
[X86][RDRAND] Add rdrand scheduling tests

llvm-svn: 320039

7 years ago[RISCV] MC layer support for the jump/branch instructions of the RVC extension
Alex Bradbury [Thu, 7 Dec 2017 13:19:57 +0000 (13:19 +0000)]
[RISCV] MC layer support for the jump/branch instructions of the RVC extension

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

Patch by Shiva Chen.

llvm-svn: 320038

7 years ago[RISCV] MC layer support for load/store instructions of the C (compressed) extension
Alex Bradbury [Thu, 7 Dec 2017 12:50:32 +0000 (12:50 +0000)]
[RISCV] MC layer support for load/store instructions of the C (compressed) extension

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

Patch by Shiva Chen.

llvm-svn: 320037

7 years ago[RISCV][NFC] Use TargetRegisterClass::hasSubClassEq in storeRegToStackSlot/loadReadFr...
Alex Bradbury [Thu, 7 Dec 2017 12:45:05 +0000 (12:45 +0000)]
[RISCV][NFC] Use TargetRegisterClass::hasSubClassEq in storeRegToStackSlot/loadReadFromStackSlot

Simply checking for register class equality will break once additional
register classes are added (as is done for the RVC instruction set extension).

llvm-svn: 320036

7 years ago[Nios2] final infrastructure to provide compilation of a return from a function
Nikolai Bozhenov [Thu, 7 Dec 2017 12:35:02 +0000 (12:35 +0000)]
[Nios2] final infrastructure to provide compilation of a return from a function

This patch includes all missing functionality needed to provide first
compilation of a simple program that just returns from a function.
I've added a test case that checks for "ret" instruction printed in assembly
output.

Patch by Andrei Grischenko (andrei.l.grischenko@intel.com)
Differential revision: https://reviews.llvm.org/D39688

llvm-svn: 320035

7 years agoAdd proper BTVER2 sched support for MOV instr.
Andrew V. Tischenko [Thu, 7 Dec 2017 11:19:49 +0000 (11:19 +0000)]
Add proper BTVER2 sched support for MOV instr.
Differential Revision: https://reviews.llvm.org/D40345

llvm-svn: 320034

7 years ago[dsymutil] Add -verify option to run DWARF verifier after linking.
Jonas Devlieghere [Thu, 7 Dec 2017 11:17:19 +0000 (11:17 +0000)]
[dsymutil] Add -verify option to run DWARF verifier after linking.

This patch adds support for running the DWARF verifier on the linked
debug info files. If the -verify options is specified and verification
fails, dsymutil exists with abort with non-zero exit code. This behavior
is *not* enabled by default.

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

llvm-svn: 320033

7 years ago[FuzzMutate] Allow only sized pointers for the GEP instruction
Igor Laevsky [Thu, 7 Dec 2017 11:10:11 +0000 (11:10 +0000)]
[FuzzMutate] Allow only sized pointers for the GEP instruction

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

llvm-svn: 320032

7 years ago[RISCV] Add missed tests for RV64D MC layer support
Alex Bradbury [Thu, 7 Dec 2017 11:05:38 +0000 (11:05 +0000)]
[RISCV] Add missed tests for RV64D MC layer support

Add tests missed in r320029.

llvm-svn: 320031

7 years ago[Index] Add setPreprocessor member to IndexDataConsumer.
Eric Liu [Thu, 7 Dec 2017 11:04:24 +0000 (11:04 +0000)]
[Index] Add setPreprocessor member to IndexDataConsumer.

Summary:
This enables us to use information in Preprocessor when handling symbol
occurrences.

Reviewers: arphaman, hokein

Reviewed By: hokein

Subscribers: malaperle, cfe-commits

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

llvm-svn: 320030

7 years ago[RISCV] MC layer support for the standard RV64D instruction set extension
Alex Bradbury [Thu, 7 Dec 2017 11:04:18 +0000 (11:04 +0000)]
[RISCV] MC layer support for the standard RV64D instruction set extension

llvm-svn: 320029

7 years ago[RISCV] MC layer support for the standard RV64F instruction set extension
Alex Bradbury [Thu, 7 Dec 2017 11:02:55 +0000 (11:02 +0000)]
[RISCV] MC layer support for the standard RV64F instruction set extension

llvm-svn: 320028

7 years ago[RISCV] MC layer support for the standard RV64A instruction set extension
Alex Bradbury [Thu, 7 Dec 2017 10:59:12 +0000 (10:59 +0000)]
[RISCV] MC layer support for the standard RV64A instruction set extension

llvm-svn: 320027

7 years ago[RISCV] MC layer support for the standard RV64M instruction set extension
Alex Bradbury [Thu, 7 Dec 2017 10:56:07 +0000 (10:56 +0000)]
[RISCV] MC layer support for the standard RV64M instruction set extension

llvm-svn: 320026

7 years ago[Testing/Support] Make matchers work with Expected<T&>
Pavel Labath [Thu, 7 Dec 2017 10:54:23 +0000 (10:54 +0000)]
[Testing/Support] Make matchers work with Expected<T&>

Summary:
This did not work because the ExpectedHolder was trying to hold the
value in an Optional<T*>. Instead of trying to mimic the behavior of
Expected and try to make ExpectedHolder work with references and
non-references, I simply store the reference to the Expected object in
the holder.

I also add a bunch of tests for these matchers, which have helped me
flesh out some problems in my initial implementation of this patch, and
uncovered the fact that we are not consistent in quoting our values in
the matcher output (which I also fix).

Reviewers: zturner, chandlerc

Subscribers: mgorny, llvm-commits

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

llvm-svn: 320025

7 years ago[RISCV] MC layer support for the standard RV64I instructions
Alex Bradbury [Thu, 7 Dec 2017 10:53:48 +0000 (10:53 +0000)]
[RISCV] MC layer support for the standard RV64I instructions

llvm-svn: 320024

7 years ago[RISCV] MC layer support for the standard RV32D instruction set extension
Alex Bradbury [Thu, 7 Dec 2017 10:46:23 +0000 (10:46 +0000)]
[RISCV] MC layer support for the standard RV32D instruction set extension

As the FPR32 and FPR64 registers have the same names, use
validateTargetOperandClass in RISCVAsmParser to coerce a parsed FPR32 to an
FPR64 when necessary. The rest of this patch is very similar to the RV32F
patch.

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

llvm-svn: 320023

7 years ago[CodeGen] Use MachineOperand::print in the MIRPrinter for MO_Register.
Francis Visoiu Mistrih [Thu, 7 Dec 2017 10:40:31 +0000 (10:40 +0000)]
[CodeGen] Use MachineOperand::print in the MIRPrinter for MO_Register.

Work towards the unification of MIR and debug output by refactoring the
interfaces.

For MachineOperand::print, keep a simple version that can be easily called
from `dump()`, and a more complex one which will be called from both the
MIRPrinter and MachineInstr::print.

Add extra checks inside MachineOperand for detached operands (operands
with getParent() == nullptr).

https://reviews.llvm.org/D40836

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+)<def> ([^ ]+)/kill: \1 def \2 \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: \1 \2 def \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: def ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: def \1 \2 def \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/<def>//g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<kill>/killed \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use,kill>/implicit killed \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<dead>/dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<def[ ]*,[ ]*dead>/dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def[ ]*,[ ]*dead>/implicit-def dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def>/implicit-def \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use>/implicit \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<internal>/internal \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<undef>/undef \1/g'

llvm-svn: 320022

7 years agoVariable: Fix usage of uninitialised value
Pavel Labath [Thu, 7 Dec 2017 10:38:22 +0000 (10:38 +0000)]
Variable: Fix usage of uninitialised value

Summary:
Variable::GetValuesForVariableExpressionPath was passing an
uninitialised value for the final_task_on_target argument. On my
compiler/optimization level combo, the final_task_on_target happened to
contain "dereference" in some circumstances, which produced hilarious
results. The same is true for other arguments to the
GetValueForExpressionPath call.

The correct behavior here seems to be to just omit the arguments
altogether and let the default behavior take place.

Reviewers: jingham

Subscribers: mehdi_amini, lldb-commits

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

llvm-svn: 320021

7 years ago[RISCV] MC layer support for the standard RV32F instruction set extension
Alex Bradbury [Thu, 7 Dec 2017 10:26:05 +0000 (10:26 +0000)]
[RISCV] MC layer support for the standard RV32F instruction set extension

The most interesting part of this patch is probably the handling of
rounding mode arguments. Sadly, the RISC-V assembler handles floating point
rounding modes as a special "argument" when it would be more consistent to
handle them like the atomics, opcode suffixes. This patch supports parsing
this optional parameter, using InstAlias to allow parsing these floating point
instructions when no rounding mode is specified.

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

llvm-svn: 320020

7 years ago[ARM] ACLE parallel arithmetic and DSP style multiplications
Sjoerd Meijer [Thu, 7 Dec 2017 09:54:39 +0000 (09:54 +0000)]
[ARM] ACLE parallel arithmetic and DSP style multiplications

This is a follow up of r302131, in which we forgot to add SemaChecking
tests. Adding these tests revealed two problems which have been fixed:
- added missing intrinsic __qdbl,
- properly range checking ssat16 and usat16.

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

llvm-svn: 320019

7 years ago[TableGen] Give the option of tolerating duplicate register names
Alex Bradbury [Thu, 7 Dec 2017 09:51:55 +0000 (09:51 +0000)]
[TableGen] Give the option of tolerating duplicate register names

A number of architectures re-use the same register names (e.g. for both 32-bit
FPRs and 64-bit FPRs). They are currently unable to use the tablegen'erated
MatchRegisterName and MatchRegisterAltName, as tablegen (when built with
asserts enabled) will fail.

When the AllowDuplicateRegisterNames in AsmParser is set, duplicated register
names will be tolerated. A backend can then coerce registers to the desired
register class by (for instance) implementing validateTargetOperandClass.

At least the in-tree Sparc backend could benefit from this, as does RISC-V
(single and double precision floating point registers).

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

llvm-svn: 320018

7 years agoIgnore pointers to incomplete types when diagnosing misaligned addresses
Roger Ferrer Ibanez [Thu, 7 Dec 2017 09:23:50 +0000 (09:23 +0000)]
Ignore pointers to incomplete types when diagnosing misaligned addresses

This is a fix for PR35509 in which we crash because we attempt to compute the
alignment of an incomplete type.

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

llvm-svn: 320017

7 years ago[X86][FMA][FMA4]: Adding full coverage of MC encoding for the FMA, FMA4 isa sets...
Gadi Haber [Thu, 7 Dec 2017 09:16:34 +0000 (09:16 +0000)]
[X86][FMA][FMA4]: Adding full coverage of MC encoding for the FMA, FMA4 isa sets.<NFC>

NFC.
 Adding MC regressions tests to cover the FMA and FMA4 ISA sets.
 This patch is part of a larger task to cover MC encoding of all X86 ISA Sets starting revision https://reviews.llvm.org/D39952

Reviewers: craig.topper, RKSimon, zvi
Differential Revision: https://reviews.llvm.org/D40880

Change-Id: Ie39c0edce69ad647076b3d4e816948b2b6e1a9e4
llvm-svn: 320016

7 years ago[X86][X87]: Adding full coverage of MC encoding for all X87 ISA Sets.<NFC>
Gadi Haber [Thu, 7 Dec 2017 09:00:19 +0000 (09:00 +0000)]
[X86][X87]: Adding full coverage of MC encoding for all X87 ISA Sets.<NFC>

NFC.
 Currently, not all the X86 ISA Sets are covered by the MC regressions tests for X86.
 A full coverage needs to be added for each ISA set and for both 32bit and 64bit instructions + registers.
 This patch includes MC assembly tests for the X87 32bit and 64bit.

Reviewers: craigt, RKSimon, zvi
Differential Revision: https://reviews.llvm.org/D39952

Change-Id: I55e1719c09a70644a6a4073c720cb5341c80fee9
llvm-svn: 320015

7 years ago[InstSimplify] Add tests for the rL319894
Igor Laevsky [Thu, 7 Dec 2017 08:52:24 +0000 (08:52 +0000)]
[InstSimplify] Add tests for the rL319894

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

llvm-svn: 320014

7 years ago[SelectionDAG] In SplitVecOp_EXTRACT_VECTOR_ELT, simplify the code that makes the...
Craig Topper [Thu, 7 Dec 2017 08:04:34 +0000 (08:04 +0000)]
[SelectionDAG] In SplitVecOp_EXTRACT_VECTOR_ELT, simplify the code that makes the type byte addressable.

We can just extend the original vector to vXi1 and trust that the legalization process will revisit it.

llvm-svn: 320013

7 years ago[SelectionDAG] Use TLI.getVectorIdxTy to determine type for an EXTRACT_VECTOR_ELT...
Craig Topper [Thu, 7 Dec 2017 08:04:33 +0000 (08:04 +0000)]
[SelectionDAG] Use TLI.getVectorIdxTy to determine type for an EXTRACT_VECTOR_ELT index instead of hardcoding MVT::i8.

llvm-svn: 320012

7 years agoAllow conditions to be decomposed with structured bindings
Zhihao Yuan [Thu, 7 Dec 2017 07:03:15 +0000 (07:03 +0000)]
Allow conditions to be decomposed with structured bindings

Summary:
This feature was discussed but not yet proposed.  It allows a structured binding to appear as a //condition//

    if (auto [ok, val] = f(...))

So the user can save an extra //condition// if the statement can test the value to-be-decomposed instead.  Formally, it makes the value of the underlying object of the structured binding declaration also the value of a //condition// that is an initialized declaration.

Considering its logicality which is entirely evident from its trivial implementation, I think it might be acceptable to land it as an extension for now before I write the paper.

Reviewers: rsmith, faisalv, aaron.ballman

Reviewed By: rsmith

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 320011

7 years agoSkip DBG instr in OptimizePHIs when looking for dead PHI cycles
Mikael Holmen [Thu, 7 Dec 2017 07:01:21 +0000 (07:01 +0000)]
Skip DBG instr in OptimizePHIs when looking for dead PHI cycles

Summary:
Changed use_instructions() to use_nodbg_instructions() when
building an instruction set.

We don't want the presence of debug info to affect the code
we generate.

Reviewers: dblaikie, Eugene.Zelenko, chandlerc, aprantl

Reviewed By: aprantl

Subscribers: aprantl, llvm-commits

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

llvm-svn: 320010

7 years ago[AVR] Override ParseDirective
Leslie Zhai [Thu, 7 Dec 2017 06:56:09 +0000 (06:56 +0000)]
[AVR] Override ParseDirective

Reviewers: dylanmckay, kparzysz

Reviewed By: dylanmckay

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

llvm-svn: 320009

7 years agoTest commit access
Zhihao Yuan [Thu, 7 Dec 2017 06:27:58 +0000 (06:27 +0000)]
Test commit access

llvm-svn: 320008

7 years ago[WebAssembly] Remove used variable
Sam Clegg [Thu, 7 Dec 2017 03:51:37 +0000 (03:51 +0000)]
[WebAssembly] Remove used variable

llvm-svn: 320007

7 years ago[ELF] Handle multiple "--version-script" options.
Igor Kudrin [Thu, 7 Dec 2017 03:25:39 +0000 (03:25 +0000)]
[ELF] Handle multiple "--version-script" options.

Both ld.bfd and ld.gold can handle this case.

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

llvm-svn: 320006

7 years agoRemove checkToString functions and use toString instead.
Rui Ueyama [Thu, 7 Dec 2017 03:24:57 +0000 (03:24 +0000)]
Remove checkToString functions and use toString instead.

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

llvm-svn: 320005

7 years ago[WebAssembly] Add -u/--undefined argument handling
Sam Clegg [Thu, 7 Dec 2017 03:19:53 +0000 (03:19 +0000)]
[WebAssembly] Add -u/--undefined argument handling

Adds a new argument to wasm-lld, `--undefined`, with
similar semantics to the ELF linker. It pulls in symbols
from files contained within a `.a` archive, forcing them
to be included even if the translation unit would not
otherwise be pulled in.

Patch by Nicholas Wilson

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

llvm-svn: 320004

7 years agoRevert "[WebAssembly] Import the linear memory and function table."
Sam Clegg [Thu, 7 Dec 2017 03:05:45 +0000 (03:05 +0000)]
Revert "[WebAssembly] Import the linear memory and function table."

We need to a little time to prepare and lld-side change that
supports this.

Original change: https://reviews.llvm.org/D40875

llvm-svn: 320003

7 years ago[WebAssembly] section kind can be code
Sam Clegg [Thu, 7 Dec 2017 02:55:51 +0000 (02:55 +0000)]
[WebAssembly] section kind can be code

Currently, when creating a named section, the Wasm
frontend forces it to use `SectionKind::Data`, whereas
in fact C++ does generate code sections with custom
names.

Patch by Nicholas Wilson

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

llvm-svn: 320002

7 years ago[WebAssembly] Fix symbol exports under -r/--relocatable
Sam Clegg [Thu, 7 Dec 2017 01:51:24 +0000 (01:51 +0000)]
[WebAssembly] Fix symbol exports under -r/--relocatable

This change cleans up the way wasm exports and globals
are generated, particualrly for -r/--relocatable where
globals need to be created and exported in order for
output relocations which reference them.

Remove the need for a per file GlobalIndexOffset and
instead set the output index for each symbol directly.
This simplifies the code in several places.

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

llvm-svn: 320001

7 years agoCodeGen: Fix invalid bitcasts for memcpy
Yaxun Liu [Thu, 7 Dec 2017 01:39:52 +0000 (01:39 +0000)]
CodeGen: Fix invalid bitcasts for memcpy

CreateCoercedLoad/CreateCoercedStore assumes pointer argument of
memcpy is in addr space 0, which is not correct and causes invalid
bitcasts for triple amdgcn---amdgiz.

It is fixed by using alloca addr space instead.

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

llvm-svn: 320000

7 years agoUpdate BitCodeFormat.
Evgeniy Stepanov [Thu, 7 Dec 2017 01:38:20 +0000 (01:38 +0000)]
Update BitCodeFormat.

Add 2 recently added attributes to list of well-known attributes
in BitCodeFormat.rst.

llvm-svn: 319999

7 years ago[sanitizer] Simplify android_run.py.
Evgeniy Stepanov [Thu, 7 Dec 2017 01:28:44 +0000 (01:28 +0000)]
[sanitizer] Simplify android_run.py.

A test-only change to pass all *SAN_OPTIONS to the device without
listing them individually.

llvm-svn: 319998

7 years ago[DebugInfo] Explicitly pass a triple to this test.
Davide Italiano [Thu, 7 Dec 2017 01:22:10 +0000 (01:22 +0000)]
[DebugInfo] Explicitly pass a triple to this test.

As we emit different linetables format on different operating
systems, this currently fails on linux. Speculative commit
to fix the bots.

llvm-svn: 319997

7 years ago[COFF] Stop lowercasing paths in messages
Shoaib Meenai [Thu, 7 Dec 2017 01:21:27 +0000 (01:21 +0000)]
[COFF] Stop lowercasing paths in messages

It's pretty annoying to have LLD lowercase paths in error messages when
cross-compiling from a case-sensitive filesystem, since e.g. if I want
to examine the problematic object file, I have to perform some manual
case correction instead of just being able to copy the path from the
error message.

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

llvm-svn: 319996

7 years ago[MC/Dwarf] Use the older DWARF linetables format on Darwin.
Davide Italiano [Thu, 7 Dec 2017 00:57:25 +0000 (00:57 +0000)]
[MC/Dwarf] Use the older DWARF linetables format on Darwin.

dsymutil doesn't yet understand the new format and the change,
among others, breaks a large fraction of the debugger tests on
mac OS.

rdar://problem/35856354

llvm-svn: 319995

7 years ago[libcxx] [test] Strip trailing whitespace. NFC.
Stephan T. Lavavej [Thu, 7 Dec 2017 00:50:23 +0000 (00:50 +0000)]
[libcxx] [test] Strip trailing whitespace. NFC.

llvm-svn: 319994

7 years ago[ModRefInfo] Replace remaining bit-wise operations with wrappers.
Alina Sbirlea [Thu, 7 Dec 2017 00:43:19 +0000 (00:43 +0000)]
[ModRefInfo] Replace remaining bit-wise operations with wrappers.

llvm-svn: 319993

7 years agoRemove old concepts parsing code
Hubert Tong [Thu, 7 Dec 2017 00:34:20 +0000 (00:34 +0000)]
Remove old concepts parsing code

Summary:
This is so we can implement concepts per P0734R0. Relevant failing test
cases are disabled.

Reviewers: hubert.reinterpretcast, rsmith, saar.raz, nwilson

Reviewed By: saar.raz

Subscribers: cfe-commits

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

Patch by Changyu Li!

llvm-svn: 319992

7 years ago[WebAssembly] Don't try to emit size information for unsized types
Dan Gohman [Thu, 7 Dec 2017 00:14:30 +0000 (00:14 +0000)]
[WebAssembly] Don't try to emit size information for unsized types

Patch by John Sully!

Fixes PR35164.

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

llvm-svn: 319991

7 years ago[Coverage] Scan ahead for the most-recent completed count (PR35495)
Vedant Kumar [Thu, 7 Dec 2017 00:01:15 +0000 (00:01 +0000)]
[Coverage] Scan ahead for the most-recent completed count (PR35495)

This extends r319391. It teaches the segment builder to emit the right
completed segment when more than one region ends at the same location.

Fixes PR35495.

llvm-svn: 319990

7 years ago[WebAssembly] Import the linear memory and function table.
Dan Gohman [Wed, 6 Dec 2017 23:57:11 +0000 (23:57 +0000)]
[WebAssembly] Import the linear memory and function table.

Instead of having .o files contain linear-memory and function table
definitions, use imports. This is more consistent with the stack pointer
being imported, and it's consistent with the linker being the one to
decide whether linear memory and function table are imported or defined
in the linked output. This implements tool-conventions #23.

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

llvm-svn: 319989

7 years ago[libFuzzer] Decrease stack usage in unit tests
Kostya Serebryany [Wed, 6 Dec 2017 23:35:02 +0000 (23:35 +0000)]
[libFuzzer] Decrease stack usage in unit tests

Summary: With 3 Dictionary objects, each containing space of ~16k DictionaryEntry objects, the MutationDispatcher object is fairly memory heavy.  On platforms with a lower default stack size, this can cause panics in FuzzerUnittest as those tests stack-allocate the MutationDispatcher.  This may be especially problematic for platforms that do not (yet) have a way to programmatically change their stack size, aside from link-time flags.  In general, it seems more prudent to use the heap for an object of this size.

Reviewers: kcc, morehouse

Reviewed By: kcc

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

llvm-svn: 319988

7 years ago[CMake] Use PRIVATE when linking LLVM fuzzers.
Matt Morehouse [Wed, 6 Dec 2017 23:32:46 +0000 (23:32 +0000)]
[CMake] Use PRIVATE when linking LLVM fuzzers.

More fuzzers missed by r319840.

llvm-svn: 319987

7 years ago[Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 6 Dec 2017 23:18:41 +0000 (23:18 +0000)]
[Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 319986

7 years ago[ModRefInfo] Use ModRefInfo wrappers in FunctionModRefBehavior
Alina Sbirlea [Wed, 6 Dec 2017 23:12:43 +0000 (23:12 +0000)]
[ModRefInfo] Use ModRefInfo wrappers in FunctionModRefBehavior
when testing for info found only in ModRefInfo [NFC].

llvm-svn: 319985

7 years agoUpdate other SizeEnums to be of type uptr as well
Vlad Tsyrklevich [Wed, 6 Dec 2017 23:02:02 +0000 (23:02 +0000)]
Update other SizeEnums to be of type uptr as well

llvm-svn: 319984

7 years ago[clang] Add PRIVATE to target_link_libraries
Shoaib Meenai [Wed, 6 Dec 2017 23:02:00 +0000 (23:02 +0000)]
[clang] Add PRIVATE to target_link_libraries

Another follow-up to r319840. I'd done a test configure with
LLVM_BUILD_STATIC, so I'm not sure why this didn't show up in that.

llvm-svn: 319983

7 years agoRevert SVN r, 319967
Kamil Rytarowski [Wed, 6 Dec 2017 22:50:12 +0000 (22:50 +0000)]
Revert SVN r, 319967

"Correct atexit(3) support in MSan/NetBSD"

This causes failures on Linux.

llvm-svn: 319981

7 years ago[AArch64] Add patterns to replace fsub fmul with fma fneg.
Florian Hahn [Wed, 6 Dec 2017 22:48:36 +0000 (22:48 +0000)]
[AArch64] Add patterns to replace fsub fmul with fma fneg.

Summary:
This patch adds MachineCombiner patterns for transforming
(fsub (fmul x y) z) into (fma x y (fneg z)). This has a lower
latency on micro architectures where fneg is cheap.

Patch based on work by George Steed.

Reviewers: rengolin, joelkevinjones, joel_k_jones, evandro, efriedma

Reviewed By: evandro

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

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

llvm-svn: 319980

7 years ago[LV] Interleaved access vectorization: fix computing new alias info
Adam Nemet [Wed, 6 Dec 2017 22:42:24 +0000 (22:42 +0000)]
[LV] Interleaved access vectorization: fix computing new alias info

As a new access is generated spanning across multiple fields, we need to
propagate alias info from all the fields to form the most generic alias info.

rdar://35602528

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

llvm-svn: 319979

7 years ago[Hexagon] Recognize vdealb, vdealh, vshuffb and vshuffh specifically
Krzysztof Parzyszek [Wed, 6 Dec 2017 22:41:49 +0000 (22:41 +0000)]
[Hexagon] Recognize vdealb, vdealh, vshuffb and vshuffh specifically

llvm-svn: 319978