Commit Graph

2145 Commits

Author SHA1 Message Date
Kevin P. Neal
e6e40ba9de Partial revert of revert of r361827: Add constrained intrinsic tests for powerpc64le.
The powerpc64-"nonle" tests are removed. They fail because of a bug that
Drew is currently working on that affects multiple targets.

Submitted by:	Drew Wock <drew.wock@sas.com>
Reviewed by:	Hal Finkel, Kevin P. Neal
Approved by:	Hal Finkel
Differential Revision:	http://reviews.llvm.org/D62388


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361985 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-29 16:29:31 +00:00
Adhemerval Zanella
29f026d977 [CodeGen] Add lrint/llrint builtins
This patch add the ISD::LRINT and ISD::LLRINT along with new
intrinsics.  The changes are straightforward as for other
floating-point rounding functions, with just some adjustments
required to handle the return value being an interger.

The idea is to optimize lrint/llrint generation for AArch64
in a subsequent patch.  Current semantic is just route it to libm
symbol.

Reviewed By: craig.topper

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361875 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 20:47:44 +00:00
Kevin P. Neal
64fe333f1e Revert 361827. It broke the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361831 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 14:37:45 +00:00
Kevin P. Neal
29c3789af8 Add constrained intrinsic tests for powerpc64 and powerpc64le.
Submitted by:	Drew Wock
Reviewed by:	Hal Finkel
Approved by:	Hal Finkel
Differential Revision:	https://reviews.llvm.org/D62388


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361827 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-28 14:17:48 +00:00
Sanjay Patel
1b57a73f6e [SelectionDAG] soften assertion when legalizing narrow vector FP ops
The test based on PR42010:
https://bugs.llvm.org/show_bug.cgi?id=42010
...may show an inaccuracy for PPC's target defs, but we should not
be so aggressive with an assert here. There's no telling what out-of-tree
targets look like.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361696 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-25 13:48:07 +00:00
Jason Liu
ea8ee651a9 Implement call lowering without parameters on AIX
Summary:dd
This patch implements call lowering for calls without parameters
on AIX as initial support.

Reviewers: sfertile, hubert.reinterpretcast, aheejin, efriedma

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361669 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-24 20:54:35 +00:00
Stefan Pintilie
c60409f121 [PowerPC] Remove CRBits Copy Of Unset/set CBit
For the situation, where we generate the following code:

       crxor 8, 8, 8
       < Some instructions>
.LBB0_1:
       < Some instructions>
       cror 1, 8, 8

cror (COPY of CRbit) depends on the result of the crxor instruction.
CR8 is known to be zero as crxor is equivalent to CRUNSET. We can simply use
crxor 1, 1, 1 instead to zero out CR1, which does not have any dependency on
any previous instruction.

This patch will optimize it to:

        < Some instructions>
.LBB0_1:
        < Some instructions>
        cror 1, 1, 1

Patch By: Victor Huang (NeHuang)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361632 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-24 12:05:37 +00:00
QingShan Zhang
f6b47d2a4f [Power9] Add a specific heuristic to schedule the addi before the load
When we are scheduling the load and addi, if all other heuristic didn't take effect,
 we will try to schedule the addi before the load, to hide the latency, and avoid the
 true dependency added by RA. And this only take effects for Power9.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361600 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-24 05:30:09 +00:00
Roman Lebedev
f2017db0bc UpdateTestChecks: ppc32 triple support
Summary:
Appears identical to powerpc64{,le}.
Regenerate test that is being affected by upcoming patch.

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: nemanjai, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361543 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-23 19:54:41 +00:00
Roman Lebedev
8f80fabdb2 [NFC][PPC] Autogenerate vec_add_sub_quadword.ll test
Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361525 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-23 18:08:26 +00:00
Roman Lebedev
dd86a3bd02 [NFC][PPC] Autogenerate vec_add_sub_doubleword.ll test
Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361524 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-23 18:08:21 +00:00
Kees Cook
40fd361936 [TargetLowering] Extend bool args to inline-asm according to getBooleanType
Summary:
This extends Krzysztof Parzyszek's X86-specific solution
(https://reviews.llvm.org/D60208) to the generic code pointed out by
James Y Knight.

Reviewers: kparzysz, craig.topper, nickdesaulniers

Subscribers: efriedma, sdardis, nemanjai, javed.absar, eraman, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, llvm-commits, srhines, void, nickdesaulniers, jyknight

Tags: #llvm

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361404 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-22 16:16:15 +00:00
Fangrui Song
41c36f8ae4 [PPC64] Parse -elfv1 -elfv2 when specified on target triple
Summary:
For big-endian powerpc64, the default ABI is ELFv1. OpenPower ABI ELFv2 is supported when -mabi=elfv2 is specified. FreeBSD support for PowerPC64 ELFv2 ABI with LLVM is in progress[1]. This patch adds an alternative way to specify ELFv2 ABI on target triple [2].

The following results are expected:

ELFv1 when using:
-target powerpc64-unknown-freebsd12.0
-target powerpc64-unknown-freebsd12.0 -mabi=elfv1
-target powerpc64-unknown-freebsd12.0-elfv1

ELFv2 when using:
-target powerpc64-unknown-freebsd12.0 -mabi=elfv2
-target powerpc64-unknown-freebsd12.0-elfv2

[1] https://wiki.freebsd.org/powerpc/llvm-elfv2
[2] https://clang.llvm.org/docs/CrossCompilation.html

Patch by Alfredo Dal'Ava Júnior!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361355 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-22 07:29:59 +00:00
Chen Zheng
0b2b4e1922 [PowerPC] [ISEL] select x-form instruction for unaligned offset
Differential Revision: https://reviews.llvm.org/D62173


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361346 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-22 02:57:31 +00:00
Yi-Hong Lyu
38b839d6c7 Move csr-save-restore-order.ll to the right place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361306 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-21 20:28:31 +00:00
QingShan Zhang
a89c4a773e [NFC][PowerPC] Add a test to verify if the scheduler schedule the addi before the load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361221 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-21 06:32:31 +00:00
Chen Zheng
131d940401 [PowerPC] test cases for selecting x-form instruction for unaligned offset - NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361219 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-21 05:06:09 +00:00
Clement Courbet
1160f948c2 Re-land r360859: "[MergeICmps] Simplify the code."
With a fix for PR41917: The predecessor list was changing under our feet.

-  for (BasicBlock *Pred : predecessors(EntryBlock_)) {
+  while (!pred_empty(EntryBlock_)) {
+    BasicBlock* const Pred = *pred_begin(EntryBlock_);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361009 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-17 09:43:45 +00:00
Nico Weber
db8503e5ea Revert r360859: "Reland r360771 "[MergeICmps] Simplify the code.""
It caused PR41917.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360963 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-17 00:43:53 +00:00
Adhemerval Zanella
51646414da [CodeGen] Add lround/llround builtins
This patch add the ISD::LROUND and ISD::LLROUND along with new
intrinsics.  The changes are straightforward as for other
floating-point rounding functions, with just some adjustments
required to handle the return value being an interger.

The idea is to optimize lround/llround generation for AArch64
in a subsequent patch.  Current semantic is just route it to libm
symbol.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360889 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-16 13:15:27 +00:00
Matt Arsenault
5fd17c6d29 RegAllocFast: Improve hinting heuristic
Trace through multiple COPYs when looking for a physreg source. Add
hinting for vregs that will be copied into physregs (we only hinted
for vregs getting copied to a physreg previously).  Give hinted a
register a bonus when deciding which value to spill.  This is part of
my rewrite regallocfast series. In fact this one doesn't even have an
effect unless you also flip the allocation to happen from back to
front of a basic block. Nonetheless it helps to split this up to ease
review of D52010

Patch by Matthias Braun

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360887 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-16 12:50:39 +00:00
Clement Courbet
ed46b2831a Reland r360771 "[MergeICmps] Simplify the code."
This revision does not seem to be the culprit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360859 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-16 06:18:02 +00:00
Nicolai Haehnle
ffd6774234 RegAlloc: try to fail more gracefully when out of registers
Summary:
The emitError path allows the program to continue, unlike report_fatal_error.
This is friendlier to use cases where LLVM is embedded in a larger program,
because the caller may be able to deal with the error somewhat gracefully.

Change the number of requested NOP bytes in the AArch64 and PowerPC
test cases to avoid triggering an unrelated assertion. The compilation
still fails, as verified by the test.

Change-Id: Iafb9ca341002a597b82e59ddc7a1f13c78758e3d

Reviewers: arsenm, MatzeB

Subscribers: qcolombet, nemanjai, wdng, javed.absar, kristof.beyls, kbarton, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360786 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-15 17:29:58 +00:00
Clement Courbet
1e3d019b42 Revert r360771 "[MergeICmps] Simplify the code."
Breaks a bunch of builbdots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360776 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-15 14:21:59 +00:00
Clement Courbet
de3c2efffe [MergeICmps] Simplify the code.
Instead of patching the original blocks, we now generate new blocks and
delete the old blocks. This results in simpler code with a less twisted
control flow (see the change in `entry-block-shuffled.ll`).

This will make https://reviews.llvm.org/D60318 simpler by making it more
obvious where control flow created and deleted.

Reviewers: gchatelet

Subscribers: hiraditya, llvm-commits, spatel

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360771 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-15 13:04:24 +00:00
Fangrui Song
d7a1a7be42 [IR] Disallow llvm.global_ctors and llvm.global_dtors of the 2-field form in textual format
The 3-field form was introduced by D3499 in 2014 and the legacy 2-field
form was planned to be removed in LLVM 4.0

For the textual format, this patch migrates the existing 2-field form to
use the 3-field form and deletes the compatibility code.
test/Verifier/global-ctors-2.ll checks we have a friendly error message.

For bitcode, lib/IR/AutoUpgrade UpgradeGlobalVariables will upgrade the
2-field form (add i8* null as the third field).

Reviewed By: rnk, dexonsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360742 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-15 02:35:32 +00:00
Lei Huang
b92f2f2fd2 [PowerPC] Custom lower known CR bit spills
For known CRBit spills, CRSET/CRUNSET, it is more efficient to load and spill
the known value instead of extracting the bit.

eg. This sequence is currently used to spill a CRUNSET:
    crclr   4*cr5+lt
    mfocrf  r3,4
    rlwinm  r3,r3,20,0,0
    stw     r3,132(r1)

This patch custom lower it to:
    li  r3,0
    stw r3,132(r1)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360677 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-14 14:27:06 +00:00
Jinsong Ji
2a870557eb [PowerPC][NFC] Fix typos in triples
Found by bzEq (Kai Luo).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360643 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-14 03:11:24 +00:00
Nick Desaulniers
f90dd6af95 [TargetLowering] Handle multi depth GEPs w/ inline asm constraints
Summary:
X86TargetLowering::LowerAsmOperandForConstraint had better support than
TargetLowering::LowerAsmOperandForConstraint for arbitrary depth
getelementpointers for "i", "n", and "s" extended inline assembly
constraints. Hoist its support from the derived class into the base
class.

Link: https://github.com/ClangBuiltLinux/linux/issues/469

Reviewers: echristo, t.p.northover

Reviewed By: t.p.northover

Subscribers: t.p.northover, E5ten, kees, jyknight, nemanjai, javed.absar, eraman, hiraditya, jsji, llvm-commits, void, craig.topper, nathanchance, srhines

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360604 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-13 17:27:44 +00:00
Lei Huang
5238a36901 [PowerPC] custom lower v2f64 fpext v2f32
Reduces scalarization overhead via custom lowering of v2f64 fpext v2f32.

eg. For the following IR
  %0 = load <2 x float>, <2 x float>* %Ptr, align 8
  %1 = fpext <2 x float> %0 to <2 x double>
  ret <2 x double> %1

Pre custom lowering:
  ld r3, 0(r3)
  mtvsrd f0, r3
  xxswapd vs34, vs0
  xscvspdpn f0, vs0
  xxsldwi vs1, vs34, vs34, 3
  xscvspdpn f1, vs1
  xxmrghd vs34, vs0, vs1

After custom lowering:
  lfd f0, 0(r3)
  xxmrghw vs0, vs0, vs0
  xvcvspdp vs34, vs0

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360429 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-10 14:04:06 +00:00
Nemanja Ivanovic
e515896823 [PowerPC][NFC] Add test for D60506 to show differences in code-gen
Differential revision: https://reviews.llvm.org/D61723


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360338 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-09 12:26:39 +00:00
QingShan Zhang
4bd9712688 [NFC][PowerPC] Add test for store combine optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360229 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-08 07:56:59 +00:00
QingShan Zhang
23785c65ac [CodeGenPrepare] Don't split the store if it is volatile
We shouldn't split the store when it is volatile.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360228 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-08 07:32:12 +00:00
Jinsong Ji
b8b7a3083e [PowerPC][NFC] Update build-vector-tests.ll using utils/update_llc_test_checks.py
build-vector-tests.ll is a huge testcase, it is hard to maintain: eg:
any fundamental changes might need to update hundreds of lines. We should
leverage the script to maintain it.

This patch simply run utils/update_llc_test_checks.py on it. There
should be no missing test points.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360175 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-07 17:29:44 +00:00
Nemanja Ivanovic
9817b74a74 [PowerPC] Use the two-constant NR algorithm for refining estimates
The single-constant algorithm produces infinities on a lot of denormal values.
The precision of the two-constant algorithm is actually sufficient across the
range of denormals. We will switch to that algorithm for now to avoid the
infinities on denormals. In the future, we will re-evaluate the algorithm to
find the optimal one for PowerPC.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360144 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-07 13:48:03 +00:00
Nemanja Ivanovic
8d416103aa [PowerPC] Fix erroneous condition for converting uint-to-fp vector conversion
A condition for exiting the legalization of v4i32 conversion to v2f64 through
extract/convert/build erroneously checks for the extract having type i32.
This is not adequate as smaller extracts are actually legalized to i32 as well.
Furthermore, an early exit is missing which means that we only check that
both extracts are from the same vector if that check fails.
As a result, both cases in the included test case fail - the first gets a
select error and the second generates incorrect code.

The culprit commit is r274535.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360043 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-06 13:35:49 +00:00
Matt Arsenault
edc4b49937 Reapply r359906, "RegAllocFast: Add heuristic to detect values not live-out of a block"
This reverts commit r359912.

This should pass now, since the clang test was made less fragile in
r359918.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359919 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-03 19:06:57 +00:00
Nico Weber
53c6ce1a39 Revert r359906, "RegAllocFast: Add heuristic to detect values not live-out of a block"
Makes clang/test/Misc/backend-stack-frame-diagnostics-fallback.cpp fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359912 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-03 18:08:03 +00:00
Matt Arsenault
ca31476482 RegAllocFast: Add heuristic to detect values not live-out of a block
Add an improved/new heuristic to catch more cases when values are not
live out of a basic block.

Patch by Matthias Braun

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359906 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-03 17:03:24 +00:00
Sanjay Patel
bb390d4f07 [PowerPC] add test that could infinite loop with reordered transforms; NFC
This is a slightly reduced version of the test from D61384.
Adding this as a preliminary step, so I can update D61149 with
the proposed fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359709 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 17:34:30 +00:00
Fangrui Song
fceaf762c0 [llvm-readobj] Change -t to --symbols in tests. NFC
-t is --symbols in llvm-readobj but --section-details (unimplemented) in readelf.
The confusing option should not be used since we aim for improving
compatibility.

Keep just one llvm-readobj -t use case in test/tools/llvm-readobj/symbols.test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359661 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-01 09:28:24 +00:00
Kang Zhang
4e6d30850c [NFC][PowerPC] Use -check-prefixes to simplify the check in code-align.ll
Summary:
When checking the same output, we can use the `-check-prefixes` to simplify the check.
For example, if we want to check below output.
```
; GENERIC-LABEL: .globl  foo
; BASIC-LABEL: .globl  foo
; PWR-LABEL: .globl  foo
; GENERIC: .p2align  2
; BASIC: .p2align  4
; PWR: .p2align  4
; GENERIC: @foo
; BASIC: @foo
; PWR: @foo

```
If we use `-check-prefixes`
```
... -check-prefixes=CHECK,GENERAL
... -check-prefixes=CHECK,BASIC
... -check-prefixes=CHECK,PWR
```
Above check can be simplify to:
```
; CHECK-LABEL: .globl  foo
; GENERIC: .p2align  2
; BASIC: .p2align  4
; PWR: .p2align  4
; CHECK: @foo
```

Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D61227


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359533 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 03:39:05 +00:00
Zi Xuan Wu
392c1020bc [DAGCombiner] Do not generate ISD::ADDE node if adde is not legal for the target when combine ISD::TRUNC node
Do not combine (trunc adde(X, Y, Carry)) into (adde trunc(X), trunc(Y), Carry), 
if adde is not legal for the target. Even it's at type-legalize phase. 
Because adde is special and will not be legalized at operation-legalize phase later.

This fixes: PR40922
https://bugs.llvm.org/show_bug.cgi?id=40922

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359532 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 03:01:14 +00:00
Ahsan Saghir
50257f1a7a Add __builtin_dcbf support for PPC
Summary:
This patch adds support for __builtin_dcbf for PPC.

__builtin_dcbf copies the contents of a modified block from the data cache
to main memory and flushes the copy from the data cache.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359517 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-29 23:25:33 +00:00
Roland Froese
076a39af99 [PowerPC] Try harder to avoid load/move-to VSR for partial vector loads
Change the PPCISelLowering.cpp function that decides to avoid update form in
favor of partial vector loads to know about newer load types and to not be
confused by the chain operand.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359504 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-29 21:08:35 +00:00
Nick Desaulniers
b3cb8ab451 [AsmPrinter] refactor to support %c w/ GlobalAddress'
Summary:
Targets like ARM, MSP430, PPC, and SystemZ have complex behavior when
printing the address of a MachineOperand::MO_GlobalAddress. Move that
handling into a new overriden method in each base class. A virtual
method was added to the base class for handling the generic case.

Refactors a few subclasses to support the target independent %a, %c, and
%n.

The patch also contains small cleanups for AVRAsmPrinter and
SystemZAsmPrinter.

It seems that NVPTXTargetLowering is possibly missing some logic to
transform GlobalAddressSDNodes for
TargetLowering::LowerAsmOperandForConstraint to handle with "i" extended
inline assembly asm constraints.

Fixes:
- https://bugs.llvm.org/show_bug.cgi?id=41402
- https://github.com/ClangBuiltLinux/linux/issues/449

Reviewers: echristo, void

Reviewed By: void

Subscribers: void, craig.topper, jholewinski, dschuff, jyknight, dylanmckay, sdardis, nemanjai, javed.absar, sbc100, jgravelle-google, eraman, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, jrtc27, atanasyan, jsji, llvm-commits, kees, tpimh, nathanchance, peter.smith, srhines

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359337 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-26 18:45:04 +00:00
Joerg Sonnenberger
4eb4e8f21e [PowerPC] Allow using initial-exec TLS with PIC
Using initial-exec TLS variables is a reasonable performance
optimisation for system libraries. Use the correct PIC mechanism to get
hold of the GOT to avoid text relocations.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359146 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 22:12:22 +00:00
Kang Zhang
a2c8107c80 [PowerPC] Fix wrong ElemSIze when calling isConsecutiveLS()
Summary:
This issue from the bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41177

When the two operands for BUILD_VECTOR are same, we will get assert error.
llvm::SDValue combineBVOfConsecutiveLoads(llvm::SDNode*, llvm::SelectionDAG&):
Assertion `!(InputsAreConsecutiveLoads && InputsAreReverseConsecutive) &&
"The loads cannot be both consecutive and reverse consecutive."' failed.

This error caused by the wrong ElemSIze when calling isConsecutiveLS(). We
should use `getScalarType().getStoreSize();` to get the ElemSize instread of
 `getScalarSizeInBits() / 8`.

Reviewed By: jsji

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358644 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-18 07:24:15 +00:00
Nick Desaulniers
4fe807c808 [AsmPrinter] defer %c to base class for ARM, PPC, and Hexagon. NFC
Summary:
None of these derived classes do anything that the base class cannot.
If we remove these case statements, then the base class can handle them
just fine.

Reviewers: peter.smith, echristo

Reviewed By: echristo

Subscribers: nemanjai, javed.absar, eraman, kristof.beyls, hiraditya, kbarton, jsji, llvm-commits, srhines

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358603 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 18:22:48 +00:00
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