Commit Graph

2096 Commits

Author SHA1 Message Date
Kang Zhang
9c0652abaf [PowerPC] Add initialization for some ppc passes
Summary:

Some llc debug options need pass-name as the parameters.
But if we use the pass-name ppc-early-ret, we will get below error:
llc test.ll -stop-after ppc-early-ret
LLVM ERROR: "ppc-early-ret" pass is not registered.
Below pass-names have the pass is not registered error:
ppc-ctr-loops
ppc-ctr-loops-verify
ppc-loop-preinc-prep
ppc-toc-reg-deps
ppc-vsx-copy
ppc-early-ret
ppc-vsx-fma-mutate
ppc-vsx-swaps
ppc-reduce-cr-ops
ppc-qpx-load-splat
ppc-branch-coalescing
ppc-branch-select

Reviewed By: jsji

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358271 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 09:59:40 +00:00
Eric Christopher
9b4c3643b3 Revert "[PowerPC] Add initialization for some ppc passes"
This reverts commit 6f8f98ce8de7c0e4ebd7fa2e1fd9507fe8d1c317 as it
is breaking nearly every bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358260 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 07:16:58 +00:00
Kang Zhang
fe3f5c800f [PowerPC] Add initialization for some ppc passes
Summary:

Some llc debug options need pass-name as the parameters.
But if we use the pass-name ppc-early-ret, we will get below error:
llc test.ll -stop-after ppc-early-ret
LLVM ERROR: "ppc-early-ret" pass is not registered.
Below pass-names have the pass is not registered error:
ppc-ctr-loops
ppc-ctr-loops-verify
ppc-loop-preinc-prep
ppc-toc-reg-deps
ppc-vsx-copy
ppc-early-ret
ppc-vsx-fma-mutate
ppc-vsx-swaps
ppc-reduce-cr-ops
ppc-qpx-load-splat
ppc-branch-coalescing
ppc-branch-select

Reviewed By: jsji

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358256 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 06:35:15 +00:00
Zi Xuan Wu
5268c8af52 [PowerPC] More precise exploitation of P9 maddld instruction when operands are constant
There are 3 operands of maddld, (add (mul %1, %2), %3) and sometimes
they are constant. If there is constant operand, it takes extra li to 
materialize the operand, and one more extra register too. So it's not 
profitable to use maddld to optimize mul-add pattern.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358253 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 05:21:31 +00:00
David Green
45a375eb6b Revert rL357745: [SelectionDAG] Compute known bits of CopyFromReg
Certain optimisations from ConstantHoisting and CGP rely on Selection DAG not
seeing through to the constant in other blocks. Revert this patch while we come
up with a better way to handle that.

I will try to follow this up with some better tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358113 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 18:00:41 +00:00
Chen Zheng
ed46a5f15d [PowerPC] initialize SchedModel according to platform.
Differential Revision: https://reviews.llvm.org/D60177


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357962 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 01:25:25 +00:00
Piotr Sobczak
959b42493f [SelectionDAG] Compute known bits of CopyFromReg
Summary:
Teach SelectionDAG how to compute known bits of ISD::CopyFromReg if
the virtual reg used has one def only.

This can be particularly useful when calling isBaseWithConstantOffset()
with the ISD::CopyFromReg argument, as more optimizations may get enabled
in the result.

Also add a missing truncation on X86, found by testing of this patch.

Change-Id: Id1c9fceec862d118c54a5b53adf72ada5d6daefa

Reviewers: bogner, craig.topper, RKSimon

Reviewed By: RKSimon

Subscribers: lebedev.ri, nemanjai, jvesely, nhaehnle, javed.absar, jsji, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357745 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-05 07:44:09 +00:00
Chen Zheng
68e1cfff74 [PowerPC]add testcase for ppcctrloops pass shortloop check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357560 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-03 03:11:34 +00:00
Nirav Dave
d3c5ebd041 [DAGCombine] Prune unnused nodes.
Summary:
Nodes that have no uses are eventually pruned when they are selected
from the worklist. Record nodes newly added to the worklist or DAG and
perform pruning after every combine attempt.

Reviewers: efriedma, RKSimon, craig.topper, spatel, jyknight

Reviewed By: jyknight

Subscribers: jdoerfert, jyknight, nemanjai, jvesely, nhaehnle, javed.absar, hiraditya, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357283 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 17:35:56 +00:00
Kang Zhang
16c4a8836b [PowerPC] Add the support for __builtin_setrnd()
Summary:
PowerPC64/PowerPC64le supports the builtin function __builtin_setrnd to set the floating point rounding mode. This function will use the least significant two bits of integer argument to set the floating point rounding mode.
double __builtin_setrnd(int mode);
The effective values for mode are:
0 - round to nearest
1 - round to zero
2 - round to +infinity
3 - round to -infinity
Note that the mode argument will modulo 4, so if the int argument is greater than 3, it will only use the least significant two bits of the mode. Namely, builtin_setrnd(102)) is equal to builtin_setrnd(2).

Reviewed By: jsji

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357241 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 08:45:24 +00:00
Zi Xuan Wu
fc1bf1b19a [PowerPC] Strength reduction of multiply by a constant by shift and add/sub in place
A shift and add/sub sequence combination is faster in place of a multiply by constant. 
Because the cycle or latency of multiply is not huge, we only consider such following
worthy patterns.

```
(mul x, 2^N + 1) => (add (shl x, N), x)
(mul x, -(2^N + 1)) => -(add (shl x, N), x)
(mul x, 2^N - 1) => (sub (shl x, N), x)
(mul x, -(2^N - 1)) => (sub x, (shl x, N))
```

And the cycles or latency is subtarget-dependent so that we need consider the
subtarget to determine to do or not do such transformation. 
Also data type is considered for different cycles or latency to do multiply.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357233 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-29 03:08:39 +00:00
Nirav Dave
b4adfc21eb Revert r356996 "[DAG] Avoid smart constructor-based dangling nodes."
This patch appears to trigger very large compile time increases in
halide builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357116 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-27 19:54:41 +00:00
Stefan Pintilie
9d733a24e0 [PowerPC] Remove UseVSXReg
The UseVSXReg flag can be safely removed and the code cleaned up.

Patch By: Yi-Hong Liu

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357028 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 20:28:21 +00:00
Nirav Dave
de6ac6d211 [DAG] Avoid smart constructor-based dangling nodes.
Various SelectionDAG non-combine operations (e.g. the getNode smart
constructor and legalization) may leave dangling nodes by applying
optimizations or not fully pruning unused result values. This can
result in nodes that are never added to the worklist and therefore can
not be pruned.

Add a node inserter as the current node deleter to make sure such
nodes have the chance of being pruned.

Many minor changes, mostly positive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356996 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 15:08:14 +00:00
Matt Arsenault
51c2ad77cd RegAllocFast: Remove early selection loop, the spill calculation will report cost 0 anyway for free regs
The 2nd loop calculates spill costs but reports free registers as cost
0 anyway, so there is little benefit from having a separate early
loop.

Surprisingly this is not NFC, as many register are marked regDisabled
so the first loop often picks up later registers unnecessarily instead
of the first one available in the allocation order...

Patch by Matthias Braun

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356499 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-19 19:01:34 +00:00
Nirav Dave
154874adc5 [DAGCombiner] If a TokenFactor would be merged into its user, consider the user later.
Summary:
A number of optimizations are inhibited by single-use TokenFactors not
being merged into the TokenFactor using it. This makes we consider if
we can do the merge immediately.

Most tests changes here are due to the change in visitation causing
minor reorderings and associated reassociation of paired memory
operations.

CodeGen tests with non-reordering changes:

  X86/aligned-variadic.ll -- memory-based add folded into stored leaq
  value.

  X86/constant-combiners.ll -- Optimizes out overlap between stores.

  X86/pr40631_deadstore_elision -- folds constant byte store into
  preceding quad word constant store.

Reviewers: RKSimon, craig.topper, spatel, efriedma, courbet

Reviewed By: courbet

Subscribers: dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, eraman, hiraditya, kbarton, jrtc27, atanasyan, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356068 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-13 17:07:09 +00:00
Jinsong Ji
f522bdf453 Set useful flags for vector imm setting instructions
Vector imm setting instructions like XXLXORz/XXLXORspz/XXLXORdpz
Should behave like LI8.

We should set corresponding flags to allow rematerialization and other
opts in LICM, RA, Scheduling etc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355948 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 18:27:09 +00:00
Jinsong Ji
d690dcb9da [NFC][PowerPC] Update testcases using utils/update_llc_test_checks.py
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355945 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 17:55:32 +00:00
Simon Pilgrim
88f77a47e9 [PowerPC] Use real pointers instead of undef
The reduced test removed the pointer arguments, but to better survive D58017 and D58070 we need them back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355532 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 18:49:39 +00:00
Guozhi Wei
005ab1287a [PPC] Adjust the computed branch offset for the possible shorter distance
In file PPCBranchSelector.cpp we tend to over estimate code size due to large
alignment and inline assembly. Usually it causes larger computed branch offset,
it is not big problem. But sometimes it may also causes smaller computed branch
offset than actual branch offset. If the offset is close to the limit of
encoding, it may cause problem at run time.
Following is a simplified example.

           actual        estimated
           address        address
 ...
bne Far      100            10c
.p2align 4
Near:        110            110
 ...
Far:        8108           8108

Actual offset:    0x8108 - 0x100 = 0x8008
Computed offset:  0x8108 - 0x10c = 0x7ffc

The computed offset is at most ((1 << alignment) - 4) bytes smaller than actual
offset. So we add this number to the offset for safety.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355529 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 18:22:22 +00:00
Strahinja Petrovic
69806c5e5c [PowerPC] Add secure plt support for TLS symbols
This patch supports secure plt mode for TLS symbols.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355513 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 15:00:10 +00:00
Chen Zheng
df3d6b9db8 [PowerPC] fix killed/dead flag after convert x-form to d-form tranformation.
Differential Revision: https://reviews.llvm.org/D58428


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355378 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 04:56:54 +00:00
Stefan Pintilie
acfc6c6aa1 [PowerPC] Move the stack pointer update instruction later in the prologue and earlier in the epilogue.
Move the stdu instruction in the prologue and epilogue.
This should provide a small performance boost in functions that are able to do
this. I've kept this change rather conservative at the moment and functions
with frame pointers or base pointers will not try to move the stack pointer
update.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355085 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-28 12:23:28 +00:00
Dmitri Gribenko
3a79f0dbdd Fixed a typo in the test s/CEHCK/CHECK/
Summary:
Turns out the test was not correct, I had to adjust the test to work.  I
also added CHECK-LABELs for better error messages from FileCheck while
I'm here.

Reviewers: jsji

Subscribers: nemanjai, eraman, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355079 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-28 10:56:39 +00:00
Joerg Sonnenberger
83855d225b Default to Secure PLT on PPC for NetBSD and OpenBSD.
This matches the default settings of clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355038 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 21:53:14 +00:00
Dmitri Gribenko
6be226648f Fixed typos in tests: s/CHEKC/CHECK/
Reviewers: ilya-biryukov

Subscribers: nemanjai, javed.absar, jsji, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354785 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-25 13:41:59 +00:00
Kang Zhang
7cb6f24031 [PowerPC] [PowerPC] Enhance the fast selection of fptoi & fptrunc instruction and clean up related asserts
Summary:
Fast selection of llvm fptoi & fptrunc instructions is not handled well about
VSX instruction support.
We'd use VSX float convert integer instruction instead of non-vsx float convert
integer instruction if the operand register class is VSSRC or VSFRC because i32
and i64 are mapped to VSSRC and VSFRC correspondingly if VSX feature is
openeded.
For float trunc instruction, we do this silimar work like float convert integer
instruction to try to use VSX instruction.

Reviewed By: jsji

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354762 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-25 02:46:16 +00:00
Nirav Dave
4741b755fc Disable big-endian constant store merges from rL354676.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354677 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-22 16:20:34 +00:00
Nirav Dave
4eee65a5d3 [DAGCombine] Fold overlapping constant stores
Fold a smaller constant store into larger constant stores immediately
preceeding it.

Reviewers: rnk, courbet

Subscribers: javed.absar, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354676 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-22 16:00:19 +00:00
Nirav Dave
30d1d86e1d [PPC] Add store merging testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354595 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-21 16:34:48 +00:00
Chen Zheng
7be6d48a75 [PowerPC] exploit P9 instruction maddld.
Differential Revision: https://reviews.llvm.org/D58364



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354427 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 02:30:06 +00:00
Stefan Pintilie
090fa34a28 [PowerPC][NFC] Added tests for prologue and epilogue code gen.
Added four test files to check the existing behaviour of prologue
and epilogue code generation. This patch was done as a setup for
the upcoming patch listed on Phabricator that will change how the
prologue and epilogue work.
The upcoming patch is: https://reviews.llvm.org/D42590

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353994 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 23:37:23 +00:00
Sanjay Patel
51dad635ad [DAGCombiner] convert logic-of-setcc into bit magic (PR40611)
If we're comparing some value for equality against 2 constants
and those constants have an absolute difference of just 1 bit,
then we can offset and mask off that 1 bit and reduce to a single
compare against zero:
         and/or (setcc X, C0, ne), (setcc X, C1, ne/eq) -->
         setcc ((add X, -C1), ~(C0 - C1)), 0, ne/eq

https://rise4fun.com/Alive/XslKj

This transform is disabled by default using a TLI hook
("convertSetCCLogicToBitwiseLogic()").

That should be overridden for AArch64, MIPS, Sparc and possibly
others based on the asm shown in:
https://bugs.llvm.org/show_bug.cgi?id=40611

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353859 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 17:07:47 +00:00
Simon Pilgrim
02b7d8fb42 [PowerPC] Regenerate test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353851 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 16:10:50 +00:00
Sanjay Patel
b6428b8bf9 [PowerPC] add tests for logic of setcc (PR40611); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353788 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 01:46:26 +00:00
Roland Froese
0783d48fed [PowerPC] Avoid scalarization of vector truncate
The PowerPC code generator currently scalarizes vector truncates that would fit in a vector register, resulting in vector extracts, scalar operations, and vector merges. This patch custom lowers a vector truncate that would fit in a register to a vector shuffle instead.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353724 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 17:29:14 +00:00
Nemanja Ivanovic
5f3121a8b0 [DAGCombine] Optimize pow(X, 0.75) to sqrt(X) * sqrt(sqrt(X))
The sqrt case is faster and we already do this for the case where
the exponent is 0.25. This adds the 0.75 case which is also not
sensitive to signed zeros.

Patch by Whitney Tsang (Whitney)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353557 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-08 19:50:58 +00:00
Sanjay Patel
df01cb5e33 [DAGCombiner] fold add/sub with bool operand based on target's boolean contents
I noticed that we are missing this canonicalization in IR:
rL352515
...and then realized that we don't get this right in SDAG either,
so this has to be fixed first regardless of what we choose to do in IR.

The existing fold was limited to scalars and using the wrong predicate
to guard the transform. We have a boolean contents TLI query that can
be used to decide which direction to fold.

This may eventually lead back to the problems/question in:
https://bugs.llvm.org/show_bug.cgi?id=40486
...but it makes no difference to that yet.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353433 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 17:43:34 +00:00
Roland Froese
e50fd44ed0 [PowerPC] Add vector truncate test to prep for D56507 NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353344 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-06 21:34:44 +00:00
Alina Sbirlea
aa5113ceaa [LICM/MSSA] Add promotion to scalars by building an AliasSetTracker with MemorySSA.
Summary:
Experimentally we found that promotion to scalars carries less benefits
than sinking and hoisting in LICM. When using MemorySSA, we build an
AliasSetTracker on demand in order to reuse the current infrastructure.
We only build it if less than AccessCapForMSSAPromotion exist in the
loop, a cap that is by default set to 250. This value ensures there are
no runtime regressions, and there are small compile time gains for
pathological cases. A much lower value (20) was found to yield a single
regression in the llvm-test-suite and much higher benefits for compile
times. Conservatively we set the current cap to a high value, but we will
explore lowering it when MemorySSA is enabled by default.

Reviewers: sanjoy, chandlerc

Subscribers: nemanjai, jlebar, Prazek, george.burgess.iv, jfb, jsji, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353339 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-06 20:25:17 +00:00
Sanjay Patel
39da3a3c7c [PowerPC] adjust test for uaddo change in rL353001
We don't need a mtctr/bctr for this test now; a regular
conditional branch is fine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353002 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-03 18:10:16 +00:00
Sanjay Patel
25df0ed1c5 [CGP] adjust target constraints for forming uaddo
There are 2 changes visible here:
1. There's no reason to limit this transform based on number
   of condition registers. That diff allows PPC to produce 
   slightly better (dot-instructions should be generally good) 
   code.
   Note: someone that cares about PPC codegen might want to 
   look closer at that output because it seems like we could
   still improve this.

2. We (probably?) should not bother trying to form uaddo (or
   other overflow ops) when there's no target support for such
   an op. This goes beyond checking whether the op is expanded
   because both PPC and AArch64 show better codegen for standard
   types regardless of whether the op is legal/custom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353001 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-03 17:53:09 +00:00
Sanjay Patel
bff7bbeefc [PowerPC] add tests for saturating add; NFC
This is copied from the existing test files for x86/AArch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352987 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-03 12:42:54 +00:00
Chen Zheng
7ecd40e2fe [PowerPC] delete no more needed workaround for readsRegister() in PowerPC
Differential Revision: https://reviews.llvm.org/D57439


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352689 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 23:18:38 +00:00
Chen Zheng
16cbc63cb0 [PowerPC] more opportunity for converting reg+reg to reg+imm
Differential Revision: https://reviews.llvm.org/D57314


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352583 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 01:57:01 +00:00
James Y Knight
b21d80e08f Adjust documentation for git migration.
This fixes most references to the paths:
 llvm.org/svn/
 llvm.org/git/
 llvm.org/viewvc/
 github.com/llvm-mirror/
 github.com/llvm-project/
 reviews.llvm.org/diffusion/

to instead point to https://github.com/llvm/llvm-project.

This is *not* a trivial substitution, because additionally, all the
checkout instructions had to be migrated to instruct users on how to
use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of
checking out various projects into various subdirectories.

I've attempted to not change any scripts here, only documentation. The
scripts will have to be addressed separately.

Additionally, I've deleted one document which appeared to be outdated
and unneeded:
  lldb/docs/building-with-debug-llvm.txt

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352514 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29 16:37:27 +00:00
Guozhi Wei
aeff6e76be [MBP] Don't move bottom block before header if it can't reduce taken branches
If bottom of block BB has only one successor OldTop, in most cases it is profitable to move it before OldTop, except the following case:

-->OldTop<-
|    .    |
|    .    |
|    .    |
---Pred   |
     |    |
    BB-----

Move BB before OldTop can't reduce the number of taken branches, this patch detects this case and prevent the moving.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352236 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25 19:45:13 +00:00
Zi Xuan Wu
be71419bf0 [PowerPC] Enhance the fast selection of cmp instruction and clean up related asserts
Fast selection of llvm icmp and fcmp instructions is not handled well about VSX instruction support.

We'd use VSX float comparison instruction instead of non-vsx float comparison instruction 
if the operand register class is VSSRC or VSFRC because i32 and i64 are mapped to VSSRC and 
VSFRC correspondingly if VSX feature is opened.

If the target does not have corresponding VSX instruction comparison for some type, 
just copy VSX-related register to common float register class and use non-vsx comparison instruction.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352174 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25 07:24:59 +00:00
Nemanja Ivanovic
81af257ae4 [PowerPC] Exploit store instructions that store a single vector element
This patch exploits the instructions that store a single element from a vector
to preform a (store (extract_elt)). We already have code that does this with
ISA 3.0 instructions that were added to handle i8/i16 types. However, we had
never exploited the existing ones that handle f32/f64/i32/i64 types.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352131 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24 23:44:28 +00:00
James Y Knight
46d00b498a Remove irrelevant references to legacy git repositories from
compiler identification lines in test-cases.

(Doing so only because it's then easier to search for references which
are actually important and need fixing.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351200 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 16:18:52 +00:00