OSDN Git Service

android-x86/external-llvm.git
6 years agoRe-land r332230 "[llvm-exegesis]Fix a warning in r332221"
Clement Courbet [Mon, 14 May 2018 12:00:35 +0000 (12:00 +0000)]
Re-land r332230 "[llvm-exegesis]Fix a warning in r332221"

comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare]

unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp:60:5: note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<unsigned long, int>' requested here
    ASSERT_EQ(FromDiskVector.size(), 1);

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

6 years ago[AArch64][SVE] Extend parsing of Prefetch operation for SVE.
Sander de Smalen [Mon, 14 May 2018 11:54:41 +0000 (11:54 +0000)]
[AArch64][SVE] Extend parsing of Prefetch operation for SVE.

Reviewers: rengolin, fhahn, samparker, SjoerdMeijer, javed.absar

Reviewed By: fhahn

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

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

6 years ago[llvm-exegesis] Revert accidentally commited code.
Clement Courbet [Mon, 14 May 2018 11:35:37 +0000 (11:35 +0000)]
[llvm-exegesis] Revert accidentally commited code.

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

6 years ago[llvm-exegesis] Fix a warning in r332221
Clement Courbet [Mon, 14 May 2018 11:31:02 +0000 (11:31 +0000)]
[llvm-exegesis] Fix a warning in r332221

comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare]

unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp:60:5: note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<unsigned long, int>' requested here
    ASSERT_EQ(FromDiskVector.size(), 1);

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

6 years ago[llvm-exegesis] Add an analysis mode.
Clement Courbet [Mon, 14 May 2018 11:30:56 +0000 (11:30 +0000)]
[llvm-exegesis] Add an analysis mode.

The analysis mode gives the user a clustered view of the measurement results and
highlights any inconsistencies with the checked-in data.

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

6 years ago[mips] Correct the predicates of indexed floating point stores and loads.
Simon Dardis [Mon, 14 May 2018 10:53:15 +0000 (10:53 +0000)]
[mips] Correct the predicates of indexed floating point stores and loads.

Also, fix the register class for microMIPS.

Reviewers: atanasyan, abeserminji, smaksimovic

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

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

6 years ago[llvm-exegesis] Allow lists of BenchmarkResults to be parsed as std::vector<Benchmark...
Clement Courbet [Mon, 14 May 2018 09:01:22 +0000 (09:01 +0000)]
[llvm-exegesis] Allow lists of BenchmarkResults to be parsed as std::vector<BenchmarkResult>.

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

6 years agoTest commit access.
Nicola Zaghen [Mon, 14 May 2018 08:24:29 +0000 (08:24 +0000)]
Test commit access.

Remove trailing whitespace.

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

6 years ago[LLVM-C] Add Bindings For Module Flags
Robert Widmann [Mon, 14 May 2018 08:09:00 +0000 (08:09 +0000)]
[LLVM-C] Add Bindings For Module Flags

Summary:
The first foray into merging debug info into the echo tests.

- Add bindings to Module::getModuleFlagsMetadata() in the form of LLVMCopyModuleFlagsMetadata
- Add the opaque type LLVMModuleFlagEntry to represent Module::ModuleFlagEntry
- Add accessors for LLVMModuleFlagEntry's behavior, key, and metadata node.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: aprantl, JDevlieghere, llvm-commits, harlanhaskins

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

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

6 years ago[llvm-ar] Make PositionalArgs static.
Fangrui Song [Mon, 14 May 2018 05:56:48 +0000 (05:56 +0000)]
[llvm-ar] Make PositionalArgs static.

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

6 years agoCorrect compatibility with the GNU Assembler's handling of comparison ops
Bill Wendling [Mon, 14 May 2018 05:25:36 +0000 (05:25 +0000)]
Correct compatibility with the GNU Assembler's handling of comparison ops

GAS returns -1 for a comparison operator if the result is true and 0 if false.

  https://www.sourceware.org/binutils/docs-2.12/as.info/Infix-Ops.html#Infix%20Ops

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

6 years ago[X86] Add fast isel test cases for the clang output for 512-bit cvtps2pd related...
Craig Topper [Mon, 14 May 2018 05:09:41 +0000 (05:09 +0000)]
[X86] Add fast isel test cases for the clang output for 512-bit cvtps2pd related intrinsics.

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

6 years ago[X86] Cleanup a multiclass that doesn't need as many parameters after recent intrinsi...
Craig Topper [Mon, 14 May 2018 00:17:52 +0000 (00:17 +0000)]
[X86] Cleanup a multiclass that doesn't need as many parameters after recent intrinsic removals.

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

6 years ago[X86] Remove and autoupgrade the cvtusi2sd intrinsic. Use uitofp+insertelement instead.
Craig Topper [Mon, 14 May 2018 00:06:49 +0000 (00:06 +0000)]
[X86] Remove and autoupgrade the cvtusi2sd intrinsic. Use uitofp+insertelement instead.

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

6 years ago[X86] Add patterns for combining movss+uint_to_fp into the intrinsic instructions...
Craig Topper [Sun, 13 May 2018 23:24:21 +0000 (23:24 +0000)]
[X86] Add patterns for combining movss+uint_to_fp into the intrinsic instructions under AVX512.

This matches what we do for sint_to_fp.

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

6 years ago[X86] Add fast-isel test cases for _mm_cvtu32_sd, _mm_cvtu64_sd, _mm_cvtu32_ss, and...
Craig Topper [Sun, 13 May 2018 23:24:19 +0000 (23:24 +0000)]
[X86] Add fast-isel test cases for _mm_cvtu32_sd, _mm_cvtu64_sd, _mm_cvtu32_ss, and _mm_cvtu64_ss.

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

6 years ago[X86] Extend instcombine folds for pclmuldq intrinsics to the 256 and 512 bit version.
Craig Topper [Sun, 13 May 2018 21:56:32 +0000 (21:56 +0000)]
[X86] Extend instcombine folds for pclmuldq intrinsics to the 256 and 512 bit version.

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

6 years ago[X86] Add missing test for the InstCombines of pclmulqdq.
Craig Topper [Sun, 13 May 2018 18:26:06 +0000 (18:26 +0000)]
[X86] Add missing test for the InstCombines of pclmulqdq.

Apparently this test was lost when r293151 was committed. It was present in the review, but not the commit.

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

6 years ago[X86] Remove and autoupgrade masked vpermd/vpermps intrinsics.
Craig Topper [Sun, 13 May 2018 18:03:59 +0000 (18:03 +0000)]
[X86] Remove and autoupgrade masked vpermd/vpermps intrinsics.

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

6 years agoFollow-up to rL332176 by adding a test case for PR37264.
Dimitry Andric [Sun, 13 May 2018 14:32:23 +0000 (14:32 +0000)]
Follow-up to rL332176 by adding a test case for PR37264.

Noticed by Simon Pilgrim.

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

6 years agoAMDGPU: Rename OpenCL lowering pass to be R600 specific.
Matt Arsenault [Sun, 13 May 2018 10:04:48 +0000 (10:04 +0000)]
AMDGPU: Rename OpenCL lowering pass to be R600 specific.

This pass is
  a) broken.
  b) r600 specific.

Fixing (a) is a bit more non-trivial, but fixing (b)
is easy. Move this pass to being R600 only for now.

This pass does pass all the unit tests, however clang
no longer generates code that looks like the unit test
input, so fixing the pass requires fixing the tests and
the pass as one, and checking it works with clang still.

Patch by Dave Airlie

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

6 years agoAMDGPU: Make undef legal for v2i16/v2f16
Matt Arsenault [Sun, 13 May 2018 10:04:38 +0000 (10:04 +0000)]
AMDGPU: Make undef legal for v2i16/v2f16

This is apparently necessary to stop undef from being
turned into a build_vector of 0s.

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

6 years agoFixing build bot error: adding const qualifiers to std::sort lambda.
Puyan Lotfi [Sun, 13 May 2018 06:50:55 +0000 (06:50 +0000)]
Fixing build bot error: adding const qualifiers to std::sort lambda.

Errors were not reproducible on clang-6.0 on ubuntu 16.04.

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

6 years ago[NFC] MIR-Canon: switching to a stable string sorting of instructions.
Puyan Lotfi [Sun, 13 May 2018 06:07:20 +0000 (06:07 +0000)]
[NFC] MIR-Canon: switching to a stable string sorting of instructions.

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

6 years ago[X86] Add some load folding patterns for cvtsi2ss/sd into intrinsic instructions.
Craig Topper [Sun, 13 May 2018 01:54:33 +0000 (01:54 +0000)]
[X86] Add some load folding patterns for cvtsi2ss/sd into intrinsic instructions.

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

6 years ago[X86] Remove some unused CHECK lines from tests.
Craig Topper [Sun, 13 May 2018 00:58:23 +0000 (00:58 +0000)]
[X86] Remove some unused CHECK lines from tests.

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

6 years ago[X86] Remove an autoupgrade legacy cvtss2sd intrinsics.
Craig Topper [Sun, 13 May 2018 00:29:40 +0000 (00:29 +0000)]
[X86] Remove an autoupgrade legacy cvtss2sd intrinsics.

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

6 years ago[X86] Remove and autoupgrade cvtsi2ss/cvtsi2sd intrinsics to match what clang has...
Craig Topper [Sat, 12 May 2018 23:14:39 +0000 (23:14 +0000)]
[X86] Remove and autoupgrade cvtsi2ss/cvtsi2sd intrinsics to match what clang has used for a very long time.

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

6 years ago[x86] Remove a comment obviated by r330269. Should have deleted the
Chandler Carruth [Sat, 12 May 2018 21:28:53 +0000 (21:28 +0000)]
[x86] Remove a comment obviated by r330269. Should have deleted the
comment in the same revision but missed it.

Thanks to Dimitry Andric for catching this!

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

6 years agoClear converters map after X86 Domain Reassignment to avoid crashes
Dimitry Andric [Sat, 12 May 2018 19:59:54 +0000 (19:59 +0000)]
Clear converters map after X86 Domain Reassignment to avoid crashes

Summary:
As reported in PR37264, in some cases the X86 Domain Reassignment
`runOnMachineFunction()` is called twice.  Because it only deletes the
`.second` members of its `InstrConverterBaseMap`, and does not clean up
the map itself, this can lead to double frees and crashes.

Use `DeleteContainerSeconds()` instead, so the `Converters` map can
safely be reinitialized and its members re-deleted for each X86 Domain
Reassignment pass.

Reviewers: guyblank, craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

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

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

6 years ago[NFC] Remove inaccurate comment
JF Bastien [Sat, 12 May 2018 19:39:34 +0000 (19:39 +0000)]
[NFC] Remove inaccurate comment

Summary:
r271558 moved getManagedStaticMutex's mutex from a function-local
static to using call_once, but left a comment added in r211424. That comment is
now erroneous, remove it.

Reviewers: zturner, chandlerc

Subscribers: aheejin, llvm-commits

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

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

6 years agollc: don't call llvm_shutdown twice
JF Bastien [Sat, 12 May 2018 19:38:44 +0000 (19:38 +0000)]
llc: don't call llvm_shutdown twice

Summary:
InitLLVM already calls llvm_shutdown, but llc registers for shutdown
with llvm_shutdown_obj so it gets called twice. It's not hurting anything, but
it's also not useful, so don't do it.

Reviewers: ruiu

Subscribers: aheejin, llvm-commits

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

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

6 years ago[X86] Add WriteFCMOV scheduler class for x87 CMOVs
Simon Pilgrim [Sat, 12 May 2018 18:07:07 +0000 (18:07 +0000)]
[X86] Add WriteFCMOV scheduler class for x87 CMOVs

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

6 years ago[mips] Initialize the long branch pass for testing purposes
Simon Dardis [Sat, 12 May 2018 16:57:26 +0000 (16:57 +0000)]
[mips] Initialize the long branch pass for testing purposes

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

6 years ago[X86] Remove some unused masked conversion intrinsics that can be replaced with an...
Craig Topper [Sat, 12 May 2018 02:34:28 +0000 (02:34 +0000)]
[X86] Remove some unused masked conversion intrinsics that can be replaced with an older intrinsic and a select.

This is what clang already uses.

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

6 years agoReapply "[PR16756] Use SSAUpdaterBulk in JumpThreading."
Michael Zolotukhin [Sat, 12 May 2018 01:52:36 +0000 (01:52 +0000)]
Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading."

Stage3/stage4 bootstrap miscompares should be fixed by a non-determinism
fix in IDF (r332167).

This reverts commit r330446.

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

6 years ago[IDF] Enforce the returned blocks to be sorted.
Michael Zolotukhin [Sat, 12 May 2018 01:44:32 +0000 (01:44 +0000)]
[IDF] Enforce the returned blocks to be sorted.

Summary:
Currently the order of blocks returned by `IDF::calculate` can be
non-deterministic. This was discovered in several attempts to enable
SSAUpdaterBulk for JumpThreading (which led to miscompare in bootstrap between
stage 3 and stage4). Originally, the blocks were put into a priority queue with
a depth level as their key, and this patch adds a DFSIn number as a second key
to specify a deterministic order across blocks from one level.

The solution was suggested by Daniel Berlin.

Reviewers: dberlin, davide

Subscribers: llvm-commits

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

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

6 years ago[AMDGPU] Fix amdgpu-waves-per-eu accounting in scheduler
Stanislav Mekhanoshin [Sat, 12 May 2018 01:41:56 +0000 (01:41 +0000)]
[AMDGPU] Fix amdgpu-waves-per-eu accounting in scheduler

We cannot query this attribute from a subtarget given a machine function.
At this point attribute itself is already unavailable and can only be
obtained through MFI.

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

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

6 years agoRequirements can have & in them!
Chris Matthews [Sat, 12 May 2018 00:13:54 +0000 (00:13 +0000)]
Requirements can have & in them!

Lets escape those so the XML is valid!

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

6 years agoAdd the message attribute to skipped
Chris Matthews [Fri, 11 May 2018 23:15:11 +0000 (23:15 +0000)]
Add the message attribute to skipped

JUnit xml allows for a message attribute to be displayed on skips. Lets
populate that with an analysis of why we skipped the test.

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

6 years ago[DAG] add convenience function to propagate FMF; NFC
Sanjay Patel [Fri, 11 May 2018 23:13:36 +0000 (23:13 +0000)]
[DAG] add convenience function to propagate FMF; NFC

There's only one use of this currently, but that could
change with D46563. Either way, we shouldn't have to
update code outside of the flags struct when those
flag definitions change.

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

6 years agoAMDGPU/GlobalISel: Implement select() for >32-bit G_STORE
Tom Stellard [Fri, 11 May 2018 23:12:49 +0000 (23:12 +0000)]
AMDGPU/GlobalISel: Implement select() for >32-bit G_STORE

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, llvm-commits, t-tye

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

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

6 years ago[MemorySSA] getIncomingValueForBlock should return a MemoryAccess.
Alina Sbirlea [Fri, 11 May 2018 22:59:37 +0000 (22:59 +0000)]
[MemorySSA] getIncomingValueForBlock should return a MemoryAccess.

Summary: getIncomingValueForBlock is just a wrapper API that should return a MemoryAccess, instead of a generic Value.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

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

6 years ago[CodeExtractor] Allow extracting blocks with exception handling
Sergey Dmitriev [Fri, 11 May 2018 22:49:49 +0000 (22:49 +0000)]
[CodeExtractor] Allow extracting blocks with exception handling

This is a CodeExtractor improvement which adds support for extracting blocks
which have exception handling constructs if that is legal to do. CodeExtractor
performs validation checks to ensure that extraction is legal when it finds
invoke instructions or EH pads (landingpad, catchswitch, or cleanuppad) in
blocks to be extracted.

I have also added an option to allow extraction of blocks with alloca
instructions, but no validation is done for allocas. CodeExtractor caller has
to validate it himself before allowing alloca instructions to be extracted.
By default allocas are still not allowed in extraction blocks.

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

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

6 years ago[DAG] clean up flag propagation for binops; NFCI
Sanjay Patel [Fri, 11 May 2018 22:45:22 +0000 (22:45 +0000)]
[DAG] clean up flag propagation for binops; NFCI

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

6 years agoOverhaul unicode handling in xunit output
Chris Matthews [Fri, 11 May 2018 22:18:22 +0000 (22:18 +0000)]
Overhaul unicode handling in xunit output

I have seen a lot of errors where the xunit does not encode unicode
test output correctly.  Handle that explicitly now.

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

6 years agoAMDGPU/SI: Don't promote alloca to vector for AddrSpaceCast instruction.
Changpeng Fang [Fri, 11 May 2018 22:17:57 +0000 (22:17 +0000)]
AMDGPU/SI: Don't promote alloca to vector for AddrSpaceCast instruction.

Summary:
  We have no logic to promote alloca to vector for an AddrSpaceCast instruction.

Reviewer:
  arsenm

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

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

6 years ago[X86] Remove and autoupgrade a bunch of FMA instrinsics that are no longer used by...
Craig Topper [Fri, 11 May 2018 21:59:34 +0000 (21:59 +0000)]
[X86] Remove and autoupgrade a bunch of FMA instrinsics that are no longer used by clang.

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

6 years ago[Split GEP] handle trunc() in separate-const-offset-from-gep pass.
Artem Belevich [Fri, 11 May 2018 21:13:19 +0000 (21:13 +0000)]
[Split GEP] handle trunc() in separate-const-offset-from-gep pass.

Let separate-const-offset-from-gep pass handle trunc() when it calculates
constant offset relative to base. The pass itself may insert trunc()
instructions when it canonicalises array indices to pointer-size integers
and needs to handle trunc() in order to evaluate the offset.

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

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

6 years ago[AMDGPU] Fix compilation failure when IR contains comdat
Yaxun Liu [Fri, 11 May 2018 20:40:14 +0000 (20:40 +0000)]
[AMDGPU] Fix compilation failure when IR contains comdat

Remove a useless SwitchSection which also causes compilation failure
when IR contains comdat.

The SwitchSection is useless because the current section is already
correct text section for the function therefore no need to switch.

It causes compilation failure for comdat because functions with comdat
has specific text section, not the default .text section.

Since HIP uses comdat, this bug caused failures for HIP.

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

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

6 years ago[DAG] reduce code duplication; NFCI
Sanjay Patel [Fri, 11 May 2018 20:08:23 +0000 (20:08 +0000)]
[DAG] reduce code duplication; NFCI

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

6 years ago[InstCombine] Handle atomic memset in the same way as regular memset
Daniel Neilson [Fri, 11 May 2018 20:04:50 +0000 (20:04 +0000)]
[InstCombine] Handle atomic memset in the same way as regular memset

Summary:
This change adds handling of the atomic memset intrinsic to the
code path that simplifies the regular memset. In practice this means
that we will now also expand a small constant-length atomic memset
into a single unordered atomic store.

Reviewers: apilipenko, skatkov, mkazantsev, anna, reames

Reviewed By: reames

Subscribers: reames, llvm-commits

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

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

6 years agoMove standard library inclusions to after internal inclusions.
David Blaikie [Fri, 11 May 2018 19:21:40 +0000 (19:21 +0000)]
Move standard library inclusions to after internal inclusions.

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

6 years ago[DAGCombiner] Set the right SDLoc on extended SETCC uses (7/N)
Vedant Kumar [Fri, 11 May 2018 18:40:10 +0000 (18:40 +0000)]
[DAGCombiner] Set the right SDLoc on extended SETCC uses (7/N)

ExtendSetCCUses updates SETCC nodes which use a load (OriginalLoad) to
reflect a simplification to the load (ExtLoad).

Based on my reading, ExtendSetCCUses may create new nodes to extend a
constant attached to a SETCC. It also creates fresh SETCC nodes which
refer to any updated operands.

ISTM that the location applied to the new constant and SETCC nodes
should be the same as the location of the ExtLoad.

This was suggested by Adrian in https://reviews.llvm.org/D45995.

Part of: llvm.org/PR37262

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

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

6 years ago[DAGCombiner] Set the right SDLoc on a newly-created sextload (6/N)
Vedant Kumar [Fri, 11 May 2018 18:40:08 +0000 (18:40 +0000)]
[DAGCombiner] Set the right SDLoc on a newly-created sextload (6/N)

This teaches tryToFoldExtOfLoad to set the right location on a
newly-created extload. With that in place, the logic for performing a
certain ([s|z]ext (load ...)) combine becomes identical for sexts and
zexts, and we can get rid of one copy of the logic.

The test case churn is due to dependencies on IROrders inherited from
the wrong SDLoc.

Part of: llvm.org/PR37262

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

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

6 years ago[DAGCombiner] Factor out duplicated logic for an extload combine, NFC (5/N)
Vedant Kumar [Fri, 11 May 2018 18:40:02 +0000 (18:40 +0000)]
[DAGCombiner] Factor out duplicated logic for an extload combine, NFC (5/N)

Part of the logic for combining (zext (load ...)) and (sext (load ...))
is duplicated. This creates problems because bugs in one version have to
be fixed again in the other version.

To address this, as a first step, I've extracted the duplicate logic
into a helper. I'll fix the debug location bug in the helper and
eliminate the copy of its logic in a followup.

Part of: llvm.org/PR37262

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

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

6 years ago[LIT] replace output escapes wit a cdata block
Chris Matthews [Fri, 11 May 2018 18:38:02 +0000 (18:38 +0000)]
[LIT] replace output escapes wit a cdata block

CDATA blocks don't need to have XML stuff escaped. Makes sense to wrap
output in them instead of escaping.

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

6 years agomake add_llvm_fuzzer calls slightly more consisten with other cmake
Nico Weber [Fri, 11 May 2018 17:58:52 +0000 (17:58 +0000)]
make add_llvm_fuzzer calls slightly more consisten with other cmake

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

6 years ago[InstCombine] snprintf optimizations
David Bolvansky [Fri, 11 May 2018 17:50:49 +0000 (17:50 +0000)]
[InstCombine] snprintf optimizations

Reviewers: spatel, efriedma, majnemer, rja, bkramer

Reviewed By: rja, bkramer

Subscribers: mstorsjo, rja, llvm-commits

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

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

6 years ago[X86][BtVer2] Model ymm move as double pumped instructions
Simon Pilgrim [Fri, 11 May 2018 17:38:36 +0000 (17:38 +0000)]
[X86][BtVer2] Model ymm move as double pumped instructions

We still need to handle mmx/xmm moves as 'decode-only' no-pipe instructions

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

6 years ago[RISCV] Support .option rvc and norvc assembler directives
Alex Bradbury [Fri, 11 May 2018 17:30:28 +0000 (17:30 +0000)]
[RISCV] Support .option rvc and norvc assembler directives

These directives allow the 'C' (compressed) extension to be enabled/disabled
within a single file.

Differential Revision: https://reviews.llvm.org/D45864
Patch by Kito Cheng

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

6 years ago[Analysis] Validate the return type of s(n)printf like libcalls
Martin Storsjo [Fri, 11 May 2018 16:53:56 +0000 (16:53 +0000)]
[Analysis] Validate the return type of s(n)printf like libcalls

If the sprintf function is static (as on mingw-w64, where many stdio
functions are static inline wrappers), earlier optimization passes
could optimize out the return value altogether, and make it void,
which could break optimizations of this libcall that touch the
return value.

This fixes the issue discussed in PR37408 for the sprintf function.

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

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

6 years ago[X86][MMX] Tag MMX Move/Load/Store as WriteVec schedule classes
Simon Pilgrim [Fri, 11 May 2018 16:38:59 +0000 (16:38 +0000)]
[X86][MMX] Tag MMX Move/Load/Store as WriteVec schedule classes

Fixes an issue on SLM/Btver2 where we had instructions were being treated as scalar loads/stores

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

6 years ago[AArch64] Fix performPostLD1Combine to check for constant lane index.
Geoff Berry [Fri, 11 May 2018 16:25:06 +0000 (16:25 +0000)]
[AArch64] Fix performPostLD1Combine to check for constant lane index.

Summary:
performPostLD1Combine in AArch64ISelLowering looks for vector
insert_vector_elt of a loaded value which it can optimize into a single
LD1LANE instruction.  The code checking for the pattern was not checking
if the lane index was a constant which could cause two problems:

- an assert when lowering the LD1LANE ISD node since it assumes an
  constant operand

- an assert in isel if the lane index value depends on the
  post-incremented base register

Both of these issues are avoided by simply checking that the lane index
is a constant.

Fixes bug 35822.

Reviewers: t.p.northover, javed.absar

Subscribers: rengolin, kristof.beyls, mcrosier, llvm-commits

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

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

6 years ago[mips] Rename Filler to MipsDelaySlotFiller and initialize the pass
Simon Dardis [Fri, 11 May 2018 16:13:53 +0000 (16:13 +0000)]
[mips] Rename Filler to MipsDelaySlotFiller and initialize the pass

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

6 years agoUse iteration instead of recursion in CFIInserter
Sanjoy Das [Fri, 11 May 2018 15:54:46 +0000 (15:54 +0000)]
Use iteration instead of recursion in CFIInserter

Summary: This recursive step can overflow the stack.

Reviewers: djokov, petarj

Subscribers: mcrosier, jlebar, bixia, llvm-commits

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

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

6 years ago[Reassociate] Prevent infinite loops when processing PHIs.
Davide Italiano [Fri, 11 May 2018 15:45:36 +0000 (15:45 +0000)]
[Reassociate] Prevent infinite loops when processing PHIs.

Phi nodes can reside in live blocks but one of their incoming
arguments can come from a dead block. Dead blocks and reassociate
don't play nice together. In fact, reassociate performs an RPO
as a first step to avoid processing dead blocks.

The reason why Reassociate might not fixpoint when examining
dead blocks is that the following:

  %xor0 = xor i16 %xor1, undef
  %xor1 = xor i16 %xor0, undef

is perfectly valid LLVM IR (if it appears in a dead block),
so the worklist algorithm keeps pushing the two instructions for
reexamination. Note that this is not Reassociate fault, at least
not entirely. It's llvm that has a weird definition of dominance.

Fixes PR37390.

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

6 years agoRemove unused SyncExecutor and make it clearer that the whole file is only used if...
Nico Weber [Fri, 11 May 2018 15:25:38 +0000 (15:25 +0000)]
Remove unused SyncExecutor and make it clearer that the whole file is only used if LLVM_ENABLE_THREADS

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

6 years ago[mips] Enable disassembly of fused (negative) multiply add/sub instructions
Simon Dardis [Fri, 11 May 2018 15:21:40 +0000 (15:21 +0000)]
[mips] Enable disassembly of fused (negative) multiply add/sub instructions

Reviewers: atanasyan, smaksimovic, abeserminji

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

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

6 years ago[X86][SLM] Vector stores only use the MEC port.
Simon Pilgrim [Fri, 11 May 2018 15:16:15 +0000 (15:16 +0000)]
[X86][SLM] Vector stores only use the MEC port.

Confirmed by both Agner and Intel's AOM - the IEC/FPC are not required for pure load/stores (even if its a partial update).

Can't fix WriteStore until all RMW instructions are cleaned up though....

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

6 years ago[X86] Split WriteF/WriteVec Move/Load/Store scheduler classes by vector width
Simon Pilgrim [Fri, 11 May 2018 14:30:54 +0000 (14:30 +0000)]
[X86] Split WriteF/WriteVec Move/Load/Store scheduler classes by vector width

Fixes a SNB issue that was missing vlddqu/vmovntdqa ymm instructions

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

6 years ago[InstCombine] Unify handling of atomic memtransfer with non-atomic memtransfer
Daniel Neilson [Fri, 11 May 2018 14:30:02 +0000 (14:30 +0000)]
[InstCombine] Unify handling of atomic memtransfer with non-atomic memtransfer

Summary:
This change reworks the handling of atomic memcpy within the instcombine pass.
Previously, a constant length atomic memcpy would be lowered into loads & stores
as long as no more than 16 load/store pairs are created. This is quite different
from the lowering done for a non-atomic memcpy; which only ever lowers into a single
load/store pair of no more than 8 bytes. Larger constant-sized memcpy calls are
expanded to load/stores in later passes, such as SelectionDAG lowering.

In this change the behaviour for atomic memcpy is unified with non-atomic memcpy;
atomic memcpy is now treated in the same was as non-atomic memcpy has always been.
We leave it to later passes to lower longer-length atomic memcpy calls.

Due to the structure of the pass's handling of memtransfer intrinsics, this change
also gives us handling of atomic memmove that we did not previously have.

Reviewers: apilipenko, skatkov, mkazantsev, anna, reames

Reviewed By: reames

Subscribers: reames, llvm-commits

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

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

6 years ago[X86] Added scheduler helper classes to split move/load/store by size
Simon Pilgrim [Fri, 11 May 2018 12:46:54 +0000 (12:46 +0000)]
[X86] Added scheduler helper classes to split move/load/store by size

Nothing uses this yet but this will allow us to specialize MMX/XMM/YMM/ZMM vector moves.

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

6 years ago[APFloat] Set losesInfo on no-op convert
Sven van Haastregt [Fri, 11 May 2018 09:45:42 +0000 (09:45 +0000)]
[APFloat] Set losesInfo on no-op convert

losesInfo would be left unset when no conversion needs to be done.  A
caller such as InstCombine's fitsInFPType would then branch on an
uninitialized value.

Caught using valgrind on an out-of-tree target.

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

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

6 years ago[IRTests] Verify PDT instead of DT
Jakub Kuderski [Fri, 11 May 2018 09:30:29 +0000 (09:30 +0000)]
[IRTests] Verify PDT instead of DT

Summary: Fix two typos which result in verifying wrong data structures (DT) instead of PDT in DominatorTreeBatchUpdatesTest.

Reviewers: davide, kuhar, grosser, dberlin

Reviewed By: davide, kuhar, dberlin

Subscribers: llvm-commits

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

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

6 years agoAMDGPU/GlobalISel: Implement select() for 32-bit G_FPTOUI
Tom Stellard [Fri, 11 May 2018 05:44:16 +0000 (05:44 +0000)]
AMDGPU/GlobalISel: Implement select() for 32-bit G_FPTOUI

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[llvm-strip] Add support for -remove-section
Alexander Shaposhnikov [Fri, 11 May 2018 05:27:06 +0000 (05:27 +0000)]
[llvm-strip] Add support for -remove-section

This diff adds support for -remove-section to llvm-strip.

Test plan: make check-all

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

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

6 years ago[X86] Remove and autoupgrade the avx512.mask.store.ss intrinsic.
Craig Topper [Fri, 11 May 2018 04:33:18 +0000 (04:33 +0000)]
[X86] Remove and autoupgrade the avx512.mask.store.ss intrinsic.

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

6 years ago[llvm-objcopy] Update remove-section.test
Alexander Shaposhnikov [Fri, 11 May 2018 04:30:57 +0000 (04:30 +0000)]
[llvm-objcopy] Update remove-section.test

Verify that the input binary is not getting modified
and add an invocation which uses -remove-section instead of -R.

Test plan: make check-all

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

6 years ago[Coroutines] PR34897: Fix incorrect elisions
Brian Gesiak [Fri, 11 May 2018 03:12:28 +0000 (03:12 +0000)]
[Coroutines] PR34897: Fix incorrect elisions

Summary:
https://bugs.llvm.org/show_bug.cgi?id=34897 demonstrates an incorrect
coroutine frame allocation elision in the coro-elide pass. The elision
is performed on the basis that the SSA variables from all llvm.coro.begin
are directly referenced in subsequent llvm.coro.destroy instructions.

However, this ignores the fact that the function may exit through paths
that do not run these destroy instructions. In the sample program from
PR34897, for example, the llvm.coro.destroy instruction is only
executed in exception handling code. When the coroutine function exits
normally, llvm.coro.destroy is not called. Eliding the allocation in
this case causes a subsequent reference to the coroutine handle from
outside of the function to access freed memory.

To fix the issue, when finding an llvm.coro.destroy for each llvm.coro.begin,
only consider llvm.coro.destroy that are executed along non-exceptional paths.

Test Plan:
1. Download the sample program from
   https://bugs.llvm.org/show_bug.cgi?id=34897, compile it with
   `clang++ -fcoroutines-ts -stdlib=libc++ -std=c++1z -O2`, and run it.
   It should print `"run1\ncheck1\nrun2\ncheck2"` and then exit
   successfully.
2. Compile https://godbolt.org/g/mCKfnr and confirm it is still
   optimized to a single instruction, 'return 1190'.
3. `check-llvm`

Reviewers: rsmith, GorNishanov, eric_niebler

Reviewed By: GorNishanov

Subscribers: andrewrk, lewissbaker, EricWF, llvm-commits

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

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

6 years ago[Support] Add docs for 'openFileFor{Write,Read}'
Brian Gesiak [Fri, 11 May 2018 01:47:27 +0000 (01:47 +0000)]
[Support] Add docs for 'openFileFor{Write,Read}'

Summary:
Add documentation for the LLVM Support functions `openFileForWrite` and
`openFileForRead`. The `openFileForRead` parameter `RealPath`, in
particular, I think warranted some explanation.

In addition, make the behavior of the functions more consistent across
platforms. Prior to this patch, Windows would set or not set the result
file descriptor based on the nature of the error, whereas Unix would
consistently set it to `-1` if the open failed. Make Windows
consistently set it to `-1` as well.

Test Plan:
1. `ninja check-llvm`
2. `ninja docs-llvm-html`

Reviewers: zturner, rnk, danielmartin, scanon

Reviewed By: danielmartin, scanon

Subscribers: scanon, danielmartin, llvm-commits

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

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

6 years ago[sanitizer-coverage] don't instrument a function if it's entry block ends with 'unrea...
Kostya Serebryany [Fri, 11 May 2018 01:09:39 +0000 (01:09 +0000)]
[sanitizer-coverage] don't instrument a function if it's entry block ends with 'unreachable'

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

6 years agoRegister NetBSD/i386 in AddressSanitizer.cpp
Kamil Rytarowski [Fri, 11 May 2018 00:58:01 +0000 (00:58 +0000)]
Register NetBSD/i386 in AddressSanitizer.cpp

Summary:
Ship kNetBSD_ShadowOffset32 set to 1ULL << 30.

This is prepared for the amd64 kernel runtime.

Sponsored by <The NetBSD Foundation>

Reviewers: vitalybuka, joerg, kcc

Reviewed By: vitalybuka

Subscribers: llvm-commits

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

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

6 years ago[InstCombine] Add tests for cases where we don't recognize type promoted rotate idioms.
Craig Topper [Fri, 11 May 2018 00:46:09 +0000 (00:46 +0000)]
[InstCombine] Add tests for cases where we don't recognize type promoted rotate idioms.

These rotates take the form

(x << (n & mask)) | (x >> (-n & mask)) where mask is bitwidth - 1.

If x has been promoted to a wider type than its original bit width due to type promotion we fail to narrower it and therefore don't recognize it as a rotate.

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

6 years agoSupport Unsupported Tests in xunit output
Chris Matthews [Fri, 11 May 2018 00:25:43 +0000 (00:25 +0000)]
Support Unsupported Tests in xunit output

We were reporting  "Unsupported" tests in xunit as passes, however since
they are not run, it make more sense to mark them as skipped. The Junit
xml standard has support for that, so lets use it.

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

6 years agoRefactor xunit test case builder to not use as much str addition
Chris Matthews [Fri, 11 May 2018 00:25:42 +0000 (00:25 +0000)]
Refactor xunit test case builder to not use as much str addition

String concatenation in python is slow.  Refactor to not concatenate the
possibly large strings of test output and instead write them directly
to the output file.

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

6 years ago[SampleFDO] Don't treat warm callsite with inline instance in the profile as cold
Wei Mi [Thu, 10 May 2018 23:02:27 +0000 (23:02 +0000)]
[SampleFDO] Don't treat warm callsite with inline instance in the profile as cold

We found current sampleFDO had a performance issue when triaging a regression.
For a callsite with inline instance in the profile, even if hot callsite inliner
cannot inline it, it may still execute enough times and should not be treated as
cold in regular inliner later. However, currently if such callsite is not inlined
by hot callsite inliner, and the BB where the callsite locates doesn't get
samples from other instructions inside of it, the callsite will have no profile
metadata annotated. In regular inliner cost analysis, if the callsite has no
profile annotated and its caller has profile information, it will be treated as
cold.

The fix changes the isCallsiteHot check and chooses to compare
CallsiteTotalSamples with hot cutoff value computed by ProfileSummaryInfo.

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

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

6 years ago[STLExtras] Add distance() for ranges, pred_size(), and succ_size()
Vedant Kumar [Thu, 10 May 2018 23:01:54 +0000 (23:01 +0000)]
[STLExtras] Add distance() for ranges, pred_size(), and succ_size()

This commit adds a wrapper for std::distance() which works with ranges.
As it would be a common case to write `distance(predecessors(BB))`, this
also introduces `pred_size()` and `succ_size()` helpers to make that
easier to write.

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

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

6 years ago[LIT] Move xunit tests tests into their own location, and and add failures
Chris Matthews [Thu, 10 May 2018 22:51:28 +0000 (22:51 +0000)]
[LIT] Move xunit tests tests into their own location, and and add failures

Failures will increase coverage.

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

6 years ago[InstCombine] Replace an 'if' that should always be true with an assert.
Craig Topper [Thu, 10 May 2018 22:45:28 +0000 (22:45 +0000)]
[InstCombine] Replace an 'if' that should always be true with an assert.

The bitwidth of the operation should always be wider than the result width of the truncate since we don't recurse through any width changing operations.

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

6 years ago[WebAssembly] Initial Disassembler.
Sam Clegg [Thu, 10 May 2018 22:16:44 +0000 (22:16 +0000)]
[WebAssembly] Initial Disassembler.

This implements a new table-gen emitter to create tables for
a wasm disassembler, and a dissassembler to use them.

Comes with 2 tests, that tests a few instructions manually. Is also able to
disassemble large .wasm files with objdump reasonably.

Not working so well, to be addressed in followups:
- objdump appears to be passing an incorrect starting point.
- since the disassembler works an instruction at a time, and it is
  disassembling stack instruction, it has no idea of pseudo register assignments.
  These registers are required for the instruction printing code that follows.
  For now, all such registers appear in the output as $0.

Patch by Wouter van Oortmerssen

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

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

6 years ago[X86] Add new patterns for masked scalar load/store to match clang's codegen from...
Craig Topper [Thu, 10 May 2018 21:49:16 +0000 (21:49 +0000)]
[X86] Add new patterns for masked scalar load/store to match clang's codegen from r331958.

Clang's codegen now uses 128-bit masked load/store intrinsics in IR. The backend will widen to 512-bits on AVX512F targets.

So this patch adds patterns to detect codegen's widening and patterns for AVX512VL that don't get widened.

We may be able to drop some of the old patterns, but I leave that for a future patch.

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

6 years agoRevert "[InstCombine] snprintf optimizations"
Martin Storsjo [Thu, 10 May 2018 21:23:36 +0000 (21:23 +0000)]
Revert "[InstCombine] snprintf optimizations"

This reverts commit SVN r331889, which could trigger failed
assertions for cases where the snprintf function is declared
with a vaguely differing signature (e.g. being defined as
static inline), see PR37408.

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

6 years agoAMDGPU/GlobalISel: Implement select() for G_BITCAST s32 <--> <2 x s16>
Tom Stellard [Thu, 10 May 2018 21:20:10 +0000 (21:20 +0000)]
AMDGPU/GlobalISel: Implement select() for G_BITCAST s32 <--> <2 x s16>

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[LLVM-C] Consolidate llgo's DIBuilder Bindings
Robert Widmann [Thu, 10 May 2018 21:10:06 +0000 (21:10 +0000)]
[LLVM-C] Consolidate llgo's DIBuilder Bindings

Summary: Move and correct LLVMDIBuilderCreateTypedef.  This is the last API in DIBuilderBindings.h, so it is being removed and the C API will now be re-exported from IRBindings.h.

Reviewers: whitequark, harlanhaskins, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

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

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

6 years agoAMDGPU/GlobalISel: Enable TableGen'd instruction selector
Tom Stellard [Thu, 10 May 2018 20:53:06 +0000 (20:53 +0000)]
AMDGPU/GlobalISel: Enable TableGen'd instruction selector

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, mgorny, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[InstCombine] add folds for minnum(-a, -b) --> -maxnum(a, b)
Sanjay Patel [Thu, 10 May 2018 20:03:13 +0000 (20:03 +0000)]
[InstCombine] add folds for minnum(-a, -b) --> -maxnum(a, b)

This is similar to what we do for integer min/max with 'not'
ops (rL321882).

This should fix:
https://bugs.llvm.org/show_bug.cgi?id=37404
https://bugs.llvm.org/show_bug.cgi?id=37405

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

6 years ago[DWARF] Fixing a bug in DWARF v5 string offsets tables where the length encoded the...
Wolfgang Pieb [Thu, 10 May 2018 20:02:34 +0000 (20:02 +0000)]
[DWARF] Fixing a bug in DWARF v5 string offsets tables where the length encoded the contribution
length excluding the table header. Instead it must encode the contribution length minus the length
field itself.

Reviewer: JDevliegehere

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

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

6 years ago[InstCombine] Moving overflow computation logic from InstCombine to ValueTracking...
Omer Paparo Bivas [Thu, 10 May 2018 19:46:19 +0000 (19:46 +0000)]
[InstCombine] Moving overflow computation logic from InstCombine to ValueTracking; NFC

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

Change-Id: Ifabcbe431a2169743b3cc310f2a34fd706f13f02

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

6 years ago[InstCombine] add minnum/maxnum tests (PR37404, PR37405); NFC
Sanjay Patel [Thu, 10 May 2018 19:21:08 +0000 (19:21 +0000)]
[InstCombine] add minnum/maxnum tests (PR37404, PR37405); NFC

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