]> granicus.if.org Git - llvm/log
llvm
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

5 years ago[ThinLTO][AutoFDO] Fix memory corruption due to race condition from thin backends
Wenlei He [Mon, 12 Aug 2019 17:45:14 +0000 (17:45 +0000)]
[ThinLTO][AutoFDO] Fix memory corruption due to race condition from thin backends

Summary:
This commit fixed a race condition from multi-threaded thinLTO backends that causes non-deterministic memory corruption for a data structure used only by AutoFDO with compact binary profile.
GUIDToFuncNameMap, a static data member of type DenseMap in FunctionSamples is used as a per-module mapping from function name MD5 to name string when input AutoFDO profile is in compact binary format. However with ThinLTO, we can have parallel backends modifying and accessing the class static map concurrently. The fix is to make GUIDToFuncNameMap a member of SampleProfileLoader instead of a file static data.

Reviewers: wmi, davidxl, danielcdh

Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

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

5 years ago[CostModel][X86][AArch64] Check all 3 cost kinds in aggregates.ll
Roman Lebedev [Mon, 12 Aug 2019 17:45:12 +0000 (17:45 +0000)]
[CostModel][X86][AArch64] Check all 3 cost kinds in aggregates.ll

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

5 years ago[X86] Disable use of zmm registers for varargs musttail calls under prefer-vector...
Craig Topper [Mon, 12 Aug 2019 17:43:26 +0000 (17:43 +0000)]
[X86] Disable use of zmm registers for varargs musttail calls under prefer-vector-width=256 and min-legal-vector-width=256.

Under this config, the v16f32 type we try to use isn't to a register
class so the getRegClassFor call will fail.

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

5 years ago[ARM] sext of a load is free
David Green [Mon, 12 Aug 2019 17:39:56 +0000 (17:39 +0000)]
[ARM] sext of a load is free

This teaches the cost model that the sext or zext of a load is going to be
free.

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

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

5 years ago[AMDGPU] Printf runtime binding pass
Stanislav Mekhanoshin [Mon, 12 Aug 2019 17:12:29 +0000 (17:12 +0000)]
[AMDGPU] Printf runtime binding pass

This pass is a port of the according pass from the HSAIL compiler.
It parses printf calls and setup runtime printf buffer.
After that it copies printf arguments to the buffer and fills in
module metadata for runtime.

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

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

5 years ago[ARM] MVE shuffle broadcast costs
David Green [Mon, 12 Aug 2019 16:54:07 +0000 (16:54 +0000)]
[ARM] MVE shuffle broadcast costs

A VDUP will perform a vector broadcast in a single instruction. Update the cost
model for MVE accordingly.

Code originally by David Sherwood.

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

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

5 years ago[ARM] Put some of the TTI costmodel behind hasNeon calls.
David Green [Mon, 12 Aug 2019 15:59:52 +0000 (15:59 +0000)]
[ARM] Put some of the TTI costmodel behind hasNeon calls.

This puts some of the calls in ARMTargetTransformInfo.cpp behind hasNeon()
checks, now that we have MVE, and updates all the tests accordingly.

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

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

5 years ago[ARM] Add or update a number of costmodel tests. NFC
David Green [Mon, 12 Aug 2019 15:40:27 +0000 (15:40 +0000)]
[ARM] Add or update a number of costmodel tests. NFC

This adds a number of cost model tests for ARM, useful for MVE. It also re-jigs
some of the existing tests to make them easier to update and read.

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

5 years ago[XCOFF] Use a single symbolic constant for the size of an embeded name. [NFC]
Sean Fertile [Mon, 12 Aug 2019 15:27:40 +0000 (15:27 +0000)]
[XCOFF] Use a single symbolic constant for the size of an embeded name. [NFC]

Convert SymbolNameSize and SectionNameSize into just `NameSize`. The length of
a name embeded in a symbol table entry or section header table entry is length 8
for Sections, Symbols and Files. No need to have a distinct constant for each
one. Also removes the Size argument to 'generateStringRef' as the size is
always 'XCOFF::NameSize'.

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

5 years ago[InstCombine] add tests for scalar-select-of-vectors; NFC
Sanjay Patel [Mon, 12 Aug 2019 15:21:11 +0000 (15:21 +0000)]
[InstCombine] add tests for scalar-select-of-vectors; NFC

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

5 years agoRevert r368339 "[MBP] Disable aggressive loop rotate in plain mode"
Hans Wennborg [Mon, 12 Aug 2019 14:23:13 +0000 (14:23 +0000)]
Revert r368339 "[MBP] Disable aggressive loop rotate in plain mode"

It caused assertions to fire when building Chromium:

  lib/CodeGen/LiveDebugValues.cpp:331: bool
  {anonymous}::LiveDebugValues::OpenRangesSet::empty() const: Assertion
  `Vars.empty() == VarLocs.empty() && "open ranges are inconsistent"' failed.

See https://crbug.com/992871#c3 for how to reproduce.

> Patch https://reviews.llvm.org/D43256 introduced more aggressive loop layout optimization which depends on profile information. If profile information is not available, the statically estimated profile information(generated by BranchProbabilityInfo.cpp) is used. If user program doesn't behave as BranchProbabilityInfo.cpp expected, the layout may be worse.
>
> To be conservative this patch restores the original layout algorithm in plain mode. But user can still try the aggressive layout optimization with -force-precise-rotation-cost=true.
>
> Differential Revision: https://reviews.llvm.org/D65673

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

5 years ago[llvm-ar][NFC] Fix buildbot
Jordan Rupprecht [Mon, 12 Aug 2019 14:21:51 +0000 (14:21 +0000)]
[llvm-ar][NFC] Fix buildbot

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

5 years ago[llvm-readobj] Downgrade 'PT_DYNAMIC segment offset + size exceeds the size of the...
Jordan Rupprecht [Mon, 12 Aug 2019 14:05:37 +0000 (14:05 +0000)]
[llvm-readobj] Downgrade 'PT_DYNAMIC segment offset + size exceeds the size of the file' from an error to a warning

Summary: This allows llvm-readobj to print other useful information for truncated files instead of giving up.

Reviewers: jhenderson, grimar, MaskRay

Reviewed By: jhenderson, grimar, MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[X86][SSE] Add test showing missing demanded elts PSADBW handling
Simon Pilgrim [Mon, 12 Aug 2019 14:01:16 +0000 (14:01 +0000)]
[X86][SSE] Add test showing missing demanded elts PSADBW handling

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

5 years agoRevert r368565: [CodeGen] Do the Simple Early Return in block-placement pass to optim...
Kang Zhang [Mon, 12 Aug 2019 14:00:31 +0000 (14:00 +0000)]
Revert r368565: [CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

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

5 years ago[llvm-ar] Accept file paths with windows format slashes
Owen Reynolds [Mon, 12 Aug 2019 14:00:28 +0000 (14:00 +0000)]
[llvm-ar] Accept file paths with windows format slashes

The internal representation of llvm-ar archives uses linux style slashes
for paths, no matter the OS. In the case of windows this meant file
paths input intending to match existing members would only match if
linux style slashes where used. This change allows either slash
direction to be input by the user.

This change includes removing an unnecessary call to normalisePath and
moving the call of another.

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

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

5 years ago[RISCV] Fix ICE in isDesirableToCommuteWithShift
Sam Elliott [Mon, 12 Aug 2019 13:51:00 +0000 (13:51 +0000)]
[RISCV] Fix ICE in isDesirableToCommuteWithShift

Summary:
Ana Pazos reported a bug where we were not checking that an APInt would
fit into 64-bits before calling `getSExtValue()`. This caused asserts when
compiling large constants, such as i128s, as happens when compiling compiler-rt.

This patch adds a testcase and makes the callback less error-prone.

Reviewers: apazos, asb, luismarques

Reviewed By: luismarques

Subscribers: hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, llvm-commits

Tags: #llvm

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

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

5 years ago[InstCombine] x /c fabs(x) -> copysign(1.0, x)
David Bolvansky [Mon, 12 Aug 2019 13:43:35 +0000 (13:43 +0000)]
[InstCombine] x /c fabs(x) -> copysign(1.0, x)

Summary:
x / fabs(x) -> copysign(1.0, x)
fabs(x) / x -> copysign(1.0, x)

Reviewers: spatel, foad, RKSimon, efriedma

Reviewed By: spatel

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

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

5 years ago[DebugInfo] Remove call sites when eliminating unreachable blocks
David Stenberg [Mon, 12 Aug 2019 13:22:29 +0000 (13:22 +0000)]
[DebugInfo] Remove call sites when eliminating unreachable blocks

Summary:
When eliminating an unreachable block we must remove any call site
information for calls residing in the block.

This was originally found on a downstream target, and the attached x86
test case was produced by hand-modifying some MIR.

Reviewers: aprantl, asowda, NikolaPrica, djtodoro, ivanbaev, vsk

Reviewed By: NikolaPrica, vsk

Subscribers: vsk, hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

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

5 years ago[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks
Kang Zhang [Mon, 12 Aug 2019 13:15:31 +0000 (13:15 +0000)]
[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

Summary:

In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun.
But the `early-ret` pass is before `block-placement`, we don't want to run it again.
This patch is to do the simple early return to optimize the blocks at the last of `block-placement`.

Reviewed By: efriedma

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

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

5 years ago[llvm-ar][test] Correct tests marked as expected fails
Owen Reynolds [Mon, 12 Aug 2019 13:04:02 +0000 (13:04 +0000)]
[llvm-ar][test] Correct tests marked as expected fails

In diff D64802 I marked three tests as expected failures for darwin but
James Nagurne saw these fail on his downstream embedded ARM cross
compiler.
I believe XFAIL: system-darwin should be used instead of using XFAIL:
darwin due to the problem being related to the darwin host and not the
target.

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

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

5 years agoRevert r368509 "[CodeGen] Do the Simple Early Return in block-placement pass to optim...
Hans Wennborg [Mon, 12 Aug 2019 12:43:51 +0000 (12:43 +0000)]
Revert r368509 "[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks"

> In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun.
> But the `early-ret` pass is before `block-placement`, we don't want to run it again.
> This patch is to do the simple early return to optimize the blocks at the last of `block-placement`.
>
> Reviewed By: efriedma
>
> Differential Revision: https://reviews.llvm.org/D63972

This also revertes follow-ups r368514 and r368532.

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

5 years ago[X86][SSE] ComputeKnownBits - add basic PSADBW handling
Simon Pilgrim [Mon, 12 Aug 2019 12:19:19 +0000 (12:19 +0000)]
[X86][SSE] ComputeKnownBits - add basic PSADBW handling

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

5 years ago[X86][SSE] Add test showing missing compute known bits PSADBW handling
Simon Pilgrim [Mon, 12 Aug 2019 12:13:08 +0000 (12:13 +0000)]
[X86][SSE] Add test showing missing compute known bits PSADBW handling

The upper 48-bits of each i64 element is guaranteed to be zero.

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

5 years agoNFC. Remove trailing whitespace in test
James Henderson [Mon, 12 Aug 2019 11:39:54 +0000 (11:39 +0000)]
NFC. Remove trailing whitespace in test

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

5 years ago[llvm-strings] Improve testing of llvm-strings
James Henderson [Mon, 12 Aug 2019 11:36:11 +0000 (11:36 +0000)]
[llvm-strings] Improve testing of llvm-strings

This patch tidies up the llvm-strings testing by:

1. Adding comments to every test.
2. Getting rid of canned input files, and having the tests generate
   them on the fly (this makes the tests self-contained).
3. Adding missing test coverage.
4. Renaming some tests that weren't clear as to their purpose.
5. Adding extra checking of various cases, formatting etc.
6. Removing a test that didn't seem to have any useful purpose for
   testing llvm-strings.

Reviewed by: rupprecht, grimar, MaskRay

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

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

5 years ago[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): avoid constantexpr pitfai...
Roman Lebedev [Mon, 12 Aug 2019 11:28:02 +0000 (11:28 +0000)]
[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): avoid constantexpr pitfail (PR42962)

Instead of matching value and then blindly casting to BinaryOperator
just to get the opcode, just match instruction and do no cast.

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

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

5 years ago[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for...
Simon Pilgrim [Mon, 12 Aug 2019 10:56:05 +0000 (10:56 +0000)]
[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::TRUNCATE

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

5 years ago[CostModel][X86][AArch64] Add some tests for extractvalue
Roman Lebedev [Mon, 12 Aug 2019 09:24:33 +0000 (09:24 +0000)]
[CostModel][X86][AArch64] Add some tests for extractvalue

In https://reviews.llvm.org/D65148 it is suggested that
it should have zero cost, always.

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

5 years ago[X86] Add some reduction add test cases that show sub-optimal code on avx2 and later.
Craig Topper [Mon, 12 Aug 2019 06:55:58 +0000 (06:55 +0000)]
[X86] Add some reduction add test cases that show sub-optimal code on avx2 and later.

For v4i8 and v8i8 when the reduction starts with a load we end up
shifting the data in the scalar domain and copying to the vector
domain a second time using a broadcast.

We already copied it to the vector domain once. It's better to
just shuffle it there.

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

5 years ago[X86] Support -march=tigerlake
Pengfei Wang [Mon, 12 Aug 2019 01:29:46 +0000 (01:29 +0000)]
[X86] Support -march=tigerlake

Support -march=tigerlake for x86.
Compare with Icelake Client, It include 4 more new features ,they are
avx512vp2intersect, movdiri, movdir64b, shstk.

Patch by Xiang Zhang (xiangzhangllvm)

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

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

5 years agoFix pass dependency for LICM
Wenlei He [Sun, 11 Aug 2019 22:54:05 +0000 (22:54 +0000)]
Fix pass dependency for LICM

Expected to address buildbot failure http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16285 caused by D65060.

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

5 years ago[X86] Remove redundant ';' chars ending IR lines in lit tests. NFC
Bjorn Pettersson [Sun, 11 Aug 2019 19:27:14 +0000 (19:27 +0000)]
[X86] Remove redundant ';' chars ending IR lines in lit tests. NFC

Reviewers: RKSimon, craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[SelectionDAG] Widen vector results of SMULFIX/UMULFIX/SMULFIXSAT
Bjorn Pettersson [Sun, 11 Aug 2019 19:27:06 +0000 (19:27 +0000)]
[SelectionDAG] Widen vector results of SMULFIX/UMULFIX/SMULFIXSAT

Summary:
After the commits that changed x86 backend to widen vectors
instead of using promotion some of our downstream tests
started to fail. It was noticed that WidenVectorResult has
been missing support for SMULFIX/UMULFIX/SMULFIXSAT. This
patch adds the missing functionality.

Reviewers: craig.topper, RKSimon

Reviewed By: craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Simplify some of the type checks in combineSubToSubus.
Craig Topper [Sun, 11 Aug 2019 17:36:49 +0000 (17:36 +0000)]
[X86] Simplify some of the type checks in combineSubToSubus.

If we have SSE2 we can handle any i8/i16 type and let
type legalization deal with it.

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

5 years ago[X86] Don't use SplitOpsAndApply for ISD::USUBSAT.
Craig Topper [Sun, 11 Aug 2019 17:36:45 +0000 (17:36 +0000)]
[X86] Don't use SplitOpsAndApply for ISD::USUBSAT.

Target independent type legalization and custom lowering
should be able to handle it.

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

5 years ago[NFC][CodeGen] Use while loop instead for loop in MachineBlockPlacement::optimizeBran...
Kang Zhang [Sun, 11 Aug 2019 12:58:50 +0000 (12:58 +0000)]
[NFC][CodeGen] Use while loop instead for loop in MachineBlockPlacement::optimizeBranches()
This will pass EXPENSIVE check.

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

5 years ago[ARM] MVE spill vector test. NFC
David Green [Sun, 11 Aug 2019 09:12:57 +0000 (09:12 +0000)]
[ARM] MVE spill vector test. NFC

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

5 years ago[MVE] Don't try to unroll vectorised MVE loops
David Green [Sun, 11 Aug 2019 08:53:18 +0000 (08:53 +0000)]
[MVE] Don't try to unroll vectorised MVE loops

Due to the nature of the beat system in the MVE architecture, along with tail
predication and low-overhead loops, unrolling has less benefit compared to
normal loops. You can not, for example, hide the latency of a load with other
instructions as you can for scalar code. Preventing unrolling also makes the
code easier to read and reason about.

So if a loop contains vector code, don't enable the runtime unrolling. At least
for the time being.

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

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

5 years ago[ARM] Permit auto-vectorization using MVE
David Green [Sun, 11 Aug 2019 08:42:57 +0000 (08:42 +0000)]
[ARM] Permit auto-vectorization using MVE

With enough codegen complete, we can now correctly report the number and size
of vector registers for MVE, allowing auto vectorisation. This also allows FP
auto-vectorization for MVE without -Ofast/-ffast-math, due to support for IEEE
FP arithmetic and parity between scalar and vector FP behaviour.

Patch by David Sherwood.

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

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

5 years agoFix __clang_call_termiante's argument for foreign exceptions
Heejin Ahn [Sun, 11 Aug 2019 06:24:07 +0000 (06:24 +0000)]
Fix __clang_call_termiante's argument for foreign exceptions

Summary:
When exceptions are repeatedly thrown in the middle of handling another
exception, we call `__clang_call_terminate` with the exception pointer
(i32) as an argument. But in case of foreign exceptions, we don't have
the pointer, so we call the function with 0. (This requires
`__clang_call_terminate` can deal with 0 argument, which will be done
later)

But previously the 0 argument was not added as a `i32.const 0` but an
immediate by mistake, causing the `call` instruction to take not an i32
but rather an exnref, because an `exnref` is left on top of the value
stack if `br_on_exn` is not taken.

```
block i32
  br_on_exn 0, __cpp_exception
                               ;; exnref is on top of stack now
  i32.const 0                  ;; This was missing!
  call __clang_call_terminate
  unreachable
end
call __clang_call_terminate    ;; This takes i32 extracted by br_on_exn
```

Reviewers: dschuff

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

Tags: #llvm

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

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

5 years ago[LICM] Make Loop ICM profile aware
Wenlei He [Sun, 11 Aug 2019 06:05:35 +0000 (06:05 +0000)]
[LICM] Make Loop ICM profile aware

Summary:
Hoisting/sinking instruction out of a loop isn't always beneficial. Hoisting an instruction from a cold block inside a loop body out of the loop could hurt performance. This change makes Loop ICM profile aware - it now checks block frequency to make sure hoisting/sinking anly moves instruction to colder block.

Test Plan:

ninja check

Reviewers: asbirlea, sanjoy, reames, nikic, hfinkel, vsk

Reviewed By: asbirlea

Subscribers: fhahn, vsk, davidxl, xbolva00, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoRevert "test commit"
Wenlei He [Sun, 11 Aug 2019 05:59:20 +0000 (05:59 +0000)]
Revert "test commit"

This reverts commit ad92a4a2769425ad0d39ac1dbb6282f6f51a1af7.

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

5 years agotest commit
Wenlei He [Sun, 11 Aug 2019 05:50:28 +0000 (05:50 +0000)]
test commit

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

5 years ago[X86] Remove some more code from combineShuffle that is no longer needed with widenin...
Craig Topper [Sun, 11 Aug 2019 02:17:18 +0000 (02:17 +0000)]
[X86] Remove some more code from combineShuffle that is no longer needed with widening legalization.

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

5 years ago[X86] Remove some code from combineShuffle that seems largely unnecessary with wideni...
Craig Topper [Sun, 11 Aug 2019 02:08:38 +0000 (02:08 +0000)]
[X86] Remove some code from combineShuffle that seems largely unnecessary with widening legalization.

The test case that changed is probably better served through
allowing combineTruncatedArithmetic to create narrow vectors. It
also appears InstCombine would have simplified this test case
to remove the zext and trunc anyway.

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

5 years ago[InstCombine][NFC] Use SimplifyAddInst() instead of SimplifyBinOp(Instruction::Binary...
Roman Lebedev [Sat, 10 Aug 2019 19:29:10 +0000 (19:29 +0000)]
[InstCombine][NFC] Use SimplifyAddInst() instead of SimplifyBinOp(Instruction::BinaryOps::Add, )

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

5 years ago[NFC][InstCombine] Tests for shift amount reassociation in bittest with truncated...
Roman Lebedev [Sat, 10 Aug 2019 19:29:03 +0000 (19:29 +0000)]
[NFC][InstCombine] Tests for shift amount reassociation in bittest with truncated shl (PR42399)

trunc-of-shl:
  https://rise4fun.com/Alive/zGx
  https://rise4fun.com/Alive/sl0L
I.e. no extra legality check needed.

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

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

5 years ago[InstCombine] Shift amount reassociation in bittest: relax one-use check when shiftin...
Roman Lebedev [Sat, 10 Aug 2019 19:28:54 +0000 (19:28 +0000)]
[InstCombine] Shift amount reassociation in bittest: relax one-use check when shifting constant

If one of the values being shifted is a constant, since the new shift
amount is known-constant, the new shift will end up being constant-folded
so, we don't need that one-use restriction then.

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

5 years ago[InstCombine] Shift amount reassociation in bittest: drop pointless one-use restriction
Roman Lebedev [Sat, 10 Aug 2019 19:28:44 +0000 (19:28 +0000)]
[InstCombine] Shift amount reassociation in bittest: drop pointless one-use restriction

That one-use restriction is not needed for correctness - we have already
ensured that one of the shifts will go away, so we know we won't increase
the instruction count. So there is no need for that restriction.

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

5 years ago[NFC][InstCombine] Tests for shift amount reassociation in bittest with shift of...
Roman Lebedev [Sat, 10 Aug 2019 19:28:12 +0000 (19:28 +0000)]
[NFC][InstCombine] Tests for shift amount reassociation in bittest with shift of const

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

5 years ago[X86][SSE] Lower shuffle as ANY_EXTEND_VECTOR_INREG
Simon Pilgrim [Sat, 10 Aug 2019 16:46:07 +0000 (16:46 +0000)]
[X86][SSE] Lower shuffle as ANY_EXTEND_VECTOR_INREG

On SSE41+ targets we always lower vector shuffles to ZERO_EXTEND_VECTOR_INREG, even if we don't need the extended bits.

This patch relaxes this so that we lower to ANY_EXTEND_VECTOR_INREG if we can, meaning that shuffle combines have a better idea of what elements need to be kept zero. This helps the multiple reduction code as we can now combine away a lot more of the pack+extend codes.

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

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

5 years ago[NFC][CodeGen] Modify the PI++ to ++PI in MachineBlockPlacement::optimizeBranches()
Kang Zhang [Sat, 10 Aug 2019 16:23:17 +0000 (16:23 +0000)]
[NFC][CodeGen] Modify the PI++ to ++PI in MachineBlockPlacement::optimizeBranches()

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

5 years ago[TableGen] Correct the shift to the proper bit width.
Michael Liao [Sat, 10 Aug 2019 16:15:06 +0000 (16:15 +0000)]
[TableGen] Correct the shift to the proper bit width.

- Replace the previous 32-bit shift with 64-bit one matching `OpInit`.

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

5 years ago[Reassociate] try harder to convert negative FP constants to positive
Sanjay Patel [Sat, 10 Aug 2019 13:17:54 +0000 (13:17 +0000)]
[Reassociate] try harder to convert negative FP constants to positive

This is an extension of a transform that tries to produce positive floating-point
constants to improve canonicalization (and hopefully lead to more reassociation
and CSE).

The original patches were:
D4904
D5363 (rL221721)

But as the test diffs show, these were limited to basic patterns by walking from
an instruction to its single user rather than recursively moving up the def-use
sequence. No fast-math is required here because we're only rearranging implicit
FP negations in intermediate ops.

A motivating bug is:
https://bugs.llvm.org/show_bug.cgi?id=32939

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

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

5 years ago[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks
Kang Zhang [Sat, 10 Aug 2019 09:58:52 +0000 (09:58 +0000)]
[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

Summary:

In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun.
But the `early-ret` pass is before `block-placement`, we don't want to run it again.
This patch is to do the simple early return to optimize the blocks at the last of `block-placement`.

Reviewed By: efriedma

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

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

5 years ago[X86] Match the IR pattern form movmsk on SSE1 only targets where v4i32 isn't legal
Craig Topper [Sat, 10 Aug 2019 07:51:13 +0000 (07:51 +0000)]
[X86] Match the IR pattern form movmsk on SSE1 only targets where v4i32 isn't legal

Summary:
This patch adds a special DAG combine for SSE1 to recognize the IR pattern InstCombine gives us for movmsk. This only does the recognition for a few cases where its obvious the input won't be scalarized resulting in building a vector just do to the movmsk. I've made it separate from our existing matching for movmsk since that's called in multiple places and I didn't spend time to see if the other callers would make sense here. Plus the restrictions and additional checks would complicate that.

This fixes the case from PR42870. Buts its probably still broken the presence of logic ops feeding the movmsk pattern which would further hide the v4f32 type.

Reviewers: spatel, RKSimon, xbolva00

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Improve the diagnostic for larger than 4-bit immediate for vpermil2pd/ps. Only...
Craig Topper [Sat, 10 Aug 2019 04:28:52 +0000 (04:28 +0000)]
[X86] Improve the diagnostic for larger than 4-bit immediate for vpermil2pd/ps. Only allow MCConstantExprs.

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

5 years ago[X86] Fix stack probe issue on windows32.
Luo, Yuanke [Sat, 10 Aug 2019 02:49:02 +0000 (02:49 +0000)]
[X86] Fix stack probe issue on windows32.

Summary:
On windows if the frame size exceed 4096 bytes, compiler need to
generate a call to _alloca_probe. X86CallFrameOptimization pass
changes the reserved stack size and cause of stack probe function
not be inserted. This patch fix the issue by detecting the call
frame size, if the size exceed 4096 bytes, drop X86CallFrameOptimization.

Reviewers: craig.topper, wxiao3, annita.zhang, rnk, RKSimon

Reviewed By: rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[MemDep] allow to select block-scan-limit when constructing MemoryDependenceAnalysis
Fedor Sergeev [Sat, 10 Aug 2019 01:23:38 +0000 (01:23 +0000)]
[MemDep] allow to select block-scan-limit when constructing MemoryDependenceAnalysis

Introducing non-global control for default block-scan-limit in MemDep analysis.
Useful when there are many compilations per initialized LLVM instance (e.g. JIT).

Reviewed By: asbirlea
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65806

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

5 years agocfi-icall: Allow the jump table to be optionally made non-canonical.
Peter Collingbourne [Fri, 9 Aug 2019 22:31:59 +0000 (22:31 +0000)]
cfi-icall: Allow the jump table to be optionally made non-canonical.

The default behavior of Clang's indirect function call checker will replace
the address of each CFI-checked function in the output file's symbol table
with the address of a jump table entry which will pass CFI checks. We refer
to this as making the jump table `canonical`. This property allows code that
was not compiled with ``-fsanitize=cfi-icall`` to take a CFI-valid address
of a function, but it comes with a couple of caveats that are especially
relevant for users of cross-DSO CFI:

- There is a performance and code size overhead associated with each
  exported function, because each such function must have an associated
  jump table entry, which must be emitted even in the common case where the
  function is never address-taken anywhere in the program, and must be used
  even for direct calls between DSOs, in addition to the PLT overhead.

- There is no good way to take a CFI-valid address of a function written in
  assembly or a language not supported by Clang. The reason is that the code
  generator would need to insert a jump table in order to form a CFI-valid
  address for assembly functions, but there is no way in general for the
  code generator to determine the language of the function. This may be
  possible with LTO in the intra-DSO case, but in the cross-DSO case the only
  information available is the function declaration. One possible solution
  is to add a C wrapper for each assembly function, but these wrappers can
  present a significant maintenance burden for heavy users of assembly in
  addition to adding runtime overhead.

For these reasons, we provide the option of making the jump table non-canonical
with the flag ``-fno-sanitize-cfi-canonical-jump-tables``. When the jump
table is made non-canonical, symbol table entries point directly to the
function body. Any instances of a function's address being taken in C will
be replaced with a jump table address.

This scheme does have its own caveats, however. It does end up breaking
function address equality more aggressively than the default behavior,
especially in cross-DSO mode which normally preserves function address
equality entirely.

Furthermore, it is occasionally necessary for code not compiled with
``-fsanitize=cfi-icall`` to take a function address that is valid
for CFI. For example, this is necessary when a function's address
is taken by assembly code and then called by CFI-checking C code. The
``__attribute__((cfi_jump_table_canonical))`` attribute may be used to make
the jump table entry of a specific function canonical so that the external
code will end up taking a address for the function that will pass CFI checks.

Fixes PR41972.

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

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

5 years agoAdd missing REQUIRES to r368487
Daniel Sanders [Fri, 9 Aug 2019 22:16:16 +0000 (22:16 +0000)]
Add missing REQUIRES to r368487

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

5 years ago[Bugpoint redesign] Fix nonlocal URI link in doc
Diego Trevino Ferrer [Fri, 9 Aug 2019 21:48:47 +0000 (21:48 +0000)]
[Bugpoint redesign] Fix nonlocal URI link in doc

Summary: Fixes documentation bot build  http://lab.llvm.org:8011/builders/llvm-sphinx-docs

Reviewers: JDevlieghere

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[DAGCombiner] exclude x*2.0 from normal negation profitability rules
Sanjay Patel [Fri, 9 Aug 2019 21:37:32 +0000 (21:37 +0000)]
[DAGCombiner] exclude x*2.0 from normal negation profitability rules

This is the codegen part of fixing:
https://bugs.llvm.org/show_bug.cgi?id=32939

Even with the optimal/canonical IR that is ideally created by D65954,
we would reverse that transform in DAGCombiner and end up with the same
asm on AArch64 or x86.

I see 2 options for trying to correct this:

  1. Limit isNegatibleForFree() by special-casing the fmul pattern (this patch).
  2. Avoid creating (fmul X, 2.0) in the 1st place by adding a special-case
     transform to SelectionDAG::getNode() and/or SelectionDAGBuilder::visitFMul()
     that matches the transform done by DAGCombiner.

This seems like the less intrusive patch, but if there's some other reason to
prefer 1 option over the other, we can change to the other option.

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

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

5 years agoRemove leftover MF->dump()'s from r368487 that break release builds
Daniel Sanders [Fri, 9 Aug 2019 21:33:31 +0000 (21:33 +0000)]
Remove leftover MF->dump()'s from r368487 that break release builds

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

5 years ago[globalisel] Add G_SEXT_INREG
Daniel Sanders [Fri, 9 Aug 2019 21:11:20 +0000 (21:11 +0000)]
[globalisel] Add G_SEXT_INREG

Summary:
Targets often have instructions that can sign-extend certain cases faster
than the equivalent shift-left/arithmetic-shift-right. Such cases can be
identified by matching a shift-left/shift-right pair but there are some
issues with this in the context of combines. For example, suppose you can
sign-extend 8-bit up to 32-bit with a target extend instruction.
  %1:_(s32) = G_SHL %0:_(s32), i32 24 # (I've inlined the G_CONSTANT for brevity)
  %2:_(s32) = G_ASHR %1:_(s32), i32 24
  %3:_(s32) = G_ASHR %2:_(s32), i32 1
would reasonably combine to:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 25
which no longer matches the special case. If your shifts and extend are
equal cost, this would break even as a pair of shifts but if your shift is
more expensive than the extend then it's cheaper as:
  %2:_(s32) = G_SEXT_INREG %0:_(s32), i32 8
  %3:_(s32) = G_ASHR %2:_(s32), i32 1
It's possible to match the shift-pair in ISel and emit an extend and ashr.
However, this is far from the only way to break this shift pair and make
it hard to match the extends. Another example is that with the right
known-zeros, this:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 24
  %3:_(s32) = G_MUL %2:_(s32), i32 2
can become:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 23

All upstream targets have been configured to lower it to the current
G_SHL,G_ASHR pair but will likely want to make it legal in some cases to
handle their faster cases.

To follow-up: Provide a way to legalize based on the constant. At the
moment, I'm thinking that the best way to achieve this is to provide the
MI in LegalityQuery but that opens the door to breaking core principles
of the legalizer (legality is not context sensitive). That said, it's
worth noting that looking at other instructions and acting on that
information doesn't violate this principle in itself. It's only a
violation if, at the end of legalization, a pass that checks legality
without being able to see the context would say an instruction might not be
legal. That's a fairly subtle distinction so to give a concrete example,
saying %2 in:
  %1 = G_CONSTANT 16
  %2 = G_SEXT_INREG %0, %1
is legal is in violation of that principle if the legality of %2 depends
on %1 being constant and/or being 16. However, legalizing to either:
  %2 = G_SEXT_INREG %0, 16
or:
  %1 = G_CONSTANT 16
  %2:_(s32) = G_SHL %0, %1
  %3:_(s32) = G_ASHR %2, %1
depending on whether %1 is constant and 16 does not violate that principle
since both outputs are genuinely legal.

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

Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, kristof.beyls, javed.absar, hiraditya, jrtc27, atanasyan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

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

5 years agoRemove variable only used in an assert.
Eric Christopher [Fri, 9 Aug 2019 21:02:47 +0000 (21:02 +0000)]
Remove variable only used in an assert.

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

5 years agoRevert the test commit
Taewook Oh [Fri, 9 Aug 2019 20:52:39 +0000 (20:52 +0000)]
Revert the test commit

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

5 years agoTest commit.
Taewook Oh [Fri, 9 Aug 2019 20:48:53 +0000 (20:48 +0000)]
Test commit.

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

5 years ago[X86] Remove custom handling for extloads from LowerLoad.
Craig Topper [Fri, 9 Aug 2019 20:27:22 +0000 (20:27 +0000)]
[X86] Remove custom handling for extloads from LowerLoad.

We don't appear to need this with widening legalization.

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

5 years ago[CodeGen] Require a name for a block addr target
Bill Wendling [Fri, 9 Aug 2019 20:18:30 +0000 (20:18 +0000)]
[CodeGen] Require a name for a block addr target

Summary:
A block address may be used in inline assembly. In which case it
requires a name so that the asm parser has something to parse. Creating
a name for every block address is a large hammer, but is necessary
because at the point when a temp symbol is created we don't necessarily
know if it's used in inline asm. This ensures that it exists regardless.

Reviewers: nickdesaulniers, craig.topper

Subscribers: nathanchance, javed.absar, llvm-commits

Tags: #llvm

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

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

5 years ago[MC] Don't recreate a label if it's already used
Bill Wendling [Fri, 9 Aug 2019 20:16:31 +0000 (20:16 +0000)]
[MC] Don't recreate a label if it's already used

Summary:
This patch keeps track of MCSymbols created for blocks that were
referenced in inline asm. It prevents creating a new symbol which
doesn't refer to the block.

Inline asm may have a reference to a label. The asm parser however
doesn't recognize it as a label and tries to create a new symbol. The
result being that instead of the original symbol (e.g. ".Ltmp0") the
parser replaces it in the inline asm with the new one (e.g. ".Ltmp00")
without updating it in the symbol table. So the machine basic block
retains the "old" symbol (".Ltmp0"), but the inline asm uses the new one
(".Ltmp00").

Reviewers: nickdesaulniers, craig.topper

Subscribers: nathanchance, javed.absar, llvm-commits

Tags: #llvm

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

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

5 years ago[Docs][llvm-strip] Fix an indentation issue.
Michael Pozulp [Fri, 9 Aug 2019 19:41:13 +0000 (19:41 +0000)]
[Docs][llvm-strip] Fix an indentation issue.

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

5 years agogn build: Merge r368432.
Peter Collingbourne [Fri, 9 Aug 2019 19:28:53 +0000 (19:28 +0000)]
gn build: Merge r368432.

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

5 years agogn build: Merge r368439.
Peter Collingbourne [Fri, 9 Aug 2019 19:28:44 +0000 (19:28 +0000)]
gn build: Merge r368439.

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

5 years agogn build: Merge r368402.
Peter Collingbourne [Fri, 9 Aug 2019 19:28:35 +0000 (19:28 +0000)]
gn build: Merge r368402.

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

5 years agogn build: Merge r368392.
Peter Collingbourne [Fri, 9 Aug 2019 19:28:26 +0000 (19:28 +0000)]
gn build: Merge r368392.

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

5 years agogn build: Merge r368358.
Peter Collingbourne [Fri, 9 Aug 2019 19:28:17 +0000 (19:28 +0000)]
gn build: Merge r368358.

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

5 years ago[Docs][llvm-strip] Add help text to llvm-strip rst doc
Michael Pozulp [Fri, 9 Aug 2019 19:10:55 +0000 (19:10 +0000)]
[Docs][llvm-strip] Add help text to llvm-strip rst doc

Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=42383

Reviewers: jhenderson, alexshap, rupprecht

Reviewed By: jhenderson

Subscribers: wolfgangp, jakehehrlich, llvm-commits

Tags: #llvm

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

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

5 years ago[TableGen] Add "InitValue": Handle operands with set bit values in decoder methods
Daniel Sanders [Fri, 9 Aug 2019 17:30:33 +0000 (17:30 +0000)]
[TableGen] Add "InitValue": Handle operands with set bit values in decoder methods

Summary:
The problem:
  When an operand had bits explicitly set to "1" (as in the InitValue.td test case attached), the decoder was ignoring those bits, and the DecoderMethod was receiving an input where the bits were still zero.

The solution:
  We added an "InitValue" variable that stores the initial value of the operand based on what bits were explicitly initialized to 1 in TableGen code. The generated decoder code then uses that initial value to initialize the "tmp" variable, then calls fieldFromInstruction to read the values for the remaining bits that were left unknown in TableGen.

This is mainly useful when there are variations of an instruction that differ based on what bits are set in the operands, since this change makes it possible to access those bits in a DecoderMethod. The DecoderMethod can use those bits to know how to handle the input.

Patch by Nicolas Guillemot

Reviewers: craig.topper, dsanders, fhahn

Reviewed By: dsanders

Subscribers: llvm-commits

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

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

5 years ago[InstCombine] Refactor optimizeExp2() (NFC)
Evandro Menezes [Fri, 9 Aug 2019 17:22:56 +0000 (17:22 +0000)]
[InstCombine] Refactor optimizeExp2() (NFC)

Refactor `LibCallSimplifier::optimizeExp2()` to use the new
`emitBinaryFloatFnCall()` version that fetches the function name from TLI.

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

5 years ago[Transforms] Add a emitBinaryFloatFnCall() version that fetches the function name...
Evandro Menezes [Fri, 9 Aug 2019 17:06:46 +0000 (17:06 +0000)]
[Transforms] Add a emitBinaryFloatFnCall() version that fetches the function name from TLI

Add the counterpart to a similar function for single operands.

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

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

5 years ago[Transforms] Fix comments for hasFloatFn() and getFloatFnName() (NFC)
Evandro Menezes [Fri, 9 Aug 2019 16:59:14 +0000 (16:59 +0000)]
[Transforms] Fix comments for hasFloatFn() and getFloatFnName() (NFC)

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

5 years agoPrint reasonable representations of type names in llvm-nm, readelf and readobj
Sunil Srivastava [Fri, 9 Aug 2019 16:54:51 +0000 (16:54 +0000)]
Print reasonable representations of type names in llvm-nm, readelf and readobj

For type values that do not have proper names, print reasonable representation
in llvm-nm, llvm-readobj and llvm-readelf, matching GNU tools.s

Fixes PR41713.

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

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

5 years agoTitle: Improve Loop Cache Analysis LIT tests.
Whitney Tsang [Fri, 9 Aug 2019 16:18:22 +0000 (16:18 +0000)]
Title: Improve Loop Cache Analysis LIT tests.
Summary: Make LIT tests unsensitive to analysis output order.
Authored By: etiotto

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

5 years ago[Transforms] Rename hasUnaryFloatFn() and getUnaryFloatFn() (NFC)
Evandro Menezes [Fri, 9 Aug 2019 16:04:18 +0000 (16:04 +0000)]
[Transforms] Rename hasUnaryFloatFn() and getUnaryFloatFn() (NFC)

Rename `hasUnaryFloatFn()` to `hasFloatFn()` and `getUnaryFloatFn()` to `getFloatFnName()`.

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

5 years ago[NFC] Added tests for D65898
David Bolvansky [Fri, 9 Aug 2019 15:52:26 +0000 (15:52 +0000)]
[NFC] Added tests for D65898

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

5 years ago[AArch64][x86] add tests for pessimization of expression with X*2.0 (PR32939); NFC
Sanjay Patel [Fri, 9 Aug 2019 14:52:31 +0000 (14:52 +0000)]
[AArch64][x86] add tests for pessimization of expression with X*2.0 (PR32939); NFC

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

5 years ago[DAGCombiner] remove redundant fold for X*1.0; NFC
Sanjay Patel [Fri, 9 Aug 2019 14:30:59 +0000 (14:30 +0000)]
[DAGCombiner] remove redundant fold for X*1.0; NFC

This is handled at node creation time (similar to X/1.0)
after:
rL357029
(no fast-math-flags needed)

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

5 years ago[MachinePipeliner] Avoid indeterminate order in FuncUnitSorter
Jinsong Ji [Fri, 9 Aug 2019 14:10:57 +0000 (14:10 +0000)]
[MachinePipeliner] Avoid indeterminate order in FuncUnitSorter

Summary:
This is exposed by adding a new testcase in PowerPC in
https://reviews.llvm.org/rL367732

The testcase got different output on different platform, hence breaking
buildbots.

The problem is that we get differnt FuncUnitOrder when calculateResMII.

The root cause is:
1. Two MachineInstr might get SAME priority(MFUsx) from minFuncUnits.
2. Current comparison operator() will return `MFUs1 > MFUs2`.
3. We use iterators for MachineInstr, so the input to FuncUnitSorter
   might be different on differnt platform due to the iterator nature.

So for two MI with same MFU, their order is actually depends on the
iterator order, which is platform (implemtation) dependent.

This is risky, and may cause cross-compiling problems.

The fix is to check make sure we assign a determine order when they are
equal.

Reviewers: bcahoon, hfinkel, jmolloy

Subscribers: nemanjai, hiraditya, MaskRay, llvm-commits

Tags: #llvm

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

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

5 years agoTitle: Loop Cache Analysis
Whitney Tsang [Fri, 9 Aug 2019 13:56:29 +0000 (13:56 +0000)]
Title: Loop Cache Analysis
Summary: Implement a new analysis to estimate the number of cache lines
required by a loop nest.
The analysis is largely based on the following paper:

Compiler Optimizations for Improving Data Locality
By: Steve Carr, Katherine S. McKinley, Chau-Wen Tseng
http://www.cs.utexas.edu/users/mckinley/papers/asplos-1994.pdf
The analysis considers temporal reuse (accesses to the same memory
location) and spatial reuse (accesses to memory locations within a cache
line). For simplicity the analysis considers memory accesses in the
innermost loop in a loop nest, and thus determines the number of cache
lines used when the loop L in loop nest LN is placed in the innermost
position.

The result of the analysis can be used to drive several transformations.
As an example, loop interchange could use it determine which loops in a
perfect loop nest should be interchanged to maximize cache reuse.
Similarly, loop distribution could be enhanced to take into
consideration cache reuse between arrays when distributing a loop to
eliminate vectorization inhibiting dependencies.

The general approach taken to estimate the number of cache lines used by
the memory references in the inner loop of a loop nest is:

Partition memory references that exhibit temporal or spatial reuse into
reference groups.
For each loop L in the a loop nest LN: a. Compute the cost of the
reference group b. Compute the 'cache cost' of the loop nest by summing
up the reference groups costs
For further details of the algorithm please refer to the paper.
Authored By: etiotto
Reviewers: hfinkel, Meinersbur, jdoerfert, kbarton, bmahjour, anemet,
fhahn
Reviewed By: Meinersbur
Subscribers: reames, nemanjai, MaskRay, wuzish, Hahnfeld, xusx595,
venkataramanan.kumar.llvm, greened, dmgreen, steleman, fhahn, xblvaOO,
Whitney, mgorny, hiraditya, mgrang, jsji, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D63459

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

5 years ago[X86][SSE] Swap X86ISD::BLENDV inputs with an inverted selection mask (PR42825)
Simon Pilgrim [Fri, 9 Aug 2019 12:44:20 +0000 (12:44 +0000)]
[X86][SSE] Swap X86ISD::BLENDV inputs with an inverted selection mask (PR42825)

As discussed on PR42825, if we are inverting the selection mask we can just swap the inputs and avoid the inversion.

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

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

5 years ago[GlobalOpt] prevent crashing on large integer types (PR42932)
Sanjay Patel [Fri, 9 Aug 2019 12:43:25 +0000 (12:43 +0000)]
[GlobalOpt] prevent crashing on large integer types (PR42932)

This is a minimal fix (copy the predicate for the assert) to
prevent the crashing seen in:
https://bugs.llvm.org/show_bug.cgi?id=42932
...when converting a constant integer of arbitrary width to uint64_t.

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

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