1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

148605 Commits

Author SHA1 Message Date
Craig Topper
dc461c9a16 [ValueTracking] Use KnownOnes to provide a better bound on known zeros for ctlz/cttz intrinics
This patch uses KnownOnes of the input of ctlz/cttz to bound the value that can be returned from these intrinsics. This makes these intrinsics more similar to the handling for ctpop which already uses known bits to produce a similar bound.

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

llvm-svn: 302444
2017-05-08 17:22:34 +00:00
Zvi Rackover
f8aa5f043e [X86] Split test configurations. NFC.
Split test that includes reproducer for pr32967 to KNL and SKX.

llvm-svn: 302442
2017-05-08 16:54:25 +00:00
Sanjay Patel
2e02754f0f [InstSimplify] fix typo; NFC
llvm-svn: 302439
2017-05-08 16:35:02 +00:00
Sanjay Patel
b20117ebc9 [InstCombine] use local variable to reduce code duplication; NFCI
llvm-svn: 302438
2017-05-08 16:33:42 +00:00
Craig Topper
01c1847bc2 [ValueTracking] Introduce a version of computeKnownBits that returns a KnownBits struct. Begin using it to replace internal usages of ComputeSignBit
This introduces a new interface for computeKnownBits that returns the KnownBits object instead of requiring it to be pre-constructed and passed in by reference.

This is a much more convenient interface as it doesn't require the caller to figure out the BitWidth to pre-construct the object. It's so convenient that I believe we can use this interface to remove the special ComputeSignBit flavor of computeKnownBits.

As a step towards that idea, this patch replaces all of the internal usages of ComputeSignBit with this new interface. As you can see from the patch there were a couple places where we called ComputeSignBit which really called computeKnownBits, and then called computeKnownBits again directly. I've reduced those places to only making one call to computeKnownBits. I bet there are probably external users that do it too.

A future patch will update the external users and remove the ComputeSignBit interface. I'll also working on moving more locations to the KnownBits returning interface for computeKnownBits.

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

llvm-svn: 302437
2017-05-08 16:22:48 +00:00
Sanjay Patel
3e7ca7a083 [InstCombine/InstSimplify] add comments about code duplication; NFC
llvm-svn: 302436
2017-05-08 16:21:55 +00:00
Sanjay Patel
31d07fed4c [InstCombine] add another test for PR32949; NFC
A patch for the InstSimplify variant of this bug is up for review here:
https://reviews.llvm.org/D32954

llvm-svn: 302434
2017-05-08 15:58:57 +00:00
Zvi Rackover
0560bf08c5 InstructionSimplify: Refactor foldIdentityShuffles. NFC.
Summary:
Minor refactoring of foldIdentityShuffles() which allows the removal of a
ConstantDataVector::get() in SimplifyShuffleVectorInstruction.

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

Conflicts:
	lib/Analysis/InstructionSimplify.cpp

llvm-svn: 302433
2017-05-08 15:46:58 +00:00
Geoff Berry
06e750c92e Fix comment typos.
llvm-svn: 302432
2017-05-08 15:33:08 +00:00
Zvi Rackover
52ceff2d11 Adding reproducer for pr32967. NFC.
llvm-svn: 302426
2017-05-08 14:47:32 +00:00
Simon Pilgrim
4099d531e6 [X86][SSE] Improve combineLogicBlendIntoPBLENDV to use general masks.
Currently combineLogicBlendIntoPBLENDV can only match ASHR to detect sign splatting of a bit mask, this patch generalises this to use computeNumSignBits instead.

This is a first step in several things we can do to improve PBLENDV support:

 * Better matching of X86ISD::ANDNP patterns.
 * Handle floating point cases.
 * Better vector and bitcast support in computeNumSignBits.
 * Recognise that PBLENDV only uses the sign bit of the mask, we should be able strip away sign splats (ASHR, PCMPGT isNeg tests etc.).

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

llvm-svn: 302424
2017-05-08 14:16:39 +00:00
Simon Pilgrim
1d3f1c6cb5 Normalize line endings. NFCI,
llvm-svn: 302422
2017-05-08 13:32:34 +00:00
Zvi Rackover
b32fbfb1f1 IR: Add a shufflevector mask commutation helper function. NFC.
Summary:
Following up on Sanjay's suggetion in D32955, move this functionality
into ShuffleVectornstruction.

Reviewers: spatel, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 302420
2017-05-08 12:40:18 +00:00
Simon Pilgrim
e29dd41674 [ARM][NEON] Add support for ISD::ABS lowering
Update NEON int_arm_neon_vabs intrinsic to use the ISD::ABS opcode directly

Added constant folding tests.

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

llvm-svn: 302417
2017-05-08 10:37:34 +00:00
Martin Storsjo
bba254df79 [ARM] Clear the constant pool cache on explicit .ltorg directives
Multiple ldr pseudoinstructions with the same constant value will
reuse the same constant pool entry. However, if the constant pool
is explicitly flushed with a .ltorg directive, we should not try
to reference constants in the previous pool any longer, since they
may be out of range.

This fixes assembling hand-written assembler source which repeatedly
loads the same constant value, across a binary size larger than the
pc-relative fixup range for ldr instructions (4096 bytes). Such
assembler source already uses explicit .ltorg instructions to emit
constant pools with regular intervals. However if we try to reuse
constants emitted in earlier pools, they end up out of range.

This makes the output of the testcase match what binutils gas does
(prior to this patch, it would fail to assemble).

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

llvm-svn: 302416
2017-05-08 10:26:24 +00:00
Simon Pilgrim
7889ea478c [AARCH64][NEON] Add support for ISD::ABS lowering
Update int_aarch64_neon_abs intrinsic to use the ISD::ABS opcode directly

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

llvm-svn: 302415
2017-05-08 10:25:18 +00:00
Igor Breger
53f8ce5987 [GlobalISel][X86] G_GEP selection support.
Summary: [GlobalISel][X86] G_GEP selection support.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

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

llvm-svn: 302412
2017-05-08 09:40:43 +00:00
Igor Breger
915957ad23 [GlobalISel][X86] G_MUL legalizer/selector support.
Summary:
G_MUL legalizer/selector/regbank support.
Use only Tablegen-erated instruction selection.
This patch dealing with legal operations only.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: krytarowski, rovka, kristof.beyls, llvm-commits

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

llvm-svn: 302410
2017-05-08 09:03:37 +00:00
Andrew Ng
9644c1e9e7 [Lit] Fix to prevent creation of "%SystemDrive%" directory on Windows.
This patch propogates the environment variable SYSTEMDRIVE on Windows when
running the unit tests. This prevents the creation of a directory named
"%SystemDrive%" when running the unit tests from FileSystemTest that use the
function llvm::sys::fs::remove_directories which in turn uses SHFileOperationW.
It is within SHFileOperationW that this environment variable may be used and if
undefined causes the creation of a "%SystemDrive%" directory in the current
directory.

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

llvm-svn: 302409
2017-05-08 08:55:38 +00:00
Craig Topper
63b5b25d3d [APInt] Modify tcMultiplyPart's overflow detection to not depend on 'i' from the earlier loop. NFC
The value of 'i' is always the smaller of DstParts and SrcParts so we can just use that fact to write all the code in terms of SrcParts and DstParts.

llvm-svn: 302408
2017-05-08 06:34:41 +00:00
Craig Topper
ee2d9260d4 [APInt] Use std::min instead of writing the same thing with the ternary operator. NFC
llvm-svn: 302407
2017-05-08 06:34:39 +00:00
Craig Topper
649f1ad9b5 [APInt] Remove 'else' after 'return' in tcMultiply methods. NFC
llvm-svn: 302406
2017-05-08 06:34:36 +00:00
Dean Michael Berris
5083dffff0 [XRay] Custom event logging intrinsic
This patch introduces an LLVM intrinsic and a target opcode for custom event
logging in XRay. Initially, its use case will be to allow users of XRay to log
some type of string ("poor man's printf"). The target opcode compiles to a noop
sled large enough to enable calling through to a runtime-determined relative
function call. At runtime, when X-Ray is enabled, the sled is replaced by
compiler-rt with a trampoline to the logic for creating the custom log entries.

Future patches will implement the compiler-rt parts and clang-side support for
emitting the IR corresponding to this intrinsic.

Reviewers: timshen, dberris

Subscribers: igorb, pelikan, rSerge, timshen, echristo, dberris, llvm-commits

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

llvm-svn: 302405
2017-05-08 05:45:21 +00:00
Craig Topper
76e9306b76 [SCEV] Use APInt::operator*=(uint64_t) to avoid a temporary APInt for a constant.
llvm-svn: 302404
2017-05-08 04:55:13 +00:00
Craig Topper
b45ca040d2 [APInt] Take advantage of new operator*=(uint64_t) to remove a temporary APInt.
llvm-svn: 302403
2017-05-08 04:55:12 +00:00
Craig Topper
eb151b0f34 [APInt] Add support for multiplying by a uint64_t.
This makes multiply similar to add, sub, xor, and, and or.

llvm-svn: 302402
2017-05-08 04:55:09 +00:00
Eric Beckmann
61da778e46 Hopefully one last commit to fix this patch, addresses string reference
issues.

llvm-svn: 302401
2017-05-08 02:47:42 +00:00
Eric Beckmann
9554d73259 Quick fix to D32609, it seems .o files are not transferred in all cases.
Therefore the .o file in question is renamed to .obj.coff.

llvm-svn: 302400
2017-05-08 02:47:25 +00:00
Eric Beckmann
f467e9d298 Update llvm-readobj -coff-resources to display tree structure.
Summary: Continue making updates to llvm-readobj to display resource sections.  This is necessary for testing the up and coming cvtres tool.

Reviewers: zturner

Subscribers: llvm-commits

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

llvm-svn: 302399
2017-05-08 02:47:07 +00:00
Craig Topper
cbf0448c49 [SCEV] Have getRangeForAffineARHelper take StartRange by const reference to avoid a copy in many of the cases.
llvm-svn: 302398
2017-05-08 02:29:15 +00:00
Eric Beckmann
918ba0feda Revert "Hopefully one last commit to fix this patch, addresses string reference"
Summary:
This reverts commit 56beec1b1cfc6d263e5eddb7efff06117c0724d2.

Revert "Quick fix to D32609, it seems .o files are not transferred in all cases."

This reverts commit 7652eecd29cfdeeab7f76f687586607a99ff4e36.

Revert "Update llvm-readobj -coff-resources to display tree structure."

This reverts commit 422b62c4d302cfc92401418c2acd165056081ed7.

Reviewers: zturner

Subscribers: llvm-commits

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

llvm-svn: 302397
2017-05-08 02:25:03 +00:00
Eric Beckmann
f84fcd81e8 Hopefully one last commit to fix this patch, addresses string reference
issues.

llvm-svn: 302395
2017-05-08 01:48:55 +00:00
Eric Beckmann
d95fe57baa Quick fix to D32609, it seems .o files are not transferred in all cases.
Therefore the .o file in question is renamed to .obj.coff.

llvm-svn: 302388
2017-05-07 23:31:14 +00:00
Eric Beckmann
c614436be9 Update llvm-readobj -coff-resources to display tree structure.
Summary: Continue making updates to llvm-readobj to display resource sections.  This is necessary for testing the up and coming cvtres tool.

Reviewers: zturner

Subscribers: llvm-commits

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

llvm-svn: 302386
2017-05-07 22:47:22 +00:00
Craig Topper
f9e6e29ef0 [ConstantRange][SimplifyCFG] Add a helper method to allow SimplifyCFG to determine if a ConstantRange has more than 8 elements without requiring an allocation if the ConstantRange is 64-bits wide.
Previously SimplifyCFG used getSetSize which returns an APInt that is 1 bit wider than the ConstantRange's bit width. In the reasonably common case that the ConstantRange is 64-bits wide, this requires returning a 65-bit APInt. APInt's can only store 64-bits without a memory allocation so this is inefficient.

The new method takes the 8 as an input and tells if the range contains more than that many elements without requiring any wider math.

llvm-svn: 302385
2017-05-07 22:22:11 +00:00
Craig Topper
712410d6fb [ConstantRange] Remove 'Of' from name of ConstantRange::isSizeStrictlySmallerThanOf so that it reads better. NFC
llvm-svn: 302383
2017-05-07 21:48:08 +00:00
Simon Pilgrim
1e7b4fdb56 [X86][AVX1] Improve 256-bit vector costs for integer unary intrinsics.
Account for subvector extraction/insertion, helps prevent the vectorizers from selecting 256-bit vectors that will have to be split anyhow on AVX1 targets. 

llvm-svn: 302378
2017-05-07 20:58:55 +00:00
Lang Hames
03a4613bc2 [Orc] Remove trailing whitespace.
llvm-svn: 302377
2017-05-07 20:39:46 +00:00
Sanjay Patel
9bbe228e3d [InstSimplify] add tests for PR32949 miscompile; NFC
llvm-svn: 302374
2017-05-07 18:19:13 +00:00
Zvi Rackover
e274f9ca04 InstructionSimplify: Relanding r301766
Summary:
Re-applying r301766 with a fix to a typo and a regression test.

The log message for r301766 was:
==================================================================================
    InstructionSimplify: Canonicalize shuffle operands. NFC-ish.

    Summary:
     Apply canonicalization rules:
        1. Input vectors with no elements selected from can be replaced with undef.
        2. If only one input vector is constant it shall be the second one.

    This allows constant-folding to cover more ad-hoc simplifications that
    were in place and avoid duplication for RHS and LHS checks.

    There are more rules we may want to add in the future when we see a
    justification. e.g. mask elements that select undef elements can be
    replaced with undef.
==================================================================================

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 302373
2017-05-07 18:16:37 +00:00
Lang Hames
e759a41442 Make llvm-rtdlyd -check preserve automatic address mappings made by RuntimeDyld.
Currently llvm-rtdyld in -check mode will map sections to back-to-back 4k
aligned slabs starting at 0x1000. Automatically remapping sections by default is
helpful because it quickly exposes relocation bugs due to use of local addresses
rather than load addresses (these would silently pass if the load address was
not remapped). These mappings can be explicitly overridden on a per-section
basis using llvm-rtdlyd's -map-section option. This patch extends this scheme to
also preserve any mappings made by RuntimeDyld itself. Preserving RuntimeDyld's
automatic mappings allows us to write test cases to verify that these automatic
mappings have been applied.

This will allow the fix in https://reviews.llvm.org/D32899 to be tested with
llvm-rtdyld -check.

llvm-svn: 302372
2017-05-07 17:19:53 +00:00
Craig Topper
d2d0986b7c [SCEV] Use move semantics in ScalarEvolution::setRange
Summary: This makes setRange take ConstantRange by rvalue reference since most callers were passing an unnamed temporary ConstantRange. We can then move that ConstantRange into the DenseMap caches. For the callers that weren't passing a temporary, I've added std::move to to the local variable being passed.

Reviewers: sanjoy, mzolotukhin, efriedma

Reviewed By: sanjoy

Subscribers: takuto.ikuta, llvm-commits

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

llvm-svn: 302371
2017-05-07 16:28:17 +00:00
Sanjay Patel
41b5979dcf [InstSimplify] use ConstantRange to simplify or-of-icmps
We can simplify (or (icmp X, C1), (icmp X, C2)) to 'true' or one of the icmps in many cases.
I had to check some of these with Alive to prove to myself it's right, but everything seems 
to check out. Eg, the deleted code in instcombine was completely ignoring predicates with
mismatched signedness.

This is a follow-up to:
https://reviews.llvm.org/rL301260
https://reviews.llvm.org/D32143

llvm-svn: 302370
2017-05-07 15:11:40 +00:00
Peter Szecsi
22df982bb3 [Kaleidoscope] toy.cpp use after move fix
The variable Proto is moved at the beginning of the codegen() function.
According to the comment above, the pointed object should be used due the
reference P.

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

llvm-svn: 302369
2017-05-07 11:00:01 +00:00
Sanjoy Das
120ac49e07 Remove unnecessary const_cast
llvm-svn: 302368
2017-05-07 05:29:36 +00:00
Sanjoy Das
9340f1ac11 Use array_pod_sort instead of std::sort
llvm-svn: 302367
2017-05-07 05:29:34 +00:00
Lang Hames
f6cb9d9b21 Fix comment.
llvm-svn: 302366
2017-05-07 03:54:53 +00:00
Saleem Abdulrasool
9cd8c8df40 COFF: add ARM64 relocation types
Add the ARM64 COFF relocation types.  This will be needed to add support
for the AArch64 Windows object file emission support.

llvm-svn: 302365
2017-05-06 23:48:02 +00:00
Simon Pilgrim
dbf61bb821 [X86][AVX512] Relax assertion and just exit combine for unsupported types (PR32907)
llvm-svn: 302361
2017-05-06 20:53:52 +00:00
Simon Pilgrim
f17aa562a5 [X86][AVX512] Move v2i64/v4i64 VPABS lowering to tablegen
Extend NoVLX targets to use the 512-bit versions

llvm-svn: 302359
2017-05-06 19:11:59 +00:00