OSDN Git Service

android-x86/external-llvm.git
5 years agoRevert "[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with...
Leonard Chan [Fri, 26 Oct 2018 22:51:51 +0000 (22:51 +0000)]
Revert "[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address"

This reverts commit 8d6af840396f2da2e4ed6aab669214ae25443204 and commit
b78d19c287b6e4a9abc9fb0545de9a3106d38d3d which causes slower build times
by initializing the AddressSanitizer on every function run.

The corresponding revisions are https://reviews.llvm.org/D52814 and
https://reviews.llvm.org/D52739.

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

5 years ago[VFS] Add property 'fallthrough' that controls fallback to real file system.
Volodymyr Sapsai [Fri, 26 Oct 2018 22:14:33 +0000 (22:14 +0000)]
[VFS] Add property 'fallthrough' that controls fallback to real file system.

Default property value 'true' preserves current behavior. Value 'false' can be
used to create VFS "root", file system that gives better control over which
files compiler can use during compilation as there are no unpredictable
accesses to real file system.

Non-fallthrough use case changes how we treat multiple VFS overlay
files. Instead of all of them being at the same level just above a real
file system, now they are nested and subsequent overlays can refer to
files in previous overlays.

rdar://problem/39465552

Reviewers: bruno, benlangmuir

Reviewed By: bruno

Subscribers: dexonsmith, cfe-commits, hiraditya

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

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

5 years ago[DAGCombiner] rearrange code in narrowExtractedVectorBinOp(); NFC
Sanjay Patel [Fri, 26 Oct 2018 21:32:04 +0000 (21:32 +0000)]
[DAGCombiner] rearrange code in narrowExtractedVectorBinOp(); NFC

We can extend this code to handle many more cases
if an extract is cheap, so prepping for that change.

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

5 years ago[ValueTracking] peek through shuffles in ComputeNumSignBits (PR37549)
Sanjay Patel [Fri, 26 Oct 2018 21:05:14 +0000 (21:05 +0000)]
[ValueTracking] peek through shuffles in ComputeNumSignBits (PR37549)

The motivating case is from PR37549:
https://bugs.llvm.org/show_bug.cgi?id=37549

The analysis improvement allows us to form a vector 'select' out of
bitwise logic (the use of ComputeNumSignBits was added at rL345149).

The smaller test shows another InstCombine improvement - we use
ComputeNumSignBits to add 'nsw' to shift-left. But the negative
test shows an example where we must not add 'nsw' - when the shuffle
mask contains undef elements.

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

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

5 years ago[LegalizeTypes] Stop DAGTypeLegalizer::getSETCCWidenedResultTy from creating illegal...
Craig Topper [Fri, 26 Oct 2018 20:59:55 +0000 (20:59 +0000)]
[LegalizeTypes] Stop DAGTypeLegalizer::getSETCCWidenedResultTy from creating illegal setccs. Add checks for valid setccs

The DAGTypeLegalizer::getSETCCWidenedResultTy was widening the MaskVT, but the code in convertMask called after getSETCCWidenedResultTy had no idea this widening had occurred. So none of the operands were widened when convertMask created new setccs with the widened VT.

This patch removes the widening and adds some asserts to getNode to validate the types of setccs to prevent issues like this in the future.

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

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

5 years agoAdd docs+a script for building clang/LLVM with PGO
George Burgess IV [Fri, 26 Oct 2018 20:56:03 +0000 (20:56 +0000)]
Add docs+a script for building clang/LLVM with PGO

Depending on who you ask, PGO grants a 15%-25% improvement in build
times when using clang. Sadly, hooking everything up properly to
generate a profile and apply it to clang isn't always straightforward.
This script (and the accompanying docs) aim to make this process easier;
ideally, a single invocation of the given script.

In terms of testing, I've got a cronjob on my Debian box that's meant to
run this a few times per week, and I tried manually running it on a puny
Gentoo box I have (four whole Atom cores!). Nothing obviously broke.
¯\_(ツ)_/¯

I don't know if we have a Python style guide, so I just shoved this
through yapf with all the defaults on.

Finally, though the focus is clang at the moment, the hope is that this
is easily applicable to other LLVM-y tools with minimal effort (e.g.
lld, opt, ...). Hence, this lives in llvm/utils and tries to be somewhat
ambiguous about naming.

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

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

5 years ago[Spectre] Fix MIR verifier errors in retpoline thunks
Reid Kleckner [Fri, 26 Oct 2018 20:26:36 +0000 (20:26 +0000)]
[Spectre] Fix MIR verifier errors in retpoline thunks

Summary:
The main challenge here is that X86InstrInfo::AnalyzeBranch doesn't
understand the way we're using a CALL instruction as a branch, so we
can't list the CallTarget MBB as a successor of the entry block. If we
don't list it as a successor, then the AsmPrinter doesn't print a label
for the MBB.

Fix the issue by inserting our own label at the beginning of the call
target block. We can rely on the AsmPrinter to always emit it, even
though the block appears to be unreachable, but address-taken.

Fixes PR38391.

Reviewers: thegameg, chandlerc, echristo

Subscribers: hiraditya, llvm-commits

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

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

5 years ago[ARM] Make InstrEmitter mark CPSR defs dead for Thumb1.
Eli Friedman [Fri, 26 Oct 2018 19:32:24 +0000 (19:32 +0000)]
[ARM] Make InstrEmitter mark CPSR defs dead for Thumb1.

The "dead" markings allow existing target-independent optimizations,
like MachineSink, to trigger more frequently. The CPSR defs would have
eventually been marked dead by LiveVariables, so this only affects
optimizations before regalloc.

The ARMBaseInstrInfo.cpp change is fixing a bug which is only visible
with this change: the transform adds a use to an otherwise dead def
of CPSR. This is covered by existing regression tests.

thumb2-tbh.ll breaks for Thumb1 due to MachineLICM changing the
generated code; I'll fix it in D53452.

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

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

5 years ago[XRay] Use std::errc::invalid_argument instead of std::errc::bad_message
Yi Kong [Fri, 26 Oct 2018 18:25:27 +0000 (18:25 +0000)]
[XRay] Use std::errc::invalid_argument instead of std::errc::bad_message

This change should appease the mingw32 builds.

Similar to r293725.

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

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

5 years ago[PowerPC] Improve BUILD_VECTOR of 4 i32s
Lei Huang [Fri, 26 Oct 2018 18:09:36 +0000 (18:09 +0000)]
[PowerPC] Improve BUILD_VECTOR of 4 i32s

Currently, for this node:
  vector int test(int a, int b, int c, int d) {
    return (vector int) { a, b, c, d };
  }

we get this on Power9:
  mtvsrdd 34, 5, 3
  mtvsrdd 35, 6, 4
  vmrgow 2, 3, 2

and this on Power8:
  mtvsrwz 0, 3
  mtvsrwz 1, 5
  mtvsrwz 2, 4
  mtvsrwz 3, 6
  xxmrghd 34, 1, 0
  xxmrghd 35, 3, 2
  vmrgow 2, 3, 2

This can be improved to this on LE Power9:
  rldimi 3, 4, 32, 0
  rldimi 5, 6, 32, 0
  mtvsrdd 34, 5, 3

and this on LE Power8
  rldimi 3, 4, 32, 0
  rldimi 5, 6, 32, 0
  mtvsrd 34, 3
  mtvsrd 35, 5
  xxpermdi 34, 35, 34, 0

This patch updates the TD pattern to generate the optimized sequence for both
Power8 and Power9 on LE and BE.

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

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

5 years agoPointer types were treated as zero-size by MergeICmps
Christy Lee [Fri, 26 Oct 2018 18:02:06 +0000 (18:02 +0000)]
Pointer types were treated as zero-size by MergeICmps

Summary:
The visitICmp analysis function would record compares of pointer types, as size 0. This causes the resulting memcmp() call to have the wrong total size.
Found with "self-build" of clang/LLVM on Windows.

Reviewers: christylee, trentxintong, courbet

Reviewed By: courbet

Subscribers: llvm-commits

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

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

5 years ago[ADT] Use explicit constructors for DenseMapPair to work around compiler issues.
Lang Hames [Fri, 26 Oct 2018 17:48:50 +0000 (17:48 +0000)]
[ADT] Use explicit constructors for DenseMapPair to work around compiler issues.

Inheriting constructors from std::pair caused clang-3.8 to treat some DenseMap
initializer_list constructor calls as ambiguous, which broke several bots. This
commit explicitly defines DenseMapPair's constructos to work around the issue.

https://reviews.llvm.org/D53726

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

5 years ago[llvm-ar] Strip trailing \r and format
Fangrui Song [Fri, 26 Oct 2018 17:38:27 +0000 (17:38 +0000)]
[llvm-ar] Strip trailing \r and format

Reviewers: mstorsjo, rupprecht, gbreynoo

Reviewed By: rupprecht

Subscribers: llvm-commits

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

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

5 years ago[X86] Stop promoting vector and/or/xor/andn to vXi64.
Craig Topper [Fri, 26 Oct 2018 17:21:26 +0000 (17:21 +0000)]
[X86] Stop promoting vector and/or/xor/andn to vXi64.

These promotions add additional bitcasts to the SelectionDAG that can pessimize computeKnownBits/computeNumSignBits. It also seems to interfere with broadcast formation.

This patch removes the promotion and adds isel patterns instead.

The increased table size is more than I would like, but hopefully we can find some canonicalizations or other tricks to start pruning out patterns going forward.

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

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

5 years ago[X86] Add -LABEL to some FileCheck checks. NFC
Craig Topper [Fri, 26 Oct 2018 17:21:19 +0000 (17:21 +0000)]
[X86] Add -LABEL to some FileCheck checks. NFC

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

5 years ago[llvm-ar] Add a dependency to BinaryFormat after rL345383
Fangrui Song [Fri, 26 Oct 2018 17:15:52 +0000 (17:15 +0000)]
[llvm-ar] Add a dependency to BinaryFormat after rL345383

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

5 years ago[DWARF][NFC] cleanup (mostly leftovers from the implementation of string offsets...
Wolfgang Pieb [Fri, 26 Oct 2018 17:14:46 +0000 (17:14 +0000)]
[DWARF][NFC] cleanup (mostly leftovers from the implementation of string offsets tables)
Majority of the patch by David Blaikie.

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

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

5 years ago[tblgen] Improve comments in TargetInstrPredicate.td. NFC
Andrea Di Biagio [Fri, 26 Oct 2018 16:22:26 +0000 (16:22 +0000)]
[tblgen] Improve comments in TargetInstrPredicate.td. NFC

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

5 years agoRevert "UBSan blacklist workaround for bot timeouts"
Vlad Tsyrklevich [Fri, 26 Oct 2018 16:07:50 +0000 (16:07 +0000)]
Revert "UBSan blacklist workaround for bot timeouts"

This reverts commit r335525. This workaround is no longer necessary
because PR37929 has been fixed.

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

5 years ago[MIR] Simplify and move MIR test
Francis Visoiu Mistrih [Fri, 26 Oct 2018 16:00:29 +0000 (16:00 +0000)]
[MIR] Simplify and move MIR test

Also fixes a Machine Verifier issue.

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

5 years ago[X86][SSE] Move 2-input limit up from getFauxShuffleMask to resolveTargetShuffleInputs
Simon Pilgrim [Fri, 26 Oct 2018 15:19:02 +0000 (15:19 +0000)]
[X86][SSE] Move 2-input limit up from getFauxShuffleMask to resolveTargetShuffleInputs

Makes no difference to actual shuffle decoding yet, but merges all the existing limits in one place for when proper support is fixed.

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

5 years ago[x86] commute blendvb with constant condition op to allow load folding
Sanjay Patel [Fri, 26 Oct 2018 14:58:13 +0000 (14:58 +0000)]
[x86] commute blendvb with constant condition op to allow load folding

This is a narrow fix for 1 of the problems mentioned in PR27780:
https://bugs.llvm.org/show_bug.cgi?id=27780

I looked at more general solutions, but it's a mess. We canonicalize shuffle masks
based on the number of elements accessed from each operand, and that's not optional.
If you remove that, we'll crash because we fail to match isel patterns. So I'm
waiting until we're sure that we have blendvb with constant condition and then
commuting based on the load potential. Other cases like blend-with-immediate are
already handled elsewhere, so this is probably not a common problem anyway.

I didn't use "MayFoldLoad" because that checks for one-use and in these cases, we've
screwed that up by creating a temporary PSHUFB using these operands that we're counting
on to be killed later. Undoing that didn't look like a simple task because it's
intertwined with determining if we actually use both operands of the shuffle or not.a

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

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

5 years ago[X86] Use existing pulled out VT variables. NFCI.
Simon Pilgrim [Fri, 26 Oct 2018 14:39:28 +0000 (14:39 +0000)]
[X86] Use existing pulled out VT variables. NFCI.

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

5 years ago[SimpleLoopUnswitch] Unswitch by experimental.guard intrinsics
Max Kazantsev [Fri, 26 Oct 2018 14:20:11 +0000 (14:20 +0000)]
[SimpleLoopUnswitch] Unswitch by experimental.guard intrinsics

This patch adds support of `llvm.experimental.guard` intrinsics to non-trivial
simple loop unswitching. These intrinsics represent implicit control flow which
has pretty much the same semantics as usual conditional branches. The
algorithm of dealing with them is following:

- Consider guards as unswitching candidates;
- If a guard is considered the best candidate, turn it into a branch;
- Apply normal unswitching algorithm on this branch.

The patch has no compile time effect on code that does not contain any guards.

Differential Revision: https://reviews.llvm.org/D53744
Reviewed By: chandlerc

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

5 years ago[ARM] Fix ARMCodeGenPrepare test cases
Sjoerd Meijer [Fri, 26 Oct 2018 14:19:57 +0000 (14:19 +0000)]
[ARM] Fix ARMCodeGenPrepare test cases

While working on FileCheck producing better diagnostics in D53710, I noticed
that our test case is broken in a few different ways. The test was running, but
results were not checked as prefix CHECK-COMMON wasn't defined (which is what
FileCheck should warn about). Also, the output was different in 2 cases because
of recent changes in ARMCodeGenPrepare.

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

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

5 years ago[CodeGen] Remove out operands from PATCHABLE_OP
Francis Visoiu Mistrih [Fri, 26 Oct 2018 13:37:25 +0000 (13:37 +0000)]
[CodeGen] Remove out operands from PATCHABLE_OP

The current model requires 1 out operand, but it is not used nor created.

This fixed an x86 machine verifier issue.

Part of PR27481.

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

5 years ago[llvm-ar] Access ADDLIB in llvm-ar via command line
Owen Reynolds [Fri, 26 Oct 2018 13:34:38 +0000 (13:34 +0000)]
[llvm-ar] Access ADDLIB in llvm-ar via command line

ADDLIB is called to add the contents of an archive to another archive.
Previously this was only accessible through the use of an MRI script.

With the use of a new "L" modifier, archive files can treated in the
manner above when using quick append.

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

5 years ago[AMDGPU] Add a pass to promote bitcast calls
Scott Linder [Fri, 26 Oct 2018 13:18:36 +0000 (13:18 +0000)]
[AMDGPU] Add a pass to promote bitcast calls

AMDGPU currently only supports direct calls, but at lower optimisation levels it
fails to lower statically direct calls which appear indirect due to a bitcast.

Add a pass to visit all CallSites and use CallPromotionUtils to "devirtualize"
calls.

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

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

5 years agoRegenerate test
Simon Pilgrim [Fri, 26 Oct 2018 12:33:56 +0000 (12:33 +0000)]
Regenerate test

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

5 years ago[llvm-mca] Fix -wreorder and -Wunused-private-field after r345376. NFC
Sam McCall [Fri, 26 Oct 2018 12:19:48 +0000 (12:19 +0000)]
[llvm-mca] Fix -wreorder and -Wunused-private-field after r345376. NFC

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

5 years ago[Codegen] - Implement basic .debug_loclists section emission (DWARF5).
George Rimar [Fri, 26 Oct 2018 11:25:12 +0000 (11:25 +0000)]
[Codegen] - Implement basic .debug_loclists section emission (DWARF5).

.debug_loclists is the DWARF 5 version of the .debug_loc.
With that patch, it will be emitted when DWARF 5 is used.

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

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

5 years ago[llvm-mca] Removed dependency on mca::SourcMgr in some Views. NFC
Andrea Di Biagio [Fri, 26 Oct 2018 10:48:04 +0000 (10:48 +0000)]
[llvm-mca] Removed dependency on mca::SourcMgr in some Views. NFC

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

5 years ago[SimpleLoopUnswitch] Make all checks before actual non-trivial unswitch
Max Kazantsev [Fri, 26 Oct 2018 09:52:58 +0000 (09:52 +0000)]
[SimpleLoopUnswitch] Make all checks before actual non-trivial unswitch

We should be able to make all relevant checks before we actually start the non-trivial
unswitching, so that we could guarantee that once we have started the transform,
it will always succeed.

Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D53747

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

5 years ago[SystemZ] Fix -Wcovered-switch-default as coding standard regulates
Fangrui Song [Fri, 26 Oct 2018 06:59:08 +0000 (06:59 +0000)]
[SystemZ] Fix -Wcovered-switch-default as coding standard regulates

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

5 years ago[NFC] Add periods to CREDITS.txt (testing git-llvm)
Kristina Brooks [Fri, 26 Oct 2018 06:57:02 +0000 (06:57 +0000)]
[NFC] Add periods to CREDITS.txt (testing git-llvm)

NFC commit to test git-llvm bridge for current GitHub monorepo.

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

5 years ago[llvm-nm] Simplify. NFC
Fangrui Song [Fri, 26 Oct 2018 06:56:51 +0000 (06:56 +0000)]
[llvm-nm] Simplify. NFC

Change a \t to spaces
Change some zero-filling memcpy to aggregate initialization
Delete redundant ArchiveName.clear() after declaration

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

5 years ago[PowerPC] Fix some missed optimization opportunities in combineSetCC
Li Jia He [Fri, 26 Oct 2018 06:48:53 +0000 (06:48 +0000)]
[PowerPC] Fix some missed optimization opportunities in combineSetCC

For both operands are bool, short, int, long, long long, add the following optimization.
1. 0-x == y --> x+y ==0
2. 0-x != y --> x+y != 0

Review: nemanjai
Differential Revision: https://reviews.llvm.org/D53360

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

5 years ago[PowerPC][NFC] Add tests for some missed optimization opportunities in combineSetCC
Li Jia He [Fri, 26 Oct 2018 05:02:10 +0000 (05:02 +0000)]
[PowerPC][NFC] Add tests for some missed optimization opportunities in combineSetCC

For both operands are bool, short, int, long, long long, add the following optimization test case.
1. 0-x == y --> x+y ==0
2. 0-x != y --> x+y != 0

Review: nemanjai
Differential Revision: https://reviews.llvm.org/D53358

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

5 years agoThis reverts commit r345357, It is wrong to create a new directory and put the test...
Li Jia He [Fri, 26 Oct 2018 04:54:56 +0000 (04:54 +0000)]
This reverts commit  r345357, It is wrong to create a new directory and put the test file into it. I am sorry for this.

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

5 years ago[NFC] Fix the regular expression for BE PPC in update_llc_test_checks.py
Nemanja Ivanovic [Fri, 26 Oct 2018 03:30:28 +0000 (03:30 +0000)]
[NFC] Fix the regular expression for BE PPC in update_llc_test_checks.py

Currently, the regular expression that matches the lines of assembly for PPC LE
(ELFv2) does not work for the assembly for BE (ELFv1). This patch fixes it.

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

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

5 years ago[PowerPC] Keep vector int to fp conversions in vector domain
Nemanja Ivanovic [Fri, 26 Oct 2018 03:19:13 +0000 (03:19 +0000)]
[PowerPC] Keep vector int to fp conversions in vector domain

At present a v2i16 -> v2f64 convert is implemented by extracts to scalar,
scalar converts, and merge back into a vector. Use vector converts instead,
with the int data permuted into the proper position and extended if necessary.

Patch by RolandF.

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

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

5 years ago[Pipeliner] Mark swp-art-deps-rec.ll as REQUIRES: asserts after rL345319
Fangrui Song [Fri, 26 Oct 2018 03:15:56 +0000 (03:15 +0000)]
[Pipeliner] Mark swp-art-deps-rec.ll as REQUIRES: asserts after rL345319

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

5 years agoAdd dependency from SystemZAsmParser to SystemZAsmPrinter after rL345349
Fangrui Song [Fri, 26 Oct 2018 03:04:54 +0000 (03:04 +0000)]
Add dependency from SystemZAsmParser to SystemZAsmPrinter after rL345349

This fixes -DBUILD_SHARED_LIBS=on build. The dependency is similar to that of X86's.

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

5 years ago[PowerPC][NFC] Add tests for some missed optimization opportunities in combineSetCC
Li Jia He [Fri, 26 Oct 2018 02:34:57 +0000 (02:34 +0000)]
[PowerPC][NFC] Add tests for some missed optimization opportunities in combineSetCC

For both operands are bool, short, int, long, long long, add the following optimization test case.
1. 0-x == y --> x+y ==0
2. 0-x != y --> x+y != 0

Review: nemanjai
Differential Revision: https://reviews.llvm.org/D53358

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

5 years agoRevert "[AArch64] Create proper memoperand for multi-vector stores"
Vlad Tsyrklevich [Fri, 26 Oct 2018 02:00:14 +0000 (02:00 +0000)]
Revert "[AArch64] Create proper memoperand for multi-vector stores"

This reverts commit r345315, it was causing test failures on
sanitizer-x86_64-linux-fast.

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

5 years agoadd myself to the CREDITS.TXT
Li Jia He [Fri, 26 Oct 2018 01:58:23 +0000 (01:58 +0000)]
add myself to the CREDITS.TXT

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

5 years agoTeach the DominatorTree fallback to recalculation when applying updates to speedup...
Chijun Sima [Fri, 26 Oct 2018 01:28:36 +0000 (01:28 +0000)]
Teach the DominatorTree fallback to recalculation when applying updates to speedup JT (PR37929)

Summary:
This patch makes the dominatortree recalculate when applying updates with the size of the update vector larger than a threshold. Directly applying updates is usually slower than recalculating the whole domtree in this case. This patch fixes an issue which causes JT running slowly on some inputs.

In bug 37929, the dominator tree is trying to apply 19,000+ updates several times, which takes several minutes.

After this patch, the time used by DT.applyUpdates:

| Input | Before (s) | After (s) | Speedup |
| the 2nd Reproducer in 37929 | 297 | 0.15 | 1980x |
| clang-5.0.0.0.bc | 9.7 | 4.3 | 2.26x |
| clang-5.0.0.4.bc | 11.6 | 2.6 | 4.46x |

Reviewers: kuhar, brzycki, trentxintong, davide, dmgreen, grosser

Reviewed By: kuhar, brzycki

Subscribers: kristina, llvm-commits

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

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

5 years ago[SystemZ] Implement SystemZOperand::print()
Jonas Paulsson [Fri, 26 Oct 2018 00:36:00 +0000 (00:36 +0000)]
[SystemZ] Implement SystemZOperand::print()

SystemZAsmParser can now handle -debug by printing the operands neatly to the
output stream. Before this patch this lead to an llvm_unreachable().

It seems that now '-mllvm -debug' does not cause any crashes anywhere (at
least not on SPEC).

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

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

5 years agoDump public symbol records in pdb2yaml mode
Zachary Turner [Fri, 26 Oct 2018 00:17:31 +0000 (00:17 +0000)]
Dump public symbol records in pdb2yaml mode

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

5 years ago[SystemZ] Pass the DAG pointer from SystemZAddressingMode::dump().
Jonas Paulsson [Fri, 26 Oct 2018 00:02:33 +0000 (00:02 +0000)]
[SystemZ]  Pass the DAG pointer from SystemZAddressingMode::dump().

In order to print the IR slot number for the memory operand, the DAG pointer
must be passed to SDNode::dump().

The isel-debug.ll test updated to also check for the IR Value reference being
printed correctly.

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

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

5 years agoReland "[WebAssembly] LSDA info generation"
Heejin Ahn [Thu, 25 Oct 2018 23:55:10 +0000 (23:55 +0000)]
Reland "[WebAssembly] LSDA info generation"

Summary:
This adds support for LSDA (exception table) generation for wasm EH.
Wasm EH mostly follows the structure of Itanium-style exception tables,
with one exception: a call site table entry in wasm EH corresponds to
not a call site but a landing pad.

In wasm EH, the VM is responsible for stack unwinding. After an
exception occurs and the stack is unwound, the control flow is
transferred to wasm 'catch' instruction by the VM, after which the
personality function is called from the compiler-generated code. (Refer
to WasmEHPrepare pass for more information on this part.)

This patch:
- Changes wasm.landingpad.index intrinsic to take a token argument, to
make this 1:1 match with a catchpad instruction
- Stores landingpad index info and catch type info MachineFunction in
before instruction selection
- Lowers wasm.lsda intrinsic to an MCSymbol pointing to the start of an
exception table
- Adds WasmException class with overridden methods for table generation
- Adds support for LSDA section in Wasm object writer

Reviewers: dschuff, sbc100, rnk

Subscribers: mgorny, jgravelle-google, sunfish, llvm-commits

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

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

5 years ago[WebAssembly] Support EH instructions in InstPrinter
Heejin Ahn [Thu, 25 Oct 2018 23:45:48 +0000 (23:45 +0000)]
[WebAssembly] Support EH instructions in InstPrinter

Summary: This adds support for exception handling instructions to InstPrinter.

Reviewers: dschuff, aardappel

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

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

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

5 years agoFix in MachineOperand::printIRValueReference().
Jonas Paulsson [Thu, 25 Oct 2018 23:39:07 +0000 (23:39 +0000)]
Fix in MachineOperand::printIRValueReference().

Handle the case where getCurrentFunction() returns nullptr by passing -1 to
printIRSlotNumber(). This will result in <badref> being printed instead of an
assertion failure.

Review: Francis Visoiu Mistrih
https://reviews.llvm.org/D53333

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

5 years ago[AArch64] Implement FP16FML intrinsics
Bryan Chan [Thu, 25 Oct 2018 23:36:41 +0000 (23:36 +0000)]
[AArch64] Implement FP16FML intrinsics

Add LLVM intrinsics for the ARMv8.2-A FP16FML vector-form instructions. Add a
DAG pattern to define the indexed-form intrinsics in terms of the vector-form
ones, similarly to how the Dot Product intrinsics were implemented.

Based on a patch by Gao Yiling.

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

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

5 years agoDelete test case. Assertions can't be tested.
Heejin Ahn [Thu, 25 Oct 2018 23:35:15 +0000 (23:35 +0000)]
Delete test case. Assertions can't be tested.

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

5 years agoTidy up test case
Heejin Ahn [Thu, 25 Oct 2018 23:35:15 +0000 (23:35 +0000)]
Tidy up test case

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

5 years agoAddress comments
Heejin Ahn [Thu, 25 Oct 2018 23:35:14 +0000 (23:35 +0000)]
Address comments

- Add llvm-mc test case (and delete the old one)
- Change report_fatal_error to assertions

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

5 years ago[WebAssembly] Error out when block/loop markers mismatch
Heejin Ahn [Thu, 25 Oct 2018 23:35:13 +0000 (23:35 +0000)]
[WebAssembly] Error out when block/loop markers mismatch

Summary:
Currently InstPrinter ignores if there are mismatches between block/loop
and end markers by skipping the case if ControlFlowStack is empty. I
guess it is better to explicitly error out in this case, because this
signals invalid input.

Reviewers: aardappel

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

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

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

5 years ago[SystemZ] NFC reformatting in SystemZTargetTransformInfo.cpp
Jonas Paulsson [Thu, 25 Oct 2018 22:53:27 +0000 (22:53 +0000)]
[SystemZ]  NFC reformatting in SystemZTargetTransformInfo.cpp

Some lines more than 80 characters long reformatted.

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

5 years ago[SystemZ] Improve getMemoryOpCost() to find foldable loads that are converted.
Jonas Paulsson [Thu, 25 Oct 2018 22:28:25 +0000 (22:28 +0000)]
[SystemZ] Improve getMemoryOpCost() to find foldable loads that are converted.

The SystemZ backend can do arithmetic of memory by loading and then extending
one of the operands. Similarly, a load + truncate can be folded into an
operand.

This patch improves the SystemZ TTI cost function to recognize this.

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

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

5 years agoDebugInfo: Explain why DW_LLE_(GNU_)startx_length is used
David Blaikie [Thu, 25 Oct 2018 22:26:25 +0000 (22:26 +0000)]
DebugInfo: Explain why DW_LLE_(GNU_)startx_length is used

This isn't the most object-size efficient encoding, but it's the only
one GDB supports for the pre-standard fission format. I've written fixes
for this twice now... - so perhaps this comment will help me remember
why neither of these have been committed and why I shouldn't try to
write a third fix another year from now...

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

5 years ago[x86] add tests for missed load folding; NFC
Sanjay Patel [Thu, 25 Oct 2018 22:23:27 +0000 (22:23 +0000)]
[x86] add tests for missed load folding; NFC

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

5 years ago[SystemZ] Improve handling and cost estimates of vector integer div/rem
Jonas Paulsson [Thu, 25 Oct 2018 21:47:22 +0000 (21:47 +0000)]
[SystemZ]  Improve handling and cost estimates of vector integer div/rem

Enable the DAG optimization that converts vector div/rem with constants into
multiply+shifts sequences by expanding them early. This is needed since
ISD::SMUL_LOHI is 'Custom' lowered on SystemZ, and will therefore not be
available to BuildSDIV after legalization.

Better cost values for these instructions based on how they will be
implemented (a constant divisor is cheaper).

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

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

5 years agollvm-dwarfdump: loclists: Don't expect an (albeit empty) expression for LLE_base_address
David Blaikie [Thu, 25 Oct 2018 21:35:59 +0000 (21:35 +0000)]
llvm-dwarfdump: loclists: Don't expect an (albeit empty) expression for LLE_base_address

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

5 years ago[Pipeliner] Ignore Artificial dependences while computing recurrences.
Sumanth Gundapaneni [Thu, 25 Oct 2018 21:27:08 +0000 (21:27 +0000)]
[Pipeliner] Ignore Artificial dependences while computing recurrences.

The artificial dependencies are not real dependencies. In some cases, they
form circuits with bigger MII. However, they are used to schedule instructions
better.

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

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

5 years ago[Pipeliner] Remove the unneeded include header(NFC).
Sumanth Gundapaneni [Thu, 25 Oct 2018 21:25:30 +0000 (21:25 +0000)]
[Pipeliner] Remove the unneeded include header(NFC).

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

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

5 years ago[X86] Change X86 backend to look for 'min-legal-vector-width' attribute instead of...
Craig Topper [Thu, 25 Oct 2018 21:16:06 +0000 (21:16 +0000)]
[X86] Change X86 backend to look for 'min-legal-vector-width' attribute instead of 'required-vector-width' when determining whether 512-bit vectors should be legal.

The required-vector-width attribute was only used for backend testing and has never been generated by clang.

I believe clang is now generating min-legal-vector-width for vector uses in user code.

With this I believe passing -mprefer-vector-width=256 to clang should prevent use of zmm registers in the generated assembly unless the user used a 512-bit intrinsic in their source code.

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

5 years ago[CodeGen] Remove operands from FENTRY_CALL
Francis Visoiu Mistrih [Thu, 25 Oct 2018 21:12:15 +0000 (21:12 +0000)]
[CodeGen] Remove operands from FENTRY_CALL

FENTRY_CALL is actually not taking any input / output operands. The
machine verifier complains now because the target description says that:

* It needs 1 unknown output
* It needs 1 or more variable inputs

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

5 years ago[AArch64] Create proper memoperand for multi-vector stores
David Greene [Thu, 25 Oct 2018 21:10:39 +0000 (21:10 +0000)]
[AArch64] Create proper memoperand for multi-vector stores

Include all of the store's source vector operands when creating the
MachineMemOperand. Previously, we were missing the first operand,
making the store size seem smaller than it really is.

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

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

5 years ago[AArch64][GlobalISel] Simplify a legalizer test. NFC.
Volkan Keles [Thu, 25 Oct 2018 20:01:19 +0000 (20:01 +0000)]
[AArch64][GlobalISel] Simplify a legalizer test. NFC.

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

5 years ago[WebAssembly] Use target-independent saturating add
Thomas Lively [Thu, 25 Oct 2018 19:06:13 +0000 (19:06 +0000)]
[WebAssembly] Use target-independent saturating add

Reviewers: aheejin, dschuff

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

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

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

5 years ago[X86] Add some non-AVX512VL command lines to the *vl-vec-test-testn.ll tests.
Craig Topper [Thu, 25 Oct 2018 18:23:48 +0000 (18:23 +0000)]
[X86] Add some non-AVX512VL command lines to the *vl-vec-test-testn.ll tests.

This will expose some regressions in the WIP and/or/xor promotion removal patch.

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

5 years ago[FPEnv] Last BinaryOperator::isFNeg(...) to m_FNeg(...) changes
Cameron McInally [Thu, 25 Oct 2018 18:09:33 +0000 (18:09 +0000)]
[FPEnv] Last BinaryOperator::isFNeg(...) to m_FNeg(...) changes

Replacing BinaryOperator::isFNeg(...) to avoid regressions when we
separate FNeg from the FSub IR instruction.

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

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

5 years ago[X86] Add KNL command lines to movmsk-cmp.ll.
Craig Topper [Thu, 25 Oct 2018 18:06:25 +0000 (18:06 +0000)]
[X86] Add KNL command lines to movmsk-cmp.ll.

Some of this code looks pretty bad and we should probably still be using movmskb more with avx512f.

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

5 years ago[GlobalISel] LegalizerHelper: Fix the incorrect alignment when splitting loads/stores...
Volkan Keles [Thu, 25 Oct 2018 17:52:19 +0000 (17:52 +0000)]
[GlobalISel] LegalizerHelper: Fix the incorrect alignment when splitting loads/stores in narrowScalar

Reviewers: dsanders, bogner, jpaquette, aemerson, ab, paquette

Reviewed By: dsanders

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

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

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

5 years ago[LegalizeDAG] Remove dead SINT_TO_FP legalization code
Simon Pilgrim [Thu, 25 Oct 2018 17:43:36 +0000 (17:43 +0000)]
[LegalizeDAG] Remove dead SINT_TO_FP legalization code

As noticed on D52965, the SINT_TO_FP i64 to f32 legalization code has been dead for years - protected by an assert.

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

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

5 years ago[GISel] LegalizerInfo: Rename MemDesc::Size to SizeInBits to make the value clearer
Volkan Keles [Thu, 25 Oct 2018 17:37:07 +0000 (17:37 +0000)]
[GISel] LegalizerInfo: Rename MemDesc::Size to SizeInBits to make the value clearer

Requested in D53679.

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

5 years ago[X86] Remove ProcIntelKNL and replace with a SlowPMADDWD flag to use in the one place...
Craig Topper [Thu, 25 Oct 2018 17:29:00 +0000 (17:29 +0000)]
[X86] Remove ProcIntelKNL and replace with a SlowPMADDWD flag to use in the one place it was checked.

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

5 years ago[X86] Remove some uarch tuning flags from KNL that look to have been inherited from...
Craig Topper [Thu, 25 Oct 2018 17:28:57 +0000 (17:28 +0000)]
[X86] Remove some uarch tuning flags from KNL that look to have been inherited from SNB/IVB incorrectly

KNL is based on a modified Silvermont core so I don't think these features apply. I think the LEA flag is probably also wrong, but I'm less sure as I barely understand the 3 LEA flags we have currently.

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

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

5 years ago[AArch64][GlobalISel] Fix the LegalityPredicate for lowerIf for G_LOAD/G_STORE
Volkan Keles [Thu, 25 Oct 2018 17:23:25 +0000 (17:23 +0000)]
[AArch64][GlobalISel] Fix the LegalityPredicate for lowerIf for G_LOAD/G_STORE

Summary:
Currently, Legalizer is trying to lower G_LOAD with a vector type
that has more than two elements due to the incorrect LegalityPredicate.

This patch fixes the issue by removing the multiplication by 8
as `MemDesc.Size` already contains the size in bits.

Reviewers: dsanders, aemerson

Reviewed By: dsanders

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

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

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

5 years ago[llvm-mca] Introduce a new base class for mca::Instruction, and change how read/write...
Andrea Di Biagio [Thu, 25 Oct 2018 17:03:51 +0000 (17:03 +0000)]
[llvm-mca] Introduce a new base class for mca::Instruction, and change how read/write information is stored.

This patch introduces a new base class for Instruction named InstructionBase.
Class InstructionBase is responsible for tracking data dependencies with the
help of ReadState and WriteState objects.  Class Instruction now derives from
InstructionBase, and adds extra information related to the `InstrStage` as well
as the `RCUTokenID`.

ReadState and WriteState objects are no longer unique pointers. This avoids
extra heap allocation and pointer checks that weren't really needed.  Now, those
objects are simply stored into SmallVectors.  We use a SmallVector instead of a
std::vector because we expect most instructions to only have a very small number
of reads and writes.  By using a simple SmallVector we also avoid extra heap
allocations most of the time.
In a debug build, this improves the performance of llvm-mca by roughly 10% (I
still have to verify the impact in performance on a release build).

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

5 years ago[AArch64] Refactor Exynos feature sets (NFC)
Evandro Menezes [Thu, 25 Oct 2018 16:45:46 +0000 (16:45 +0000)]
[AArch64] Refactor Exynos feature sets (NFC)

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

5 years ago[ARM] Regenerate vdup tests
Simon Pilgrim [Thu, 25 Oct 2018 15:33:47 +0000 (15:33 +0000)]
[ARM] Regenerate vdup tests

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

5 years ago[AArch64] Add EXT patterns for 64-bit EXT of a subvector of a 128-bit vector
John Brawn [Thu, 25 Oct 2018 15:31:51 +0000 (15:31 +0000)]
[AArch64] Add EXT patterns for 64-bit EXT of a subvector of a 128-bit vector

If we have a 64-bit EXT where one of the operands is a subvector of a 128-bit
vector then in some cases we can eliminate an extract_subvector by converting
to a 128-bit EXT of the 128-bit vector.

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

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

5 years ago[ARM] Use Cortex-A57 sched model for Cortex-A72
Sam Parker [Thu, 25 Oct 2018 15:08:29 +0000 (15:08 +0000)]
[ARM] Use Cortex-A57 sched model for Cortex-A72

This mirrors what we already do for AArch64 as the cores are similar.
As discussed in the review, enabling the machine scheduler causes
more variations in performance changes so it is not enabled for now.
This patch improves LNT scores by a geomean of 1.57% at -O3.

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

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

5 years ago[AArch64] Refactor definition of EXT patterns to use a multiclass
John Brawn [Thu, 25 Oct 2018 15:00:10 +0000 (15:00 +0000)]
[AArch64] Refactor definition of EXT patterns to use a multiclass

Using a multiclass reduces duplication, and makes it easier to add new patterns
later. This refactoring does add some new patterns, but as far as I can tell
there's no IR that will end up triggering them so this is effectively NFC.

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

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

5 years ago[AArch64] Do 64-bit vector move of 0 and -1 by extracting from the 128-bit move
John Brawn [Thu, 25 Oct 2018 14:56:48 +0000 (14:56 +0000)]
[AArch64] Do 64-bit vector move of 0 and -1 by extracting from the 128-bit move

Currently a vector move of 0 or -1 will use different instructions depending on
the size of the vector. Using a single instruction (the 128-bit one) for both
gives more opportunity for Machine CSE to eliminate instructions.

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

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

5 years ago[DEBUG_INFO][NVPTX]Fix processing of DBG_VALUES.
Alexey Bataev [Thu, 25 Oct 2018 14:27:27 +0000 (14:27 +0000)]
[DEBUG_INFO][NVPTX]Fix processing of DBG_VALUES.

Summary:
If the instruction in the eliminateFrameIndex function is a DBG_VALUE
instruction, it requires special processing. The frame register is set
to VRFrame and the offset is based on the object offset.
The code is similar to the code used in
lib/CodeGen/PrologEpilogInserter.cpp.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

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

5 years ago[X86] Fix llc invocation on MIR test case
Francis Visoiu Mistrih [Thu, 25 Oct 2018 14:11:07 +0000 (14:11 +0000)]
[X86] Fix llc invocation on MIR test case

The current state of the llc invocation is:

* Running all the passes from dwarfehprepare to stack coloring
(included)
* It runs it from the LLVM IR included in the file
* It *ADDS* the generated MI from ISel to the MI in the MIR file
* The machine verifier doesn't like it.

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

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

5 years ago[GlobalISel] Use the target preferred type for G_EXTRACT_VECTOR_ELT index.
Amara Emerson [Thu, 25 Oct 2018 14:04:54 +0000 (14:04 +0000)]
[GlobalISel] Use the target preferred type for G_EXTRACT_VECTOR_ELT index.

Allows for better imported pattern re-use.

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

5 years agoIR: Optimize StructType::get to perform one hash lookup instead of two, NFCI
Krasimir Georgiev [Thu, 25 Oct 2018 13:38:07 +0000 (13:38 +0000)]
IR: Optimize StructType::get to perform one hash lookup instead of two, NFCI

Summary:
This function was performing two hash lookups when a new struct type was requested: first checking if it exists and second to insert it. This patch updates the function to perform a single hash lookup in this case by updating the value in the hash table in-place in case the struct type was not there before.

Similar to r345151.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: llvm-commits

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

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

5 years ago[CostModel][X86] Add realistic vXi64 uitofp vXf64 costs
Simon Pilgrim [Thu, 25 Oct 2018 13:06:20 +0000 (13:06 +0000)]
[CostModel][X86] Add realistic vXi64 uitofp vXf64 costs

Match codegen improvements from D53649/rL345256

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

5 years ago[RISCV] Use PatFrags for variable shift patterns
Alex Bradbury [Thu, 25 Oct 2018 12:45:20 +0000 (12:45 +0000)]
[RISCV] Use PatFrags for variable shift patterns

This follows SystemZ and I think is cleaner vs the multiclass.

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

5 years ago[CostModel][X86] Add realistic i64 uitofp f64 scalar costs
Simon Pilgrim [Thu, 25 Oct 2018 12:42:10 +0000 (12:42 +0000)]
[CostModel][X86] Add realistic i64 uitofp f64 scalar costs

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

5 years ago[llvm-mca] Removed a couple of redundant method declarations, and simplified code...
Andrea Di Biagio [Thu, 25 Oct 2018 11:51:34 +0000 (11:51 +0000)]
[llvm-mca] Removed a couple of redundant method declarations, and simplified code in ResourcePressureView. NFC

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

5 years agoMissing semicolon.
Simon Pilgrim [Thu, 25 Oct 2018 11:38:17 +0000 (11:38 +0000)]
Missing semicolon.

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

5 years ago[TargetLowering] Improve vXi64 UINT_TO_FP vXf64 support (P38226)
Simon Pilgrim [Thu, 25 Oct 2018 11:15:57 +0000 (11:15 +0000)]
[TargetLowering] Improve vXi64 UINT_TO_FP vXf64 support (P38226)

As suggested on D52965, this patch moves the i64 to f64 UINT_TO_FP expansion code from LegalizeDAG into TargetLowering and makes it available to LegalizeVectorOps as well.

Not only does this help perform X86 lowering as a true vectorization instead of (partially vectorized) scalar conversions, it avoids the HADDPD op from the scalar code which can be slow on most targets.

The AVX512F does have the vcvtusi2sdq scalar operation but we don't unroll to use it as it seems to only help for the v2f64 case - otherwise the unrolling cost will certainly be too high. My feeling is that we should leave it to the vectorizers - and if it generates the vector UINT_TO_FP we should use it.

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

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

5 years ago[llvm-dwarfdump] - Fix incorrect parsing of the DW_LLE_startx_length
George Rimar [Thu, 25 Oct 2018 10:56:44 +0000 (10:56 +0000)]
[llvm-dwarfdump] - Fix incorrect parsing of the DW_LLE_startx_length

As was already mentioned in comments for D53364, DWARF 5
spec says about DW_LLE_startx_length:

"This is a form of bounded location description that has two unsigned ULEB operands.
The first value is an address index (into the .debug_addr section) that indicates the beginning of the address range
over which the location is valid. The second value is the length of the range. ")

Currently, the length is always parsed as U32.
Patch change the behavior to parse DW_LLE_startx_length as ULEB128 for DWARF 5
and keeps it as U32 for DWARF4+(pre-DWARF5) for compatibility.

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

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

5 years ago[TTI] Add generic SK_Broadcast shuffle costs
Simon Pilgrim [Thu, 25 Oct 2018 10:52:36 +0000 (10:52 +0000)]
[TTI] Add generic SK_Broadcast shuffle costs

I noticed while fixing PR39368 that we don't have generic shuffle costs for broadcast style shuffles.

This patch adds SK_BROADCAST handling, but exposes ARM/AARCH64 lack of handling of this type, which I've added a fix for at the same time.

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

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

5 years agoFix MSVC llvm-exegesis build. NFCI.
Simon Pilgrim [Thu, 25 Oct 2018 10:45:38 +0000 (10:45 +0000)]
Fix MSVC llvm-exegesis build. NFCI.

MSVC is a bit funny about is_pod.....

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