Commit Graph

48482 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
51458ed09e Be more aggressive about following hints.
RAGreedy::tryAssign will now evict interference from the preferred
register even when another register is free.

To support this, add the EvictionCost struct that counts how many hints
are broken by an eviction. We don't want to break one hint just to
satisfy another.

Rename canEvict to shouldEvict, and add the first bit of eviction policy
that doesn't depend on spill weights: Always make room in the preferred
register as long as the evictees can be split and aren't already
assigned to their preferred register.

Also make the CSR avoidance more accurate. When looking for a cheaper
register it is OK to use a new volatile register. Only CSR aliases that
have never been used before should be avoided.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134735 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 20:46:18 +00:00
Jim Grosbach
0b44aea7b5 Use tPseudoExpand for tTAILJMPrND and tTAILJMPr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 20:39:19 +00:00
Jim Grosbach
af7f2d6b67 Use tPseudoExpand for tTAILJMPd and tTAILJMPdND.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134732 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 20:32:21 +00:00
Benjamin Kramer
70629abe31 Silence compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134730 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 20:18:13 +00:00
Jim Grosbach
8dc41f33f7 Add more info to FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134729 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 20:18:11 +00:00
Jim Grosbach
e36e21e830 Move Thumb tail call pseudos to Thumb.td file.
Fix a FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134727 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 20:13:35 +00:00
Evan Cheng
480cee5d43 TargetAsmParser doesn't need reference to Target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 19:33:14 +00:00
Benjamin Kramer
11b4c952a6 Remove unused copy of UpdateInlinedAtInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134720 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 19:32:06 +00:00
Jim Grosbach
245f5e8e2a Use ARMPseudoExpand for ARM tail calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134719 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 18:50:22 +00:00
Jim Grosbach
9ca2a778b6 Shuffle productions around a bit.
No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134714 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 18:26:27 +00:00
Jim Grosbach
4559a7bcfd Use ARMPseudoExpand for BLr9, BLr9_pred, BXr9, and BXr9_pred.
TableGen'erated MC lowering pseudo-expansion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134712 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 18:15:12 +00:00
Devang Patel
2cf158ec4b Refactor. It is inliner's responsibility to update line number information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 18:01:31 +00:00
Chandler Carruth
549a85138c Add CMake support for the new TableGen file introduced in r134705.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134707 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 17:54:08 +00:00
Jim Grosbach
53e3fc463e Use TableGen'erated pseudo lowering for ARM.
Hook up the TableGen lowering for simple pseudo instructions for ARM and
use it for a subset of the many pseudos the backend has as proof of concept.

More conversions to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 17:40:42 +00:00
Devang Patel
90b40414a0 Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134703 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 17:09:57 +00:00
Devang Patel
80efd4e96b Make provision to have floating point constants in .debug_loc expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134702 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 16:49:43 +00:00
Benjamin Kramer
3492a4af12 Apparently we can't expect a BinaryOperator here.
Should fix llvm-gcc selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134699 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 12:08:24 +00:00
Benjamin Kramer
9c64030445 Emit a more efficient magic number multiplication for exact sdivs.
We have to do this in DAGBuilder instead of DAGCombiner, because the exact bit is lost after building.

  struct foo { char x[24]; };
  long bar(struct foo *a, struct foo *b) { return a-b; }
is now compiled into
  movl	4(%esp), %eax
  subl	8(%esp), %eax
  sarl	$3, %eax
  imull	$-1431655765, %eax, %eax
instead of
  movl	4(%esp), %eax
  subl	8(%esp), %eax
  movl	$715827883, %ecx
  imull	%ecx
  movl	%edx, %eax
  shrl	$31, %eax
  sarl	$2, %edx
  addl	%eax, %edx
  movl	%edx, %eax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134695 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 10:31:30 +00:00
Evan Cheng
ebdeeab812 Eliminate asm parser's dependency on TargetMachine:
- Each target asm parser now creates its own MCSubtatgetInfo (if needed).
- Changed AssemblerPredicate to take subtarget features which tablegen uses
  to generate asm matcher subtarget feature queries. e.g.
  "ModeThumb,FeatureThumb2" is translated to
  "(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134678 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 01:53:10 +00:00
Lang Hames
1fb0955cab Make GVN look through extractvalues for recognised intrinsics. GVN can then CSE ops that match values produced by the intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134677 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 01:50:54 +00:00
Akira Hatanaka
0184336195 Raise assertion when MachineOperand has unexpected target flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134671 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 00:42:35 +00:00
Akira Hatanaka
18dfcb8a28 Make sure variable Kind is assigned a value to suppress warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 00:26:25 +00:00
Nick Lewycky
9bf45d0b1a Let the inline asm 'q' constraint match float, and on 64-bit double too.
Fixes PR9602!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134665 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 00:19:27 +00:00
Eric Christopher
77ed1353bf Go ahead and emit the barrier on x86-64 even without sse2. The
processor supports it just fine.

Fixes PR9675 and rdar://9740801


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134664 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 00:04:56 +00:00
Akira Hatanaka
794bf17cbe Lower MachineInstr to MC Inst and print to .s files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134661 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 23:56:50 +00:00
Eric Christopher
d8cca66bb4 Handle fpcr register.
Part of PR10299 and rdar://9740322

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134653 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 22:54:12 +00:00
Eric Christopher
31b5f00c4e Add support for the X86 'l' constraint.
Fixes PR10149 and rdar://9738585

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134648 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 22:29:07 +00:00
Eric Christopher
09ad0b6894 Remove a FIXME. All of the standard ones are in the list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134647 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 22:29:03 +00:00
Akira Hatanaka
78d62b2c7f Remove unnecessary newline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134645 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 22:06:18 +00:00
Devang Patel
476df5f64f Add DEBUG message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134643 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 21:44:42 +00:00
Evan Cheng
18fb1d35db Add Mode64Bit feature and sink it down to MC layer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134641 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 21:06:52 +00:00
Bill Wendling
4ae970b393 Move a function out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134640 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 21:05:13 +00:00
Akira Hatanaka
03236be44a Rather than having printMemOperand change the way memory operands are printed
based on a modifier, split it into two functions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 20:54:20 +00:00
Akira Hatanaka
3014b2f322 This patch adds a flag in MCAsmInfo that indicates whether dwarf register
numbers should be printed instead of symbolic register names in
MCAsmStreamer::EmitRegisterName. This is necessary because some versions of
GNU assembler won't accept code in which symbolic register names are used in
cfi directives. There is no change in behavior unless the flag is explicitly
set to true by a backend.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134635 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 20:30:33 +00:00
Akira Hatanaka
17a2f8e551 Define class MipsMCInstLower.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134633 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 20:24:54 +00:00
Akira Hatanaka
aa08ea0530 Change visibility of MipsAsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 20:10:52 +00:00
Akira Hatanaka
2091a0d8d2 Define class MipsMCSymbolRefExpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134629 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 19:27:22 +00:00
Akira Hatanaka
4d1abf1a38 Simplify MipsRegisterInfo::eliminateFrameIndex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134628 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 19:13:09 +00:00
Evan Cheng
4761a8d654 Rewrite comment in English.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134627 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 19:09:06 +00:00
Evan Cheng
963b03c1a9 Rename attribute 'thumb' to a more descriptive 'thumb-mode'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134626 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 19:05:12 +00:00
Akira Hatanaka
d3ac47f805 Reverse order of operands of address operand mem so that the base operand comes
before the offset. This change will enable simplification of function
MipsRegisterInfo::eliminateFrameIndex.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134625 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 18:57:00 +00:00
Akira Hatanaka
e280519ba6 Add missing return statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134622 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 18:27:36 +00:00
Devang Patel
9194c6716b If known DebugLocs do not match then two DBG_VALUE machine instructions are not identical. For example,
DBG_VALUE 3.310000e+02, 0, !"ds"; dbg:sse.stepfft.c:138:18 @[ sse.stepfft.c:32:10 ]
        DBG_VALUE 3.310000e+02, 0, !"ds"; dbg:sse.stepfft.c:138:18 @[ sse.stepfft.c:31:10 ]

These two MIs represent identical value, 3.31...,  for one variable, ds, but they are not identical because the represent two separate instances of inlined variable "ds". 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134620 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 17:45:33 +00:00
Joerg Sonnenberger
f86b76ead7 Recognize mipseb as alias for mips for symmetry with mipsel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134617 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 16:53:52 +00:00
Oscar Fuentes
a8504111f6 Update CMake library dependencies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134616 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 16:33:00 +00:00
Douglas Gregor
7f358da70f Fix CMake build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 15:59:22 +00:00
Cameron Zwarich
375db7f39a The VMLA instruction and its friends are not actually fused; they're plain old
multiply-accumulate instructions with separate rounding steps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134609 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 08:28:52 +00:00
Evan Cheng
db068738e8 Sink feature IsThumb into MC layer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134608 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 08:26:46 +00:00
Evan Cheng
0ddff1b535 Compute feature bits at time of MCSubtargetInfo initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 07:07:08 +00:00
Chris Lattner
cbd40f8357 type can be null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134601 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 05:29:18 +00:00
Chris Lattner
7af453a3bd use a more efficient check for 'is metadata'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 05:12:37 +00:00
Bill Wendling
b99e412650 Use ArrayRef instead of a std::vector&.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 04:42:01 +00:00
Lang Hames
944520f38c Add functions 'hasPredecessor' and 'hasPredecessorHelper' to SDNode. The
hasPredecessorHelper function allows predecessors to be cached to speed up
repeated invocations. This fixes PR10186.

X.isPredecessorOf(Y) now just calls Y.hasPredecessor(X)

Y.hasPredecessor(X) calls Y.hasPredecessorHelper(X, Visited, Worklist) with
empty Visited and Worklist sets (i.e. no caching over invocations).

Y.hasPredecessorHelper(X, Visited, Worklist) caches search state in Visited
and Worklist to speed up repeated calls. The Visited set is searched for X
before going to the worklist to further search the DAG if necessary.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134592 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 04:31:51 +00:00
Evan Cheng
39dfb0ff84 Change some ARM subtarget features to be single bit yes/no in order to sink them down to MC layer. Also fix tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 03:55:05 +00:00
Bill Wendling
6a6b8c3e96 Add a target hook to encode the compact unwind information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134577 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 00:54:13 +00:00
Devang Patel
7986289a9c Add DEBUG messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134572 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 00:14:27 +00:00
Evan Cheng
94ca42ff04 Factor ARM triple parsing out of ARMSubtarget. Another step towards making ARM subtarget info available to MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134569 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 00:08:19 +00:00
Devang Patel
a4acb008cb Use DBG_VALUE location while inserting DBG_VALUE during alloca promotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134568 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 00:05:58 +00:00
Jakub Staszak
447c40c402 Fix a bug in the "expect" intrinsic lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134566 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 23:50:16 +00:00
Eli Friedman
a38cfb2fce When tail-merging multiple blocks, make sure to correctly update the live-in list on the merged block to correctly account for the live-outs of all the predecessors. They might not be the same in all cases (the testcase I have involves a PHI node where one of the operands is an IMPLICIT_DEF).
Unfortunately, the testcase I have is large and confidential, so I don't have a test to commit at the moment; I'll see if I can come up with something smaller where this issue reproduces.

<rdar://problem/9716278>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134565 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 23:41:48 +00:00
Devang Patel
90369eb209 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134561 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 23:26:18 +00:00
Devang Patel
a462d6e8eb Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134559 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 23:09:51 +00:00
Bill Wendling
2b2dc7c4be Clean up the #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134557 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 22:52:32 +00:00
Eric Christopher
882e1e1c5d Grammar and 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134555 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 22:41:18 +00:00
Devang Patel
4fd3c5957e Handle cases where multiple dbg.declare and dbg.value intrinsics are tied to one alloca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134549 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 22:06:11 +00:00
Evan Cheng
78a9f138ae Add ARM MC registry routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 22:02:34 +00:00
Evan Cheng
ed5e355214 Rename files for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134546 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 22:01:53 +00:00
Jim Grosbach
d1689ae4b1 Mark ARM pseudo-instructions as isPseudo.
This allows us to remove the (bogus and unneeded) encoding information from
the pseudo-instruction class definitions. All of the pseudos that haven't
been converted yet and still need encoding information instance from the normal
instruction classes and explicitly set isCodeGenOnly, and so are distinct
from this change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134540 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 21:35:46 +00:00
Devang Patel
231a5ab746 Simplify. Consolidate dbg.declare handling in AllocaPromoter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 21:09:55 +00:00
Andrew Trick
17f91d21a7 indvars -disable-iv-rewrite: ExprToMap lives in Pass data, so be more
careful about referencing values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 21:07:10 +00:00
Jim Grosbach
d378b32382 Remove un-used encoding info from Pseudo MLAv5.
Pseudo-instructions don't have encoding information, as they're lowered
to real instructions by the time we're doing binary encoding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134533 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 20:57:35 +00:00
Eli Friedman
b0e77a228f Fix missing triple support for RTEMS target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 20:56:26 +00:00
Andrew Trick
037d1c0c7e indvars -disable-iv-rewrite: Added SimplifyCongruentIVs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134530 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 20:50:43 +00:00
Bill Wendling
486dd90696 Constify getCompactUnwindRegNum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134527 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 20:33:48 +00:00
Evan Cheng
b262799d49 createMCInstPrinter doesn't need TargetMachine anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134525 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 19:45:42 +00:00
Tobias Grosser
a3574fb7e5 LICM: Remove trailing white spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134521 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 19:20:02 +00:00
Tobias Grosser
df7102b7d6 LICM: Do not loose alignment on promotion
The promotion code lost any alignment information, when hoisting loads and
stores out of the loop. This lead to incorrect aligned memory accesses. We now
use the largest alignment we can prove to be correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134520 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 19:19:55 +00:00
Jakub Staszak
9da9934e27 Introduce "expect" intrinsic instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134516 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 18:22:43 +00:00
Kevin Enderby
d521f2d2f1 Changed the X86 PUSH64i8 record to use the i64i8imm ParserMatchClass so that a
push with a small constant produces a 2-byte push.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134501 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 17:23:46 +00:00
Evan Cheng
68ae5b4bea Remove the AsmWriterEmitter (unused) feature that rely on TargetSubtargetInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134457 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 02:02:33 +00:00
Dan Gohman
9c04b5bd28 Remove the ObjC ARC passes from the default optimization list, and add
extension points to be used by clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134444 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 22:01:44 +00:00
Devang Patel
c5ecbdc189 Preserve debug loc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134441 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 21:48:22 +00:00
Benjamin Kramer
3209a03daf Use memcmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134439 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 20:28:00 +00:00
Rafael Espindola
9b9c5ea2c3 Really fix typo :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134436 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 19:17:10 +00:00
Rafael Espindola
5ac795c56f Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134433 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 19:13:27 +00:00
Chad Rosier
338398a288 By default mkstemp() creates a temporary file with mode 0600, but the mode
used for open is 0666.  Therefore, add the necessary permission bits for
consistency.
rdar://8621462

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 18:55:31 +00:00
Jakob Stoklund Olesen
549019792a Break infinite loop when the Hopfield network oscillates.
This is impossible in theory, I can prove it. In practice, our near-zero
threshold can cause the network to oscillate between equally good
solutions.

<rdar://problem/9720596>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134428 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 18:46:42 +00:00
Rafael Espindola
82c475d057 Compare all 4 bytes of the header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134427 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 18:41:47 +00:00
Eli Friedman
af45b3d8cb Add assembler/disassembler support for non-AVX pclmulqdq. While I'm here, use proper aliases for the pclmullqlqdq and friends. PR10269.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134424 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 18:21:20 +00:00
Andrew Trick
e0dc2faaa0 indvars -disable-iv-rewrite: avoid multiple IVs in weird cases.
Putting back the helper that I removed on 7/1 to do this right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134423 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 18:19:39 +00:00
Jim Grosbach
bc20e4f2dc ARM estimateStackSize() needs to account for simplified call frames.
If the function allocates reserved stack space for callee argument frames,
estimateStackSize() needs to account for that, as it doesn't show up as
ordinary frame objects. Otherwise, a callee with a large argument list will
throw off the calculations for whether to allocate an emergency spill slot
and we get assert() failures in the register scavenger.

rdar://9715469


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134415 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 16:05:50 +00:00
Jakob Stoklund Olesen
9693d4c3f0 Fix PR10277.
Remat during spilling triggers dead code elimination. If a phi-def
becomes unused, that may also cause live ranges to split into separate
connected components.

This type of splitting is different from normal live range splitting. In
particular, there may not be a common original interval.

When the split range is its own original, make sure that the new
siblings are also their own originals. The range being split cannot be
used as an original since it doesn't cover the new siblings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 15:38:41 +00:00
Jakob Stoklund Olesen
2b0f4abfbe Tweak comment and debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134412 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 15:38:37 +00:00
Michael J. Spencer
64388ceee0 Fix warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 14:48:59 +00:00
Benjamin Kramer
fc87cdc1f4 PR10267: Don't combine an equality compare with an AND into an inequality compare when the AND has more than one use.
This can pessimize code, inequalities are generally more expensive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-04 20:16:36 +00:00
Roman Divacky
cbb11869c4 Remove accidentaly left node from previous iteration of the patch.
Noticed by Benjamin Kramer!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134376 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-04 15:42:45 +00:00
Rafael Espindola
2548391104 Move early tail duplication earlier.
This fixes the issue noted in PR10251 where early tail dup of bbs with
indirectbr would cause a bb to be duplicated into a loop preheader
and then into its predecessors, creating phi nodes with identical
operands just before register allocation.

This helps with jsinterp.o size (__TEXT goes from 163568 to 126656)
and a bit with performance 1.005x faster on sunspider (jits still enabled).

The result on webkit with the jit disabled is more significant: 1.021x faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134372 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-04 04:54:22 +00:00
Rafael Espindola
6a9d2b13fd Move most of the pre BB code to TailDuplicateAndUpdate. Change the
HasIndirectbr variable to be just that. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134371 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-04 01:21:42 +00:00
Rafael Espindola
c0af352038 Reduce indentation and fix the count of how many PHIs we have inserted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-04 00:13:36 +00:00
Jakob Stoklund Olesen
736a0118b5 Fix PR10244.
A split point inserted in a block with a landing pad successor may be
hoisted above the call to ensure that it dominates all successors. The
code that handles the rest of the basic block must take this into
account.

I am not including a test case, it would be very fragile. PR10244 comes
from building clang with exceptions enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134369 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-04 00:05:28 +00:00
Roman Divacky
b272332e61 Make the i64 and f64 be 64bit ABI aligned in the target description.
This is what both the ABI and clang says.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-03 16:24:07 +00:00
Rafael Espindola
65268575c4 Fix an easy fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134364 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-03 05:26:42 +00:00
Duncan Sands
d6b98e8bd8 Remove unused array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134323 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 16:36:24 +00:00
Duncan Sands
ba519f8fc9 Revert previous commit. It seems that whether casting to void
is valid or not depends on which system you build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134321 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 13:14:22 +00:00
Duncan Sands
d01cb35804 Supress gcc-4.5 warning about the result not being used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134319 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 13:06:23 +00:00
Rafael Espindola
017205d3c1 Use getVNInfoAt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134312 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 07:50:27 +00:00
Jakob Stoklund Olesen
0d3d95662f Consistent diagnostic capitalization and redundant context elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134311 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 07:23:40 +00:00
Jakob Stoklund Olesen
9d812a2805 Better diagnostics when inline asm fails to allocate.
asm.c:2:7: error: ran out of registers during register allocation
  asm(""::"r"(0), "r"(1), "r"(2), "r"(3), "r"(4), "r"(5), "r"(6), "r"(7), "r"(8), "r"(9));
        ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134310 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 07:17:37 +00:00
Rafael Espindola
a9badd250c Check the VN of the src register at the two copies, not just the
register number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134309 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 05:34:02 +00:00
Jakob Stoklund Olesen
d519de0827 Include a source location when complaining about bad inline assembly.
Add a MI->emitError() method that the backend can use to report errors
related to inline assembly. Call it from X86FloatingPoint.cpp when the
constraints are wrong.

This enables proper clang diagnostics from the backend:

$ clang -c pr30848.c
pr30848.c:5:12: error: Inline asm output regs must be last on the x87 stack
  __asm__ ("" : "=u" (d));  /* { dg-error "output regs" } */
           ^
1 error generated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134307 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 03:53:34 +00:00
Andrew Trick
4b02915386 indvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134306 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 02:34:25 +00:00
Jakob Stoklund Olesen
1a988004db Use a new strategy for preventing eviction loops in RAGreedy.
Every live range is assigned a cascade number the first time it is
involved in an eviction. As the evictor, it gets a new cascade number.
Every evictee is assigned the same cascade number as the evictor.

Eviction is prohibited if the evictor has a lower assigned cascade
number than the evictee.

This means that assigned cascade numbers are monotonically increasing
with every eviction, yet they are bounded by NextCascade which can only
be incremented by new live ranges. Thus, infinite loops cannot happen,
but eviction cascades can still be triggered by new live ranges as we
want.

Thanks to Andy for explaining this to me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134303 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 01:37:09 +00:00
Evan Cheng
2416b89621 Add getFeatureBits to extract feature bits for a given CPU.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134298 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 00:43:44 +00:00
Cameron Zwarich
c20fb63ebd Take a stab at fixing the llvm-x86_64-linux-checks failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134287 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 23:45:21 +00:00
Eric Christopher
e3997d40de TargetConstant immediates won't be placed into registers so tighten
up the valid constant check earlier.

rdar://9692967


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 23:04:38 +00:00
Douglas Gregor
6ced1d12dd Add initial *-*-rtems* target, from Joel Sherrill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134282 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 22:41:06 +00:00
Evan Cheng
385e930d55 Rename XXXGenSubtarget.inc to XXXGenSubtargetInfo.inc for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134281 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 22:36:09 +00:00
Evan Cheng
ce795dc92f Add MCSubtargetInfo target registry stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134279 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 22:25:04 +00:00
Dan Gohman
71997f303e Teach IVUsers to stop at non-affine expressions unless they are both
outside the loop and reducible.

This more completely hides them from LSR, which isn't usually able to
do anything meaningful with non-affine expressions anyway, and this
consequently hides them from SCEVExpander, which is acutely unprepared
for non-affine expressions.

Replace test/CodeGen/X86/lsr-nonaffine.ll with a new test that tests
the new behavior.

This works around the bug in PR10117 / rdar://problem/9633149, and is
generally an improvement besides.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134268 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 22:05:19 +00:00
Owen Anderson
f1ac465b67 Generalize @llvm.ctlz, @llvm.cttz, and @llvm.ctpop to work on vectors of integers, and fix the one optimization pass that I'm aware of that needs updating for this. At least one current target, ARM NEON, can implement these operations on vectors directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134265 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 21:52:38 +00:00
Eli Friedman
adebeeaaee Calling-convention specifications for illegal types are no-ops. Simplify based on this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134264 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 21:33:28 +00:00
Jim Grosbach
a7603982db ARMv7M vs. ARMv7E-M support.
The DSP instructions in the Thumb2 instruction set are an optional extension
in the Cortex-M* archtitecture. When present, the implementation is considered
an "ARMv7E-M implementation," and when not, an "ARMv7-M implementation."

Add a subtarget feature hook for the v7e-m instructions and hook it up. The
cortex-m3 cpu is an example of a v7m implementation, while the cortex-m4 is
a v7e-m implementation.

rdar://9572992



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134261 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 21:12:19 +00:00
Evan Cheng
5b1b4489cf Rename TargetSubtarget to TargetSubtargetInfo for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 21:01:15 +00:00
Evan Cheng
94214703d9 - Added MCSubtargetInfo to capture subtarget features and scheduling
itineraries.
- Refactor TargetSubtarget to be based on MCSubtargetInfo.
- Change tablegen generated subtarget info to initialize MCSubtargetInfo
  and hide more details from targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134257 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 20:45:01 +00:00
Jim Grosbach
eb03c3b228 Fix off-by-one error.
(low two bits always zero, so off by one bit of encoded value).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 19:07:09 +00:00
Evan Cheng
4db3cffe94 Hide the call to InitMCInstrInfo into tblgen generated ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 17:57:27 +00:00
Jim Grosbach
efeedceb41 Pseudo-ize t2MOVCC[ri].
t2MOVCC[ri] are just t2MOV[ri] instructions, so properly pseudo-ize them.
The Thumb1 versions, tMOVCC[ri] were only present for use by the size-
reduction pass, so they're no longer necessary at all and can be deleted.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134242 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 17:14:11 +00:00
Evan Cheng
4d9af61a48 Eliminate one extra conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134240 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 16:59:30 +00:00
Duncan Sands
ed5bc470aa Disable commit 134216 ("Add 134199 back, but disable the optimization when the second
copy is a kill") to see if it fixes the i386 dragonegg buildbot, which is timing out
because gcc built with dragonegg is going into an infinite loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 12:01:00 +00:00
Francois Pichet
24e11afad2 Another misuse of StringRef. MSVC is very sensitive to that kind of error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 09:23:41 +00:00
Nick Lewycky
394d1f1948 Fix likely typo, reduce number of instruction name collisions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 06:27:03 +00:00
Rafael Espindola
3f9b9eb57d Fix use after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134234 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 04:40:50 +00:00
Rafael Espindola
8f1bdac3eb Avoid DenseMap lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134231 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 04:15:02 +00:00
Rafael Espindola
fe11caaa73 Fix off by one error. I misunderstood the comment about killedAt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134229 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 03:31:29 +00:00
Rafael Espindola
1c8b97cbc0 Check the liveinterval, not the kill flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134228 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 02:35:06 +00:00
Jakob Stoklund Olesen
5e9ae090d8 Don't inflate register classes used by inline asm.
The constraints are represented by the register class of the original
virtual register created for the inline asm. If the register class were
included in the operand descriptor, we might be able to do this.

For now, just give up on regclass inflation when inline asm is involved.

No test case, this bug hasn't happened yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134226 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 01:24:25 +00:00
Akira Hatanaka
c4f24eb584 Improve Mips back-end's handling of DBG_VALUE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134224 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 01:04:43 +00:00
Dan Gohman
68c0dbc14f Improve constant folding of undef for cmp and select operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134223 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 01:03:43 +00:00
Eric Christopher
5e653c925c Add support for the 'j' immediate constraint. This is conditionalized on
supporting the instruction that the constraint is for 'movw'.

Part of rdar://9119939


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134222 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 01:00:07 +00:00
Dan Gohman
30cb6dda5a Improve constant folding of undef for binary operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 00:42:17 +00:00
Eric Christopher
d5dc9eca2b Add support for the ARM 't' register constraint. And another testcase
for the 'x' register constraint.

Part of rdar://9119939


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134220 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 00:30:46 +00:00
Evan Cheng
e1bff38386 Switch SubtargetFeatures from std::string to StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134219 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 00:23:10 +00:00
Eric Christopher
1070f82569 We'll return a null RC by default if we can't match.
Part of rdar://9119939


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134217 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 00:19:27 +00:00
Rafael Espindola
0c13e9471a Add 134199 back, but disable the optimization when the second copy is a kill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134216 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 00:16:54 +00:00
Eric Christopher
89bd71fc53 Add support for the 'x' constraint.
Part of rdar://9307836 and rdar://9119939


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134215 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 00:14:47 +00:00
Bill Wendling
c3882164cb Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134212 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:59:38 +00:00
Eric Christopher
09b4467ac5 Capitalize the unsigned part of the initializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134211 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:59:16 +00:00
Eric Christopher
35e6d4d6b6 Rename Pair to RCPair lacking any better naming ideas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:50:52 +00:00
Bill Wendling
e08d4335ad Improve comment: Show the register the DWARF label is added to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:47:40 +00:00
Bill Wendling
2374cb8e7d Use the correct registers on X86_64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134208 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:47:14 +00:00
Jakob Stoklund Olesen
098c7ac7c8 Fix a problem with fast-isel return values introduced in r134018.
We would put the return value from long double functions in the wrong
register.

This fixes gcc.c-torture/execute/conversion.c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134205 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:42:18 +00:00
Jim Grosbach
2a7b41ba4d Refact ARM Thumb1 tMOVr instruction family.
Merge the tMOVr, tMOVgpr2tgpr, tMOVtgpr2gpr, and tMOVgpr2gpr instructions
into tMOVr. There's no need to keep them separate. Giving the tMOVr
instruction the proper GPR register class for its operands is sufficient
to give the register allocator enough information to do the right thing
directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134204 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:38:17 +00:00
Eric Christopher
73744df0c4 Add support for the 'h' constraint.
Part of rdar://9119939


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:23:01 +00:00
Bill Wendling
5cd2791513 Add target a target hook to get the register number used by the compact unwind
encoding for the registers it knows about. Return -1 if it can't handle that
register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 23:20:32 +00:00
Rafael Espindola
15e96be3c7 Revert my previous patch while I debug llvm-gcc bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134201 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 22:58:17 +00:00
Bill Wendling
d221cd676b Add one more comment to the FDE verbose asm output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 22:35:49 +00:00
Rafael Espindola
c747acb8d9 Don't give up on coalescing A and B when we find
A = X
B = X

Instead, proceed as if we had found

A = X
B = A

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 22:24:13 +00:00
Eric Christopher
a8cca80d4a Add a convenience typedef for std::pair<unsigned, const TargetRegisterClass*>.
No functional change.

Part of rdar://9119939


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134198 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 22:17:01 +00:00
Jim Grosbach
63b46faeb8 Thumb1 register to register MOV instruction is predicable.
Fix a FIXME and allow predication (in Thumb2) for the T1 register to
register MOV instructions. This allows some better codegen with
if-conversion (as seen in the test updates), plus it lays the groundwork
for pseudo-izing the tMOVCC instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134197 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 22:10:46 +00:00
Bill Wendling
2541c41f3e Add comments to the FDE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134196 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 22:02:20 +00:00
Bill Wendling
efd24ddbff Add more comments to the ASM output for the CIE's "moves".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134194 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 21:45:12 +00:00
Jakob Stoklund Olesen
1bd622132b Tweak error messages to match GCC. Should fix gcc.target/i386/pr30848.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 21:30:30 +00:00
Bill Wendling
3c163cfa60 Add comments to the ASM output to help understand the compact unwind and CIE tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 21:25:51 +00:00
Rafael Espindola
cfe5254cd3 Create a isFullCopy predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134189 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 21:15:52 +00:00
Rafael Espindola
77a2c372fa Add r134057 back, but splice the predecessor after the successors phi
nodes.

Original message:
Let simplify cfg simplify bb with only debug and lifetime intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134182 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 20:14:24 +00:00
Jim Grosbach
ff97eb0cf4 Pseudo-ize the Thumb tTPsoft instruction.
It's just a call to a special helper function. Get rid of the T2 variant
entirely, as it's identical to the Thumb1 version.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134178 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 19:38:01 +00:00
Andrew Trick
6e0ce24e0c indvars -disable-iv-rewrite: handle cloning binary operators that cannot overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134177 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 19:02:17 +00:00
Jim Grosbach
16f9924000 Pseudo-ize the t2LDMIA_RET instruction.
It's just a t2LDMIA_UPD instruction with extra codegen properties, so it
doesn't need the encoding information. As a side-benefit, we now correctly
recognize for instruction printing as a 'pop' instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134173 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 18:25:42 +00:00
Jim Grosbach
4629d50501 Pseudo-ize the Thumb tPOP_RET instruction.
It's just a tPOP instruction with additional code-gen properties, so it
doesn't need encoding information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134172 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 17:34:04 +00:00
Rafael Espindola
ef17e01725 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134148 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 13:17:24 +00:00
Jim Grosbach
dafc17e2c2 Kill dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134131 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 02:23:05 +00:00
Jim Grosbach
41ca4b7b62 Size reducing SP adjusting t2ADDri needs to check predication.
tADDrSPi is not predicable, so we can't size-reduce a t2ADDri to it if the
predicate is anything other than "always."



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134130 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 02:22:49 +00:00
Evan Cheng
4cc446bc40 Fix ARMSubtarget feature parsing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 02:12:44 +00:00
Evan Cheng
276365dd4b Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name to
be the first encoded as the first feature. It then uses the CPU name to look up
features / scheduling itineray even though clients know full well the CPU name
being used to query these properties.

The fix is to just have the clients explictly pass the CPU name!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 01:53:36 +00:00
Joerg Sonnenberger
ca0ede7655 Recognize the xstorerng alias for VIA PadLock's xstore instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134126 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 01:38:03 +00:00
Jakob Stoklund Olesen
87360f73ae Reapply r134047 now that the world is ready for it.
This patch will sometimes choose live range split points next to
interference instead of always splitting next to a register point. That
means spill code can now appear almost anywhere, and it was necessary
to fix code that didn't expect that.

The difficult places were:

- Between a CALL returning a value on the x87 stack and the
  corresponding FpPOP_RETVAL (was FpGET_ST0). Probably also near x87
  inline assembly, but that didn't actually show up in testing.

- Between a CALL popping arguments off the stack and the corresponding
  ADJCALLSTACKUP.

Both are fixed now. The only place spill code can't appear is after
terminators, see SplitAnalysis::getLastSplitPoint.

Original commit message:

Rewrite RAGreedy::splitAroundRegion, now with cool ASCII art.

This function has to deal with a lot of special cases, and the old
version got it wrong sometimes. In particular, it would sometimes leave
multiple uses in the stack interval in a single block. That causes bad
code with multiple reloads in the same basic block.

The new version handles block entry and exit in a single pass. It first
eliminates all the easy cases, and then goes on to create a local
interval for the blocks with difficult interference. Previously, we
would only create the local interval for completely isolated blocks.

It can happen that the stack interval becomes completely empty because
we could allocate a register in all edge bundles, and the new local
intervals deal with the interference. The empty stack interval is
harmless, but we need to remove a SplitKit assertion that checks for
empty intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134125 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 01:30:39 +00:00
Andrew Trick
60ac719c85 indvars -disable-iv-rewrite: handle an edge case involving identity phis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134124 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 01:27:23 +00:00
Eric Christopher
5244c4cc2f Remove getRegClassForInlineAsmConstraint and all dependencies.
Fixes rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134123 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 01:20:03 +00:00
Eric Christopher
0a1509e779 Make sure we use the correct register class here since we'll need to
care about spill values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134122 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 01:05:46 +00:00
Eric Christopher
5d8aa345dd Fix a small thinko for constant i64 lock/orq optimization where we
we didn't have an opcode for 64-bit constant or expressions.

Fixes rdar://9692967


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134121 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 00:48:30 +00:00
Bill Wendling
9287a6eef3 * Use the proper size to output the range size.
* Rough in the compact encoding part.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134119 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30 00:30:52 +00:00
Bill Wendling
4498d39680 Stupid error: If the LSDA and Personality functions aren't there, emit 0 instead
of the encoding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 23:53:16 +00:00
Devang Patel
272511f518 Revert r133953 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 23:50:13 +00:00
Bill Wendling
9056e90320 We don't want to use relocations inside the compact unwind section. Just use the
symbols instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134115 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 23:49:12 +00:00
Jim Grosbach
f6fd90910a Remove redundant Thumb2 ADD/SUB SP instruction definitions.
Unlike Thumb1, Thumb2 does not have dedicated encodings for adjusting the
stack pointer. It can just use the normal add-register-immediate encoding
since it can use all registers as a source, not just R0-R7. The extra
instruction definitions are just duplicates of the normal instructions with
the (not well enforced) constraint that the source register was SP.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134114 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 23:25:04 +00:00
Jakob Stoklund Olesen
6531bddb86 Always adjust the stack pointer immediately after the call.
Some x86-32 calls pop values off the stack, and we need to readjust the
stack pointer after the call. This happens when ADJCALLSTACKUP is
eliminated.

It could happen that spill code was inserted between the CALL and
ADJCALLSTACKUP instructions, and we would compute wrong stack pointer
offsets for those frame index references.

Fix this by inserting the stack pointer adjustment immediately after the
call instead of where the ADJCALLSTACKUP instruction was erased.

I don't have a test case since we don't currently insert code in that
position. We will soon, though. I am testing a regalloc patch that
didn't work on Linux because of this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134113 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 23:11:39 +00:00
Andrew Trick
cc359d9fa2 indvars -disable-iv-rewrite: insert new trunc instructions carefully.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134112 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 23:03:57 +00:00
Cameron Zwarich
faff127319 In the ARM global merging pass, allow extraneous alignment specifiers. This pass
already makes the assumption, which is correct on ARM, that a type's alignment is
less than its alloc size. This improves codegen with Clang (which inserts a lot of
extraneous alignment specifiers) and fixes <rdar://problem/9695089>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134106 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 22:24:25 +00:00
Eric Christopher
fa6f5917af Remove getRegClassForInlineAsmConstraint from the ARM port.
Part of rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134095 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 21:10:36 +00:00
Eric Christopher
50cf9b38dc Remove todo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134094 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 21:05:54 +00:00
Rafael Espindola
00258d17cd make compose and isMoveInstr static functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134093 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 20:55:48 +00:00
Jim Grosbach
74472b4bf9 Refactor away tSpill and tRestore pseudos in ARM backend.
The tSpill and tRestore instructions are just copies of the tSTRspi and
tLDRspi instructions, respectively. Just use those directly instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134092 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 20:26:39 +00:00
Eric Christopher
1e965641dc Add a TODO for the Alpha port inline asm constraints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134089 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 19:41:27 +00:00
Eric Christopher
46b65f7a2b Move Alpha from getRegClassForInlineAsmConstraint to
getRegForInlineAsmConstraint.

Part of rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134088 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 19:40:01 +00:00
Eric Christopher
38d6426523 Update comment for getRegForInlineAsmConstraint for Mips.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134087 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 19:33:04 +00:00
Eric Christopher
1c24ba9fad Move the Blackfin port away from getRegClassForInlineAsmConstraint by
creating a few specific register classes.

Part of rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134086 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 19:30:29 +00:00
Eric Christopher
193f7e2eb0 Remove getRegClassForInlineAsmConstraint from MBlaze. Add a TODO comment
for the port.

Part of rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134085 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 19:12:24 +00:00
Eric Christopher
314aff1474 Remove getRegClassForInlineAsmConstraint for Mips.
Part of rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134084 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 19:04:31 +00:00
Eric Christopher
158bf50787 Remove getRegClassForInlineAsmConstraint from sparc.
Part of rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134083 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 18:53:10 +00:00
Eric Christopher
ca42299619 Move XCore from getRegClassForInlineAsmConstraint to
getRegForInlineAsmConstraint.

Part of rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134080 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 17:53:29 +00:00
Eric Christopher
d176af8cf3 Use getRegForInlineAsmConstraint instead of custom defining regclasses
via vectors.

Part of rdar://9643582


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134079 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 17:23:50 +00:00
Chad Rosier
ce77aa3edc Temporarily revert r134057: "Let simplify cfg simplify bb with only debug and
lifetime intrinsics" due to buildbot failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134071 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 16:22:11 +00:00
Jim Grosbach
254cf03a45 Asm parser range checking on .<size> <value> directives.
For example, ".byte 256" would previously assert() when emitting an object
file. Now it generates a diagnostic that the literal value is out of range.

rdar://9686950


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134069 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 16:05:14 +00:00
Benjamin Kramer
bdd1ef2dbe Revert a part of r126557 which could create unschedulable DAGs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 13:47:25 +00:00
Rafael Espindola
0fb7dcd48f Let simplify cfg simplify bb with only debug and lifetime intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134057 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 05:25:47 +00:00
NAKAMURA Takumi
c4a84304a0 Fix CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134055 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 03:26:17 +00:00
Andrew Trick
11745d4c02 indvars -disable-iv-rewrite: just because SCEV ignores casts doesn't
mean they can be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 03:13:40 +00:00
Jakob Stoklund Olesen
2c0cbce763 Revert r134047 while investigating a llvm-gcc-i386-linux-selfhost
miscompile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134053 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 02:03:36 +00:00
Evan Cheng
ab8be96fd3 Sink SubtargetFeature and TargetInstrItineraries (renamed MCInstrItineraries) into MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134049 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 01:14:12 +00:00
Jakob Stoklund Olesen
4d517e34e5 Rewrite RAGreedy::splitAroundRegion, now with cool ASCII art.
This function has to deal with a lot of special cases, and the old
version got it wrong sometimes. In particular, it would sometimes leave
multiple uses in the stack interval in a single block. That causes bad
code with multiple reloads in the same basic block.

The new version handles block entry and exit in a single pass. It first
eliminates all the easy cases, and then goes on to create a local
interval for the blocks with difficult interference. Previously, we
would only create the local interval for completely isolated blocks.

It can happen that the stack interval becomes completely empty because
we could allocate a register in all edge bundles, and the new local
intervals deal with the interference. The empty stack interval is
harmless, but we need to remove a SplitKit assertion that checks for
empty intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 00:24:24 +00:00
Evan Cheng
d5b03f252c Move CallFrameSetupOpcode and CallFrameDestroyOpcode to TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134030 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 21:14:33 +00:00
Evan Cheng
6844f7bcde Hide more details in tablegen generated MCRegisterInfo ctor function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134027 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 20:44:22 +00:00
Evan Cheng
94b01f6882 Add MCInstrInfo registeration machinery.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134026 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 20:29:03 +00:00
Evan Cheng
22fee2dff4 Merge XXXGenRegisterNames.inc into XXXGenRegisterInfo.inc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134024 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 20:07:07 +00:00
Evan Cheng
e837dead3c - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo and
sink them into MC layer.
- Added MCInstrInfo, which captures the tablegen generated static data. Chang
TargetInstrInfo so it's based off MCInstrInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134021 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 19:10:37 +00:00
Jakob Stoklund Olesen
9bbe4d6c00 Clean up the handling of the x87 fp stack to make it more robust.
Drop the FpMov instructions, use plain COPY instead.

Drop the FpSET/GET instruction for accessing fixed stack positions.
Instead use normal COPY to/from ST registers around inline assembly, and
provide a single new FpPOP_RETVAL instruction that can access the return
value(s) from a call. This is still necessary since you cannot tell from
the CALL instruction alone if it returns anything on the FP stack. Teach
fast isel to use this.

This provides a much more robust way of handling fixed stack registers -
we can tolerate arbitrary FP stack instructions inserted around calls
and inline assembly. Live range splitting could sometimes break x87 code
by inserting spill code in unfortunate places.

As a bonus we handle floating point inline assembly correctly now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134018 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 18:32:28 +00:00
Chad Rosier
118c9a0c49 Remove warning: 'c0' may be used uninitialized in this function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134014 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 17:26:57 +00:00
Jakob Stoklund Olesen
27ce3b96e5 Print registers by name instead of by number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134013 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 17:24:32 +00:00
Andrew Trick
99a92f67c7 cleanup: misleading comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134010 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 16:45:04 +00:00
Roman Divacky
bdb226ec83 Implement ISD::VAARG lowering on PPC32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134005 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 15:30:42 +00:00
Jay Foad
4f91054fe4 PR10210: New method ConstantArray::getAsCString(). Use it in LTO to
avoid getting embedded trailing null bytes in std::strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133999 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 08:24:19 +00:00
Andrew Trick
dc8e546048 Cleanup. Fix a stupid variable name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133995 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 05:41:52 +00:00
Andrew Trick
5e7645be4c SCEVExpander: give new insts a name that identifies the reponsible pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133992 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 05:07:32 +00:00
Andrew Trick
a5d950f673 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133991 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 05:04:16 +00:00
Nick Lewycky
89991d4413 Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 03:57:31 +00:00
Rafael Espindola
cee94d718b Fix cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133989 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 03:17:03 +00:00
Andrew Trick
56caa09808 indvars --disable-iv-rewrite: sever ties with IVUsers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 03:01:46 +00:00
Andrew Trick
15832f6177 indvars --disable-iv-rewrite: Defer evaluating s/zext until SCEV
evaluates all other IV exprs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133982 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 02:49:20 +00:00
Chandler Carruth
0b3b58df1b Fix CMake build by removing this now dead file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133981 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 02:03:12 +00:00
Jakob Stoklund Olesen
1e0bd63477 Fix a bad iterator dereference that Evan uncovered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 01:18:58 +00:00
Jim Grosbach
adf7366771 ARM Thumb2 asm syntax optional destination operand for binary operators.
When the destination operand is the same as the first source register
operand for arithmetic instructions, the destination operand may be omitted.

For example, the following two instructions are equivalent:
and r1, #ff
and r1, r1, #ff

rdar://9672867



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133973 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 00:19:13 +00:00
Evan Cheng
f46e7e3d7f Remove RegClass2VRegMap from MachineRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 23:54:40 +00:00
Jim Grosbach
6b8f1e35ea ARM Assembly support for Thumb mov-immediate.
Correctly parse the forms of the Thumb mov-immediate instruction:
  1. 8-bit immediate 0-255.
  2. 12-bit shifted-immediate.

The 16-bit immediate "movw" form is also legal with just a "mov" mnemonic,
but is not yet supported. More parser logic necessary there due to fixups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133966 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 23:54:06 +00:00
Evan Cheng
f10711fb8c Remove the experimental (and unused) pre-ra splitting pass. Greedy regalloc can split live ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 23:40:45 +00:00
Andrew Trick
156d460c75 indvars -disable-iv-rewrite: run RLEV after SimplifyIVUsers for
a bit more control over the order SCEVs are evaluated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 23:17:44 +00:00
Devang Patel
016c5829a5 During bottom up fast-isel, instructions emitted to materalize registers are at top of basic block and do not have debug location. This may misguide debugger while entering the basic block and sometimes debugger provides semi useful view of current location to developer by picking up previous known location as current location. Assign a sensible location to the first instruction in a basic block, if it does not have one location derived from source file, so that debugger can provide meaningful user experience to developers in edge cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 22:32:04 +00:00
Jakub Staszak
f227b50a8e Calculate GetBestDestForJumpOnUndef correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133946 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 21:51:12 +00:00
Jim Grosbach
df8fe9901d ARM Asm parsing of Thumb2 move immediate.
Thumb2 MOV mnemonic can accept both cc_out and predication. We don't (yet)
encode the instruction properly, but this gets the parsing part.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133945 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 21:38:03 +00:00
Evan Cheng
15993f83a4 More refactoring. Move getRegClass from TargetOperandInfo to TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133944 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 21:26:13 +00:00
Jim Grosbach
d1f0bbee18 Add exception necessitated by 133938.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133939 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 20:59:10 +00:00
Jim Grosbach
660a9ec4aa ARM assembly carry set/clear condition code aliases for 'hi/lo'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133938 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 20:40:29 +00:00
Jim Grosbach
fbd01783a6 ARM assembler support for ldmfd/stmfd mnemonics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133936 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 20:32:18 +00:00
Jim Grosbach
0d06bb9548 ARM assembler support for vpush/vpop.
Add aliases for the vpush/vpop mnemonics to the VFP load/store multiple
writeback instructions w/ SP as the base pointer.

rdar://9683231



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133932 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 20:00:07 +00:00
Jim Grosbach
0ff9220ccb ARM Assembly syntax support for arithmetic implied dest operand.
When the destination operand is the same as the first source register
operand for arithmetic instructions, the destination operand may be omitted.

For example, the following two instructions are equivalent:
  sub r2, r2, #6
  sub r2, #6

rdar://9682597



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133925 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 19:09:15 +00:00
Owen Anderson
702110159a The index stored in the RegDefIter is one after the current index. When getting the index, decrement it so that it points to the current element. Fixes an off-by-one bug encountered when trying to make use of MVT::untyped.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133923 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 18:34:12 +00:00
Evan Cheng
73f50d9bc3 Merge XXXGenRegisterDesc.inc XXXGenRegisterNames.inc XXXGenRegisterInfo.h.inc
into XXXGenRegisterInfo.inc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133922 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 18:32:37 +00:00
Andrew Trick
4ef4c171db pre-RA-sched: Cleanup register pressure tracking.
Removed the check that peeks past EXTRA_SUBREG, which I don't think
makes sense any more. Intead treat it as a normal register def. No
significant affect on x86 or ARM benchmarks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133917 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 18:01:20 +00:00
Jakob Stoklund Olesen
f27229ee5a Track live-out physical registers in MachineDCE.
Patch by Sanjoy Das!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133910 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 15:00:36 +00:00
Nick Lewycky
9174d5c738 Teach one piece of scalarrepl to handle lifetime markers. When transforming an
alloca that only holds a copy of a global and we're going to replace the users
of the alloca with that global, just nuke the lifetime intrinsics. Part of
PR10121.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 05:40:02 +00:00
Nick Lewycky
99e0b2a8df Move onlyUsedByLifetimeMarkers to ValueTracking so that it can be used by other
passes as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 04:20:45 +00:00
Jakob Stoklund Olesen
1baeb006d2 Grow the X86FloatingPoint register map to hold 16 registers.
This allows for more live scratch registers which is needed to handle
live ST registers before return and inline asm instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 04:08:36 +00:00
Jakob Stoklund Olesen
f792fa90f1 Distinguish early clobber output operands from clobbered registers.
Both become <earlyclobber> defs on the INLINEASM MachineInstr, but we
now use two different asm operand kinds.

The new Kind_Clobber is treated identically to the old
Kind_RegDefEarlyClobber for now, but x87 floating point stack inline
assembly does care about the difference.

This will pop a register off the stack:

  asm("fstp %st" : : "t"(x) : "st");

While this will pop the input and push an output:

  asm("fst %st" : "=&t"(r) : "t"(x));

We need to know if ST0 was a clobber or an output operand, and we can't
depend on <dead> flags for that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133902 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 04:08:33 +00:00
Jakob Stoklund Olesen
7a2ecd3f99 Decode and pretty print inline asm operand descriptors.
The INLINEASM MachineInstrs have an immediate operand describing each
original inline asm operand. Decode the bits in MachineInstr::print() so
it is easier to read:

  INLINEASM <es:rorq $1,$0>, $0:[regdef], %vreg0<def>, %vreg1<def>, $1:[imm], 1, $2:[reguse] [tiedto:$0], %vreg2, %vreg3, $3:[regdef-ec], %EFLAGS<earlyclobber,imp-def>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133901 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 04:08:29 +00:00
Rafael Espindola
ca08dcc483 Remove unused methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133900 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-26 22:44:34 +00:00
Rafael Espindola
5b220213bf There is only one register coalescer. Merge it into the base class and
remove the analysis group.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133899 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-26 22:34:10 +00:00
Rafael Espindola
655739de7b Merge SimpleRegisterCoalescing.cpp into RegisterCoalescer.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-26 22:06:36 +00:00
Rafael Espindola
b0efa94fb6 merge SimpleRegisterCoalescing.h into RegisterCoalescer.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-26 21:54:28 +00:00
Rafael Espindola
fdf16ca44f Move RegisterCoalescer.h to lib/CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133895 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-26 21:41:06 +00:00
Rafael Espindola
79db6a1db6 Remove unnecessary wrapper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133886 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-26 19:47:36 +00:00
Chad Rosier
14d71aac84 Replace dyn_cast<> with cast<> since the cast is already guarded by the necessary check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133874 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 18:51:28 +00:00
Dan Bailey
84149460d5 PTX: Reverting implementation of i8.
The .b8 operations in PTX are far more limiting than I first thought. The mov operation isn't even supported, so there's no way of converting a .pred value into a .b8 without going via .b16, which is
not sensible. An improved implementation needs to use the fact that loads and stores automatically extend and truncate to implement support for EXTLOAD and TRUNCSTORE in order to correctly support
boolean values.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133873 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 18:16:28 +00:00
Michael J. Spencer
25b15777df Object: Add proper error handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133872 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 17:55:23 +00:00
Michael J. Spencer
001c9205fc Make Binary the parent of ObjectFile and update children to new interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133870 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 17:54:50 +00:00
Michael J. Spencer
c44c915372 Add Binary class. This is a cleaner parent than ObjectFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133869 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 17:54:29 +00:00
Michael J. Spencer
d2a02f409e Add Object/Error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133868 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 17:42:56 +00:00
Chad Rosier
df78fcd2d6 Enable tail call optimization in the presence of a byval (x86-32 and x86-64).
<rdar://problem/9483883>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133858 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 02:04:56 +00:00
Douglas Gregor
ba3dc10702 Unbreak CMake build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 00:51:50 +00:00
Evan Cheng
4219718180 Add include guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133847 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 23:59:54 +00:00
Evan Cheng
46af0d7341 Rename TargetDesc to MCTargetDesc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133846 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 23:53:19 +00:00
Jim Grosbach
ba8297ec08 Refactor MachO relocation generaration into the Target directories.
Move the target-specific RecordRelocation logic out of the generic MC
MachObjectWriter and into the target-specific object writers. This allows
nuking quite a bit of target knowledge from the supposedly target-independent
bits in lib/MC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133844 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 23:44:37 +00:00
Owen Anderson
e6b8bf8c4a The scheduler needs to be aware on the existence of untyped nodes when it performs type propagation for EXTRACT_SUBREG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133838 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 23:02:22 +00:00
Rafael Espindola
1189027f9d Fix cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 22:01:28 +00:00
Devang Patel
fa3f9c001f Fix struct member's scope. Patch by Xi Wang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 22:00:39 +00:00
Chad Rosier
2416da36ac Hoist simple check above more complex checking to avoid unnecessary
overheads.  No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133824 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 21:15:36 +00:00
Devang Patel
0f03782d16 Revert unintentional check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133822 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 20:48:14 +00:00
Devang Patel
8594d429e0 Handle debug info for i128 constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133821 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 20:46:11 +00:00
Evan Cheng
f5fa52ed06 - Add MCRegisterInfo registration machinery. Also added x86 registration routines.
- Rename TargetRegisterDesc to MCRegisterDesc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133820 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 20:42:09 +00:00
Jim Grosbach
8b45456700 ARM movw/movt fixups need to mask the high bits.
The fixup value comes in as the whole 32-bit value, so for the lo16 fixup,
the upper bits need to be masked off. Previously we assumed the masking had
already been done and asserted.

rdar://9635991

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133818 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 20:06:59 +00:00
Jim Grosbach
32e7abd080 tidy up whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 19:43:27 +00:00
Dan Bailey
b05a8a8f02 PTX: Add support for i8 type and introduce associated .b8 registers
The i8 type is required for boolean values, but can only use ld, st and mov instructions. The i1 type continues to be used for predicates.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 19:27:10 +00:00
Chad Rosier
ef01edf1e9 The Neon VCVT (between floating-point and fixed-point, Advanced SIMD)
instructions can be used to match combinations of multiply/divide and VCVT 
(between floating-point and integer, Advanced SIMD).  Basically the VCVT 
immediate operand that specifies the number of fraction bits corresponds to a 
floating-point multiply or divide by the corresponding power of 2.

For example, VCVT (floating-point to fixed-point, Advanced SIMD) can replace a 
combination of VMUL and VCVT (floating-point to integer) as follows:

Example (assume d17 = <float 8.000000e+00, float 8.000000e+00>):
  vmul.f32        d16, d17, d16
  vcvt.s32.f32    d16, d16
becomes:
  vcvt.s32.f32    d16, d16, #3

Similarly, VCVT (fixed-point to floating-point, Advanced SIMD) can replace a 
combinations of VCVT (integer to floating-point) and VDIV as follows:

Example (assume d17 = <float 8.000000e+00, float 8.000000e+00>):
  vcvt.f32.s32    d16, d16
  vdiv.f32        d16, d17, d16
becomes:
  vcvt.f32.s32    d16, d16, #3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133813 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 19:23:04 +00:00
Justin Holewinski
4799729d67 PTX: Add preliminary support for outputting debug information in the form of
.file and .loc directives.

Ideally, we would utilize the existing support in AsmPrinter for this, but
I cannot find a way to get .file and .loc directives to print without the
rest of the associated DWARF sections, which ptxas cannot handle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133812 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 19:19:18 +00:00
Akira Hatanaka
25eba399cb Change the chain input of nodes that load the address of a function. This change
enables SelectionDAG::getLoad at MipsISelLowering.cpp:1914 to return a
pre-existing node instead of redundantly create a new node every time it is
called.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133811 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 19:01:25 +00:00
Jim Grosbach
535e58b910 Fixup info for Thumb2 unconditional branch.
rdar://9667872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133808 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 18:48:32 +00:00
Akira Hatanaka
8b2b713f68 Prevent generation of redundant addiu instructions that compute address of
static variables or functions. 




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133803 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 17:55:19 +00:00
Justin Holewinski
35f4fb34ff PTX: Re-work target sm/compute selection and add some basic GPU
targets: g80, gt200, gf100(fermi)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 16:27:49 +00:00
Rafael Espindola
40179bf874 Simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133798 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 15:50:56 +00:00
Rafael Espindola
d7f35fa824 Now that bb with phis are not considered simple, duplicate them even if
we cannot duplicate to every predecessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133797 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 15:47:41 +00:00
Rafael Espindola
1f71549a2e Simplify now that blocks with phis are not considered simple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 14:04:13 +00:00
Rafael Espindola
ce117be633 Fix CellSPU CMakeList.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 13:58:45 +00:00
Evan Cheng
6db5d55ec3 Fix CellSPU CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 05:04:48 +00:00
Evan Cheng
a347f85dbe Starting to refactor Target to separate out code that's needed to fully describe
target machine from those that are only needed by codegen. The goal is to
sink the essential target description into MC layer so we can start building
MC based tools without needing to link in the entire codegen.

First step is to refactor TargetRegisterInfo. This patch added a base class
MCRegisterInfo which TargetRegisterInfo is derived from. Changed TableGen to
separate register description from the rest of the stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 01:44:41 +00:00
Jakub Staszak
66dddd1da3 Calculate backedge probability correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 23:52:11 +00:00
Jim Grosbach
0edb05b9e4 Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133770 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 22:29:00 +00:00
Jakub Staszak
fd9533b4a3 Missing files for the BlockFrequency analysis added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133767 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 21:56:59 +00:00
Jakub Staszak
44eb49c2a1 Introduce BlockFrequency analysis for BasicBlocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133766 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 21:45:20 +00:00
Eli Friedman
a390a1aa48 Add support for movntil/movntiq mnemonics. Reported on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 21:07:47 +00:00
Eli Friedman
00805fae5b PR10180: Fix a instcombine crash with FP vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133756 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 20:40:23 +00:00
Evan Cheng
f05589d043 Rename TargetOptions::StackAlignment to StackAlignmentOverride.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133739 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 18:15:47 +00:00
Evan Cheng
df214fa517 Remove TargetOptions.h dependency from ARMSubtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133738 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 18:15:17 +00:00
Justin Holewinski
d8149c1bef PTX: Always use registers for return values, but use .param space for device
parameters if SM >= 2.0

- Update test cases to be more robust against register allocation changes
- Bump up the number of registers to 128 per type
- Include Python script to re-generate register file with any number of
  registers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133736 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 18:10:13 +00:00
Justin Holewinski
486ca24c08 PTX: Whitespace fixes and remove commented out code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 18:10:07 +00:00
Justin Holewinski
a5ccb4e974 PTX: Prevent DCE from eliminating st.param calls, and unify the handling of
st.param and ld.param

FIXME: Test cases still need to be updated

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133733 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 18:10:05 +00:00
Justin Holewinski
67a9184861 PTX: Use .param space for parameters in device functions for SM >= 2.0
FIXME: DCE is eliminating the final st.param.x calls, figure out why

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133732 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 18:10:03 +00:00
Evan Cheng
ef41ff618f Remove TargetOptions.h dependency from X86Subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 17:54:54 +00:00
Rafael Espindola
83471853b1 Revert "revert 133714"
This reverts commit e8e00f5efb.

The cmake build on OS X is still broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133718 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 14:19:39 +00:00
Dylan Noblesmith
e8e00f5efb revert 133714
It broke the build worse.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133716 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 13:56:01 +00:00
Rafael Espindola
cd34486581 133713 broke the build, revert it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133714 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 13:37:38 +00:00
Dylan Noblesmith
5417eed201 Support: make floating-exception header private
It has only one user. This eliminates the last include of
config.h from the public headers -- ideally, config.h
shouldn't even be installed by `make install` anymore.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133713 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 12:45:54 +00:00
Dylan Noblesmith
4dd26ddf8e CppBackend: fixup for api change
This broke after r133364.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133709 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 12:11:37 +00:00
Jay Foad
95c3e48f95 Reinstate r133513 (reverted in r133700) with an additional fix for a
-Wshorten-64-to-32 warning in Instructions.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 09:09:15 +00:00
Bill Wendling
5b46e8e6b8 Use a reference. Don't make a useless copy of the vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133707 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 07:55:41 +00:00
Bill Wendling
a8c9e6a943 Formatting changes. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133706 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 07:44:54 +00:00
Eric Christopher
e59fbc04ad Revert r133513:
"Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512)."

Due to some additional warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133700 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 06:24:52 +00:00
Bill Wendling
4c0c446d74 Use the presence of the __compact_unwind section to indicate that a target
supports compact unwind info instead of having a separate flag indicating this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 05:13:28 +00:00
Rafael Espindola
9dbbd87938 Move more logic to shouldTailDuplicate and only duplicate regular bb before
register allocation if it has a indirectbr or if we can duplicate it to
every predecessor.

This fixes the SingleSource/Benchmarks/Shootout-C++/matrix.cpp regression but
keeps the previous improvements to sunspider.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133682 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 03:41:29 +00:00
Evan Cheng
2fa82bc3da Get rid of one getStackAlignment(). RegisterInfo shouldn't need to know about stack alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 01:53:43 +00:00
Bill Wendling
e3cd13f0e2 Some skeleton code to emit the compact unwind. If the information is unable to
be emitted in a compact way, we then default to emitting a CIE and FDE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133676 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 01:06:23 +00:00
Bill Wendling
3f2ea825bd 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 00:09:43 +00:00
Bill Wendling
1a3ab63cb5 Add a flag that indicates whether a target supports compact unwind info or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133662 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 23:16:51 +00:00
Rafael Espindola
d6379a993c Reenable tail duplication of bb with just an unconditional jump, but
don't remove blocks that have their address taken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 22:31:57 +00:00
Bill Wendling
aa0a8f3177 Add a __LD,__compact_unwind section.
If the linker supports it, this will hold the CIE and FDE information in a
compact format. The implementation of the compact unwinding emission is coming
soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133658 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 22:22:24 +00:00
Nick Lewycky
e6240e8b83 Fix the implementation of ConstantRange::sub(ConstantRange). Patch by Xi Wang!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133648 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 21:13:46 +00:00
Chad Rosier
f78b5952c3 Revert r133607. This is causing failures in the Clang gccTestSuite.
Specifically, gcc.c-torture/compile/pr21356.c.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 21:13:23 +00:00
Bill Wendling
bbdffa9ab0 Move class methods out-of-line. This reduces the indentation, and is more in
line with LLVM's general coding style.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133645 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 21:07:27 +00:00
Devang Patel
df3ad6697b New binops need debug loc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133642 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 20:56:56 +00:00
Jim Grosbach
d7d71a1859 Add missing header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133640 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 20:40:30 +00:00
Jim Grosbach
2fc6898886 Move ARMMachObjectWriter to its own file.
Just tidy up a bit. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133638 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 20:14:52 +00:00
Devang Patel
a098bf1239 Set debug loc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133636 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 19:52:36 +00:00
Nick Lewycky
5b7ac1402f Emit trailing padding on constant vectors when TargetData says that the vector
is larger than the sum of the elements (including per-element padding).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133631 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 18:55:03 +00:00
Justin Holewinski
08d03168f2 PTX: Fix FrameIndex mapping bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 16:07:03 +00:00
Jay Foad
267010864e Replace the existing forms of ConstantArray::get() with a single form
that takes an ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133615 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 09:24:39 +00:00
Jay Foad
a0c138429e Make ConstantVector::get() always take an ArrayRef, never a std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 09:10:19 +00:00
Dan Bailey
3e8cff47a7 Test Commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133613 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 09:04:30 +00:00
Jay Foad
0df445b460 Eliminate a temporary std::vector in ConstantStruct::get().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133612 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 08:55:11 +00:00
Jay Foad
2a4a6fecf0 Extend ConstantUniqueMap with a new template parameter ValRefType,
representing a constant reference to ValType. Normally this is just
"const ValType &", but when ValType is a std::vector we want to use
ArrayRef as the reference type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 08:50:06 +00:00
Rafael Espindola
c9be257261 Reenable the optimization added in 133415, but change the definition of a "simple" bb to
be one with only one unconditional branch and no phis. Duplicating the phis in this case
is possible, but requeres liveness analysis or breaking edges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133607 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 04:01:58 +00:00
Justin Holewinski
6332fdef15 PTX: Add signed integer comparisons
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 02:09:50 +00:00
Justin Holewinski
a9c85f9ead PTX: Add .address_size directive if PTX version >= 2.3
Patch by Wei-Ren Chen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133589 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 00:43:56 +00:00
Devang Patel
6f373a87cb After register is spilled there should not be any DBG_VALUE referring the same register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133569 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 23:02:36 +00:00
Owen Anderson
109c22c062 Fix some trailing issues from my introduction of MVT::untyped and its use for REGISTER_SEQUENCE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133567 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 22:54:23 +00:00
Nick Lewycky
94d4c91bc5 Add support for assembling "movq" when it's correct to do so, while continuing
to emit "movd" across the board to continue supporting a Darwin assembler bug.
This is the reincarnation of r133452.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133565 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 22:45:41 +00:00
Bill Wendling
0c11218f0a Add verbose EH table printing to SjLj exception tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133561 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 22:40:24 +00:00
Devang Patel
72d9b0e4fc There could be more than one DBG_VALUE instructions for variables where all of them have offset based on one register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133560 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 22:36:03 +00:00
Bill Wendling
8fcd3e6204 Improve the comment printing for the EH table. This gives a much more detailed
explanation of what the EH table describes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133559 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 22:30:20 +00:00
Eric Christopher
1312ca8be6 Handle the memory-ness of all U+ ARM constraints.
Noticed on inspection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133553 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 22:10:57 +00:00
Devang Patel
71c38e3359 Remove r130409, as requested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133536 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 19:46:09 +00:00
Evan Cheng
734f63bed9 Reorg. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133533 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 19:00:54 +00:00
Bob Wilson
38c892624b Revert r133452: "Emit movq for 64-bit register to XMM register moves..."
This is breaking compiler-rt and llvm-gcc builds on MacOSX when not using
the integrated assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133524 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 17:35:13 +00:00
Anna Zaks
0ac56845d1 Add support for sadd.with.overflow and uadd.with.overflow intrinsics to the CBackend by emitting definitions for each intrinsic that occurs in the module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 17:18:15 +00:00