platform/upstream/llvm.git
5 years ago[X86][SSE] Add SimplifyDemandedVectorElts HADD/HSUB handling.
Simon Pilgrim [Sat, 11 May 2019 16:07:12 +0000 (16:07 +0000)]
[X86][SSE] Add SimplifyDemandedVectorElts HADD/HSUB handling.

Still missing PHADDW/PHSUBW tests because PEXTRW doesn't call SimplifyDemandedVectorElts

llvm-svn: 360526

5 years agoFixupLEAPass::fixupIncDec - non-LEA opcodes should not happen here. NFCI.
Simon Pilgrim [Sat, 11 May 2019 16:02:34 +0000 (16:02 +0000)]
FixupLEAPass::fixupIncDec - non-LEA opcodes should not happen here. NFCI.

Matches what we do in other functions and fixes scan-build warning about uninitialized NewOpcode variable.

llvm-svn: 360525

5 years ago[X86] Add CMOV_FR32X/CMOV_FR64X pseudo instructions. Use them in fast isel to fix...
Craig Topper [Sat, 11 May 2019 16:00:28 +0000 (16:00 +0000)]
[X86] Add CMOV_FR32X/CMOV_FR64X pseudo instructions. Use them in fast isel to fix a machine verifier error after adding test cases.

Fast isel picks the FR32X/FR64X register classes when lowering pseudo select, but it didn't have the right opcode to go with it.

llvm-svn: 360524

5 years ago[X86] Sink some fast isel code into the only if that uses it. NFC
Craig Topper [Sat, 11 May 2019 16:00:19 +0000 (16:00 +0000)]
[X86] Sink some fast isel code into the only if that uses it. NFC

llvm-svn: 360523

5 years ago[X86] Use TLI.getRegClassFor to simplify some more fast isel code. NFCI
Craig Topper [Sat, 11 May 2019 16:00:13 +0000 (16:00 +0000)]
[X86] Use TLI.getRegClassFor to simplify some more fast isel code. NFCI

llvm-svn: 360522

5 years ago[MC][X86] Add test cases from PR14056
Simon Pilgrim [Sat, 11 May 2019 15:51:14 +0000 (15:51 +0000)]
[MC][X86] Add test cases from PR14056

llvm-svn: 360521

5 years agoHexagonConstEvaluator::evaluateHexExt - check incoming opcodes. NFCI.
Simon Pilgrim [Sat, 11 May 2019 15:24:34 +0000 (15:24 +0000)]
HexagonConstEvaluator::evaluateHexExt - check incoming opcodes. NFCI.

Only certain extension opcodes are supported - fixes scan build warning.

llvm-svn: 360520

5 years ago[X86][SSE] Tweaked HADD/HSUB SimplifyDemandedVectorElts
Simon Pilgrim [Sat, 11 May 2019 14:47:54 +0000 (14:47 +0000)]
[X86][SSE] Tweaked HADD/HSUB SimplifyDemandedVectorElts

Try to ensure we LHS and RHS test coverage

llvm-svn: 360519

5 years ago[X86][SSE] Add integer HADD/HSUB SimplifyDemandedVectorElts tests
Simon Pilgrim [Sat, 11 May 2019 14:08:34 +0000 (14:08 +0000)]
[X86][SSE] Add integer HADD/HSUB SimplifyDemandedVectorElts tests

llvm-svn: 360518

5 years ago[X86][SSE] Add HADD/HSUB SimplifyDemandedVectorElts tests
Simon Pilgrim [Sat, 11 May 2019 12:46:38 +0000 (12:46 +0000)]
[X86][SSE] Add HADD/HSUB SimplifyDemandedVectorElts tests

Shows missed opportunities to simplify args.

Will add integer HADD/HSUB tests in a future commit.

llvm-svn: 360517

5 years agoFix uninitialized variable analyzer warning. NFCI.
Simon Pilgrim [Sat, 11 May 2019 11:08:24 +0000 (11:08 +0000)]
Fix uninitialized variable analyzer warning. NFCI.

llvm-svn: 360516

5 years agoConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.
Simon Pilgrim [Sat, 11 May 2019 11:01:46 +0000 (11:01 +0000)]
ConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.

Duplicate getOffset() call.

llvm-svn: 360515

5 years agoSelectionDAGISel::CodeGenAndEmitDAG - remove unused variable. NFCI.
Simon Pilgrim [Sat, 11 May 2019 11:00:37 +0000 (11:00 +0000)]
SelectionDAGISel::CodeGenAndEmitDAG - remove unused variable. NFCI.

llvm-svn: 360514

5 years ago[X86] Use getRegClassFor to simplify some code in fast isel. NFCI
Craig Topper [Sat, 11 May 2019 05:18:58 +0000 (05:18 +0000)]
[X86] Use getRegClassFor to simplify some code in fast isel. NFCI

No need to select the register class based on type and features. It should
already be setup by X86ISelLowering.

llvm-svn: 360513

5 years ago[X86] Don't emit MOVNTDQA loads from fast-isel without SSE4.1.
Craig Topper [Sat, 11 May 2019 04:19:33 +0000 (04:19 +0000)]
[X86] Don't emit MOVNTDQA loads from fast-isel without SSE4.1.

We were checking for SSE4.1 for FP types, but not integer 128-bit types.

Fixes PR41837.

llvm-svn: 360512

5 years ago[X86] Add a test case for idempotent atomic operations with speculative load hardenin...
Craig Topper [Sat, 11 May 2019 04:00:27 +0000 (04:00 +0000)]
[X86] Add a test case for idempotent atomic operations with speculative load hardening. Fix an additional issue found by the test.

This test covers the fix from r360475 as well.

llvm-svn: 360511

5 years ago[SystemZ] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 03:36:16 +0000 (03:36 +0000)]
[SystemZ] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360510

5 years ago[Breakpoint] Make breakpoint language agnostic
Alex Langford [Sat, 11 May 2019 03:32:25 +0000 (03:32 +0000)]
[Breakpoint] Make breakpoint language agnostic

Summary:
Breakpoint shouldn't need to depend on any specific details from a
programming language. Currently the only language-specific detail it takes
advantage of are the different qualified names an objective-c method name might
have when adding a name lookup. This is reasonably generalizable.

The current method name I introduced is "GetVariantMethodNames", which I'm not
particularly tied to. If you have a better suggestion, please do let me know.

Reviewers: JDevlieghere, jingham, clayborg

Subscribers: mgorny, lldb-commits

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

llvm-svn: 360509

5 years agogn build: sort tablegen rules for X86 and AArch64
David L. Jones [Sat, 11 May 2019 03:23:37 +0000 (03:23 +0000)]
gn build: sort tablegen rules for X86 and AArch64

llvm-svn: 360508

5 years agogn build: merge r360494 and r360502
David L. Jones [Sat, 11 May 2019 03:20:09 +0000 (03:20 +0000)]
gn build: merge r360494 and r360502

llvm-svn: 360507

5 years ago[Sparc] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 02:59:02 +0000 (02:59 +0000)]
[Sparc] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360506

5 years ago[RISCV] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 02:43:58 +0000 (02:43 +0000)]
[RISCV] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure

llvm-svn: 360505

5 years ago[compiler-rt] Fix crtbegin.c compilation
Shoaib Meenai [Sat, 11 May 2019 02:33:33 +0000 (02:33 +0000)]
[compiler-rt] Fix crtbegin.c compilation

We're building with -std=c11 now (as opposed to -std=gnu11), so we can't
use GNU extensions and need to spell inline assembly as __asm__.

llvm-svn: 360503

5 years ago[PowerPC] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 02:33:18 +0000 (02:33 +0000)]
[PowerPC] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360502

5 years ago[NVPTX] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 02:09:13 +0000 (02:09 +0000)]
[NVPTX] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360500

5 years agoReject attempts to call non-static member functions on objects outside
Richard Smith [Sat, 11 May 2019 02:00:06 +0000 (02:00 +0000)]
Reject attempts to call non-static member functions on objects outside
their lifetime in constant expressions.

This is undefined behavior per [class.cdtor]p2.

We continue to allow this for objects whose values are not visible
within the constant evaluation, because there's no way we can tell
whether the access is defined or not, existing code relies on the
ability to make such calls, and every other compiler allows such
calls.

llvm-svn: 360499

5 years ago[MSP430] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:58:52 +0000 (01:58 +0000)]
[MSP430] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360498

5 years ago[Mips] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:38:56 +0000 (01:38 +0000)]
[Mips] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360497

5 years ago[Lanai] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:25:58 +0000 (01:25 +0000)]
[Lanai] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360496

5 years ago[cc1as] Change -compress-debug-sections= to use --
Fangrui Song [Sat, 11 May 2019 01:14:50 +0000 (01:14 +0000)]
[cc1as] Change -compress-debug-sections= to use --

The double dash form is documented by GNU as, used by gcc, and accepted by llvm-mc.

llvm-svn: 360495

5 years ago[BPF] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:13:21 +0000 (01:13 +0000)]
[BPF] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360494

5 years ago[AVR] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 01:03:03 +0000 (01:03 +0000)]
[AVR] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360493

5 years agogn build: merge r360490
David L. Jones [Sat, 11 May 2019 00:44:30 +0000 (00:44 +0000)]
gn build: merge r360490

llvm-svn: 360492

5 years agogn build: merge r360484 and r360486
David L. Jones [Sat, 11 May 2019 00:35:53 +0000 (00:35 +0000)]
gn build: merge r360484 and r360486

llvm-svn: 360491

5 years ago[ARM] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 00:34:07 +0000 (00:34 +0000)]
[ARM] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360490

5 years agogn build: merge r360345
David L. Jones [Sat, 11 May 2019 00:20:18 +0000 (00:20 +0000)]
gn build: merge r360345

llvm-svn: 360489

5 years ago[ARC] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 00:13:01 +0000 (00:13 +0000)]
[ARC] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360488

5 years ago[AMDGPU] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Sat, 11 May 2019 00:03:35 +0000 (00:03 +0000)]
[AMDGPU] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360487

5 years ago[AArch64] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Fri, 10 May 2019 23:50:01 +0000 (23:50 +0000)]
[AArch64] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360486

5 years ago[XCore] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Fri, 10 May 2019 23:36:49 +0000 (23:36 +0000)]
[XCore] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360485

5 years ago[X86] Move InstPrinter files to MCTargetDesc. NFC
Richard Trieu [Fri, 10 May 2019 23:24:38 +0000 (23:24 +0000)]
[X86] Move InstPrinter files to MCTargetDesc.  NFC

For some targets, there is a circular dependency between InstPrinter and
MCTargetDesc.  Merging them together will fix this.  For the other targets,
the merging is to maintain consistency so all targets will have the same
structure.

llvm-svn: 360484

5 years ago[Darwin] Introduce a new flag, -fapple-link-rtlib that forces linking of the builtins...
Amara Emerson [Fri, 10 May 2019 23:24:20 +0000 (23:24 +0000)]
[Darwin] Introduce a new flag, -fapple-link-rtlib that forces linking of the builtins library.

This driver flag is useful when users want to link against the compiler's
builtins, but nothing else, and so use flags like -nostdlib.

Darwin can't use -nolibc & nostdlib++ like other platforms on because we
disable all runtime lib linking with -static, which we still want to have
an option to link with the builtins.

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

llvm-svn: 360483

5 years agoChange the disabling of packet logging to be in TearDownHook lambdas.
Jason Molenda [Fri, 10 May 2019 23:22:15 +0000 (23:22 +0000)]
Change the disabling of packet logging to be in TearDownHook lambdas.

llvm-svn: 360482

5 years agoRevert [DAGCombiner] Avoid creating large tokenfactors in visitTokenFactor
Jordan Rupprecht [Fri, 10 May 2019 23:20:02 +0000 (23:20 +0000)]
Revert [DAGCombiner] Avoid creating large tokenfactors in visitTokenFactor

This reverts r360171 (git commit a9d6c32eafc645c55b07eb50698c428e14c0bffd). A repro showing the asan/msan failures is forthcoming.

llvm-svn: 360481

5 years agoTed pointed out that some of test tests that are enabling packet
Jason Molenda [Fri, 10 May 2019 23:03:05 +0000 (23:03 +0000)]
Ted pointed out that some of test tests that are enabling packet
logging when the testsuite is run with trace mode enabled are leaving
the logging enabled after the tests have finished.  That state
isn't cleared in a --no-multiprocess testsuite run.

llvm-svn: 360480

5 years agoFactor out redzone ABI checks [NFCI]
Philip Reames [Fri, 10 May 2019 22:55:42 +0000 (22:55 +0000)]
Factor out redzone ABI checks [NFCI]

As requested in D58632, cleanup our red zone detection logic in the X86 backend. The existing X86MachineFunctionInfo flag is used to track whether we *use* the redzone (via a particularly optimization?), but there's no common way to check whether the function *has* a red zone.

I'd appreciate careful review of the uses being updated. I think they are NFC, but a careful eye from someone else would be appreciated.

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

llvm-svn: 360479

5 years ago[ORC] Make a narrowing-cast explicit to silence a compiler warning.
Lang Hames [Fri, 10 May 2019 22:51:03 +0000 (22:51 +0000)]
[ORC] Make a narrowing-cast explicit to silence a compiler warning.

llvm-svn: 360478

5 years ago[JITLink][MachO] Mark atoms in sections 'no-dead-strip' set live by default.
Lang Hames [Fri, 10 May 2019 22:24:37 +0000 (22:24 +0000)]
[JITLink][MachO] Mark atoms in sections 'no-dead-strip' set live by default.

If a MachO section has the no-dead-strip attribute set then its atoms should
be preserved, regardless of whether they're public or referenced elsewhere in
the object.

llvm-svn: 360477

5 years ago[COFF] Update LLD yaml test cases to include .bss size
Reid Kleckner [Fri, 10 May 2019 22:12:51 +0000 (22:12 +0000)]
[COFF] Update LLD yaml test cases to include .bss size

These yaml test cases appear to have been affected by PR41836

Right now what happens is that these empty .bss sections are merged into
.data, then the .data output section ends up having a zero virtual size,
and it is discarded from the output after addresses are assigned.
However, we've already assigned OutputSections to Chunks, so we don't
correctly report the zero-sized chunks that were in there as having been
discarded. Soon, we will report them as discarded, so these test cases
need to be updated to have a non-zero size so they aren't discarded.

llvm-svn: 360476

5 years ago[X86] Disable speculative load hardening for operations with an explicit RSP base.
Craig Topper [Fri, 10 May 2019 22:03:33 +0000 (22:03 +0000)]
[X86] Disable speculative load hardening for operations with an explicit RSP base.

After D58632, we can create idempotent atomic operations to the top of stack.
This confused speculative load hardening because it thinks accesses should have
virtual register base except for the cases it already excluded.

This commit adds a new exclusion for this case. I'll try to reduce a test case
for this, but this fix was verified to work by the reporter. This should avoid
needing to revert D58632.

llvm-svn: 360475

5 years ago[CodeGen][ObjC] Emit invoke instead of call to call `objc_release` when
Akira Hatanaka [Fri, 10 May 2019 21:54:16 +0000 (21:54 +0000)]
[CodeGen][ObjC] Emit invoke instead of call to call `objc_release` when
necessary.

Prior to r349952, clang used to call objc_msgSend when sending a release
messages, emitting an invoke instruction instead of a call instruction
when it was necessary to catch an exception. That changed in r349952
because runtime function objc_release is called as a nounwind function,
which broke programs that were overriding the dealloc method and
throwing an exception from it. This patch restores the behavior prior to
r349952.

rdar://problem/50253394

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

llvm-svn: 360474

5 years ago[COFF] Fix .bss section size bug in obj2yaml / yaml2obj
Reid Kleckner [Fri, 10 May 2019 21:53:44 +0000 (21:53 +0000)]
[COFF] Fix .bss section size bug in obj2yaml / yaml2obj

We need to serialize SizeOfRawData through even when there is no data,
as in a .bss section.

Fixes PR41836

llvm-svn: 360473

5 years ago[LegalizeVectorOps] Remove calls to LegalizeOp on the return value from ExpandLoad...
Craig Topper [Fri, 10 May 2019 21:42:27 +0000 (21:42 +0000)]
[LegalizeVectorOps] Remove calls to LegalizeOp on the return value from ExpandLoad/ExpandStore.

We already updated the LegalizedNodes map at the end of the Expand call. This
would have marked the new node as being mapped to itself. So the LegalizeOp
call will find that an immediately return.

llvm-svn: 360472

5 years agoSkip over prefetches
Mircea Trofin [Fri, 10 May 2019 21:27:55 +0000 (21:27 +0000)]
Skip over prefetches

Summary: Skip over prefetches when assigning debug info to instructions with memory operands. This way, the debug info is stable after instrumenting a binary with prefetches, allowing for iterative profiling and instrumentation.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360471

5 years ago[SDAG] Recursively legalize both vector mulo results
Nikita Popov [Fri, 10 May 2019 20:42:48 +0000 (20:42 +0000)]
[SDAG] Recursively legalize both vector mulo results

Split out from D61692 per RKSimon's suggestion. Vector op
legalization will automatically recursively legalize the returned
SDValue, but we need to take care of the other results ourselves.
Otherwise it will end up getting legalized only during op
legalization, by which point it might be too late (though I'm not
aware of any specific cases right now).

There are codegen differences because expansion occurs earlier now
and we don't get a DAGCombiner run in between.

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

llvm-svn: 360470

5 years ago[ThinLTO] Clang test changes for new CanAutoHide flag
Teresa Johnson [Fri, 10 May 2019 20:38:31 +0000 (20:38 +0000)]
[ThinLTO] Clang test changes for new CanAutoHide flag

llvm-svn: 360468

5 years agoFixed tests where grep was not matching the linefeed
Alexandre Ganea [Fri, 10 May 2019 20:11:36 +0000 (20:11 +0000)]
Fixed tests where grep was not matching the linefeed

When files are synchronized locally as CRLF on Windows, grep didn't match the newline. Switched to FileCheck instead.

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

llvm-svn: 360467

5 years ago[ThinLTO] Auto-hide prevailing linkonce_odr only when all copies eligible
Teresa Johnson [Fri, 10 May 2019 20:08:24 +0000 (20:08 +0000)]
[ThinLTO] Auto-hide prevailing linkonce_odr only when all copies eligible

Summary:
We hit undefined references building with ThinLTO when one source file
contained explicit instantiations of a template method (weak_odr) but
there were also implicit instantiations in another file (linkonce_odr),
and the latter was the prevailing copy. In this case the symbol was
marked hidden when the prevailing linkonce_odr copy was promoted to
weak_odr. It led to unsats when the resulting shared library was linked
with other code that contained a reference (expecting to be resolved due
to the explicit instantiation).

Add a CanAutoHide flag to the GV summary to allow the thin link to
identify when all copies are eligible for auto-hiding (because they were
all originally linkonce_odr global unnamed addr), and only do the
auto-hide in that case.

Most of the changes here are due to plumbing the new flag through the
bitcode and llvm assembly, and resulting test changes. I augmented the
existing auto-hide test to check for this situation.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, eraman, dexonsmith, arphaman, dang, llvm-commits, steven_wu, wmi

Tags: #llvm

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

llvm-svn: 360466

5 years agoAdd target triple to test.
Leonard Chan [Fri, 10 May 2019 20:07:47 +0000 (20:07 +0000)]
Add target triple to test.

llvm-svn: 360465

5 years agoFix handling of objects under construction during constant expression
Richard Smith [Fri, 10 May 2019 20:05:32 +0000 (20:05 +0000)]
Fix handling of objects under construction during constant expression
evaluation.

It's not enough to just track the LValueBase that we're evaluating, we
need to also track the path to the objects whose constructors are
running.

llvm-svn: 360464

5 years agoImprove interface of APValuePathEntry.
Richard Smith [Fri, 10 May 2019 20:05:31 +0000 (20:05 +0000)]
Improve interface of APValuePathEntry.

llvm-svn: 360463

5 years ago[DAGCombiner] reduce code duplication; NFC
Sanjay Patel [Fri, 10 May 2019 20:02:30 +0000 (20:02 +0000)]
[DAGCombiner] reduce code duplication; NFC

llvm-svn: 360462

5 years agoAdd InstCombine::visitFNeg(...)
Cameron McInally [Fri, 10 May 2019 20:01:04 +0000 (20:01 +0000)]
Add InstCombine::visitFNeg(...)

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

llvm-svn: 360461

5 years ago[CVP] Add tests for urem, sdiv, srem ranges; NFC
Nikita Popov [Fri, 10 May 2019 19:36:38 +0000 (19:36 +0000)]
[CVP] Add tests for urem, sdiv, srem ranges; NFC

We currently don't calcuate result ranges for these binary operators.

llvm-svn: 360460

5 years ago[crt] Use -std=c11 for crtbegin.o/crtend.o
Petr Hosek [Fri, 10 May 2019 19:23:56 +0000 (19:23 +0000)]
[crt] Use -std=c11 for crtbegin.o/crtend.o

The source uses C11 syntax such as comments and some compilers print
warnings without specifying this flag.

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

llvm-svn: 360459

5 years agoDebugInfo: Only move types out of type units if they're named or type united
David Blaikie [Fri, 10 May 2019 19:15:29 +0000 (19:15 +0000)]
DebugInfo: Only move types out of type units if they're named or type united

Follow up to r359122, after a bug was reported in it - the original
change too aggressively tried to move related types out of type units,
which included unnamed types (like array types) which can't reasonably
be declared-but-not-defined.

A step beyond that is that some types in type units can be anonymous, if
they are types with a name for linkage purposes (eg: "typedef struct { }
x;"). So ensure those don't get turned into plain declarations (without
signatures) because, lacking names, they can't be resolved to the
definition.

[Also include a fix for llvm-dwarfdump/libDebugInfoDWARF to pretty print
types in type units]

llvm-svn: 360458

5 years ago[OPENMP][NVPTX]Improve number of threads counter, NFC.
Alexey Bataev [Fri, 10 May 2019 18:56:05 +0000 (18:56 +0000)]
[OPENMP][NVPTX]Improve number of threads counter, NFC.

Summary:
Patch improves performance of the full runtime mode by moving
number-of-threads counter to the shared memory. It also allows to save
global memory.

Reviewers: grokos, gtbercea, kkwli0

Subscribers: guansong, jfb, jdoerfert, openmp-commits, caomhin

Tags: #openmp

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

llvm-svn: 360457

5 years ago[SLP] Refactor VectorizableTree to use unique_ptr.
Simon Pilgrim [Fri, 10 May 2019 18:55:17 +0000 (18:55 +0000)]
[SLP] Refactor VectorizableTree to use unique_ptr.

This patch fixes the TreeEntry dangling pointer issue caused by reallocations of VectorizableTree.

Committed on behalf of @vporpo (Vasileios Porpodas)

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

llvm-svn: 360456

5 years agoReplace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
Paul Robinson [Fri, 10 May 2019 18:47:39 +0000 (18:47 +0000)]
Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
to say the same thing.

llvm-svn: 360455

5 years ago[ZoneAlgo] Fix PHI inconsistency in invalid contexts.
Michael Kruse [Fri, 10 May 2019 18:38:13 +0000 (18:38 +0000)]
[ZoneAlgo] Fix PHI inconsistency in invalid contexts.

PHI nodes (reads) could point to multiple instances of predecessor
blocks (PHI writes) when in an invalid context. Fix by removing PHI
instances that are in an invalid or ouside assumed context.

This fixes llvm.org/PR41656.

llvm-svn: 360454

5 years ago[NFC][TSan][libdispatch] Tiny CMake file cleanup
Julian Lettner [Fri, 10 May 2019 18:37:30 +0000 (18:37 +0000)]
[NFC][TSan][libdispatch] Tiny CMake file cleanup

llvm-svn: 360453

5 years agoReplace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
Paul Robinson [Fri, 10 May 2019 18:32:53 +0000 (18:32 +0000)]
Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
to say the same thing.

llvm-svn: 360452

5 years agoRemoving an unused member variable; NFC.
Aaron Ballman [Fri, 10 May 2019 18:29:10 +0000 (18:29 +0000)]
Removing an unused member variable; NFC.

llvm-svn: 360451

5 years ago[clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_check'
Don Hinton [Fri, 10 May 2019 18:27:09 +0000 (18:27 +0000)]
[clang-tidy] Change the namespace for llvm checkers from 'llvm' to 'llvm_check'

Summary:
Change the namespace for llvm checkers from 'llvm' to
'llvm_check', and modify add_new_check.py and rename_check.py to
support the new namespace. Checker, file, and directory names remain
unchanged.

Used new version of rename_check.py to make the change in existing
llvm checkers, but had to fix LLVMTidyModule.cpp and
LLVMModuleTest.cpp by hand.

The changes made by rename_check.py are idempotent, so if accidentally
run multiple times, it won't do anything.

Reviewed By: aaron.ballman

Tags: #clang, #clang-tools-extra

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

llvm-svn: 360450

5 years agoReplace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
Paul Robinson [Fri, 10 May 2019 18:08:02 +0000 (18:08 +0000)]
Replace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
expresses the intent of the exclusion.

llvm-svn: 360449

5 years agoFix and test for assertion error in P41835.
Leonard Chan [Fri, 10 May 2019 18:05:15 +0000 (18:05 +0000)]
Fix and test for assertion error in P41835.

llvm-svn: 360448

5 years agoReplace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
Paul Robinson [Fri, 10 May 2019 17:57:22 +0000 (17:57 +0000)]
Replace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that better
expresses the intent of the exclusion.

llvm-svn: 360447

5 years ago[Sema] Mark array element destructors referenced during initialization
Erik Pilkington [Fri, 10 May 2019 17:52:26 +0000 (17:52 +0000)]
[Sema] Mark array element destructors referenced during initialization

This fixes a crash where we would neglect to mark a destructor referenced for an
__attribute__((no_destory)) array. The destructor is needed though, since if an
exception is thrown we need to cleanup the elements.

rdar://48462498

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

llvm-svn: 360446

5 years ago[CVP] Add tests for abs and nabs spf; NFC
Nikita Popov [Fri, 10 May 2019 17:39:50 +0000 (17:39 +0000)]
[CVP] Add tests for abs and nabs spf; NFC

One half of the bound is already computed correctly for these
tests, the other isn't.

llvm-svn: 360445

5 years ago[LSR] Tweak setup cost depth threshold to 10.
Amara Emerson [Fri, 10 May 2019 17:29:35 +0000 (17:29 +0000)]
[LSR] Tweak setup cost depth threshold to 10.

The original change introduced a depth limit of 7 which caused a 22% regression
in the Swift MapReduceLazyCollection & Ackermann benchmarks. This new threshold
still ensures that the original test case doesn't hang.

rdar://50359639

llvm-svn: 360444

5 years agoFinish renaming CompileUnit -> Unit
Jan Kratochvil [Fri, 10 May 2019 17:14:37 +0000 (17:14 +0000)]
Finish renaming CompileUnit -> Unit

D42892 changed a lot of code to use superclass DWARFUnit instead of its
subclass DWARFCompileUnit.

Finish this change more thoroughly for any *CompileUnit* -> *Unit* names.
Later patch will introduce DWARFTypeUnit which needs to be sometimes different
from DWARFCompileUnit and it would be confusing without this renaming.

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

llvm-svn: 360443

5 years ago[MC][ELF] Copy top 3 bits of st_other to .symver aliases
Fangrui Song [Fri, 10 May 2019 17:09:25 +0000 (17:09 +0000)]
[MC][ELF] Copy top 3 bits of st_other to .symver aliases

On PowerPC64 ELFv2 ABI, the top 3 bits of st_other encode the local
entry offset. A versioned symbol alias created by .symver should copy
the bits from the source symbol.

This partly fixes PR41048. A full fix needs tracking of .set assignments
and updating st_other fields when finish() is called, see D56586.

Patch by Alfredo Dal'Ava JĂșnior

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

llvm-svn: 360442

5 years agoAdjust MachineScheduler to use ProcResource counts
Momchil Velikov [Fri, 10 May 2019 16:54:32 +0000 (16:54 +0000)]
Adjust MachineScheduler to use ProcResource counts

This fix allows the scheduler to take into account the number of instances of
each ProcResource specified. Previously a declaration in a scheduler of
ProcResource<1> would be treated identically to a declaration of
ProcResource<2>. Now the hazard recognizer would report a hazard only after all
of the resource instances are busy.

Patch by Jackson Woodruff and Momchil Velikov.

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

llvm-svn: 360441

5 years ago[llvm-objdump] Print st_other
Fangrui Song [Fri, 10 May 2019 16:24:57 +0000 (16:24 +0000)]
[llvm-objdump] Print st_other

Add support for ".hidden" ".internal" ".protected" and " 0x%02x" for
other st_other bits used by some architectures.

Reviewed By: sfertile

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

llvm-svn: 360439

5 years agoRecommit r360345 with fixes (was reverted in r360348).
Aaron Ballman [Fri, 10 May 2019 16:24:28 +0000 (16:24 +0000)]
Recommit r360345 with fixes (was reverted in r360348).

Add the modernize-use-trailing-return check to rewrite function signatures to use trailing return types.

Patch by Bernhard Manfred Gruber.

llvm-svn: 360438

5 years agoPull r360426 as it is breaking the build bots.
Nemanja Ivanovic [Fri, 10 May 2019 16:03:22 +0000 (16:03 +0000)]
Pull r360426 as it is breaking the build bots.

llvm-svn: 360437

5 years ago[X86] Avoid SFB - Fix inconsistent codegen with/without debug info
Robert Lougher [Fri, 10 May 2019 15:55:06 +0000 (15:55 +0000)]
[X86] Avoid SFB - Fix inconsistent codegen with/without debug info

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

The functions findPotentiallyBlockedCopies and buildCopy are currently not
accounting for the presence of debug instructions. In the former this results
in the optimization not being trigerred, and in the latter results in
inconsistent codegen.

This patch enables the optimization to be performed in a debug build and
ensures the codegen is consistent with non-debug builds.

Patch by Chris Dawson.

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

llvm-svn: 360436

5 years ago[X86][SSE] Add getHopForBuildVector vector splitting
Simon Pilgrim [Fri, 10 May 2019 15:46:04 +0000 (15:46 +0000)]
[X86][SSE] Add getHopForBuildVector vector splitting

If we only use the lower xmm of a ymm hop, then extract the xmm's (for free), perform the xmm hop and then insert back into a ymm (for free).

Fixes some of the regressions noted in D61782

llvm-svn: 360435

5 years agoAnother attempt to fix the build bot breaks after r360426
Nemanja Ivanovic [Fri, 10 May 2019 15:44:56 +0000 (15:44 +0000)]
Another attempt to fix the build bot breaks after r360426

The test case checks were produced by the update_test_checks.py
scripts and I assumed that is sufficient. However, the behaviour
is different with different default target triples. Specify the
triple explicitly in the test case.

If this doesn't clean up the build bot breaks, I'll remove the test
case until I can get to the bottom of why the behaviour on build bots
is different from my machine.

llvm-svn: 360434

5 years agoFix build break after r360426
Nemanja Ivanovic [Fri, 10 May 2019 15:11:40 +0000 (15:11 +0000)]
Fix build break after r360426

llvm-svn: 360433

5 years agominidump: Don't eagerly resolve module paths read from the minidump
Pavel Labath [Fri, 10 May 2019 15:05:26 +0000 (15:05 +0000)]
minidump: Don't eagerly resolve module paths read from the minidump

This can cause us to return paths to files on the local filesystem even
if we don't end up using that file (for instance because the file is not
a real module).

llvm-svn: 360432

5 years ago[InferAddressSpaces] Enhance the handling of cosntexpr.
Michael Liao [Fri, 10 May 2019 14:57:42 +0000 (14:57 +0000)]
[InferAddressSpaces] Enhance the handling of cosntexpr.

Summary:
- Constant expressions may not be added in strict postorder as the
  forward instruction scan order. Thus, for a constant express (CE0), if
  its operand (CE1) is used in an previous instruction, they are not in
  postorder. However, different from
  `cloneInstructionWithNewAddressSpace`,
  `cloneConstantExprWithNewAddressSpace` doesn't bookkeep uninferred
  instructions for later resolving. That results in failure of inferring
  constant address.
- This patch adds the support to infer constant expression operand
  recursively, since there won't be loop, if that operand is another
  constant expression.

Reviewers: arsenm

Subscribers: jholewinski, jvesely, wdng, nhaehnle, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360431

5 years agoFix some gcc warnings in compiler-rt
Nico Weber [Fri, 10 May 2019 14:15:13 +0000 (14:15 +0000)]
Fix some gcc warnings in compiler-rt

- Several "warning: extra ';' [-Wpedantic]"
- One "C++ style comments are not allowed in ISO C90 [enabled by default]"
  in a file that uses C style comments everywhere but in one place

llvm-svn: 360430

5 years ago[PowerPC] custom lower `v2f64 fpext v2f32`
Lei Huang [Fri, 10 May 2019 14:04:06 +0000 (14:04 +0000)]
[PowerPC] custom lower `v2f64 fpext v2f32`

Reduces scalarization overhead via custom lowering of v2f64 fpext v2f32.

eg. For the following IR
  %0 = load <2 x float>, <2 x float>* %Ptr, align 8
  %1 = fpext <2 x float> %0 to <2 x double>
  ret <2 x double> %1

Pre custom lowering:
  ld r3, 0(r3)
  mtvsrd f0, r3
  xxswapd vs34, vs0
  xscvspdpn f0, vs0
  xxsldwi vs1, vs34, vs34, 3
  xscvspdpn f1, vs1
  xxmrghd vs34, vs0, vs1

After custom lowering:
  lfd f0, 0(r3)
  xxmrghw vs0, vs0, vs0
  xvcvspdp vs34, vs0

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

llvm-svn: 360429

5 years ago[libclang] Forward isInline for NamespaceDecl to libclang
Nikolai Kosjar [Fri, 10 May 2019 13:58:34 +0000 (13:58 +0000)]
[libclang] Forward isInline for NamespaceDecl to libclang

llvm-svn: 360428

5 years agoAdd name comments for bools passed to getObjCEncodingForTypeImpl()
Nico Weber [Fri, 10 May 2019 13:56:56 +0000 (13:56 +0000)]
Add name comments for bools passed to getObjCEncodingForTypeImpl()

No behavior change. Medium term, probably want to use a bitmask instead
of 8 distinct bool parameters, but let's make the call sites easier to
read first.

llvm-svn: 360427

5 years ago[Pass Pipeline][NFC] Add a test prior to committing D61726
Nemanja Ivanovic [Fri, 10 May 2019 13:47:00 +0000 (13:47 +0000)]
[Pass Pipeline][NFC] Add a test prior to committing D61726

This patch just adds a test case to show the differences in code emitted
by opt before and after https://reviews.llvm.org/D61726.

llvm-svn: 360426

5 years agoReplace lit feature keyword 'non-ms-sdk' with 'ms-sdk'; eliminate
Paul Robinson [Fri, 10 May 2019 13:40:17 +0000 (13:40 +0000)]
Replace lit feature keyword 'non-ms-sdk' with 'ms-sdk'; eliminate
'non-ps4-sdk' and use just 'ps4'.

llvm-svn: 360425

5 years agoPre-commit InstCombine::visitFNeg(...) test.
Cameron McInally [Fri, 10 May 2019 13:18:57 +0000 (13:18 +0000)]
Pre-commit InstCombine::visitFNeg(...) test.

llvm-svn: 360424

5 years ago[lldb] [lit] Fix clobbers in x86_64 register test
Michal Gorny [Fri, 10 May 2019 13:12:36 +0000 (13:12 +0000)]
[lldb] [lit] Fix clobbers in x86_64 register test

llvm-svn: 360423