]> granicus.if.org Git - llvm/log
llvm
5 years agoRevert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM'
David L. Jones [Wed, 14 Aug 2019 04:50:33 +0000 (04:50 +0000)]
Revert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM'

This reverts r368526 (git commit 7e71aa24bc0788690fea7f0d7eab400c6a784deb)
This reverts r368542 (git commit cb5a90fd314a7914cf293797bb4fd7a6841052cf)

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

5 years agoRemove minimum toolchain soft-error
JF Bastien [Wed, 14 Aug 2019 04:30:51 +0000 (04:30 +0000)]
Remove minimum toolchain soft-error

Summary:
Back in January I changed the minimum toolchain version required to build clang
and LLVM: D57264. Since then we've release LLVM 8, following
[our process](http://llvm.org/docs/DeveloperPolicy.html#toolchain)
it's therefore now a good time to remove the soft-error and officially deprecate
older toolchains. I tried this out last Tursday night to see if any bots
complained, and I saw no complaints. I also manually audited bots and didn't see
any bot that should break, but their toolchain information is unreliable and
some bots are offline.

Once this patch stick we'll move to C++14 as we've
[already agreed](http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html).

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, EricWF, thakis, chandlerc

Tags: #llvm

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

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

5 years agoCoroutines: adjust for SVN r358739
John McCall [Wed, 14 Aug 2019 03:54:25 +0000 (03:54 +0000)]
Coroutines: adjust for SVN r358739

CallSite has been removed in favour of CallBase.  Adjust the coroutine split to
account for that.

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

5 years agoDon't run a full verifier pass in coro-splitting's private pipeline.
John McCall [Wed, 14 Aug 2019 03:54:18 +0000 (03:54 +0000)]
Don't run a full verifier pass in coro-splitting's private pipeline.

Potentially addresses rdar://49022293.

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

5 years agoRemove unreachable blocks before splitting a coroutine.
John McCall [Wed, 14 Aug 2019 03:54:13 +0000 (03:54 +0000)]
Remove unreachable blocks before splitting a coroutine.

The suspend-crossing algorithm is not correct in the presence of uses
that cannot be reached on some successor path from their defs.

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

5 years agoSupport swifterror in coroutine lowering.
John McCall [Wed, 14 Aug 2019 03:54:05 +0000 (03:54 +0000)]
Support swifterror in coroutine lowering.

The support for swifterror allocas should work in all lowerings.
The support for swifterror arguments only really works in a lowering
with prototypes where you can ensure that the prototype also has a
swifterror argument; I'm not really sure how it could possibly be
made to work in the switch lowering.

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

5 years agoUpdate for optimizer changes.
John McCall [Wed, 14 Aug 2019 03:53:58 +0000 (03:53 +0000)]
Update for optimizer changes.

rdar://37352868

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

5 years agoIn coro.retcon lowering, don't explode if the optimizer messes around with the linkag...
John McCall [Wed, 14 Aug 2019 03:53:52 +0000 (03:53 +0000)]
In coro.retcon lowering, don't explode if the optimizer messes around with the linkage of the prototype or the exact types of the yielded values.

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

5 years agoFix a use-after-free in the coro.alloca treatment.
John McCall [Wed, 14 Aug 2019 03:53:46 +0000 (03:53 +0000)]
Fix a use-after-free in the coro.alloca treatment.

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

5 years agoAdd intrinsics for doing frame-bound dynamic allocations within a coroutine.
John McCall [Wed, 14 Aug 2019 03:53:40 +0000 (03:53 +0000)]
Add intrinsics for doing frame-bound dynamic allocations within a coroutine.

These rely on having an allocator provided to the coroutine and thus,
for now, only work in retcon lowerings.

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

5 years agoGuard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is...
John McCall [Wed, 14 Aug 2019 03:53:31 +0000 (03:53 +0000)]
Guard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is not guaranteed to be defined in all builds.

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

5 years agoGeneralize llvm.coro.suspend.retcon to allow an arbitrary number of arguments to...
John McCall [Wed, 14 Aug 2019 03:53:26 +0000 (03:53 +0000)]
Generalize llvm.coro.suspend.retcon to allow an arbitrary number of arguments to be passed back to the continuation function.

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

5 years agoExtend coroutines to support a "returned continuation" lowering.
John McCall [Wed, 14 Aug 2019 03:53:17 +0000 (03:53 +0000)]
Extend coroutines to support a "returned continuation" lowering.

A quick contrast of this ABI with the currently-implemented ABI:

- Allocation is implicitly managed by the lowering passes, which is fine
  for frontends that are fine with assuming that allocation cannot fail.
  This assumption is necessary to implement dynamic allocas anyway.

- The lowering attempts to fit the coroutine frame into an opaque,
  statically-sized buffer before falling back on allocation; the same
  buffer must be provided to every resume point.  A buffer must be at
  least pointer-sized.

- The resume and destroy functions have been combined; the continuation
  function takes a parameter indicating whether it has succeeded.

- Conversely, every suspend point begins its own continuation function.

- The continuation function pointer is directly returned to the caller
  instead of being stored in the frame.  The continuation can therefore
  directly destroy the frame when exiting the coroutine instead of having
  to leave it in a defunct state.

- Other values can be returned directly to the caller instead of going
  through a promise allocation.  The frontend provides a "prototype"
  function declaration from which the type, calling convention, and
  attributes of the continuation functions are taken.

- On the caller side, the frontend can generate natural IR that directly
  uses the continuation functions as long as it prevents IPO with the
  coroutine until lowering has happened.  In combination with the point
  above, the frontend is almost totally in charge of the ABI of the
  coroutine.

- Unique-yield coroutines are given some special treatment.

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

5 years ago[FileCheck] Document FILECHECK_OPTS in -help
Joel E. Denny [Wed, 14 Aug 2019 02:56:20 +0000 (02:56 +0000)]
[FileCheck] Document FILECHECK_OPTS in -help

Reviewed By: thopre

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

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

5 years ago[FileCheck] Move -dump-input diagnostic to first line
Joel E. Denny [Wed, 14 Aug 2019 02:56:09 +0000 (02:56 +0000)]
[FileCheck] Move -dump-input diagnostic to first line

Without this patch, `-dump-input` prints a diagnostic at the end of
its marker range.  For example:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~ error: no match found
```

This patch moves it to the beginning like this:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~ error: no match found
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~
```

The former somehow looks nicer because the diagnostic doesn't appear
to be somewhere within the marker range.  However, the latter is more
practical, especially when the marker range includes the remainder of
a very long dump.  First, in the case of an error, this patch enables
me to search the dump for `error:` and usually immediately land where
the detected error began.  Second, when trying to follow FileCheck's
logic, it's best to read top down, so this patch enables me to see
each diagnostic as soon as I encounter its marker.

Reviewed By: thopre

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

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

5 years ago[GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source...
Aditya Nandakumar [Wed, 14 Aug 2019 01:23:33 +0000 (01:23 +0000)]
[GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source index

https://reviews.llvm.org/D66182

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

5 years ago[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.
Amara Emerson [Tue, 13 Aug 2019 23:51:20 +0000 (23:51 +0000)]
[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.

The destinations should be FPRs (for now).

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

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

5 years ago[AArch64] Remove incorrect usage of MONonTemporal.
Eli Friedman [Tue, 13 Aug 2019 23:12:14 +0000 (23:12 +0000)]
[AArch64] Remove incorrect usage of MONonTemporal.

This has no effect at the moment, but might matter if we try to
implement non-temporal loads in the future.

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

5 years ago[ORC] Fix SpeculativeJIT example code broken by r368707.
Lang Hames [Tue, 13 Aug 2019 22:44:54 +0000 (22:44 +0000)]
[ORC] Fix SpeculativeJIT example code broken by r368707.

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

5 years agoAttempt to fix issue with unresolved lit test in TableGen
Jessica Paquette [Tue, 13 Aug 2019 22:32:26 +0000 (22:32 +0000)]
Attempt to fix issue with unresolved lit test in TableGen

Build bots are unhappy about the Common directory.

Add an excludes list to lit.local.cfg.

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

5 years ago[NFCI] Explicitly provide user-defined constructor for SectionRef
Alex Langford [Tue, 13 Aug 2019 22:16:18 +0000 (22:16 +0000)]
[NFCI] Explicitly provide user-defined constructor for SectionRef

I am changing this to work around an issue that is being hit when
building with clang 3.8. Specifically, clang 3.8 requires that we have a user
defined default constructor for SectionRef for the default initialization of a
const SectionRef.

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

5 years ago[GlobalISel][NFC] Factor out common target code from GlobalISelEmitterTests
Jessica Paquette [Tue, 13 Aug 2019 22:14:37 +0000 (22:14 +0000)]
[GlobalISel][NFC] Factor out common target code from GlobalISelEmitterTests

Factor out commonly-used target code from the GlobalISelEmitter tests into
a GlobalISelEmitterCommon.td file. This is tested by the original
GlobalISelEmitter.td test.

This reduces the amount of boilerplate code necessary for tests like this.

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

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

5 years agoRelax opcode checks in test to check for only a number instead of a specific number.
Douglas Yung [Tue, 13 Aug 2019 22:05:18 +0000 (22:05 +0000)]
Relax opcode checks in test to check for only a number instead of a specific number.

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

5 years ago[GlobalISel]: Fix lowering of G_SHUFFLE_VECTOR with scalar sources
Aditya Nandakumar [Tue, 13 Aug 2019 21:49:11 +0000 (21:49 +0000)]
[GlobalISel]: Fix lowering of G_SHUFFLE_VECTOR with scalar sources

https://reviews.llvm.org/D66171

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

5 years ago[GISel] Pass MachineRegisterInfo by const reference to matcher.
Mark Lacey [Tue, 13 Aug 2019 21:17:14 +0000 (21:17 +0000)]
[GISel] Pass MachineRegisterInfo by const reference to matcher.

Summary: NFC.

Reviewers: aditya_nandakumar, volkan

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago [AIX]Lowering global address for 32/64bit small/large code models
Xiangling Liao [Tue, 13 Aug 2019 20:29:01 +0000 (20:29 +0000)]
[AIX]Lowering global address for 32/64bit small/large code models

    This patch implements global address lowering for 32/64 bit with small/large code models.
    1.For 32bit large code model on AIX, there are newly added pseudo opcode LWZtocL & ADDIStocHA32, the support of which on MC layer will be
       provided by future patches.
    2.The default code model on AIX should be small code model.
    3.Since AIX does not have medium code model, "report_fatal_error" when users specify it.

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

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

5 years ago[ORC] Fix BuildingAJIT tutorial code broken by r368707.
Lang Hames [Tue, 13 Aug 2019 19:38:52 +0000 (19:38 +0000)]
[ORC] Fix BuildingAJIT tutorial code broken by r368707.

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

5 years ago[AMDGPU] Fix to 'Fold readlane from copy of SGPR or imm'
Tim Renouf [Tue, 13 Aug 2019 18:57:55 +0000 (18:57 +0000)]
[AMDGPU] Fix to 'Fold readlane from copy of SGPR or imm'

That change (r363670) could leave a copy from vgpr to sgpr. Fixed.

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

Change-Id: I00c3fe6fda2e8e1e36f53195b881b1449c777ea4

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

5 years ago[ARM] Add MVE beats vector cost model
David Green [Tue, 13 Aug 2019 18:12:08 +0000 (18:12 +0000)]
[ARM] Add MVE beats vector cost model

The MVE architecture has the idea of "beats", where a vector instruction can be
executed over several ticks of the architecture. This adds a similar system
into the Arm backend cost model, multiplying the cost of all vector
instructions by a factor.

This factor essentially becomes the expected difference between scalar code
and vector code, on average. MVE Vector instructions can also overlap so the a
true cost of them is often lower. But equally scalar instructions can in some
situations be dual issued, or have other optimisations such as unrolling or
make use of dsp instructions. The default is chosen as 2. This should not
prevent vectorisation is a most cases (as the vector instructions will still be
doing at least 4 times the work), but it will help prevent over vectorising in
cases where the benefits are less likely.

This adds things so far to the obvious places in ARMTargetTransformInfo, and
updates a few related costs like not treating float instructions as cost 2 just
because they are floats.

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

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

5 years ago[llvm-profdata] Profile dump for compact binary format
Wenlei He [Tue, 13 Aug 2019 17:56:08 +0000 (17:56 +0000)]
[llvm-profdata] Profile dump for compact binary format

Summary: Fix "llvm-profdata show" so it can work with compact binary format profile. The change is to mark all functions "used" so SampleProfileReaderCompactBinary::read will read in all profiles available for dumping. The function names will be MD5 hash for compact binary format.

Reviewers: wmi, davidxl, danielcdh

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[AutoUpgrader] Make ArcRuntime Autoupgrader more conservative
Steven Wu [Tue, 13 Aug 2019 17:52:21 +0000 (17:52 +0000)]
[AutoUpgrader] Make ArcRuntime Autoupgrader more conservative

Summary:
This is a tweak to r368311 and r368646 which auto upgrades the calls to
objc runtime functions to objc runtime intrinsics, in order to make sure
that the auto upgrader does not trigger with up-to-date bitcode.

It is possible for bitcode that is up-to-date to contain direct calls to
objc runtime function and those are not inserted by compiler as part of
ARC and they should not be upgraded. Now auto upgrader only triggers as
when the old style of ARC marker is used so it is guaranteed that it
won't trigger on update-to-date bitcode.

This also means it won't do this upgrade for bitcode from llvm-8 and
llvm-9, which preserves the behavior of those releases. Ideally they
should be upgraded as well but it is more important to make sure
AutoUpgrader will not trigger on up-to-date bitcode.

Reviewers: ahatanak, rjmccall, dexonsmith, pete

Reviewed By: dexonsmith

Subscribers: hiraditya, jkorous, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC] Fixed test
David Bolvansky [Tue, 13 Aug 2019 17:51:28 +0000 (17:51 +0000)]
[NFC] Fixed test

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

5 years agoUse Register over unsigned in LateEHPrepare (NFC)
Heejin Ahn [Tue, 13 Aug 2019 17:35:44 +0000 (17:35 +0000)]
Use Register over unsigned in LateEHPrepare (NFC)

Summary:
While D65962 is pending for review, I landed D65475 that added one more
use of `unsigned`. Changed it to `Register`.

Reviewers: dsanders

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

Tags: #llvm

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

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

5 years ago[util] Allow callsigns when running git llvm revert
Jordan Rupprecht [Tue, 13 Aug 2019 17:19:53 +0000 (17:19 +0000)]
[util] Allow callsigns when running git llvm revert

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

5 years ago[SimplifyLibCalls] Add noalias from known callsites
David Bolvansky [Tue, 13 Aug 2019 17:18:46 +0000 (17:18 +0000)]
[SimplifyLibCalls] Add noalias from known callsites

Summary:
Should be fine for memcpy, strcpy, strncpy.

Reviewers: jdoerfert, efriedma

Reviewed By: jdoerfert

Subscribers: uenoku, llvm-commits

Tags: #llvm

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

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

5 years ago[ValueTracking] Improve reverse assumption inference
Nikita Popov [Tue, 13 Aug 2019 17:15:42 +0000 (17:15 +0000)]
[ValueTracking] Improve reverse assumption inference

Use isGuaranteedToTransferExecutionToSuccessor() instead of
isSafeToSpeculativelyExecute() when seeing whether we can propagate
the information in an assume backwards in isValidAssumeForContext().
The latter is more general - it also allows arbitrary loads/stores -
and is also the condition we want: if our assume is guaranteed to
execute, its condition not holding would be UB.

Original patch by arielb1.

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

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

5 years ago[NFC] Revisited/updated tests
David Bolvansky [Tue, 13 Aug 2019 17:07:02 +0000 (17:07 +0000)]
[NFC] Revisited/updated tests

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

5 years agoReland r368691: "[AIX] Implement LR prolog/epilog save/restore"
Hubert Tong [Tue, 13 Aug 2019 17:05:53 +0000 (17:05 +0000)]
Reland r368691: "[AIX] Implement LR prolog/epilog save/restore"

Trying again with the code changes (and not just the new test).

Summary:
This patch fixes the offsets of fields in the stack frame linkage save
area for AIX.

Reviewers: sfertile, hubert.reinterpretcast, jasonliu, Xiangling_L, xingxue, ZarkoCA, daltenty

Reviewed By: hubert.reinterpretcast

Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

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

Patch by Chris Bowler!

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

5 years ago[NFC][AIX] Use assert instead of llvm_unreachable
David Tenty [Tue, 13 Aug 2019 17:04:51 +0000 (17:04 +0000)]
[NFC][AIX] Use assert instead of llvm_unreachable

Addresses post-commit comments on https://reviews.llvm.org/D64825. Use
assert instead of llvm_unreachable to check if invalid csect types are being
generated. Use report_fatal_error on unimplemented XCOFF features.

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

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

5 years ago[Dwarf] Complete the list of type tags.
Jonas Devlieghere [Tue, 13 Aug 2019 17:00:54 +0000 (17:00 +0000)]
[Dwarf] Complete the list of type tags.

An incorrect verification error revealed that the list of type tags was
incomplete. This patch adds the missing types by adding a tag kind to
the Dwarf.def file, which is used by the `isType` function.

A test was added for the original verification error.

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

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

5 years ago[X86] Add some vXi8 extract subvector cost model tests
Simon Pilgrim [Tue, 13 Aug 2019 16:44:40 +0000 (16:44 +0000)]
[X86] Add some vXi8 extract subvector cost model tests

We don't have full 512-bit test coverage yet - but there's enough to help test D65892

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

5 years ago[SLC] Improve dereferenceable bytes annotation
David Bolvansky [Tue, 13 Aug 2019 16:44:16 +0000 (16:44 +0000)]
[SLC] Improve dereferenceable bytes annotation

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

5 years agoGlobalISel: Partially implement fewerElementsVector G_UNMERGE_VALUES
Matt Arsenault [Tue, 13 Aug 2019 16:26:28 +0000 (16:26 +0000)]
GlobalISel: Partially implement fewerElementsVector G_UNMERGE_VALUES

Odd sized vectors aren't handled yet.

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

5 years ago[ARM] Fix detection of duplicates when parsing reg list operands
Momchil Velikov [Tue, 13 Aug 2019 16:13:00 +0000 (16:13 +0000)]
[ARM] Fix detection of duplicates when parsing reg list operands

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

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

5 years ago[ARM] Fix encoding of APSR in CLRM instruction
Momchil Velikov [Tue, 13 Aug 2019 16:12:46 +0000 (16:12 +0000)]
[ARM] Fix encoding of APSR in CLRM instruction

The APSR is encoded by setting bit 15 in the register list of the CLRM
instruction (cf. https://static.docs.arm.com/ddi0553/bh/DDI0553B_h_armv8m_arm.pdf).

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

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

5 years agoGlobalISel: Implement lower for G_SHUFFLE_VECTOR
Matt Arsenault [Tue, 13 Aug 2019 16:09:07 +0000 (16:09 +0000)]
GlobalISel: Implement lower for G_SHUFFLE_VECTOR

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

5 years ago[ORC] Refactor definition-generation, add a generator for static libraries.
Lang Hames [Tue, 13 Aug 2019 16:05:18 +0000 (16:05 +0000)]
[ORC] Refactor definition-generation, add a generator for static libraries.

This patch replaces the JITDylib::DefinitionGenerator typedef with a class of
the same name, and adds support for attaching a sequence of DefinitionGeneration
objects to a JITDylib.

This patch also adds a new definition generator,
StaticLibraryDefinitionGenerator, that can be used to add symbols fom a static
library to a JITDylib. An object from the static library will be added (via
a supplied ObjectLayer reference) whenever a symbol from that object is
referenced.

To enable testing, lli is updated to add support for the --extra-archive option
when running in -jit-kind=orc-lazy mode.

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

5 years agoGlobalISel: Add more verifier checks for G_SHUFFLE_VECTOR
Matt Arsenault [Tue, 13 Aug 2019 15:52:21 +0000 (15:52 +0000)]
GlobalISel: Add more verifier checks for G_SHUFFLE_VECTOR

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

5 years agoGlobalISel: Change representation of shuffle masks
Matt Arsenault [Tue, 13 Aug 2019 15:34:38 +0000 (15:34 +0000)]
GlobalISel: Change representation of shuffle masks

Currently shufflemasks get emitted as any other constant, and you end
up with a bunch of virtual registers of G_CONSTANT with a
G_BUILD_VECTOR. The AArch64 selector then asserts on anything that
doesn't fit this pattern. This isn't an ideal representation, and
should avoid legalization and have fewer opportunities for a
representational error.

Rather than invent a new shuffle mask operand type, similar to what
ShuffleVectorSDNode does, just track the original IR Constant mask
operand. I don't completely like the idea of adding another link to
the IR, but MIR is already quite dependent on IR constants already,
and this will allow sharing the shuffle mask utility functions with
the IR.

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

5 years ago[CodeGen][SelectionDAG] More efficient code for X % C == 0 (SREM case)
Roman Lebedev [Tue, 13 Aug 2019 14:57:37 +0000 (14:57 +0000)]
[CodeGen][SelectionDAG] More efficient code for X % C == 0 (SREM case)

Summary:
This implements an optimization described in Hacker's Delight 10-17:
when `C` is constant, the result of `X % C == 0` can be computed
more cheaply without actually calculating the remainder.
The motivation is discussed here: https://bugs.llvm.org/show_bug.cgi?id=35479.

One huge caveat: this signed case is only valid for positive divisors.

While we can freely negate negative divisors, we can't negate `INT_MIN`,
so for now if `INT_MIN` is encountered, we bailout.
As a follow-up, it should be possible to handle that more gracefully
via extra `and`+`setcc`+`select`.

This passes llvm's test-suite, and from cursory(!) cross-examination
the folds (the assembly) match those of GCC, and manual checking via alive
did not reveal any issues (other than the `INT_MIN` case)

Reviewers: RKSimon, spatel, hermord, craig.topper, xbolva00

Reviewed By: RKSimon, xbolva00

Subscribers: xbolva00, thakis, javed.absar, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

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

5 years ago[TargetLowering][NFC] prepareUREMEqFold(): fixup comment
Roman Lebedev [Tue, 13 Aug 2019 14:57:08 +0000 (14:57 +0000)]
[TargetLowering][NFC] prepareUREMEqFold(): fixup comment

The comment initially matched the code, but the code was incorrect
and was fixed after the initial revert back back when it was introduced,
but the comment was never updated.

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

5 years agoRevert r368691; test checked in without changes by accident
Hubert Tong [Tue, 13 Aug 2019 14:43:34 +0000 (14:43 +0000)]
Revert r368691; test checked in without changes by accident

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

5 years ago[llvm-readelf] Implement note parsing for NT_FILE and unknown descriptors
Jordan Rupprecht [Tue, 13 Aug 2019 14:38:45 +0000 (14:38 +0000)]
[llvm-readelf] Implement note parsing for NT_FILE and unknown descriptors

Summary:
This patch implements two note parsers; one for NT_FILE coredumps, e.g.:

```
  CORE                  0x00000080      NT_FILE (mapped files)
    Page size: 4096
                 Start                 End         Page Offset
    0x0000000000001000  0x0000000000002000  0x0000000000003000
        /path/to/a.out
    0x0000000000004000  0x0000000000005000  0x0000000000006000
        /path/to/libc.so
    0x0000000000007000  0x0000000000008000  0x0000000000009000
        [stack]
```

(A more realistic example can be tested locally by creating a crashing program and running `llvm-readelf -n core`)

And also implements a raw hex dump for unknown descriptor data for unhandled descriptor types.

Reviewers: MaskRay, jhenderson, grimar, alexshap

Reviewed By: MaskRay, grimar

Subscribers: emaste, llvm-commits, labath

Tags: #llvm

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

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

5 years agoFix -Wdocumentation warning (@returns used in void function). NFCI.
Simon Pilgrim [Tue, 13 Aug 2019 13:55:38 +0000 (13:55 +0000)]
Fix -Wdocumentation warning (@returns used in void function). NFCI.

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

5 years ago[AIX] Implement LR prolog/epilog save/restore
Hubert Tong [Tue, 13 Aug 2019 13:38:24 +0000 (13:38 +0000)]
[AIX] Implement LR prolog/epilog save/restore

Summary:
This patch fixes the offsets of fields in the stack frame linkage save
area for AIX.

Reviewers: sfertile, hubert.reinterpretcast, jasonliu, Xiangling_L, xingxue, ZarkoCA, daltenty

Reviewed By: hubert.reinterpretcast

Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

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

Patch by Chris Bowler!

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

5 years ago[InstCombine] Non-canonical clamp-like pattern handling
Roman Lebedev [Tue, 13 Aug 2019 12:49:28 +0000 (12:49 +0000)]
[InstCombine] Non-canonical clamp-like pattern handling

Summary:
Given a pattern like:
```
%old_cmp1 = icmp slt i32 %x, C2
%old_replacement = select i1 %old_cmp1, i32 %target_low, i32 %target_high
%old_x_offseted = add i32 %x, C1
%old_cmp0 = icmp ult i32 %old_x_offseted, C0
%r = select i1 %old_cmp0, i32 %x, i32 %old_replacement
```
it can be rewritten as more canonical pattern:
```
%new_cmp1 = icmp slt i32 %x, -C1
%new_cmp2 = icmp sge i32 %x, C0-C1
%new_clamped_low = select i1 %new_cmp1, i32 %target_low, i32 %x
%r = select i1 %new_cmp2, i32 %target_high, i32 %new_clamped_low
```
Iff `-C1 s<= C2 s<= C0-C1`
Also, `ULT` predicate can also be `UGE`; or `UGT` iff `C0 != -1` (+invert result)
Also, `SLT` predicate can also be `SGE`; or `SGT` iff `C2 != INT_MAX` (+invert result)

If `C1 == 0`, then all 3 instructions must be one-use; else at most either `%old_cmp1` or `%old_x_offseted` can have extra uses.
NOTE: if we could reuse `%old_cmp1` as one of the comparisons we'll have to build, this could be less limiting.

So there are two icmp's, each one with 3 predicate variants, so there are 9 fold variants:

|     | ULT                            | UGE                             | UGT                             |
| SLT | https://rise4fun.com/Alive/yIJ | https://rise4fun.com/Alive/5BfN | https://rise4fun.com/Alive/INH  |
| SGE | https://rise4fun.com/Alive/hd8 | https://rise4fun.com/Alive/Abk  | https://rise4fun.com/Alive/PlzS |
| SGT | https://rise4fun.com/Alive/VYG | https://rise4fun.com/Alive/oMY  | https://rise4fun.com/Alive/KrzC |
{F9730206}

This fold was brought up in https://reviews.llvm.org/D65148#1603922 by @dmgreen, and is needed to unblock that patch.
This patch requires D65530.

Reviewers: spatel, nikic, xbolva00, dmgreen

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits, dmgreen

Tags: #llvm

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

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

5 years ago[InstCombine][NFC] Rename IsFreeToInvert() -> isFreeToInvert() for consistency
Roman Lebedev [Tue, 13 Aug 2019 12:49:16 +0000 (12:49 +0000)]
[InstCombine][NFC] Rename IsFreeToInvert() -> isFreeToInvert() for consistency

As per https://reviews.llvm.org/D65530#inline-592325

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

5 years ago[InstCombine] foldXorOfICmps(): don't give up on non-single-use ICmp's if all users...
Roman Lebedev [Tue, 13 Aug 2019 12:49:06 +0000 (12:49 +0000)]
[InstCombine] foldXorOfICmps(): don't give up on non-single-use ICmp's if all users are freely invertible

Summary:
This is rather unconventional..

As the comment there says, we don't have much folds for xor-of-icmps,
we try to turn them into an and-of-icmps, for which we have plenty of folds.
But if the ICmp we need to invert is not single-use - we give up.

As discussed in https://reviews.llvm.org/D65148#1603922,
we may have a non-canonical CLAMP pattern, with bit match and
select-of-threshold that we'll potentially clamp.
As it can be seen in `canonicalize-clamp-with-select-of-constant-threshold-pattern.ll`,
out of all 8 variations of the pattern, only two are **not** canonicalized into
the variant with and+icmp instead of bit math.
The reason is because the ICmp we need to invert is not single-use - we give up.

We indeed can't perform this fold at will, the general rule is that
we should not increase instruction count in InstCombine,

But we wouldn't end up increasing instruction count if we can adapt every other
user to the inverted value. This way the `not` we create **will** get folded,
and in the end the instruction count did not increase.

For that, of course, we need to look at the users of a Value,
which is again rather unconventional for InstCombine :S

Thus i'm proposing to be a little bit more insistive in `foldXorOfICmps()`.
The alternatives would be to not create that `not`, but add duplicate code to
manually invert all users; or to add some even less general combine to handle
some more specific pattern[s].

Reviewers: spatel, nikic, RKSimon, craig.topper

Reviewed By: spatel

Subscribers: hiraditya, jdoerfert, dmgreen, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-readobj] - Remove 'error(Error EC)' helper.
George Rimar [Tue, 13 Aug 2019 12:07:41 +0000 (12:07 +0000)]
[llvm-readobj] - Remove 'error(Error EC)' helper.

We do not need it. I replaced it with
reportError(StringRef Input, Error Err).

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

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

5 years agogn build: Extract git() and git_out() functions in sync script
Nico Weber [Tue, 13 Aug 2019 11:48:15 +0000 (11:48 +0000)]
gn build: Extract git() and git_out() functions in sync script

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

5 years agogn build: Merge r368630
Nico Weber [Tue, 13 Aug 2019 11:32:54 +0000 (11:32 +0000)]
gn build: Merge r368630

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

5 years agogn build: Give cmake sync script an opt-in --write flag
Nico Weber [Tue, 13 Aug 2019 11:32:45 +0000 (11:32 +0000)]
gn build: Give cmake sync script an opt-in --write flag

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

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

5 years agogn build: Make sync script group output by revision
Nico Weber [Tue, 13 Aug 2019 11:24:20 +0000 (11:24 +0000)]
gn build: Make sync script group output by revision

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

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

5 years ago[X86] XFormVExtractWithShuffleIntoLoad - handle shuffle mask scaling
Simon Pilgrim [Tue, 13 Aug 2019 11:11:42 +0000 (11:11 +0000)]
[X86] XFormVExtractWithShuffleIntoLoad - handle shuffle mask scaling

If the target shuffle mask is from a wider type, attempt to scale the mask so that the extraction can attempt to peek through.

Fixes the regression mentioned in rL368662

Reapplying this as rL368308 had to be reverted as part of rL368660 to revert rL368276

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

5 years ago[X86] SimplifyDemandedVectorElts - attempt to recombine target shuffle using Demanded...
Simon Pilgrim [Tue, 13 Aug 2019 10:51:39 +0000 (10:51 +0000)]
[X86] SimplifyDemandedVectorElts - attempt to recombine target shuffle using DemandedElts mask (reapplied)

If we don't demand all elements, then attempt to combine to a simpler shuffle.

At the moment we can only do this if Depth == 0 as combineX86ShufflesRecursively uses Depth to track whether the shuffle has really changed or not - we'll need to change this before we can properly start merging combineX86ShufflesRecursively into SimplifyDemandedVectorElts.

The insertps-combine.ll regression is because XFormVExtractWithShuffleIntoLoad can't see through shuffles of different widths - this will be fixed in a follow-up commit.

Reapplying this as rL368307 had to be reverted as part of rL368660 to revert rL368276

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

5 years agoRevert r368276 "[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDeman...
Hans Wennborg [Tue, 13 Aug 2019 09:33:25 +0000 (09:33 +0000)]
Revert r368276 "[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::EXTRACT_VECTOR_ELT"

This introduced a false positive MemorySanitizer warning about use of
uninitialized memory in a vectorized crc function in Chromium. That suggests
maybe something is not right with this transformation. See
https://crbug.com/992853#c7 for a reproducer.

This also reverts the follow-up commits r368307 and r368308 which
depended on this.

> This patch attempts to peek through vectors based on the demanded bits/elt of a particular ISD::EXTRACT_VECTOR_ELT node, allowing us to avoid dependencies on ops that have no impact on the extract.
>
> In particular this helps remove some unnecessary scalar->vector->scalar patterns.
>
> The wasm shift patterns are annoying - @tlively has indicated that the wasm vector shift codegen are to be refactored in the near-term and isn't considered a major issue.
>
> Differential Revision: https://reviews.llvm.org/D65887

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

5 years ago[SimplifyLibCalls] Add dereferenceable bytes from known callsites
David Bolvansky [Tue, 13 Aug 2019 09:11:49 +0000 (09:11 +0000)]
[SimplifyLibCalls] Add dereferenceable bytes from known callsites

Summary:
int mm(char *a, char *b) {
    return memcmp(a,b,16);
}

Currently:
define dso_local i32 @mm(i8* nocapture readonly %a, i8* nocapture readonly %b) local_unnamed_addr #1 {
entry:
  %call = tail call i32 @memcmp(i8* %a, i8* %b, i64 16)
  ret i32 %call
}

After patch:
define dso_local i32 @mm(i8* nocapture readonly %a, i8* nocapture readonly %b) local_unnamed_addr #1 {
entry:
  %call = tail call i32 @memcmp(i8* dereferenceable(16)  %a, i8* dereferenceable(16)  %b, i64 16)
  ret i32 %call
}

Reviewers: jdoerfert, efriedma

Reviewed By: jdoerfert

Subscribers: javed.absar, spatel, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][InstCombine] Non-canonical clamp pattern: non-canonical predicate tests
Roman Lebedev [Tue, 13 Aug 2019 08:14:13 +0000 (08:14 +0000)]
[NFC][InstCombine] Non-canonical clamp pattern: non-canonical predicate tests

We can't handle 'uge' case because we can't ever get it,
there needs to be extra use on that compare or else it will be
canonicalized, but because of extra use we can't handle it.

'sge' case we can have.

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

5 years ago[PowerPC] Fix ICE when truncating some vectors
Qiu Chaofan [Tue, 13 Aug 2019 07:53:29 +0000 (07:53 +0000)]
[PowerPC] Fix ICE when truncating some vectors

The legalizer would hit an assertion on PowerPC platform when truncating
a vector whose size is not power of 2.  This patch is to add a check to
prevent vectors with such odd-size elements from being custom lowered.

Reviewed By: Hal Finkel

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

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

5 years ago[AArch64][GlobalISel] Replace explicit vreg creation with implicit using SrcOp. NFC.
Amara Emerson [Tue, 13 Aug 2019 06:55:32 +0000 (06:55 +0000)]
[AArch64][GlobalISel] Replace explicit vreg creation with implicit using SrcOp. NFC.

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

5 years ago[GlobalISel] Make the InstructionSelector instance non-const, allowing state to be...
Amara Emerson [Tue, 13 Aug 2019 06:26:59 +0000 (06:26 +0000)]
[GlobalISel] Make the InstructionSelector instance non-const, allowing state to be maintained.

Currently we can't keep any state in the selector object that we get from
subtarget. As a result we have to plumb through all our variables through
multiple functions. This change makes it non-const and adds a virtual init()
method to allow further state to be captured for each target.

AArch64 makes use of this in this patch to cache a call to hasFnAttribute()
which is expensive to call, and is used on each selection of G_BRCOND.

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

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

5 years agoAdded unit tests to check supported rounding modes
Serge Pavlov [Tue, 13 Aug 2019 05:21:18 +0000 (05:21 +0000)]
Added unit tests to check supported rounding modes

Also added fixed misspelled metadata name.

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

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

5 years ago[GlobalISel]: Add KnownBits for G_XOR
Aditya Nandakumar [Tue, 13 Aug 2019 04:32:33 +0000 (04:32 +0000)]
[GlobalISel]: Add KnownBits for G_XOR

https://reviews.llvm.org/D66119

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

5 years agoVerifier: check prof branch_weights
Yevgeny Rouban [Tue, 13 Aug 2019 04:03:38 +0000 (04:03 +0000)]
Verifier: check prof branch_weights

This patch is to check some of constraints on
!pro branch_weights metadata:
https://llvm.org/docs/BranchWeightMetadata.html

Reviewers: asbirlea, reames, chandlerc
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D61179

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

5 years agoDo not call replaceAllUsesWith to upgrade calls to ARC runtime functions
Akira Hatanaka [Tue, 13 Aug 2019 01:23:06 +0000 (01:23 +0000)]
Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions
to intrinsic calls

This fixes a bug in r368311.

It turns out that the ARC runtime functions in the IR can have pointer
parameter types that are not i8* or i8**. Instead of RAUWing normal
functions with intrinsics, manually bitcast the arguments before passing
them to the intrinsic functions and bitcast the return value back to the
type of the original call instruction.

This recommits r368634, which was reverted in r368637. The loop in the
patch was iterating over uses of a function and deleting function calls
inside it, which caused bots to crash.

rdar://problem/54125406

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

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

5 years ago[AMDGPU] Fix msan failure in printf lowering
Stanislav Mekhanoshin [Tue, 13 Aug 2019 01:07:27 +0000 (01:07 +0000)]
[AMDGPU] Fix msan failure in printf lowering

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

5 years agoEliminate implicit Register->unsigned conversions in VirtRegMap. NFC
Daniel Sanders [Tue, 13 Aug 2019 00:55:24 +0000 (00:55 +0000)]
Eliminate implicit Register->unsigned conversions in VirtRegMap. NFC

Summary:
This was mostly an experiment to assess the feasibility of completely
eliminating a problematic implicit conversion case in D61321 in advance of
landing that* but it also happens to align with the goal of propagating the
use of Register/MCRegister instead of unsigned so I believe it makes sense
to commit it.

The overall process for eliminating the implicit conversions from
Register/MCRegister -> unsigned was to:
1. Add an explicit conversion to support genuinely required conversions to
   unsigned. For example, using them as an index for IndexedMap. Sadly it's
   not possible to have an explicit and implicit conversion to the same
   type and only deprecate the implicit one so I called the explicit
   conversion get().
2. Temporarily annotate the implicit conversion to unsigned with
   LLVM_ATTRIBUTE_DEPRECATED to make them visible
3. Eliminate implicit conversions by propagating Register/MCRegister/
   explicit-conversions appropriately
4. Remove the deprecation added in 2.

* My conclusion is that it isn't feasible as there's too much code to
  update in one go.

Depends on D65678

Reviewers: arsenm

Subscribers: MatzeB, wdng, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoRevert "Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions"
Akira Hatanaka [Tue, 13 Aug 2019 00:20:36 +0000 (00:20 +0000)]
Revert "Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions"

This reverts commit r368634 because it broke a bot.

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

5 years agoMove findBBwithCalls to the file it's used in to avoid unused function
Eric Christopher [Tue, 13 Aug 2019 00:05:01 +0000 (00:05 +0000)]
Move findBBwithCalls to the file it's used in to avoid unused function
warnings.

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

5 years agoDo not call replaceAllUsesWith to upgrade calls to ARC runtime functions
Akira Hatanaka [Mon, 12 Aug 2019 23:53:23 +0000 (23:53 +0000)]
Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions
to intrinsic calls

This fixes a bug in r368311.

It turns out that the ARC runtime functions in the IR can have pointer
parameter types that are not i8* or i8**. Instead of RAUWing normal
functions with intrinsics, manually bitcast the arguments before passing
them to the intrinsic functions and bitcast the return value back to the
type of the original call instruction.

rdar://problem/54125406

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

5 years ago[AMDGPU] removed unused functions from printf lowering
Stanislav Mekhanoshin [Mon, 12 Aug 2019 23:32:35 +0000 (23:32 +0000)]
[AMDGPU] removed unused functions from printf lowering

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

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

5 years ago[WinEH] Fix catch block parent frame pointer offset
Reid Kleckner [Mon, 12 Aug 2019 23:02:00 +0000 (23:02 +0000)]
[WinEH] Fix catch block parent frame pointer offset

r367088 made it so that funclets store XMM registers into their local
frame instead of storing them to the parent frame. However, that change
forgot to update the parent frame pointer offset for catch blocks. This
change does that.

Fixes crashes when an exception is rethrown in a catch block that saves
XMMs, as described in https://crbug.com/992860.

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

5 years ago[TextAPI] Fix & Add tests for tbd files version 3.
Juergen Ributzka [Mon, 12 Aug 2019 23:01:07 +0000 (23:01 +0000)]
[TextAPI] Fix & Add tests for tbd files version 3.

- There was a simple typo in TextStub code that prevented version 3 files to be read.
- Included a version 3 unit test to handle the differences in the format.
- Also a typo in Error.h inside the comments.

https://reviews.llvm.org/D66041

This patch is from Cyndy Ishida <cyndy_ishida@apple.com>.

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

5 years ago[risc-v] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Daniel Sanders [Mon, 12 Aug 2019 22:41:02 +0000 (22:41 +0000)]
[risc-v] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM

Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).

Depends on D65919

Reviewers: lenary

Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits

Tags: #llvm

Differential Revision for full review was: https://reviews.llvm.org/D65962

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

5 years ago[aarch64] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Daniel Sanders [Mon, 12 Aug 2019 22:40:53 +0000 (22:40 +0000)]
[aarch64] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM

Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).

Manual fixups in:
AArch64InstrInfo.cpp - genFusedMultiply() now takes a Register* instead of unsigned*
AArch64LoadStoreOptimizer.cpp - Ternary operator was ambiguous between Register/MCRegister. Settled on Register

Depends on D65919

Reviewers: aemerson

Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits

Tags: #llvm

Differential Revision for full review was: https://reviews.llvm.org/D65962

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

5 years ago[webassembly] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Daniel Sanders [Mon, 12 Aug 2019 22:40:45 +0000 (22:40 +0000)]
[webassembly] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM

Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).

Reviewers: aheejin

Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits

Tags: #llvm

Differential Revision for whole review: https://reviews.llvm.org/D65962

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

5 years ago[AMDGPU] Use PredicateControl in MIMGBaseOpcode. NFC.
Stanislav Mekhanoshin [Mon, 12 Aug 2019 22:32:21 +0000 (22:32 +0000)]
[AMDGPU] Use PredicateControl in MIMGBaseOpcode. NFC.

This is infrastructural, will be needed for future work.
For some reason it was only used in MIMG_NoSampler, while
needed everywere we use MIMGBaseOpcode if we want to use
predicates.

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

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

5 years ago[Attributor] Use the cached data layout directly
Johannes Doerfert [Mon, 12 Aug 2019 22:21:09 +0000 (22:21 +0000)]
[Attributor] Use the cached data layout directly

This removes the warning by using the new DL member.
It also simplifies the code.

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

5 years agoTitle: Fix build warning for operator<< when using GCC 7.
Whitney Tsang [Mon, 12 Aug 2019 22:20:54 +0000 (22:20 +0000)]
Title: Fix build warning for operator<< when using GCC 7.
Authored By: etiotto
Differential Revision: https://reviews.llvm.org/D63459

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

5 years ago[X86] Allow combineTruncateWithSat to use pack instructions for i16->i8 without AVX512BW.
Craig Topper [Mon, 12 Aug 2019 22:18:23 +0000 (22:18 +0000)]
[X86] Allow combineTruncateWithSat to use pack instructions for i16->i8 without AVX512BW.

We need AVX512BW to be able to truncate an i16 vector. If we don't
have that we have to extend i16->i32, then trunc, i32->i8. But we
won't be able to remove the min/max if we do that. At least not
without more special handling.

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

5 years ago[Attributor][NFC] Add IntegerState raw_ostream << operator
Johannes Doerfert [Mon, 12 Aug 2019 22:07:34 +0000 (22:07 +0000)]
[Attributor][NFC] Add IntegerState raw_ostream << operator

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

5 years ago[Attributor] Make the InformationCache an Attributor member
Johannes Doerfert [Mon, 12 Aug 2019 22:05:53 +0000 (22:05 +0000)]
[Attributor] Make the InformationCache an Attributor member

The functionality is not changed but the interfaces are simplified and
repetition is removed.

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

5 years ago[GISel]: Fix a bug in KnownBits where we should have been using SizeInBits
Aditya Nandakumar [Mon, 12 Aug 2019 21:28:12 +0000 (21:28 +0000)]
[GISel]: Fix a bug in KnownBits where we should have been using SizeInBits

https://reviews.llvm.org/D66039

We were using getIndexSize instead of getIndexSizeInBits().
Added test case for G_PTRTOINT and G_INTTOPTR.

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

5 years agoRevert "Disable MachO TBD write tests for Windows."
Juergen Ributzka [Mon, 12 Aug 2019 19:51:34 +0000 (19:51 +0000)]
Revert "Disable MachO TBD write tests for Windows."

The underlying issue was fixed in r357759.

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

5 years ago[X86] Remove unreachable code from LowerTRUNCATE. NFC
Craig Topper [Mon, 12 Aug 2019 19:26:45 +0000 (19:26 +0000)]
[X86] Remove unreachable code from LowerTRUNCATE. NFC

All three 256->128 bit cases were already handled above.

Noticed while looking at the coverage report.

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

5 years ago[X86] Add a paranoia type check to the code that detects AVG patterns from truncating...
Craig Topper [Mon, 12 Aug 2019 19:26:37 +0000 (19:26 +0000)]
[X86] Add a paranoia type check to the code that detects AVG patterns from truncating stores.

If we're after type legalize, we should make sure we won't create
a store with an illegal type when we separate the AVG pattern
from the truncating store.

I don't know of a way to fail for this today. Just noticed while
I was in the vicinity.

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

5 years ago[X86] Simplify creation of saturating truncating stores.
Craig Topper [Mon, 12 Aug 2019 19:26:30 +0000 (19:26 +0000)]
[X86] Simplify creation of saturating truncating stores.

We just need to check if the truncating store is legal
instead of going through isSATValidOnAVX512Subtarget.

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

5 years ago[X86] Replace call to isTruncStoreLegalOrCustom with isTruncStoreLegal. NFC
Craig Topper [Mon, 12 Aug 2019 19:26:22 +0000 (19:26 +0000)]
[X86] Replace call to isTruncStoreLegalOrCustom with isTruncStoreLegal. NFC

We have no custom trunc stores on X86.

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

5 years agogn build: Merge r368592
Nico Weber [Mon, 12 Aug 2019 18:33:10 +0000 (18:33 +0000)]
gn build: Merge r368592

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

5 years ago[NFC][PowerPC] Add the test case shrink-wrap.mir and shrink-wrap.ll for PPC
Kang Zhang [Mon, 12 Aug 2019 17:50:01 +0000 (17:50 +0000)]
[NFC][PowerPC] Add the test case shrink-wrap.mir and shrink-wrap.ll for PPC

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