OSDN Git Service

android-x86/external-llvm.git
5 years ago[llvm-pdbutil] Support PDBs without a DBI stream
Alexandre Ganea [Mon, 6 Aug 2018 19:35:00 +0000 (19:35 +0000)]
[llvm-pdbutil] Support PDBs without a DBI stream

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

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

5 years ago[X86] Recognize a splat of negate in isFNEG
Easwaran Raman [Mon, 6 Aug 2018 19:23:38 +0000 (19:23 +0000)]
[X86] Recognize a splat of negate in isFNEG

Summary:
Expand isFNEG so that we generate the appropriate F(N)M(ADD|SUB)
instructions in more cases. For example, the following sequence
a = _mm256_broadcast_ss(f)
d = _mm256_fnmadd_ps(a, b, c)

generates an fsub and fma without this patch and an fnma with this
change.

Reviewers: craig.topper

Subscribers: llvm-commits, davidxl, wmi

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

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

5 years ago[X86] When using "and $0" and "orl $-1" to store 0 and -1 for minsize, make sure...
Craig Topper [Mon, 6 Aug 2018 18:44:26 +0000 (18:44 +0000)]
[X86] When using "and $0" and "orl $-1" to store 0 and -1 for minsize, make sure the store isn't volatile

If the store is volatile this might be a memory mapped IO access. In that case we shouldn't generate a load that didn't exist in the source

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

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

5 years ago[X86] Add test cases to show bad use of "and $0" and "orl $-1" for minsize when the...
Craig Topper [Mon, 6 Aug 2018 18:44:21 +0000 (18:44 +0000)]
[X86] Add test cases to show bad use of "and $0" and "orl $-1" for minsize when the store is volatile

If the store is volatile we shouldn't be adding a little that didn't exist in the source.

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

5 years ago[RegisterCoalescer] Delay live interval update work until the rematerialization
Wei Mi [Mon, 6 Aug 2018 17:30:45 +0000 (17:30 +0000)]
[RegisterCoalescer] Delay live interval update work until the rematerialization
for all the uses from the same def is done.

We run into a compile time problem with flex generated code combined with
`-fno-jump-tables`. The cause is that machineLICM hoists a lot of invariants
outside of a big loop, and drastically increases the compile time in global
register splitting and copy coalescing.  https://reviews.llvm.org/D49353
relieves the problem in global splitting. This patch is to handle the problem
in copy coalescing.

About the situation where the problem in copy coalescing happens. After
machineLICM, we have several defs outside of a big loop with hundreds or
thousands of uses inside the loop. Rematerialization in copy coalescing
happens for each use and everytime rematerialization is done, shrinkToUses
will be called to update the huge live interval. Because we have 'n' uses
for a def, and each live interval update will have at least 'n' complexity,
the total update work is n^2.

To fix the problem, we try to do the live interval update work in a collective
way. If a def has many copylike uses larger than a threshold, each time
rematerialization is done for one of those uses, we won't do the live interval
update in time but delay that work until rematerialization for all those uses
are completed, so we only have to do the live interval update work once.

Delaying the live interval update could potentially change the copy coalescing
result, so we hope to limit that change to those defs with many
(like above a hundred) copylike uses, and the cutoff can be adjusted by the
option -mllvm -late-remat-update-threshold=xxx.

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

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

5 years agoFix typo in the MSVC Visualizer for SmallVector class
Daniil Fukalov [Mon, 6 Aug 2018 16:47:24 +0000 (16:47 +0000)]
Fix typo in the MSVC Visualizer for SmallVector class

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

5 years agoFix raw_fd_ostream::write_impl hang due to an infinite loop with large output
Owen Reynolds [Mon, 6 Aug 2018 16:21:41 +0000 (16:21 +0000)]
Fix raw_fd_ostream::write_impl hang due to an infinite loop with large output

On windows when raw_fd_ostream::write_impl calls write, a 32 bit input is required for character count. As a variable with size_t is used for this argument, on x64 integral demotion occurs. In the case of large files an infinite loop follows.
See: https://bugs.llvm.org/show_bug.cgi?id=37926
This fix allows the output of files larger than the previous int32 limit.

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

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

5 years agoAMDGPU: Fold v_lshl_or_b32 with 0 src0
Matt Arsenault [Mon, 6 Aug 2018 15:40:20 +0000 (15:40 +0000)]
AMDGPU: Fold v_lshl_or_b32 with 0 src0

Appears from expansion of some packed cases.

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

5 years agoValueTracking: Handle canonicalize in CannotBeNegativeZero
Matt Arsenault [Mon, 6 Aug 2018 15:16:26 +0000 (15:16 +0000)]
ValueTracking: Handle canonicalize in CannotBeNegativeZero

Also fix apparently missing test coverage for any of the
handling here.

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

5 years agoAMDGPU: Rename check prefixes in test
Matt Arsenault [Mon, 6 Aug 2018 15:16:12 +0000 (15:16 +0000)]
AMDGPU: Rename check prefixes in test

Will avoid noisy diff in future change.

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

5 years ago[NFC] Fixed unused function warnings
David Bolvansky [Mon, 6 Aug 2018 15:09:15 +0000 (15:09 +0000)]
[NFC] Fixed unused function warnings

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

5 years agoRevert unused function fix
David Bolvansky [Mon, 6 Aug 2018 15:05:51 +0000 (15:05 +0000)]
Revert unused function fix

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

5 years ago[NFC] Fixed unused function warning
David Bolvansky [Mon, 6 Aug 2018 14:42:07 +0000 (14:42 +0000)]
[NFC] Fixed unused function warning

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

5 years ago[AArch64] Fix assertion failure on widened f16 BUILD_VECTOR
Bryan Chan [Mon, 6 Aug 2018 14:14:41 +0000 (14:14 +0000)]
[AArch64] Fix assertion failure on widened f16 BUILD_VECTOR

Summary:
Ensure that NormalizedBuildVector returns a BUILD_VECTOR with operands of the
same type. This fixes an assertion failure in VerifySDNode.

Reviewers: SjoerdMeijer, t.p.northover, javed.absar

Reviewed By: SjoerdMeijer

Subscribers: kristof.beyls, llvm-commits

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

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

5 years agoFix modules build with different technique to suppress Knuth debugging
Tim Northover [Mon, 6 Aug 2018 11:43:11 +0000 (11:43 +0000)]
Fix modules build with different technique to suppress Knuth debugging

Currently we use #pragma push_macro(LLVM_DEBUG) to fiddle with the LLVM_DEBUG
macro so that we can silence debugging the Knuth division algorithm unless it's
actually desired. Unfortunately this is incompatible with enabling modules
while building LLVM (via LLVM_ENABLE_MODULES=ON), probably due to a bug being
fixed by D33004.

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

5 years agoARM-MachO: don't add Thumb bit for addend to non-external relocation.
Tim Northover [Mon, 6 Aug 2018 11:32:44 +0000 (11:32 +0000)]
ARM-MachO: don't add Thumb bit for addend to non-external relocation.

ld64 supplies its own Thumb bit for Thumb functions, and intentionally zeroes
out that part of any addend in an object file. But it only does that for
symbols marked N_EXT -- i.e. external symbols. So LLVM should avoid setting
that extra bit in other cases.

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

5 years agoRe-enable "[ValueTracking] Teach isKnownNonNullFromDominatingCondition about AND"
Max Kazantsev [Mon, 6 Aug 2018 11:14:18 +0000 (11:14 +0000)]
Re-enable "[ValueTracking] Teach isKnownNonNullFromDominatingCondition about AND"

The patch was reverted because of bug detected by sanitizer. The bug is fixed,
respective tests added.

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

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

5 years ago[docs] Continue working around broken Sphinx parsing of LLVM code blocks
Chandler Carruth [Mon, 6 Aug 2018 10:20:05 +0000 (10:20 +0000)]
[docs] Continue working around broken Sphinx parsing of LLVM code blocks
by switching to `text` in another place.

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

5 years ago[docs] Remove the `dso_local` tag from these functions.
Chandler Carruth [Mon, 6 Aug 2018 10:03:25 +0000 (10:03 +0000)]
[docs] Remove the `dso_local` tag from these functions.

The sphinx build bot is erroring on these examples for some unknown
reason, and really the dso_local doesn't seem to be relevant to the
example in any way so its cleaner to omit it. And now they will look
a bit more like other (successful) IR examples.

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

5 years ago[docs] Stop trying to parse the ThinLTO summary IR fragments with the
Chandler Carruth [Mon, 6 Aug 2018 09:46:59 +0000 (09:46 +0000)]
[docs] Stop trying to parse the ThinLTO summary IR fragments with the
`llvm` syntax in Sphinx. This appears to just fail and create errors on
the docs buildbot.

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

5 years agoRevert rL338990 to see if it causes sanitizer failures
Max Kazantsev [Mon, 6 Aug 2018 08:10:28 +0000 (08:10 +0000)]
Revert rL338990 to see if it causes sanitizer failures

Multiple failues reported by sanitizer-x86_64-linux, seem to be caused by this
patch. Reverting to see if they sustain without it.

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

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

5 years agoTry to fix buildbot
Max Kazantsev [Mon, 6 Aug 2018 06:35:21 +0000 (06:35 +0000)]
Try to fix buildbot

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

5 years ago[ValueTracking] Teach isKnownNonNullFromDominatingCondition about AND
Max Kazantsev [Mon, 6 Aug 2018 06:11:36 +0000 (06:11 +0000)]
[ValueTracking] Teach isKnownNonNullFromDominatingCondition about AND

`isKnownNonNullFromDominatingCondition` is able to prove non-null basing on `br` or `guard`
by `%p != null` condition, but is unable to do so basing on `(%p != null) && %other_cond`.
This patch allows it to do so.

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

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

5 years ago[GuardWidening] Widen guards with conditions of frequently taken dominated branches
Max Kazantsev [Mon, 6 Aug 2018 05:49:19 +0000 (05:49 +0000)]
[GuardWidening] Widen guards with conditions of frequently taken dominated branches

If there is a frequently taken branch dominated by a guard, and its condition is available
at the point of the guard, we can widen guard with condition of this branch and convert
the branch into unconditional:

  guard(cond1)
  if (cond2) {
    // taken in 99.9% cases
    // do something
  } else {
    // do something else
  }

Converts to

  guard(cond1 && cond2)
  // do something

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

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

5 years ago[NFC] Fix typo
Xin Tong [Mon, 6 Aug 2018 05:03:21 +0000 (05:03 +0000)]
[NFC] Fix typo

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

5 years ago[NFC] Fixed unused function warning
David Bolvansky [Mon, 6 Aug 2018 04:45:46 +0000 (04:45 +0000)]
[NFC] Fixed unused function warning

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

5 years ago[DebugInfo] Refactor DbgInfoIntrinsic class hierarchy.
Hsiangkai Wang [Mon, 6 Aug 2018 03:59:47 +0000 (03:59 +0000)]
[DebugInfo] Refactor DbgInfoIntrinsic class hierarchy.

In the past, DbgInfoIntrinsic has a strong assumption that these
intrinsics all have variables and expressions attached to them.
However, it is too strong to derive the class for other debug entities.
Now, it has problems for debug labels.

In order to make DbgInfoIntrinsic as a base class for 'debug info', I
create a class for 'variable debug info', DbgVariableIntrinsic.

DbgDeclareInst, DbgAddrIntrinsic, and DbgValueInst will be derived from it.

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

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

5 years ago[docs] Switch debug info metadata blocks to use `text` instead of `llvm`
Chandler Carruth [Mon, 6 Aug 2018 03:35:36 +0000 (03:35 +0000)]
[docs] Switch debug info metadata blocks to use `text` instead of `llvm`
highlighting syntax.

Most of them already were like this, and the Sphinx runs on the docs
build bot seems to be substantially more picky and/or not have support
for a bunch of the syntax here. Hopefully this will let it progress past
this.

My previous attempt to fix the syntax made the `opt` tool happy, but no
idea what the Sphinx stuff is really looking for, and the fact that
other blocks already just use `text` led me to this solution.

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

5 years ago[docs] Correct the basic syntax structure of the DISubrange example.
Chandler Carruth [Mon, 6 Aug 2018 02:30:01 +0000 (02:30 +0000)]
[docs] Correct the basic syntax structure of the DISubrange example.

Notably, just close two of the debug info metadata nodes early rather
than leaving them open with `...` which won't ever lex correctly. And
add the missing `:` on the count labels.

Slowly progressing through all of the warnings on the documentation
build bot. Sorry to do this one commit at a time, but despite my best
efforts I can't trigger these errors locally.

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

5 years ago[docs] Remove an example that isn't well formed LLVM IR and trips up the
Chandler Carruth [Mon, 6 Aug 2018 02:02:09 +0000 (02:02 +0000)]
[docs] Remove an example that isn't well formed LLVM IR and trips up the
Sphinx syntax highlighter.

This example also doesn't really make sense. There is no control flow or
clarification of what the `Safe:` block exists to do... If we want
examples here, we should make them much more clear in addition to making
them well formed IR sequences.

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

5 years ago[docs] Fix an LLVM-syntax code block to actually be valid LLVM synatx.
Chandler Carruth [Mon, 6 Aug 2018 01:41:25 +0000 (01:41 +0000)]
[docs] Fix an LLVM-syntax code block to actually be valid LLVM synatx.

Hopefully fixes an issue on the docs build bot.

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

5 years ago[docs] Turn of `nasm` highlighting for a code block.
Chandler Carruth [Mon, 6 Aug 2018 01:19:43 +0000 (01:19 +0000)]
[docs] Turn of `nasm` highlighting for a code block.

This appears to produce a warning on the docs build bot. It doesn't
reproduce for me, likely because I have a newer (or more full featured)
pygments install.

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

5 years ago[docs] Reinstate r337730 - Add support for Markdown documentation in
Chandler Carruth [Mon, 6 Aug 2018 00:38:31 +0000 (00:38 +0000)]
[docs] Reinstate r337730 - Add support for Markdown documentation in
Sphinx.

We think the bot is updated now, so trying this again. I'm landing it
(with permission) as Michael is at a con at the moment.

Actual patch largely by Michael Spencer.

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

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

5 years ago[ORC] Remove an incorrect use of 'cantFail'.
Lang Hames [Sun, 5 Aug 2018 23:55:35 +0000 (23:55 +0000)]
[ORC] Remove an incorrect use of 'cantFail'.

This code was moved out from BasicObjectLayerMaterializationUnit, which required
the supplied object to be well formed. The getObjectSymbolFlags function does
not require a well-formed object, so we have to propagate the error here.

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

5 years ago[ORC] Change JITSymbolFlags debug output, add a function for getting a symbol
Lang Hames [Sun, 5 Aug 2018 22:35:37 +0000 (22:35 +0000)]
[ORC] Change JITSymbolFlags debug output, add a function for getting a symbol
flags map from a buffer representing an object file.

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

5 years ago[NFC] Fixed inliner tests - 2
David Bolvansky [Sun, 5 Aug 2018 16:53:36 +0000 (16:53 +0000)]
[NFC] Fixed inliner tests - 2

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

5 years ago[NFC] Fixed inliner tests
David Bolvansky [Sun, 5 Aug 2018 16:30:46 +0000 (16:30 +0000)]
[NFC] Fixed inliner tests

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

5 years agoEnrich inline messages
David Bolvansky [Sun, 5 Aug 2018 14:53:08 +0000 (14:53 +0000)]
Enrich inline messages

Summary:
This patch improves Inliner to provide causes/reasons for negative inline decisions.
1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
4. Adjusted tests for changed printing.

Patch by: yrouban (Yevgeny Rouban)

Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00

Reviewed By: tejohnson, xbolva00

Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith

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

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

5 years agoRevert "Add a warning if someone attempts to add extra section flags to sections"
Eric Christopher [Sun, 5 Aug 2018 14:23:37 +0000 (14:23 +0000)]
Revert "Add a warning if someone attempts to add extra section flags to sections"

There are a bunch of edge cases and inconsistencies in how we're emitting sections
cause this warning to fire and it needs more work.

This reverts commit r335558.

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

5 years ago[NFC][InstCombine] Add tests for sinking 'not' into 'xor' (PR38446)
Roman Lebedev [Sun, 5 Aug 2018 10:15:04 +0000 (10:15 +0000)]
[NFC][InstCombine] Add tests for sinking 'not' into 'xor' (PR38446)

https://rise4fun.com/Alive/IT3

Comes up in the [most ugliest]  signed int -> signed char  case of
-fsanitize=implicit-conversion (https://reviews.llvm.org/D50250)

Not sure if we want to do it always, or only when it is free to invert.

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

5 years ago[NFC][InstCombine] Regenerate set.ll test
Roman Lebedev [Sun, 5 Aug 2018 08:53:40 +0000 (08:53 +0000)]
[NFC][InstCombine] Regenerate set.ll test

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

5 years ago[X86] Remove stale comments from a test. NFC
Craig Topper [Sun, 5 Aug 2018 06:25:01 +0000 (06:25 +0000)]
[X86] Remove stale comments from a test. NFC

The 16-bit case was recently fixed so this comment no longer applies.

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

5 years ago[InstCombine] [NFC] Tests for strcmp to memcmp transformation
David Bolvansky [Sun, 5 Aug 2018 05:46:56 +0000 (05:46 +0000)]
[InstCombine] [NFC] Tests for strcmp to memcmp transformation

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

5 years ago[ADT] Add an early-increment iterator-like type and range adaptor.
Chandler Carruth [Sat, 4 Aug 2018 08:17:26 +0000 (08:17 +0000)]
[ADT] Add an early-increment iterator-like type and range adaptor.

This allows us to model the common LLVM idiom of incrementing
immediately after dereferencing so that we can remove or update the
entity w/o losing our ability to reach the "next".

However, these are not real or proper iterators. They are just enough to
allow range based for loops and very simple range algorithms to work,
but should not be considered full general.

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

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

5 years ago[TailCallElim] Preserve DT and PDT
Chijun Sima [Sat, 4 Aug 2018 08:13:47 +0000 (08:13 +0000)]
[TailCallElim] Preserve DT and PDT

Summary:
Previously, in the NewPM pipeline, TailCallElim recalculates the DomTree when it modifies any instruction in the Function.
For example,
```
CallInst *CI = dyn_cast<CallInst>(&I);
...
CI->setTailCall();
Modified = true;
...
if (!Modified || ...)
  return PreservedAnalyses::all();
```
After applying this patch, the DomTree only recalculates if needed (plus an extra insertEdge() + an extra deleteEdge() call).

When optimizing SQLite with `-passes="default<O3>"` pipeline of the newPM, the number of DomTree recalculation decreases by 6.2%, the number of nodes visited by DFS decreases by 2.9%. The time used by DomTree will decrease approximately 1%~2.5% after applying the patch.

Statistics:
```
Before the patch:
 23010 dom-tree-stats               - Number of DomTree recalculations
489264 dom-tree-stats               - Number of nodes visited by DFS -- DomTree
After the patch:
 21581 dom-tree-stats               - Number of DomTree recalculations
475088 dom-tree-stats               - Number of nodes visited by DFS -- DomTree
```

Reviewers: kuhar, dmgreen, brzycki, grosser, davide

Reviewed By: kuhar, brzycki

Subscribers: llvm-commits

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

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

5 years ago[llvm-objdump] Remove continue after report_error which is unreachable
Fangrui Song [Sat, 4 Aug 2018 05:19:00 +0000 (05:19 +0000)]
[llvm-objdump] Remove continue after report_error which is unreachable

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

5 years ago[ADCE] Remove the need of DomTree
Chijun Sima [Sat, 4 Aug 2018 02:50:12 +0000 (02:50 +0000)]
[ADCE] Remove the need of DomTree

Summary: ADCE doesn't need to query domtree.

Reviewers: kuhar, brzycki, dmgreen, davide, grosser

Reviewed By: kuhar

Subscribers: llvm-commits

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

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

5 years agoReverted r338825 and all the following tries to fix issues introduced by that commit...
Galina Kistanova [Sat, 4 Aug 2018 01:59:12 +0000 (01:59 +0000)]
Reverted r338825 and all the following tries to fix issues introduced by that commit (r338826, r338827, r338829, r338880).

This commit has broken build bots and has been left unattended for too long.

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

5 years ago[GISel]: Add Opcodes for CTLZ/CTTZ/CTPOP
Aditya Nandakumar [Sat, 4 Aug 2018 01:22:12 +0000 (01:22 +0000)]
[GISel]: Add Opcodes for CTLZ/CTTZ/CTPOP

https://reviews.llvm.org/D48600

Added IRTranslator support to translate these known intrinsics into GISel opcodes.

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

5 years agoFix buildbot breakage.
Rui Ueyama [Sat, 4 Aug 2018 00:23:37 +0000 (00:23 +0000)]
Fix buildbot breakage.

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

5 years agoUse the same constants as zlib to represent compression level.
Rui Ueyama [Sat, 4 Aug 2018 00:13:13 +0000 (00:13 +0000)]
Use the same constants as zlib to represent compression level.

This change allows users pass compression level that was not listed
in the enum. Also, I think using different values than zlib's
compression levels was just confusing.

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

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

5 years ago[X86] Add isel patterns for atomic_load+sub+atomic_sub.
Craig Topper [Fri, 3 Aug 2018 22:08:30 +0000 (22:08 +0000)]
[X86] Add isel patterns for atomic_load+sub+atomic_sub.

Despite the comment removed in this patch, this is beneficial when the RHS of the sub is a register.

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

5 years ago[X86] Add test cases to show missed opportunity to use RMW for atomic_load+sub+atomic...
Craig Topper [Fri, 3 Aug 2018 22:08:28 +0000 (22:08 +0000)]
[X86] Add test cases to show missed opportunity to use RMW for atomic_load+sub+atomic_store.

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

5 years ago[X86] Re-generate abi-isel.ll checks with update_llc_test_checks.py
Reid Kleckner [Fri, 3 Aug 2018 21:58:25 +0000 (21:58 +0000)]
[X86] Re-generate abi-isel.ll checks with update_llc_test_checks.py

These tests were clearly auto-generated when they were converted to
FileCheck back in r80019 (2009), but we didn't have a fancy script to
keep them up to date then. I've reviewed the diff, and we should be
generating the exact same code sequences we used to.

After this, I plan to commit a change that changes our output slightly,
but in a way that is still correct. It will generate a large diff, and I
want it to be clearly correct, so I am regenerating these checks in
preparation for that.

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

5 years ago[X86] Make abi-isel.ll like update_llc_test_checks.py output
Reid Kleckner [Fri, 3 Aug 2018 21:58:12 +0000 (21:58 +0000)]
[X86] Make abi-isel.ll like update_llc_test_checks.py output

- Remove -asm-verbose=0 from every llc command. The tests still pass.
- Reorder the RUN lines to match CHECKs.
- Use -LABEL like update_llc_test_checks.py does.

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

5 years ago[X86] Layout tests exactly as update_llc_test_checks.py would
Reid Kleckner [Fri, 3 Aug 2018 21:57:59 +0000 (21:57 +0000)]
[X86] Layout tests exactly as update_llc_test_checks.py would

Put the LLVM IR at the bottom of the function instead of the top.  In my
next patch, I will run update_llc_test_checks.py on this file, and I
want to only highlight the diffs in the CHECK lines. Hopefully by doing
this change first, the patch will be more understandable.

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

5 years ago[X86] Remove RELEASE_ and ACQUIRE_ pseudo instructions. Use isel patterns and the...
Craig Topper [Fri, 3 Aug 2018 21:40:44 +0000 (21:40 +0000)]
[X86] Remove RELEASE_ and ACQUIRE_ pseudo instructions. Use isel patterns and the normal instructions instead

At one point in time acquire implied mayLoad and mayStore as did release. Thus we needed separate pseudos that also carried that property. This appears to no longer be the case. I believe it was changed in 2012 with a comment saying that atomic memory accesses are marked volatile which preserves the ordering.

So from what I can tell we shouldn't need additional pseudos since they aren't carry any flags that are different from the normal instructions. The only thing I can think of is that we may consider them for load folding candidates in the peephole pass now where we didn't before. If that's important hopefully there's something in the memory operand we can check to prevent the folding without relying on pseudo instructions.

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

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

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Fri, 3 Aug 2018 20:58:14 +0000 (20:58 +0000)]
[X86] Autogenerate complete checks. NFC

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

5 years ago[TRE][DebugInfo] Preserve Debug Location in new branch instruction
Anastasis Grammenos [Fri, 3 Aug 2018 20:27:13 +0000 (20:27 +0000)]
[TRE][DebugInfo] Preserve Debug Location in new branch instruction

There are two branch instructions created
so the new test covers them both.

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

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

5 years ago[SelectionDAG] Teach LegalizeVectorTypes to widen the mask input to a masked store.
Craig Topper [Fri, 3 Aug 2018 20:14:18 +0000 (20:14 +0000)]
[SelectionDAG] Teach LegalizeVectorTypes to widen the mask input to a masked store.

The mask operand is visited before the data operand so we need to be able to widen it.

Fixes PR38436.

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

5 years ago[Support] Don't initialize compressed buffer allocated by zlib::compress
Fangrui Song [Fri, 3 Aug 2018 19:37:49 +0000 (19:37 +0000)]
[Support] Don't initialize compressed buffer allocated by zlib::compress

resize() (zeroing) makes every allocated page resident. The actual size of the compressed buffer is usually much
smaller. Making every page resident is wasteful.

When linking a test binary with ~1.9GiB uncompressed debug info with LLD, this optimization decreases max RSS by ~1.5GiB.

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

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

5 years agoDAG: Enhance isKnownNeverNaN
Matt Arsenault [Fri, 3 Aug 2018 18:27:52 +0000 (18:27 +0000)]
DAG: Enhance isKnownNeverNaN

Add a parameter for testing specifically for
sNaNs - at least one instruction pattern on AMDGPU
needs to check specifically for this.

Also handle more cases, and add a target hook
for custom nodes, similar to the hooks for known
bits.

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

5 years ago[NVPTX] Handle __nvvm_reflect("__CUDA_ARCH").
Artem Belevich [Fri, 3 Aug 2018 18:05:24 +0000 (18:05 +0000)]
[NVPTX] Handle __nvvm_reflect("__CUDA_ARCH").

Summary:
libdevice in recent CUDA versions relies on __nvvm_reflect() to select
GPU-specific bitcode. This patch addresses the requirement.

Reviewers: jlebar

Subscribers: jholewinski, sanjoy, hiraditya, bixia, llvm-commits

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

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

5 years ago[X86] Add a DAG combine for the __builtin_parity idiom used by clang to enable better...
Craig Topper [Fri, 3 Aug 2018 18:00:29 +0000 (18:00 +0000)]
[X86] Add a DAG combine for the __builtin_parity idiom used by clang to enable better codegen

Clang uses "ctpop & 1" to implement __builtin_parity. If the popcnt instruction isn't supported this generates a large amount of code to calculate the population count. Instead we can bisect the data down to a single byte using xor and then check the parity flag.

Even when popcnt is supported, its still a good idea to split 64-bit data on 32-bit targets using an xor in front of a single popcnt. Otherwise we get two popcnts and an add before the and.

I've specifically targeted this at the sizes supported by clang builtins, but we could generalize this if we think that's useful.

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

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

5 years ago[X86] Add test cases for the current codegen of __builtin_parity.
Craig Topper [Fri, 3 Aug 2018 18:00:23 +0000 (18:00 +0000)]
[X86] Add test cases for the current codegen of __builtin_parity.

Will be improved in a follow commit

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

5 years ago[SLC] Refactor shrinking of functions (NFC)
Evandro Menezes [Fri, 3 Aug 2018 17:50:16 +0000 (17:50 +0000)]
[SLC] Refactor shrinking of functions (NFC)

Merge the helper functions for shrinking unary and binary functions into a
single one, while keeping all their functionality.  Otherwise, NFC.

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

5 years agoFix crash in bounds checking.
Joel Galenson [Fri, 3 Aug 2018 17:12:23 +0000 (17:12 +0000)]
Fix crash in bounds checking.

In r337830 I added SCEV checks to enable us to insert fewer bounds checks.  Unfortunately, this sometimes crashes when multiple bounds checks are added due to SCEV caching issues.  This patch splits the bounds checking pass into two phases, one that computes all the conditions (using SCEV checks) and the other that adds the new instructions.

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

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

5 years ago[llvm-mca][docs] Move the code marker text into its own subsection. NFC.
Matt Davis [Fri, 3 Aug 2018 15:56:07 +0000 (15:56 +0000)]
[llvm-mca][docs] Move the code marker text into its own subsection. NFC.

Also fixed a few undecorated 'llvm-mca' references to be highlighted
with the 'program' emphasis.

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

5 years ago[X86] Fix line endings.
Simon Pilgrim [Fri, 3 Aug 2018 15:09:56 +0000 (15:09 +0000)]
[X86] Fix line endings.

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

5 years ago[Partial Inlining] Fix small bug in detecting if we did something
Graham Yiu [Fri, 3 Aug 2018 14:42:53 +0000 (14:42 +0000)]
[Partial Inlining] Fix small bug in detecting if we did something

- It's possible for 'Changed' to return as false even if we did
  partial inline something.  Fixed to accumulate return values

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

5 years ago[WebAssembly] Cleanup of the way globals and global flags are handled
Nicholas Wilson [Fri, 3 Aug 2018 14:33:37 +0000 (14:33 +0000)]
[WebAssembly] Cleanup of the way globals and global flags are handled

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

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

5 years ago[llvm-mca] Speed up the computation of the wait/ready/issued sets in the Scheduler.
Andrea Di Biagio [Fri, 3 Aug 2018 12:55:28 +0000 (12:55 +0000)]
[llvm-mca] Speed up the computation of the wait/ready/issued sets in the Scheduler.

This patch is a follow-up to r338702.

We don't need to use a map to model the wait/ready/issued sets. It is much more
efficient to use a vector instead.

This patch gives us an average 7.5% speedup (on top of the ~12% speedup obtained
after r338702).

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

5 years ago[Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is already...
Chijun Sima [Fri, 3 Aug 2018 12:45:29 +0000 (12:45 +0000)]
[Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is already awaiting deletion

Summary:
Previously, `removeUnreachableBlocks` still returns true (which indicates the CFG is changed) even when all the unreachable blocks found is awaiting deletion in the DDT class.
This makes code pattern like
```
// Code modified from lib/Transforms/Scalar/SimplifyCFGPass.cpp
bool EverChanged = removeUnreachableBlocks(F, nullptr, DDT);
...
do {
    EverChanged = someMightHappenModifications();
    EverChanged |= removeUnreachableBlocks(F, nullptr, DDT);
  } while (EverChanged);
```
become a dead loop.
Fix this by detecting whether a BasicBlock is already awaiting deletion.

Reviewers: kuhar, brzycki, dmgreen, grosser, davide

Reviewed By: kuhar, brzycki

Subscribers: llvm-commits

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

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

5 years ago[llvm-mca][docs] Improve the CommandLine documentation.
Andrea Di Biagio [Fri, 3 Aug 2018 12:44:56 +0000 (12:44 +0000)]
[llvm-mca][docs] Improve the CommandLine documentation.

This patch replaces all the remaining occurrences of string "MCA" with
":program:`llvm-mca`".  Somehow I missed those strings when I committed r338394.

This patch also improves section "Instruction Dispatch".

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

5 years agoconvert some tabs to spaces
Nico Weber [Fri, 3 Aug 2018 12:21:54 +0000 (12:21 +0000)]
convert some tabs to spaces

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

5 years ago[DebugInfo/Verifier] Don't emit error for missing module in index
Jonas Devlieghere [Fri, 3 Aug 2018 12:01:43 +0000 (12:01 +0000)]
[DebugInfo/Verifier] Don't emit error for missing module in index

We don't expect module names to be present in the index. This patch adds
DW_TAG_module to the blacklist.

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

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

5 years ago[SystemZ] Improve handling of instructions which expand to several groups
Jonas Paulsson [Fri, 3 Aug 2018 10:43:05 +0000 (10:43 +0000)]
[SystemZ]  Improve handling of instructions which expand to several groups

Some instructions expand to more than one decoder group.

This has been hitherto ignored, but is handled with this patch.

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

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

5 years ago[NFC] Add missing comment
Max Kazantsev [Fri, 3 Aug 2018 10:41:51 +0000 (10:41 +0000)]
[NFC] Add missing comment

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

5 years ago[NFC] Move some methods into static functions
Max Kazantsev [Fri, 3 Aug 2018 10:16:40 +0000 (10:16 +0000)]
[NFC] Move some methods into static functions

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

5 years ago[Windows FS] Allow moving files in TempFile::keep
Jeremy Morse [Fri, 3 Aug 2018 10:13:35 +0000 (10:13 +0000)]
[Windows FS] Allow moving files in TempFile::keep

In r338216 / D49860 TempFile::keep was extended to allow keeping across
filesystems. The aim on Windows was to have this happen in rename_internal
using the existing system API. However, to fix an issue and preserve the
idea of "renaming" not being a move, put Windows keep-across-filesystem in
TempFile::keep.

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

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

5 years ago[TargetLowering] Generalise BuildSDIV function
Simon Pilgrim [Fri, 3 Aug 2018 10:00:54 +0000 (10:00 +0000)]
[TargetLowering] Generalise BuildSDIV function

First step towards a BuildSDIV equivalent to D49248 for non-uniform vector support - this just pushes the splat detection down into TargetLowering::BuildSDIV where its still used.

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

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

5 years ago[llvm-exegesis] Renaming classes and functions.
Guillaume Chatelet [Fri, 3 Aug 2018 09:29:38 +0000 (09:29 +0000)]
[llvm-exegesis] Renaming classes and functions.

Summary: Functional No Op.

Reviewers: gchatelet

Subscribers: tschuett, courbet, llvm-commits

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

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

5 years ago[ARM] FP16: support vector zip and unzip
Sjoerd Meijer [Fri, 3 Aug 2018 09:24:29 +0000 (09:24 +0000)]
[ARM] FP16: support vector zip and unzip

This is addressing PR38404.

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

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

5 years ago[XRay][tools] Use Support/JSON.h in llvm-xray convert
Dean Michael Berris [Fri, 3 Aug 2018 09:21:31 +0000 (09:21 +0000)]
[XRay][tools] Use Support/JSON.h in llvm-xray convert

Summary:
This change removes the ad-hoc implementation used by llvm-xray's
`convert` subcommand to generate JSON encoded catapult (AKA Chrome
Trace Viewer) trace output, to instead use the JSON encoder now in the
Support library.

Reviewers: kpw, zturner, eizan

Reviewed By: kpw

Subscribers: llvm-commits

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

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

5 years ago[X86] Add example of 'zero shift' guards on rotation patterns (PR34924)
Simon Pilgrim [Fri, 3 Aug 2018 09:20:02 +0000 (09:20 +0000)]
[X86] Add example of 'zero shift' guards on rotation patterns (PR34924)

Basic pattern that leaves an unnecessary select on a rotation by zero result. This variant is trivial - the more general case with a compare+branch to prevent execution of undefined shifts is more tricky.

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

5 years ago[ARM] FP16: support VFMA
Sjoerd Meijer [Fri, 3 Aug 2018 09:12:56 +0000 (09:12 +0000)]
[ARM] FP16: support VFMA

This is addressing PR38404.

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

5 years ago[XRay] fixup: add one more missing std::move(...)
Dean Michael Berris [Fri, 3 Aug 2018 09:06:11 +0000 (09:06 +0000)]
[XRay] fixup: add one more missing std::move(...)

Follow up to D48370.

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

5 years ago[XRay] fixup: Add missing std::move(...)
Dean Michael Berris [Fri, 3 Aug 2018 07:54:37 +0000 (07:54 +0000)]
[XRay] fixup: Add missing std::move(...)

Follow up to D48370.

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

5 years ago[XRay] Fixup: remove 'noexcept' in defaulted move members
Dean Michael Berris [Fri, 3 Aug 2018 07:41:34 +0000 (07:41 +0000)]
[XRay] Fixup: remove 'noexcept' in defaulted move members

This is to appease stage1 builds using gcc.

Follow-up to D48370.

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

5 years ago[XRay][llvm] Load XRay Profiles
Dean Michael Berris [Fri, 3 Aug 2018 07:18:39 +0000 (07:18 +0000)]
[XRay][llvm] Load XRay Profiles

Summary:
This change implements the profile loading functionality in LLVM to
support XRay's profiling mode in compiler-rt.

We introduce a type named `llvm::xray::Profile` which allows building a
profile representation. We can load an XRay profile from a file to build
Profile instances, or do it manually through the Profile type's API.

The intent is to get the `llvm-xray` tool to generate `Profile`
instances and use that as the common abstraction through which all
conversion and analysis can be done. In the future we can generate
`Profile` instances from `Trace` instances as well, through conversion
functions.

Some of the key operations supported by the `Profile` API are:

- Path interning (`Profile::internPath(...)`) which returns a unique path
  identifier.

- Block appending (`Profile::addBlock(...)`) to add thread-associated
  profile information.

- Path ID to Path lookup (`Profile::expandPath(...)`) to look up a
  PathID and return the original interned path.

- Block iteration.

A 'Path' in this context represents the function call stack in
leaf-to-root order. This is represented as a path in an internally
managed prefix tree in the `Profile` instance. Having a handle (PathID)
to identify the unique Paths we encounter for a particular Profile
allows us to reduce the amount of memory required to associate profile
data to a particular Path.

This is the first of a series of patches to migrate the `llvm-stacks`
tool towards using a single profile representation.

Depends on D48653.

Reviewers: kpw, eizan

Reviewed By: kpw

Subscribers: mgorny, llvm-commits, hiraditya

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

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

5 years ago[X86] Remove all the vector NOP bitcast patterns. Use a few lines of code in the...
Craig Topper [Fri, 3 Aug 2018 07:01:10 +0000 (07:01 +0000)]
[X86] Remove all the vector NOP bitcast patterns. Use a few lines of code in the Select method in X86ISelDAGToDAG.cpp instead.

There are a lot of permutations of types here generating a lot of patterns in the isel table. It's more efficient to just ReplaceUses and RemoveDeadNode from the Select function.

The test changes are because we have a some shuffle patterns that have a bitcast as their root node. But the behavior is identical to another instruction whose pattern doesn't start with a bitcast. So this isn't a functional change.

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

5 years agobuild_llvm_package.bat: Add OpenMP back
Hans Wennborg [Fri, 3 Aug 2018 07:00:08 +0000 (07:00 +0000)]
build_llvm_package.bat: Add OpenMP back

After r338721, it builds again.

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

5 years ago[Dominators] Refine the logic of recalculate() in the DomTreeUpdater
Chijun Sima [Fri, 3 Aug 2018 06:51:35 +0000 (06:51 +0000)]
[Dominators] Refine the logic of recalculate() in the DomTreeUpdater

Summary:
This patch refines the logic of `recalculate()` in the `DomTreeUpdater` in the following two aspects:
1. Previously, `recalculate()` tests whether there are pending updates/BBs awaiting deletion and then do recalculation under Lazy UpdateStrategy; and do recalculation immediately under Eager UpdateStrategy. (The former behavior is inherited from the `DeferredDominance` class). This is an inconsistency between two strategies and there is no obvious reason to do this. So the behavior is changed to always recalculate available trees when calling `recalculate()`.
2. Fix the issue of when DTU under Lazy UpdateStrategy holds nothing but with BBs awaiting deletion, after calling `recalculate()`, BBs awaiting deletion aren't flushed. An additional unittest is added to cover this case.

Reviewers: kuhar, dmgreen, brzycki, grosser, davide

Reviewed By: kuhar

Subscribers: llvm-commits

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

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

5 years ago[X86] Support fp128 and/or/xor/load/store with VEX and EVEX encoded instructions.
Craig Topper [Fri, 3 Aug 2018 06:12:56 +0000 (06:12 +0000)]
[X86] Support fp128 and/or/xor/load/store with VEX and EVEX encoded instructions.

Move all the patterns to X86InstrVecCompiler.td so we can keep SSE/AVX/AVX512 all in one place.

To save some patterns we'll use an existing DAG combine to convert f128 fand/for/fxor to integer when sse2 is enabled. This allows use to reuse all the existing patterns for v2i64.

I believe this now makes SHA instructions the only case where VEX/EVEX and legacy encoded instructions could be generated simultaneously.

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

5 years ago[InstSimplify] fold extracting from std::pair (2/2)
Hiroshi Inoue [Fri, 3 Aug 2018 05:39:48 +0000 (05:39 +0000)]
[InstSimplify] fold extracting from std::pair (2/2)

This is the second patch of the series which intends to enable jump threading for an inlined method whose return type is std::pair<int, bool> or std::pair<bool, int>.
The first patch is https://reviews.llvm.org/rL338485.

This patch handles code sequences that merges two values using `shl` and `or`, then extracts one value using `and`.

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

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

5 years ago[Dominators] Convert existing passes and utils to use the DomTreeUpdater class
Chijun Sima [Fri, 3 Aug 2018 05:08:17 +0000 (05:08 +0000)]
[Dominators] Convert existing passes and utils to use the DomTreeUpdater class

Summary:
This patch is the second in a series of patches related to the [[ http://lists.llvm.org/pipermail/llvm-dev/2018-June/123883.html | RFC - A new dominator tree updater for LLVM ]].

It converts passes (e.g. adce/jump-threading) and various functions which currently accept DDT in local.cpp and BasicBlockUtils.cpp to use the new DomTreeUpdater class.
These converted functions in utils can accept DomTreeUpdater with either UpdateStrategy and can deal with both DT and PDT held by the DomTreeUpdater.

Reviewers: brzycki, kuhar, dmgreen, grosser, davide

Reviewed By: brzycki

Subscribers: llvm-commits

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

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

5 years ago[X86] When post-processing the DAG to remove zero extending moves for YMM/ZMM, make...
Craig Topper [Fri, 3 Aug 2018 04:49:42 +0000 (04:49 +0000)]
[X86] When post-processing the DAG to remove zero extending moves for YMM/ZMM, make sure the producing instruction is VEX/XOP/EVEX encoded.

If the producing instruction is legacy encoded it doesn't implicitly zero the upper bits. This is important for the SHA instructions which don't have a VEX encoded version. We might also be able to hit this with the incomplete f128 support that hasn't been ported to VEX.

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

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Fri, 3 Aug 2018 04:49:41 +0000 (04:49 +0000)]
[X86] Autogenerate complete checks. NFC

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

5 years ago[X86] Add R13D to the isInefficientLEAReg in FixupLEAs.
Craig Topper [Fri, 3 Aug 2018 03:45:19 +0000 (03:45 +0000)]
[X86] Add R13D to the isInefficientLEAReg in FixupLEAs.

I'm assuming the R13 restriction extends to R13D. Guessing this restriction is related to the funny encoding of this register as base always requiring a displacement to be encoded.

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

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Fri, 3 Aug 2018 01:28:12 +0000 (01:28 +0000)]
[X86] Autogenerate complete checks. NFC

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