OSDN Git Service

android-x86/external-llvm.git
5 years agoRefine ArgPromotion metadata handling
Teresa Johnson [Thu, 14 Feb 2019 14:14:24 +0000 (14:14 +0000)]
Refine ArgPromotion metadata handling

Summary:
In r353537 we now copy all metadata to the new function, with the old
being removed when the old function is eliminated. In some cases the old
function is dropped to a declaration (seems to only occur with the old
PM). Go ahead and clear all metadata from the old function to handle that
case, since verification will complain otherwise. This is consistent
with what was being done for debug metadata before r353537.

Reviewers: davidxl, uabelho

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354032 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV.
Florian Hahn [Thu, 14 Feb 2019 13:59:39 +0000 (13:59 +0000)]
[LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV.

The test case requires the peeled loop to be forgotten after peeling,
even though it does not have a parent. When called via the unroller,
SE->forgetTopmostLoop is also called, so the test case would also pass
without any SCEV invalidation, but peelLoop is exposed as utility
function. Also, in the test case, simplifyLoop will make changes,
removing the loop from SCEV, but it is better to not rely on this
behavior.

Reviewers: sanjoy, mkazantsev

Reviewed By: mkazantsev

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354031 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV][NFC] Add RV64I CHECK lines to inline-asm.ll test
Alex Bradbury [Thu, 14 Feb 2019 13:09:54 +0000 (13:09 +0000)]
[RISCV][NFC] Add RV64I CHECK lines to inline-asm.ll test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354028 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply [VFS] Allow multiple RealFileSystem instances with independent CWDs.
Sam McCall [Thu, 14 Feb 2019 12:57:01 +0000 (12:57 +0000)]
Reapply [VFS] Allow multiple RealFileSystem instances with independent CWDs.

This reverts commit r351091.
The original mac breakages are addressed by ensuring the root directory
we're working from is fully symlink-resolved before starting.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354026 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS GlobalISel] Select phi instruction for integers
Petar Avramovic [Thu, 14 Feb 2019 12:36:19 +0000 (12:36 +0000)]
[MIPS GlobalISel] Select phi instruction for integers

Select G_PHI for integers for MIPS32.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354025 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Instrumentation][NFC] Fix warning.
Clement Courbet [Thu, 14 Feb 2019 12:10:49 +0000 (12:10 +0000)]
[Instrumentation][NFC] Fix warning.

lib/Transforms/Instrumentation/AddressSanitizer.cpp:1173:29: warning: extra ‘;’ [-Wpedantic]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354024 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS GlobalISel] Select branch instructions
Petar Avramovic [Thu, 14 Feb 2019 11:39:53 +0000 (11:39 +0000)]
[MIPS GlobalISel] Select branch instructions

Select G_BR and G_BRCOND for MIPS32.
Unconditional branch G_BR does not have register operand,
for that reason we only add tests.
Since conditional branch G_BRCOND compares register to zero on MIPS32,
explicit extension must be performed on i1 condition in order to set
high bits to appropriate value.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354022 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake widenable condition transparent for MemoryWriteTracking
Max Kazantsev [Thu, 14 Feb 2019 11:10:29 +0000 (11:10 +0000)]
Make widenable condition transparent for MemoryWriteTracking

Side effects of widenable condition intrinsic are modelled via
InaccessibleMemOnly, and there is no way to say that it isn't
really writing any memory. This patch teaches MemoryWriteTracking
ignore this intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354021 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTeach isGuaranteedToTransferExecutionToSuccessor about widenable conditions
Max Kazantsev [Thu, 14 Feb 2019 11:10:21 +0000 (11:10 +0000)]
Teach isGuaranteedToTransferExecutionToSuccessor about widenable conditions

Widenable condition intrinsic is guaranteed to return value, notify
the isGuaranteedToTransferExecutionToSuccessor function about it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354020 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix an accidentally flipped pair of arguments, NFCI
Jeremy Morse [Thu, 14 Feb 2019 11:09:24 +0000 (11:09 +0000)]
Fix an accidentally flipped pair of arguments, NFCI

While rebasing a refactor in r353950 I accidentally swapped two function
arguments; one is SelectionDAGBuilders "current" DebugLoc, the other is the one
from the "current" debug intrinsic. They're probably always identical, but I
haven't proved that yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354019 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Ensure we update the correct flags in the peephole optimiser
David Green [Thu, 14 Feb 2019 11:09:24 +0000 (11:09 +0000)]
[ARM] Ensure we update the correct flags in the peephole optimiser

The Arm peephole optimiser code keeps track of both an MI and a SubAdd that can
be used to optimise away a CMP. In the rare case that both are found and not
ruled-out as valid, we could end up setting the flags on the wrong one.

Instead make sure we are using SubAdd if it exists, as it will be closer to the
CMP.

The testcase here is a little theoretical, with a dead def of cpsr. It should
hopefully show the point.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354018 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Fix TempFile::discard to not leave behind temporary files
Andrew Ng [Thu, 14 Feb 2019 11:08:49 +0000 (11:08 +0000)]
[Support] Fix TempFile::discard to not leave behind temporary files

Moved the remove of the temporary file to after the close to avoid
remove failures caused by ETXTBSY errors.

This issue was seen when FileOutputBuffer falls back to an in memory
buffer due to the inability to mmap the on disk file. This occurred when
running LLD on an Ubuntu VM in VirtualBox on a Windows host attempting
to write the output to a VirtualBox shared folder.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354017 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Refactor LICM code for better readability
Max Kazantsev [Thu, 14 Feb 2019 09:04:12 +0000 (09:04 +0000)]
[NFC] Refactor LICM code for better readability

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354013 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj][test] Add all GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} bits
Fangrui Song [Thu, 14 Feb 2019 07:52:51 +0000 (07:52 +0000)]
[llvm-readobj][test] Add all GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} bits

And delete trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354011 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRelax test to check for a valid number instead of a specific number
Douglas Yung [Thu, 14 Feb 2019 04:11:09 +0000 (04:11 +0000)]
Relax test to check for a valid number instead of a specific number
to be like every other check in this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354007 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Make (f80 (sint_to_fp (i16))) use fistps/fisttps instead of fistpl/fisttpl...
Craig Topper [Thu, 14 Feb 2019 01:41:43 +0000 (01:41 +0000)]
[X86] Make (f80 (sint_to_fp (i16))) use fistps/fisttps instead of fistpl/fisttpl when SSE is enabled.

When SSE is enabled sint_to_fp with i16 is blindly promoted to i32, but that changes the behavior of f80 conversion.

Move the promotion to i16 to LowerFP_TO_INT so we can limit it based on the floating point type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354003 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[llvm-objdump] Allow short options without arguments to be grouped"
Matthew Voss [Thu, 14 Feb 2019 01:39:43 +0000 (01:39 +0000)]
Revert "[llvm-objdump] Allow short options without arguments to be grouped"

Reverted due to failures on the llvm-hexagon-elf.

This reverts commit 77e1f27476c89f65eeb496d131065177e6417f23.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354002 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objdump] Allow short options without arguments to be grouped
Matthew Voss [Thu, 14 Feb 2019 00:39:40 +0000 (00:39 +0000)]
[llvm-objdump] Allow short options without arguments to be grouped

Summary:

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

Reviewers: kristina, jhenderson, grimar, jakehehrlich, rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353998 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[globalisel][combine] Split existing rules into a match and apply step
Daniel Sanders [Thu, 14 Feb 2019 00:15:28 +0000 (00:15 +0000)]
[globalisel][combine] Split existing rules into a match and apply step

Summary:
The declarative tablegen definitions split rules into match and apply steps.
Prepare for that by doing the same in the C++ implementations. This aids
some of the migration effort while the tablegen version is incomplete.

Reviewers: bogner, volkan, aditya_nandakumar, paquette, aemerson

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, Petar.Avramovic, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353996 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-ar][libObject] Fix relative paths when nesting thin archives.
Jordan Rupprecht [Wed, 13 Feb 2019 23:39:41 +0000 (23:39 +0000)]
[llvm-ar][libObject] Fix relative paths when nesting thin archives.

Summary:
When adding one thin archive to another, we currently chop off the relative path to the flattened members. For instance, when adding `foo/child.a` (which contains `x.txt`) to `parent.a`, when flattening it we should add it as `foo/x.txt` (which exists) instead of `x.txt` (which does not exist).

As a note, this also undoes the `IsNew` parameter of handling relative paths in r288280. The unit test there still passes.

This was reported as part of testing the kernel build with llvm-ar: https://patchwork.kernel.org/patch/10767545/ (see the second point).

Reviewers: mstorsjo, pcc, ruiu, davide, david2050, inglorion

Reviewed By: ruiu

Subscribers: void, jdoerfert, tpimh, mgorny, hans, nickdesaulniers, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353995 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Added tests for prologue and epilogue code gen.
Stefan Pintilie [Wed, 13 Feb 2019 23:37:23 +0000 (23:37 +0000)]
[PowerPC][NFC] Added tests for prologue and epilogue code gen.

Added four test files to check the existing behaviour of prologue
and epilogue code generation. This patch was done as a setup for
the upcoming patch listed on Phabricator that will change how the
prologue and epilogue work.
The upcoming patch is: https://reviews.llvm.org/D42590

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353994 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ConstProp] add IR tests to show miscompiles; NFC
Sanjay Patel [Wed, 13 Feb 2019 23:27:31 +0000 (23:27 +0000)]
[ConstProp] add IR tests to show miscompiles; NFC

A fix for these is proposed in D51216.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353992 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj] Dump GNU_PROPERTY_X86_ISA_1_{NEEDED,USED} notes in .note.gnu.property
Fangrui Song [Wed, 13 Feb 2019 23:18:05 +0000 (23:18 +0000)]
[llvm-readobj] Dump GNU_PROPERTY_X86_ISA_1_{NEEDED,USED} notes in .note.gnu.property

Reviewers: grimar, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353991 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Inline a single use helper function, and remove last non-MMO interface...
Philip Reames [Wed, 13 Feb 2019 23:01:11 +0000 (23:01 +0000)]
[SelectionDAG] Inline a single use helper function, and remove last non-MMO interface [NFC]

For D57601, we need to know whether the instruction is volatile.  We'd either have to pass yet another parameter, or just standardize on the MMO interface.  I chose the second.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353989 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RegAllocGreedy] Take last chance recoloring into account in evicting.
Mark Lacey [Wed, 13 Feb 2019 22:56:43 +0000 (22:56 +0000)]
[RegAllocGreedy] Take last chance recoloring into account in evicting.

Last chance recoloring inserts into FixedRegisters those virtual
registers it is attempting to assign a physical register to.

We must consider these when we consider candidates for eviction so that
we do not end up evicting something while we are attempting to recolor
to assign it.

This is hitting in an out-of-tree target and no longer reproduces on
trunk. That does not appear to be a result of it having been fixed, but
rather, it appears that optimization changes and/or other changes to
register allocation mask the problem.

I haven't found a way to come up with a reasonable test case for this
(i.e. one that I can actually commit to open source, is reasonable
in size, and actually reproduces the issue).

rdar://problem/45708741

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353988 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AVR] Fix a typo - 's/analisys/analysis'
Dylan McKay [Wed, 13 Feb 2019 22:31:37 +0000 (22:31 +0000)]
[AVR] Fix a typo - 's/analisys/analysis'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353987 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] memory.fill
Thomas Lively [Wed, 13 Feb 2019 22:25:18 +0000 (22:25 +0000)]
[WebAssembly] memory.fill

Summary:
memset lowering, fix argument types in memcpy lowering, and
test encodings. Depends on D57736.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353986 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NewPM] Second attempt at porting ASan
Leonard Chan [Wed, 13 Feb 2019 22:22:48 +0000 (22:22 +0000)]
[NewPM] Second attempt at porting ASan

This is the second attempt to port ASan to new PM after D52739. This takes the
initialization requried by ASan from the Module by moving it into a separate
class with it's own analysis that the new PM ASan can use.

Changes:
- Split AddressSanitizer into 2 passes: 1 for the instrumentation on the
  function, and 1 for the pass itself which creates an instance of the first
  during it's run. The same is done for AddressSanitizerModule.
- Add new PM AddressSanitizer and AddressSanitizerModule.
- Add legacy and new PM analyses for reading data needed to initialize ASan with.
- Removed DominatorTree dependency from ASan since it was unused.
- Move GlobalsMetadata and ShadowMapping out of anonymous namespace since the
  new PM analysis holds these 2 classes and will need to expose them.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353985 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Bulk memory intrinsics and builtins
Thomas Lively [Wed, 13 Feb 2019 22:11:16 +0000 (22:11 +0000)]
[WebAssembly] Bulk memory intrinsics and builtins

Summary:
implements llvm intrinsics and clang intrinsics for
memory.init and data.drop.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353983 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r353962
Serge Guelton [Wed, 13 Feb 2019 22:11:09 +0000 (22:11 +0000)]
Revert r353962

Specialization of Optional for trivially copyable types yields failure on the buildbots I fail to reproduce locally.
Better safe than sorry, reverting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353982 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r353957.
Peter Collingbourne [Wed, 13 Feb 2019 21:03:23 +0000 (21:03 +0000)]
gn build: Merge r353957.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353980 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Kill last uses of getAtomic w/o a MMO operand [NFC]
Philip Reames [Wed, 13 Feb 2019 20:42:59 +0000 (20:42 +0000)]
[SelectionDAG] Kill last uses of getAtomic w/o a MMO operand [NFC]

The helper function was used by only two callers, and largely ended up providing distinct functionality based on optional arguments and opcode.  Inline and simply to make the functionality much more clear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353977 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add 'mpx' to getHostCPUFeatures.
Craig Topper [Wed, 13 Feb 2019 20:12:41 +0000 (20:12 +0000)]
[X86] Add 'mpx' to getHostCPUFeatures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353974 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeExtractor] Only lift lifetime markers present in the extraction region
Vedant Kumar [Wed, 13 Feb 2019 19:53:38 +0000 (19:53 +0000)]
[CodeExtractor] Only lift lifetime markers present in the extraction region

When CodeExtractor finds liftime markers referencing inputs to the
extraction region, it lifts these markers out of the region and inserts
them around the call to the extracted function (see r350420, PR39671).

However, it should *only* lift lifetime markers that are actually
present in the extraction region. I.e., if a start marker is present in
the extraction region but a corresponding end marker isn't (or vice
versa), only the start marker (or end marker, resp.) should be lifted.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353973 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] More unordered atomic lowering tests
Philip Reames [Wed, 13 Feb 2019 19:49:17 +0000 (19:49 +0000)]
[Tests] More unordered atomic lowering tests

This time, focused around narrowing and widening transformations.  Also, include a few simple memory optimization tests to highlight missed oppurtunities.  This is part of building up the test base for D57601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353972 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] RMW folding tests w/unordered atomic operations
Philip Reames [Wed, 13 Feb 2019 18:41:54 +0000 (18:41 +0000)]
[Tests] RMW folding tests w/unordered atomic operations

We get a suprising number of these today actually, but some are missed. The main point of this is strengthen the test set for D57601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353966 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Add a bunch of tests for load folding w/unordered atomics
Philip Reames [Wed, 13 Feb 2019 18:26:01 +0000 (18:26 +0000)]
[Tests] Add a bunch of tests for load folding w/unordered atomics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353964 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add 'fxsr' to the getHostCPUFeatures detection code.
Craig Topper [Wed, 13 Feb 2019 18:21:36 +0000 (18:21 +0000)]
[X86] Add 'fxsr' to the getHostCPUFeatures detection code.

We implicitly mark this feature as enabled when the target is 64-bits, but our detection code for -march=native didn't support it so you can't detect it on 32-bit targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353963 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-commit rL353927, patch included
Serge Guelton [Wed, 13 Feb 2019 18:12:04 +0000 (18:12 +0000)]
Re-commit rL353927, patch included

Make llvm::Optional<T> trivially copyable when T is trivially copyable

This is an ever-recurring issue (see https://bugs.llvm.org/show_bug.cgi?id=39427 and https://bugs.llvm.org/show_bug.cgi?id=35978)
but I believe that thanks to https://reviews.llvm.org/D54472 we can now ship a decent implementation of this.

Basically the fact that llvm::is_trivially_copyable has a consistent behavior across compilers should prevent any ABI issue,
and using in-place new instead of memcpy should keep compiler bugs away.

This patch is slightly different from the original revision https://reviews.llvm.org/rL353927 but achieves the same goal. It just avoids
going through std::conditional which may the code more explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353962 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] First batch of cornercase tests for unordered atomics
Philip Reames [Wed, 13 Feb 2019 18:00:58 +0000 (18:00 +0000)]
[Tests] First batch of cornercase tests for unordered atomics

Mixture of things we legally can't do, and things we're missing.  Once D57601 is in, the later will serve as a punch list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353959 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Auto update a test
Philip Reames [Wed, 13 Feb 2019 17:30:03 +0000 (17:30 +0000)]
[Tests] Auto update a test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353958 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Support reserving arbitrary general purpose registers
Petr Hosek [Wed, 13 Feb 2019 17:28:47 +0000 (17:28 +0000)]
[AArch64] Support reserving arbitrary general purpose registers

This is a follow up to D48580 and D48581 which allows reserving
arbitrary general purpose registers with the exception of registers
with special purpose (X8, X16-X18, X29, X30) and registers used by LLVM
(X0, X19). This change also generalizes some of the existing logic to
rely entirely on values generated from tablegen.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353957 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Rename some test files for consistency
Philip Reames [Wed, 13 Feb 2019 17:23:11 +0000 (17:23 +0000)]
[Tests] Rename some test files for consistency

Most are named "atomic-something" so rename the few which were "atomic_something".  I keep typing the wrong name due to the inconsistency.  :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353956 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo][DAG] Either salvage dangling debug info or emit Undef DBG_VALUEs
Jeremy Morse [Wed, 13 Feb 2019 16:33:05 +0000 (16:33 +0000)]
[DebugInfo][DAG] Either salvage dangling debug info or emit Undef DBG_VALUEs

In this patch SelectionDAG tries to salvage any dbg.values that are going to be
dropped, in case they can be recovered from Values in the current BB. It also
strengthens SelectionDAGs handling of dangling debug data, so that dbg.values
are *always* emitted (as Undef or otherwise) instead of dangling forever.

The motivation behind this patch exists in the new test case: a memory address
(here a bitcast and GEP) exist in one basic block, and a dbg.value referring to
the address is left in the 'next' block. The base pointer is live across all
basic blocks. In current llvm trunk the dbg.value cannot be encoded, and it
isn't even emitted as an Undef DBG_VALUE.

The change is simply: if we're definitely going to drop a dbg.value, repeatedly
apply salvageDebugInfo to its operand until either we find something that can
be encoded, or we can't salvage any further in which case we produce an Undef
DBG_VALUE. To know when we're "definitely going to drop a dbg.value",
SelectionDAG signals SelectionDAGBuilder when all IR instructions have been
encoded to force salvaging. This ensures that any dbg.value that's dangling
after DAG creation will have a corresponding DBG_VALUE encoded.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353954 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX] Add shuffle_v8i32_0dcd3f14 shuffle test case
Simon Pilgrim [Wed, 13 Feb 2019 16:12:36 +0000 (16:12 +0000)]
[X86][AVX] Add shuffle_v8i32_0dcd3f14 shuffle test case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353953 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj] Rename pr_data to PrData
Fangrui Song [Wed, 13 Feb 2019 15:58:23 +0000 (15:58 +0000)]
[llvm-readobj] Rename pr_data to PrData

As requested by grimar in D58112.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353951 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo][DAG] Refactor dbg.value lowering into its own method
Jeremy Morse [Wed, 13 Feb 2019 15:53:10 +0000 (15:53 +0000)]
[DebugInfo][DAG] Refactor dbg.value lowering into its own method

This is a pure copy-and-paste job, moving the logic for lowering dbg.value
intrinsics to SDDbgValues into its own function. This is ahead of adding some
more users of this logic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353950 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Store a bitmask of used groups in the instruction descriptor.
Andrea Di Biagio [Wed, 13 Feb 2019 14:56:06 +0000 (14:56 +0000)]
[MCA] Store a bitmask of used groups in the instruction descriptor.

This is to speedup 'checkAvailability' queries in class ResourceManager.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353949 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo][DAG] Limit special-casing of dbg.values for Arguments
Jeremy Morse [Wed, 13 Feb 2019 13:37:33 +0000 (13:37 +0000)]
[DebugInfo][DAG] Limit special-casing of dbg.values for Arguments

SelectionDAGBuilder has special handling for dbg.value intrinsics that are
understood to define the location of function parameters on entry to the
function. To enable this, we avoid recording a dbg.value as a virtual register
reference if it might be such a parameter, so that it later hits
EmitFuncArgumentDbgValue.

This patch reduces the set of circumstances where we avoid recording a
dbg.value as a virtual register reference, to allow more "normal" variables
to be recorded that way. We now only bypass for potential parameters if:
 * The dbg.value operand is an Argument,
 * The Variable is a parameter, and
 * The Variable is not inlined.
meaning it's very likely that the dbg.value is a function-entry parameter
location.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353948 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Add const qualifiers where possible
Max Kazantsev [Wed, 13 Feb 2019 11:54:45 +0000 (11:54 +0000)]
[NFC] Add const qualifiers where possible

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353941 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r353927
Serge Guelton [Wed, 13 Feb 2019 11:35:45 +0000 (11:35 +0000)]
Revert r353927

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353940 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM GlobalISel] Support G_SELECT for Thumb2
Diana Picus [Wed, 13 Feb 2019 11:25:32 +0000 (11:25 +0000)]
[ARM GlobalISel] Support G_SELECT for Thumb2

Same as arm mode, but slightly different opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353938 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA][Scheduler] Use latency information to further classify busy instructions.
Andrea Di Biagio [Wed, 13 Feb 2019 11:02:42 +0000 (11:02 +0000)]
[MCA][Scheduler] Use latency information to further classify busy instructions.

This patch introduces a new instruction stage named 'IS_PENDING'.
An instruction transitions from the IS_DISPATCHED to the IS_PENDING stage if
input registers are not available, but their latency is known.

This patch also adds a new set of instructions named 'PendingSet' to class
Scheduler. The idea is that the PendingSet will only contain instructions that
have reached the IS_PENDING stage.
By construction, an instruction in the PendingSet is only dependent on
instructions that have already reached the execution stage. The plan is to use
this knowledge to identify bottlenecks caused by data dependencies (see
PR37494).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353937 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo][InstCombine] Prefer to salvage debuginfo over sinking it
Jeremy Morse [Wed, 13 Feb 2019 10:54:53 +0000 (10:54 +0000)]
[DebugInfo][InstCombine] Prefer to salvage debuginfo over sinking it

When instcombine sinks an instruction between two basic blocks, it sinks any
dbg.value users in the source block with it, to prevent debug use-before-free.
However we can do better by attempting to salvage the debug users, which would
avoid moving where the variable location changes. If we successfully salvage,
still sink a (cloned) dbg.value with the sunk instruction, as the sunk
instruction is more likely to be "live" later in the compilation process.

If we can't salvage dbg.value users of a sunk instruction, mark the dbg.values
in the original block as being undef. This terminates any earlier variable
location range, and represents the fact that we've optimized out the variable
location for a portion of the program.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353936 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMissing header
Serge Guelton [Wed, 13 Feb 2019 10:19:06 +0000 (10:19 +0000)]
Missing header

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353933 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GuardWidening] Support widening of explicitly expressed guards
Max Kazantsev [Wed, 13 Feb 2019 09:56:30 +0000 (09:56 +0000)]
[GuardWidening] Support widening of explicitly expressed guards

This patch adds support of guards expressed in explicit form via
`widenable_condition` in Guard Widening pass.

Differential Revision: https://reviews.llvm.org/D56075
Reviewed By: reames

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353932 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Stop changing labels for register-described parameter DBG_VALUEs
David Stenberg [Wed, 13 Feb 2019 09:34:07 +0000 (09:34 +0000)]
[DebugInfo] Stop changing labels for register-described parameter DBG_VALUEs

Summary:
This is a follow-up to D57510. This patch stops DebugHandlerBase from
changing the starting label for the first non-overlapping,
register-described parameter DBG_VALUEs to the beginning of the
function. That code did not consider what defined the registers, which
could result in the ranges for the debug values starting before their
defining instructions. We currently do not emit debug values for
constant values directly at the start of the function, so this code is
still useful for such values, but my intention is to remove the code
from DebugHandlerBase completely when we get there. One reason for
removing it is that the code violates the history map's ranges, which I
think can make it quite confusing when troubleshooting.

In D57510, PrologEpilogInserter was amended so that parameter DBG_VALUEs
now are kept at the start of the entry block, even after emission of
prologue code. That was done to reduce the degradation of debug
completeness from this patch. PR40638 is another example, where the
lexical-scope trimming that LDV does, in combination with scheduling,
results in instructions after the prologue being left without locations.
There might be other cases where the DBG_VALUEs are pushed further down,
for which the DebugHandlerBase code may be helpful, but as it now quite
often result in incorrect locations, even after the prologue, it seems
better to remove that code, and try to work our way up with accurate
locations.

In the long run we should maybe not aim to provide accurate locations
inside the prologue. Some single location descriptions, at least those
referring to stack values, generate inaccurate values inside the
epilogue, so we maybe should not aim to achieve accuracy for location
lists. However, it seems that we now emit line number programs that can
result in GDB and LLDB stopping inside the prologue when doing line
number stepping into functions. See PR40188 for more information.

A summary of some of the changed test cases is available in PR40188#c2.

Reviewers: aprantl, dblaikie, rnk, jmorse

Reviewed By: aprantl

Subscribers: jdoerfert, jholewinski, jvesely, javed.absar, llvm-commits

Tags: #debug-info, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353928 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake llvm::Optional<T> trivially copyable when T is trivially copyable
Serge Guelton [Wed, 13 Feb 2019 09:31:22 +0000 (09:31 +0000)]
Make llvm::Optional<T> trivially copyable when T is trivially copyable

This is an ever-recurring issue (see https://bugs.llvm.org/show_bug.cgi?id=39427 and https://bugs.llvm.org/show_bug.cgi?id=35978)
but I believe that thanks to https://reviews.llvm.org/D54472 we can now ship a decent implementation of this.

Basically the fact that llvm::is_trivially_copyable has a consistent behavior across compilers should prevent any ABI issue,
and using in-place new instead of memcpy should keep compiler bugs away.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353927 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm] [cmake] Provide split include paths in LLVMConfig
Michal Gorny [Wed, 13 Feb 2019 08:34:40 +0000 (08:34 +0000)]
[llvm] [cmake] Provide split include paths in LLVMConfig

Modify LLVMConfig to provide split variables for in-source and generated
include paths.  Currently, it uses a single value for both
LLVM_INCLUDE_DIRS and LLVM_INCLUDE_DIR which works for install tree but
fails hard at build tree (where LLVM_INCLUDE_DIR incorrectly contains
multiple values).

Instead, put the generated directory in LLVM_INCLUDE_DIR, and the source
tree in LLVM_MAIN_INCLUDE_DIR which is consistent with in-LLVM builds.
For install tree, both variables will have the same value.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353924 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][SLP] Enable SLP vectorization for 128-bit horizontal X86 instructions (add...
Anton Afanasyev [Wed, 13 Feb 2019 08:26:43 +0000 (08:26 +0000)]
[X86][SLP] Enable SLP vectorization for 128-bit horizontal X86 instructions (add, sub)

Try to use 64-bit SLP vectorization. In addition to horizontal instrs
this change triggers optimizations for partial vector operations (for instance,
using low halfs of 128-bit registers xmm0 and xmm1 to multiply <2 x float> by
<2 x float>).

Fixes llvm.org/PR32433

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353923 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Use default expansion for (i64 fp_to_uint f80) when avx512 is enabled on 64...
Craig Topper [Wed, 13 Feb 2019 07:42:34 +0000 (07:42 +0000)]
[X86] Use default expansion for (i64 fp_to_uint f80) when avx512 is enabled on 64-bit targets to match what happens without avx512.

In 64-bit mode prior to avx512 we use Expand, but with avx512 we need to make f32/f64 conversions Legal so we use Custom and then do our own expansion for f80. But this seems to produce codegen differences relative to avx2. This patch corrects this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353921 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Refactor the FP_TO_INTHelper interface. NFCI
Craig Topper [Wed, 13 Feb 2019 07:42:31 +0000 (07:42 +0000)]
[X86] Refactor the FP_TO_INTHelper interface. NFCI

-Pull the final stack load creation from the two callers into the helper.
-Return a single SDValue instead of a std::pair.
-Remove the Replace flag which isn't really needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353920 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Add --strip-unneeded-symbol(s)
Eugene Leviant [Wed, 13 Feb 2019 07:34:54 +0000 (07:34 +0000)]
[llvm-objcopy] Add --strip-unneeded-symbol(s)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353919 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LoopSimplifyCFG] Re-enable const branch folding by default
Max Kazantsev [Wed, 13 Feb 2019 06:12:48 +0000 (06:12 +0000)]
[LoopSimplifyCFG] Re-enable const branch folding by default

Known underlying bugs have been fixed, intensive fuzz testing did not
find any new problems. Re-enabling by default. Feel free to revert if
it causes any functional failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353911 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj] Dump GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} notes in .note.gnu.property
Fangrui Song [Wed, 13 Feb 2019 01:51:45 +0000 (01:51 +0000)]
[llvm-readobj] Dump GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} notes in .note.gnu.property

Summary: And change the output ("X86 features" -> "x86 feature") a bit.

Reviewers: grimar, xiangzhangllvm, hjl.tools, rupprecht

Reviewed By: rupprecht

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353908 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MC] Make symbol version errors non-fatal
Reid Kleckner [Wed, 13 Feb 2019 01:39:32 +0000 (01:39 +0000)]
[MC] Make symbol version errors non-fatal

We stil don't have a source location, which is pretty lame, but at least
we won't tell the user to file a clang bug report anymore.

Fixes PR40712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353907 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[dsymutil] Improve readability of cloneAllCompileUnits (NFC)
Jonas Devlieghere [Wed, 13 Feb 2019 00:32:21 +0000 (00:32 +0000)]
[dsymutil] Improve readability of cloneAllCompileUnits (NFC)

Add some newlines and improve consistency between the two loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353904 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[dsymutil] Don't clone empty CUs
Jonas Devlieghere [Wed, 13 Feb 2019 00:32:06 +0000 (00:32 +0000)]
[dsymutil] Don't clone empty CUs

The DWARF standard says that an empty compile unit is not valid:

> Each such contribution consists of a compilation unit header (see
> Section 7.5.1.1 on page 200) followed by a single DW_TAG_compile_unit or
> DW_TAG_partial_unit debugging information entry, together with its
> children.

Therefore we shouldn't clone them in dsymutil.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353903 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA & LoopPassManager] Add remaining book keeping [NFCI].
Alina Sbirlea [Tue, 12 Feb 2019 23:48:02 +0000 (23:48 +0000)]
[MemorySSA & LoopPassManager] Add remaining book keeping [NFCI].

Add plumbing to get MemorySSA in the remaining loop passes.
Also update unit test to add the dependency.
[EnableMSSALoopDependency remains disabled].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353901 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Try to use function specific ST
Matt Arsenault [Tue, 12 Feb 2019 23:44:13 +0000 (23:44 +0000)]
AMDGPU: Try to use function specific ST

Subtargets are a function level property, so ideally we would
eliminate everywhere that needs to check the global one. Rename the
function to try avoiding confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353900 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Ignore CodeObjectV3 when inlining
Matt Arsenault [Tue, 12 Feb 2019 23:30:11 +0000 (23:30 +0000)]
AMDGPU: Ignore CodeObjectV3 when inlining

This was inhibiting inlining of library functions when clang was
invoking the inliner directly. This is covering a bit of a mess with
subtarget feature handling, and this shouldn't be a subtarget
feature. The behavior is different depending on whether you are using
a -mattr flag in clang, or llc, opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353899 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Remember to cast value to void to disable warning.
Jonas Paulsson [Tue, 12 Feb 2019 23:13:18 +0000 (23:13 +0000)]
[SystemZ]  Remember to cast value to void to disable warning.

Hopefully fixes buildbot problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353898 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LICM] Cap the clobbering calls in LICM.
Alina Sbirlea [Tue, 12 Feb 2019 23:05:40 +0000 (23:05 +0000)]
[LICM] Cap the clobbering calls in LICM.

Summary:
Unlimitted number of calls to getClobberingAccess can lead to high
compile times in pathological cases.
Switching EnableLicmCap flag from bool to int, and enabling to default 100.
(tested to be appropriate for current bechmarks)
We can revisit this value when enabling MemorySSA.

Reviewers: sanjoy, chandlerc, george.burgess.iv

Subscribers: jlebar, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353897 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] A few more live-in deopt lowering tests
Philip Reames [Tue, 12 Feb 2019 23:00:07 +0000 (23:00 +0000)]
[Tests] A few more live-in deopt lowering tests

Nothing super interesting, just making sure obvious cases work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353895 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/NFC: Remove SubtargetFeatureISAVersion since it is not used anywhere
Konstantin Zhuravlyov [Tue, 12 Feb 2019 22:49:49 +0000 (22:49 +0000)]
AMDGPU/NFC: Remove SubtargetFeatureISAVersion since it is not used anywhere

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353892 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Remove duplicate processor (gfx900)
Konstantin Zhuravlyov [Tue, 12 Feb 2019 22:29:25 +0000 (22:29 +0000)]
AMDGPU: Remove duplicate processor (gfx900)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353889 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[gn build] Separate debug and optimization settings
David Major [Tue, 12 Feb 2019 22:24:45 +0000 (22:24 +0000)]
[gn build] Separate debug and optimization settings

This patch adds an `is_optimized` variable, orthogonal to `is_debug`, to allow for a gn analogue to `RelWithDebInfo` builds.

As part of this we'll want to explicitly enable GC+ICF, for the sake of `is_debug && is_optimized` builds. The flags normally default to true except that if you pass `/DEBUG` they default to false.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353888 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Clean up comments in SelectionDAGBuilder.h. NFC
Bjorn Pettersson [Tue, 12 Feb 2019 22:11:20 +0000 (22:11 +0000)]
[SelectionDAG] Clean up comments in SelectionDAGBuilder.h. NFC

Remove redundant function/variable names from doxygen
comments (as suggested in https://reviews.llvm.org/D57697).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353886 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix auto-upgrade for the new parameter to llvm.objectsize
Erik Pilkington [Tue, 12 Feb 2019 21:55:38 +0000 (21:55 +0000)]
Fix auto-upgrade for the new parameter to llvm.objectsize

r352664 added a 'dynamic' parameter to objectsize, but the AutoUpgrade
changes were incomplete. Also, fix an off-by-one error I made in the
upgrade logic that is now no longer unreachable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353884 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ConstProp] add test for miscompile from bitcast transform; NFC
Sanjay Patel [Tue, 12 Feb 2019 21:49:56 +0000 (21:49 +0000)]
[ConstProp] add test for miscompile from bitcast transform; NFC

This problem goes with the fix in D51215.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353883 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-dwp] Use color-formatted error reporting
Jordan Rupprecht [Tue, 12 Feb 2019 20:37:33 +0000 (20:37 +0000)]
[llvm-dwp] Use color-formatted error reporting

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353876 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix undefined behaviour in PPCInstPrinter::printBranchOperand.
Sean Fertile [Tue, 12 Feb 2019 20:03:04 +0000 (20:03 +0000)]
Fix undefined behaviour in PPCInstPrinter::printBranchOperand.

Fix the undefined behaviour introduced by my previous patch r353865 (left
shifting a potentially negative value), which was caught by the bots that run
UBSan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353874 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-dwp] Avoid writing the output dwp file when there is an error
Jordan Rupprecht [Tue, 12 Feb 2019 20:00:51 +0000 (20:00 +0000)]
[llvm-dwp] Avoid writing the output dwp file when there is an error

Summary: Use ToolOutputFile to clean up the output file unless dwp actually finishes successfully.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353873 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Expand v8i8 cttz (PR39729)
Nikita Popov [Tue, 12 Feb 2019 18:55:53 +0000 (18:55 +0000)]
[AArch64] Expand v8i8 cttz (PR39729)

Fix for https://bugs.llvm.org/show_bug.cgi?id=39729.

Rather than adding just a case for v8i8 I'm setting cttz to expand
for all vector types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353872 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InlineSpiller] Fix a crash due to lack of forward progress from remat (try 2)
Philip Reames [Tue, 12 Feb 2019 18:33:01 +0000 (18:33 +0000)]
[InlineSpiller] Fix a crash due to lack of forward progress from remat (try 2)

This is a recommit of r335091 Add more test cases for deopt-operands via regalloc, and r335077 [InlineSpiller] Fix a crash due to lack of forward progress from remat specifically for STATEPOINT.  They were reverted due to a crash.

This change includes the text of both original changes, but also includes three aditional pieces:
1) A bug fix for the observed crash.  I had failed to record the failed remat value as live which resulted in an instruction being deleted which still had uses.  With the machine verifier, this is caught quickly.  Without it, we fail in StackSlotColoring due to an empty live interval from LiveStack.
2) A test case which demonstrates the fix for (1).  See @test11.
3) A control flag which defaults to disabling this for the moment.  Once I've run more extensive validaton, I will switch the default and then remove this flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353871 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Use VGM whenever possible to load FP immediates.
Jonas Paulsson [Tue, 12 Feb 2019 18:06:06 +0000 (18:06 +0000)]
[SystemZ]  Use VGM whenever possible to load FP immediates.

isFPImmLegal() has been extended to recognize certain FP immediates that can
be built with VGM (Vector Generate Mask).

These scalar FP immediates (that were previously loaded from the constant
pool) are now selected as VGMF/VGMG in Select().

Review: Ulrich Weigand
https://reviews.llvm.org/D58003

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353867 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] Fix printing of negative offsets in call instruction dissasembly.
Sean Fertile [Tue, 12 Feb 2019 17:48:22 +0000 (17:48 +0000)]
[PowerPC] Fix printing of negative offsets in call instruction dissasembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353865 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel][NFC] Gardening: Make translateSimpleUnaryIntrinsic general
Jessica Paquette [Tue, 12 Feb 2019 17:38:34 +0000 (17:38 +0000)]
[GlobalISel][NFC] Gardening: Make translateSimpleUnaryIntrinsic general

Instead of only having this code work for unary intrinsics, have it work for
an arbitrary number of parameters.

Factor out the cases that fall under this (fma, pow).

This makes it a bit easier to add more intrinsics which don't require any
special work.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353863 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[tablegen] Add locations to many PrintFatalError() calls
Daniel Sanders [Tue, 12 Feb 2019 17:36:57 +0000 (17:36 +0000)]
[tablegen] Add locations to many PrintFatalError() calls

Summary:
While working on the GISel Combiner, I noticed I was producing location-less
error messages fairly often and set about fixing this. In the process, I
noticed quite a few places elsewhere in TableGen that also neglected to include
a relevant location.

This patch adds locations to errors that relate to a specific record (or a
field within it) and also have easy access to the relevant location. This is
particularly useful when multiclasses are involved as many of these errors
refer to the full name of a record and it's difficult to guess which substring
is grep-able.

Unfortunately, tablegen currently only supports Record granularity so it's not
currently possible to point at a specific Init so these sometimes point at the
record that caused the error rather than the precise origin of the error.

Reviewers: bogner, aditya_nandakumar, volkan, aemerson, paquette, nhaehnle

Reviewed By: nhaehnle

Subscribers: jdoerfert, nhaehnle, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353862 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel][AArch64] Select llvm.bswap* for non-vector types
Jessica Paquette [Tue, 12 Feb 2019 17:28:17 +0000 (17:28 +0000)]
[GlobalISel][AArch64] Select llvm.bswap* for non-vector types

This teaches the IRTranslator to emit G_BSWAP when it runs into
Intrinsic::bswap. This allows us to select G_BSWAP for non-vector types in
AArch64.

Add a select-bswap.mir test, and add global isel checks to a couple existing
tests in test/CodeGen/AArch64.

This doesn't handle every bswap case, since some of these rely on known bits
stuff. This just lets us handle the naive case.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353861 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX] Enable shuffle combining support for zero_extend
Simon Pilgrim [Tue, 12 Feb 2019 17:22:35 +0000 (17:22 +0000)]
[X86][AVX] Enable shuffle combining support for zero_extend

A more limited version of rL352997 that had to be disabled in rL353198 - allow extension of any 128/256/512 bit vector that at least uses byte sized scalars.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353860 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] convert logic-of-setcc into bit magic (PR40611)
Sanjay Patel [Tue, 12 Feb 2019 17:07:47 +0000 (17:07 +0000)]
[DAGCombiner] convert logic-of-setcc into bit magic (PR40611)

If we're comparing some value for equality against 2 constants
and those constants have an absolute difference of just 1 bit,
then we can offset and mask off that 1 bit and reduce to a single
compare against zero:
         and/or (setcc X, C0, ne), (setcc X, C1, ne/eq) -->
         setcc ((add X, -C1), ~(C0 - C1)), 0, ne/eq

https://rise4fun.com/Alive/XslKj

This transform is disabled by default using a TLI hook
("convertSetCCLogicToBitwiseLogic()").

That should be overridden for AArch64, MIPS, Sparc and possibly
others based on the asm shown in:
https://bugs.llvm.org/show_bug.cgi?id=40611

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353859 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] add negative tests for setcc folds; NFC
Sanjay Patel [Tue, 12 Feb 2019 16:44:37 +0000 (16:44 +0000)]
[x86] add negative tests for setcc folds; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353855 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Fix return calling convention in expansion of ?MULO
whitequark [Tue, 12 Feb 2019 16:41:50 +0000 (16:41 +0000)]
[SelectionDAG] Fix return calling convention in expansion of ?MULO

Summary:
The SMULO/UMULO DAG nodes, when not directly supported by the target,
expand to a multiplication twice as wide. In case that the resulting
type is not legal, the legalizer cannot directly call the intrinsic
with the wide arguments; instead, it "pre-lowers" them by splitting
them in halves.

rL283203 made sure that on big endian targets, the legalizer passes
the argument halves in the correct order. It did not do the same
for the return value halves because the existing code used a hack;
it put an illegal type into DAG and hoped that nothing would break
and it would be correctly lowered elsewhere.

rL307207 fixed this, handling return value halves similar to how
argument handles are handled, but did not take big-endian targets
into account.

This commit fixes the expansion on big-endian targets, such as
the out-of-tree OR1K target.

Reviewers: eli.friedman, vadimcn

Subscribers: george-hopkins, efriedma, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353854 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Improved debug prints. NFC
Andrea Di Biagio [Tue, 12 Feb 2019 16:18:57 +0000 (16:18 +0000)]
[MCA] Improved debug prints. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353852 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC] Regenerate test
Simon Pilgrim [Tue, 12 Feb 2019 16:10:50 +0000 (16:10 +0000)]
[PowerPC] Regenerate test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353851 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Add more insert/extract testcases
Matt Arsenault [Tue, 12 Feb 2019 15:04:03 +0000 (15:04 +0000)]
AMDGPU/GlobalISel: Add more insert/extract testcases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353848 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Codegen] Make sure kill flags are not incorrect from removed machine phi's
David Green [Tue, 12 Feb 2019 15:02:57 +0000 (15:02 +0000)]
[Codegen] Make sure kill flags are not incorrect from removed machine phi's

We need to clear the kill flags on both SingleValReg and OldReg, to ensure they remain
conservatively correct.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353847 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-dwp] Abort when dwo_id is unset
Jordan Rupprecht [Tue, 12 Feb 2019 15:01:07 +0000 (15:01 +0000)]
[llvm-dwp] Abort when dwo_id is unset

Summary:
An empty dwo_id indicates a degenerate .dwo file that should not have been generated in the first place. Instead of discovering this error later when merging with another degenerate .dwo file, print an error immediately when noticing an unset dwo_id, including the filename of the offending file.

Test case created by compiling a trivial file w/ `-fno-split-dwarf-inlining -gmlt -gsplit-dwarf -c` prior to r353771

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: jdoerfert, aprantl, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353846 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Only make f16 constants legal on f16 targets
Matt Arsenault [Tue, 12 Feb 2019 14:54:55 +0000 (14:54 +0000)]
AMDGPU/GlobalISel: Only make f16 constants legal on f16 targets

We could deal with it, but there's no real point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353845 91177308-0d34-0410-b5e6-96231b3b80d8