Commit Graph

162242 Commits

Author SHA1 Message Date
Mircea Trofin
7348dc2750 Revert "Revert "[lit] Generalized /dev/null support on Windows.""
Summary:
This reverts commit r328596.

Checking if the arguments are strings before testing if they contain "/dev/null".

Reviewers: rnk

Reviewed By: rnk

Subscribers: delcypher, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328603 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27 01:39:17 +00:00
Sanjay Patel
678a72e748 [x86] add RUN for target before roundss; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328601 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27 00:32:19 +00:00
Jan Korous
771829b640 [lit] Temporarily disable shtest-timeout.py on darwin
Disabled until fixed in order to avoid random failures on green dragon.

rdar://problem/38774530

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328598 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-27 00:16:28 +00:00
Mircea Trofin
35e080b536 Revert "[lit] Generalized /dev/null support on Windows."
This reverts commit ca7fdbb974.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328596 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 23:59:39 +00:00
David Blaikie
22f6baa132 Add a build dependency from libMC to libDebugInfoCodeView to match the reality of header dependencies here
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328595 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 23:48:52 +00:00
David Blaikie
1d4a167c65 Move CVDebugRecord from CodeView to Object to fix layering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328593 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 23:37:02 +00:00
Sanjay Patel
8fd84ebcf3 [x86] add tests for ftrunc; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328592 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 23:18:32 +00:00
Aaron Smith
2b889957ee [DebugInfoPDB] Print the method name along with the variant value
Before this change, using dumpProperties() with PDBSymbolData
would look like this:

  get_locationType: 3
  1

After this change:

  get_locationType: 3
  get_value: 1



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328590 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 22:53:38 +00:00
Mircea Trofin
ca7fdbb974 [lit] Generalized /dev/null support on Windows.
Generalized /dev/null remapping on Windows, and added test.

Reviewers: rnk

Reviewed By: rnk

Subscribers: amccarth, zturner, delcypher, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328589 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 22:41:06 +00:00
Aaron Smith
28ec98c907 [DebugInfoPDB] Add methods to get the compiland and line numbers with PDBSymbolData
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328587 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 22:17:12 +00:00
Aaron Smith
f975bab62f [DebugInfoPDB] Add DIA implementation of findLineNumbersByRVA
This method is used to find line numbers for PDBSymbolData
that have an invalid virtual address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328586 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 22:13:22 +00:00
Aaron Smith
af0c1412d9 [DebugInfoPDB] Add DIA implementation of addressForVA and addressForRVA
These are used in finding line numbers for PDBSymbolData


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328585 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 22:10:02 +00:00
Simon Pilgrim
aa18302e4f Fix newlines. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328583 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 21:07:59 +00:00
Simon Pilgrim
b72ac7e9e8 [X86] Add WriteCRC32 scheduler class
Currently CRC32 instructions use the WriteFAdd class, this patch splits them off into their own, at the moment it is still mostly just a duplicate of WriteFAdd but it can now be tweaked on a target by target basis.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328582 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 21:06:14 +00:00
Rafael Espindola
f9941d3c0d Use local symbols for creating .stack-size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328581 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 20:40:22 +00:00
Reid Kleckner
13e4ac0111 Fix go bindings test when using goma distributed build tool
Goma[1] is a distributed build system similar to distcc and icecc
primarily used to compile Chromium. The client is open source, and
hopefully soon the server will be as well. The intended usage model is
similar to most distributed build systems: prefix gomacc onto your
compiler command line, and it transparently distributes compilation.

The go lit config wants to determine the host compiler binary, so it
needs some extra logic to avoid looking at these prefixes.

[1] https://chromium.googlesource.com/infra/goma/client/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328580 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 20:19:14 +00:00
Paul Robinson
c7df4e42af Use correct format specifier.
Review comment on r328235 by James Henderson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328578 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 19:55:01 +00:00
Eli Friedman
b972acbf78 [MemorySSA] Fix exponential compile-time updating MemorySSA.
MemorySSAUpdater::getPreviousDefRecursive is a recursive algorithm, for
each block, it computes the previous definition for each predecessor,
then takes those definitions and combines them. But currently it doesn't
remember results which it already computed; this means it can visit the
same block multiple times, which adds up to exponential time overall.

To fix this, this patch adds a cache. If we computed the result for a
block already, we don't need to visit it again because we'll come up
with the same result. Well, unless we RAUW a MemoryPHI; in that case,
the TrackingVH will be updated automatically.

This matches the original source paper for this algorithm.

The testcase isn't really a test for the bug, but it adds coverage for
the case where tryRemoveTrivialPhi erases an existing PHI node. (It's
hard to write a good regression test for a performance issue.)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328577 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 19:52:54 +00:00
Krzysztof Parzyszek
cc9e41f605 [Hexagon] Assertion failure in HexagonSubtarget.cpp
In restoreLatency, replace range-for loop with std::find.

Patch by Jyotsna Verma.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328574 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 19:04:58 +00:00
Simon Pilgrim
ac9701c363 [X86][Btver2] Add (U)COMISD/(U)COMISD scheduler costs
Account for the "+i" integer pipe transfer cost (1cy use of JALU0 for GPR PRF write)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328573 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 19:01:06 +00:00
Haicheng Wu
648a6091ec [SLP] Add more checks to a test case. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328572 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 18:59:28 +00:00
Reid Kleckner
ff1d4d27d7 [X86] Fix Windows i1 zeroext conventions to use i8 instead of i32
Summary:
Re-lands r328386 and r328443, reverting r328482.

Incorporates fixes from @mstorsjo in D44876 (thanks!) so that small
parameters in i8 and i16 do not end up in the SysV register parameters
(EDI, ESI, etc).

I added tests for how we receive small parameters, since that is the
important part. It's always safe to store more bytes than will be read,
but the assumptions you make when loading them are what really matter.

I also tested this by self-hosting clang and it passed tests on win64.

Reviewers: mstorsjo, hans

Subscribers: hiraditya, mstorsjo, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328570 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 18:49:48 +00:00
Simon Pilgrim
33b38a21e8 [X86] Add WriteBitScan/WriteLZCNT/WriteTZCNT/WritePOPCNT scheduler classes (PR36881)
Give the bit count instructions their own scheduler classes instead of forcing them into existing classes.

These were mostly overridden anyway, but I had to add in costs from Agner for silvermont and znver1 and the Fam16h SoG for btver2 (Jaguar).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328566 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 18:19:28 +00:00
David Blaikie
a9c6c33abc Remove unused file, ExecutionEngine/MCJIT/ObjectBuffer.h
This header also wasn't self contained/modular - but with no users, it
didn't seem worth fixing because it'd break so easily again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328565 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 18:10:31 +00:00
Mandeep Singh Grang
61e5f25ff1 [XCore] Change std::sort to llvm::sort in response to r327219
Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.

Reviewers: dblaikie, RKSimon, robertlytton

Reviewed By: robertlytton

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328564 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 18:08:26 +00:00
Reid Kleckner
d15fdc63fa [lit] Implement 'cat' command for internal shell
Fixes PR36449

Patch by Chamal de Silva

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328563 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 18:05:12 +00:00
Zachary Turner
01931073eb Delete pdbutil diff mode.
This has been made obsolete by the fact that almost all of the
things it previously checked for are no longer relevant since
we can just compare bytes in a lot of places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328562 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 18:01:07 +00:00
Krzysztof Parzyszek
03a0661f60 [Hexagon] Add more lit tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328561 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 17:53:48 +00:00
Sanjay Patel
99cf6a153e [InstCombine] improve code comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328560 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 17:52:02 +00:00
Lei Huang
ae98859fc1 [Power9]Legalize and emit code for quad-precision convert from double-precision
Legalize and emit code for quad-precision floating point operation xscvdpqp
and add option to guard the quad precision operation support.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328558 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 17:46:25 +00:00
Stefan Pintilie
ba5863e984 [PowerPC] Infrastructure work. Implement getting the opcode for a spill in one place.
A new function getOpcodeForSpill should now be the only place to get
the opcode for a given spilled register.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328556 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 17:39:18 +00:00
Zaara Syeda
10fe375630 Disable [MachineLICM] Add functions to MachineLICM to hoist invariant stores
Disable https://reviews.llvm.org/D40196 with setting option
hoist-const-stores to false since failing s390 buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328555 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 17:22:33 +00:00
Krzysztof Parzyszek
e67cab7ed9 [Pipeliner] Several node-ordering fixes
First, we change the heuristic that is used to ignore the recurrent
node-sets in the node ordering. In certain cases it's not important
to focus on the recurrent node-sets.  Instead, the algorithm begins
by considering all the instructions in the node ordering step.

Second, a minor change to the bottom up traversal, which needs to
consider loop carried dependences (modeled as anti dependences).
Previously, these instructions were skipped, which caused problems
because the instruction ends up having both predecessors and
sucessors in the schedule.

Third, consider anti-dependences as a tie breaker when choosing
between instructions in the node ordering. We want to make sure
that the source of the anti-dependence does not end up with both
predecesssors and sucessors in the final node ordering.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328554 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 17:07:41 +00:00
Tim Corringham
476b2588b1 [AMDGPU] Improve disassembler error handling
Summary:
llvm-objdump now disassembles unrecognised opcodes as data, using
the .long directive. We treat unrecognised opcodes as being 32 bit
values, so move along 4 bytes rather than the single byte which
previously resulted in a cascade of bogus disassembly following an
unrecognised opcode.

While no solution can always disassemble code that contains
embedded data correctly this provides a significant improvement.

The disassembler will now cope with an arbitrary length section
as it no longer truncates it to a multiple of 4 bytes, and will
use the .byte directive for trailing bytes.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328553 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 17:06:33 +00:00
Simon Pilgrim
92d40b0a3d [X86][Btver2] Add CVTSI2SD/CVTSI2SS scheduler costs
We still need to account for how Jaguar passes data from GPR -> XMM, which isn't as clean as XMM -> GPR.....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328551 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 17:02:02 +00:00
Krzysztof Parzyszek
b22cddf04e [Pipeliner] Check for affine expression in isLoopCarriedOrder
The pipeliner must add a loop carried dependence between two memory
operations if the base register is not an affine (linear) exression.
The current implementation doesn't check how the base register is
defined, which allows non-affine expressions, and then the pipeliner
does not add a loop carried dependence when one is needed.

This patch adds code to isLoopCarriedOrder that checks if the base
register of the memory operations is defined by a phi, and the loop
definition for the phi is a constant increment value.  This is a very
simple check for a linear expression.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328550 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:58:40 +00:00
David Blaikie
42e9b96ddf Remove an unneeded (& mislayered) include from Target/TargetLoweringObjectFile on a CodeGen header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328549 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:57:31 +00:00
David Blaikie
fecaf52c6b Remove unneeded (& mislayered) include from TargetMachine.cpp on a CodeGen header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328548 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:52:10 +00:00
Krzysztof Parzyszek
b709662b9c [Pipeliner] Add missing loop carried dependences
The pipeliner is not adding a dependence edge for a loop carried
dependence, and ends up scheduling a load from iteration n prior
to an aliased store in iteration n-1.

The code that adds the loop carried dependences in the pipeliner
doesn't check if the memory objects for loads and stores are
"identified" (i.e., distinct) objects. If they are not, then the
code that adds the dependences needs to be conservative. The
objects can be used to check dependences only when they are
distinct objects.

The code that checks for loop carried dependences has been updated
to classify loads and stores that are not identified as "unknown"
values. A store with an "unknown" value can potentially create
a loop carried dependence with any pending load.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328547 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:50:11 +00:00
Haicheng Wu
b9e7253e39 [SLP] Add a test case. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328546 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:47:37 +00:00
Krzysztof Parzyszek
276ad3cf6c [Pipeliner] Fix renaming in pipeliner when eliminating phis
The phi renaming code in the pipeliner uses the wrong value when
rewriting phi uses, which results in an undefined value. In this
case, the original phi is no longer needed due to the order of
instruction in the pipelined loop. The pipeliner was assuming, in
this case, the the phi loop definition should be used to
rewrite the uses. However, the pipeliner needs to check to make
sure that the loop definition has already been scheduled. If not,
then the phi initial value needs to be used instead.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328545 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:41:36 +00:00
Krzysztof Parzyszek
2d4c98fec9 [Pipeliner] Fix number of phis to generate in the epilog
The pipeliner was generating too many phis in the epilog blocks, which
caused incorrect code generation when rewriting an instruction that uses
the phi.

In this case, there 3 prolog and epilog stages. An existing phi was
scheduled at stage 1. When generating the code for the 2nd epilog an
extra new phi was generated.

To fix this, we need to update the code that calculates the maximum
number of phis that can be generated, which is based upon the current
prolog stage and the stage of the original phi. In this case, when the
prolog stage is 1 and the original phi stage is 1, the maximum number
of phis to generate is 2.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328543 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:37:55 +00:00
Krzysztof Parzyszek
5f51cb0ad8 [Pipeliner] Use latency to compute RecMII
The patch contains severals changes needed to pipeline an example
that was transformed so that a Phi with a subreg is converted to
copies.

The pipeliner wasn't working for a couple of reasons.
- The RecMII was 3 instead of 2 due to the extra copies.
- Copy instructions contained a latency of 1.
- The node order algorithm was not choosing the best "bottom"
node, which caused an instruction to be scheduled that had a 
predecessor and successor already scheduled.
- Updated the Hexagon Machine Scheduler to check if the node is
latency bound when adding the cost for a 0-latency dependence.

The RecMII was 3 because the computation looks at the number of
nodes in the recurrence. The extra copy is an extra node but
it shouldn't increase the latency. The new RecMII computation
looks at the latency of the instructions in the recurrence. We
changed the latency of the dependence of a copy to 0. The latency
computation for the copy also checks the use of the copy (similar
to a reg_sequence).

The node order algorithm was not choosing the last instruction
in the recurrence for a bottom up traversal. This was when the
last instruction is a copy. A check was added when choosing the
instruction to check for NodeNum if the maxASAP is the same. This
means that the scheduler will not end up with another node in
the recurrence that has both a predecessor and successor already
scheduled.

The cost computation in Hexagon Machine Scheduler adds cost when
an instruction can be packetized with a zero-latency instruction.
We should only do this if the schedule is latency bound. 

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328542 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:33:16 +00:00
Simon Pilgrim
b483db269f [X86][Btver2] Add CVTSD2SS/CVTSS2SD scheduler costs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328541 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:24:13 +00:00
Krzysztof Parzyszek
6023f6ca35 [Pipeliner] Fix assert caused by pipeliner serialization
The pipeliner is asserting because the serialization step that 
occurs at the end is deleting an instruction.  The assert
occurs later on because there is a use without a definition.  

The problem occurs when an instruction defines a value used 
by a REQ_SEQUENCE and that value is used by a COPY instruction.
The latencies between these instructions are zero, so they are
put in to the same packet.  The serialization code is unable to
handle this correctly, and ends up putting the REG_SEQUENCE
before its definition.

There is special code in the serialization step that attempts
to handle zero-cost instructions (phis, copy, reg_sequence)
differently than regular instructions. Unfortunately, this means
the order does not come out correct.

This patch simplifies the code by changing the seperate steps for
handling zero-cost and regular instructions. Only phis are
handled separate now, since they should occurs first. Then, this
patch adds checks to make use the MoveUse is set to the smallest
value if there are multiple uses in a cycle.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328540 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:23:29 +00:00
Sebastian Pop
0c137c5660 [InstCombine] reassociate loop invariant GEP chains to enable LICM
This change brings performance of zlib up by 10%. The example below is from a
hot loop in longest_match() from zlib.

do.body:
  %cur_match.addr.0 = phi i32 [ %cur_match, %entry ], [ %2, %do.cond ]
  %idx.ext = zext i32 %cur_match.addr.0 to i64
  %add.ptr = getelementptr inbounds i8, i8* %win, i64 %idx.ext
  %add.ptr2 = getelementptr inbounds i8, i8* %add.ptr, i64 %idx.ext1
  %add.ptr3 = getelementptr inbounds i8, i8* %add.ptr2, i64 -1

In this example %idx.ext1 is a loop invariant. It will be moved above the use of
loop induction variable %idx.ext such that it can be hoisted out of the loop by
LICM. The operands that have dependences carried by the loop will be sinked down
in the GEP chain. This patch will produce the following output:

do.body:
  %cur_match.addr.0 = phi i32 [ %cur_match, %entry ], [ %2, %do.cond ]
  %idx.ext = zext i32 %cur_match.addr.0 to i64
  %add.ptr = getelementptr inbounds i8, i8* %win, i64 %idx.ext1
  %add.ptr2 = getelementptr inbounds i8, i8* %add.ptr, i64 -1
  %add.ptr3 = getelementptr inbounds i8, i8* %add.ptr2, i64 %idx.ext

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328539 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:19:31 +00:00
Krzysztof Parzyszek
42f8f944d9 [Pipeliner] Enable more base+offset dependence changes in pipeliner
The pipeliner changes dependences between base+offset instructions
(loads and stores) so that the instructions have more flexibility
to be scheduled with respect to each other. This occurs when the
pipeliner is able to compute that the instructions will not alias
if their order is changed. The prevous code enforced the alias
property by checking if the base register is the same, and that the
offset values are either both positive or negative.

This patch improves the alias check by using the API
areMemAccessesTriviallyDisjoint instead. This enables more cases,
especially if the offset is a negative value. The pipeliner uses
the function by creating a new instruction with the offset used
in the next iteration.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328538 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:17:06 +00:00
Krzysztof Parzyszek
1e6d98ea5e [Pipeliner] Fix calculation when reusing phis
A schedule may require that a phi from the original loop is used in
multiple iterations in the scheduled loop. When this occurs, we generate
multiple phis in the pipelined loop to save the value across iterations.

When we generate the new phis and update the register names in the
pipelined loop, the pipeliner attempts to reuse a previously generated
phi, when possible. The calculation for the name of the new phi needs
to account for the version/iteration of the original phi. Also, in the
epilog, the code only needs to check backwards for a previous iteration
until reaching the first prolog block.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328537 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:10:48 +00:00
Simon Pilgrim
f0568a860c [X86][Btver2] Account for the "+i" integer pipe transfer costs (1cy use of JALU0 for GPR PRF write)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328536 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:10:08 +00:00
Krzysztof Parzyszek
2fc30a3dc4 [Pipeliner] Fix check for order dependences when finalizing instructions
The code in orderDepdences that looks at the order dependences between
instructions was processing all the successor and predecessor order
dependences. However, we really only want to check for an order dependence
for instructions scheduled in the same cycle.

Also, fixed how the pipeliner handles output dependences. An output
dependence is also a potential loop carried dependence. The pipeliner
didn't handle this case properly so an invalid schedule could be created
that allowed an output dependence to be scheduled in the next iteration
at the same cycle.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328516 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 16:05:55 +00:00