OSDN Git Service

android-x86/external-llvm.git
5 years ago[DebugInfo] Remove redundant argument. [NFC]
Jonas Devlieghere [Mon, 17 Sep 2018 14:23:47 +0000 (14:23 +0000)]
[DebugInfo] Remove redundant argument. [NFC]

Removes the redundant UnitType parameter from verifyUnitContents. I also
fixed  some formatting issues as I was touching the file.

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

5 years ago[ARM] Cleanup ARM CGP isSupportedValue
Sam Parker [Mon, 17 Sep 2018 13:57:39 +0000 (13:57 +0000)]
[ARM] Cleanup ARM CGP isSupportedValue

isSupportedValue explicitly checked and accepted many types of value,
primarily for debugging reasons. Remove most of these checks and do a
bit of refactoring now that the pass is more stable. This also enables
ZExts to be sources, but this has very little practical benefit at the
moment extend instructions will still be introduced.

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

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

5 years agoFix "not all control paths return a value" MSVC warning. NFCI.
Simon Pilgrim [Mon, 17 Sep 2018 13:56:42 +0000 (13:56 +0000)]
Fix "not all control paths return a value" MSVC warning. NFCI.

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

5 years ago[ARM] Disallow icmp with negative imm and overflow
Sam Parker [Mon, 17 Sep 2018 13:48:25 +0000 (13:48 +0000)]
[ARM] Disallow icmp with negative imm and overflow

We allow overflowing instructions if they're decreasing and only used
by an unsigned compare. Add the extra condition that the icmp cannot
be using a negative immediate.

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

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

5 years agoFix vectorization of canonicalize
Matt Arsenault [Mon, 17 Sep 2018 13:24:30 +0000 (13:24 +0000)]
Fix vectorization of canonicalize

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

5 years ago[GVNHoist] Re-enable GVNHoist by default
Alexandros Lamprineas [Mon, 17 Sep 2018 12:24:55 +0000 (12:24 +0000)]
[GVNHoist] Re-enable GVNHoist by default

Rebase rL341954 since https://bugs.llvm.org/show_bug.cgi?id=38912
has been fixed by rL342055.

Precommit testing performed:
* Overnight runs of csmith comparing the output between programs
  compiled with gvn-hoist enabled/disabled.
* Bootstrap builds of clang with UbSan/ASan configurations.

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

5 years agoUse createTemporaryFile in SampleProfTest
Alexander Kornienko [Mon, 17 Sep 2018 12:11:01 +0000 (12:11 +0000)]
Use createTemporaryFile in SampleProfTest

Create a temporary file in the system temporary directory instead of creating a
file in the current directory, which may be not writable. (Fix for an issue
introduced in r342283.)

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

5 years ago[llvm-exegesis] Add predefined floating point values so we can test impact of special...
Guillaume Chatelet [Mon, 17 Sep 2018 11:09:32 +0000 (11:09 +0000)]
[llvm-exegesis] Add predefined floating point values so we can test impact of special values on latency.

Summary: This will be useful to generate many configurations and test instruction regimes (NaN, Inf, subnormal, normal).

Reviewers: courbet

Subscribers: mgorny, tschuett, llvm-commits

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

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

5 years ago[PowerPC] Fix label address calculation for ppc64
Strahinja Petrovic [Mon, 17 Sep 2018 11:03:40 +0000 (11:03 +0000)]
[PowerPC] Fix label address calculation for ppc64

This patch fixes calculating address of label for non-pic ppc64.

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

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

5 years agoReland r342233: [ThinLTO] Allow setting of maximum cache size with 64-bit number
James Henderson [Mon, 17 Sep 2018 10:21:26 +0000 (10:21 +0000)]
Reland r342233: [ThinLTO] Allow setting of maximum cache size with 64-bit number

The original was reverted due to an apparent build-bot test failure,
but it looks like this is just a flaky test.

Also added a C-interface function for large values, and updated
llvm-lto's --thinlto-cache-max-size-bytes switch to take a type larger
than int.

The maximum cache size in terms of bytes is a 64-bit number. However,
the methods to set it only took unsigned previously, which meant that
the maximum cache size could not be specified above 4GB. That's quite
small compared to the output of some projects, so it makes sense to
provide the ability to set larger values in that field.

We also needed a C-interface function that provides a greater range
than the existing thinlto_codegen_set_cache_size_bytes, which also only
takes an unsigned, so this change also adds
hinlto_codegen_set_cache_size_megabytes.

Reviewed by: mehdi_amini, tejohnson, steven_wu

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

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

5 years ago[llvm-objcopy] Add missing alias for --strip-all-gnu
Alexander Shaposhnikov [Mon, 17 Sep 2018 09:45:12 +0000 (09:45 +0000)]
[llvm-objcopy] Add missing alias for --strip-all-gnu

This diff adds -S as an alias for --strip-all-gnu
(for compatibility with binutils' objcopy).

Patch by Dmitry Golovin!

Test plan: make check-all

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

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

5 years ago[NFC] Turn unsigned counters into boolean flags
Max Kazantsev [Mon, 17 Sep 2018 06:33:29 +0000 (06:33 +0000)]
[NFC] Turn unsigned counters into boolean flags

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

5 years ago[DebugInfo] Fix build when std::vector::iterator is a pointer
Kristina Brooks [Sun, 16 Sep 2018 22:21:59 +0000 (22:21 +0000)]
[DebugInfo] Fix build when std::vector::iterator is a pointer

std::vector::iterator type may be a pointer, then
iterator::value_type fails to compile since iterator is not a class,
namespace, or enumeration.

Patch by orivej (Orivej Desh)

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

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

5 years ago[X86][SSE] Always enable ISD::SRL -> ISD::MULHU for v8i16
Simon Pilgrim [Sun, 16 Sep 2018 20:28:38 +0000 (20:28 +0000)]
[X86][SSE] Always enable ISD::SRL -> ISD::MULHU for v8i16

For constant non-uniform cases we'll never introduce more and/andn/or selects than already occur in generic pre-SSE41 ISD::SRL lowering.

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

5 years ago[X86][AVX] Enable ISD::SRL -> ISD::MULHU for v16i16
Simon Pilgrim [Sun, 16 Sep 2018 19:20:47 +0000 (19:20 +0000)]
[X86][AVX] Enable ISD::SRL -> ISD::MULHU for v16i16

Now that rL340913 has landed with improved v16i16 selects as shuffles.

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

5 years ago[DAGCombiner] try to convert pow(x, 1/3) to cbrt(x)
Sanjay Patel [Sun, 16 Sep 2018 16:50:26 +0000 (16:50 +0000)]
[DAGCombiner] try to convert pow(x, 1/3) to cbrt(x)

This is a follow-up suggested in D51630 and originally proposed as an IR transform in D49040.

Copying the motivational statement by @evandro from that patch:
"This transformation helps some benchmarks in SPEC CPU2000 and CPU2006, such as 188.ammp,
447.dealII, 453.povray, and especially 300.twolf, as well as some proprietary benchmarks.
Otherwise, no regressions on x86-64 or A64."

I'm proposing to add only the minimum support for a DAG node here. Since we don't have an
LLVM IR intrinsic for cbrt, and there are no other DAG ways to create a FCBRT node yet, I
don't think we need to worry about DAG builder, legalization, a strict variant, etc. We
should be able to expand as needed when adding more functionality/transforms. For reference,
these are transform suggestions currently listed in SimplifyLibCalls.cpp:

//   * cbrt(expN(X))  -> expN(x/3)
//   * cbrt(sqrt(x))  -> pow(x,1/6)
//   * cbrt(cbrt(x))  -> pow(x,1/9)

Also, given that we bail out on long double for now, there should not be any logical
differences between platforms (unless there's some platform out there that has pow()
but not cbrt()).

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

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

5 years ago[x86] fix uses check in broadcast transform (PR38949)
Sanjay Patel [Sun, 16 Sep 2018 15:41:56 +0000 (15:41 +0000)]
[x86] fix uses check in broadcast transform (PR38949)

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

It's not clear to me that we even need a one-use check in this fold.
Ie, 2 independent loads might be better than a load+dependent shuffle.

Note that the existing re-use tests are not affected. We actually do form a
broadcast node in those tests now because there's no extra use of the
insert_subvector node in those cases. But something later in isel pattern
matching decides that it is not worth using a broadcast for the full load in
those tests:

Legalized selection DAG: %bb.0 'test_broadcast_2f64_4f64_reuse:'
  t7: v2f64,ch = load<(load 16 from %ir.p0)> t0, t2, undef:i64
      t4: i64,ch = CopyFromReg t0, Register:i64 %1
    t10: ch = store<(store 16 into %ir.p1)> t7:1, t7, t4, undef:i64
      t18: v4f64 = insert_subvector undef:v4f64, t7, Constant:i64<0>
    t20: v4f64 = insert_subvector t18, t7, Constant:i64<2>

Becomes:
  t7: v2f64,ch = load<(load 16 from %ir.p0)> t0, t2, undef:i64
      t4: i64,ch = CopyFromReg t0, Register:i64 %1
    t10: ch = store<(store 16 into %ir.p1)> t7:1, t7, t4, undef:i64
    t21: v4f64 = X86ISD::SUBV_BROADCAST t7

ISEL: Starting selection on root node: t21: v4f64 = X86ISD::SUBV_BROADCAST t7
...
  Created node: t27: v4f64 = INSERT_SUBREG IMPLICIT_DEF:v4f64, t7, TargetConstant:i32<7>
  Morphed node: t21: v4f64 = VINSERTF128rr t27, t7, TargetConstant:i8<1>

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

5 years ago[x86] add failure to splat test (PR38949); NFC
Sanjay Patel [Sun, 16 Sep 2018 14:59:04 +0000 (14:59 +0000)]
[x86] add failure to splat test (PR38949); NFC

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

5 years ago[NFC][InstCombine] One more test pattern for comparisons with low-bit-mask.
Roman Lebedev [Sun, 16 Sep 2018 12:51:09 +0000 (12:51 +0000)]
[NFC][InstCombine] One more test pattern for comparisons with low-bit-mask.

https://rise4fun.com/Alive/UGzE <- non-canonical, but has extra uses.

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

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

5 years agoFix -Wdangling-else gcc warning. NFCI.
Simon Pilgrim [Sun, 16 Sep 2018 12:30:41 +0000 (12:30 +0000)]
Fix -Wdangling-else gcc warning. NFCI.

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

5 years ago[NFC][InstCombine] Some more tests for comparisons with low-bit-mask.
Roman Lebedev [Sun, 16 Sep 2018 08:05:06 +0000 (08:05 +0000)]
[NFC][InstCombine] Some more tests for comparisons with low-bit-mask.

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

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

5 years ago[llvm-readobj] Make some commonly used short options visibile in -help
Fangrui Song [Sat, 15 Sep 2018 21:27:46 +0000 (21:27 +0000)]
[llvm-readobj] Make some commonly used short options visibile in -help

For people who use llvm-readelf as a replacement of GNU readelf, they would like to see -d -r ... listed in llvm-readelf -help. It also helps understanding the confusing -s (which is unfortunately different in semantics).

Reviewers: phosek, ruiu, echristo

Reviewed By: ruiu, echristo

Subscribers: llvm-commits

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

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

5 years agoRevert r342148 (and follow-on fix attempts r342154, r342180, r342182, r342193)
Nico Weber [Sat, 15 Sep 2018 19:04:27 +0000 (19:04 +0000)]
Revert r342148 (and follow-on fix attempts r342154, r342180, r342182, r342193)

Many bots buildling with make have been broken for several days, e.g.
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13

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

5 years ago[InstCombine] Support (sub (sext x), (sext y)) --> (sext (sub x, y)) and (sub (zext...
Craig Topper [Sat, 15 Sep 2018 18:54:10 +0000 (18:54 +0000)]
[InstCombine] Support (sub (sext x), (sext y)) --> (sext (sub x, y)) and (sub (zext x), (zext y)) --> (zext (sub x, y))

Summary:
If the sub doesn't overflow in the original type we can move it above the sext/zext.

This is similar to what we do for add. The overflow checking for sub is currently weaker than add, so the test cases are constructed for what is supported.

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

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

5 years agoGive InfoStreamBuilder an opt-in method to write a hash of the PDB as GUID.
Nico Weber [Sat, 15 Sep 2018 18:35:51 +0000 (18:35 +0000)]
Give InfoStreamBuilder an opt-in method to write a hash of the PDB as GUID.

Naively computing the hash after the PDB data has been generated is in practice
as fast as other approaches I tried. I also tried online-computing the hash as
parts of the PDB were written out (https://reviews.llvm.org/D51887; that's also
where all the measuring data is) and computing the hash in parallel
(https://reviews.llvm.org/D51957). This approach here is simplest, without
being slower.

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

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

5 years agoUpdate microsoftDemangle() to work more like itaniumDemangle().
Nico Weber [Sat, 15 Sep 2018 18:24:20 +0000 (18:24 +0000)]
Update microsoftDemangle() to work more like itaniumDemangle().

* Use same method of initializing the output stream and its buffer
* Allow a nullptr Status pointer
* Don't print the mangled name on demangling error
* Write to N (if it is non-nullptr)

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

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

5 years ago[X86][SSE] Fix insertps load combine test name
Simon Pilgrim [Sat, 15 Sep 2018 16:57:04 +0000 (16:57 +0000)]
[X86][SSE] Fix insertps load combine test name

The existing test was called extract_lane_insertps_5123 but it was in fact doing a <6,1,2,3> shuffle. I've fixed the name and added the <5,1,2,3> test case as well.

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

5 years ago[X86] Remove an fp->int->fp domain crossing in LowerUINT_TO_FP_i64.
Craig Topper [Sat, 15 Sep 2018 16:23:35 +0000 (16:23 +0000)]
[X86] Remove an fp->int->fp domain crossing in LowerUINT_TO_FP_i64.

Summary: This unfortunately adds a move, but isn't that better than going to the int domain and back?

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

5 years ago[X86] Fold (movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C))
Craig Topper [Sat, 15 Sep 2018 16:23:33 +0000 (16:23 +0000)]
[X86] Fold (movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C))

Summary:
MOVMSK only care about the sign bit so we don't need the setcc to fill the whole element with 0s/1s. We can just shift the bit we're looking for into the sign bit. This saves a constant pool load.

Inspired by PR38840.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: lebedev.ri, llvm-commits

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

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

5 years ago[NFC] minor cleanup in PassManagerInternal.h
Fedor Sergeev [Sat, 15 Sep 2018 14:56:12 +0000 (14:56 +0000)]
[NFC] minor cleanup in PassManagerInternal.h

A few changes found necessary for upcoming PassInstrumentation patch:
  - name() methods made const
  - properly forward arguments in AnalysisPassModel::run

Separated out of the main D47858 patch.

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

5 years ago[InstCombine][x86] try harder to convert blendv intrinsic to generic IR (PR38814)
Sanjay Patel [Sat, 15 Sep 2018 14:25:44 +0000 (14:25 +0000)]
[InstCombine][x86] try harder to convert blendv intrinsic to generic IR (PR38814)

Missing optimizations with blendv are shown in:
https://bugs.llvm.org/show_bug.cgi?id=38814

If this works, it's an easier and more powerful solution than adding pattern matching
for a few special cases in the backend. The potential danger with this transform in IR
is that the condition value can get separated from the select, and the backend might
not be able to make a blendv out of it again. I don't think that's too likely, but
I've kept this patch minimal with a 'TODO', so we can test that theory in the wild
before expanding the transform.

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

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

5 years agoFix line endings. NFCI.
Simon Pilgrim [Sat, 15 Sep 2018 14:20:53 +0000 (14:20 +0000)]
Fix line endings. NFCI.

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

5 years ago[InstCombine] Inefficient pattern for high-bits checking 3 (PR38708)
Roman Lebedev [Sat, 15 Sep 2018 12:04:13 +0000 (12:04 +0000)]
[InstCombine] Inefficient pattern for high-bits checking 3 (PR38708)

Summary:
It is sometimes important to check that some newly-computed value
is non-negative and only n bits wide (where n is a variable.)
There are many ways to check that:
https://godbolt.org/z/o4RB8D
The last variant seems best?
(I'm sure there are some other variations i haven't thought of..)

The last (as far i know?) pattern, non-canonical due to the extra use.
https://godbolt.org/z/aCMsPk
https://rise4fun.com/Alive/I6f

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

Reviewers: spatel, craig.topper, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

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

5 years ago[CodeGenPrepare] Preserve debug locs in OptimizeExtractBits
Vedant Kumar [Sat, 15 Sep 2018 04:08:52 +0000 (04:08 +0000)]
[CodeGenPrepare] Preserve debug locs in OptimizeExtractBits

CodeGenPrepare has a transform that sinks {lshr, trunc} pairs to make it
easier for the backend to emit fancy extract-bits instructions (e.g UBFX).

Teach it to preserve debug locations and salvage debug values.

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

5 years ago[WebAssembly][NFC] Generalize operand numbers in SIMD tests
Thomas Lively [Sat, 15 Sep 2018 01:12:48 +0000 (01:12 +0000)]
[WebAssembly][NFC] Generalize operand numbers in SIMD tests

Reviewers: aheejin, dschuff

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

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

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

5 years ago[WebAssembly] SIMD shifts
Thomas Lively [Sat, 15 Sep 2018 00:45:31 +0000 (00:45 +0000)]
[WebAssembly] SIMD shifts

Summary:
Implement shifts of vectors by i32. Since LLVM defines shifts as
binary operations between two vectors, this involves pattern matching
on splatted shift operands. For v2i64 shifts any i32 shift operands
have to be zero extended in the input and any i64 shift operands have
to be wrapped in the output. Depends on D52007.

Reviewers: aheejin, dschuff

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

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

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

5 years agoFix filesystem race issue in SampleProfTest introduced in rL342283.
Wei Mi [Sat, 15 Sep 2018 00:04:15 +0000 (00:04 +0000)]
Fix filesystem race issue in SampleProfTest introduced in rL342283.

Before this fix, multiple invocations of testRoundTrip will create multiple
writers which share the same file as output destination. That could introduce
filesystem race issue when multiple subtests are executed concurrently. This
patch assign writers with different files as their output destinations.

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

5 years ago[WebAssembly] SIMD neg
Thomas Lively [Fri, 14 Sep 2018 22:35:12 +0000 (22:35 +0000)]
[WebAssembly] SIMD neg

Summary: Depends on D52007.

Reviewers: aheejin, dschuff

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

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

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

5 years ago[PDB] Make the pretty dumper output modified types.
Zachary Turner [Fri, 14 Sep 2018 22:29:19 +0000 (22:29 +0000)]
[PDB] Make the pretty dumper output modified types.

Currently if we got something like `const Foo` we'd ignore it and
just rely on printing the unmodified `Foo` later on.  However,
for testing the native reading code we really would like to be able
to see these so that we can verify that the native reader can
actually handle them.  Instead of printing out the full type though,
just print out the header.

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

5 years ago[BreakFalseDeps] Fix bad formatting. NFC
Craig Topper [Fri, 14 Sep 2018 22:26:09 +0000 (22:26 +0000)]
[BreakFalseDeps] Fix bad formatting. NFC

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

5 years ago[InstCombine] refactor mul narrowing folds; NFCI
Sanjay Patel [Fri, 14 Sep 2018 22:23:35 +0000 (22:23 +0000)]
[InstCombine] refactor mul narrowing folds; NFCI

Similar to rL342278:
The test diffs are all cosmetic due to the change in
value naming, but I'm including that to show that the
new code does perform these folds rather than something
else in instcombine.

D52075 should be able to use this code too rather than
duplicating all of the logic.

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

5 years agoAttempt to unbreak the build after r342286.
Adrian Prantl [Fri, 14 Sep 2018 21:43:45 +0000 (21:43 +0000)]
Attempt to unbreak the build after r342286.

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

5 years ago[InstCombine] add/use overflowing math helper functions; NFC
Sanjay Patel [Fri, 14 Sep 2018 21:30:07 +0000 (21:30 +0000)]
[InstCombine] add/use overflowing math helper functions; NFC

The mul case can already be refactored to use this similar to
rL342278.
The sub case is proposed in D52075.

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

5 years ago[PowerPC] Fix the calling convention for i1 arguments on PPC32
Lion Yang [Fri, 14 Sep 2018 21:26:05 +0000 (21:26 +0000)]
[PowerPC] Fix the calling convention for i1 arguments on PPC32

Summary:
Integer types smaller than i32 must be extended to i32 by default.
The feature "crbits" introduced at r202451 handles i1 as a special case,
but it did not extend properly.
The caller was, therefore, passing i1 stack arguments by writing 0/1 to
the first byte of the 4-byte stack object and callee was
reading the first byte for the value.

"crbits" is enabled if the optimization level is greater than 1,
which is very common in "release builds".
Such discrepancies with ABI specification also introduces
potential incompatibility with programs or libraries
built with other compilers e.g. GCC.

Fixes PR38661

Reviewers: hfinkel, cuviper

Subscribers: sylvestre.ledru, glaubitz, nagisa, nemanjai, kbarton, llvm-commits

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

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

5 years ago[WebAssembly][NFC] Move SIMD encoding tests to dedicated file
Thomas Lively [Fri, 14 Sep 2018 21:21:42 +0000 (21:21 +0000)]
[WebAssembly][NFC] Move SIMD encoding tests to dedicated file

Summary:
This change makes the tests more focused and avoids problematic
interactions between the testing modes and instruction encoding. This
change also allows the other tests to use less verbose output and
stricter checks.

Reviewers: aheejin, dschuff, aardappel

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

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

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

5 years agoAdd missing include.
Zachary Turner [Fri, 14 Sep 2018 21:19:52 +0000 (21:19 +0000)]
Add missing include.

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

5 years ago[codeview] Remove dead code
Reid Kleckner [Fri, 14 Sep 2018 21:14:08 +0000 (21:14 +0000)]
[codeview] Remove dead code

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

5 years ago[PDB] Refactor a little of the Symbol creation code.
Zachary Turner [Fri, 14 Sep 2018 21:03:57 +0000 (21:03 +0000)]
[PDB] Refactor a little of the Symbol creation code.

Eventually we need to be able to support nested types, which don't
have an associated CVType record.  To handle this, remove the
CVType from all of the record classes, and instead store the
deserialized record.  Then move the deserialization up to the thing
that creates the type.  This actually makes error handling better
anyway as we can return an invalid symbol instead of asserting false.

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

5 years ago[SampleFDO] Add FunctionOffsetTable in compact binary format profile.
Wei Mi [Fri, 14 Sep 2018 20:52:59 +0000 (20:52 +0000)]
[SampleFDO] Add FunctionOffsetTable in compact binary format profile.

The patch saves a function offset table which maps function name index to the
offset of its function profile to the start of the binary profile. By using
the function offset table, for those function profiles which will not be used
when compiling a module, the profile reader does't have to read them. For
profile size around 10~20M, it saves ~10% compile time.

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

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

5 years agotest/Other/can-execute.txt: delete %t after the test
Fangrui Song [Fri, 14 Sep 2018 20:41:42 +0000 (20:41 +0000)]
test/Other/can-execute.txt: delete %t after the test

This test constructs a non-readable file of mode 0111, which lingers in the test output directory and will cause EACCES to various tools (rg, rsync, ...)

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

5 years ago[InstCombine] refactor add narrowing folds; NFCI
Sanjay Patel [Fri, 14 Sep 2018 20:40:46 +0000 (20:40 +0000)]
[InstCombine] refactor add narrowing folds; NFCI

The test diffs are all cosmetic due to the change in
value naming, but I'm including that to show that the
new code does perform these folds rather than something
else in instcombine.

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

5 years agoHotColdSplit: fix invalid SSA due to outlining
Sebastian Pop [Fri, 14 Sep 2018 20:36:19 +0000 (20:36 +0000)]
HotColdSplit: fix invalid SSA due to outlining

The test used to fail with an invalid phi node: the two predecessors were outlined
and the SSA representation was left invalid. The patch adds the exit block to the
cold region.

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

5 years agoHotColdSplit: fix isSingleEntrySingleExit
Sebastian Pop [Fri, 14 Sep 2018 20:36:14 +0000 (20:36 +0000)]
HotColdSplit: fix isSingleEntrySingleExit

remove duplicate entries from isSingleEntrySingleExit: the Entry block is
already added by the loop over the dominance frontier.

Remove the heuristic from isOutlineCandidate that a region is too small when it
only contains a basic block. With this change we now grow regions starting from
a block and we continue adding to the ValidColdRegion. Check the heuristic just
before code generation.

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

5 years agoHotColdSplit: add back propagation to extend cold regions
Sebastian Pop [Fri, 14 Sep 2018 20:36:10 +0000 (20:36 +0000)]
HotColdSplit: add back propagation to extend cold regions

Also fix a problem in forward propagation:
  const TerminatorInst *TI = It->getTerminator();
was set outside the while loop that iterates over It.

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

5 years ago[InstCombine] add more tests for add narrowing folds; NFC
Sanjay Patel [Fri, 14 Sep 2018 20:33:40 +0000 (20:33 +0000)]
[InstCombine] add more tests for add narrowing folds; NFC

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

5 years ago[WebAssembly][NFC] Fix unconventional test names
Thomas Lively [Fri, 14 Sep 2018 20:22:45 +0000 (20:22 +0000)]
[WebAssembly][NFC] Fix unconventional test names

Reviewers: aheejin, dschuff

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

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

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

5 years agoRemove unused DIASession field
Reid Kleckner [Fri, 14 Sep 2018 20:16:31 +0000 (20:16 +0000)]
Remove unused DIASession field

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

5 years agoAMDGPU: Clear the bits before they are being set in program resource registers
Konstantin Zhuravlyov [Fri, 14 Sep 2018 20:00:36 +0000 (20:00 +0000)]
AMDGPU: Clear the bits before they are being set in program resource registers

Change by Tony Tye

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

5 years agoFix lit/example/many-tests pickling issue
Alex Langford [Fri, 14 Sep 2018 19:44:09 +0000 (19:44 +0000)]
Fix lit/example/many-tests pickling issue

Summary:
The multiprocess module uses pickling to transfer
information between processes and does not know how to pickle
the class created in the lit.cfg file and thus the example
fails.

Implement ManyTests in a separate file and import for the
example test passes

Patch by Nathan Lanza <nathan@lanza.io>

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

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

5 years agoTest commit access
Lion Yang [Fri, 14 Sep 2018 19:43:11 +0000 (19:43 +0000)]
Test commit access

Remove trailing spaces

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

5 years agoRevert r342183 "[DAGCombine] Fix crash when store merging created an extract_subvecto...
Reid Kleckner [Fri, 14 Sep 2018 19:39:40 +0000 (19:39 +0000)]
Revert r342183 "[DAGCombine] Fix crash when store merging created an extract_subvector with invalid index."

Causes 'isVector() && "Invalid vector type!"' assertion when building
Skia in Chrome.

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

5 years agoFix debug info for SelectionDAG legalization of DAG nodes with two results.
Adrian Prantl [Fri, 14 Sep 2018 19:38:45 +0000 (19:38 +0000)]
Fix debug info for SelectionDAG legalization of DAG nodes with two results.

This patch fixes the debug info handling for SelectionDAG legalization
of DAG nodes with two results. When an replaced SDNode has more than
one result, transferDbgValues was always copying the SDDbgValue from
the first result and attaching them to all members. In reality
SelectionDAG::ReplaceAllUsesWith() is given an array of SDNodes
(though the type signature doesn't make this obvious (cf. the call
site code in ReplaceNode()).

rdar://problem/44162227

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

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

5 years ago[ThinLTOCodeGenerator] Avoid Rehash StringMap in ThreadPool
Steven Wu [Fri, 14 Sep 2018 19:38:21 +0000 (19:38 +0000)]
[ThinLTOCodeGenerator] Avoid Rehash StringMap in ThreadPool

Summary:
During threaded thinLTO, it is possible that the entry for current
module doesn't exist in StringMaps (like ExportLists, ResolvedODR,
etc.). Using operator[] might trigger a rehash for the StringMap, which
might happen on multiple threads at the same time.

rdar://problem/43846199

Reviewers: tejohnson, mehdi_amini, kromanova, pcc

Reviewed By: tejohnson

Subscribers: dang, inglorion, eraman, dexonsmith, llvm-commits

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

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

5 years agoRevert r342210 "[ARM] bottom-top mul support in ARMParallelDSP"
Reid Kleckner [Fri, 14 Sep 2018 18:44:37 +0000 (18:44 +0000)]
Revert r342210 "[ARM] bottom-top mul support in ARMParallelDSP"

It causes assertion failures while building Skia for Android in
Chromium:
https://ci.chromium.org/buildbot/chromium.clang/ToTAndroid/4550

Reduction forthcoming.

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

5 years agoRevert a line-endings change that somehow got included with rL342257
Simon Pilgrim [Fri, 14 Sep 2018 18:35:21 +0000 (18:35 +0000)]
Revert a line-endings change that somehow got included with rL342257

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

5 years ago[X86][SSE] Lower shuffles to permute(unpack(x,y)) (PR31151)
Simon Pilgrim [Fri, 14 Sep 2018 18:33:31 +0000 (18:33 +0000)]
[X86][SSE] Lower shuffles to permute(unpack(x,y)) (PR31151)

Attempt to lower a shuffle as an unpack of elements from two inputs followed by a single-input (wider) permutation.

As long as the permutation is wider this is a win - there may be some circumstances where same size permutations would also be useful but I've left that for future work.

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

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

5 years ago[X86] Re-generate test checks using current version of the script. NFC
Craig Topper [Fri, 14 Sep 2018 18:27:09 +0000 (18:27 +0000)]
[X86] Re-generate test checks using current version of the script. NFC

The regular expression used for stack accesses is different today.

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

5 years ago[InstCombine] rename test file to better describe the fold; NFC
Sanjay Patel [Fri, 14 Sep 2018 18:12:30 +0000 (18:12 +0000)]
[InstCombine] rename test file to better describe the fold; NFC

The folds are not limited to zext, and the real goal is width
reduction of a math op. D52075 is proposing to extend this to
subtracts.

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

5 years ago[InstCombine] remove unnecessary target constraints for tests; NFC
Sanjay Patel [Fri, 14 Sep 2018 18:06:36 +0000 (18:06 +0000)]
[InstCombine] remove unnecessary target constraints for tests; NFC

These are universal folds.

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

5 years ago[InstCombine] move test next to related tests; NFC
Sanjay Patel [Fri, 14 Sep 2018 18:05:14 +0000 (18:05 +0000)]
[InstCombine] move test next to related tests; NFC

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

5 years ago[InstCombine] remove stall comment from test file; NFC
Sanjay Patel [Fri, 14 Sep 2018 18:02:17 +0000 (18:02 +0000)]
[InstCombine] remove stall comment from test file; NFC

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

5 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Fri, 14 Sep 2018 17:53:44 +0000 (17:53 +0000)]
[InstCombine] regenerate test checks; NFC

There was a bug in a check line regex that could cause the test to fail
with a naming difference. The auto-gen script seems to work as expected now.

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

5 years agoIntroduce explicit add_unittest_with_input_files target for tests that use llvm:...
Nico Weber [Fri, 14 Sep 2018 17:34:46 +0000 (17:34 +0000)]
Introduce explicit add_unittest_with_input_files target for tests that use llvm::getInputFileDirectory()

Using llvm::getInputFileDirectory() in unit tests is discouraged, so require an explicit opt-in.
This way, cmake also writes ~60 fewer unused files to disk.

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

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

5 years agofix noasserts build
Adrian Prantl [Fri, 14 Sep 2018 17:32:52 +0000 (17:32 +0000)]
fix noasserts build

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

5 years agoSelectionDAG: Add compact SDDbgValue representation to -dag-dump-verbose output
Adrian Prantl [Fri, 14 Sep 2018 17:08:02 +0000 (17:08 +0000)]
SelectionDAG: Add compact SDDbgValue representation to -dag-dump-verbose output

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

5 years agoRevert r342233.
James Henderson [Fri, 14 Sep 2018 16:48:47 +0000 (16:48 +0000)]
Revert r342233.

This caused LLD test failures, which I've been unable to reproduce.

Reverting to allow for further investigation next week.

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

5 years agofix typos
Adrian Prantl [Fri, 14 Sep 2018 16:12:14 +0000 (16:12 +0000)]
fix typos

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

5 years ago[InstCombine] add more tests for x86 blendv (PR38814); NFC
Sanjay Patel [Fri, 14 Sep 2018 13:47:33 +0000 (13:47 +0000)]
[InstCombine] add more tests for x86 blendv (PR38814); NFC

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

5 years ago[X86][BMI1] Fix BLSI/BLSMSK/BLSR BMI1 scheduling on btver2
Simon Pilgrim [Fri, 14 Sep 2018 13:31:14 +0000 (13:31 +0000)]
[X86][BMI1] Fix BLSI/BLSMSK/BLSR BMI1 scheduling on btver2

These have the same behaviour as tzcnt on btver2 - confirmed with AMD 16h SOG, Agner and instlatx64.

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

5 years ago[X86][BMI1] Add scheduler class for BLSI/BLSMSK/BLSR BMI1 instructions
Simon Pilgrim [Fri, 14 Sep 2018 13:09:56 +0000 (13:09 +0000)]
[X86][BMI1] Add scheduler class for BLSI/BLSMSK/BLSR BMI1 instructions

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

5 years ago[ThinLTO]Allow setting of maximum cache size with 64-bit number
James Henderson [Fri, 14 Sep 2018 12:51:19 +0000 (12:51 +0000)]
[ThinLTO]Allow setting of maximum cache size with 64-bit number

Also added a C-interface function for large values, and updated
llvm-lto's --thinlto-cache-max-size-bytes switch to take a type larger
than int.

The maximum cache size in terms of bytes is a 64-bit number. However,
the methods to set it only took unsigned previously, which meant that
the maximum cache size could not be specified above 4GB. That's quite
small compared to the output of some projects, so it makes sense to
provide the ability to set larger values in that field.

We also needed a C-interface function that provides a greater range
than the existing thinlto_codegen_set_cache_size_bytes, which also only
takes an unsigned, so this change also adds
hinlto_codegen_set_cache_size_megabytes.

Reviewed by: mehdi_amini, tejohnson, steven_wu

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

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

5 years ago[AMDGPU] Ensure trig range reduction only used for subtargets that require it
David Stuttard [Fri, 14 Sep 2018 10:27:19 +0000 (10:27 +0000)]
[AMDGPU] Ensure trig range reduction only used for subtargets that require it

Summary:
GFX9 and above support sin/cos instructions with a greater range and thus don't
require a fract instruction prior to invocation.

Added a subtarget feature to reflect this and added code to take advantage of
expanded range on GFX9+

Also updated the tests to check correct behaviour

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits

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

Change-Id: I1c1f1d3726a5ae32116646ca5cfa1ab4ef69e5b0

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

5 years ago[DWARF] reposting r342048, which was reverted in r342056 due to buildbot
Wolfgang Pieb [Fri, 14 Sep 2018 09:14:10 +0000 (09:14 +0000)]
[DWARF] reposting r342048, which was reverted in r342056 due to buildbot
errors.
Adjusted 2 test cases for ARM and darwin and fixed a bug with the original
change in dsymutil.

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

5 years ago[ARM] bottom-top mul support in ARMParallelDSP
Sam Parker [Fri, 14 Sep 2018 08:09:09 +0000 (08:09 +0000)]
[ARM] bottom-top mul support in ARMParallelDSP

On failing to find sequences that can be converted into dual macs,
try to find sequential 16-bit loads that are used by muls which we
can then use smultb, smulbt, smultt with a wide load.

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

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

5 years ago[LoopInterchange] Preserve ScalarEvolution, by forgetting about interchanged loops.
Florian Hahn [Fri, 14 Sep 2018 07:50:20 +0000 (07:50 +0000)]
[LoopInterchange] Preserve ScalarEvolution, by forgetting about interchanged loops.

As preparation for LoopInterchange becoming a loop pass, it needs to
preserve ScalarEvolution. Even though interchanging should not change
the trip count of the loop, it modifies loop entry, latch and exit
blocks.

I added -verify-scev to some loop interchange tests, but the verification does
not catch problems caused by missing invalidation of SE in loop interchange, as
the trip counts themselves do not change. So there might be potential to
make the SE verification covering more stuff in the future.

Reviewers: mkazantsev, efriedma, karthikthecool

Reviewed By: efriedma

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

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

5 years ago[SystemZ] Adjust cost functions for subtargets that use LI + LOC instead of IPM
Jonas Paulsson [Fri, 14 Sep 2018 06:46:55 +0000 (06:46 +0000)]
[SystemZ] Adjust cost functions for subtargets that use LI + LOC instead of IPM

After recent improvements which makes better use of LOC instead of IPM, the
TTI cost functions also needs to be updated to reflect this.

This involves sext, zext and xor of i1.

The tests were updated so that for z13 the new costs are expected, while the
old costs are still checked for on zEC12.

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

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

5 years ago[Support] Treat null bytes as separator in windows command line strings
Martin Storsjo [Fri, 14 Sep 2018 06:08:01 +0000 (06:08 +0000)]
[Support] Treat null bytes as separator in windows command line strings

When reading directives from a .drectve section, the directives are
tokenized as a normal windows command line. However in these cases,
link.exe allows the directives to be separated by null bytes, not only by
spaces.

A test case for this change will be added in the lld repo.

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

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

5 years ago[InstCombine] Add some test cases for (add (sext x), (sext y)) --> (sext (add int...
Craig Topper [Fri, 14 Sep 2018 05:16:58 +0000 (05:16 +0000)]
[InstCombine] Add some test cases for (add (sext x), (sext y)) --> (sext (add int x, y)) and (mul (sext x), (sext y)) --> (sext (mul x, y)). NFC

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

5 years ago[NFC] Remove meaningless code from GVN
Max Kazantsev [Fri, 14 Sep 2018 04:50:38 +0000 (04:50 +0000)]
[NFC] Remove meaningless code from GVN

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

5 years agoFix for the buildbot failure http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux...
Hideki Saito [Fri, 14 Sep 2018 02:02:57 +0000 (02:02 +0000)]
Fix for the buildbot failure lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/23635
from the commit (r342197) of https://reviews.llvm.org/D50820.

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

5 years ago[VPlan] Implement initial vector code generation support for simple outer loops.
Hideki Saito [Fri, 14 Sep 2018 00:36:00 +0000 (00:36 +0000)]
[VPlan] Implement initial vector code generation support for simple outer loops.

Summary:
[VPlan] Implement vector code generation support for simple outer loops.

Context: Patch Series #1 for outer loop vectorization support in LV  using VPlan. (RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-December/119523.html).

This patch introduces vector code generation support for simple outer loops that are currently supported in the VPlanNativePath. Changes here essentially do the following:

  - force vector code generation using explicit vectorize_width

  - add conservative early returns in cost model and other places for VPlanNativePath

  - add code for setting up outer loop inductions

  - support for widening non-induction PHIs that can result from inner loops and uniform conditional branches

  - support for generating uniform inner branches

We plan to add a handful C outer loop executable tests once the initial code generation support is committed. This patch is expected to be NFC for the inner loop vectorizer path. Since we are moving in the direction of supporting outer loop vectorization in LV, it may also be time to rename classes such as InnerLoopVectorizer.

Reviewers: fhahn, rengolin, hsaito, dcaballe, mkuper, hfinkel, Ayal

Reviewed By: fhahn, hsaito

Subscribers: dmgreen, bollu, tschuett, rkruppe, rogfer01, llvm-commits

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

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

5 years ago[NFC] Link LLVMCore into LLVMExegesisARMTests.
Richard Diamond [Thu, 13 Sep 2018 23:18:33 +0000 (23:18 +0000)]
[NFC] Link LLVMCore into LLVMExegesisARMTests.

Fixes missing `llvm::LLVMContext::~LLVMContext()` symbols w/
`BUILD_SHARED_LIBS`.

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

5 years ago[AMDGPU] Removed unused method
Tim Renouf [Thu, 13 Sep 2018 21:56:25 +0000 (21:56 +0000)]
[AMDGPU] Removed unused method

Summary:
I accidentally left this behind in D50306, and it causes a build warning
when I build with gcc7.

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

Change-Id: I30f7a47047e9d9d841f652da66d2fea19e74842c

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

5 years ago[SanitizerCoverage] Create comdat for global arrays.
Matt Morehouse [Thu, 13 Sep 2018 21:45:55 +0000 (21:45 +0000)]
[SanitizerCoverage] Create comdat for global arrays.

Summary:
Place global arrays in comdat sections with their associated functions.
This makes sure they are stripped along with the functions they
reference, even on the BFD linker.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: eraman, hiraditya, llvm-commits

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

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

5 years ago[NFC][InstCombine] PR38708 - inefficient pattern for high-bits checking 3.
Roman Lebedev [Thu, 13 Sep 2018 21:34:47 +0000 (21:34 +0000)]
[NFC][InstCombine] PR38708 - inefficient pattern for high-bits checking 3.

The last, non-canonical variant:
https://godbolt.org/z/aCMsPk
https://rise4fun.com/Alive/I6f

It can only happen due to the extra use on the inner shift.
But here it is ok.

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

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

5 years ago[DAGCombine] Fix crash when store merging created an extract_subvector with invalid...
Amara Emerson [Thu, 13 Sep 2018 21:28:58 +0000 (21:28 +0000)]
[DAGCombine] Fix crash when store merging created an extract_subvector with invalid index.

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

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

5 years agoLLVMExegesisX86Tests: link to LLVMCore, too.
Roman Lebedev [Thu, 13 Sep 2018 21:26:09 +0000 (21:26 +0000)]
LLVMExegesisX86Tests: link to LLVMCore, too.

Fixes build for me.
Refs. D52054

[215/217] Linking CXX executable unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests
FAILED: unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests
: && /usr/bin/g++  -pipe -O2 -g0 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -pipe -O2 -g0 -UNDEBUG  -fuse-ld=lld -Wl,--color-diagnostics -Wl,-allow-shlib-undefined     -Wl,-O3 -Wl,--gc-sections unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AnalysisTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/SnippetGeneratorTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/RegisterAliasingTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/TargetTest.cpp.o  -o unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests  -Wl,-rpath,/build/llvm-build-GCC-release/lib lib/libLLVMMC.so.8svn lib/libLLVMMCParser.so.8svn lib/libLLVMObject.so.8svn lib/libLLVMSymbolize.so.8svn lib/libLLVMX86CodeGen.so.8svn lib/libLLVMX86AsmParser.so.8svn lib/libLLVMX86AsmPrinter.so.8svn lib/libLLVMX86Desc.so.8svn lib/libLLVMX86Disassembler.so.8svn lib/libLLVMX86Info.so.8svn lib/libLLVMX86Utils.so.8svn lib/libLLVMSupport.so.8svn -lpthread lib/libgtest_main.so.8svn lib/libgtest.so.8svn -lpthread lib/libLLVMExegesis.so.8svn lib/libLLVMExegesisX86.so.8svn && :
ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
>>> referenced by AssemblerTest.cpp
>>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunction_Test::TestBody())

ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
>>> referenced by AssemblerTest.cpp
>>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunctionXOR32rr_Default_Test::TestBody())

ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
>>> referenced by AssemblerTest.cpp
>>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(void exegesis::MachineFunctionGeneratorBaseTest::Check<int, int, int, int, int, int, int, int>(exegesis::ExegesisTarget const&, llvm::ArrayRef<unsigned int>, llvm::MCInst, int, int, int, int, int, int, int, int))

ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
>>> referenced by AssemblerTest.cpp
>>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunctionMOV32ri_Test::TestBody())
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

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

5 years ago[llvm-exegesis] Add missing MC dependency to CMakeLists.txt
Sam Clegg [Thu, 13 Sep 2018 21:17:16 +0000 (21:17 +0000)]
[llvm-exegesis] Add missing MC dependency to CMakeLists.txt

See rL342148

This probably only shows up in BUILD_SHARED_LIBS=ON builds
which might explain how it crept in.

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

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

5 years ago[bindings/go] Add DebugLoc parameter to InsertXXXAtEnd()
Peter Collingbourne [Thu, 13 Sep 2018 21:16:39 +0000 (21:16 +0000)]
[bindings/go] Add DebugLoc parameter to InsertXXXAtEnd()

These functions previously passed nil for the location, which always resulted in a crash.

This is a signature breaking change, but I cannot see how they could have been used before.

Patch by Ben Clayton!

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

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

5 years agoAdd dependency on new llvm-cxxmap tool to check-llvm.
Richard Smith [Thu, 13 Sep 2018 21:15:34 +0000 (21:15 +0000)]
Add dependency on new llvm-cxxmap tool to check-llvm.

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