platform/upstream/llvm.git
6 years ago[VPlan] Add Analysis and Core to LLVM_LINK_COMPONENTS
Heejin Ahn [Mon, 18 Jun 2018 23:51:16 +0000 (23:51 +0000)]
[VPlan] Add Analysis and Core to LLVM_LINK_COMPONENTS

Summary: Without these, build with `-DSHARED_LIB=ON` fails.

Reviewers: dschuff

Subscribers: mgorny, bollu, tschuett, rkruppe, rogfer01, llvm-commits

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

llvm-svn: 334997

6 years agoUtilize new SDNode flag functionality to expand current support for fadd
Michael Berg [Mon, 18 Jun 2018 23:44:59 +0000 (23:44 +0000)]
Utilize new SDNode flag functionality to expand current support for fadd

Summary: This patch originated from D46562 and is a proper subset, with some issues addressed.

Reviewers: spatel, hfinkel, wristow, arsenm, javed.absar

Reviewed By: spatel

Subscribers: wdng, nhaehnle

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

llvm-svn: 334996

6 years agoSome NFC changes to how we scan of kexts & kernels in memory in the
Jason Molenda [Mon, 18 Jun 2018 23:30:03 +0000 (23:30 +0000)]
Some NFC changes to how we scan of kexts & kernels in memory in the
DynamicLoaderDarwinKernel plugin.  Created a new function ReadMachHeader
and instead of reading through the target cached memory reader,
start by reading only a mach header sized chunk of memory, then
check it for a valid mach-o magic # and use the size of the load
commands to pre-fetch the entire load commands of the kext which
is the only thing we're going to read, instead of letting the generic
mach-o parser read it in 512 byte chunks.

Functionally this is doing exactly the same thing as before, but by
cutting down on the # of packets going back and forth, even on a
local connection it's close to a quarter faster than it was before.

<rdar://problem/38570146>

llvm-svn: 334995

6 years ago[X86] Remove ReadAfterLd from avx512_shift_rmbi multiclass.
Craig Topper [Mon, 18 Jun 2018 23:20:57 +0000 (23:20 +0000)]
[X86] Remove ReadAfterLd from avx512_shift_rmbi multiclass.

The instructions that use this class don't have another source register. So I think this was just marking one of the address operands as ReadAfterLd?

llvm-svn: 334994

6 years agoRevert "Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor"
Xin Tong [Mon, 18 Jun 2018 23:20:08 +0000 (23:20 +0000)]
Revert "Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor"

This reverts commit f976cf4cca0794267f28b54e468007fd476d37d9.

I am reverting this because it causes break in a few bots and its going
to take me sometime to look at this.

llvm-svn: 334993

6 years agoSimplify blockaddress usage before giving up in MergeBlockIntoPredecessor
Xin Tong [Mon, 18 Jun 2018 22:59:13 +0000 (22:59 +0000)]
Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor

Summary:
Simplify blockaddress usage before giving up in MergeBlockIntoPredecessor

This is a missing small optimization in MergeBlockIntoPredecessor.

This helps with one simplifycfg test which expects this case to be handled.

Reviewers: davide, spatel, brzycki, asbirlea

Subscribers: llvm-commits

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

llvm-svn: 334992

6 years ago[ELF] Uniquify --wrap list.
Fangrui Song [Mon, 18 Jun 2018 22:32:15 +0000 (22:32 +0000)]
[ELF] Uniquify --wrap list.

Summary: For --wrap foo --wrap foo, bfd/gold wrap the symbol only once but LLD would rotate it twice.

Reviewers: ruiu, espindola

Subscribers: emaste, arichardson, mgrang, llvm-commits

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

llvm-svn: 334991

6 years agoTidy comment language and explanation.
Eric Christopher [Mon, 18 Jun 2018 22:21:19 +0000 (22:21 +0000)]
Tidy comment language and explanation.

llvm-svn: 334990

6 years agoPull non-lazy stub table emission into a separate function alongside
Eric Christopher [Mon, 18 Jun 2018 22:21:18 +0000 (22:21 +0000)]
Pull non-lazy stub table emission into a separate function alongside
the individual stub creation to increase readability a bit in the
non-object file format specific function.

llvm-svn: 334989

6 years agoAdd return statements to make it clear that all of these are mutually exclusive condi...
Eric Christopher [Mon, 18 Jun 2018 22:21:13 +0000 (22:21 +0000)]
Add return statements to make it clear that all of these are mutually exclusive conditions.

else if would have worked just as well, but this keeps the original readability a bit more clear.

llvm-svn: 334988

6 years agoTests for dag combine select (binop) -> select. NFC.
Stanislav Mekhanoshin [Mon, 18 Jun 2018 21:49:07 +0000 (21:49 +0000)]
Tests for dag combine select (binop) -> select. NFC.

Tests will be updated with https://reviews.llvm.org/D48223

llvm-svn: 334987

6 years ago[llvm-mca] Cleanup the header syntax line. Fix a comment. NFC.
Matt Davis [Mon, 18 Jun 2018 21:38:38 +0000 (21:38 +0000)]
[llvm-mca] Cleanup the header syntax line. Fix a comment. NFC.

This patch removes a few dashes from the header comment to make room for the syntax line.

llvm-svn: 334986

6 years ago[WebAssembly] Modified tablegen defs to have 2 parallel instuction sets.
Wouter van Oortmerssen [Mon, 18 Jun 2018 21:22:44 +0000 (21:22 +0000)]
[WebAssembly] Modified tablegen defs to have 2 parallel instuction sets.

Summary:
One for register based, much like the existing definitions,
and one for stack based (suffix _S).

This allows us to use registers in most of LLVM (which works better),
and stack based in MC (which results in a simpler and more readable
assembler / disassembler).

Tried to keep this change as small as possible while passing tests,
follow-up commit will:
- Add reg->stack conversion in MI.
- Fix asm/disasm in MC to be stack based.
- Fix emitter to be stack based.

tests passing:
llvm-lit -v `find test -name WebAssembly`

test/CodeGen/WebAssembly
test/MC/WebAssembly
test/MC/Disassembler/WebAssembly
test/DebugInfo/WebAssembly
test/CodeGen/MIR/WebAssembly
test/tools/llvm-objdump/WebAssembly

Reviewers: dschuff, sbc100, jgravelle-google, sunfish

Subscribers: aheejin, JDevlieghere, llvm-commits

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

llvm-svn: 334985

6 years agorefactor of visitFADD for AllowNewConst cases
Michael Berg [Mon, 18 Jun 2018 21:12:21 +0000 (21:12 +0000)]
refactor of visitFADD for AllowNewConst cases

Summary: Refactoring for all constant cases which require AllowNewConst and some staging for future fmf usage.

Reviewers: spatel, hfinkel, wristow

Reviewed By: spatel

Subscribers: nhaehnle

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

llvm-svn: 334984

6 years ago[AArch64][SVE] Asm: Fix predicate pattern diagnostics.
Sander de Smalen [Mon, 18 Jun 2018 21:03:02 +0000 (21:03 +0000)]
[AArch64][SVE] Asm: Fix predicate pattern diagnostics.

This patch uses the DiagnosticPredicate for SVE predicate patterns
to improve their diagnostics, now giving a 'invalid operand' diagnostic
if the type is not an immediate or one of the expected pattern
labels.

Reviewers: samparker, SjoerdMeijer, javed.absar, fhahn

Reviewed By: fhahn

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

llvm-svn: 334983

6 years agoIRgen: Mark aliases of ctors and dtors as unnamed_addr.
Peter Collingbourne [Mon, 18 Jun 2018 20:58:54 +0000 (20:58 +0000)]
IRgen: Mark aliases of ctors and dtors as unnamed_addr.

This is not only semantically correct but ensures that they will not
be marked as address-significant once D48155 lands.

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

llvm-svn: 334982

6 years agoFixing os_version_check.c to be actual C source
Chris Bieneman [Mon, 18 Jun 2018 20:56:19 +0000 (20:56 +0000)]
Fixing os_version_check.c to be actual C source

The initial implementaiton was using the C++ typeof keyword. This
causes the compiler to spew warnings unnecissarilly. This patch removes
the uses of typeof and replaces them with explicit typedefs of the
function types.

llvm-svn: 334981

6 years ago[AArch64][SVE] Asm: Support for saturating INC/DEC (32bit scalar) instructions.
Sander de Smalen [Mon, 18 Jun 2018 20:50:33 +0000 (20:50 +0000)]
[AArch64][SVE] Asm: Support for saturating INC/DEC (32bit scalar) instructions.

The variants added by this patch are:
- SQINC     signed increment, e.g. sqinc x0, w0, all, mul #4
- SQDEC     signed decrement, e.g. sqdec x0, w0, all, mul #4
- UQINC   unsigned increment, e.g. uqinc w0, all, mul #4
- UQDEC   unsigned decrement, e.g. uqdec w0, all, mul #4

This patch includes asmparser changes to parse a GPR64 as a GPR32 in
order to satisfy the constraint check:
  x0 == GPR64(w0)
in:
  sqinc x0, w0, all, mul #4
         ^___^ (must match)

Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar

Reviewed By: fhahn

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

llvm-svn: 334980

6 years ago[WebAssembly] Cleaned up register accessors in WebAssemblyMachineFunctionInfo.h
Wouter van Oortmerssen [Mon, 18 Jun 2018 20:45:49 +0000 (20:45 +0000)]
[WebAssembly] Cleaned up register accessors in WebAssemblyMachineFunctionInfo.h

Tested: llvm-lit -v `find test -name WebAssembly`

(This is a commit access "test commit" :)

llvm-svn: 334979

6 years agoFixed file completion for paths that start with '~'.
Raphael Isemann [Mon, 18 Jun 2018 20:11:38 +0000 (20:11 +0000)]
Fixed file completion for paths that start with '~'.

We didn't add the remaining path behind the '~' to the completion string,
causing it to just complete directories inside the user home directory. This
patch just adds the directory of the remaining path if there is one.

Fixes rdar://problem/40147002

llvm-svn: 334978

6 years ago[x86] regenerate checks and adjust tests
Sanjay Patel [Mon, 18 Jun 2018 20:05:16 +0000 (20:05 +0000)]
[x86] regenerate checks and adjust tests

2 of these tests were clearly not doing what the comments
said they were doing.

The last test was added at rL177933 with no assertions
(presumably it used to crash). But either we don't have
that problem anymore, or this test is folded sooner,
so we don't hit the bug that was fixed by disabling late
FP constant creation. Looking at this as part of reviewing
D48289.

llvm-svn: 334977

6 years ago[docs] Fix indentation of llvm-exegesis command line arguments
Simon Pilgrim [Mon, 18 Jun 2018 20:05:02 +0000 (20:05 +0000)]
[docs] Fix indentation of llvm-exegesis command line arguments

llvm-svn: 334976

6 years ago[TSan] Report proper error on allocator failures instead of CHECK(0)-ing
Alex Shlyapnikov [Mon, 18 Jun 2018 20:03:31 +0000 (20:03 +0000)]
[TSan] Report proper error on allocator failures instead of CHECK(0)-ing

Summary:
Following up on and complementing D44404 and other sanitizer allocators.

Currently many allocator specific errors (OOM, for example) are reported as
a text message and CHECK(0) termination, no stack, no details, not too
helpful nor informative. To improve the situation, detailed and structured
common errors were defined and reported under the appropriate conditions.

Common tests were generalized a bit to cover a slightly different TSan
stack reporting format, extended to verify errno value and returned
pointer value check is now explicit to facilitate debugging.

Reviewers: dvyukov

Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 334975

6 years agoFix clangd test to pass when delayed template parsing is on by default
Reid Kleckner [Mon, 18 Jun 2018 18:55:10 +0000 (18:55 +0000)]
Fix clangd test to pass when delayed template parsing is on by default

llvm-svn: 334973

6 years agoDon't let test/Driver/no-canonical-prefixes.c form a symlink cycle the second time...
Nico Weber [Mon, 18 Jun 2018 18:50:35 +0000 (18:50 +0000)]
Don't let test/Driver/no-canonical-prefixes.c form a symlink cycle the second time it runs.

The test makes %t.fake a symlink to %t.real by running `ln -sf %t.real
%t.fake`. If %t.fake already is a symlink to %t.real when this runs (e.g. if
the test has run before), then this effectively becomes `ln -sf %t.real %t.real`,
symlinking the directory to itself. At least on my mac, this leads to the
directory containing itself.

As fix, just remove %t.fake before creating the symlink. To clean up build dirs
on bots, also remove %t.real for a while.

https://reviews.llvm.org/D48224

llvm-svn: 334972

6 years ago[X86] Encode the EVEX2VEX exception list information in .td files instead of the...
Craig Topper [Mon, 18 Jun 2018 18:47:07 +0000 (18:47 +0000)]
[X86] Encode the EVEX2VEX exception list information in .td files instead of the emitter source.

Rather than having an exclusion list in tablegen sources, add a flag to the X86 instruction records that can be used to suppress checking for convertibility.

llvm-svn: 334971

6 years ago[NFC] make MIFlag accessor functions consistant with usage model
Michael Berg [Mon, 18 Jun 2018 18:37:48 +0000 (18:37 +0000)]
[NFC] make MIFlag accessor functions consistant with usage model

llvm-svn: 334970

6 years ago[VPlan] Add VPInstruction to VPRecipe transformation.
Florian Hahn [Mon, 18 Jun 2018 18:28:49 +0000 (18:28 +0000)]
[VPlan] Add VPInstruction to VPRecipe transformation.

This patch introduces a VPInstructionToVPRecipe transformation, which
allows us to generate code for a VPInstruction based VPlan re-using the
existing infrastructure.

Reviewers: dcaballe, hsaito, mssimpso, hfinkel, rengolin, mkuper, javed.absar, sguggill

Reviewed By: dcaballe

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

llvm-svn: 334969

6 years agoIntroduce lldb-framework CMake target and centralize its logic
Alex Langford [Mon, 18 Jun 2018 18:27:16 +0000 (18:27 +0000)]
Introduce lldb-framework CMake target and centralize its logic

Summary:
In this patch I aim to do the following:

1) Create an lldb-framework target that acts as the target that handles generating LLDB.framework. Previously, liblldb acted as the target for generating the framework in addition to generating the actual lldb library. This made the target feel overloaded.
2) Centralize framework generation as much as it makes sense to do so.
3) Create a target lldb-suite, which depends on every tool and library that makes liblldb fully functional. One result of having this target is it makes tracking dependencies much clearer.

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

llvm-svn: 334968

6 years ago[ORC] Add an initial implementation of a replacement CompileOnDemandLayer.
Lang Hames [Mon, 18 Jun 2018 18:01:43 +0000 (18:01 +0000)]
[ORC] Add an initial implementation of a replacement CompileOnDemandLayer.

CompileOnDemandLayer2 is a replacement for CompileOnDemandLayer built on the ORC
Core APIs. Functions in added modules are extracted and compiled lazily.
CompileOnDemandLayer2 supports multithreaded JIT'd code, and compilation on
multiple threads.

llvm-svn: 334967

6 years ago[ORC] Keep weak flag on VSO symbol tables during materialization, but treat
Lang Hames [Mon, 18 Jun 2018 18:01:41 +0000 (18:01 +0000)]
[ORC] Keep weak flag on VSO symbol tables during materialization, but treat
materializing weak symbols as strong.

This removes some elaborate flag tweaking and plays nicer with RuntimeDyld,
which relies of weak/common flags to determine whether it should emit a given
weak definition. (Switching to strong up-front makes it appear as if there is
already an overriding definition, which would require an extra back-channel to
override).

llvm-svn: 334966

6 years ago[analyzer] Remove accidentally committed lines.
George Karpenkov [Mon, 18 Jun 2018 17:59:03 +0000 (17:59 +0000)]
[analyzer] Remove accidentally committed lines.

llvm-svn: 334965

6 years agoFix a bug introduced by rL334850
Tomasz Krupa [Mon, 18 Jun 2018 17:57:05 +0000 (17:57 +0000)]
Fix a bug introduced by rL334850

Summary: All *_sqrt_round_s[s|d] intrinsics should execute a square root on
zeroth element from B (Ops[1]) and insert in to A (Ops[0]), not the other way around.

Reviewers: itaraban, craig.topper

Reviewed By: craig.topper

Subscribers: craig.topper, cfe-commits

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

llvm-svn: 334964

6 years agoShrink interval after moving copy in removePartialRedundancy
Krzysztof Parzyszek [Mon, 18 Jun 2018 17:16:39 +0000 (17:16 +0000)]
Shrink interval after moving copy in removePartialRedundancy

llvm-svn: 334963

6 years ago[OPENMP, NVPTX] Emit simple reduction if requested.
Alexey Bataev [Mon, 18 Jun 2018 17:11:45 +0000 (17:11 +0000)]
[OPENMP, NVPTX] Emit simple reduction if requested.

If simple reduction is requested, use the simple reduction instead of
the runtime functions calls.

llvm-svn: 334962

6 years ago[llvm-mca] Use an ordered map to collect hardware statistics. NFC.
Andrea Di Biagio [Mon, 18 Jun 2018 17:04:56 +0000 (17:04 +0000)]
[llvm-mca] Use an ordered map to collect hardware statistics. NFC.

Histogram entries are now ordered by key.  This should improves their
readability when statistics are printed.

llvm-svn: 334961

6 years agoFix typoed cast to avoid assertion in MCFragment::dump.
Nirav Dave [Mon, 18 Jun 2018 16:26:11 +0000 (16:26 +0000)]
Fix typoed cast to avoid assertion in MCFragment::dump.

llvm-svn: 334959

6 years ago[SLPVectorizer] Tidyup isShuffle helper
Simon Pilgrim [Mon, 18 Jun 2018 16:25:01 +0000 (16:25 +0000)]
[SLPVectorizer] Tidyup isShuffle helper

Ensure we keep track of the input vectors in all cases instead of just for SK_Select.

Ideally we'd reuse the shuffle mask pattern matching in TargetTransformInfo::getInstructionThroughput here to easily add support for all TargetTransformInfo::ShuffleKind without mass code duplication, I've added a TODO for now but D48236 should help us here.

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

llvm-svn: 334958

6 years ago[TableGen] Make TiedAsmOperandTable in the AsmMatcher 'static' since its at file...
Craig Topper [Mon, 18 Jun 2018 16:17:46 +0000 (16:17 +0000)]
[TableGen] Make TiedAsmOperandTable in the AsmMatcher 'static' since its at file scope.

llvm-svn: 334957

6 years ago[TableGen] Remove unused member variable.
Craig Topper [Mon, 18 Jun 2018 16:17:45 +0000 (16:17 +0000)]
[TableGen] Remove unused member variable.

I think this became unused after r324196.

llvm-svn: 334956

6 years agoFix macosx build broken by the VersionTuple refactor
Pavel Labath [Mon, 18 Jun 2018 16:10:20 +0000 (16:10 +0000)]
Fix macosx build broken by the VersionTuple refactor

I actually did check that macos builds before committing, but this error
was in conditionally compiled code that did not seem to be used on my
machine.

I also fix a typo in the previous speculative NetBSD patch.

llvm-svn: 334955

6 years agoFix netbsd build broken by r334950
Pavel Labath [Mon, 18 Jun 2018 15:44:36 +0000 (15:44 +0000)]
Fix netbsd build broken by r334950

This also includes one more build fix for windows.

llvm-svn: 334953

6 years agoAttempt to fix windows&freebsd builds broken by r334950
Pavel Labath [Mon, 18 Jun 2018 15:29:42 +0000 (15:29 +0000)]
Attempt to fix windows&freebsd builds broken by r334950

llvm-svn: 334952

6 years ago[VPlanRecipeBase] Add eraseFromParent().
Florian Hahn [Mon, 18 Jun 2018 15:18:48 +0000 (15:18 +0000)]
[VPlanRecipeBase] Add eraseFromParent().

Reviewers: dcaballe, hsaito, mkuper, hfinkel

Reviewed By: dcaballe

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

llvm-svn: 334951

6 years agoUse llvm::VersionTuple instead of manual version marshalling
Pavel Labath [Mon, 18 Jun 2018 15:02:23 +0000 (15:02 +0000)]
Use llvm::VersionTuple instead of manual version marshalling

Summary:
This has multiple advantages:
- we need only one function argument/instance variable instead of three
- no need to default initialize variables
- no custom parsing code
- VersionTuple has comparison operators, which makes version comparisons much
  simpler

Reviewers: zturner, friss, clayborg, jingham

Subscribers: emaste, lldb-commits

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

llvm-svn: 334950

6 years ago[AArch64][SVE] Asm: Support for saturating INC/DEC (64bit scalar) instructions.
Sander de Smalen [Mon, 18 Jun 2018 14:47:52 +0000 (14:47 +0000)]
[AArch64][SVE] Asm: Support for saturating INC/DEC (64bit scalar) instructions.

Summary:
The variants added by this patch are:
- SQINC  (signed increment)
- UQINC  (unsigned increment)
- SQDEC  (signed decrement)
- UQDEC  (unsigned decrement)

For example:
  uqincw  x0, all, mul #4

Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar

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

llvm-svn: 334948

6 years ago[X86][BtVer2] Flag AVX2+ scheduler classes as unsupported
Simon Pilgrim [Mon, 18 Jun 2018 14:31:14 +0000 (14:31 +0000)]
[X86][BtVer2] Flag AVX2+ scheduler classes as unsupported

Jaguar only supports up to AVX1

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

llvm-svn: 334947

6 years ago[ELF] - Simplify the conflict-variable-linkage-name.s test case. [NFC]
George Rimar [Mon, 18 Jun 2018 14:14:35 +0000 (14:14 +0000)]
[ELF] - Simplify the conflict-variable-linkage-name.s test case. [NFC]

This is a follow up requested during post commit review for
"[lld] r333880 - [ELF] - Also use DW_AT_linkage_name when gathering information about variables for error messages."

It removes checking of the input objects since it is really excessive.

llvm-svn: 334946

6 years ago[llvm-mca] Add tests for XOP and AVX512 instructions that implicitly clear the upper...
Andrea Di Biagio [Mon, 18 Jun 2018 14:00:30 +0000 (14:00 +0000)]
[llvm-mca] Add tests for XOP and AVX512 instructions that implicitly clear the upper portion of a super-register.

When the destination register of a XOP instruction is an XMM register, bits
[255:128] of the corresponding YMM register are cleared.

When the destination register of a EVEX encoded instruction is an XMM/YMM
register, the upper bits of the corresponding ZMM are cleared.
On processors that feature AVX512, a write to an XMM registers always clears the
upper portion of the corresponding ZMM register if the instruction is VEX or
EVEX encoded.

These new tests show some interesting cases which aren't correctly analyzed by
llvm-mca. The lack of knowledge related to the implicit update on the
super-registers is addressed by D48225.

llvm-svn: 334945

6 years ago[sanitizer] Guard call to internal_lseek when SANITIZER_MAC is true
Francis Visoiu Mistrih [Mon, 18 Jun 2018 13:53:51 +0000 (13:53 +0000)]
[sanitizer] Guard call to internal_lseek when SANITIZER_MAC is true

r334881 breaks macOS bots because internal_lseek is not defined (neither
used on macOS):
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/46240/consoleFull.

See discussion from r334881: https://reviews.llvm.org/rL334881

llvm-svn: 334944

6 years ago[VPlan] Fix sanitizer problem with insertBefore.
Florian Hahn [Mon, 18 Jun 2018 13:51:28 +0000 (13:51 +0000)]
[VPlan] Fix sanitizer problem with insertBefore.

llvm-svn: 334943

6 years ago[TableGen][AsmMatcherEmitter] Allow tied operands of different classes in aliases.
Sander de Smalen [Mon, 18 Jun 2018 13:39:29 +0000 (13:39 +0000)]
[TableGen][AsmMatcherEmitter] Allow tied operands of different classes in aliases.

Allow a tied operand of a different operand class in InstAliases,
so that the operand can be printed (and added to the MC instruction)
as the appropriate register. For example, 'GPR64as32', which would
be printed/parsed as a 32bit register and should match a tied 64bit
register operand, where the former is a sub-register of the latter.

This patch also generalizes the constraint checking to an overrideable
method in MCTargetAsmParser, so that target asmparsers can specify
whether a given operand satisfies the tied register constraint.

Reviewers: olista01, rengolin, fhahn, SjoerdMeijer, samparker, dsanders, craig.topper

Reviewed By: fhahn

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

llvm-svn: 334942

6 years agoAdjust for clang-format changes
Tobias Grosser [Mon, 18 Jun 2018 13:01:52 +0000 (13:01 +0000)]
Adjust for clang-format changes

llvm-svn: 334941

6 years ago[ScopInfo] Move splitAliasGroupsByDomain and getAccessDomain to isl++ [NFCI]
Tobias Grosser [Mon, 18 Jun 2018 12:53:26 +0000 (12:53 +0000)]
[ScopInfo] Move splitAliasGroupsByDomain and getAccessDomain to isl++ [NFCI]

llvm-svn: 334940

6 years ago[ScopInfo] Move more functions to isl++ [NFCI]
Tobias Grosser [Mon, 18 Jun 2018 12:49:47 +0000 (12:49 +0000)]
[ScopInfo] Move more functions to isl++ [NFCI]

This change includes:

  - getFortranArrayIds
  - adjustDomainDimensions
  - propagateInvalidStmtDomains
  - buildAliasGroupsForAccesses

llvm-svn: 334939

6 years ago[ScopInfo] Move addNonEmptyDomainConstraints to isl++ [NFCI]
Tobias Grosser [Mon, 18 Jun 2018 12:41:58 +0000 (12:41 +0000)]
[ScopInfo] Move addNonEmptyDomainConstraints to isl++ [NFCI]

llvm-svn: 334938

6 years agoMove buildConditionSet to C++
Tobias Grosser [Mon, 18 Jun 2018 12:35:36 +0000 (12:35 +0000)]
Move buildConditionSet to C++

llvm-svn: 334937

6 years agoUpdate copyright year to 2018.
Paul Robinson [Mon, 18 Jun 2018 12:22:17 +0000 (12:22 +0000)]
Update copyright year to 2018.

llvm-svn: 334936

6 years ago[analyzer] Checker for uninitialized C++ objects
Kristof Umann [Mon, 18 Jun 2018 11:50:17 +0000 (11:50 +0000)]
[analyzer] Checker for uninitialized C++ objects

This checker analyzes C++ constructor calls, and reports uninitialized fields.

Due to the nature of this problem (uninitialized fields after an object
construction), this checker doesn't search for bugs, but rather is a tool to
enforce a specific programming model where every field needs to be initialized.

This checker lands in alpha for now, and a number of followup patches will be
made to reduce false negatives and to make it easier for the user to understand
what rules the checker relies on, eg. whether a derived class' constructor is
responsible for initializing inherited data members or whether it should be
handled in the base class' constructor.

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

llvm-svn: 334935

6 years ago[SLPVectorizer] Avoid calling const VL.size() repeatedly in for-loop. NFCI.
Simon Pilgrim [Mon, 18 Jun 2018 11:35:36 +0000 (11:35 +0000)]
[SLPVectorizer] Avoid calling const VL.size() repeatedly in for-loop. NFCI.

llvm-svn: 334934

6 years ago[VPlanRecipeBase] Add insertBefore helper.
Florian Hahn [Mon, 18 Jun 2018 11:34:17 +0000 (11:34 +0000)]
[VPlanRecipeBase] Add insertBefore helper.

Reviewers: dcaballe, mkuper, hfinkel, hsaito, mssimpso

Reviewed By: dcaballe

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

llvm-svn: 334933

6 years ago[llvm-exegesis] Optionally ignore instructions without a sched class.
Clement Courbet [Mon, 18 Jun 2018 11:27:47 +0000 (11:27 +0000)]
[llvm-exegesis] Optionally ignore instructions without a sched class.

Summary: See PR37602.

Reviewers: RKSimon

Subscribers: llvm-commits, tschuett

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

llvm-svn: 334932

6 years ago[AArch64][SVE] Asm: Support for vector element compares.
Sander de Smalen [Mon, 18 Jun 2018 10:59:19 +0000 (10:59 +0000)]
[AArch64][SVE] Asm: Support for vector element compares.

This patch adds instructions for comparing elements from two vectors, e.g.
  cmpgt p0.s, p0/z, z0.s, z1.s

and also adds support for comparing to a 64-bit wide element vector, e.g.
  cmpgt p0.s, p0/z, z0.s, z1.d

The patch also contains aliases for certain comparisons, e.g.:
  cmple p0.s, p0/z, z0.s, z1.s => cmpge p0.s, p0/z, z1.s, z0.s
  cmplo p0.s, p0/z, z0.s, z1.s => cmphi p0.s, p0/z, z1.s, z0.s
  cmpls p0.s, p0/z, z0.s, z1.s => cmphs p0.s, p0/z, z1.s, z0.s
  cmplt p0.s, p0/z, z0.s, z1.s => cmpgt p0.s, p0/z, z1.s, z0.s

llvm-svn: 334931

6 years ago[ASTMatchers] Add support for matching the type of a friend decl.
David L. Jones [Mon, 18 Jun 2018 09:23:08 +0000 (09:23 +0000)]
[ASTMatchers] Add support for matching the type of a friend decl.

This allows matchers like:

  friendDecl(hasType(cxxRecordDecl(...)))
  friendDecl(hasType(asString(...)))

It seems that hasType is probably the most reasonable narrowing matcher to
overload, since it is already used to narrow to other declaration kinds.

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

Reviewers: klimek, aaron.ballman

Subscribers: cfe-commits
llvm-svn: 334930

6 years ago[ASTMatchers] Don't assert-fail in specifiesTypeLoc().
David L. Jones [Mon, 18 Jun 2018 08:59:16 +0000 (08:59 +0000)]
[ASTMatchers] Don't assert-fail in specifiesTypeLoc().

The specifiesTypeLoc() matcher narrows a nestedNameSpecifier matcher based on a
typeloc within the NNS. However, the matcher does not guard against NNS which
are a namespace, and cause getTypeLoc to assert-fail.

llvm-svn: 334929

6 years ago[Fuzzer] Set an explicit libc++ dependency when needed
Petr Hosek [Mon, 18 Jun 2018 08:01:57 +0000 (08:01 +0000)]
[Fuzzer] Set an explicit libc++ dependency when needed

On targets that don't link internal libc++ (Fuchsia and Linux) but
use libc++ as their C++ library and libFuzzer is being built using
the just built compiler together with libc++ as part of runtimes, we
need an explicit dependency from libFuzzer object library to libc++ to
make sure the headers are available by the time we start building
libFuzzer.

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

llvm-svn: 334928

6 years ago[X86] Fix NOOP sched overrides on BDW/HSW/SKL.
Clement Courbet [Mon, 18 Jun 2018 06:48:22 +0000 (06:48 +0000)]
[X86] Fix NOOP sched overrides on BDW/HSW/SKL.

Summary: Noop certainly does not use resources.

Reviewers: RKSimon, craig.topper, andreadb

Subscribers: gbedwell, llvm-commits, gchatelet

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

llvm-svn: 334927

6 years agoFix libcxxabi tests after clang r334924
Vitaly Buka [Mon, 18 Jun 2018 06:43:55 +0000 (06:43 +0000)]
Fix libcxxabi tests after clang r334924

llvm-svn: 334926

6 years ago[X86] Create X86InstrFMA3Group objects fully in a static table instead of on the...
Craig Topper [Mon, 18 Jun 2018 06:32:22 +0000 (06:32 +0000)]
[X86] Create X86InstrFMA3Group objects fully in a static table instead of on the heap. NFCI

Previously we heap allocated the X86InstrFMA3Group objects which were created by passing them small register/memory opcode arrays that existed as individual static tables.

Rather than a bunch of small static arrays we now have one large static table of X86InstrFMA3Group objects. Rather than storing a pointer to the opcode arrays in the X86InstrFMA3Group object, we now store have a register and memory array as part of the object. If a group doesn't have memory or register opcodes, the array entries will be 0.

This greatly simplifies the destruction of the X86InstrFMA3Info object. We no longer need to delete the X86InstrFMA3Group objects as we destruct the DenseMap. And we don't need to keep track of which ones we already deleted.

This reduces the llc binary size on my local machine by ~50k. I can only assume that's really due to the fact that we had something like 512 small static arrays that we passed to the init functions either one at a time or in pairs. So there were between 256 and 512 distinct calls to the init functions in the initOnceImpl method.

llvm-svn: 334925

6 years agoFix libcxx tests after clang r334677.
Vitaly Buka [Mon, 18 Jun 2018 06:24:29 +0000 (06:24 +0000)]
Fix libcxx tests after clang r334677.

llvm-svn: 334924

6 years ago[sanitizer] Suppress unused function warning
Vitaly Buka [Mon, 18 Jun 2018 05:55:44 +0000 (05:55 +0000)]
[sanitizer] Suppress unused function warning

llvm-svn: 334923

6 years ago[X86] Add '.s' aliases to the assembler for the various redundant move encodings...
Craig Topper [Mon, 18 Jun 2018 05:00:50 +0000 (05:00 +0000)]
[X86] Add '.s' aliases to the assembler for the various redundant move encodings to match gas and our EVEX instructions.

We already have these aliases for EVEX enocded instructions, but not for the GPR, MMX, SSE, and VEX versions.

Also remove the vpextrw.s EVEX alias. That's not something gas implements.

llvm-svn: 334922

6 years agoFix the 'tb' alias command
Frederic Riss [Mon, 18 Jun 2018 04:34:33 +0000 (04:34 +0000)]
Fix the 'tb' alias command

No idea when this broke or if it ever worked. Added a small test
for one-shot breakpoints while I was there.

llvm-svn: 334921

6 years ago[X86] Move the 'vmovq.s' and similar assembly strings for EVEX vector moves with...
Craig Topper [Mon, 18 Jun 2018 01:28:05 +0000 (01:28 +0000)]
[X86] Move the 'vmovq.s' and similar assembly strings for EVEX vector moves with reversed operands to InstAliases.

The .s assembly strings allow the reversed forms to be targeted from assembly which matches gas behavior. But when printing the instructions we should print them without the .s to match other tooling like objdump. By using InstAliases we can use the normal string in the instruction and just hide it from the assembly parser.

Ideally we'd add the .s versions to the legacy SSE and VEX versions as well for full compatibility with gas. Not sure how we got to state where only EVEX was supported.

llvm-svn: 334920

6 years ago[TableGen] Prevent double flattening of InstAlias asm strings in the asm matcher...
Craig Topper [Mon, 18 Jun 2018 01:28:01 +0000 (01:28 +0000)]
[TableGen] Prevent double flattening of InstAlias asm strings in the asm matcher emitter.

Unlike CodeGenInstruction, CodeGenInstAlias was flatting asm strings in its constructor. For instructions it was the users responsibility to flatten the string.

AsmMatcherEmitter didn't know this and treated them the same. This caused double flattening of InstAliases. This is mostly harmless unless the desired assembly string contains curly braces. The second flattening wouldn't know to ignore these and would remove the curly braces. And for variant 1 it would remove the contents of them as well.

To mitigate this, this patch makes removes the flattening from the CodeGenIntAlias constructor and modifies AsmWriterEmitter to account for the flattening not having been done.

llvm-svn: 334919

6 years ago[ORC] Remove redundant condition
Lang Hames [Sun, 17 Jun 2018 23:54:58 +0000 (23:54 +0000)]
[ORC] Remove redundant condition

llvm-svn: 334918

6 years agoFix libcxx tests after clang r334677.
Richard Smith [Sun, 17 Jun 2018 19:58:45 +0000 (19:58 +0000)]
Fix libcxx tests after clang r334677.

Feature test macro versions may have a trailing L.

llvm-svn: 334917

6 years ago[ORC] Only notify queries that they are resolved/ready when the query state
Lang Hames [Sun, 17 Jun 2018 18:59:01 +0000 (18:59 +0000)]
[ORC] Only notify queries that they are resolved/ready when the query state
changes.

This guards against redundant notifications.

llvm-svn: 334916

6 years ago[X86] Add all the FMA instructions direclty to the load folding table instead of...
Craig Topper [Sun, 17 Jun 2018 18:00:16 +0000 (18:00 +0000)]
[X86] Add all the FMA instructions direclty to the load folding table instead of proxying through X86InstrFMA3Info.

These increases the size of the static tables, but is closer to what we would get if used the autogenerated table directly. This reduces the remaining large deltas between what's in the manual table and what's in the autogenerated table.

llvm-svn: 334915

6 years ago[sanitizer] Fix tsan GO build
Vitaly Buka [Sun, 17 Jun 2018 17:58:08 +0000 (17:58 +0000)]
[sanitizer] Fix tsan GO build

llvm-svn: 334914

6 years ago[sanitizer] Fix s390 build after r334900
Vitaly Buka [Sun, 17 Jun 2018 17:40:38 +0000 (17:40 +0000)]
[sanitizer] Fix s390 build after r334900

llvm-svn: 334913

6 years ago[sanitizer] Use confstr to check libc version in InitTlsSize
Vitaly Buka [Sun, 17 Jun 2018 17:31:22 +0000 (17:31 +0000)]
[sanitizer] Use confstr to check libc version in InitTlsSize

Reviewers: Lekensteyn, jakubjelinek

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 334912

6 years ago[ORC] Suppress an unused variable warning for a debug-mode only use.
Lang Hames [Sun, 17 Jun 2018 17:18:12 +0000 (17:18 +0000)]
[ORC] Suppress an unused variable warning for a debug-mode only use.

llvm-svn: 334911

6 years ago[ORC] Erase empty dependence sets when adding new symbol dependencies.
Lang Hames [Sun, 17 Jun 2018 16:59:53 +0000 (16:59 +0000)]
[ORC] Erase empty dependence sets when adding new symbol dependencies.

llvm-svn: 334910

6 years ago[ORC] In MaterializationResponsibility, only maintain the Materializing flag on
Lang Hames [Sun, 17 Jun 2018 16:59:52 +0000 (16:59 +0000)]
[ORC] In MaterializationResponsibility, only maintain the Materializing flag on
symbols in debug mode.

The MaterializationResponsibility class hijacks the Materializing flag to track
symbols that have not yet been resolved in order to guard against redundant
resolution. Since this is an API contract check and only enforced in debug mode
there is no reason to maintain the flag state in release mode.

llvm-svn: 334909

6 years ago[X86] Pass the parent SDNode to X86DAGToDAGISel::selectScalarSSELoad to simplify...
Craig Topper [Sun, 17 Jun 2018 16:29:46 +0000 (16:29 +0000)]
[X86] Pass the parent SDNode to X86DAGToDAGISel::selectScalarSSELoad to simplify the hasSingleUseFromRoot handling.

Some of the calls to hasSingleUseFromRoot were passing the load itself. If the load's chain result has a user this would count against that. By getting the true parent of the match and ensuring any intermediate between the match and the load have a single use we can avoid this case. isLegalToFold will take care of checking users of the load's data output.

This fixed at least fma-scalar-memfold.ll to succed without the peephole pass.

llvm-svn: 334908

6 years ago[llvm-mca][X86] Add some avx512f/avx512vl resource test placeholders
Simon Pilgrim [Sun, 17 Jun 2018 16:25:48 +0000 (16:25 +0000)]
[llvm-mca][X86] Add some avx512f/avx512vl resource test placeholders

There are a lot of instructions to add under these ISAs (and the other AVX512 variants) but this should demonstrate how to test for the EVEX instructions with different maskings

llvm-svn: 334907

6 years ago[AArch64][SVE] Asm: Support for bitwise operations on predicate vectors.
Sander de Smalen [Sun, 17 Jun 2018 10:48:21 +0000 (10:48 +0000)]
[AArch64][SVE] Asm: Support for bitwise operations on predicate vectors.

This patch adds support for instructions performing bitwise operations
on predicate vectors, including AND, BIC, EOR, NAND, NOR, ORN, ORR, and
their status flag setting variants ANDS, BICS, EORS, NANDS, ORNS, ORRS.

This patch also adds several aliases:

  orr  p0.b, p1/z, p1.b, p1.b  => mov  p0.b, p1.b
  orrs p0.b, p1/z, p1.b, p1.b  => movs p0.b, p1.b

  and  p0.b, p1/z, p2.b, p2.b  => mov  p0.b, p1/z, p2.b
  ands p0.b, p1/z, p2.b, p2.b  => movs p0.b, p1/z, p2.b

  eor  p0.b, p1/z, p2.b, p1.b  => not  p0.b, p1/z, p2.b
  eors p0.b, p1/z, p2.b, p1.b  => nots p0.b, p1/z, p2.b

llvm-svn: 334906

6 years ago[AArch64][SVE] Asm: Support for SEL (vector/predicate) instructions.
Sander de Smalen [Sun, 17 Jun 2018 10:11:04 +0000 (10:11 +0000)]
[AArch64][SVE] Asm: Support for SEL (vector/predicate) instructions.

Support for SVE's predicated select instructions to select elements
from either vector, both in a data-vector and a predicate-vector
variant.

llvm-svn: 334905

6 years ago[NVPTX] Ignore target-cpu and -features for inlining
Jonas Hahnfeld [Sun, 17 Jun 2018 09:55:20 +0000 (09:55 +0000)]
[NVPTX] Ignore target-cpu and -features for inlining

We don't want to prevent inlining because of target-cpu and -features
attributes that were added to newer versions of LLVM/Clang: There are
no incompatible functions in PTX, ptxas will throw errors in such cases.

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

llvm-svn: 334904

6 years agoRevert "[CMake] Use a different source depending on C++ support"
Jonas Hahnfeld [Sun, 17 Jun 2018 09:51:33 +0000 (09:51 +0000)]
Revert "[CMake] Use a different source depending on C++ support"

This reverts commit r332924 and followup r332936 silencing a warning.

The change breaks the build on x86 if there is no 32-bit version of the
C++ libraries, see discussion in https://reviews.llvm.org/D47169.

llvm-svn: 334903

6 years ago[fuzzer] Python 3 print fixes
Vitaly Buka [Sun, 17 Jun 2018 09:11:56 +0000 (09:11 +0000)]
[fuzzer] Python 3 print fixes

llvm-svn: 334902

6 years ago[fuzzer] Fix collect_data_flow.py for python 3
Vitaly Buka [Sun, 17 Jun 2018 08:41:56 +0000 (08:41 +0000)]
[fuzzer] Fix collect_data_flow.py for python 3

llvm-svn: 334901

6 years ago[sanitizer] Use const char* in internal_simple_strtoll
Vitaly Buka [Sun, 17 Jun 2018 08:41:45 +0000 (08:41 +0000)]
[sanitizer] Use const char* in internal_simple_strtoll

llvm-svn: 334900

6 years ago[WebAssembly] Simple comment fix. NFC.
Heejin Ahn [Sun, 17 Jun 2018 00:37:56 +0000 (00:37 +0000)]
[WebAssembly] Simple comment fix. NFC.

llvm-svn: 334899

6 years ago[X86] More additions to the load folding tables based on the autogenerated tables.
Craig Topper [Sat, 16 Jun 2018 23:25:50 +0000 (23:25 +0000)]
[X86] More additions to the load folding tables based on the autogenerated tables.

Including more additions for NotMemoryFoldable to remove some entries from the autogenerated table.

llvm-svn: 334898

6 years ago[X86] Hide POP16/32/64rmr and PUSH16/32/64rmr instructions from the assembly parser.
Craig Topper [Sat, 16 Jun 2018 23:25:48 +0000 (23:25 +0000)]
[X86] Hide POP16/32/64rmr and PUSH16/32/64rmr instructions from the assembly parser.

These all have a short form encoding that the assembler already prefers. Though that preference seems to only be based on order in the .td fie. Hiding the long form saves space in the table and prevents us from breaking the implicit order based priority.

llvm-svn: 334897

6 years ago[X86] Fix an inconsistency between AVX512 and AVX/SSE version on a couple instructions.
Craig Topper [Sat, 16 Jun 2018 23:25:47 +0000 (23:25 +0000)]
[X86] Fix an inconsistency between AVX512 and AVX/SSE version on a couple instructions.

VMOVPQIto64Zmr is not a 64-bit mode only instruction. But I don't know how to test this because VMOVPQIto64mr should always have priority over it in 32-bit mode since its only advantage is XMM16-XMM31 which aren't usable in 32-bit mode.

VMOVPQIto64Zrr is a 64-bit mode only instruction, but we don't need to explicitly mark it as such because it uses a GR64 register which won't parse in 32-bit mode.

llvm-svn: 334896

6 years agoCorrelatedValuePropagation: Preserve DT.
Michael Zolotukhin [Sat, 16 Jun 2018 18:57:31 +0000 (18:57 +0000)]
CorrelatedValuePropagation: Preserve DT.

Summary:
We only modify CFG in a couple of places, and we can preserve DT there
with a little effort.

Reviewers: davide, vsk

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 334895

6 years agoRemove P0771, which was not passed in Rapperswil
Marshall Clow [Sat, 16 Jun 2018 18:03:29 +0000 (18:03 +0000)]
Remove P0771, which was not passed in Rapperswil

llvm-svn: 334894