Commit Graph

20740 Commits

Author SHA1 Message Date
Evan Cheng
f7c9695a38 Resolve unfold tables ambiguity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43194 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 23:50:58 +00:00
Evan Cheng
66f7163545 Local spiller optimization:
Turn a store folding instruction into a load folding instruction. e.g.
     xorl  %edi, %eax
     movl  %eax, -32(%ebp)
     movl  -36(%ebp), %eax
     orl   %eax, -32(%ebp)
=>
     xorl  %edi, %eax
     orl   -36(%ebp), %eax
     mov   %eax, -32(%ebp)
This enables the unfolding optimization for a subsequent instruction which will
also eliminate the newly introduced store instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43192 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 21:23:22 +00:00
Bill Wendling
80629c85f1 Don't branch fold inline asm statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 21:09:55 +00:00
Duncan Sands
7f5f6851c3 Add support for a few more nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43190 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 20:29:48 +00:00
Dale Johannesen
b6210fc92b Redo "last ppc long double fix" as Chris wants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43189 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 20:29:00 +00:00
Chris Lattner
f185e67844 Fix a really nasty vector miscompilation bill recently introduced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43181 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 16:47:35 +00:00
Chris Lattner
1c4d492b94 rename ExpandOperation to ExpandOperationResult, as suggested
by Duncan


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 15:28:47 +00:00
Rafael Espindola
7b73a5d6de split LowerMEMCPY into LowerMEMCPYCall and LowerMEMCPYInline in the ARM backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43176 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 14:35:17 +00:00
Duncan Sands
c8ca2365e5 Support for expanding ADDE and SUBE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43175 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 13:06:17 +00:00
Duncan Sands
5d868b1ffe If the value types are equal then this routine
asserts in later checks rather than producing
the ordinary load it is supposed to.  Avoid all
such hassles by directly returning an ordinary
load in this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 13:05:40 +00:00
Rafael Espindola
5c0d6ed325 Add support for byval function whose argument is not 32 bit aligned.
To do this it is necessary to add a "always inline" argument to the
memcpy node. For completeness I have also added this node to memmove
and memset.  I have also added getMem* functions, because the extra
argument makes it cumbersome to use getNode and because I get confused
by it :-)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43172 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 10:41:11 +00:00
Chris Lattner
1f39dc42cd Implement a few new operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43171 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 04:46:45 +00:00
Chris Lattner
50f4395d86 Implement expansion of SINT_TO_FP and UINT_TO_FP operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43170 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 04:32:47 +00:00
Chris Lattner
c99df1b848 implement support for custom expansion of any node type, in one place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43169 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 04:14:36 +00:00
Chris Lattner
26cb2862e9 comment fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43168 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 04:08:28 +00:00
Chris Lattner
597ab48ca0 Make use of TLI.ExpandOperation, remove softfloat stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43167 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 03:58:25 +00:00
Chris Lattner
c224a53d7a add expand support for bit_convert result, even allowing custom expansion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43166 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 03:33:14 +00:00
Chris Lattner
f58dac3169 add a new target hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43165 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 03:31:45 +00:00
Chris Lattner
3a7c33a853 Add an easy microoptimization I noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43164 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 03:29:26 +00:00
Bill Wendling
1851898e75 Negative indices aren't allowed here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43161 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 01:10:49 +00:00
Dale Johannesen
fabd32deb0 More ppcf128 issues (maybe the last)?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43160 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 00:59:18 +00:00
Evan Cheng
f0a0cddbcd - Added getOpcodeAfterMemoryUnfold(). It doesn't unfold an instruction, but only returns the opcode of the instruction post unfolding.
- Fix some copy+paste bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43153 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 22:40:57 +00:00
Evan Cheng
58184e6878 Use SmallVectorImpl instead of SmallVector with hardcoded size in MRegister public interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43150 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 21:29:24 +00:00
Devang Patel
99db6add3d Try again.
Instead of loading small global string from memory, use
integer constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43148 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 19:52:32 +00:00
Owen Anderson
b388ca9544 Allow GVN to eliminate redundant calls to functions without side effects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43147 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 19:39:33 +00:00
Christopher Lamb
a4c791072f Fix a misnamed parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43145 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 19:29:45 +00:00
Christopher Lamb
91ee18c1f7 Fix a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43144 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 19:28:55 +00:00
Chris Lattner
a0bc7fc7bd Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll by
fixing some obviously broken code :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43141 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 18:49:29 +00:00
Chris Lattner
b7daa84a35 this doesn't need dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43133 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:26:24 +00:00
Chris Lattner
fe3e3f4438 Reduce reliance on rtti info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43130 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:11:18 +00:00
Chris Lattner
53336cb47e fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43129 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:10:48 +00:00
Chris Lattner
8dc2e288ac This requires rtti info because tblgen uses commandline,
and tblgen requires rtti.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43127 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 15:57:29 +00:00
Gordon Henriksen
38ffcc93eb Work around downrev gccs which do not inherit visibility of the
Registry<>::iterator member class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43122 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 11:53:05 +00:00
Bill Wendling
90bfc2d105 Pointer arithmetic should be done with the index the same size as the pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 08:32:37 +00:00
Duncan Sands
70ba3d4803 Support for ADDC/SUBC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43119 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 08:22:16 +00:00
Evan Cheng
4ae31a5d32 Really fix PR1734. Carefully track which register uses are sub-register uses by
traversing inverse register coalescing map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43118 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 07:49:59 +00:00
Chris Lattner
65a3323b0a legalizing the ret operation on f64 shouldn't introduce a new
i64 bit convert needlessly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43116 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 06:17:07 +00:00
Owen Anderson
7b714321df Move Split<...>() into DomTreeBase. This should make the #include's of DominatorInternals.h
in CodeExtractor and LoopSimplify unnecessary.

Hartmut, could you confirm that this fixes the issues you were seeing?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 05:13:52 +00:00
Evan Cheng
afa222c895 Reverting r43070 for now. It's causing llc test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43103 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 23:51:13 +00:00
Gordon Henriksen
4b2b9402c5 Switching TargetMachineRegistry to use the new generic Registry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43094 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:28:48 +00:00
Devang Patel
84458323a2 Do not raise free() call that is called through invoke instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43083 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 20:12:58 +00:00
Hartmut Kaiser
469b7a4ec1 Fixed linker errors (unresolved externals: split<>(...)) when compiling with VC++. Please review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43081 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 18:37:09 +00:00
Dan Gohman
3b7cf0aaba Define a helper function ConstantVector::getSplatValue for testing for
and working with broadcasted constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 17:51:30 +00:00
Dan Gohman
c623096fe2 Add support for ISD::SELECT in SplitVectorOp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43072 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 14:48:28 +00:00
Duncan Sands
f411b83c8c Return Expand from getOperationAction for all extended
types.  This is needed for SIGN_EXTEND_INREG at least.
It is not clear if this is correct for other operations.
On the other hand, for the various load/store actions
it seems to correct to return the type action, as is
currently done.
Also, it seems that SelectionDAG::getValueType can be
called for extended value types; introduce a map for
holding these, since we don't really want to extend
the vector to be 2^32 pointers long!
Generalize DAGTypeLegalizer::PromoteResult_TRUNCATE
and DAGTypeLegalizer::PromoteResult_INT_EXTEND to handle
the various funky possibilities that apints introduce,
for example that you can promote to a type that needs
to be expanded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43071 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 13:49:58 +00:00
Devang Patel
afc407ea51 Apply "Instead of loading small c string constant, use integer constant directly" transformation while processing load instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43070 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 07:24:40 +00:00
Evan Cheng
a5bfc97da7 Apply Chris' suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43069 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 06:53:44 +00:00
Chris Lattner
7ef1a4bf04 Change fp to sint legalization on x86-32 to do 2 x i32
loads instead of 1 x i64 loads.  This doesn't change any functionality yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43068 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 06:17:29 +00:00
Chris Lattner
2ff75ee9ab fix some funny indentation, add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43066 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 06:02:13 +00:00
Evan Cheng
95f0ab624d One more extract_subreg coalescing bug fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 05:29:37 +00:00
Evan Cheng
3c1f4a4d47 Fix MergeValueInAsValue(). It allows overlapping live ranges but should replace
their value numbers with the specified value number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:13:29 +00:00
Evan Cheng
3f4b80ec0c Clean up code that calculate MBB live-in's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43061 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:12:22 +00:00
Evan Cheng
4ca980e7f9 Clean up code that calculate MBB live-in's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43060 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:10:22 +00:00
Owen Anderson
05d2318fbd Move splitBlock into DomTreeBase from DomTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43059 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 02:03:17 +00:00
Devang Patel
16a04f3f20 Use immediate stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43055 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 23:44:18 +00:00
Dale Johannesen
db44bf85d8 Disable attempts to constant fold PPC f128.
Remove the assumption that this will happen from
various places.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 23:38:29 +00:00
Evan Cheng
11923cc05e Some clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43043 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 21:09:14 +00:00
Owen Anderson
49b653aa6a Template DominatorTreeBase by node type. This is the next major step towards
having dominator information on MBB's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 19:59:25 +00:00
Evan Cheng
dcd8f78f8a Fix PR1734.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 19:29:47 +00:00
Dale Johannesen
c274f54ed8 Check for invalid cc's in f80 select.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 18:09:08 +00:00
Chris Lattner
f602a25668 Fix a bug handling frame references in ppc inline asm when the frame offset
doesn't fit into 16 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43032 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 18:00:18 +00:00
Duncan Sands
af47b11b95 Initial infrastructure for arbitrary precision integer
codegen support.  This should have no effect on codegen
for other types.  Debatable bits: (1) the use (abuse?)
of a set in SDNode::getValueTypeList; (2) the length of
getTypeToTransformTo, which maybe should be refactored
with a non-inline part for extended value types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43030 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 09:56:48 +00:00
Duncan Sands
a7c97a7f5b Fixes due to lack of type-safety for ValueType: (1) ValueType
being passed instead of an opcode; (2) ValueType being passed
for isVolatile (!) in getLoad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43028 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 09:07:20 +00:00
Arnold Schwaighofer
448175fd02 Correction to tail call optimization code. The new return address
was stored to the acutal stack slot before the parameters were
lowered to their stack slot. This could cause arguments to be
overwritten by the return address if the called function had less
parameters than the caller function. The update should remove the
last failing test case of llc-beta: SPASS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43027 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 09:05:00 +00:00
Evan Cheng
8b0b874987 Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43026 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 08:04:24 +00:00
Chris Lattner
59e84258cb implement promotion of select and select_cc, allowing MallocBench/gs to
work with type promotion on x86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43025 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 03:00:22 +00:00
Dan Gohman
c4c9660129 Teach IntrinsicLowering.cpp about the sin, cos, and pow intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 22:07:31 +00:00
Evan Cheng
4859e277f7 Make CalcLatency() non-recursive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43017 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 21:33:22 +00:00
Chris Lattner
1de7c1dd6f Change LowerFP_TO_SINT to create the specific code it needs instead of
unconditionally creating an i64 bitcast.  With the future legalizer
design, operation legalization can't introduce new nodes with illegal
types.

This fixes the rest of olden on ppc32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43005 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 20:14:52 +00:00
Evan Cheng
87c8935fd5 LowerFP_TO_SINT must not create a stack object if it's not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43004 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 20:11:21 +00:00
Devang Patel
73d0e211a3 Add removeModuleProvider()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43002 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 19:56:32 +00:00
Evan Cheng
f5c7359afa Fix PR1729: watch out for val# with no def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42996 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 18:33:50 +00:00
Chris Lattner
85dd3be735 Move CreateStackTemporary out to SelectionDAG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42995 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 17:48:57 +00:00
Chris Lattner
37ce9df0da add a new CreateStackTemporary helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42994 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 17:47:20 +00:00
Chris Lattner
cfc24007b1 implement promotion of BR_CC operands, fixing bisort on ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 17:16:12 +00:00
Chris Lattner
1296e9d306 updates from duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42991 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 16:46:29 +00:00
Devang Patel
b9e981304b Achieve same result but use fewer lines of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42985 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 15:31:35 +00:00
Neil Booth
686700e325 Fast-track obviously over-large and over-small exponents during decimal->
integer conversion.  In some such cases this makes us one or two orders
of magnitude faster than NetBSD's libc.  Glibc seems to have a similar
fast path.

Also, tighten up some upper bounds to save a bit of memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42984 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 15:00:55 +00:00
Duncan Sands
65f8d3bf6b Fix some typos. Call getTypeToTransformTo rather than
getTypeToExpandTo.  The difference is that
getTypeToExpandTo gives the final result of expansion
(eg: i128 -> i32 on a 32 bit machine) while
getTypeToTransformTo does just one step (i128 -> i64).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42982 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 13:30:18 +00:00
Chris Lattner
01d029b82c One mundane change: Change ReplaceAllUsesOfValueWith to *optionally*
take a deleted nodes vector, instead of requiring it.

One more significant change:  Implement the start of a legalizer that
just works on types.  This legalizer is designed to run before the 
operation legalizer and ensure just that the input dag is transformed
into an output dag whose operand and result types are all legal, even
if the operations on those types are not.

This design/impl has the following advantages:

1. When finished, this will *significantly* reduce the amount of code in
   LegalizeDAG.cpp.  It will remove all the code related to promotion and
   expansion as well as splitting and scalarizing vectors.
2. The new code is very simple, idiomatic, and modular: unlike 
   LegalizeDAG.cpp, it has no 3000 line long functions. :)
3. The implementation is completely iterative instead of recursive, good
   for hacking on large dags without blowing out your stack.
4. The implementation updates nodes in place when possible instead of 
   deallocating and reallocating the entire graph that points to some 
   mutated node.
5. The code nicely separates out handling of operations with invalid 
   results from operations with invalid operands, making some cases
   simpler and easier to understand.
6. The new -debug-only=legalize-types option is very very handy :), 
   allowing you to easily understand what legalize types is doing.

This is not yet done.  Until the ifdef added to SelectionDAGISel.cpp is
enabled, this does nothing.  However, this code is sufficient to legalize
all of the code in 186.crafty, olden and freebench on an x86 machine.  The
biggest issues are:

1. Vectors aren't implemented at all yet
2. SoftFP is a mess, I need to talk to Evan about it.
3. No lowering to libcalls is implemented yet.
4. Various operations are missing etc.
5. There are FIXME's for stuff I hax0r'd out, like softfp.

Hey, at least it is a step in the right direction :).  If you'd like to help,
just enable the #ifdef in SelectionDAGISel.cpp and compile code with it.  If
this explodes it will tell you what needs to be implemented.  Help is 
certainly appreciated.

Once this goes in, we can do three things:

1. Add a new pass of dag combine between the "type legalizer" and "operation
   legalizer" passes.  This will let us catch some long-standing isel issues
   that we miss because operation legalization often obfuscates the dag with
   target-specific nodes.
2. We can rip out all of the type legalization code from LegalizeDAG.cpp,
   making it much smaller and simpler.  When that happens we can then 
   reimplement the core functionality left in it in a much more efficient and
   non-recursive way.
3. Once the whole legalizer is non-recursive, we can implement whole-function
   selectiondags maybe...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42981 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 06:10:22 +00:00
Chris Lattner
3cb9351e8a One xform performed by LegalizeDAG is transformation of "store of fp" to "store of int".
Make two changes:
1) only xform "store of f32" if i32 is a legal type for the target.
2) only xform "store of f64" if either i64 or i32 are legal for the target.
3) if i64 isn't legal, manually lower to 2 stores of i32 instead of letting a
   later pass of legalize do it.  This is ugly, but helps future changes I'm 
   about to commit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42980 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 05:46:06 +00:00
Chris Lattner
3cab1c72b5 avoid an APFloat copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42979 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 05:34:10 +00:00
Chris Lattner
59afba0fe9 Add a (disabled by default) way to view the ID of a node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42978 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 05:32:43 +00:00
Dale Johannesen
6e64473603 Handle PPC long double in CBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42972 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15 01:05:37 +00:00
Chris Lattner
7a3c85583d remove misleading comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42970 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 20:35:12 +00:00
Chris Lattner
fb5b11046b If a target doesn't have HasMULHU or HasUMUL_LOHI, ExpandOp would return
without lo/hi set.  Fall through to making a libcall instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42969 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 18:35:05 +00:00
Neil Booth
e5e0194583 Consolidate logic for creating NaNs. Silence compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42966 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 10:39:51 +00:00
Neil Booth
caf19d79e5 Whether arithmetic is supported is a property of the semantics. Make it
so, and clean up the checks by putting them in an inline function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42965 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 10:29:28 +00:00
Neil Booth
1870f29c6c Separate out parsing of decimal number. Use this to only allocate
memory for the significand once up-front.  Also ignore insignificant
trailing zeroes; this saves unnecessary multiplications later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42964 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 10:16:12 +00:00
Evan Cheng
3644601563 Unbreak x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42962 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 10:09:39 +00:00
Evan Cheng
34729256e8 When coalescing an EXTRACT_SUBREG and the dst register is a physical register,
the source register will be coalesced to the super register of the LHS. Properly
merge in the live ranges of the resulting coalesced interval that were part of
the original source interval to the live interval of the super-register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42961 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 10:08:34 +00:00
Evan Cheng
347d39f1fd Revert 42908 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 05:57:21 +00:00
Dale Johannesen
296c176141 Fix type mismatch error in PPC Altivec (only causes
a problem when asserts are on).  From vecLib.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42959 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 01:58:32 +00:00
Dale Johannesen
5927d8e94d Disable some compile-time optimizations on PPC
long double.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42958 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-14 01:56:47 +00:00
Duncan Sands
7fef59f7e5 Clarify that fastcc has a problem with nested function
trampolines, rather than with nested functions themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42955 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 07:38:37 +00:00
Chris Lattner
e33544ce55 Enhance the truncstore optimization code to handle shifted
values and propagate demanded bits through them in simple cases.

This allows this code:
void foo(char *P) {
   strcpy(P, "abc");
}
to compile to:

_foo:
        ldrb r3, [r1]
        ldrb r2, [r1, #+1]
        ldrb r12, [r1, #+2]!
        ldrb r1, [r1, #+1]
        strb r1, [r0, #+3]
        strb r2, [r0, #+1]
        strb r12, [r0, #+2]
        strb r3, [r0]
        bx lr

instead of:

_foo:
        ldrb r3, [r1, #+3]
        ldrb r2, [r1, #+2]
        orr r3, r2, r3, lsl #8
        ldrb r2, [r1, #+1]
        ldrb r1, [r1]
        orr r2, r1, r2, lsl #8
        orr r3, r2, r3, lsl #16
        strb r3, [r0]
        mov r2, r3, lsr #24
        strb r2, [r0, #+3]
        mov r2, r3, lsr #16
        strb r2, [r0, #+2]
        mov r3, r3, lsr #8
        strb r3, [r0, #+1]
        bx lr

testcase here: test/CodeGen/ARM/truncstore-dag-combine.ll

This also helps occasionally for X86 and other cases not involving 
unaligned load/stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42954 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 06:58:48 +00:00
Chris Lattner
2b4c279a8e Add a simple optimization to simplify the input to
truncate and truncstore instructions, based on the 
knowledge that they don't demand the top bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42952 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 06:35:54 +00:00
Neil Booth
d1a23d573d If the power of 5 is exact, and the reciprocal exact, the error is zero not one half-ulps. This prevents an infinite loop in rare cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42950 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 03:34:08 +00:00
Evan Cheng
7f56625447 Local spiller optimization:
Turn this:
movswl  %ax, %eax
movl    %eax, -36(%ebp)
xorl    %edi, -36(%ebp)
into
movswl  %ax, %eax
xorl    %edi, %eax
movl    %eax, -36(%ebp)
by unfolding the load / store xorl into an xorl and a store when we know the
value in the spill slot is available in a register. This doesn't change the
number of instructions but reduce the number of times memory is accessed.

Also unfold some load folding instructions and reuse the value when similar
situation presents itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42947 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 02:50:24 +00:00
Evan Cheng
106e8020bd Change unfoldMemoryOperand(). User is now responsible for passing in the
register used by the unfolded instructions. User can also specify whether to
unfold the load, the store, or both.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42946 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 02:35:06 +00:00
Evan Cheng
fa9457276a Optionally create a MachineInstr without default implicit operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42945 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13 02:23:01 +00:00
Arnold Schwaighofer
92226dd19f Correcting the corrections. Bad bad baaad emacs!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42935 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 21:53:12 +00:00
Arnold Schwaighofer
48abc5cf6b Corrected many typing errors. And removed 'nest' parameter handling
for fastcc from X86CallingConv.td.  This means that nested functions
are not supported for calling convention 'fastcc'.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42934 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 21:30:57 +00:00
Devang Patel
7b9e1d251f Dest type is always i8 *. This allows some simplification.
Do not filter memmove.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42930 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 20:10:21 +00:00
Duncan Sands
2e4d675d93 Due to the new tail call optimization, trampolines can no
longer be created for fastcc functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42925 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 19:37:31 +00:00
Dale Johannesen
f646774edd ppc long double. Implement fabs and fneg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42924 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 19:02:17 +00:00
Evan Cheng
1c5d83c14e Update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 18:22:55 +00:00
Chris Lattner
a79dd432b3 Fix a bug in my patch last night that broke InstCombine/2007-10-12-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42920 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 18:05:47 +00:00
Dale Johannesen
6e63e09236 Implement i64->ppcf128 conversions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42919 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 17:52:03 +00:00
Evan Cheng
48ff282dd4 Did mean to leave this in. INSERT_SUBREG isn't being coalesced yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42916 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 17:16:50 +00:00
Neil Booth
6ac7016eb1 Remove duplicate comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42913 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 16:05:57 +00:00
Neil Booth
96c7471b39 Implement correctly-rounded decimal->binary conversion, i.e. conversion
from user input strings.

Such conversions are more intricate and subtle than they may appear;
it is unlikely I have got it completely right first time.  I would
appreciate being informed of any bugs and incorrect roundings you
might discover.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42912 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 16:02:31 +00:00
Neil Booth
5b8e0c5fd3 Remove a field that was never used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42911 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 15:35:10 +00:00
Neil Booth
7a951ca548 If we're trying to be arbitrary precision, unsigned char clearly won't cut it. Needed for dec->bin conversions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42910 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 15:33:27 +00:00
Neil Booth
1e8390d8d6 Don't attempt to mask no bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42909 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 15:31:31 +00:00
Dan Gohman
8ddde0a151 Change the names used for internal labels to use the current
function symbol name instead of a codegen-assigned function
number.

Thanks Evan! :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 14:53:36 +00:00
Dan Gohman
a9b511187b Fix some corner cases with vectors in copyToRegs and copyFromRegs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42907 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 14:33:11 +00:00
Dan Gohman
9e04c82c0e Add support to SplitVectorOp for powi, where the second operand
is a scalar integer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42906 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 14:13:46 +00:00
Dan Gohman
f0d0089340 Mark vector ctpop, cttz, and ctlz as Expand on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42905 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 14:09:42 +00:00
Dan Gohman
a3f269f7f6 Mark vector pow, ctpop, cttz, and ctlz as Expand on PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 14:08:57 +00:00
Evan Cheng
52c7ff7067 Restrict EXTRACT_SUBREG coalescing to avoid negative performance impact.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 09:15:53 +00:00
Evan Cheng
32dfbeada7 EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG like
(almost) a register copy. However, it always coalesced to the register of the
RHS (the super-register). All uses of the result of a EXTRACT_SUBREG are sub-
register uses which adds subtle complications to load folding, spiller rewrite,
etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42899 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 08:50:34 +00:00
Evan Cheng
10136e7c7f Some clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42898 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 08:45:27 +00:00
Evan Cheng
f4a9c69ff6 Fold load / store into MOV32to32_ and MOV16to16_.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42895 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 08:38:01 +00:00
Evan Cheng
96aaa54529 Flag MOV32to32_ with EXTRACT_SUBREG. They should not be scheduled apart.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42894 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 07:55:53 +00:00
Gabor Greif
f3cdf3e3ec eliminate warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42892 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 07:44:54 +00:00
Chris Lattner
6a94de2990 Fix some 80 column violations.
Fix DecomposeSimpleLinearExpr to handle simple constants better.
Don't nuke gep(bitcast(allocation)) if the bitcast(allocation) will
fold the allocation.  This fixes PR1728 and Instcombine/malloc3.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42891 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 05:30:59 +00:00
Dale Johannesen
ca68aaa0e5 PPC long double. Implement a couple more conversions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42888 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 01:37:08 +00:00
Dan Gohman
ac9385a555 Add intrinsics for sin, cos, and pow. These use llvm_anyfloat_ty, and so
may be overloaded with vector types. And add a testcase for codegen for
these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42885 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 00:01:22 +00:00
Dan Gohman
8266952813 Codegen support for vector intrinsics.
Factor out the code that expands the "nasty scalar code" for unrolling
vectors into a separate routine, teach it how to handle mixed
vector/scalar operands, as seen in powi, and use it for several operators,
including sin, cos, powi, and pow.

Add support in SplitVectorOp for fpow, fpowi and for several unary
operators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:57:53 +00:00
Dale Johannesen
fcf4d24ffb Implement ppc long double->uint conversion.
Make ppc long double constants print.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42882 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:32:15 +00:00
Dan Gohman
f96e4de403 Set ISD::FPOW to Expand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42881 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:21:31 +00:00
Dan Gohman
e54be10418 Add runtime library names for pow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42880 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:09:10 +00:00
Dan Gohman
07f04fd574 Add an ISD::FPOW node type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42879 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:06:37 +00:00
Dale Johannesen
83e105c600 Add missing argument to PALIGNR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42874 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 20:58:37 +00:00
Gabor Greif
724441e64a Fix an assertion abort on sparc. malloc(0) is allowed to
return NULL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42871 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 19:40:35 +00:00
Arnold Schwaighofer
c85e1716f0 Added tail call optimization to the x86 back end. It can be
enabled by passing -tailcallopt to llc.  The optimization is
performed if the following conditions are satisfied:
* caller/callee are fastcc
* elf/pic is disabled OR
  elf/pic enabled + callee is in module + callee has
  visibility protected or hidden


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42870 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 19:40:01 +00:00
Dale Johannesen
a471c2ecda Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet,
just format transformations.  Make readers and
writers work.  Split constants into 2 doubles in
Legalize.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 18:07:22 +00:00
Devang Patel
f9193de25b Lower memcpy if it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42864 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 17:21:57 +00:00
Chris Lattner
85d0aaa291 Fix CodeGen/Generic/BasicInstrs.llx on sparc by marking divrem
illegal.  Thanks to gabor for pointing this out!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42832 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 18:10:57 +00:00
Duncan Sands
272dce0137 Correct swapped arguments to getConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42824 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 09:54:50 +00:00
Dale Johannesen
6eaeff29b8 Next PPC long double bits: ppcf128->i32 conversion.
Surprisingly complicated.
Adds getTargetNode for 2 outputs, no inputs (missing).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 01:01:31 +00:00
Evan Cheng
be8db245f5 Bad choice of variable name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 00:11:40 +00:00
Evan Cheng
5edc57fa42 Fix an extremely stupid bug that prevented first round of coalescing (physical registers only) from happening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42820 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 23:36:27 +00:00
Chris Lattner
3daae2701b Add new MemoryBuffer::getMemBufferCopy method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 21:46:38 +00:00
Devang Patel
b593898e11 Do not walk invalid iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42812 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 21:31:36 +00:00
Dan Gohman
9a5263241d Pass argc by value, not by reference, since it isn't modified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 16:04:57 +00:00
Dan Gohman
6d60cac029 LowerIntegerDivOrRem no longer exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42787 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 15:45:13 +00:00
Dan Gohman
74f87a63b6 Fix grammar in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42786 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 15:44:37 +00:00
Dan Gohman
5bf88ebab9 This is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 15:42:21 +00:00
Evan Cheng
b76143cf8f Under 64-bit mode use LEA64_32r instead of LEA64r to save a byte.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42783 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 07:14:53 +00:00
Chris Lattner
be2c4596cb Change a #include into a forward declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 03:40:30 +00:00
Bruno Cardoso Lopes
8262df3aa4 Position Independent Code (PIC) support [3]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42780 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 03:15:11 +00:00
Bruno Cardoso Lopes
0a6040063f Position Independent Code (PIC) support [2]
- Added a function to hold the stack location 
  where GP must be stored during LowerCALL
- AsmPrinter now emits directives based on
  relocation type
- PIC_ set to default relocation type (same as GCC)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42779 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 03:01:19 +00:00
Bruno Cardoso Lopes
e78080c4dc Position Independent Code (PIC) support [1]
- Modified instruction format to handle pseudo instructions
- Added LoadAddr SDNode to load symbols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 02:55:31 +00:00
Evan Cheng
3f41d66d75 Bug fix. X86 was emitting redundant setcc and test instructions before a conditional move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 22:16:29 +00:00
Dan Gohman
30d4254536 Call getFunctionNumber() instead of referencing FunctionNumber directly,
for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:27:12 +00:00
Dan Gohman
525178cdbf Migrate X86 and ARM from using X86ISD::{,I}DIV and ARMISD::MULHILO{U,S} to
use ISD::{S,U}DIVREM and ISD::{S,U}MUL_HIO. Move the lowering code
associated with these operators into target-independent in LegalizeDAG.cpp
and TargetLowering.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42762 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:33:35 +00:00
Evan Cheng
d47c84c1c9 Allow x86 compare to be commutable by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42761 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:27:46 +00:00
Gordon Henriksen
2618a6c112 C and Objective Caml bindings for PHINode::addIncoming etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:14:39 +00:00
Dan Gohman
389079b59f DAGCombiner support for UDIVREM/SDIVREM and UMUL_LOHI/SMUL_LOHI.
Check if one of the two results unneeded so see if a simpler operator
could bs used. Also check to see if each of the two computations could be
simplified if they were split into separate operators. Factor out the code
that calls visit() so that it can be used for this purpose.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:57:15 +00:00
Evan Cheng
b428657504 Remove debugging printf to get build going on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:49:43 +00:00
Dan Gohman
3ce990dc05 When we start enabling SMUL_LOHI/UMUL_LOHI or SDIVREM/UDIVREM in
target-indepenent lowering, don't use them on PowerPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:28:24 +00:00
Dan Gohman
08ce976971 Add convenience overloads of SelectionDAG::getNode that take a SDVTList
and individual SDOperand operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42753 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:49:58 +00:00
Dan Gohman
82a13c9c48 Move the space in overview output for commands out of each of the
commands and into the common code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:45:12 +00:00
Dan Gohman
8e41ed7c4e Simplify getIntPtrType, allowing it to work for arbitrary pointer sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:16:25 +00:00
Dan Gohman
c318329a10 Use correct parentheses with the '&& "..."' idiom in an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:13:30 +00:00
Dan Gohman
417e11b9bf In -debug mode, dump SelectionDAGs both before and after the
optimization passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42749 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:12:17 +00:00
Dan Gohman
cdf2b3b2f8 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:08:41 +00:00
Neil Booth
5477f8593d Use APInt::tcExtract. It's cleaner, and works :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42746 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 14:39:42 +00:00
Neil Booth
68e53ad6cb Add a new function tcExtract for extracting a bignum from an
arbitrary range of bits embedded in the middle of another bignum.
This kind of operation is desirable in many cases of software
floating point, e.g. converting bignum integers to floating point
numbers of fixed precision (you want to extract the precision most
significant bits).

Elsewhere, add an assertion, and exit the shift functions early if
the shift count is zero.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42745 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 13:47:12 +00:00
Owen Anderson
1aad74c9e8 Begin the process of allowing DomTree on MBB's. Step One: template DomTreeNode by making it a typedef of a templated DomTreeNodeBase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42743 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 07:44:39 +00:00
Evan Cheng
537d5c27ff Kill cycle of an live range is always the last use index + 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42742 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 06:59:30 +00:00
Gordon Henriksen
6d6203dff3 C and Objective Caml bindings for getFunction and getNamedGlobal. Also enhanced
the Objective Caml 'declare_*' functions to behave more or less like
getOrInsertFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 03:45:09 +00:00
Chris Lattner
f443ba7f97 disable this entirely: it is causing use of invalidated iterators and infinite looping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42739 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 22:00:31 +00:00
Chris Lattner
eac9385f09 Fix many regressions on x86 by avoiding dereferencing the end iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 21:53:12 +00:00
Gordon Henriksen
c84c16be9b C and Objective Caml bindings for GlobalVariable::isConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 17:31:42 +00:00
Neil Booth
f16c595252 Add back convertFromSignExtendedInteger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42735 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 12:15:41 +00:00
Neil Booth
7a7bc0f724 Now that convertFromUnsignedParts has a sane, constant interface,
convertFromZeroExtendedInteger can be simplified as it doesn't need
to make a copy of the source bignum.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42734 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 12:10:57 +00:00
Neil Booth
643ce59495 Reimplement convertFromUnsignedInteger so it is passed a const bignum.
It used to modify its argument in-place.

This interface is saner and the implementation more efficient.  It will
be needed for decimal->binary conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42733 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 12:07:53 +00:00
Neil Booth
ccf596a53e convertFromInteger, as originally written, expected sign-extended
input.  APInt unfortunately zero-extends signed integers, so Dale
modified the function to expect zero-extended input.  Make this
assumption explicit in the function name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42732 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 11:45:55 +00:00
Neil Booth
33d4c92e78 combineLostFractions does not need to be a member function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42729 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:51:21 +00:00
Gordon Henriksen
1cf08fddc7 C and Objective Caml bindings for PATypeHolder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 00:13:35 +00:00
Gordon Henriksen
c0491ac8b6 Bindings for the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42707 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 21:00:36 +00:00
Anton Korobeynikov
2508372746 Oops, I really wanted to commit this part also :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42700 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 16:39:43 +00:00
Anton Korobeynikov
4f1c33f7c8 Move merge code into new helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42699 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 16:17:49 +00:00
Gordon Henriksen
81a788176e Adopting a uniform naming convention for type constructors in bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 16:05:20 +00:00
Gordon Henriksen
e3b989d4a4 Adopting a uniform naming convention for constant constructors in bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 15:11:06 +00:00
Gordon Henriksen
4647569fe7 Adding C and Ocaml bindings for ConstantExpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42696 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 14:29:36 +00:00
Evan Cheng
513da43c9c Reapply 42677.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 08:19:55 +00:00
Neil Booth
92f7e8d925 Cleaner, more general exponent output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42690 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 07:29:25 +00:00
Chris Lattner
a11ef82207 silence warnings in no-assert build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42687 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 06:13:42 +00:00
Chris Lattner
5349de1372 revert evan's patch until the header is committed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42686 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 06:08:17 +00:00
Evan Cheng
c231e8c8a5 Added DAG xforms. e.g.
(vextract (v4f32 s2v (f32 load $addr)), 0) -> (f32 load $addr) 
(vextract (v4i32 bc (v4f32 s2v (f32 load $addr))), 0) -> (i32 load $addr)
Remove x86 specific patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42677 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 02:46:29 +00:00
Dale Johannesen
638ccd52b9 Next powerpc long double bits. Comparisons work,
although not well, and shortening FP converts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42672 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 01:24:11 +00:00
Neil Booth
055c0b3a8f Fix and clarify some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42670 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 00:43:45 +00:00
Neil Booth
978661d053 Generalize tcFullMultiply so that the operands can be of differing
part widths.  Also, return the number of parts actually required to
hold the result's value.
Remove an over-cautious condition from rounding of float->hex conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42669 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 00:24:48 +00:00
Gordon Henriksen
88cc699942 Wrapping Value::dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 00:08:49 +00:00
Gordon Henriksen
acd96191cd Removing the silly CHelpers header by rolling wrap and unwrap into the C
bindings headers themselves, hidden behind #ifdef __cplusplus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42666 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 23:59:36 +00:00
Evan Cheng
7ad42d9ec0 Commute x86 cmove instructions by swapping the operands and change the condition
to its inverse.
Testing this as llcbeta


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42661 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 23:13:21 +00:00
Evan Cheng
57cce6c466 This is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 22:34:59 +00:00
Evan Cheng
ecf80ac68a Enable convertToThreeAddress for X86 by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42655 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 22:31:10 +00:00
Devang Patel
5c4cd0d82e Fix bug in updating dominance frontier after loop
unswitch when frontier includes basic blocks that 
are not inside loop.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42654 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 22:29:34 +00:00
Evan Cheng
b75ed322c4 INC64_32r -> LEA64_32r is better than INC64_32r -> LEA32r, but it still can
cause performance degradation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42653 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 21:55:32 +00:00
Evan Cheng
559dc46d46 In 64-bit mode, avoid using leal with 32-bit 32-bit address size, e.g.
leal 1(%ecx), %edi, which requires 67H prefix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42647 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 20:34:26 +00:00
Dale Johannesen
161e897b0f First round of ppc long double. call/return and
basic arithmetic works.
Rename RTLIB long double functions to distinguish
different flavors of long double; the lib functions
have different names, alas.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42644 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 20:04:43 +00:00
Evan Cheng
b952d1f5be Add support to convert more 64-bit instructions to 3-address instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42642 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 18:20:36 +00:00
Evan Cheng
3154cb67d1 ADC and SBB uses EFLAGS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42640 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 17:59:57 +00:00
Dan Gohman
52c0253f04 Change a few more spaces to tabs in assembly output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42638 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 15:58:41 +00:00
Dan Gohman
4e8e831a4e Change a space to a tab in the assembly output of a .globl directive
for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42637 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 15:54:58 +00:00
Dan Gohman
e14ea86744 Legalize support for MUL_LOHI and DIVREM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42636 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 14:17:22 +00:00
Dan Gohman
2eb4ebd953 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42635 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 14:11:58 +00:00
Dan Gohman
ccd60799cd Provide names for MUL_LOHI and DIVREM operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42634 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 14:11:04 +00:00
Evan Cheng
3f411c7627 Testing convertToThreeeAddress as X86 llcbeta.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42630 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 08:04:01 +00:00
Evan Cheng
d5cb5a462b Chain producing nodes cannot be moved, not chain reading nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42627 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:42:35 +00:00
Evan Cheng
117c366219 Oops. Didn't mean to leave this in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:39:40 +00:00
Evan Cheng
f10c973797 If a node that defines a physical register that is expensive to copy. The
scheduler will try a number of tricks in order to avoid generating the
copies. This may not be possible in case the node produces a chain value
that prevent movement. Try unfolding the load from the node before to allow
it to be moved / cloned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42625 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:39:18 +00:00
Evan Cheng
75b4e46b8a Added storeRegToAddr, loadRegFromAddr, and unfoldMemoryOperand's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42624 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:34:55 +00:00
Evan Cheng
afa98bcf3d Not needed any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42623 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:34:14 +00:00
Evan Cheng
e203ae9971 Forgot these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42622 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:33:45 +00:00
Evan Cheng
66f0f64082 - Added a few target hooks to generate load / store instructions from / to any
address (not just from / to frameindexes).
- Added target hooks to unfold load / store instructions / SDNodes into separate
load, data processing, store instructions / SDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42621 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:32:41 +00:00
Evan Cheng
39305cf553 Add a variant of getTargetNode() that takes a vector of MVT::ValueType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42620 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:10:49 +00:00
Evan Cheng
daccea18ca Silence a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42619 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:09:32 +00:00
Chris Lattner
87b77b9079 add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42607 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 15:47:27 +00:00
Neil Booth
a30b0ee959 Add APFloat -> hexadecimal string conversion, as per %a and %A in C99.
Useful for diagnostics and debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42598 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 22:26:02 +00:00
Owen Anderson
9cb7f49ee9 Completely merge the implementation details of DomTree and PostDomTree.
Also, add a FIXME for a bug in PostDomTree calculation I noticed while writing this,


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42593 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:25:45 +00:00
Devang Patel
c1e2660c5d Fix 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42591 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:17:43 +00:00
Devang Patel
f476e8e7ce Refactor code in a separate method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42590 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:16:08 +00:00
Chris Lattner
116c3219df Add initial iterator support for folding set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42589 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:12:09 +00:00
Chris Lattner
9a7288b0c6 Simplify implementation of the FoldingSet circular list, a necessary step
to giving it iterators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42586 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 20:45:43 +00:00
Dan Gohman
cb406c2597 Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42585 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 19:26:29 +00:00
Dan Gohman
2bb7d0647e Fix a using namespace llvm; in a header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42584 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 19:04:09 +00:00
Dale Johannesen
5a2174febf Tone down an overzealous optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42582 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 17:45:27 +00:00
Chris Lattner
fce5cfe190 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42579 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 17:10:03 +00:00
Tanya Lattner
088b5913ef Fix PR1719, by not marking llvm.global.annotations internal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42578 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 17:05:40 +00:00
Neil Booth
b7dea4cb36 Tweak RoundAwayFromZero the bit number below which is truncated, and make
it const.

Preparation for APFloat -> hexadecimal string conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42576 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 15:16:41 +00:00
Chris Lattner
e1bb6ab7b0 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42573 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 06:10:59 +00:00
Chris Lattner
bd14f58b76 Fix PR1719, by not marking llvm.noinline internal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42565 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 03:59:15 +00:00
Chris Lattner
67a1af9709 Bill's example is still not enough to repro this, but it has other issues that
seem significant as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42564 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 03:40:24 +00:00
Owen Anderson
471ab54df7 Factor some code from the DomTree and PostDomTree calculate methods up into
each one's runOnFunction method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42563 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 03:20:17 +00:00
Bill Wendling
7687bd0b2b Another micro-opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42554 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 21:49:31 +00:00
Bill Wendling
2bb6d459e6 Another missed optimization with LICM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42552 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 21:43:06 +00:00
Bill Wendling
892d392905 Small label changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42549 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 21:02:53 +00:00
Bill Wendling
6dbb1b59ae Now with source code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42548 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 21:01:16 +00:00
Bill Wendling
8d1c8ce3d8 Now with LL code!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42547 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 20:54:32 +00:00
Bill Wendling
6aab4910cd Another missed optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42546 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 20:42:59 +00:00
Bill Wendling
c720279ac7 Micro-optimization -- missed LICM opportunity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42542 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 19:55:05 +00:00
Dale Johannesen
9ab7fb3ba4 Rewrite sqrt and powi to use anyfloat. By popular demand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42537 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 17:43:59 +00:00
Evan Cheng
7f3394f379 Refactor code to add load / store folded instructions -> register only
instructions reverse map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42509 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 23:44:33 +00:00
Dale Johannesen
a7ac2bd407 Fix stride computations for long double arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42508 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 23:08:35 +00:00