Commit Graph

465 Commits

Author SHA1 Message Date
Anton Korobeynikov 1b4e6015b4 Fixed uninitialized stuff inside LegalizeDAG. Fortunately, the only
affected part is codegen of "memove" inside x86 backend. This fixes
PR1144

llvm-svn: 33752
2007-02-01 08:39:52 +00:00
Chris Lattner 296a83cefb Fit in 80 columns
llvm-svn: 33745
2007-02-01 04:55:59 +00:00
Evan Cheng 53026f1d5a Allow the target to override the ISD::CondCode that's to be used to test the
result of the comparison libcall against zero.

llvm-svn: 33701
2007-01-31 09:29:11 +00:00
Nate Begeman eda5997cc8 Finish off bug 680, allowing targets to custom lower frame and return
address nodes.

llvm-svn: 33636
2007-01-29 22:58:52 +00:00
Anton Korobeynikov 9fa3839d29 More cleanup
llvm-svn: 33605
2007-01-28 16:04:40 +00:00
Anton Korobeynikov 037c867b54 Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Jim Laskey c56315c2b5 Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.

llvm-svn: 33550
2007-01-26 21:22:28 +00:00
Jim Laskey f9e5445ed4 Make LABEL a builtin opcode.
llvm-svn: 33537
2007-01-26 14:34:52 +00:00
Chris Lattner 50ee0e40e5 Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can.  Patch by Scott Michel!

llvm-svn: 33409
2007-01-20 22:35:55 +00:00
Reid Spencer a94d394ad2 For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.

llvm-svn: 33370
2007-01-19 21:13:56 +00:00
Evan Cheng 31cbddf28a Store default libgcc routine names and allow them to be redefined by target.
llvm-svn: 33105
2007-01-12 02:11:51 +00:00
Evan Cheng 5f80c450f3 Expand fcopysign to the bitwise sequence if select is marked as expensive.
llvm-svn: 32940
2007-01-05 23:33:44 +00:00
Evan Cheng 3b841ddbe0 Bug in ExpandFCOPYSIGNToBitwiseOps(). Clear the old sign bit of operand 0
before or'ing in the sign bit of operand 1.

llvm-svn: 32930
2007-01-05 21:31:51 +00:00
Evan Cheng 003feb03d5 Expand fcopysign to a series of bitwise of operations when it's profitable to
do so.

llvm-svn: 32881
2007-01-04 21:56:39 +00:00
Reid Spencer 791864c6a5 Clean up from recent changes. Comment the new parameter to ExpandLibCall.
Consolidate some lines of code and remove duplication.

llvm-svn: 32829
2007-01-03 04:22:32 +00:00
Reid Spencer e63b6518fa For PR950:
Three changes:
1. Convert signed integer types to signless versions.
2. Implement the @sext and @zext parameter attributes. Previously the
   type of an function parameter was used to determine whether it should
   be sign extended or zero extended before the call. This information is
   now communicated via the function type's parameter attributes.
3. The interface to LowerCallTo had to be changed in order to accommodate
   the parameter attribute information. Although it would have been
   convenient to pass in the FunctionType itself, there isn't always one
   present in the caller. Consequently, a signedness indication for the
   result type and for each parameter was provided for in the interface
   to this method. All implementations were changed to make the adjustment
   necessary.

llvm-svn: 32788
2006-12-31 05:55:36 +00:00
Evan Cheng 9ad6edf2ec May need to promote the operand (either sign_extend_inreg or and) before
expanding a {s|u}int_to_fp.

llvm-svn: 32665
2006-12-19 01:44:04 +00:00
Evan Cheng adc80f98cf LegalizeSetCCOperands() may end up inserting libcalls. They need to be
properly serialized. Do not clear LastCallSEQ_END until that is done.

llvm-svn: 32659
2006-12-18 22:55:34 +00:00
Evan Cheng 851e589eda Expand FP undef
llvm-svn: 32623
2006-12-16 02:20:50 +00:00
Evan Cheng 860004688a Allow promoted FP_TO_UINT / FP_TO_SINT to expand operand.
llvm-svn: 32621
2006-12-16 02:10:30 +00:00
Evan Cheng 388cbbf000 Expand fabs / fneg to and / xor.
llvm-svn: 32619
2006-12-16 00:52:40 +00:00
Evan Cheng 884bc09d10 Fix select_cc, select expansion to soft-fp bugs.
llvm-svn: 32616
2006-12-15 22:42:55 +00:00
Chris Lattner b1a9492ed7 silence a bogus warning
llvm-svn: 32597
2006-12-15 07:36:19 +00:00
Evan Cheng 35fdd5ffe1 Expand FP compares to soft-fp call(s)
llvm-svn: 32590
2006-12-15 02:59:56 +00:00
Jim Laskey 70323a8146 1. Tidy up jump table info.
2. Allow the jit to handle PIC relocable jump tables.

llvm-svn: 32581
2006-12-14 19:17:33 +00:00
Evan Cheng 22cf89967b More soft-fp work.
llvm-svn: 32559
2006-12-13 20:57:08 +00:00
Evan Cheng e370e0eb09 Expand (f64 extload f32) to (f64 fp_ext (load f32)) if f64 type action is expand.
llvm-svn: 32527
2006-12-13 03:19:57 +00:00
Evan Cheng f3a80c6235 Expand fsqrt, fsin, and fcos to libcalls.
llvm-svn: 32526
2006-12-13 02:38:13 +00:00
Evan Cheng 0a5b805f6d Expand f32 / f64 to i32 / i64 conversion to soft-fp library calls.
llvm-svn: 32523
2006-12-13 01:57:55 +00:00
Evan Cheng 3766fc60da Expand FP constant to integers if FP types are not legal.
llvm-svn: 32497
2006-12-12 22:19:28 +00:00
Evan Cheng 97a750fc47 Soft fp FNEG, SINT_TO_FP, UINT_TO_FP libcall expansion.
llvm-svn: 32495
2006-12-12 21:51:17 +00:00
Evan Cheng 47833a1d28 Expand ConstantFP to load from CP if float types are being expanded.
llvm-svn: 32494
2006-12-12 21:32:44 +00:00
Evan Cheng 0076ca0da9 - When expanding a bit_convert whose src operand is also to be expanded and
its expansion result type is equal to the result type of the bit_convert,
e.g. (i64 bit_convert (f64 op)) if FP is not legal
returns the result of the expanded source operand.
- Store f32 / f64 may be expanded to a single store i32/i64.

llvm-svn: 32490
2006-12-12 19:53:13 +00:00
Chris Lattner 2f96e7d241 fit in 80 cols
llvm-svn: 32474
2006-12-12 05:22:21 +00:00
Chris Lattner 080881614d this can only be fptrunc.
llvm-svn: 32473
2006-12-12 05:21:51 +00:00
Chris Lattner 6ba11fbd75 Revert Nate's patch to fix X86/store-fp-constant.ll. With the dag combiner
and legalizer separated like they currently are, I don't see a way to handle
this xform.

llvm-svn: 32466
2006-12-12 04:18:56 +00:00
Reid Spencer 3c49edcaa1 Change inferred cast creation calls to more specific cast creations.
llvm-svn: 32460
2006-12-12 01:17:41 +00:00
Evan Cheng 3432ab97c1 Re-apply changes that were backed out and fix a naughty typo.
llvm-svn: 32442
2006-12-11 19:27:14 +00:00
Chris Lattner e9a203c4e5 Revert changes that broke oggenc on ppc
llvm-svn: 32440
2006-12-11 18:53:38 +00:00
Evan Cheng f4bec95b58 f32 / f64 node is expanded to one i32 / i64 node.
llvm-svn: 32433
2006-12-11 06:50:04 +00:00
Evan Cheng f6b01fdb48 Clean up some bad code.
llvm-svn: 32432
2006-12-11 06:25:26 +00:00
Nate Begeman 8e20c760fa Move something that should be in the dag combiner from the legalizer to the
dag combiner.

llvm-svn: 32431
2006-12-11 02:23:46 +00:00
Evan Cheng 4eee72471c Preliminary soft float support.
llvm-svn: 32394
2006-12-09 02:42:38 +00:00
Bill Wendling 22e978a736 Removing even more <iostream> includes.
llvm-svn: 32320
2006-12-07 20:04:42 +00:00
Evan Cheng a743fada65 Avoid inifinite looping if READCYCLECOUNTER isn't custom lowered.
llvm-svn: 32022
2006-11-29 19:13:47 +00:00
Evan Cheng 6973993e9c Allow target to custom lower READCYCLECOUNTER (when it doesn't have to be expanded).
llvm-svn: 32016
2006-11-29 08:26:18 +00:00
Chris Lattner 3abb63651b Fix PR1016
llvm-svn: 31950
2006-11-28 01:03:30 +00:00
Chris Lattner db18938355 If a brcond condition is promoted, make sure to zero extend it, even if not
expanded into BR_CC.

llvm-svn: 31932
2006-11-27 04:39:56 +00:00
Chris Lattner 94c231f453 Fix PR988 and CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll.
The low part goes in the first operand of expandop, not the second one.

llvm-svn: 31487
2006-11-07 04:11:44 +00:00
Reid Spencer de46e48420 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00