OSDN Git Service
Simon Pilgrim [Tue, 5 Sep 2017 14:32:06 +0000 (14:32 +0000)]
[AMDGPU] Added extra test checks to make D19325 diff clearer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312537
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 5 Sep 2017 13:40:29 +0000 (13:40 +0000)]
[X86] Limit store merge size when implicitfloat is enabled (PR34421)
As suggested by @niravd : https://bugs.llvm.org/show_bug.cgi?id=34421#c2
Differential Revision: https://reviews.llvm.org/D37464
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312534
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 5 Sep 2017 12:32:16 +0000 (12:32 +0000)]
Strip trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312531
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 5 Sep 2017 12:28:30 +0000 (12:28 +0000)]
[X86] Regenerate scalar rotation tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312530
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 5 Sep 2017 12:23:45 +0000 (12:23 +0000)]
[X86][AVX512] Use AVX512 attributes instead of -mcpu in vector shift tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312529
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 5 Sep 2017 12:05:14 +0000 (12:05 +0000)]
[X86][AVX512] Use AVX512 attributes instead of -mcpu
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312528
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Tue, 5 Sep 2017 11:59:16 +0000 (11:59 +0000)]
Fix test/DebugInfo/dwarfdump-decompression-invalid-size.test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312527
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Tue, 5 Sep 2017 11:21:38 +0000 (11:21 +0000)]
[Decompression] Fail gracefully when out of memory
This patch adds failing gracefully when running out of memory when
allocating a buffer for decompression.
This provides a work-around for:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3224
Differential revision: https://reviews.llvm.org/D37447
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312526
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Tue, 5 Sep 2017 08:22:47 +0000 (08:22 +0000)]
[ARM] GlobalISel: Minor cleanups in inst selector
Use the STI member of ARMInstructionSelector instead of
TII.getSubtarget() and also make use of STI's methods instead of
checking the object format manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312522
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Tue, 5 Sep 2017 07:57:41 +0000 (07:57 +0000)]
[ARM] GlobalISel: Support global variables for RWPI
In RWPI code, globals that are not read-only are accessed relative to
the SB register (R9). This is achieved by explicitly generating an ADD
instruction between SB and an offset that we either load from a constant
pool or movw + movt into a register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312521
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 5 Sep 2017 05:49:44 +0000 (05:49 +0000)]
[X86] Add hasSideEffects=0 and mayLoad=1 to some instructions that recently had their patterns removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312520
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 5 Sep 2017 05:26:38 +0000 (05:26 +0000)]
[InstCombine] Add test cases for folding (select (icmp ne/eq (and X, C1), (bitwiseop Y, C2), Y -> (bitwiseop Y, (shl/shr (and X, C1), C3)) or similar.
This is possible if C1 and C2 are both powers of 2. Or if binop is 'and' then ~C2 needs to be a power of 2.
We already support this for 'or', but we should be able to support 'and' and 'xor'. This will be enhanced by D37274.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312519
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 5 Sep 2017 05:26:37 +0000 (05:26 +0000)]
[InstCombine] Move foldSelectICmpAnd helper function earlier in the file to enable reuse in a future patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312518
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 5 Sep 2017 05:26:36 +0000 (05:26 +0000)]
[InstCombine] In foldSelectIntoOp, avoid creating a Constant before we know for sure we're going to use it and avoid an unnecessary call to m_APInt.
Instead of creating a Constant and then calling m_APInt with it (which will always return true). Just create an APInt initially, and use that for the checks in isSelect01 function. If it turns out we do need the Constant, create it from the APInt.
This is a refactor for a future patch that will do some more checks of the constant values here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312517
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 5 Sep 2017 05:06:05 +0000 (05:06 +0000)]
[ORC] Add some more docs/comments to the RemoteObjectLayer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312516
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 5 Sep 2017 04:31:14 +0000 (04:31 +0000)]
[ORC] Exclude RemoteObjectLayer from the ExecutionEngine module, as modules
builds seem to be having trouble with it.
http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/11401
When trying to link lli-child-target, the linker reports missing symbols for
the 'Name' members of 'rpc::Function<OrcRPCNegotiate, FunctionIdT(std::string)>'
(base class for OrcRPCNegotiate) and 'rpc::Function<OrcRPCResponse, void()>'
(base class for OrcRPCResponse), despite there being definitions for these
immediately below the rpc::Function class template.
This looks like the same bug that bit OrcRemoteTargetClient/Server in r286920.
<rdar://problem/
34249745>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312515
91177308-0d34-0410-b5e6-
96231b3b80d8
Hiroshi Inoue [Tue, 5 Sep 2017 04:15:17 +0000 (04:15 +0000)]
[PowerPC] eliminate redundant compare instruction
If multiple conditional branches are executed based on the same comparison, we can execute multiple conditional branches based on the result of one comparison on PPC. For example,
if (a == 0) { ... }
else if (a < 0) { ... }
can be executed by one compare and two conditional branches instead of two pairs of a compare and a conditional branch.
This patch identifies a code sequence of the two pairs of a compare and a conditional branch and merge the compares if possible.
To maximize the opportunity, we do canonicalization of code sequence before merging compares.
For the above example, the input for this pass looks like:
cmplwi r3, 0
beq 0, .LBB0_3
cmpwi r3, -1
bgt 0, .LBB0_4
So, before merging two compares, we canonicalize it as
cmpwi r3, 0 ; cmplwi and cmpwi yield same result for beq
beq 0, .LBB0_3
cmpwi r3, 0 ; greather than -1 means greater or equal to 0
bge 0, .LBB0_4
The generated code should be
cmpwi r3, 0
beq 0, .LBB0_3
bge 0, .LBB0_4
Differential Revision: https://reviews.llvm.org/D37211
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312514
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 5 Sep 2017 04:11:51 +0000 (04:11 +0000)]
[ORC] Drop callB wrapper from the remote object layer added in r312511.
This snippet was accidentally in the final commit, but is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312513
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 5 Sep 2017 03:34:09 +0000 (03:34 +0000)]
[ORC] Add a pair of ORC layers that forward object-layer operations via RPC.
This patch introduces RemoteObjectClientLayer and RemoteObjectServerLayer,
which can be used to forward ORC object-layer operations from a JIT stack in
the client to a JIT stack (consisting only of object-layers) in the server.
This is a new way to support remote-JITing in LLVM. The previous approach
(supported by OrcRemoteTargetClient and OrcRemoteTargetServer) used a
remote-mapping memory manager that sat "beneath" the JIT stack and sent
fully-relocated binary blobs to the server. The main advantage of the new
approach is that relocatable objects can be cached on the server and re-used
(if the code that they represent hasn't changed), whereas fully-relocated blobs
can not (since the addresses they have been permanently bound to will change
from run to run).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312511
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Tue, 5 Sep 2017 02:17:43 +0000 (02:17 +0000)]
NewGVN: Fix PR 34430 - we need to look through predicateinfo copies to detect self-cycles of phi nodes. We also need to not ignore certain types of arguments when testing whether the phi has a backedge or was originally constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312510
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Tue, 5 Sep 2017 02:17:42 +0000 (02:17 +0000)]
NewGVN: Fix PR 34452 by passing instruction all the way down when we do aggregate value simplification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312509
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Tue, 5 Sep 2017 02:17:41 +0000 (02:17 +0000)]
NewGVN: Detect copies through predicateinfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312508
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Tue, 5 Sep 2017 02:17:40 +0000 (02:17 +0000)]
NewGVN: Change where check for original instruction in phi of ops leader finding is done. Where we had it before, we would stop looking when we hit the original instruction, but skip it. Now we skip it and keep looking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312507
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 4 Sep 2017 22:01:25 +0000 (22:01 +0000)]
[x86] add tests for vector store merge opportunity; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312504
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 4 Sep 2017 21:46:05 +0000 (21:46 +0000)]
[x86] auto-generate complete checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312503
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 4 Sep 2017 21:43:32 +0000 (21:43 +0000)]
[x86] add/regenerate complete checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312502
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 4 Sep 2017 20:54:46 +0000 (20:54 +0000)]
[ORC] Refactor OrcRemoteTarget code to expose its RPC API, reduce
code duplication in the client, and improve error propagation.
This patch moves the OrcRemoteTarget rpc::Function declarations from
OrcRemoteTargetRPCAPI into their own namespaces under llvm::orc::remote so that
they can be used in new contexts (in particular, a remote-object-file adapter
layer that I will commit shortly).
Code duplication in OrcRemoteTargetClient (especially in loops processing the
code, rw-data and ro-data allocations) is removed by moving the loop bodies
into their own functions.
Error propagation is (slightly) improved by adding an ErrorReporter functor to
the OrcRemoteTargetClient -- Errors that can't be returned (because they occur
in destructors, or behind stable APIs that don't provide error returns) can be
sent to the ErrorReporter instead. Some methods in the Client API are also
changed to make better use of the Expected class: returning Expected<T>s rather
than returning Errors and taking T&s to store the results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312500
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 4 Sep 2017 17:21:17 +0000 (17:21 +0000)]
[x86] add test for unnecessary cmp + masked store; NFC
As noted in PR11210:
https://bugs.llvm.org/show_bug.cgi?id=11210
...fixing this should allow us to eliminate x86-specific masked store intrinsics in IR.
(Although more testing will be needed to confirm that.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312496
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam McCall [Mon, 4 Sep 2017 15:47:00 +0000 (15:47 +0000)]
Revert "Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding""
This crashes on boringSSL on PPC (will send reduced testcase)
This reverts commit r312328.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312490
91177308-0d34-0410-b5e6-
96231b3b80d8
Strahinja Petrovic [Mon, 4 Sep 2017 15:14:37 +0000 (15:14 +0000)]
Fix test/Transforms/GlobalOpt/integer-bool-dwarf
This patch fixes regression related with
integer-bool-dwarf test.
Patch by Nikola Prica.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312489
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Mon, 4 Sep 2017 14:15:34 +0000 (14:15 +0000)]
Update test for testing avx512
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312487
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 4 Sep 2017 13:51:57 +0000 (13:51 +0000)]
[X86][AVX512] Add support for VPERMILPS v16f32 shuffle lowering (PR34382)
Avoid use of VPERMPS where we don't need it by instead using the variable mask version of VPERMILPS for unary shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312486
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 4 Sep 2017 13:43:13 +0000 (13:43 +0000)]
Added shuffle test case from PR34382
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312485
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 4 Sep 2017 11:08:47 +0000 (11:08 +0000)]
Added shuffle test case from PR34369
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312481
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Mon, 4 Sep 2017 10:30:39 +0000 (10:30 +0000)]
[DebugInfo] - Fix for lld DWARF parsing of base address selection entries in range lists.
It solves issue of wrong section index evaluating for ranges when
base address is used.
Based on David Blaikie's patch D36097.
Differential revision: https://reviews.llvm.org/D37214
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312477
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Mon, 4 Sep 2017 09:31:32 +0000 (09:31 +0000)]
[X86] Replace -mcpu option with -mattr in LIT tests added in https://reviews.llvm.org/rL312442
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312474
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Mon, 4 Sep 2017 09:06:45 +0000 (09:06 +0000)]
[GlobalISel][X86] G_PHI support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312473
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Mon, 4 Sep 2017 08:35:13 +0000 (08:35 +0000)]
LoopVectorize: MaxVF should not be larger than the loop trip count
Summary:
Improve how MaxVF is computed while taking into account that MaxVF should not be larger than the loop's trip count.
Other than saving on compile-time by pruning the possible MaxVF candidates, this patch fixes pr34438 which exposed the following flow:
1. Short trip count identified -> Don't bail out, set OptForSize:=True to avoid tail-loop and runtime checks.
2. Compute MaxVF returned 16 on a target supporting AVX512.
3. OptForSize -> choose VF:=MaxVF.
4. Bail out because TripCount = 8, VF = 16, TripCount % VF !=0 means we need a tail loop.
With this patch step 2. will choose MaxVF=8 based on TripCount.
Reviewers: Ayal, dorit, mkuper, hfinkel
Reviewed By: hfinkel
Subscribers: hfinkel, llvm-commits
Differential Revision: https://reviews.llvm.org/D37425
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312472
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Mon, 4 Sep 2017 08:12:16 +0000 (08:12 +0000)]
[LoopUnroll][DebugInfo] Don't add metadata to unrolled remainder loop
Debug information can be, and was, corrupted when the runtime
remainder loop was fully unrolled. This is because a !null node can
be created instead of a unique one describing the loop. In this case,
the original node gets incorrectly updated with the NewLoopID
metadata.
In the case when the remainder loop is going to be quickly fully
unrolled, there isn't the need to add loop metadata for it anyway.
Differential Revision: https://reviews.llvm.org/D37338
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312471
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 4 Sep 2017 07:35:05 +0000 (07:35 +0000)]
[X86] Remove duplicate FMA patterns from the isel table.
This reorders some patterns to get tablegen to detect them as duplicates. Tablegen only detects duplicates when creating variants for commutable operations. It does not detect duplicates between the patterns as written in the td file. So we need to ensure all the FMA patterns in the td file are unique.
This also uses null_frag to remove some other unneeded patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312470
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 4 Sep 2017 06:59:50 +0000 (06:59 +0000)]
[X86] Mark the FMA nodes as commutable so tablegen will auto generate the patterns.
This uses the capability introduced in r312464 to make SDNode patterns commutable on the first two operands.
This allows us to remove some of the extra FMA patterns that have to put loads and mask operands in different places to cover all cases. This even includes patterns that were missing to support match a load in the first operand with FMA4. Non-broadcast loads with masking for AVX512.
I believe this is causing us to generate some duplicate patterns because tablegen's isomorphism checks don't catch isomorphism between the patterns as written in the td. It only detects isomorphism in the commuted variants it tries to create. The the unmasked 231 and 132 memory forms are isomorphic as written in the td file so we end up keeping both. I think we precommute the 132 pattern to fix this.
We also need a follow up patch to go back to the legacy FMA3 instructions and add patterns to the 231 and 132 forms which we currently don't have.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312469
91177308-0d34-0410-b5e6-
96231b3b80d8
Dean Michael Berris [Mon, 4 Sep 2017 05:34:58 +0000 (05:34 +0000)]
[XRay][CodeGen] Use PIC-friendly code in XRay sleds and remove synthetic references in .text
Summary:
This is a re-roll of D36615 which uses PLT relocations in the back-end
to the call to __xray_CustomEvent() when building in -fPIC and
-fxray-instrument mode.
Reviewers: pcc, djasper, bkramer
Subscribers: sdardis, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D37373
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312466
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 4 Sep 2017 03:44:33 +0000 (03:44 +0000)]
[TableGen] Teach tablegen to allow SDNPCommutable nodes with more than 2 operands.
Summary:
Tablegen already supports commutable instrinsics with more than 2 operands. There it just assumes the first two operands are commutable.
I plan to use this to improve the generation of FMA patterns in the X86 backend.
Reviewers: aymanmus, zvi, RKSimon, spatel, arsenm
Reviewed By: arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: https://reviews.llvm.org/D37430
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312464
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 4 Sep 2017 01:13:36 +0000 (01:13 +0000)]
[X86] Add a combine to recognize when we have two insert subvectors that together write the whole vector, but the starting vector isn't undef.
In this case we should replace the starting vector with undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312462
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 4 Sep 2017 01:13:34 +0000 (01:13 +0000)]
[X86] Remove some unnecessary curly braces and blank line. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312461
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 3 Sep 2017 22:25:52 +0000 (22:25 +0000)]
[X86] Add a combine to turn (insert_subvector zero, (insert_subvector zero, X, Idx), Idx) into an insert of X into the larger zero vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312460
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 3 Sep 2017 22:25:50 +0000 (22:25 +0000)]
[X86] Add more patterns to use moves to zero the upper portions of a vector register that I missed in r312450.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312459
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 3 Sep 2017 22:25:49 +0000 (22:25 +0000)]
[X86] Combine inserting a vector of zeros into a vector of zeros just the larger vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312458
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 3 Sep 2017 17:52:25 +0000 (17:52 +0000)]
[X86] Add patterns to turn an insert into lower subvector of a zero vector into a move instruction which will implicitly zero the upper elements.
Ideally we'd be able to emit the SUBREG_TO_REG without the explicit register->register move, but we'd need to be sure the producing operation would select something that guaranteed the upper bits were already zeroed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312450
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 3 Sep 2017 17:52:23 +0000 (17:52 +0000)]
[X86] Add VBLENDPS/VPBLENDD to the execution domain fixing tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312449
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 3 Sep 2017 17:52:19 +0000 (17:52 +0000)]
[X86] Canonicalize (concat_vectors X, zero) -> (insert_subvector zero, X, 0).
In a future patch, I plan to teach isel to use a small vector move with implicit zeroing of the upper elements when it sees the (insert_subvector zero, X, 0) pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312448
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 3 Sep 2017 15:35:10 +0000 (15:35 +0000)]
[InstCombine] add tests for fcmp ord/uno canonicalization; NFC
Currently, we canonicalize some cases to use 0.0, but we miss others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312445
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Sun, 3 Sep 2017 15:06:26 +0000 (15:06 +0000)]
[X86] Add -mtriple option to LIT tests added in https://reviews.llvm.org/rL312442
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312443
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Sun, 3 Sep 2017 13:53:44 +0000 (13:53 +0000)]
[X86][AVX512] Add simple tests for all AVX512 shuffle instructions.
Throughout an effort to strongly check the behavior of CodeGen with the IR shufflevector instruction we generated many tests while predicting the best X86 sequence that may be generated.
This is a subset of the generated tests that we think may add value to our X86 set of tests.
Some of the checks are not optimal and will be changed after fixing:
1. PR34394
2. PR34382
3. PR34380
4. PR34359
Differential Revision: https://reviews.llvm.org/D37329
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312442
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Sun, 3 Sep 2017 10:44:18 +0000 (10:44 +0000)]
[X86] Add RUN line for LIT test committed in "rL312438: [X86] Fix crash on assert of non-simple type after type-legalization.".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312439
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Sun, 3 Sep 2017 09:09:16 +0000 (09:09 +0000)]
[X86] Fix crash on assert of non-simple type after type-legalization
The function combineShuffleToVectorExtend in DAGCombine might generate an illegal typed node after "legalize types" phase, causing assertion on non-simple type to fail afterwards.
Adding a type check in case the combine is running after the type legalize pass.
Differential Revision: https://reviews.llvm.org/D37330
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312438
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 3 Sep 2017 03:00:27 +0000 (03:00 +0000)]
Add llvm-isel-fuzzer to test/CMakeLists.txt
Tests were added that depend on llvm-isel-fuzzer in r312427, so the tests
should depend on the tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312433
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 3 Sep 2017 01:46:26 +0000 (01:46 +0000)]
[X86] Add output register to BTC/BTR/BTS instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312432
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sun, 3 Sep 2017 00:50:42 +0000 (00:50 +0000)]
[ORC] Add an Error return to the JITCompileCallbackManager::grow method.
Calling grow may result in an error if, for example, this is a callback
manager for a remote target. We need to be able to return this error to the
callee.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312429
91177308-0d34-0410-b5e6-
96231b3b80d8
Keith Wyss [Sun, 3 Sep 2017 00:40:13 +0000 (00:40 +0000)]
Revert "[XRay][tools] Function call stack based analysis tooling for XRay traces"
This reverts commit
204a65e0702847a1880336372ad7abd1df414b44.
Double ref qualifier failed bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312428
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Sun, 3 Sep 2017 00:37:39 +0000 (00:37 +0000)]
llvm-isel-fuzzer: Add some basic tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312427
91177308-0d34-0410-b5e6-
96231b3b80d8
Keith Wyss [Sun, 3 Sep 2017 00:03:47 +0000 (00:03 +0000)]
[XRay][tools] Function call stack based analysis tooling for XRay traces
This change introduces a subcommand to the llvm-xray tool called
"stacks" which allows for analysing XRay traces provided as inputs and
accounting time to stacks instead of just individual functions. This
gives us a more precise view of where in a program the latency is
actually attributed.
The tool uses a trie data structure to keep track of the caller-callee
relationships as we process the XRay traces. In particular, we keep
track of the function call stack as we enter functions. While we're
doing this we're adding nodes in a trie and indicating a "calls"
relatinship between the caller (current top of the stack) and the callee
(the new top of the stack). When we push function ids onto the stack, we
keep track of the timestamp (TSC) for the enter event.
When exiting functions, we are able to account the duration by getting
the difference between the timestamp of the exit event and the
corresponding entry event in the stack. This works even if we somehow
miss the exit events for intermediary functions (i.e. if the exit event
is not cleanly associated with the enter event at the top of the stack).
The output of the tool currently provides just the top N leaf functions
that contribute the most latency, and the top N stacks that have the
most frequency. In the future we can provide more sophisticated query
mechanisms and potentially an export to database feature to make offline
analysis of the stack traces possible with existing tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312426
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Sat, 2 Sep 2017 23:43:04 +0000 (23:43 +0000)]
Move some CLI utils out of llvm-isel-fuzzer and into the library
FuzzMutate might not be the best place for these, but it makes more
sense than an entirely new library for now. This will make setting up
fuzz targets with consistent CLI handling easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312425
91177308-0d34-0410-b5e6-
96231b3b80d8
Don Hinton [Sat, 2 Sep 2017 22:56:58 +0000 (22:56 +0000)]
Fix buildbot failures for new test that requires the X86 target be built.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312424
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sat, 2 Sep 2017 19:16:28 +0000 (19:16 +0000)]
[ORC] Update comments in RTDyldObjectLinkingLayer to refer to singular objects
rather than object sets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312423
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 2 Sep 2017 18:53:46 +0000 (18:53 +0000)]
[X86] Teach fastisel to handle zext/sext i8->i16 and sext i1->i8/i16/i32/i64
Summary:
ZExt and SExt from i8 to i16 aren't implemented in the autogenerated fast isel table because normal isel does a zext/sext to 32-bits and a subreg extract to avoid a partial register write or false dependency on the upper bits of the destination. This means without handling in fast isel we end up triggering a fast isel abort.
We had no custom sign extend handling at all so while I was there I went ahead and implemented sext i1->i8/i16/i32/i64 which was also missing. This generates an i1->i8 sign extend using a mask with 1, then an 8-bit negate, then continues with a sext from i8. A better sequence would be a wider and/negate, but would require more custom code.
Fast isel tests are a mess and I couldn't find a good home for the tests so I created a new one.
The test pr34381.ll had to have fast-isel removed because it was relying on a fast isel abort to hit the bug. The test case still seems valid with fast-isel disabled though some of the instructions changed.
Reviewers: spatel, zvi, igorb, guyblank, RKSimon
Reviewed By: guyblank
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37320
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312422
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 18:10:29 +0000 (18:10 +0000)]
[InstCombine] replace unnecessary fcmp fold with assert
See https://reviews.llvm.org/rL312411 for related InstSimplify tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312421
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 17:53:33 +0000 (17:53 +0000)]
[InstCombine] combine foldAndOfFCmps and foldOrOfFcmps; NFCI
In addition to removing chunks of duplicated code, we don't
want these to diverge. If there's a fold for one, there
should be a fold of the other via DeMorgan's Laws.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312420
91177308-0d34-0410-b5e6-
96231b3b80d8
Don Hinton [Sat, 2 Sep 2017 17:28:39 +0000 (17:28 +0000)]
[CMAKE] Move version control macros to AddLLVM.cmake so they can be reused by clang, etc.
Summary:
Move version control macros, find_first_existing_file and
find_first_existing_vc_file to AddLLVM.cmake so they can be reused by sub projects
like clang.
Differential Revision: https://reviews.llvm.org/D36971
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312419
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 17:17:17 +0000 (17:17 +0000)]
[InstCombine] fix misnamed locals and use them to reduce code; NFCI
We had these locals:
Value *Op0RHS = LHS->getOperand(1);
Value *Op1LHS = RHS->getOperand(0);
...so we confusingly transposed the meaning of left/right and op0/op1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312418
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 2 Sep 2017 16:41:55 +0000 (16:41 +0000)]
[LoopVectorize] Turn static DenseSet into switch.
LLVM transforms this into a bit test which is a lot faster and smaller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312417
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 16:32:37 +0000 (16:32 +0000)]
[InstCombine] remove unnecessary code; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312416
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 16:30:27 +0000 (16:30 +0000)]
[InstCombine] move related functions next to each other; NFC
This makes it easier to see that they're almost duplicates.
As with the similar icmp functions, there should be identical
folds for both logic ops because those are DeMorganized variants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312415
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 15:11:55 +0000 (15:11 +0000)]
[InstCombine] use local variable to reduce code duplication; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312414
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 14:38:15 +0000 (14:38 +0000)]
[InstSimplify] regenerate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312413
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 14:35:18 +0000 (14:35 +0000)]
[InstCombine] put 2 related tests in the same file; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312412
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 2 Sep 2017 14:27:00 +0000 (14:27 +0000)]
[InstSimplify] move fcmp simplification tests from InstCombine
These are all tests that result in a constant, so moving the tests over to where they are actually handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312411
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Shaposhnikov [Sat, 2 Sep 2017 08:19:01 +0000 (08:19 +0000)]
[llvm-dwp] Implement -e option
The binutils utility dwp has an option "-e"
https://gcc.gnu.org/wiki/DebugFissionDWP
to specify an executable/library to get the list
of *.dwo files from it. This option is particularly useful when
someone runs the tool manually outside of a build system.
This diff adds an implementation of "-e" to llvm-dwp.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D37371
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312409
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Sat, 2 Sep 2017 05:14:55 +0000 (05:14 +0000)]
Return copy of XML dump
COFF/DriverUtils.cpp uses buffer after WindowsManifestMerger destroyed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312408
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Sat, 2 Sep 2017 03:15:13 +0000 (03:15 +0000)]
llvm-mt: Fix memory management in WindowsManifestMergerImpl::getMergedManifest
Summary:
xmlDoc needs to be released with xmlFreeDoc.
XML_PARSE_NODICT is needed for safe moving nodes between documents.
Buffer returned from xmlDocDumpFormatMemoryEnc needs xmlFree, but it needs
outlive users of getMergedManifest results.
Reviewers: ecbeckmann, rnk, zturner, ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37321
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312406
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Sat, 2 Sep 2017 02:28:03 +0000 (02:28 +0000)]
[CMake][runtimes] Use target specific name for all runtimes targets
We need to use target specific name for all runtimes targets. Target
specific name means the name of target in the LLVM build is different
from the name in runtimes build (in LLVM build, it's suffixed by the
target itself). Previously we have only used target specific names for
check targets collected through SUB_CHECK_TARGETS, but that's not
sufficient, we need to use target specific names for all targets we're
exposing in LLVM build.
Fixes PR34335.
Differential Revision: https://reviews.llvm.org/D37245
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312405
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 2 Sep 2017 02:18:44 +0000 (02:18 +0000)]
Fix PR/33305. caused by trying to simplify expressions in phi of ops that should have no leaders.
Summary:
After a discussion with Rekka, i believe this (or a small variant)
should fix the remaining phi-of-ops problems.
Rekka's algorithm for completeness relies on looking up expressions
that should have no leader, and expecting it to fail (IE looking up
expressions that can't exist in a predecessor, and expecting it to
find nothing).
Unfortunately, sometimes these expressions can be simplified to
constants, but we need the lookup to fail anyway. Additionally, our
simplifier outsmarts this by taking these "not quite right"
expressions, and simplifying them into other expressions or walking
through phis, etc. In the past, we've sometimes been able to find
leaders for these expressions, incorrectly.
This change causes us to not to try to phi of ops such expressions.
We determine safety by seeing if they depend on a phi node in our
block.
This is not perfect, we can do a bit better, but this should be a
"correctness start" that we can then improve. It also requires a
bunch of caching that i'll eventually like to eliminate.
The right solution, longer term, to the simplifier issues, is to make
the query interface for the instruction simplifier/constant folder
have the flags we need, so that we can keep most things going, but
turn off the possibly-invalid parts (threading through phis, etc).
This is an issue in another wrong code bug as well.
Reviewers: davide, mcrosier
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D37175
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312401
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 2 Sep 2017 00:09:43 +0000 (00:09 +0000)]
[llvm-pdbutil] Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312395
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zemtsov [Fri, 1 Sep 2017 23:12:43 +0000 (23:12 +0000)]
Disable 64bit file position on old 32 bit Androids.
This is needed for building LLVM on Android with new NDK (newer
than r15c) and API level < 24. Android C library (Bionic) didn't have
support for 64 bit file position until Android N.
Differential Revision: https://reviews.llvm.org/D37314
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312389
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Fri, 1 Sep 2017 22:25:22 +0000 (22:25 +0000)]
[AMDGPU] Testcase for computeKnownBits recursion. NFC.
Testcase for rL312364:
[AMDGPU] Prevent infinite recursion in DAG.computeKnownBits()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312388
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Fri, 1 Sep 2017 22:17:14 +0000 (22:17 +0000)]
[MIParser] Ensure getHexUint doesn't produce APInts with a bitwidth of 0
If getHexUint reads in a hex 0, it will create an APInt with a value of 0.
The number of active bits on this APInt is used to calculate the bitwidth of
Result. The number of active bits is defined as an APInt's bitwidth - its
number of leading 0s. Since this APInt is 0, its bitwidth and number of leading
0s are equal.
Thus, Result is constructed with a bitwidth of 0, triggering an APInt assert.
This commit fixes that by checking if the APInt is equal to 0, and setting the
bitwidth to 32 if it is. Otherwise, it sets the bitwidth using getActiveBits.
This caused issues when compiling MIR files with successor probabilities. In
the case that a successor is tagged with a probability of 0, this assert would
fire on debug builds.
https://reviews.llvm.org/D37401
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312387
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Fri, 1 Sep 2017 21:37:29 +0000 (21:37 +0000)]
[Analysis, Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312383
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 1 Sep 2017 21:27:34 +0000 (21:27 +0000)]
[InstCombine][InstSimplify] Teach decomposeBitTestICmp to look through truncate instructions
This patch teaches decomposeBitTestICmp to look through truncate instructions on the input to the compare. If a truncate is found it will now return the pre-truncated Value and appropriately extend the APInt mask.
This allows some code to be removed from InstSimplify that was doing this functionality.
This allows InstCombine's bit test combining code to match a pre-truncate Value with the same Value appear with an 'and' on another icmp. Or it allows us to combine a truncate to i16 and a truncate to i8. This also required removing the type check from the beginning of getMaskedTypeForICmpPair, but I believe that's ok because we still have to find two values from the input to each icmp that are equal before we'll do any transformation. So the type check was really just serving as an early out.
There was one user of decomposeBitTestICmp that didn't want to look through truncates, so I've added a flag to prevent that behavior when necessary.
Differential Revision: https://reviews.llvm.org/D37158
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312382
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 1 Sep 2017 21:27:31 +0000 (21:27 +0000)]
[InstCombine] Don't require the compare types to be the same in getMaskedTypeForICmpPair.
A future patch will make the code look through truncates feeding the compare. So the compares might be different types but the pretruncated types might be the same.
This should be safe because we still require the same Value* to be used truncated or not in both compares. So that serves to ensure the types are the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312381
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 1 Sep 2017 21:27:29 +0000 (21:27 +0000)]
[InstCombine] When converting decomposeBitTestICmp's APInt return to ConstantInt, make sure we use the type from the Value* that was also returned from decomposeBitTestICmp.
Previously we used the type from the LHS of the compare, but a future patch will change decomposeBitTestICmp to look through truncates so it will return a pretruncated Value* and the type needs to match that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312380
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 1 Sep 2017 21:09:04 +0000 (21:09 +0000)]
[x86] eliminate redundant shuffle of horizontal math ops when both inputs are the same
This is limited to a set of patterns based on the example in PR34111:
https://bugs.llvm.org/show_bug.cgi?id=34111
...but as I was investigating this, I see that horizontal patterns can go wrong in many,
many other ways that would not be handled by this patch. Each data type may even go
different in the DAG after starting with the same basic IR pattern, so even proper IR
canonicalization won't fix it all.
Differential Revision: https://reviews.llvm.org/D37357
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312379
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Fri, 1 Sep 2017 20:43:20 +0000 (20:43 +0000)]
[AMDGPU] Prevent infinite recursion in DAG.computeKnownBits()
Differential Revision: https://reviews.llvm.org/D37392
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312364
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 1 Sep 2017 20:17:20 +0000 (20:17 +0000)]
Fix broken test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312359
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 1 Sep 2017 20:06:56 +0000 (20:06 +0000)]
[llvm-pdbutil] Support dumping CodeView from object files.
We have llvm-readobj for dumping CodeView from object files, and
llvm-pdbutil has always been more focused on PDB. However,
llvm-pdbutil has a lot of useful options for summarizing debug
information in aggregate and presenting high level statistical
views. Furthermore, it's arguably better as a testing tool since
we don't have to write tests to conform to a state-machine like
structure where you match multiple lines in succession, each
depending on a previous match. llvm-pdbutil dumps much more
concisely, so it's possible to use single-line matches in many
cases where as with readobj tests you have to use multi-line
matches with an implicit state machine.
Because of this, I'm adding object file support to llvm-pdbutil.
In fact, this mirrors the cvdump tool from Microsoft, which also
supports both object files and pdb files. In the future we could
perhaps rename this tool llvm-cvutil.
In the meantime, this allows us to deep dive into object files
the same way we already can with PDB files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312358
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 1 Sep 2017 19:54:08 +0000 (19:54 +0000)]
[TTI] Fix getGEPCost() for geps with a single operand.
Previously this would sporadically crash as TargetType
was never initialized. We special-case the single-operand
case returning earlier and trying to mimic the behaviour of
isLegalAddressingMode as closely as possible.
Differential Revision: https://reviews.llvm.org/D37277
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312357
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Fri, 1 Sep 2017 19:37:49 +0000 (19:37 +0000)]
llvm-isel-fuzzer: Weak function invoke the ire of PE/COFF
It's non-trivial to use weak symbols in a cross platform way (See
sanitizer_win_defs.h in compiler-rt), and doing it naively like we
have here causes some build failures:
http://lab.llvm.org:8011/builders/clang-with-thin-lto-windows/builds/1260
Instead of going down the rabbit hole of emulating weak symbols for
this very trivial dummy fuzzer driver, we can just rely on the fact
that we know which hooks any given fuzz target implements and forward
declare a normal symbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312354
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 1 Sep 2017 19:36:34 +0000 (19:36 +0000)]
[TTI] Initialize a value to trigger a crash deterministically.
We expect the pointer to be initialized by the above loop, but
if that's not executed, the contents are garbage.
A fix for the crash will be committed immediately after.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312353
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 1 Sep 2017 19:20:18 +0000 (19:20 +0000)]
NewGVN: Make sure we don't incorrectly use PredicateInfo when doing PHI of ops
Summary: When we backtranslate expressions, we can't use the predicateinfo, since we are evaluating them in a different context.
Reviewers: davide, mcrosier
Subscribers: sanjoy, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D37174
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312352
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 1 Sep 2017 18:38:02 +0000 (18:38 +0000)]
AMDGPU: Add ds_{read|write}_addtid_b32 definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312349
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 1 Sep 2017 18:36:26 +0000 (18:36 +0000)]
LiveIntervalAnalysis: Fix alias regunit reserved definition
A register in CodeGen can be marked as reserved: In that case we
consider the register always live and do not use (or rather ignore)
kill/dead/undef operand flags.
LiveIntervalAnalysis however tracks liveness per register unit (not per
register). We already needed adjustments for this in r292871 to deal
with super/sub registers. However I did not look at aliased register
there. Looking at ARM:
FPSCR (regunits FPSCR, FPSCR~FPSCR_NZCV) aliases with FPSCR_NZCV
(regunits FPSCR_NZCV, FPSCR~FPSCR_NZCV) hence they share a register unit
(FPSCR~FPSCR_NZCV) that represents the aliased parts of the registers.
This shared register unit was previously considered non-reserved,
however given that we uses of the reserved FPSCR potentially violate
some rules (like uses without defs) we should make FPSCR~FPSCR_NZCV
reserved too and stop tracking liveness for it.
This patch:
- Defines a register unit as reserved when: At least for one root
register, the root register and all its super registers are reserved.
- Adjust LiveIntervals::computeRegUnitRange() for new reserved
definition.
- Add MachineRegisterInfo::isReservedRegUnit() to have a canonical way
of testing.
- Stop computing LiveRanges for reserved register units in HMEditor even
with UpdateFlags enabled.
- Skip verification of uses of reserved reg units in the machine
verifier (this usually didn't happen because there would be no cached
liverange but there is no guarantee for that and I would run into this
case before the HMEditor tweak, so may as well fix the verifier too).
Note that this should only affect ARMs FPSCR/FPSCR_NZCV registers today;
aliased registers are rarely used, the only other cases are hexagons
P0-P3/P3_0 and C8/USR pairs which are not mixing reserved/non-reserved
registers in an alias.
Differential Revision: https://reviews.llvm.org/D37356
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312348
91177308-0d34-0410-b5e6-
96231b3b80d8