Commit Graph

2066 Commits

Author SHA1 Message Date
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
Francis Visoiu Mistrih
08223c34d4 Replace "no-frame-pointer-*" function attributes with "frame-pointer"
Part of the effort to refactoring frame pointer code generation. We used
to use two function attributes "no-frame-pointer-elim" and
"no-frame-pointer-elim-non-leaf" to represent three kinds of frame
pointer usage: (all) frames use frame pointer, (non-leaf) frames use
frame pointer, (none) frame use frame pointer. This CL makes the idea
explicit by using only one enum function attribute "frame-pointer"

Option "-frame-pointer=" replaces "-disable-fp-elim" for tools such as
llc.

"no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" are still
supported for easy migration to "frame-pointer".

tests are mostly updated with

// replace command line args ‘-disable-fp-elim=false’ with ‘-frame-pointer=none’
grep -iIrnl '\-disable-fp-elim=false' * | xargs sed -i '' -e "s/-disable-fp-elim=false/-frame-pointer=none/g"

// replace command line args ‘-disable-fp-elim’ with ‘-frame-pointer=all’
grep -iIrnl '\-disable-fp-elim' * | xargs sed -i '' -e "s/-disable-fp-elim/-frame-pointer=all/g"

Patch by Yuanfang Chen (tabloid.adroit)!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351049 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-14 10:55:55 +00:00
Zi Xuan Wu
b813f92d5e Recommit "[PowerPC] Fix assert from machine verify pass that unmatched register class about fcmp selection in fast-isel"
This re-commit r350685.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350799 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-10 06:20:14 +00:00
Zi Xuan Wu
bccca22e8c Revert "[PowerPC] Fix assert from machine verify pass that unmatched register class about fcmp selection in fast-isel"
This reverts commit r350685.

See compile assert in compiler-rt.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350693 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 06:12:24 +00:00
Zi Xuan Wu
1a79f8b30a [PowerPC] Fix assert from machine verify pass that unmatched register class about fcmp selection in fast-isel
Bad machine code: Illegal virtual register for instruction

function: TestULE
basic block: %bb.0 entry (0x1000a39b158)
instruction: %2:crrc = FCMPUD %1:vsfrc, %3:f8rc
operand 1: %1:vsfrc

Fix assert about missing match between fcmp instruction and register class. 
We should use vsx related cmp instruction xvcmpudp instead of fcmpu when vsx is opened.

add -verifymachineinstrs option into related test cases to enable the verify pass.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350685 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 02:31:10 +00:00
QingShan Zhang
90ae81a0fa [Power9] Enable the Out-of-Order scheduling model for P9 hw
When switched to the MI scheduler for P9, the hardware is modeled as out of order.
However, inside the MI Scheduler algorithm, we still use the in-order scheduling model
as the MicroOpBufferSize isn't set. The MI scheduler take it as the hw cannot buffer
the op. So, only when all the available instructions issued, the pending instruction
could be scheduled. That is not true for our P9 hw in fact.

This patch is trying to enable the Out-of-Order scheduling model. The buffer size 44 is
picked from the P9 hw spec, and the perf test indicate that, its value won't hurt the cpu2017.

With this patch, there are 3 specs improved over 3% and 1 spec deg over 3%. The detail is as follows:

x264_r: +6.95%
cactuBSSN_r: +6.94%
lbm_r: +4.11%
xz_r: -3.85%

And the GEOMEAN for all the C/C++ spec in spec2017 is about 0.18% improved. 

Reviewer: Nemanjai
Differential Revision: https://reviews.llvm.org/D55810


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350285 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 05:04:18 +00:00
Craig Topper
6529ef607e [DAGCombiner][X86][PowerPC] Teach visitSIGN_EXTEND_INREG to fold (sext_in_reg (aext/sext x)) -> (sext x) when x has more than 1 sign bit and the sext_inreg is from one of them.
If x has multiple sign bits than it doesn't matter which one we extend from so we can sext from x's msb instead.

The X86 setcc-combine.ll changes are a little weird. It appears we ended up with a (sext_inreg (aext (trunc (extractelt)))) after type legalization. The sext_inreg+aext now gets optimized by this combine to leave (sext (trunc (extractelt))). Then we visit the trunc before we visit the sext. This ends up changing the truncate to an extractvectorelt from a bitcasted vector. I have a follow up patch to fix this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350235 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-02 17:58:27 +00:00
Wei Mi
86d9738a1c [PowerPC] Remove SeenUse check when optimizing conditional branch in
PPCPreEmitPeephole pass.

PPCPreEmitPeephole will convert a BC to B when the conditional branch is
based on a constant CR by CRSET or CRUNSET. This is added in
https://reviews.llvm.org/rL343100.

When the conditional branch is known to be always taken, all branches will
be removed and a new unconditional branch will be inserted. However, when
SeenUse is false the original patch will not remove the branches, but still
insert the new unconditional branch, update the successors and create
inconsistent IR. Compiling the synthetic testcase included can show the
problem we run into.

The patch simply removes the SeenUse condition when adding branches into
InstrsToErase set.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350223 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-02 17:07:23 +00:00
Kang Zhang
55e4ae96b0 [PowerPC] Fix machine verify pass error for PATCHPOINT pseudo instruction that bad machine code
Summary:
For SDAG, we pretend patchpoints aren't special at all until we emit the code for the pseudo.
Then the verifier runs and it seems like we have a use of an undefined register (the register will 
be reserved later, but the verifier doesn't know that).

So this patch call setUsesTOCBasePtr before emit the code for the pseudo, so verifier can know 
X2 is a reserved register.

Reviewed By: nemanjai

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350165 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-30 15:13:51 +00:00
Kang Zhang
dcca366145 [PowerPC] Fix ADDE, SUBE do not know how to promote operator
Summary:
This patch is created to fix the Bugzilla bug 39815:
https://bugs.llvm.org/show_bug.cgi?id=39815 

This patch is to support promotion integer result for the instruction ADDE, SUBE.

Reviewed By: hfinkel

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350161 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-30 07:48:09 +00:00
Nemanja Ivanovic
4125b366e1 [PowerPC] Complete the custom legalization of vector int to fp conversion
A recent patch has added custom legalization of vector conversions of
v2i16 -> v2f64. This just rounds it out for other types where the input vector
has an illegal (narrower) type than the result vector. Specifically, this will
handle the following conversions:

v2i8 -> v2f64
v4i8 -> v4f32
v4i16 -> v4f32

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350155 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-29 13:40:48 +00:00
Nemanja Ivanovic
d7217b281a [PowerPC] Fix CR Bit spill pseudo expansion
The current CRBIT spill pseudo-op expansion creates a KILL instruction
that kills the CRBIT and defines the enclosing CR field. However, this
paints a false picture to the register allocator that all bits in the CR
field are killed so copies of other bits out of the field become dead and
removable.
This changes the expansion to preserve the KILL flag on the CRBIT as an
implicit use and to treat the CR field as an undef input.

Thanks to Hal Finkel for the review and Uli Weigand for implementation input.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350153 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-29 11:43:54 +00:00
Hiroshi Inoue
bb0efe8412 [PowerPC] handle ISD:TRUNCATE in BitPermutationSelector
This is the last one in a series of patches to support better code generation for bitfield insert.
BitPermutationSelector already support ISD::ZERO_EXTEND but not TRUNCATE.
This patch adds support for ISD:TRUNCATE in BitPermutationSelector.

For example of this test case, 
struct s64b {
  int a:4;
  int b:16;
  int c:24;
};
void bitfieldinsert64b(struct s64b *p, unsigned char v) {
  p->b = v;
}

the selection DAG loos like:

t14: i32,ch = load<(load 4 from %ir.0)> t0, t2, undef:i64
       t18: i32 = and t14, Constant:i32<-1048561>
            t4: i64,ch = CopyFromReg t0, Register:i64 %1
          t22: i64 = AssertZext t4, ValueType:ch:i8
        t23: i32 = truncate t22
      t16: i32 = shl nuw nsw t23, Constant:i32<4>
    t19: i32 = or t18, t16
  t20: ch = store<(store 4 into %ir.0)> t14:1, t19, t2, undef:i64

By handling truncate in the BitPermutationSelector, we can use information from AssertZext when selecting t19 and skip the mask operation corresponding to t18.
So the generated sequences with and without this patch are

without this patch
	rlwinm 5, 5, 0, 28, 11 # corresponding to t18
	rlwimi 5, 4, 4, 20, 27
with this patch
	rlwimi 5, 4, 4, 12, 27

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350118 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-28 08:00:39 +00:00
QingShan Zhang
d966eee328 [PowerPC] Remove the implicit use of the register if it is replaced by Imm
If we are changing the MI operand from Reg to Imm, we need also handle its implicit use if have.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350115 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-28 03:38:09 +00:00
Zi Xuan Wu
b534db940c [PowerPC] Fix assert from machine verify pass that atomic pseudo expanding causes mismatched register class
For atomic value operand which less than 4 bytes need to be masked. 
And the related operation to calculate the newvalue can be done in 32 bit gprc. 
So just use gprc for mask and value calculation.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350113 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-28 02:12:55 +00:00
Chen Zheng
e63b22587b [PowerPC] fix register class after converting X-FORM instruction to D-FORM instruction
Differential Revision: https://reviews.llvm.org/D55806



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350111 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-28 01:02:35 +00:00
Kang Zhang
d2ca398f08 [PowerPC] Fix the bug of ISD::ADDE to set its second return type to glue
Summary:
This patch is to fix the bug imported by rL341634.
In above submit , the the return type of ISD::ADDE is 
14224: SDVTList VTs = DAG.getVTList(MVT::i64, MVT::i64), 
but in fact, the second return type of ISD::ADDE should be 
MVT::Glue not MVT::i64.

Reviewed By: hfinkel

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350061 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-25 03:29:51 +00:00
Clement Courbet
d60a72a44b Re-land r349731 "[CodeGen][ExpandMemcmp] Add an option for allowing overlapping loads.
Update PPC ir following GEP->bitcat to bitcat->GEP->bitcat change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349747 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-20 13:01:04 +00:00
Kang Zhang
26f63006cb [PowerPC] Implement the isSelectSupported() target hook
Summary:
PowerPC has scalar selects (isel) and vector mask selects (xxsel). But PowerPC
does not have vector CR selects, PowerPC does not support scalar condition 
selects on vectors.
In addition to implementing this hook, isSelectSupported() should return false
when the SelectSupportKind is ScalarCondVectorVal, so that predictable selects
are converted into branch sequences.

Reviewed By: steven.zhang,  hfinkel

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349727 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-20 06:19:59 +00:00
Amy Kwan
50ca11abbd Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349633 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 15:21:07 +00:00
Kewen Lin
979b87d6b7 [PowerPC]Exploit P9 vabsdu for unsigned vselect patterns
For type v4i32/v8ii16/v16i8, do following transforms:
  (vselect (setcc a, b, setugt), (sub a, b), (sub b, a)) -> (vabsd a, b)
  (vselect (setcc a, b, setuge), (sub a, b), (sub b, a)) -> (vabsd a, b)
  (vselect (setcc a, b, setult), (sub b, a), (sub a, b)) -> (vabsd a, b)
  (vselect (setcc a, b, setule), (sub b, a), (sub a, b)) -> (vabsd a, b)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 03:04:07 +00:00
Kewen Lin
d662b75286 [PowerPC][NFC]Update vabsd cases with vselect test cases
Power9 VABSDU* instructions can be exploited for some special vselect sequences.
Check in the orignal test case here, later the exploitation patch will update this 
and reviewers can check the differences easily.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349446 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 08:11:32 +00:00
Kewen Lin
a032360a02 [PowerPC] Exploit power9 new instruction setb
Check the expected pattens feeding to SELECT_CC like:
   (select_cc lhs, rhs,  1, (sext (setcc [lr]hs, [lr]hs, cc2)), cc1)
   (select_cc lhs, rhs, -1, (zext (setcc [lr]hs, [lr]hs, cc2)), cc1)
   (select_cc lhs, rhs,  0, (select_cc [lr]hs, [lr]hs,  1, -1, cc2), seteq)
   (select_cc lhs, rhs,  0, (select_cc [lr]hs, [lr]hs, -1,  1, cc2), seteq)
Further transform the sequence to comparison + setb if hits.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349445 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 07:53:26 +00:00
QingShan Zhang
a2fa464a64 [NFC] Add new test to cover the lhs scheduling issue for P9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349443 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 06:32:42 +00:00
QingShan Zhang
34ef4ce829 [NFC] fix test case issue that with wrong label check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349439 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 04:25:41 +00:00
Kewen Lin
5ebd7af2ed [PowerPC] Improve vec_abs on P9
Improve the current vec_abs support on P9, generate ISD::ABS node for vector types,
combine ABS node to VABSD node for some special cases to make use of P9 VABSD* insns,
do custom lowering to vsub(vneg later)+vmax if it has no combination opportunity.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349437 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-18 03:16:43 +00:00
Kewen Lin
847f938b2e [Power9][NFC]update vabsd case for better dumping
Appended options -ppc-vsr-nums-as-vr and -ppc-asm-full-reg-names to get the 
more descriptive output. Also removed useless function attributes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349329 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 06:32:02 +00:00
Kewen Lin
d279ef3f2d [Power9][NFC]Make pre-inc-disable case more robust
With some patch adopted for Power9 vabsd* insns, some CHECKs can't get the expected results.
But it's false alarm, we should update the case more robust.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349325 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 03:16:12 +00:00
Kewen Lin
1921566f91 [Power9][NFC] add setb exploitation test case
Add an original test case for setb before the exploitation actually takes effect, later we can check the difference.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349251 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-15 04:39:37 +00:00
Chen Zheng
514d2ac6ee [NFC][PowerPC] add verify-machineinstrs check
After rL349029 and rL348566, sj-ctr-loop.ll is ok for verify-machineinstrs check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349030 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-13 12:55:42 +00:00
Chen Zheng
cae6eb17b2 [PowerPC] intrinsic llvm.eh.sjlj.setjmp should not have flag isBarrier.
Differential Revision: https://reviews.llvm.org/D55499


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349029 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-13 12:25:20 +00:00