oota-llvm.git
15 years agofix some 80-col violations
Gabor Greif [Sat, 30 Aug 2008 10:09:02 +0000 (10:09 +0000)]
fix some 80-col violations

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

15 years agoRe-apply 55467 with fix. If copy is being replaced by remat'ed def, transfer the...
Evan Cheng [Sat, 30 Aug 2008 09:09:33 +0000 (09:09 +0000)]
Re-apply 55467 with fix. If copy is being replaced by remat'ed def, transfer the implicit defs onto the remat'ed instruction.

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

15 years agoFold isRematerializable checks into isSafeToReMat.
Evan Cheng [Sat, 30 Aug 2008 09:07:18 +0000 (09:07 +0000)]
Fold isRematerializable checks into isSafeToReMat.

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

15 years agoFor now, can't mark XOR64rr isAsCheapAsAMove. It's technically correct. But various...
Evan Cheng [Sat, 30 Aug 2008 08:54:22 +0000 (08:54 +0000)]
For now, can't mark XOR64rr isAsCheapAsAMove. It's technically correct. But various passes cannot handle remating these.

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

15 years agoTransform (x << (y&31)) -> (x << y). This takes advantage of the fact x86 shift instr...
Evan Cheng [Sat, 30 Aug 2008 02:03:58 +0000 (02:03 +0000)]
Transform (x << (y&31)) -> (x << y). This takes advantage of the fact x86 shift instructions 2nd operand (shift count) is limited to 0 to 31 (or 63 in the x86-64 case).

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

15 years agoEnable -fvisibility-inlines-hidden by default for compilers which
Daniel Dunbar [Sat, 30 Aug 2008 01:16:19 +0000 (01:16 +0000)]
Enable -fvisibility-inlines-hidden by default for compilers which
support it.

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

15 years agoTestcases for ppc atomics.
Dale Johannesen [Sat, 30 Aug 2008 00:54:31 +0000 (00:54 +0000)]
Testcases for ppc atomics.

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

15 years agoFix an issue where a use might be selected before a def, and then we didn't respect...
Owen Anderson [Sat, 30 Aug 2008 00:38:46 +0000 (00:38 +0000)]
Fix an issue where a use might be selected before a def, and then we didn't respect the pre-chosen vreg
assignment when selecting the def.  This is the naive solution to the problem: insert a copy to the pre-chosen
vreg.  Other solutions might be preferable, such as:
  1) Passing the dest reg into FastEmit_.  However, this would require the higher level code to know about reg classes, which they don't currently.
  2) Selecting blocks in reverse postorder.  This has some compile time cost for computing the order, and we'd need to measure its impact.

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

15 years agoAdd ppc partial-word ATOMIC_CMP_SWAP.
Dale Johannesen [Sat, 30 Aug 2008 00:08:53 +0000 (00:08 +0000)]
Add ppc partial-word ATOMIC_CMP_SWAP.

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

15 years agoSwap fp comparison operands and change predicate to allow load folding (safely this...
Evan Cheng [Fri, 29 Aug 2008 23:22:12 +0000 (23:22 +0000)]
Swap fp comparison operands and change predicate to allow load folding (safely this time).

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

15 years agoUse static_cast instead of C style cast.
Evan Cheng [Fri, 29 Aug 2008 23:21:31 +0000 (23:21 +0000)]
Use static_cast instead of C style cast.

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

15 years agoFix 80 col. violations.
Evan Cheng [Fri, 29 Aug 2008 23:20:46 +0000 (23:20 +0000)]
Fix 80 col. violations.

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

15 years agoxfail this.
Evan Cheng [Fri, 29 Aug 2008 22:59:13 +0000 (22:59 +0000)]
xfail this.

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

15 years agoBack out 55498. It broken Apple style bootstrapping.
Evan Cheng [Fri, 29 Aug 2008 22:21:44 +0000 (22:21 +0000)]
Back out 55498. It broken Apple style bootstrapping.

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

15 years agoBacking out 55521. Not safe.
Evan Cheng [Fri, 29 Aug 2008 22:13:21 +0000 (22:13 +0000)]
Backing out 55521. Not safe.

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

15 years agoAdd partial word version of ATOMIC_SWAP.
Dale Johannesen [Fri, 29 Aug 2008 18:29:46 +0000 (18:29 +0000)]
Add partial word version of ATOMIC_SWAP.

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

15 years agoAdd initial support for fast isel of instructions that have inputs pinned to physical...
Owen Anderson [Fri, 29 Aug 2008 17:45:56 +0000 (17:45 +0000)]
Add initial support for fast isel of instructions that have inputs pinned to physical registers.

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

15 years agoregenerate
Chris Lattner [Fri, 29 Aug 2008 17:20:18 +0000 (17:20 +0000)]
regenerate

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

15 years agoAsmprint nameless instructions as:
Chris Lattner [Fri, 29 Aug 2008 17:19:30 +0000 (17:19 +0000)]
Asmprint nameless instructions as:

%4 = add ...

instead of:

add ...    ; 4

This makes opt -print-cfg output actually usable and makes .ll files
generally easier to read.  This fixes PR2480

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

15 years agoallow this to pass.
Chris Lattner [Fri, 29 Aug 2008 17:18:26 +0000 (17:18 +0000)]
allow this to pass.

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

15 years agoAdd support for parsing .ll files that have numbers in front of
Chris Lattner [Fri, 29 Aug 2008 17:12:13 +0000 (17:12 +0000)]
Add support for parsing .ll files that have numbers in front of
nameless values, such as:

%3 = add i32 4, 2

This fixes the first half of PR2480

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

15 years agoTableGen'ing instruction encodings.
Evan Cheng [Fri, 29 Aug 2008 07:42:03 +0000 (07:42 +0000)]
TableGen'ing instruction encodings.

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

15 years agoaddrmode1 (data processing) instruction encoding: bits 5-6 are 0, bits 7-10 encode...
Evan Cheng [Fri, 29 Aug 2008 07:40:52 +0000 (07:40 +0000)]
addrmode1 (data processing) instruction encoding: bits 5-6 are 0, bits 7-10 encode the opcode.

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

15 years agoMVN is addrmode1.
Evan Cheng [Fri, 29 Aug 2008 07:36:24 +0000 (07:36 +0000)]
MVN is addrmode1.

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

15 years agoAdd GlobalValue::{removeFromParent,eraseFromParent}
Daniel Dunbar [Fri, 29 Aug 2008 07:30:15 +0000 (07:30 +0000)]
Add GlobalValue::{removeFromParent,eraseFromParent}

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

15 years agoMore refactoring.
Evan Cheng [Fri, 29 Aug 2008 06:41:12 +0000 (06:41 +0000)]
More refactoring.

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

15 years agoAdd DenseMap::lookup:
Daniel Dunbar [Fri, 29 Aug 2008 00:48:44 +0000 (00:48 +0000)]
Add DenseMap::lookup:
  /// lookup - Return the entry for the specified key, or a default
  /// constructed value if no such entry exists.

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

15 years agoSwap fp comparison operands and change predicate to allow load folding.
Evan Cheng [Thu, 28 Aug 2008 23:48:31 +0000 (23:48 +0000)]
Swap fp comparison operands and change predicate to allow load folding.

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

15 years agoRefactor ARM instruction format definitions into a separate file. No functionality...
Evan Cheng [Thu, 28 Aug 2008 23:39:26 +0000 (23:39 +0000)]
Refactor ARM instruction format definitions into a separate file. No functionality changes.

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

15 years agoAdd a target callback for FastISel.
Dan Gohman [Thu, 28 Aug 2008 23:21:34 +0000 (23:21 +0000)]
Add a target callback for FastISel.

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

15 years agoremove tabs, fix > 80 cols
Gabor Greif [Thu, 28 Aug 2008 23:19:51 +0000 (23:19 +0000)]
remove tabs, fix > 80 cols

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

15 years agoAdd another description to my entry.
Bill Wendling [Thu, 28 Aug 2008 23:16:37 +0000 (23:16 +0000)]
Add another description to my entry.

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

15 years agojust a brain dump for a small tool
Gabor Greif [Thu, 28 Aug 2008 23:15:28 +0000 (23:15 +0000)]
just a brain dump for a small tool
that brings us to 80-col violations
or tabs.

Usage:
  visit-violations <file>

At the moment it outputs editor invocations.

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

15 years agorename destroy -> releaseMemory to properly hook into passmgr.
Chris Lattner [Thu, 28 Aug 2008 22:56:53 +0000 (22:56 +0000)]
rename destroy -> releaseMemory to properly hook into passmgr.

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

15 years agoAdd support for JIT exceptions on Darwin. Since we're dealing with libgcc,
Nicolas Geoffray [Thu, 28 Aug 2008 22:34:49 +0000 (22:34 +0000)]
Add support for JIT exceptions on Darwin. Since we're dealing with libgcc,
whose darwin code was written after the ability to dynamically register frames,
we need to do special hacks to make things work.

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

15 years agofix the output dumbness I have introduced some time ago
Gabor Greif [Thu, 28 Aug 2008 22:32:39 +0000 (22:32 +0000)]
fix the output dumbness I have introduced some time ago

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

15 years agoerect abstraction boundaries for accessing SDValue members, rename Val -> Node to...
Gabor Greif [Thu, 28 Aug 2008 21:40:38 +0000 (21:40 +0000)]
erect abstraction boundaries for accessing SDValue members, rename Val -> Node to reflect semantics

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

15 years agoImplement null and undef values for FastISel.
Dan Gohman [Thu, 28 Aug 2008 21:19:07 +0000 (21:19 +0000)]
Implement null and undef values for FastISel.

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

15 years agoIn lowering SELECT_CC, removed cases where we can't flip the true and false when...
Mon P Wang [Thu, 28 Aug 2008 21:04:05 +0000 (21:04 +0000)]
In lowering SELECT_CC, removed cases where we can't flip the true and false when the compare value has a NaN

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

15 years agoOptimize DAGCombiner's worklist processing. Previously it started
Dan Gohman [Thu, 28 Aug 2008 21:01:56 +0000 (21:01 +0000)]
Optimize DAGCombiner's worklist processing. Previously it started
its work by putting all nodes in the worklist, requiring a big
dynamic allocation. Now, DAGCombiner just iterates over the AllNodes
list and maintains a worklist for nodes that are newly created or
need to be revisited. This allows the worklist to stay small in most
cases, so it can be a SmallVector.

This has the side effect of making DAGCombine not miss a folding
opportunity in alloca-align-rounding.ll.

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

15 years agoMove CaseBlock, JumpTable, and BitTestBlock to be members of
Dan Gohman [Thu, 28 Aug 2008 20:38:18 +0000 (20:38 +0000)]
Move CaseBlock, JumpTable, and BitTestBlock to be members of
SelectionDAGLowering instead of being in an anonymous namespace.
This fixes warnings about SelectionDAGLowering having fields
using anonymous namespaces.

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

15 years agoFix a FastISel bug where the instructions from lowering the arguments
Dan Gohman [Thu, 28 Aug 2008 20:28:56 +0000 (20:28 +0000)]
Fix a FastISel bug where the instructions from lowering the arguments
were being emitted after the first instructions of the entry block.

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

15 years agoUse resize instead of reserve. Reserve doesn't change size().
Rafael Espindola [Thu, 28 Aug 2008 18:32:53 +0000 (18:32 +0000)]
Use resize instead of reserve. Reserve doesn't change size().

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

15 years agoReduce the size of the Parts vector.
Rafael Espindola [Thu, 28 Aug 2008 18:29:58 +0000 (18:29 +0000)]
Reduce the size of the Parts vector.

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

15 years agoHook up support for fast-isel of trunc instructions, using the newly working support...
Owen Anderson [Thu, 28 Aug 2008 18:26:01 +0000 (18:26 +0000)]
Hook up support for fast-isel of trunc instructions, using the newly working support for EXTRACT_SUBREG.

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

15 years agoAdd support for fast-isel of opcodes that require use of extract_subreg. Because...
Owen Anderson [Thu, 28 Aug 2008 18:06:12 +0000 (18:06 +0000)]
Add support for fast-isel of opcodes that require use of extract_subreg.  Because of how extract_subreg is treated, it requires special case handling.

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

15 years agoImplement partial-word binary atomics on ppc.
Dale Johannesen [Thu, 28 Aug 2008 17:53:09 +0000 (17:53 +0000)]
Implement partial-word binary atomics on ppc.

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

15 years agoFastEmitInst_extractsubreg doesn't need to be passed the register class. It can...
Owen Anderson [Thu, 28 Aug 2008 17:47:37 +0000 (17:47 +0000)]
FastEmitInst_extractsubreg doesn't need to be passed the register class.  It can get it from MachineRegisterInfo instead.

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

15 years agoRevert r55467; it causes regressions in UnitTests/Vector/divides,
Dan Gohman [Thu, 28 Aug 2008 17:22:54 +0000 (17:22 +0000)]
Revert r55467; it causes regressions in UnitTests/Vector/divides,
Benchmarks/sim/sim, and others on x86-64.

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

15 years agoCorrectly resize the Parts array.
Rafael Espindola [Thu, 28 Aug 2008 14:24:45 +0000 (14:24 +0000)]
Correctly resize the Parts array.

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

15 years agoIf a copy isn't coalesced, but its src is defined by trivial computation. Re-material...
Evan Cheng [Thu, 28 Aug 2008 07:53:51 +0000 (07:53 +0000)]
If a copy isn't coalesced, but its src is defined by trivial computation. Re-materialize the src to replace the copy.

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

15 years agoFsFLD0S{S|D} and V_SETALLONES are as cheap as moves.
Evan Cheng [Thu, 28 Aug 2008 07:52:25 +0000 (07:52 +0000)]
FsFLD0S{S|D} and V_SETALLONES are as cheap as moves.

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

15 years agoMake the verifier reject instructions which have null pointers
Chris Lattner [Thu, 28 Aug 2008 04:02:44 +0000 (04:02 +0000)]
Make the verifier reject instructions which have null pointers
for operands: rdar://6179606.  no testcase, because I can't write
a .ll file that is this broken ;-)

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

15 years agoClear the intervals list in "destroy", patch by
Chris Lattner [Thu, 28 Aug 2008 03:33:03 +0000 (03:33 +0000)]
Clear the intervals list in "destroy", patch by
Prakash Prabhu!

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

15 years agoSplit the ATOMIC NodeType's to include the size, e.g.
Dale Johannesen [Thu, 28 Aug 2008 02:44:49 +0000 (02:44 +0000)]
Split the ATOMIC NodeType's to include the size, e.g.
ATOMIC_LOAD_ADD_{8,16,32,64} instead of ATOMIC_LOAD_ADD.
Increased the Hardcoded Constant OpActionsCapacity to match.
Large but boring; no functional change.

This is to support partial-word atomics on ppc; i8 is
not a valid type there, so by the time we get to lowering, the
ATOMIC_LOAD nodes looks the same whether the type was i8 or i32.
The information can be added to the AtomicSDNode, but that is the
largest SDNode; I don't fully understand the SDNode allocation,
but it is sensitive to the largest node size, so increasing
that must be bad.  This is the alternative.

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

15 years agoThis test crashes on non-x86 host; make SSE explicit.
Dale Johannesen [Thu, 28 Aug 2008 01:51:09 +0000 (01:51 +0000)]
This test crashes on non-x86 host; make SSE explicit.
Feel free to fix a better way!

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

15 years agoFix a missing #include. Patch by Andrew John Hughes.
Dan Gohman [Thu, 28 Aug 2008 00:20:07 +0000 (00:20 +0000)]
Fix a missing #include. Patch by Andrew John Hughes.

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

15 years agoReorganize the lifetimes of the major objects SelectionDAGISel
Dan Gohman [Wed, 27 Aug 2008 23:52:12 +0000 (23:52 +0000)]
Reorganize the lifetimes of the major objects SelectionDAGISel
works with.

SelectionDAG, FunctionLoweringInfo, and SelectionDAGLowering
objects now get created once per SelectionDAGISel instance, and
can be reused across blocks and across functions. Previously,
they were created and destroyed each time they were needed.

This reorganization simplifies the handling of PHI nodes, and
also SwitchCases, JumpTables, and BitTestBlocks. This
simplification has the side effect of fixing a bug in FastISel
where successor PHI nodes weren't being updated correctly.

This is also a step towards making the transition from FastISel
into and out of SelectionDAG faster, and also making
plain SelectionDAG faster on code with lots of little blocks.

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

15 years agoAdd a helper method that will be used to support EXTRACT_SUBREG for selecting trunc...
Owen Anderson [Wed, 27 Aug 2008 22:30:02 +0000 (22:30 +0000)]
Add a helper method that will be used to support EXTRACT_SUBREG for selecting trunc's in fast-isel.

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

15 years agoMake "movdq2q" and "movq2dq" dependent upon having SSE2 because they use the
Bill Wendling [Wed, 27 Aug 2008 21:32:04 +0000 (21:32 +0000)]
Make "movdq2q" and "movq2dq" dependent upon having SSE2 because they use the
SSE2 registers as well as the MMX registers.

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

15 years agoPut file scoped constants in an anonymous namespace. Use the "using namespace
Bill Wendling [Wed, 27 Aug 2008 21:10:13 +0000 (21:10 +0000)]
Put file scoped constants in an anonymous namespace. Use the "using namespace
llvm" for consistency.

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

15 years agoMove the check whether it's worth remating to caller.
Evan Cheng [Wed, 27 Aug 2008 20:58:54 +0000 (20:58 +0000)]
Move the check whether it's worth remating to caller.

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

15 years agoDo not apply the transformation if the target does not support DestTy natively.
Devang Patel [Wed, 27 Aug 2008 20:55:23 +0000 (20:55 +0000)]
Do not apply the transformation if the target does not support DestTy natively.

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

15 years agoBackout 55429
Devang Patel [Wed, 27 Aug 2008 20:51:49 +0000 (20:51 +0000)]
Backout 55429

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

15 years agoFix FastISel's bitcast code for the case where getRegForValue fails.
Dan Gohman [Wed, 27 Aug 2008 20:41:38 +0000 (20:41 +0000)]
Fix FastISel's bitcast code for the case where getRegForValue fails.

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

15 years agoRefactor isSafeToReMat out of 2addr pass.
Evan Cheng [Wed, 27 Aug 2008 20:33:50 +0000 (20:33 +0000)]
Refactor isSafeToReMat out of 2addr pass.

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

15 years agoAdd facility to create a target.
Devang Patel [Wed, 27 Aug 2008 20:00:27 +0000 (20:00 +0000)]
Add facility to create a target.

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

15 years agoUse TargetLowering to get the types in fast isel, which handles pointer types correct...
Owen Anderson [Wed, 27 Aug 2008 18:58:30 +0000 (18:58 +0000)]
Use TargetLowering to get the types in fast isel, which handles pointer types correctly for our purposes.

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

15 years agoDon't check TLI.getOperationAction. The FastISel way is to
Dan Gohman [Wed, 27 Aug 2008 18:15:05 +0000 (18:15 +0000)]
Don't check TLI.getOperationAction. The FastISel way is to
just try to do the action and let the tablegen-generated code
determine if there is target-support for an operation.

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

15 years agoAdd a new FastISel method, getRegForValue, which takes care of
Dan Gohman [Wed, 27 Aug 2008 18:10:19 +0000 (18:10 +0000)]
Add a new FastISel method, getRegForValue, which takes care of
the details of materializing constants and other values into
registers, and make use of it in several places.

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

15 years agoAdd a comment about the current floating-point constant code in FastISel.
Dan Gohman [Wed, 27 Aug 2008 18:01:42 +0000 (18:01 +0000)]
Add a comment about the current floating-point constant code in FastISel.

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

15 years agoFix typos and whitespaces. Other cosmetic changes based on feedback.
Devang Patel [Wed, 27 Aug 2008 17:50:18 +0000 (17:50 +0000)]
Fix typos and whitespaces. Other cosmetic changes based on feedback.

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

15 years agoMinor cleanup.
Chris Lattner [Wed, 27 Aug 2008 17:36:58 +0000 (17:36 +0000)]
Minor cleanup.

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

15 years agoReinstate the x86-64 portion of r55190. When doing extloads into
Dan Gohman [Wed, 27 Aug 2008 17:33:15 +0000 (17:33 +0000)]
Reinstate the x86-64 portion of r55190. When doing extloads into
64-bit registers from 16-bit and smaller memory locations, prefer
instructions that define the entire 64-bit register, to avoid
partial-register updates.

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

15 years agoOptimize ScheduleDAGRRList's topological sort to use one pass instead
Dan Gohman [Wed, 27 Aug 2008 16:29:48 +0000 (16:29 +0000)]
Optimize ScheduleDAGRRList's topological sort to use one pass instead
of two, and to not need a scratch std::vector. Also, compute the ordering
immediately in the result array, instead of in another scratch std::vector
that is copied to the result array.

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

15 years agoOptimize ScheduleDAG's ComputeDepths and ComputeHeights to not need
Dan Gohman [Wed, 27 Aug 2008 16:27:25 +0000 (16:27 +0000)]
Optimize ScheduleDAG's ComputeDepths and ComputeHeights to not need
a scratch std::vector.

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

15 years agoRemove the std::ostream form of PseudoSourceValue's print,
Dan Gohman [Wed, 27 Aug 2008 16:19:44 +0000 (16:19 +0000)]
Remove the std::ostream form of PseudoSourceValue's print,
which isn't needed anymore.

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

15 years agoUpdate a comment to reflect recent changes.
Dan Gohman [Wed, 27 Aug 2008 16:18:22 +0000 (16:18 +0000)]
Update a comment to reflect recent changes.

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

15 years agoUnbreak PseudoSourceValue::print. This fixes -print-machine-instrs
Dan Gohman [Wed, 27 Aug 2008 15:24:43 +0000 (15:24 +0000)]
Unbreak PseudoSourceValue::print. This fixes -print-machine-instrs
and various other things.

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

15 years agoDiagnose uses of unsized types with the byval attribute in the
Dan Gohman [Wed, 27 Aug 2008 14:48:06 +0000 (14:48 +0000)]
Diagnose uses of unsized types with the byval attribute in the
verifier. See PR2711 for details.

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

15 years agoUpdate wording, as aggregates are now first-class.
Dan Gohman [Wed, 27 Aug 2008 14:44:57 +0000 (14:44 +0000)]
Update wording, as aggregates are now first-class.

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

15 years agoAdd DebugInfoBuilder. Patch by Talin!
Evan Cheng [Wed, 27 Aug 2008 06:51:14 +0000 (06:51 +0000)]
Add DebugInfoBuilder. Patch by Talin!

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

15 years agoBasic FastISel support for floating-point constants.
Dan Gohman [Wed, 27 Aug 2008 01:09:54 +0000 (01:09 +0000)]
Basic FastISel support for floating-point constants.

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

15 years agoFix handling of inttoptr and ptrtoint when unhandled operands are present.
Owen Anderson [Wed, 27 Aug 2008 00:35:37 +0000 (00:35 +0000)]
Fix handling of inttoptr and ptrtoint when unhandled operands are present.

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

15 years agoAdd support for fast isel of inttoptr and ptrtoint in the cases where truncation...
Owen Anderson [Wed, 27 Aug 2008 00:31:01 +0000 (00:31 +0000)]
Add support for fast isel of inttoptr and ptrtoint in the cases where truncation is not needed.

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

15 years agoFactor out a large amoutn of the cast handling code in fast isel into helper methods.
Owen Anderson [Tue, 26 Aug 2008 23:46:32 +0000 (23:46 +0000)]
Factor out a large amoutn of the cast handling code in fast isel into helper methods.
This simultaneously makes the code simpler and adds support for sext as well.

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

15 years agoAdd a MachineInstrBuilder method for adding floating-point
Dan Gohman [Tue, 26 Aug 2008 23:19:23 +0000 (23:19 +0000)]
Add a MachineInstrBuilder method for adding floating-point
immediate operands.

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

15 years agoAdd support for fast isel of zext.
Owen Anderson [Tue, 26 Aug 2008 23:14:49 +0000 (23:14 +0000)]
Add support for fast isel of zext.

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

15 years agodisallow direct access to SDValue::ResNo, provide a getter instead
Gabor Greif [Tue, 26 Aug 2008 22:36:50 +0000 (22:36 +0000)]
disallow direct access to SDValue::ResNo, provide a getter instead

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

15 years agoAdd support for fptosi of constants in fast isel.
Owen Anderson [Tue, 26 Aug 2008 22:34:28 +0000 (22:34 +0000)]
Add support for fptosi of constants in fast isel.

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

15 years agoPut a heuristic in place to prevent GVN from falling into bad cases with massively...
Owen Anderson [Tue, 26 Aug 2008 22:07:42 +0000 (22:07 +0000)]
Put a heuristic in place to prevent GVN from falling into bad cases with massively complicated CFGs.
This speeds up a particular testcase from 12+ hours to 5 seconds with little perceptible loss of quality.

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

15 years agoOptimize SelectionDAG's topological sort to use one pass instead
Dan Gohman [Tue, 26 Aug 2008 21:42:18 +0000 (21:42 +0000)]
Optimize SelectionDAG's topological sort to use one pass instead
of two, and to not need a scratch std::vector. Also, use the
SelectionDAG's topological sort in LegalizeDAG instead of having
a separate implementation.

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

15 years agoRefactor the bitcast code into its own function.
Dan Gohman [Tue, 26 Aug 2008 21:28:54 +0000 (21:28 +0000)]
Refactor the bitcast code into its own function.

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

15 years agoRefactor a bunch of FastISelEmitter code into a helper class, and
Dan Gohman [Tue, 26 Aug 2008 21:21:20 +0000 (21:21 +0000)]
Refactor a bunch of FastISelEmitter code into a helper class, and
put each major step in a separate function. This makes the high
level sequence of events easier to follow.

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

15 years agoMake FastISel use the correct argument type when casting GEP indices.
Dan Gohman [Tue, 26 Aug 2008 20:57:08 +0000 (20:57 +0000)]
Make FastISel use the correct argument type when casting GEP indices.

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

15 years agoDon't select binary instructions with illegal types.
Dan Gohman [Tue, 26 Aug 2008 20:52:40 +0000 (20:52 +0000)]
Don't select binary instructions with illegal types.

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

15 years agoAdd support for fast isel of sitofp, and remove some unnecessary and imprecise legali...
Owen Anderson [Tue, 26 Aug 2008 20:37:00 +0000 (20:37 +0000)]
Add support for fast isel of sitofp, and remove some unnecessary and imprecise legality checks.

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

15 years ago- small bug corrected: incorrect iterator type.
Cedric Venet [Tue, 26 Aug 2008 19:49:04 +0000 (19:49 +0000)]
- small bug corrected: incorrect iterator type.
- fix to please VS: add a return after an assert.

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

15 years agoUse a combination of copyRegToReg and ISD::BIT_CONVERT when doing fast isel of bitcasts,
Owen Anderson [Tue, 26 Aug 2008 18:51:24 +0000 (18:51 +0000)]
Use a combination of copyRegToReg and ISD::BIT_CONVERT when doing fast isel of bitcasts,
allowing it to support the full range of conversions people might ask for in a correct manner.

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

15 years agoThese assertions should be return false's instead, allowing the client to detect...
Owen Anderson [Tue, 26 Aug 2008 18:50:40 +0000 (18:50 +0000)]
These assertions should be return false's instead, allowing the client to detect the failure.

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