Commit Graph

26940 Commits

Author SHA1 Message Date
Hal Finkel
b5ff1bb218 Adjust PPC440 operand latencies
The operand latencies for the PPC440 should be specified relative to dispatch,
not relative to the initial fetch-and-decode stages. Because most instructions
(ignoring bypass) wait in dispatch until their operands are ready, this is
modeled as reading input operands "at dispatch" (0 cycles after issue), and so
every input and output operand has 4 cycles subtracted from it.

This could alter scheduling slightly, but I don't expect a large effect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195947 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-29 05:59:00 +00:00
Hal Finkel
f13a4e6e7b Don't model the fetch and decode units for the PPC440
Modeling the fetch and decode units in the PPC440 itinerary does not add
anything to the hazard detection capability (and so modeling them just wastes
compile time).

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195946 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-29 05:58:38 +00:00
Lang Hames
1cbca515b6 Refactor a lot of patchpoint/stackmap related code to simplify and make it
target independent.

Most of the x86 specific stackmap/patchpoint handling was necessitated by the
use of the native address-mode format for frame index operands. PEI has now
been modified to treat stackmap/patchpoint similarly to DEBUG_INFO, allowing
us to use a simple, platform independent register/offset pair for frame
indexes on stackmap/patchpoints.

Notes:
  - Folding is now platform independent and automatically supported.
  - Emiting patchpoints with direct memory references now just involves calling
    the TargetLoweringBase::emitPatchPoint utility method from the target's
    XXXTargetLowering::EmitInstrWithCustomInserter method. (See
    X86TargetLowering for an example).
  - No more ugly platform-specific operand parsers.

This patch shouldn't change the generated output for X86. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195944 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-29 03:07:54 +00:00
Hao Liu
7fd70e7b0c AArch64: The pattern match should check the range of the immediate value.
Or we can generate some illegal instructions.
E.g. shrn2 v0.4s, v1.2d, #35. The legal range should be in [1, 16].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195941 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-29 02:11:22 +00:00
Jiangning Liu
3733a6b892 Add missing pattern for supporting intrinsic function vbsl_f64 with
argument double floating point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195938 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-29 01:37:15 +00:00
Kevin Qin
9224192321 [AArch64 NEON]Fix a assertion failure when disassemble SHLL instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195936 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-29 01:29:16 +00:00
Rafael Espindola
88ccad035e Refactor to remove a bit of duplication. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195933 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 20:12:44 +00:00
Benjamin Kramer
4e7a22f970 Silence sign-compare warning and reduce nesting.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 19:58:56 +00:00
NAKAMURA Takumi
ef70d2a393 [CMake] Let add_public_tablegen_target() provide intrinsics_gen, too.
I think, in principle, intrinsics_gen may be added explicitly.
That said, it can be added incidentally, since each target already has dependencies to llvm-tblgen.
Almost all source files depend on both CommonTaleGen and intrinsics_gen.

Explicit add_dependencies() have been pruned under lib/Target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195929 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 17:04:31 +00:00
NAKAMURA Takumi
ad363187c4 [CMake] Let add_public_tablegen_target responsible to provide dependency to CommonTableGen.
add_public_tablegen_target adds *CommonTableGen to LLVM_COMMON_DEPENDS.
LLVM_COMMON_DEPENDS affects add_llvm_library (and other add_target stuff) within its scope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195927 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 17:04:04 +00:00
Rafael Espindola
4ca0ef70cd The global prefix is always one char. Don't use a string for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195926 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 17:00:49 +00:00
NAKAMURA Takumi
98bb341955 [CMake] Prune include_directories() in llvm/lib/Target, take #2.
I forgot to commit them. They were staging in my local repo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 15:30:37 +00:00
Daniel Sanders
2513d8beda [mips] Revert test commit r195922.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195923 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 15:26:33 +00:00
Daniel Sanders
dd5920c8a4 [mips] A test commit to test my Herald and Audit workflow
Will be reverted in the next commit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195922 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 15:25:43 +00:00
NAKAMURA Takumi
9ec9b8434b [CMake] Prune include_directories() in llvm/lib/Target. add_llvm_target() sets them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 14:53:30 +00:00
NAKAMURA Takumi
dd290fe960 Add newline at eof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195920 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 14:52:52 +00:00
Rafael Espindola
60f6083a36 Use the mangler consistently instead of using getGlobalPrefix directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195911 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 08:59:52 +00:00
Hal Finkel
680cd7b077 Don't share functional units among the PPC itineraries
Instead of sharing functional unit names between the various PPC itineraries,
give each core its own unit names prefixed with the core name.  This follows
the convention used by other backends (such as ARM), and removes a non-obvious
ordering dependency between the various PPCSchedule*.td files.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 06:05:59 +00:00
Jiangning Liu
91e710c3dd Remove the variable only used by assert to avoid the build failure
caused by build options [-Werror,-Wunused-variable].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195905 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 01:34:55 +00:00
Hao Liu
cdd732cdd3 AArch64: Fix a bug about disassembling post-index load single element to 4 vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 01:07:45 +00:00
Reed Kotler
18a777a09a Check in conditional branches for constant islands. Still need to finish
conditional branches for very large targets. That will be the next small
patch. Everything now should in principle work as good (functionality
wise) as without constant islands so we decided at Mips/Imagination to
make constant islands the default for Mips16 now so that it will get
excercised a lot and this port is still experimentatl though hopefully soon
we will change the status. Some more cleanup and code review is in order
but things are converging fast.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195902 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-28 00:56:37 +00:00
Akira Hatanaka
92b8543819 [mips] Redefine TAILCALL as a pseudo instruction.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195896 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 23:58:32 +00:00
Akira Hatanaka
b415592831 Add MipsOptimizePICCall.cpp to CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195894 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 23:47:25 +00:00
Akira Hatanaka
bd44867477 [mips] Implement the following optimizations using dominance information to
make PIC calls a little more efficient:

1. Remove instructions setting up $gp if it is known that a function has been
   called at least once.
2. Save the address of a called function in a register instead of loading
   it from the GOT at every call site.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 23:38:42 +00:00
Hal Finkel
d99338105b Add IIC_ prefix to PPC instruction-class names
This adds the IIC_ prefix to the instruction itinerary class names, giving the
PPC backend a naming convention for itinerary classes that is more consistent
with that used by the X86 and ARM backends.

Instruction scheduling in the PPC backend needs a bunch of cleanup and
improvement (especially for the ooo cores). This is just a preliminary step.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195890 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 23:26:09 +00:00
Rafael Espindola
fe7d0c3534 Don't set GlobalPrefix to the default value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195884 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 21:57:54 +00:00
Rafael Espindola
98fef8e6c0 The R600 has its own asm printer which doesn't use GlobalPrefix. Drop it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195883 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 21:52:37 +00:00
Tom Stellard
8a6b7df6f8 R600: Expand vector FABS
NOTE: This is a candidate for the 3.4 branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195881 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 21:23:39 +00:00
Tom Stellard
aa6ec15caf R600/SI: Implement spilling of SGPRs v5
SGPRs are spilled into VGPRs using the {READ,WRITE}LANE_B32 instructions.

v2:
  - Fix encoding of Lane Mask
  - Use correct register flags, so we don't overwrite the low dword
    when restoring multi-dword registers.

v3:
  - Register spilling seems to hang the GPU, so replace all shaders
    that need spilling with a dummy shader.

v4:
  - Fix *LANE definitions
  - Change destination reg class for 32-bit SMRD instructions

v5:
  - Remove small optimization that was crashing Serious Sam 3.

https://bugs.freedesktop.org/show_bug.cgi?id=68224
https://bugs.freedesktop.org/show_bug.cgi?id=71285

NOTE: This is a candidate for the 3.4 branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195880 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 21:23:35 +00:00
Tom Stellard
0cbf943733 R600/SI: Use SGPR_32 register class for 32-bit SMRD outputs
Writing to the M0 register from an SMRD instruction hangs the GPU, so
we need to use the SGPR_32 register class, which does not include M0.

NOTE: This is a candidate for the 3.4 branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195879 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 21:23:29 +00:00
Tom Stellard
496dbfe7b9 R600: Add support for ISD::FROUND
NOTE: This is a candidate for the 3.4 branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195878 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 21:23:20 +00:00
Rafael Espindola
825dfc8cba Remove dead code.
MO_ExternalSymbol and MO_JumpTableIndex don't show up in inline asm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195861 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 18:38:14 +00:00
Rafael Espindola
4635dbb8bc Convert two if sequences to switches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195859 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 18:26:51 +00:00
Rafael Espindola
b7e71e35a9 Use a switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195857 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 18:18:24 +00:00
Rafael Espindola
ed3eb50482 Remove more dead code now that this is only used for inline asm.
MO_ConstantPoolIndex is handled in printLeaMemReference.
MO_JumpTableIndex and MO_ExternalSymbol don't show up in inline asm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 15:13:06 +00:00
Jiangning Liu
35df2e8c7f Fix the AArch64 NEON bug exposed by checking constant integer argument range of ACLE intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195843 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 14:02:25 +00:00
Rafael Espindola
3b818b481f Convert more methods in static helpers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195826 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 07:34:09 +00:00
Rafael Espindola
81e995dc91 Convert these methods into static functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195825 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 07:14:26 +00:00
Rafael Espindola
ef8a810cd7 Cleanup and test X86AsmPrinter::printPCRelImm.
It is only used for asm printing.

On X86 we put basic block addresses on register before passing them to inline
asm, so the MO_MachineBasicBlock case was dead.

MO_ExternalSymbol was dead since any symbol being passed to inline asm
is represented as MO_GlobalAddress.

The MO_GlobalAddress and MO_Register cases were not tested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195824 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 06:53:13 +00:00
Hal Finkel
aba036df07 Fix comment in PPCA2Model
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195807 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 03:12:56 +00:00
Rafael Espindola
a3e61947b7 Remove dead argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195806 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 02:25:20 +00:00
Chad Rosier
9fef0370c5 [AArch64] Add support for NEON scalar floating-point absolute difference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195803 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 01:45:58 +00:00
Chad Rosier
48f115aabf [AArch64] Add support for NEON scalar floating-point to integer convert
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195788 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 22:17:37 +00:00
Reed Kotler
c0dfa22e19 Fix a bug related to constant islands for Mips16 and mips16/32 dual mode.
The determination of when we are doing constant pools was being made too
early in the asm printer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195781 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 20:38:40 +00:00
Michael Liao
fd115c47a2 Fix PR18054
- Fix bug in (vsext (vzext x)) -> (vsext x) in SIGN_EXTEND_IN_REG
  lowering where we need to check whether x is a vector type (in-reg
  type) of i8, i16 or i32; otherwise, that optimization is not valid.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 20:31:31 +00:00
Tim Northover
2254509d71 Darwin-ARM: use movw/movt for static relocations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195759 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 12:45:05 +00:00
Richard Sandiford
396e080b34 [SystemZ] Fix incorrect use of RISBG for a zero-extended right shift
We would wrongly transform the testcase into the equivalent of an AND with 1.
The problem was that, when testing whether the shifted-in bits of the right
shift were significant, we used the width of the final zero-extended result
rather than the width of the shifted value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195731 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 10:53:16 +00:00
Kevin Qin
cf7ed12a1d Refactored the implementation of AArch64 NEON instruction ZIP, UZP
and TRN.
Fix a bug when mixed use of vget_high_u8() and vuzp_u8().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195716 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 03:26:47 +00:00
Kevin Qin
57f6b2778b [AArch64]Implement 128 bit register copy with NEON.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195713 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 02:33:42 +00:00
Andrew Trick
501aeea325 StackMap: Implement support for DirectMemRefOp.
A Direct stack map location records the address of frame index. This
address is itself the value that the runtime requested. This differs
from IndirectMemRefOp locations, which refer to a stack locations from
which the requested values must be loaded. Direct locations can
directly communicate the address if an alloca, while IndirectMemRefOp
handle register spills.

For example:

entry:
  %a = alloca i64...
  llvm.experimental.stackmap(i32 <ID>, i32 <shadowBytes>, i64* %a)

Since both the alloca and stackmap intrinsic are in the entry block,
and the intrinsic takes the address of the alloca, the runtime can
assume that LLVM will not substitute alloca with any intervening
value. This must be verified by the runtime by checking that the stack
map's location is a Direct location type. The runtime can then
determine the alloca's relative location on the stack immediately after
compilation, or at any time thereafter. This differs from Register and
Indirect locations, because the runtime can only read the values in
those locations when execution reaches the instruction address of the
stack map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195712 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 02:03:25 +00:00