40177 Commits

Author SHA1 Message Date
Mehdi Amini
33a6ab06c9 Use StringRef in ARMConstantPool APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:41:06 +00:00
Sanjay Patel
b60ab5d110 [Target] move reciprocal estimate settings from TargetOptions to TargetLowering
The motivation for the change is that we can't have pseudo-global settings for
codegen living in TargetOptions because that doesn't work with LTO.

Ideally, these reciprocal attributes will be moved to the instruction-level via
FMF, metadata, or something else. But making them function attributes is at least
an improvement over the current state.

The ingredients of this patch are:

    Remove the reciprocal estimate command-line debug option.
    Add TargetRecip to TargetLowering.
    Remove TargetRecip from TargetOptions.
    Clean up the TargetRecip implementation to work with this new scheme.
    Set the default reciprocal settings in TargetLoweringBase (everything is off).
    Update the PowerPC defaults, users, and tests.
    Update the x86 defaults, users, and tests.

Note that if this patch needs to be reverted, the related clang patch checked in
at r283251 should be reverted too.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 20:46:43 +00:00
Matthias Braun
627f6167c2 AArch64: Macrofusion: Split features, add missing combinations.
AArch64InstrInfo::shouldScheduleAdjacent() determines whether two
instruction can benefit from macroop fusion on apple CPUs. The list
turned out to be incomplete:
- the "rr" variants of the instructions were missing
- even the "rs" variants can have shift value == 0 and behave like the
  "rr" variants

This also splits the MacropFusion target feature into
ArithmeticBccFusion and ArithmeticCbzFusion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 19:28:21 +00:00
Nemanja Ivanovic
94ec1e3c4f [Power9] Exploit D-Form VSX Scalar memory ops that target full VSX register set
This patch corresponds to review:

The newly added VSX D-Form (register + offset) memory ops target the upper half
of the VSX register set. The existing ones target the lower half. In order to
unify these and have the ability to target all the VSX registers using D-Form
operations, this patch defines Pseudo-ops for the loads/stores which are
expanded post-RA. The expansion then choses the correct opcode based on the
register that was allocated for the operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283212 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 11:25:52 +00:00
Simon Dardis
c072c50d24 [mips][fastisel] Consider soft-float an unsupported floating point mode
Treat soft-float as unsupported for fast-isel. Additionally, ensure we check
that lowering f32 arguments also considers the case of soft-float mode.

Reviewers: ehostunreach, vkalintiris, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D24505


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 10:35:07 +00:00
Sjoerd Meijer
a074ac8dd7 Consistent fp denormal mode names. NFC.
This fixes the inconsistency of the fp denormal option names: in LLVM this was
DenormalType, but in Clang this is DenormalMode which seems better.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 08:03:36 +00:00
Nemanja Ivanovic
d0e875cdad [Power9] Part-word VSX integer scalar loads/stores and sign extend instructions
This patch corresponds to review:
https://reviews.llvm.org/D23155

This patch removes the VSHRC register class (based on D20310) and adds
exploitation of the Power9 sub-word integer loads into VSX registers as well
as vector sign extensions.
The new instructions are useful for a few purposes:

    Int to Fp conversions of 1 or 2-byte values loaded from memory
    Building vectors of 1 or 2-byte integers with values loaded from memory
    Storing individual 1 or 2-byte elements from integer vectors

This patch implements all of those uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 06:59:23 +00:00
Craig Topper
e17aeaefbf [X86] Add MOV8rm_NOREX to switch in isReallyTriviallyReMaterializable to match MOV8rm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 03:11:44 +00:00
Matt Arsenault
548c83d355 AMDGPU: Refactor indirect vector lowering
Allow inserting multiple instructions in the
expanded loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 01:41:05 +00:00
Matt Arsenault
dc1ddc021d AMDGPU: Factor SGPR spilling into separate functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 01:14:56 +00:00
Dan Gohman
3f22f87fb5 [WebAssembly] Update to more stack-machine-oriented terminology.
WebAssembly has officially switched from being an AST to being a stack
machine. Update various bits of terminology and README.md entries
accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:43:53 +00:00
Dan Gohman
bafb9a4eed [WebAssemby] Clean up an obsolete comment.
The comment is present inside the body of GetVRegDef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:32:21 +00:00
Matthias Braun
3d8b8c8458 TargetMachine: Make the win32-macho workaround more specific.
This is to avoid problems with win32 + ELF which surprisingly happens a
lot in practice: If a user just specifies -march on the commandline the
object format changes along with the architecture to ELF in many
instances while the OS stays with the default/host OS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:12:37 +00:00
Dan Gohman
1596f9b429 [WebAssembly] Delete an unused function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 22:06:28 +00:00
Dan Gohman
e2559a883e [WebAssembly] Fix indentation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 21:33:09 +00:00
Dan Gohman
e0c2ec2a7e [WebAssembly] Rename OPERAND_FP32IMM to OPERAND_F32IMM.
WebAssembly documentation consistently says "f32" rather than "fp32" to
describe 32-bit floating-point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 21:31:31 +00:00
Quentin Colombet
0a7ba882e5 [AArch64][RegisterBankInfo] Add getSameKindofOperandsMapping.
Refactor the code so that the same function can be used for all
instructions with all the same operands for up to 3 operands.

This is going to be useful for cast instructions.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:20:13 +00:00
Krzysztof Parzyszek
6f4042b831 [RDF] Fix liveness propagation through shadows
Each shadow only represents data flow that is restricted to its reaching
def. Propagating more than that could lead to spurious register liveness,
resulting in extra (incorrectly) block live-ins.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:17:20 +00:00
Matthias Braun
f455558a9f AArch64Subtarget: Remove unused CPUString field
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:17:02 +00:00
Matthias Braun
4f52404044 X86: Do not produce GOT relocations on windows
Windows has no GOT relocations the way elf/darwin has. Some people use
x86_64-pc-win32-macho to build EFI firmware; Do not produce GOT
relocations for this target.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:11:24 +00:00
Konstantin Zhuravlyov
49e7805871 [AMDGPU] Pass optimization level to SelectionDAGISel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 18:47:26 +00:00
Konstantin Zhuravlyov
1e8f5fd9f8 [AMDGPU] Sign extend AShr when promoting (instead of zero extending)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 18:29:01 +00:00
Krzysztof Parzyszek
4fbe7c8ae1 [RDF] Further improve readability of the graph
Print target basic block for a branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 17:54:33 +00:00
Krzysztof Parzyszek
d1ed87a667 [RDF] Replace RegisterAliasInfo with target-independent code using lane masks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 17:14:48 +00:00
Sanjay Patel
7b05e5c94e [x86, SSE/AVX] allow 128/256-bit lowering for copysign vector intrinsics (PR30433)
This should fix:
https://llvm.org/bugs/show_bug.cgi?id=30433

There are a couple of open questions about the codegen:
1. Should we let scalar ops be scalars and avoid vector constant loads/splats?
2. Should we have a pass to combine constants such as the inverted pair that we have here?

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 16:38:27 +00:00
Matt Arsenault
510a4bca2e AMDGPU: Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 13:06:58 +00:00
Volkan Keles
9920e54e99 Add new target hooks for LoadStoreVectorizer
Summary: Added 6 new target hooks for the vectorizer in order to filter types, handle size constraints and decide how to split chains.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, mzolotukhin, wdng, llvm-commits, nhaehnle

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 10:31:34 +00:00
Sjoerd Meijer
ec44dc9079 [ARM] Code size optimisation to lower udiv+urem to udiv+mls instead of a
library call to __aeabi_uidivmod. This is an improved implementation of
r280808, see also D24133, that got reverted because isel was stuck in a loop.
That was caused by the optimisation incorrectly triggering on i64 ints, which
shouldn't happen because there is no 64bit hwdiv support; that put isel's type
legalization and this optimisation in a loop. A native ARM compiler and testing
now shows that this is fixed.

Patch mostly by Pablo Barrio.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283098 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 10:12:32 +00:00
Konstantin Zhuravlyov
4d2168214e [AMDGPU] Remove unused variables from SIOptimizeExecMasking
Differential Revision: https://reviews.llvm.org/D25110


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:43:22 +00:00
Hal Finkel
dd1b9ba7a3 [PowerPC] Account for the ELFv2 function prologue during branch selection
The PPC branch-selection pass, which performs branch relaxation, needs to
account for the padding that might be introduced to satisfy block alignment
requirements. We were assuming that the first block was at offset zero (i.e.
had the alignment of the function itself), but under the ELFv2 ABI, a global
entry function prologue is added to the first block, and it is a
two-instruction sequence (i.e. eight-bytes long). If the function has 16-byte
alignment, the fact that the first block is eight bytes offset from the start
of the function is relevant to calculating where padding will be added in
between later blocks.

Unfortunately, I don't have a small test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 04:06:44 +00:00
Craig Topper
8fd6969a8b [AVX-512] Remove isCheapAsAMove flag from VMOVAPSZ128rm_NOVLX and friends.
This was accidentally copy and pasted from other Pseudos in the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 02:22:33 +00:00
Craig Topper
7036cb8dbf [X86] Mark all sizes of (V)MOVUPD as trivially rematerializable.
I don't know for sure that we truly needs this, but its the only vector load that isn't rematerializable. Making it consistent allows it to not be a special case in the td files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283083 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 02:00:29 +00:00
Simon Pilgrim
a96fb0875d [X86][AVX2] Add support for combining target shuffles to VPERMD/VPERMPS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 21:07:58 +00:00
Simon Pilgrim
9d7b8dc59c [X86][AVX] Ensure broadcast loads respect dependencies
To allow broadcast loads of a non-zero'th vector element, lowerVectorShuffleAsBroadcast can replace a load with a new load with an adjusted address, but unfortunately we weren't ensuring that the new load respected the same dependencies.

This patch adds a TokenFactor and updates all dependencies of the old load to reference the new load instead.

Bug found during internal testing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 15:59:15 +00:00
Craig Topper
a8c3c60282 [X86] Don't set i64 ADDC/ADDE/SUBC/SUBE as Custom if the target isn't 64-bit. This way we don't have to catch them and do nothing with them in ReplaceNodeResults.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 06:13:43 +00:00
Craig Topper
ca641f3453 [X86] Fix indentation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 06:13:40 +00:00
Hal Finkel
4c305bebf0 [PowerPC] Refactor soft-float support, and enable PPC64 soft float
This change enables soft-float for PowerPC64, and also makes soft-float disable
all vector instruction sets for both 32-bit and 64-bit modes. This latter part
is necessary because the PPC backend canonicalizes many Altivec vector types to
floating-point types, and so soft-float breaks scalarization support for many
operations. Both for embedded targets and for operating-system kernels desiring
soft-float support, it seems reasonable that disabling hardware floating-point
also disables vector instructions (embedded targets without hardware floating
point support are unlikely to have Altivec, etc. and operating system kernels
desiring not to use floating-point registers to lower syscall cost are unlikely
to want to use vector registers either). If someone needs this to work, we'll
need to change the fact that we promote many Altivec operations to act on
v4f32. To make it possible to disable Altivec when soft-float is enabled,
hardware floating-point support needs to be expressed as a positive feature,
like the others, and not a negative feature, because target features cannot
have dependencies on the disabling of some other feature. So +soft-float has
now become -hard-float.

Fixes PR26970.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 02:10:20 +00:00
Simon Pilgrim
ec8ee2ad55 [X86][SSE] Cleaned up shuffle decode assertion messages
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 20:12:56 +00:00
Simon Pilgrim
fc651f7cc1 Fix signed/unsigned warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283041 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 16:14:57 +00:00
Simon Pilgrim
20e8247890 [X86][SSE] Add support for combining target shuffles to binary BLEND
We already had support for 1-input BLEND with zero - this adds support for 2-input BLEND as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 16:04:28 +00:00
Simon Pilgrim
55ce06af6f [X86][SSE] Always combine target shuffles to MOVSD/MOVSS
Now we can commute to BLENDPD/BLENDPS on SSE41+ targets if necessary, so simplify the combine matching where we can.

This required me to add a couple of scalar math movsd/moss fold patterns that hadn't been needed in the past.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 15:33:01 +00:00
Simon Pilgrim
1c8d24e339 [X86][SSE] Enable commutation from MOVSD/MOVSS to BLENDPD/BLENDPS on SSE41+ targets
Instead of selecting between MOVSD/MOVSS and BLENDPD/BLENDPS at shuffle lowering by subtarget this will help us select the instruction based on actual commutation requirements.

We could possibly add BLENDPD/BLENDPS -> MOVSD/MOVSS commutation and MOVSD/MOVSS memory folding using a similar approach if it proves useful

I avoided adding AVX512 handling as I'm not sure when we should be making use of VBLENDPD/VBLENDPS on EVEX targets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 14:26:11 +00:00
Craig Topper
b8004760df [X86] Cleanup patterns for using VMOVDDUP for broadcasts.
-Remove OptForSize. Not all of the backend follows the same rules for creating broadcasts and there is no conflicting pattern.
-Don't stop selecting VEX VMOVDDUP when AVX512 is supported. We need VLX for EVEX VMOVDDUP.
-Only use VMOVDDUP for v2i64 broadcasts if AVX2 is not supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 07:11:24 +00:00
Mehdi Amini
102077e6f3 Revert "Use StringRef instead of raw pointer in TargetRegistry API (NFC)"
This reverts commit r283017. Creates an infinite loop somehow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 07:08:23 +00:00
Mehdi Amini
ec52cdee8f Use StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 06:46:33 +00:00
Mehdi Amini
876fe65d27 Use StringRef instead of raw pointer in TargetRegistry API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 06:25:30 +00:00
Craig Topper
825f7d897c [AVX-512] Add EVEX versions of VPBROADCASTW patterns with truncated i32 loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 06:01:23 +00:00
Mehdi Amini
0efcb40364 Use StringRef in Datalayout API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 05:57:55 +00:00
Mehdi Amini
48435b0f76 Revert "Use StringRef in Datalayout API (NFC)"
This reverts commit r283009. Bots are broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 05:12:48 +00:00
Mehdi Amini
b398ca69f4 Use StringRef in Datalayout API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 04:17:59 +00:00