oota-llvm.git
10 years ago[mips][mips64r6] Replace m[tf]hi, m[tf]lo, mult, multu, dmult, dmultu, div, ddiv...
Daniel Sanders [Thu, 12 Jun 2014 10:44:10 +0000 (10:44 +0000)]
[mips][mips64r6] Replace m[tf]hi, m[tf]lo, mult, multu, dmult, dmultu, div, ddiv, divu, ddivu for MIPS32r6/MIPS64.

Summary:
The accumulator-based (HI/LO) multiplies and divides from earlier ISA's have
been removed and replaced with GPR-based equivalents. For example:
  div $1, $2
  mflo $3
is now:
  div $3, $1, $2

This patch disables the accumulator-based multiplies and divides for
MIPS32r6/MIPS64r6 and uses the GPR-based equivalents instead.

Renamed expandPseudoDiv to insertDivByZeroTrap to better describe the
behaviour of the function.

MipsDelaySlotFiller now invalidates the liveness information when moving
instructions to the delay slot. Without this, divrem.ll will abort since
%GP ends up used before it is defined.

Reviewers: vmedic, zoran.jovanovic, jkolek

Reviewed By: jkolek

Differential Revision: http://reviews.llvm.org/D3896

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210760 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips] Move CHECK lines to the same line as the instruction it's testing
Matheus Almeida [Thu, 12 Jun 2014 09:50:17 +0000 (09:50 +0000)]
[mips] Move CHECK lines to the same line as the instruction it's testing
for consistency with the other tests.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210757 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Use a register set to -1 for data0 on ds_inc*/ds_dec*
Matt Arsenault [Thu, 12 Jun 2014 08:21:54 +0000 (08:21 +0000)]
R600/SI: Use a register set to -1 for data0 on ds_inc*/ds_dec*

There is not such thing as a 0-data ds instruction, and the data
operand needs to be a vgpr set to something meaningful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210756 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAvoid in-class initializer from r210747
Alp Toker [Thu, 12 Jun 2014 04:27:37 +0000 (04:27 +0000)]
Avoid in-class initializer from r210747

Turns out MSVC doesn't like this. Sorry for the noise!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210749 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAvoid anonymous namespace in header from r210747
Alp Toker [Thu, 12 Jun 2014 04:21:14 +0000 (04:21 +0000)]
Avoid anonymous namespace in header from r210747

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210748 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAvoid redundant allocations in the linker optimisation hint
Alp Toker [Thu, 12 Jun 2014 04:02:46 +0000 (04:02 +0000)]
Avoid redundant allocations in the linker optimisation hint

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210747 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastISel][x86] Add testcase for r210719.
Juergen Ributzka [Thu, 12 Jun 2014 03:54:05 +0000 (03:54 +0000)]
[FastISel][x86] Add testcase for r210719.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210746 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[x86] Improve frameaddress test from r210709.
Juergen Ributzka [Thu, 12 Jun 2014 03:29:29 +0000 (03:29 +0000)]
[x86] Improve frameaddress test from r210709.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210743 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastISel] Add support for the stackmap intrinsic.
Juergen Ributzka [Thu, 12 Jun 2014 03:29:26 +0000 (03:29 +0000)]
[FastISel] Add support for the stackmap intrinsic.

This implements target-independent FastISel lowering for the stackmap intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210742 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPrefix generic_category with std::.
Rafael Espindola [Thu, 12 Jun 2014 02:52:22 +0000 (02:52 +0000)]
Prefix generic_category with std::.

Sorry I missed these before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210740 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't put generic_category in the llvm namespace.
Rafael Espindola [Thu, 12 Jun 2014 02:00:39 +0000 (02:00 +0000)]
Don't put generic_category in the llvm namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210737 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix verifier for GlobalAliases to avoid recursing into global initializers.
Bob Wilson [Thu, 12 Jun 2014 01:46:54 +0000 (01:46 +0000)]
Fix verifier for GlobalAliases to avoid recursing into global initializers.

The verifier follows GlobalAlias operands so that it can detect cycles of
alias definitions. It was doing this in a way that caused it to also recurse
through initializers for the GlobalValue aliasees, and it would fail when
an initializer refers to a global that is a declaration and not a definition.
This patch causes it to stop recursing when it hits a global definition.
<rdar://problem/17277451>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210734 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't import error_category into the llvm namespace.
Rafael Espindola [Thu, 12 Jun 2014 01:45:43 +0000 (01:45 +0000)]
Don't import error_category into the llvm namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210733 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't import error_condition into the llvm namespace.
Rafael Espindola [Thu, 12 Jun 2014 01:29:42 +0000 (01:29 +0000)]
Don't import error_condition into the llvm namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210731 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUsed mapWindowsError. I missed these in the initial transition.
Rafael Espindola [Thu, 12 Jun 2014 01:25:33 +0000 (01:25 +0000)]
Used mapWindowsError. I missed these in the initial transition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210729 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove some low hanging fruit from system_error.h
Rafael Espindola [Thu, 12 Jun 2014 01:10:47 +0000 (01:10 +0000)]
Remove some low hanging fruit from system_error.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210728 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTry to fix the mingw build.
Rafael Espindola [Thu, 12 Jun 2014 00:24:39 +0000 (00:24 +0000)]
Try to fix the mingw build.

* MingW needs mapWindowsError.
* MingW is missing some entries in std::errc, but we don't use them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210725 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDo not register and de-register PassRegistrationListeners during
Zachary Turner [Thu, 12 Jun 2014 00:16:36 +0000 (00:16 +0000)]
Do not register and de-register PassRegistrationListeners during
construction and destruction.

PassRegistrationListener is intended for use as a generic listener.
In some cases, PassRegistrationListener-derived classes were being
created, and automatically registered and de-registered in static
constructors and destructors.  Since ManagedStatics are destroyed
prior to program shutdown, this leads to errors where an attempt is
made to access a ManagedStatic that has already been destroyed.

Reviewed by: rnk, dblaikie

Differential Revision: http://reviews.llvm.org/D4106

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210724 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTeach LoopUnrollPass to respect loop unrolling hints in metadata.
Eli Bendersky [Wed, 11 Jun 2014 23:15:35 +0000 (23:15 +0000)]
Teach LoopUnrollPass to respect loop unrolling hints in metadata.

See http://reviews.llvm.org/D4090 for more details.

The Clang change that produces this metadata was committed in r210667

Patch by Mark Heffernan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210721 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastISel][X86] Add support for the sqrt intrinsic.
Juergen Ributzka [Wed, 11 Jun 2014 23:11:02 +0000 (23:11 +0000)]
[FastISel][X86] Add support for the sqrt intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210720 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastIsel][X86] Add support for lowering the first 8 floating-point arguments.
Juergen Ributzka [Wed, 11 Jun 2014 23:10:58 +0000 (23:10 +0000)]
[FastIsel][X86] Add support for lowering the first 8 floating-point arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210719 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't acquire the mutex during the destructor of PassRegistry.
Zachary Turner [Wed, 11 Jun 2014 23:03:31 +0000 (23:03 +0000)]
Don't acquire the mutex during the destructor of PassRegistry.

This destructor is run as part of static program termination, and
so all ManagedStatics (including this lock) will have been
destroyed by llvm_shutdown.  Furthermore, if there is actually
a race condition during static program termination, then we are
just hiding a bug somewhere else, because other threads should
not be running at this point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210717 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImplement get_magic with generic tools and inline it.
Rafael Espindola [Wed, 11 Jun 2014 22:53:00 +0000 (22:53 +0000)]
Implement get_magic with generic tools and inline it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210716 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove unused has_magic.
Rafael Espindola [Wed, 11 Jun 2014 21:53:22 +0000 (21:53 +0000)]
Remove unused has_magic.

This will allow inlining get_magic, which should in turn fix one of the mingw
build problems after the switch to std::error_code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210712 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastISel][X86] Add support for the frameaddress intrinsic.
Juergen Ributzka [Wed, 11 Jun 2014 21:44:44 +0000 (21:44 +0000)]
[FastISel][X86] Add support for the frameaddress intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210709 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64] Basic Sched Model for Cortex-A57.
Chad Rosier [Wed, 11 Jun 2014 21:06:56 +0000 (21:06 +0000)]
[AArch64] Basic Sched Model for Cortex-A57.
Patch by Dave Estes<cestes@codeaurora.org>
Differential Revision: http://reviews.llvm.org/D4008

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210705 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: Set correct InstrItinClass for instructions using *Helper classes
Tom Stellard [Wed, 11 Jun 2014 20:51:42 +0000 (20:51 +0000)]
R600: Set correct InstrItinClass for instructions using *Helper classes

We weren't doing this before, so all instruction using the *Helper
classes were considered for any ALU slot.

This fixes a hang in the builtin-char-clz-1.0.generated.cl piglit test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210703 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: BCNT_INT is a vector only instruction
Tom Stellard [Wed, 11 Jun 2014 20:51:39 +0000 (20:51 +0000)]
R600: BCNT_INT is a vector only instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210702 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: honor hex immediate formatting for ldr/str i12 offsets.
Jim Grosbach [Wed, 11 Jun 2014 20:26:45 +0000 (20:26 +0000)]
ARM: honor hex immediate formatting for ldr/str i12 offsets.

Previously we would always print the offset as decimal, regardless of
the formatting requested. Now we use the formatImm() helper so the value
is printed as the client (LLDB in the motivating example) requested.

Before:
ldr.w r8, [sp, #180] @ always

After:
ldr.w r8, [sp, #0xb4] @ when printing hex immediates
ldr.w r8, [sp, #0180] @ when printing decimal immediates

rdar://17237103

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210701 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-mc: Add option for prefering hex format disassembly.
Jim Grosbach [Wed, 11 Jun 2014 20:26:40 +0000 (20:26 +0000)]
llvm-mc: Add option for prefering hex format disassembly.

Previously there was a separate mode entirely (--hdis vs.
--disassemble). It makes a bit more sense for the immediate printing
style to be a flag for --disassmeble rather than an entirely different
thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210700 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Fix bitcast between v2i32 and f64
Matt Arsenault [Wed, 11 Jun 2014 19:31:13 +0000 (19:31 +0000)]
R600/SI: Fix bitcast between v2i32 and f64

This is the same problem fixed in r210664 for more types.

The test passes without this fix. For some reason
I'm only hitting this when creating selects lowered
to v2i32 selects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210692 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse std::error_code instead of llvm::error_code.
Rafael Espindola [Wed, 11 Jun 2014 19:05:50 +0000 (19:05 +0000)]
Use std::error_code instead of llvm::error_code.

The idea of this patch is to turn llvm/Support/system_error.h into a
transitional header that just brings in the erorr_code api to the llvm
namespace. I will remove it shortly afterwards.

The cases where the general idea needed some tweaking:

* std::errc is a namespace in msvc, so we cannot use "using std::errc". I could
add an #ifdef, but there were not that many uses, so I just added std:: to
them in this patch.

* Template specialization had to be moved to the std namespace in this
patch set already.

* The msvc implementation of default_error_condition doesn't seem to
provide the same transformations as we need. Not too surprising since
the standard doesn't actually say what "equivalent" means. I fixed the
problem by keeping our old mapping and using it at error_code
construction time.

Despite these shortcomings I think this is still a good thing. Some reasons:

* The different implementations of system_error might improve over time.
* It removes 925 lines of code from llvm already.
* It removes 6313 bytes from the text segment of the clang binary when
it is built with gcc and 2816 bytes when building with clang and
libstdc++.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210687 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Reassociate] FileCheckize and cleanup a few testcases. No functional change
Chad Rosier [Wed, 11 Jun 2014 18:28:45 +0000 (18:28 +0000)]
[Reassociate] FileCheckize and cleanup a few testcases. No functional change
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210685 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix assert comments in Instruction.cpp.
Chad Rosier [Wed, 11 Jun 2014 18:26:29 +0000 (18:26 +0000)]
Fix assert comments in Instruction.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210684 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Update place using old subtarget predicate
Matt Arsenault [Wed, 11 Jun 2014 18:11:34 +0000 (18:11 +0000)]
R600/SI: Update place using old subtarget predicate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210683 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Add common 64-bit LDS atomics
Matt Arsenault [Wed, 11 Jun 2014 18:08:54 +0000 (18:08 +0000)]
R600/SI: Add common 64-bit LDS atomics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210680 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Add instruction definitions for 64-bit LDS atomics
Matt Arsenault [Wed, 11 Jun 2014 18:08:50 +0000 (18:08 +0000)]
R600/SI: Add instruction definitions for 64-bit LDS atomics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210679 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Add 32-bit LDS atomic cmpxchg
Matt Arsenault [Wed, 11 Jun 2014 18:08:48 +0000 (18:08 +0000)]
R600/SI: Add 32-bit LDS atomic cmpxchg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210678 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Use LDS atomic inc / dec
Matt Arsenault [Wed, 11 Jun 2014 18:08:45 +0000 (18:08 +0000)]
R600/SI: Use LDS atomic inc / dec

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210677 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Add other LDS atomic operations
Matt Arsenault [Wed, 11 Jun 2014 18:08:42 +0000 (18:08 +0000)]
R600/SI: Add other LDS atomic operations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210676 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Add instruction definitions for more LDS ops
Matt Arsenault [Wed, 11 Jun 2014 18:08:39 +0000 (18:08 +0000)]
R600/SI: Add instruction definitions for more LDS ops

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210675 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Fix backwards names for local atomic instructions.
Matt Arsenault [Wed, 11 Jun 2014 18:08:37 +0000 (18:08 +0000)]
R600/SI: Fix backwards names for local atomic instructions.

The manual lists them as *_RTN_U32, not *_U32_RTN, which is more
consistent with how every other sized instruction is named.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210674 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Refactor local atomics.
Matt Arsenault [Wed, 11 Jun 2014 18:08:34 +0000 (18:08 +0000)]
R600/SI: Refactor local atomics.

Use patterns that will also match the immediate offset to
match the normal read / writes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210673 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Use v_cvt_f32_ubyte* instructions
Matt Arsenault [Wed, 11 Jun 2014 17:50:44 +0000 (17:50 +0000)]
R600/SI: Use v_cvt_f32_ubyte* instructions

This eliminates extra extract instructions when loading an i8 vector to
a float vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210666 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSmallVectorTest: Make the deleted member functions private to help MSVC users.
David Blaikie [Wed, 11 Jun 2014 17:50:14 +0000 (17:50 +0000)]
SmallVectorTest: Make the deleted member functions private to help MSVC users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210665 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Fix selection failure on scalar_to_vector
Matt Arsenault [Wed, 11 Jun 2014 17:40:32 +0000 (17:40 +0000)]
R600/SI: Fix selection failure on scalar_to_vector

There seem to be only 2 places that produce these,
and it's kind of tricky to hit them.

Also fixes failure to bitcast between i64 and v2f32,
although this for some reason wasn't actually broken in the
simple bitcast testcase, but did in the scalar_to_vector one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210664 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoX86: add stringy name for X86ISD::LCMPXCHG16_DAG
Tim Northover [Wed, 11 Jun 2014 17:04:08 +0000 (17:04 +0000)]
X86: add stringy name for X86ISD::LCMPXCHG16_DAG

I don't know what "target specific node #383" is, and I don't want to
have to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210663 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert r210613 to conform to coding standards.
Eric Christopher [Wed, 11 Jun 2014 16:59:33 +0000 (16:59 +0000)]
Revert r210613 to conform to coding standards.
Thanks Duncan for noticing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210662 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][mips64r6] Improve tests affected by the changes to multiplies and divides
Daniel Sanders [Wed, 11 Jun 2014 15:48:00 +0000 (15:48 +0000)]
[mips][mips64r6] Improve tests affected by the changes to multiplies and divides

Summary:
MIPS32r6/MIPS64r6 support has not been added yet.

inlineasm-cnstrnt-reg.ll:
  Explicitly specify the CPU since it will not work on MIPS32r6/MIPS64r6
  when -integrated-as is the default. We can't change the mnemonic since the
  LO register is an implicit def of mtlo and MIPS32r6/MIPS64r6 has no
  instructions that use LO.

2008-08-01-AsmInline.ll:
  Explicitly specify the CPU since MIPS32r6/MIPS64r6 will correctly emit
  different code and this is a regression test.

mips64instrs.ll and mips64muldiv.ll
  Check registers and the way the multiply is used in m1

divrem.ll
  Check registers and use multiple filecheck prefixes to limit redundancy

Reviewers: vmedic, jkolek, zoran.jovanovic, matheusalmeida

Reviewed By: matheusalmeida

Subscribers: matheusalmeida

Differential Revision: http://reviews.llvm.org/D3894

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210656 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips] Implement jr.hb and jalr.hb (Jump Register and Jump and Link Register with...
Matheus Almeida [Wed, 11 Jun 2014 15:05:56 +0000 (15:05 +0000)]
[mips] Implement jr.hb and jalr.hb (Jump Register and Jump and Link Register with Hazard Barrier).

Summary: These instructions are available in ISAs >= mips32/mips64. For mips32r6/mips64r6, jr.hb has a new encoding format.

Reviewers: dsanders

Reviewed By: dsanders

Differential Revision: http://reviews.llvm.org/D4019

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210654 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd AVX512 masked leadz instrinsic support.
Cameron McInally [Wed, 11 Jun 2014 12:54:45 +0000 (12:54 +0000)]
Add AVX512 masked leadz instrinsic support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210652 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImprove the test for inlining of __no_debug__ functions.
Evgeniy Stepanov [Wed, 11 Jun 2014 08:46:45 +0000 (08:46 +0000)]
Improve the test for inlining of __no_debug__ functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210645 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] Refactor the logic to select horizontal adds/subs to a helper function.
Andrea Di Biagio [Wed, 11 Jun 2014 07:57:50 +0000 (07:57 +0000)]
[X86] Refactor the logic to select horizontal adds/subs to a helper function.

This patch moves part of the logic implemented by the target specific
combine rules added at r210477 to a separate helper function.
This should make easier to add more rules for matching AVX/AVX2 horizontal
adds/subs.

This patch also fixes a problem caused by a wrong check performed on indices
of extract_vector_elt dag nodes in input to the scalar adds/subs.

New tests have been added to verify that we correctly check indices of
extract_vector_elt dag nodes when selecting a horizontal operation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210644 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCreate macro INITIALIZE_TM_PASS.
Jiangning Liu [Wed, 11 Jun 2014 07:04:37 +0000 (07:04 +0000)]
Create macro INITIALIZE_TM_PASS.

Pass initialization requires to initialize TargetMachine for back-end
specific passes. This commit creates a new macro INITIALIZE_TM_PASS to
simplify this kind of initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210641 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoGlobal merge for global symbols.
Jiangning Liu [Wed, 11 Jun 2014 06:44:53 +0000 (06:44 +0000)]
Global merge for global symbols.

This commit is to improve global merge pass and support global symbol merge.
The global symbol merge is not enabled by default. For aarch64, we need some
more back-end fix to make it really benifit ADRP CSE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210640 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRename global-merge to enable-global-merge.
Jiangning Liu [Wed, 11 Jun 2014 06:35:26 +0000 (06:35 +0000)]
Rename global-merge to enable-global-merge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210639 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConvert StringMapEntry::Create to use StringRef instead of start/end pointers. Simpli...
Craig Topper [Wed, 11 Jun 2014 05:35:56 +0000 (05:35 +0000)]
Convert StringMapEntry::Create to use StringRef instead of start/end pointers. Simpliies all in tree call sites. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210638 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTry to fix the msvc build.
Rafael Espindola [Wed, 11 Jun 2014 04:41:37 +0000 (04:41 +0000)]
Try to fix the msvc build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210636 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUses generic_category instead of system_category.
Rafael Espindola [Wed, 11 Jun 2014 04:34:41 +0000 (04:34 +0000)]
Uses generic_category instead of system_category.

Some c++ libraries (libstdc++ at least) don't seem to map to the generic
category in in the system_category's default_error_condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210635 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMC: add enumeration of WinEH data encoding
Saleem Abdulrasool [Wed, 11 Jun 2014 04:19:25 +0000 (04:19 +0000)]
MC: add enumeration of WinEH data encoding

Most Windows platforms use auxiliary data for unwinding.  This information is
stored in the .pdata section.  The encoding format for the data differs between
architectures and Windows variants.  Windows MIPS and Alpha use identical
formats; Alpha64 is the same with different widths.  Windows x86_64 and Itanium
share the representation.  All Windows CE entries are identical irrespective of
the architecture.  ARMv7 (Windows [NT] on ARM) has its own format.

This enumeration will become the differentiator once the windows EH emission
infrastructure is generalised, allowing us to emit the necessary unwinding
information for Windows on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210634 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMC: clang-format MCAsmInfo
Saleem Abdulrasool [Wed, 11 Jun 2014 04:19:19 +0000 (04:19 +0000)]
MC: clang-format MCAsmInfo

Apply clang-format over the header.  Reformat the docs to current LLVM style.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210633 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove windows_error.
Rafael Espindola [Wed, 11 Jun 2014 03:58:34 +0000 (03:58 +0000)]
Remove windows_error.

MSVC doesn't seem to provide any is_error_code_enum enumeration for the
windows errors.

Fortunately very few places in llvm have to handle raw windows errors, so
we can just construct the corresponding error_code directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210631 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoThere is no posix_category in std, use generic_category.
Rafael Espindola [Wed, 11 Jun 2014 03:49:13 +0000 (03:49 +0000)]
There is no posix_category in std, use generic_category.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210630 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse cast instead of assert + dyn_cast
Matt Arsenault [Wed, 11 Jun 2014 03:30:06 +0000 (03:30 +0000)]
Use cast instead of assert + dyn_cast

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210628 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: Add helper functions.
Matt Arsenault [Wed, 11 Jun 2014 03:29:54 +0000 (03:29 +0000)]
R600: Add helper functions.

Extract these from some of my other patches, since this
is the only thing really making them dependent on each other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210627 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse an enum class.
Rafael Espindola [Wed, 11 Jun 2014 01:22:20 +0000 (01:22 +0000)]
Use an enum class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210623 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCodeGen: refactor DwarfException
Saleem Abdulrasool [Wed, 11 Jun 2014 01:19:03 +0000 (01:19 +0000)]
CodeGen: refactor DwarfException

DwarfException served as a base class for exception handling directive emission.
However, this is also used by other exception models (e.g. Win64EH).  Rename
this class to EHStreamer and split it out of DwarfException.h.  NFC.

Use the opportunity to fix up some of the documentation comments to match
current LLVM style.  Also rename some functions to conform better with current
LLVM coding style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210622 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse an enum class.
Rafael Espindola [Wed, 11 Jun 2014 01:09:09 +0000 (01:09 +0000)]
Use an enum class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210620 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove duplicate copy of InstrItineraryData from the TargetMachine,
Eric Christopher [Wed, 11 Jun 2014 00:53:17 +0000 (00:53 +0000)]
Remove duplicate copy of InstrItineraryData from the TargetMachine,
it's already on the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210619 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove to a private function to initialize the subtarget dependencies
Eric Christopher [Wed, 11 Jun 2014 00:46:34 +0000 (00:46 +0000)]
Move to a private function to initialize the subtarget dependencies
so that we can use initializer lists for the AArch64 Subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210616 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove to a private function to initialize the subtarget dependencies
Eric Christopher [Wed, 11 Jun 2014 00:25:19 +0000 (00:25 +0000)]
Move to a private function to initialize the subtarget dependencies
so that we can use initializer lists for the X86Subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210614 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSort includes.
Eric Christopher [Wed, 11 Jun 2014 00:25:16 +0000 (00:25 +0000)]
Sort includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210613 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[FastISel][X86] Extend support for {s|u}{add|sub|mul}.with.overflow intrinsics.
Juergen Ributzka [Tue, 10 Jun 2014 23:52:44 +0000 (23:52 +0000)]
[FastISel][X86] Extend support for {s|u}{add|sub|mul}.with.overflow intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210610 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse unique_ptr for X86Subtarget pointer members.
Eric Christopher [Tue, 10 Jun 2014 23:26:47 +0000 (23:26 +0000)]
Use unique_ptr for X86Subtarget pointer members.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210606 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove AArch64TargetLowering to AArch64Subtarget.
Eric Christopher [Tue, 10 Jun 2014 23:26:45 +0000 (23:26 +0000)]
Move AArch64TargetLowering to AArch64Subtarget.
This currently necessitates a TargetMachine for the TargetLowering
constructor and TLOF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210605 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "Remove support for runtime multi-threading."
Zachary Turner [Tue, 10 Jun 2014 23:15:43 +0000 (23:15 +0000)]
Revert "Remove support for runtime multi-threading."

This reverts revision r210600.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210603 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove support for runtime multi-threading.
Zachary Turner [Tue, 10 Jun 2014 23:01:20 +0000 (23:01 +0000)]
Remove support for runtime multi-threading.

This patch removes the functions llvm_start_multithreaded() and
llvm_stop_multithreaded(), and changes llvm_is_multithreaded()
to return a constant value based on the value of the compile-time
definition LLVM_ENABLE_THREADS.

Previously, it was possible to have compile-time support for
threads on, and runtime support for threads off, in which case
certain mutexes were not allocated or ever acquired.  Now, if the
build is created with threads enabled, mutexes are always acquired.

A test before/after patch of compiling a very large TU showed no
noticeable performance impact of this change.

Reviewers: rnk

Differential Revision: http://reviews.llvm.org/D4076

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210600 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove AArch64InstrInfo to AArch64Subtarget.
Eric Christopher [Tue, 10 Jun 2014 22:57:25 +0000 (22:57 +0000)]
Move AArch64InstrInfo to AArch64Subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210599 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove a method that was just replacing direct access to a member.
Eric Christopher [Tue, 10 Jun 2014 22:57:21 +0000 (22:57 +0000)]
Remove a method that was just replacing direct access to a member.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210598 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agolit: warn when passed invalid pathname
Hans Wennborg [Tue, 10 Jun 2014 22:51:58 +0000 (22:51 +0000)]
lit: warn when passed invalid pathname

It would previously say things like

  warning: input 'test/Frontend/foo.c' contained no tests

and have the user pull their hair trying to figure out what's wrong with that
file. This patch changes the message to the much clearer:

  warning: no such file or directory: 'test/Frontend/foo.c'

Differential Revision: http://reviews.llvm.org/D4097

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210597 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove the use of TargetMachine from X86InstrInfo.
Eric Christopher [Tue, 10 Jun 2014 22:34:31 +0000 (22:34 +0000)]
Remove the use of TargetMachine from X86InstrInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210596 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove X86RegisterInfo away from using the TargetMachine and only
Eric Christopher [Tue, 10 Jun 2014 22:34:28 +0000 (22:34 +0000)]
Move X86RegisterInfo away from using the TargetMachine and only
using the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210595 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMark a few functions noexcept.
Rafael Espindola [Tue, 10 Jun 2014 21:26:47 +0000 (21:26 +0000)]
Mark a few functions noexcept.

This reduces the difference between std::error_code and llvm::error_code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210591 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse the TargetMachine on the DAG or the MachineFunction instead
Eric Christopher [Tue, 10 Jun 2014 21:25:13 +0000 (21:25 +0000)]
Use the TargetMachine on the DAG or the MachineFunction instead
of using the cached TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210589 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Emit an error when attempting to spill VGPRs v4
Tom Stellard [Tue, 10 Jun 2014 21:20:41 +0000 (21:20 +0000)]
R600/SI: Emit an error when attempting to spill VGPRs v4

I can't get VGPR spilling to work reliable, so for now just emit
an error when the register allocator tries to spill VGPRs.

v2:
  - Fix build
v3:
  - Added crash fix when spilling SPGRs
v4:
  - Use V_MOV_B32 as a dummy instruction instead of S_NOP

Patch by: Darren Powell

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210588 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Fix a crash when spilling SGPRs
Tom Stellard [Tue, 10 Jun 2014 21:20:38 +0000 (21:20 +0000)]
R600/SI: Fix a crash when spilling SGPRs

We need to make sure only one new instruction is added when spilling
otherwise the register allocator may crash.

This fixes a crash in the game Antichamber.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210587 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a LLVM_NOEXCEPT to Compiler.h.
Rafael Espindola [Tue, 10 Jun 2014 20:45:52 +0000 (20:45 +0000)]
Add a LLVM_NOEXCEPT to Compiler.h.

This will be needed for the switch to std::error_code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210581 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoWe already have a reference to the TargetMachine, use that.
Eric Christopher [Tue, 10 Jun 2014 20:39:39 +0000 (20:39 +0000)]
We already have a reference to the TargetMachine, use that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210580 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoHave isInTailCallPosition take the DAG so that we can use the
Eric Christopher [Tue, 10 Jun 2014 20:39:38 +0000 (20:39 +0000)]
Have isInTailCallPosition take the DAG so that we can use the
version of TargetLowering/Machine from there on the way to avoiding
TargetMachine in TargetLowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210579 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReorder includes to be sorted.
Eric Christopher [Tue, 10 Jun 2014 20:39:35 +0000 (20:39 +0000)]
Reorder includes to be sorted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210578 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRearrange the CHECK lines in this test to make failure more obvious.
Reid Kleckner [Tue, 10 Jun 2014 20:16:47 +0000 (20:16 +0000)]
Rearrange the CHECK lines in this test to make failure more obvious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210575 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "Patch by Ray Donnelly to print register names instead of numbers."
Reid Kleckner [Tue, 10 Jun 2014 20:16:36 +0000 (20:16 +0000)]
Revert "Patch by Ray Donnelly to print register names instead of numbers."

This reverts commit r206683.

The code was confusing SEH register numbers with DWARF register numbers.
The test case it was committed with was obviously incorrect.  The
disassembler was roundtripping '.seh_pushreg %rsi' as '.seh_pushreg
%rbp', and other exciting things.

Noticed by Vadim Chugunov.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210574 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix error in tablegen when either operand of !if is an empty list.
Matt Arsenault [Tue, 10 Jun 2014 20:10:08 +0000 (20:10 +0000)]
Fix error in tablegen when either operand of !if is an empty list.

!if([Something], []) would error with "No type for list".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210572 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix typos.
Eric Christopher [Tue, 10 Jun 2014 20:07:29 +0000 (20:07 +0000)]
Fix typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210571 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: Use BCNT_INT for evergreen
Matt Arsenault [Tue, 10 Jun 2014 19:18:28 +0000 (19:18 +0000)]
R600: Use BCNT_INT for evergreen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210569 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Implement i64 ctpop
Matt Arsenault [Tue, 10 Jun 2014 19:18:24 +0000 (19:18 +0000)]
R600/SI: Implement i64 ctpop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210568 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Use bcnt instruction for ctpop
Matt Arsenault [Tue, 10 Jun 2014 19:18:21 +0000 (19:18 +0000)]
R600/SI: Use bcnt instruction for ctpop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210567 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse an enum class now that they are available.
Rafael Espindola [Tue, 10 Jun 2014 19:08:21 +0000 (19:08 +0000)]
Use an enum class now that they are available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210566 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600: Handle fcopysign
Matt Arsenault [Tue, 10 Jun 2014 19:00:20 +0000 (19:00 +0000)]
R600: Handle fcopysign

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210564 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoR600/SI: Handle sign_extend and zero_extend to i64 with patterns.
Matt Arsenault [Tue, 10 Jun 2014 18:54:59 +0000 (18:54 +0000)]
R600/SI: Handle sign_extend and zero_extend to i64 with patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210563 91177308-0d34-0410-b5e6-96231b3b80d8