platform/upstream/llvm.git
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

7 years agoFix broken windows sanitizer buildbot
Vlad Tsyrklevich [Wed, 6 Dec 2017 22:40:23 +0000 (22:40 +0000)]
Fix broken windows sanitizer buildbot

r319875 caused a sign comparison build failure. Explicitly set the
enum's type to be unsigned.

llvm-svn: 319977

7 years agoAdd a call to std::vector::reserve.
Rafael Espindola [Wed, 6 Dec 2017 22:32:19 +0000 (22:32 +0000)]
Add a call to std::vector::reserve.

This reduces total allocations when linking clang fsds from 263.21MB
to 174.62MB.

This also has some very nice speed improvements on some
benchmarks. Chromium and clang fsds link 6% faster.

llvm-svn: 319976

7 years ago[libFuzzer] fix a minor regression in printing
Kostya Serebryany [Wed, 6 Dec 2017 22:12:24 +0000 (22:12 +0000)]
[libFuzzer] fix a minor regression in printing

llvm-svn: 319975

7 years agoAlways evaluate the second argument for CHECK() lazily.
Rui Ueyama [Wed, 6 Dec 2017 22:08:17 +0000 (22:08 +0000)]
Always evaluate the second argument for CHECK() lazily.

This patch is to rename check CHECK and make it a C macro, so that
we can evaluate the second argument lazily.

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

llvm-svn: 319974

7 years ago[NFC] Fix formatting
Philip Pfaffe [Wed, 6 Dec 2017 22:01:08 +0000 (22:01 +0000)]
[NFC] Fix formatting

llvm-svn: 319973

7 years ago[libomptarget] Split implementation of interface functions
Jonas Hahnfeld [Wed, 6 Dec 2017 21:59:15 +0000 (21:59 +0000)]
[libomptarget] Split implementation of interface functions

This last of four patches adds a new file for the interface
functions that Clang uses during code generation. The only
change except simply moving the current code is renaming the
function CheckDeviceAndCtors() and using the correct type for
64bit device ids.

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

llvm-svn: 319972

7 years ago[libomptarget] Split implementation of API functions
Jonas Hahnfeld [Wed, 6 Dec 2017 21:59:12 +0000 (21:59 +0000)]
[libomptarget] Split implementation of API functions

This third patch moves the implementation of the user-facing
OpenMP API functions into its own file. For now, the code is
only moved, no cleanups applied yet.

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

llvm-svn: 319971

7 years ago[libomptarget] Split device functionality
Jonas Hahnfeld [Wed, 6 Dec 2017 21:59:09 +0000 (21:59 +0000)]
[libomptarget] Split device functionality

This is the second patch to split the current monolithic
implementation into separate files. Note that this change
doesn't cleanup the code yet.

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

llvm-svn: 319970

7 years ago[libomptarget] Split RTL plugin functionality
Jonas Hahnfeld [Wed, 6 Dec 2017 21:59:07 +0000 (21:59 +0000)]
[libomptarget] Split RTL plugin functionality

This is the first of four patches to split the target agnostic
library into multiple (smaller) files. It only moves the code
to separate implementation files and does no cleanup (yet) except
removing unneeded headers.

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

llvm-svn: 319969

7 years ago[libomptarget] Move header files and CMake library definition
Jonas Hahnfeld [Wed, 6 Dec 2017 21:59:04 +0000 (21:59 +0000)]
[libomptarget] Move header files and CMake library definition

Future patches will add (private) header files in src/ that should
not be visible to plugins, so move the "public" ones to a new
include/ directory. This is still internal in a sense that the
contained files won't be installed for the user.
Similarly, the target agnostic offloading library should be built
directly in src/. The parent directory is responsible for finding
dependencies and including all subdirectories.

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

llvm-svn: 319968

7 years agoCorrect atexit(3) support in MSan/NetBSD
Kamil Rytarowski [Wed, 6 Dec 2017 21:57:39 +0000 (21:57 +0000)]
Correct atexit(3) support in MSan/NetBSD

Summary:
The NetBSD specific implementation of cxa_atexit() does not
preserve the 2nd argument if dso is equal to NULL.

Changes:

 - Split paths of handling intercepted __cxa_atexit() and atexit(3).
   This affects all supported Operating Systems.
 - Add a local stack-like structure to hold the __cxa_atexit() context.
   atexit(3) is documented in the C standard as calling callback from the
   earliest to the oldest entry. This path also fixes potential ABI
   problem of passing an argument to a function from the atexit(3)
   callback mechanism.
 - Allow usage of global vars with ctors in interceptors.
   This allows to use Vector without automatic cleaning up the structures.

This code has been modeled after TSan implementation for the same functions.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc

Reviewed By: vitalybuka

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 319967

7 years agoHandle NetBSD symbol renaming in msan_interceptors.cc
Kamil Rytarowski [Wed, 6 Dec 2017 21:32:57 +0000 (21:32 +0000)]
Handle NetBSD symbol renaming in msan_interceptors.cc

Summary:
NetBSD renames symbols for historical and compat reasons.

Add required symbol renames in sanitizer_common_interceptors.inc:

 - gettimeofday -> __gettimeofday50
 - getrusage -> __getrusage50
 - shmctl -> __shmctl50

Additionally handle sigaction symbol mangling.
Rename the function symbol in the file to SIGACTION_SYMNAME and define
it as __sigaction14 for NetBSD and sigaction for !NetBSD. We cannot use
simple renaming with the proprocessor, as there are valid fields named
sigaction and they must be left intact.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, eugenis, vitalybuka, dvyukov

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 319966

7 years ago[Hexagon] Handle perfect shuffles on single vectors
Krzysztof Parzyszek [Wed, 6 Dec 2017 21:25:03 +0000 (21:25 +0000)]
[Hexagon] Handle perfect shuffles on single vectors

llvm-svn: 319965

7 years ago[InstCombine] canonicalize constant-minus-boolean to select-of-constants
Sanjay Patel [Wed, 6 Dec 2017 21:22:57 +0000 (21:22 +0000)]
[InstCombine] canonicalize constant-minus-boolean to select-of-constants

This restores the half of:
https://reviews.llvm.org/rL75531
that was reverted at:
https://reviews.llvm.org/rL159230

For the x86 case mentioned there, we now produce:
leal 1(%rdi), %eax
subl %esi, %eax

We have target hooks to invert this in DAGCombiner (and x86 is enabled) with:
https://reviews.llvm.org/rL296977
https://reviews.llvm.org/rL311731

AArch64 and possibly other targets would probably benefit from enabling those hooks too.
See PR30327:
https://bugs.llvm.org/show_bug.cgi?id=30327#c2

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

llvm-svn: 319964

7 years ago[PGO] Make indirect call promotion a utility
Matthew Simpson [Wed, 6 Dec 2017 21:22:54 +0000 (21:22 +0000)]
[PGO] Make indirect call promotion a utility

This patch factors out the main code transformation utilities in the pgo-driven
indirect call promotion pass and places them in Transforms/Utils. The change is
intended to be a non-functional change, letting non-pgo-driven passes share a
common implementation with the existing pgo-driven pass.

The common utilities are used to conditionally promote indirect call sites to
direct call sites. They perform the underlying transformation, and do not
consider profile information. The pgo-specific details (e.g., the computation
of branch weight metadata) have been left in the indirect call promotion pass.

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

llvm-svn: 319963

7 years ago[WebAssembly] Commit a file I accidentally omitted from r319956.
Dan Gohman [Wed, 6 Dec 2017 21:16:04 +0000 (21:16 +0000)]
[WebAssembly] Commit a file I accidentally omitted from r319956.

llvm-svn: 319962

7 years ago[OpenMP] Add entry for Intel Compiler 18
Jonathan Peyton [Wed, 6 Dec 2017 21:15:28 +0000 (21:15 +0000)]
[OpenMP] Add entry for Intel Compiler 18

Patch by Simon Convent

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

llvm-svn: 319961

7 years agoEliminate double printing of verbose affinity settings
Jonathan Peyton [Wed, 6 Dec 2017 21:07:41 +0000 (21:07 +0000)]
Eliminate double printing of verbose affinity settings

Redundant extra verbose output of binding to full mask in case
affinity=balanced or OMP_PLACES=<any> or OMP_PROC_BIND=<any>

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

llvm-svn: 319960

7 years ago[libc++] Create install-stripped targets
Shoaib Meenai [Wed, 6 Dec 2017 21:03:42 +0000 (21:03 +0000)]
[libc++] Create install-stripped targets

LLVM is gaining install-*-stripped targets to perform stripped installs,
and in order for this to be useful for install-distribution, all
potential distribution components should have stripped installation
targets. LLVM has a function to create these install targets, but since
we can't use LLVM CMake functions in libc++, let's do it manually.

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

llvm-svn: 319959

7 years agoPort SCEVAffinator to the isl c++ bindings
Philip Pfaffe [Wed, 6 Dec 2017 21:02:22 +0000 (21:02 +0000)]
Port SCEVAffinator to the isl c++ bindings

Summary: Straight forward port of SCEVAffinator

Reviewers: grosser, bollu, Meinersbur

Reviewed By: Meinersbur

Subscribers: pollydev, llvm-commits

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

llvm-svn: 319958

7 years agoTrivial enum fix
Jonathan Peyton [Wed, 6 Dec 2017 21:02:15 +0000 (21:02 +0000)]
Trivial enum fix

This change is a trivial fix for enums that removes specification of "last" or
"upper" values, or other boundary values. This simplifies the code in places,
and results in never needing to update the "upper" values again.

Patch by Terry Wilmarth

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

llvm-svn: 319957

7 years ago[WebAssembly] Remove WASM_STACK_POINTER.
Dan Gohman [Wed, 6 Dec 2017 20:56:40 +0000 (20:56 +0000)]
[WebAssembly] Remove WASM_STACK_POINTER.

WASM_STACK_POINTER and the .stack_pointer directive are no longer needed
now that the stack pointer global is an import.

llvm-svn: 319956

7 years ago[lld] Set up .arcconfig to point to new Diffusion LLD repository
Ben Hamilton [Wed, 6 Dec 2017 20:56:23 +0000 (20:56 +0000)]
[lld] Set up .arcconfig to point to new Diffusion LLD repository

Summary:
We want to automatically copy the appropriate mailing list
for review requests to the LLD repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40179, I set up a new Diffusion repository with callsign
"LLD" for lld:

https://reviews.llvm.org/source/lld/

This explicitly updates lld's .arcconfig to point to the new C
repository in Diffusion, which will let us use Herald rule H270.

Reviewers: peter.smith, ruiu, rafael, sammccall

Reviewed By: sammccall

Subscribers: dlj, bkramer, sammccall, klimek

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

llvm-svn: 319955

7 years ago[compiler-rt] Set up .arcconfig to point to new Diffusion CRT repository
Ben Hamilton [Wed, 6 Dec 2017 20:55:32 +0000 (20:55 +0000)]
[compiler-rt] Set up .arcconfig to point to new Diffusion CRT repository

Summary:
We want to automatically copy the appropriate mailing list
as well as #sanitizers for review requests to the compiler-rt repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40179, I set up a new Diffusion repository with callsign
"CRT" for compiler-rt:

https://reviews.llvm.org/source/compiler-rt/

This explicitly updates compiler-rt's .arcconfig to point to the new
CRT repository in Diffusion, which will let us use Herald rules H270
and H271.

Reviewers: krytarowski, joerg, dvyukov, vitalybuka, sammccall

Reviewed By: sammccall

Subscribers: dlj, bkramer, dberris, llvm-commits, sammccall, klimek, #sanitizers

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

llvm-svn: 319954

7 years ago[lldb] Use PRIVATE in target_link_libraries
Shoaib Meenai [Wed, 6 Dec 2017 20:53:03 +0000 (20:53 +0000)]
[lldb] Use PRIVATE in target_link_libraries

This is a follow-up to r319840. I guess none of the systems I'd tested
on before had LLDB_SYSTEM_LIBS set, which is why I didn't see any local
errors, but I'm surprised none of the bots caught it either.

llvm-svn: 319953