Commit Graph

3466 Commits

Author SHA1 Message Date
Zhou Sheng
6b6b6ef167 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 12:24:14 +00:00
Evan Cheng
c8edc64188 Naming consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33026 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:55:53 +00:00
Evan Cheng
c62d4bb695 Fix for PR1075: bottom-up register-reduction scheduling actually increases register pressure.
- Fixed bugs in sethi-ullman number computation and priority queue comparison
functions.
- Separate code that handles priority computation special cases from SU number computation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33025 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:50:38 +00:00
Chris Lattner
ddae4bd683 Implement some trivial FP foldings when -enable-unsafe-fp-math is specified.
This implements CodeGen/PowerPC/unsafe-math.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33024 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:04:05 +00:00
Jim Laskey
6488a078ba Need to handle static declarations properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 22:15:18 +00:00
Chris Lattner
f01da5939d llvm 2.0 doesn't support llvm.isunordered.*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32994 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 08:52:43 +00:00
Chris Lattner
a4810b52d0 remove support for llvm.isunordered
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 08:37:22 +00:00
Chris Lattner
b76efb71d4 Change the interface to Module::getOrInsertFunction to be easier to use,to resolve PR1088, and to help PR411.
This simplifies many clients also


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32989 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 08:12:01 +00:00
Evan Cheng
636c753b6b Expand fcopysign to the bitwise sequence if select is marked as expensive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32940 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 23:33:44 +00:00
Evan Cheng
068c5f47ea Bug in ExpandFCOPYSIGNToBitwiseOps(). Clear the old sign bit of operand 0
before or'ing in the sign bit of operand 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32930 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 21:31:51 +00:00
Evan Cheng
489a87ca09 CopyToReg source operand can be a register as well. e.g. Copy from GlobalBaseReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32929 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 20:59:06 +00:00
Evan Cheng
0d630d2204 GEP subscript is interpreted as a signed value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32888 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 01:46:20 +00:00
Chris Lattner
f8e7a21912 fix PowerPC/2007-01-04-ArgExtension.ll, a bug handling K&R prototypes with
the recent signless changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 22:22:37 +00:00
Evan Cheng
912095beca Expand fcopysign to a series of bitwise of operations when it's profitable to
do so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32881 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 21:56:39 +00:00
Reid Spencer
bcca3405bd Legalizer doesn't do an ANY_EXTEND if we don't ask for one so make sure
that we default to an ANY_EXTEND if no parameter attribute is set on the
result value of a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32836 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-03 16:49:33 +00:00
Jim Laskey
26a3687d53 NULL names should pass validation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32835 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-03 13:46:20 +00:00
Jim Laskey
1e3a5772d8 Silence warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32834 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-03 13:36:40 +00:00
Reid Spencer
376dd212f9 Restore previous behavior of defaulting to ZEXT. This works around two
things: (1) preventing PR1071 and (2) working around missing parameter
attributes for bool type. (2) will be fixed shortly. When PR1071 is fixed,
this patch should be undone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32831 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-03 05:03:05 +00:00
Reid Spencer
8c57dfb1ae Two changes:
1. Switch expression and cases are compared signed and are sign extended.
2. For function results needing extended, do SIGN_EXTEND if the SExtAttribute
   is set and ZERO_EXTEND if the ZExtAttribute is set, otherwise just let
   the Legalizer do ANY_EXTEND.
This fixes the recent regression in kimwitu++ and probably the llvm-gcc
bootstrap issue we had today.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32830 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-03 04:25:33 +00:00
Reid Spencer
b47b25cfda Clean up from recent changes. Comment the new parameter to ExpandLibCall.
Consolidate some lines of code and remove duplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-03 04:22:32 +00:00
Evan Cheng
ad93d7fda5 - Fixing naming inconsistency: calleesave -> calleesaved.
- Make use of spillCalleeSavedRegisters() and restoreCalleeSavedRegisters().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-02 21:31:15 +00:00
Reid Spencer
47857812e2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32788 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:55:36 +00:00
Reid Spencer
e4d87aa2de For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 06:05:41 +00:00
Jim Laskey
ee5f9274b9 Need to walk the derived chain of typedefs to get actual size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32744 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-22 20:03:42 +00:00
Evan Cheng
d472ad7c7c Debug dump error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32743 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-22 02:04:05 +00:00
Reid Spencer
246dd65a13 Just print integer constants as signed values. The actual signedness
doesn't matter as it is determined in the way the constant is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32733 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-21 19:04:23 +00:00
Reid Spencer
eefef64e59 Simplify all the casting business and get rid of isSigned().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32731 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-21 08:28:31 +00:00
Evan Cheng
0b4f80ee89 getLoad() and getStore() calls missed SVOffset operand. Thanks to Dan Gohman
for pointing it out!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32712 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-20 01:27:29 +00:00
Chris Lattner
cd3245ac45 Eliminate static ctors from Statistics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32698 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 22:41:21 +00:00
Anton Korobeynikov
24287ddb81 Fix for PR1059: http://llvm.org/PR1059
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32685 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 21:04:20 +00:00
Evan Cheng
7df28dc9d7 May need to promote the operand (either sign_extend_inreg or and) before
expanding a {s|u}int_to_fp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32665 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 01:44:04 +00:00
Evan Cheng
722cb36069 LegalizeSetCCOperands() may end up inserting libcalls. They need to be
properly serialized. Do not clear LastCallSEQ_END until that is done.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32659 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 22:55:34 +00:00
Reid Spencer
8a903db499 Convert the last uses of CastInst::createInferredCast to a normal cast
creation. These changes are still temporary but at least this pushes
knowledge of signedness out closer to where it can be determined properly
and allows signedness to be removed from VMCore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32654 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 08:47:13 +00:00
Rafael Espindola
15404d060b move ExtWeakSymbols to AsmPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32648 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 03:37:18 +00:00
Bill Wendling
f2174da713 Fixed so that it dereferences the ostream pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32640 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-17 11:15:53 +00:00
Bill Wendling
5c7e326585 Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32636 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-17 05:15:13 +00:00
Chris Lattner
36d439666c Fix PR1049 and CodeGen/Generic/2006-12-16-InlineAsmCrash.ll
by producing target constants instead of constants.  Constants can get
selected to li/movri instructions, which causes the scheduler to explode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32633 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 21:14:48 +00:00
Evan Cheng
e90460ee9a Cannot combine an indexed load / store any further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32629 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 06:25:23 +00:00
Evan Cheng
aa975c1c47 Expand FP undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32623 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 02:20:50 +00:00
Jeff Cohen
4b607748d8 The best unbreakage yet, addressing Bill's concerns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32622 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 02:15:42 +00:00
Evan Cheng
0b1b9dcf22 Allow promoted FP_TO_UINT / FP_TO_SINT to expand operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32621 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 02:10:30 +00:00
Evan Cheng
966bf24491 Expand fabs / fneg to and / xor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32619 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 00:52:40 +00:00
Jeff Cohen
c21c5eeb4f An even better unbreakage...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32617 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 22:57:14 +00:00
Evan Cheng
19103b11ec Fix select_cc, select expansion to soft-fp bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32616 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 22:42:55 +00:00
Jim Laskey
f6c4ccfaab This code was usurping the sextload expand in teh legalizer. Just make
sure the right conditions are checked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32611 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 21:38:30 +00:00
Chris Lattner
2d53a320b4 silence a bogus warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32597 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 07:36:19 +00:00
Evan Cheng
86facc2828 Minor clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32593 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 06:41:01 +00:00
Evan Cheng
2b49c50083 Expand FP compares to soft-fp call(s)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32590 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 02:59:56 +00:00
Jim Laskey
acd80ac7bb 1. Tidy up jump table info.
2. Allow the jit to handle PIC relocable jump tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32581 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 19:17:33 +00:00
Evan Cheng
7a0d51c8e3 Fix a long-standing spiller bug:
If a spillslot value is available in a register, and there is a noop copy that
targets that register, the spiller correctly decide not to invalidate the
spillslot register.

However, even though the noop copy does not clobbers the value. It does start a
new intersecting live range. That means the spillslot register is available for
use but should not be reused for a two-address instruction modref operand which
would clobber the new live range.

When we remove the noop copy, update the available information by clearing the
canClobber bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32576 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-14 07:54:05 +00:00
Evan Cheng
9f87788040 More soft-fp work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32559 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 20:57:08 +00:00
Evan Cheng
548f611bae Expand (f64 extload f32) to (f64 fp_ext (load f32)) if f64 type action is expand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32527 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 03:19:57 +00:00
Evan Cheng
98ff3b979a Expand fsqrt, fsin, and fcos to libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32526 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 02:38:13 +00:00
Evan Cheng
6af00d588c Expand f32 / f64 to i32 / i64 conversion to soft-fp library calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32523 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 01:57:55 +00:00
Reid Spencer
7b06bd532d Replace CastInst::createInferredCast calls with more accurate cast
creation calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-13 00:50:17 +00:00
Evan Cheng
279101eb1a Expand FP constant to integers if FP types are not legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32497 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 22:19:28 +00:00
Evan Cheng
5c9ce1893a Soft fp FNEG, SINT_TO_FP, UINT_TO_FP libcall expansion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32495 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 21:51:17 +00:00
Evan Cheng
004952140f Expand ConstantFP to load from CP if float types are being expanded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32494 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 21:32:44 +00:00
Evan Cheng
0ca67332fa Expand i32/i64 CopyToReg f32/f64 to BIT_CONVERT + CopyToReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32493 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 21:21:32 +00:00
Evan Cheng
7b2b5c846c - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32490 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 19:53:13 +00:00
Evan Cheng
b15974a65c Expand formal arguments and call arguments recursively: e.g. f64 -> i64 -> 2 x i32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32476 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 07:27:38 +00:00
Chris Lattner
f0094839f0 fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32474 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:22:21 +00:00
Chris Lattner
d9e06a5d03 this can only be fptrunc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32473 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:21:51 +00:00
Chris Lattner
3bb7e3f3ba This case isn't needed with recent changes to ConstantInt::get
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32472 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:19:46 +00:00
Chris Lattner
ddc9401991 split up inttoptr from ptrtoint handling, the cases aren't similar at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32471 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:18:19 +00:00
Chris Lattner
cb0a681989 the operand of a bitcast is always the right size, just emit it in place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32470 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:14:13 +00:00
Chris Lattner
d93d46ee7e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32466 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 04:18:56 +00:00
Chris Lattner
62be1a71f4 make this code more aggressive about turning store fpimm into store int imm.
This is not sufficient to fix X86/store-fp-constant.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32465 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 04:16:14 +00:00
Reid Spencer
86b89e5529 Tidy up a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32462 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 01:32:02 +00:00
Reid Spencer
15f46d6c28 Change inferred cast creation calls to more specific cast creations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32460 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 01:17:41 +00:00
Evan Cheng
13acce3ef0 Re-apply changes that were backed out and fix a naughty typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32442 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 19:27:14 +00:00
John Criswell
2381f6f6c6 It seems the llvm::OStream class does not handle stream manipulators.
For now, just grab the stream and perform the output on it directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 19:15:36 +00:00
Chris Lattner
70a24b3141 Revert changes that broke oggenc on ppc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32440 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 18:53:38 +00:00
Evan Cheng
25ece66ff3 Don't convert store double C, Ptr to store long C, Ptr if i64 is not a legal type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32434 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 17:25:19 +00:00
Evan Cheng
bbf1e5e2e9 f32 / f64 node is expanded to one i32 / i64 node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32433 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 06:50:04 +00:00
Evan Cheng
b618230231 Clean up some bad code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32432 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 06:25:26 +00:00
Nate Begeman
2cbba89347 Move something that should be in the dag combiner from the legalizer to the
dag combiner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32431 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 02:23:46 +00:00
Nate Begeman
bfaaaa6e0f Properly mangles symbol table names
Supports constant pools
Supports relocations to jump tables
Supports relocations within the data segment (global = address of global)
Allocates memory in a non-hacky for all non-code objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32430 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 02:20:45 +00:00
Anton Korobeynikov
d27a258d2d Cleaned setjmp/longjmp lowering interfaces. Now we're producing right
code (both asm & cbe) for Mingw32 target.
Removed autoconf checks for underscored versions of setjmp/longjmp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32415 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-10 23:12:42 +00:00
Evan Cheng
1a8f1fe676 Preliminary soft float support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32394 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-09 02:42:38 +00:00
Evan Cheng
cc22a7a2ad Move findTiedToSrcOperand to TargetInstrDescriptor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:45:48 +00:00
Evan Cheng
5c2a46052b Proper fix for PR1037: to determine is a VR is a modref, check 1) whether it is
tied to another oeprand, 2) whether is is being tied to by another operand. So
the destination operand of a two-address MI can be correctly identified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32354 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 08:02:34 +00:00
Evan Cheng
7814ad0bf3 findTiedToSrcOperand() changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32353 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 07:59:51 +00:00
Chris Lattner
555d8d6f4b Fix CodeGen/PowerPC/2006-12-07-SelectCrash.ll on PPC64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32336 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 22:36:47 +00:00
Bill Wendling
bcd2498f4f Removed more <iostream> includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32321 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 20:28:15 +00:00
Bill Wendling
832171cb97 Removing even more <iostream> includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32320 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 20:04:42 +00:00
Reid Spencer
fe46361719 Revision 1.83 causes PR1037.
Reverted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32305 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 16:21:19 +00:00
Evan Cheng
7d3223eef2 Initialize {Min|Max}CSFrameIndex properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32299 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 02:25:34 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Evan Cheng
51cdcd1972 MI keeps a ptr of TargetInstrDescriptor, use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32296 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:21:59 +00:00
Evan Cheng
6065f66e7c getOperandConstraint returns -1 if the operand does have the specific constraint. This bug was causing excessive spills.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32295 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 00:46:04 +00:00
Chris Lattner
ac0b6ae358 Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 17:46:33 +00:00
Jim Laskey
2b4e98cb20 Some addresssed should be 64-bit and some shouldn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32278 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 17:43:18 +00:00
Evan Cheng
576d123e13 Move copyKillDeadInfo out-of-line. Add findRegisterUseOperand().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32273 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 08:27:42 +00:00
Chris Lattner
4c7e227973 eliminate fp statistic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32251 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 01:48:55 +00:00
Jeff Cohen
97af751deb Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32113 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-02 02:22:01 +00:00
Evan Cheng
ba59a1e453 Match TargetInstrInfo changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32098 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-01 21:52:58 +00:00
Jim Laskey
2bbff6d173 better check for version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32045 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-30 18:29:23 +00:00
Jim Laskey
2172f966ca Change global descriptor names to provide name, full name and linkage name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32036 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-30 14:35:45 +00:00
Jim Laskey
749b01d5ff Temp fix to deal gdb issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32035 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-30 11:09:42 +00:00
Evan Cheng
67f660cb08 - MachineInstr now keeps a ptr to TargetInstrDescriptor instead of Opcode.
- Remove the ugly TargetInstrDescriptors hack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32032 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-30 07:08:44 +00:00
Evan Cheng
6a16c5ab2d Avoid inifinite looping if READCYCLECOUNTER isn't custom lowered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32022 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 19:13:47 +00:00
Jim Laskey
36729ddd23 Eliminate unnecessary scopes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32020 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 16:55:57 +00:00
Evan Cheng
f0b3ba6752 Allow target to custom lower READCYCLECOUNTER (when it doesn't have to be expanded).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32016 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 08:26:18 +00:00
Evan Cheng
f3e486e069 Fix for PR1023 by Dan Gohman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32003 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 01:58:12 +00:00
Evan Cheng
a5a57d66f5 Fix for PR1022 (folding loads of static initializers) by Dan Gohman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32000 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 01:38:07 +00:00
Chris Lattner
3f7927c84c add a hook to allow targets to hack on inline asms to lower them to llvm
when they want to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31997 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 01:12:32 +00:00
Bill Wendling
bdc679d564 Converted to using llvm streams instead of <iostream>s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31992 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 00:39:47 +00:00
Bill Wendling
a09362eb97 Use llvm streams instead of <iostream>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31985 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 22:48:48 +00:00
Bill Wendling
38b0e7bbf2 Put the #include for a module first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31958 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 03:31:29 +00:00
Evan Cheng
8bcb042f22 Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31957 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 02:25:34 +00:00
Bill Wendling
d9fd2acc1f Changed to using llvm streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31954 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 02:08:17 +00:00
Chris Lattner
b6c806045b Fix PR1016
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31950 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 01:03:30 +00:00
Evan Cheng
c0f64ffab9 Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead
of opcode and number of operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31947 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 23:37:22 +00:00
Chris Lattner
3687c1a4d3 Fix the dag combiner bug corresponding to PR1014.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31943 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 21:50:02 +00:00
Chris Lattner
bc4cf8d5b1 For better or worse, load from i1 is assumed to be zero extended. Do not
form a load from i1 from larger loads that may not be zext'd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31933 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 04:40:53 +00:00
Chris Lattner
f9908172e9 If a brcond condition is promoted, make sure to zero extend it, even if not
expanded into BR_CC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31932 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 04:39:56 +00:00
Reid Spencer
3da59db637 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Jim Laskey
0374248e86 Global label not handled correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31883 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-20 20:29:06 +00:00
Chris Lattner
32ba1aa204 Fix PR1011 and CodeGen/Generic/2006-11-20-DAGCombineCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31878 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-20 18:05:46 +00:00
Chris Lattner
a138c6c73a setOperand should not zap the operand list or add implicit operands to an
instruction.  Doing so breaks the FP stackifier, the alpha branch selector
the sparc fpmover.

This fixes PR1012 and CodeGen/X86/fp-stack-compare.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31876 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-20 17:57:22 +00:00
Reid Spencer
45fb3f3cb2 For PR950:
First in a series of patches to convert SetCondInst into ICmpInst and
FCmpInst using only two opcodes and having the instructions contain their
predicate value. Nothing uses these classes yet. More patches to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31867 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-20 01:22:35 +00:00
Chris Lattner
4b10591265 Don't transform in another bad case: if the block is empty, it should be
simplified before we do this xform so that our cost model is accurate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31864 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-18 22:25:39 +00:00
Chris Lattner
f10a56a86f Fix another case we *don't* want to do this xform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31861 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-18 21:56:39 +00:00
Chris Lattner
1ccc4684f3 Implement operator<< for machine basic blocks to make it easier to dump them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31857 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-18 21:47:36 +00:00
Chris Lattner
154e104718 make the previous change more aggressive, moving any block with no fallthrough.
This speeds up yacr2 by 7% on a core2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31856 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-18 21:30:35 +00:00
Chris Lattner
a7bef4a4e4 Minor code layout tweak: if we have something like this:
if (cond) goto BB2
BB1:
    ...
    return;
BB2:
   ...

Move BB1 to the end of the function so that the code falls through in the
non-return case.  This has the effect of moving assert (and other no-return
call) bodies and return blocks out of loops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31855 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-18 20:47:54 +00:00
Jim Laskey
5f64a16869 Fixing the ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31822 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-17 13:07:55 +00:00
Bill Wendling
b2b9c20b61 More removal of std::cerr and DEBUG, replacing with DOUT instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31806 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-17 02:09:07 +00:00
Bill Wendling
54fcc7f704 Replace std::cerr uses of the "DEBUG" macro with "DOUT" instead. Removes
a #include of iostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31800 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-17 00:50:36 +00:00
Bill Wendling
00e533043d *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31789 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-16 20:11:33 +00:00
Evan Cheng
ce9a576f29 Match MachineCodeEmitter changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31787 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-16 20:04:04 +00:00
Bill Wendling
beeb77f3ae Don't recompute getNumOperands for each iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31783 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-16 07:35:18 +00:00
Bill Wendling
01352aa187 Added a new method "CreateNewLiveInterval" which, given a list of
LiveRanges, creates a new LiveInterval from them. The LiveRanges should
have existed already in another LiveInterval, but removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31780 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-16 02:41:50 +00:00
Chris Lattner
e01eaa09c6 enable the branch folding pass for the JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31777 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-16 01:00:07 +00:00
Evan Cheng
cc47021f49 Fix an incorrectly inverted condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31773 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-16 00:08:20 +00:00
Evan Cheng
ddee842062 Match live variable changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31762 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-15 20:55:15 +00:00
Evan Cheng
6b2c05f3d3 Minor updates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31761 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-15 20:54:29 +00:00
Evan Cheng
9a1956ae6a A register def can be partially dead when the whole register has use(s) but a subreg does not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31760 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-15 20:54:11 +00:00
Evan Cheng
a6c4c1eb90 Do away with kill / dead maps. Move kill / dead info onto MI's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31759 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-15 20:51:59 +00:00
Chris Lattner
b71fd7897f Simplify IntrinsicLowering and clarify that it is only for use by the
CBE and interpreter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31755 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-15 18:00:10 +00:00
Chris Lattner
43193d60e9 remove dead #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31753 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-15 17:51:15 +00:00
Evan Cheng
7ce4578353 Matches MachineInstr changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31712 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 23:36:35 +00:00
Evan Cheng
d7de496b23 - Let MachineInstr ctors add implicit def and use operands. Other operands
will be inserted before these operands. If the opcode changes (by
  setOpcode), the implicit operands are updated as well.
- Added IsKill, IsDead fields to MachineOperand in preparation for changes
  that move kill / dead info to MachineInstr's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31711 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 23:34:06 +00:00
Reid Spencer
a07d5b9164 Make an assert comment match the tested assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31686 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 20:07:59 +00:00
Evan Cheng
3ba433a7e8 Add methods to add implicit def use operands to a MI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31675 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 10:20:02 +00:00
Chris Lattner
41e53fd39b disallow preinc of a frameindex. This is not profitable and causes 2-addr
pass to explode.  This fixes a bunch of llc-beta failures on ppc last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31661 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 01:00:15 +00:00
Chris Lattner
9f1794ea58 reduce indentation by using early exits. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31660 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 00:56:29 +00:00
Chris Lattner
448f219fed move big chunks of code out-of-line, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31658 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 00:39:41 +00:00
Chris Lattner
734c91d250 Fix a dag combiner bug exposed by my recent instcombine patch. This fixes
CodeGen/Generic/2006-11-10-DAGCombineMiscompile.ll and PPC gsm/toast


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31644 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-10 21:37:15 +00:00
Evan Cheng
438f7bc67c Add implicit def / use operands to MachineInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31633 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-10 08:43:01 +00:00
Evan Cheng
a7ff64d608 When forming a pre-indexed store, make sure ptr isn't the same or is a pred of value being stored. It would cause a cycle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31631 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-10 08:28:11 +00:00
Chris Lattner
1e7aa5c209 commentate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31627 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-10 04:41:34 +00:00
Evan Cheng
8dc5cad8a2 Don't attempt expensive pre-/post- indexed dag combine if target does not support them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31598 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 19:10:46 +00:00
Evan Cheng
5ff839fbab Add a mechanism to specify whether a target supports a particular indexed load / store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31597 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 18:56:43 +00:00
Evan Cheng
0030582239 Rename ISD::MemOpAddrMode to ISD::MemIndexedMode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31596 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 18:44:21 +00:00
Evan Cheng
144d8f09e1 Rename ISD::MemOpAddrMode to ISD::MemIndexedMode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31595 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 17:55:04 +00:00
Jim Laskey
85f419b36c Allows debugging llc self hosted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31594 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 16:32:26 +00:00
Jim Laskey
5496f01465 Merging dwarf info to a single compile unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31593 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 14:52:14 +00:00
Evan Cheng
d258efaf6e getPostIndexedAddressParts change: passes in load/store instead of its loaded / stored VT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31584 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 04:29:46 +00:00
Evan Cheng
a1fd6504aa Remove M_2_ADDR_FLAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31583 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-09 02:22:54 +00:00
Evan Cheng
b00dddd164 Match more post-indexed ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31569 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 20:27:27 +00:00
Jim Laskey
d6c3422e31 Remove redundant <cmath>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31561 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 19:16:44 +00:00
Jim Laskey
6ea0f6bce8 Now can re-enable debug label folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31549 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 14:17:45 +00:00
Evan Cheng
03fa6ea402 - When performing pre-/post- indexed load/store transformation, do not worry
about whether the new base ptr would be live below the load/store. Let two
  address pass split it back to non-indexed ops.
- Minor tweaks / fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31544 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 08:30:28 +00:00
Evan Cheng
a4f53ef527 Fixed a minor bug preventing some pre-indexed load / store transformation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31543 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 06:56:05 +00:00
Reid Spencer
3822ff5c71 For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 06:47:33 +00:00
Evan Cheng
6c1491dd06 Fix a obscure post-indexed load / store dag combine bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31537 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 02:38:55 +00:00
Chris Lattner
5d056952ba optimize single MBB loops better. In particular, produce:
LBB1_57:        #bb207.i
        movl 72(%esp), %ecx
        movb (%ecx,%eax), %cl
        movl 80(%esp), %edx
        movb %cl, 1(%edx,%eax)
        incl %eax
        cmpl $143, %eax
        jne LBB1_57     #bb207.i
        jmp LBB1_64     #cond_next255.i

intead of:

LBB1_57:        #bb207.i
        movl 72(%esp), %ecx
        movb (%ecx,%eax), %cl
        movl 80(%esp), %edx
        movb %cl, 1(%edx,%eax)
        incl %eax
        cmpl $143, %eax
        je LBB1_64      #cond_next255.i
        jmp LBB1_57     #bb207.i

This eliminates a branch per iteration of the loop.  This hurted PPC
particularly, because the extra branch meant another dispatch group for each
iteration of the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31530 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 01:03:21 +00:00
Jim Laskey
4d0c1a04bc Accidently reran commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31516 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 21:58:55 +00:00
Jim Laskey
5e213ea697 Missed a label map, reverting till covered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31514 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 21:37:31 +00:00
Jim Laskey
fffcd69709 Missed a label map, reverting till covered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 20:53:05 +00:00
Jim Laskey
9d4209fb82 1. Add a pass to fold debug label instructions so a debug info client can detect
empty ranges.

2. Reorg how MachineDebugInfo maintains changes to debug labels.

3. Have dwarf writer use debug label info to simplify scopes and source line
coorespondence.

4. Revert the merging of compile units until I can get the bugs ironed out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 19:33:46 +00:00
Chris Lattner
393ebae0ef Enable improved spilling costs by default. This speeds up viterbi on x86
by 40%, FreeBench/fourinarow by 20%, and many other programs 10-25%.

On PPC, this speeds up fourinarow by 18%, and probably other things as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31504 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 18:04:58 +00:00
Jim Laskey
7902c75331 Use correct value for float HUGH_VAL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31500 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 12:25:45 +00:00
Evan Cheng
bbd6f6ec1a Add post-indexed load / store transformations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31498 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 09:03:05 +00:00
Chris Lattner
b75a663707 Add a new llcbeta option. This speeds up viterbi from 12.34 to 8.76s on
X86.  If happy, I'll enable this by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31493 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 07:18:40 +00:00
Reid Spencer
5a4951e936 Unbreak X86/ELF Debugging. Somehow this line got lost in Jim's cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31492 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 06:36:36 +00:00
Chris Lattner
fa9aa2b424 Fix PR988 and CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll.
The low part goes in the first operand of expandop, not the second one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31487 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-07 04:11:44 +00:00
Evan Cheng
d5ad440f43 Remove dead code; added a missing null ptr check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31478 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-06 21:33:46 +00:00
Jim Laskey
f910a3ff0f Tab interferes with uniqueness.
NOTE: There doesn't seem to be consistency for whether a leading tab
is present in a section heading.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31475 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-06 16:23:59 +00:00
Jim Laskey
84ca10f47b D'oh - reversed logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31474 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-06 13:20:29 +00:00
Evan Cheng
3ef554d2b1 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31473 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-06 08:14:30 +00:00
Jeff Cohen
d41b30def3 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31464 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-05 19:31:28 +00:00
Evan Cheng
33dbedcdcb Added pre-indexed store support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31459 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-05 09:31:14 +00:00
Evan Cheng
9109fb1eb7 Added getIndexedStore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31458 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-05 09:30:09 +00:00
Jim Laskey
5cd496e727 Live local variables are being dropped because the begin or end labels marking
their scope are being deleted.  Workaround is to widen scope to full function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31454 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-04 10:48:07 +00:00
Evan Cheng
95f6edeff5 Changes to use operand constraints to process two-address instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31453 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-04 09:44:31 +00:00
Evan Cheng
e077ef6e85 Fixed some spiller bugs exposed by the recent two-address code changes. Now
there may be other def(s) apart from the use&def two-address operand. We need
to check if the register reuse for a use&def operand may conflicts with another
def. Provide a mean to recover from the conflict if it is detected when the
defs are processed later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31439 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-04 00:21:55 +00:00
Chris Lattner
033b107e10 this will work better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31419 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 19:15:55 +00:00
Chris Lattner
0709718665 Fix the build on xcode < 2.4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31417 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 19:13:59 +00:00
Evan Cheng
e6e97e66a3 Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31414 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 07:31:32 +00:00
Evan Cheng
1a854be352 Rename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31413 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 07:21:16 +00:00
Reid Spencer
b8f4e0aa17 Remove dead variable. Fix 80 column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31412 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 03:30:34 +00:00
Evan Cheng
7fc033a24d Added DAG combiner transformation to generate pre-indexed loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31410 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 03:06:21 +00:00
Evan Cheng
c5fc57dcae Added isPredecessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31409 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 03:05:24 +00:00
Evan Cheng
bf105c8424 Proper check for two-addressness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31408 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 03:04:46 +00:00
Chris Lattner
02cb49ee67 silence warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31397 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 01:28:29 +00:00
Reid Spencer
97821311a3 Make CodeGen libs -pedantic clean.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31387 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 23:56:21 +00:00
Jim Laskey
f673388351 1. Hash not quite right for DIEValues.
2. Not going to use Usage (no significant benefit.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31384 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 21:48:18 +00:00
Reid Spencer
9bd6d65e29 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31382 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:55:40 +00:00
Reid Spencer
3ed469ccd7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:25:50 +00:00
Jim Laskey
ef42a01113 General clean up of teh dwarf writer.
1. Most significant is the folding of debug information entries.  This
reduced self hosted -g SelectionDAGISel.s from 120M to 13M and pretty
close to matching .o file sizes with gcc.

2. Debug information entry printing for debugging the dwarf code.

3. Bring all the code closer to llvm standards.

4. Misc. fixes and doc clean ups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31379 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:12:39 +00:00
Reid Spencer
0a783f783c For PR950:
Replace the REM instruction with UREM, SREM and FREM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31369 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 01:53:59 +00:00
Chris Lattner
2a821601f1 Allow the getRegForInlineAsmConstraint method to return a register class with
no fixes physreg.  Treat this as permission to use any register in the register
class.  When this happens and it is safe, allow the llvm register allcoator to
allocate the register instead of doing it at isel time.  This eliminates a ton
of copies around common inline asms.  For example:

int test2(int Y, int X) {
  asm("foo %0, %1" : "=r"(X): "r"(X));
  return X;
}

now compiles to:

_test2:
        foo r3, r4
        blr

instead of:

_test2:
        mr r2, r4
        foo r2, r2
        mr r3, r2
        blr

GCC produces:

_test2:
        foo r4, r4
        mr r3,r4
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 01:41:49 +00:00
Evan Cheng
e6ae14e1f4 Rename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31364 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 23:18:32 +00:00
Evan Cheng
360c2dd25a Two-address instructions no longer have to be A := A op C. Now any pair of dest / src operands can be tied together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31363 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 23:06:55 +00:00
Evan Cheng
1dabb68ab4 Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31359 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 22:39:30 +00:00
Evan Cheng
93467e7fe3 CopyFromReg starts a live range so its use should not be considered a floater.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31356 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 22:17:06 +00:00
Chris Lattner
d4bf3c2fd6 give branch folding a simple heuristic to decide which block to split so that
it inserts an uncond branch where it is less likely to cause a problem.  This
fixes some perf issues on ppc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31354 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 19:36:29 +00:00
Evan Cheng
41349c10cb Add a printSetLabel that takes two id's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31347 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 09:23:08 +00:00
Evan Cheng
6cc31ae4da Print jumptable index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31340 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 04:48:30 +00:00
Chris Lattner
1d08d83230 make tail merging more aggressive. If two blocks share a common tail, but the
tail is not an entire block for either of them, pick one, split it, then
merge the common part.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31336 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 01:16:12 +00:00
Chris Lattner
d8ccff0c3e enable branch folding with an option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31335 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-01 00:38:31 +00:00
Chris Lattner
0ccb500fa7 Compile CodeGen/PowerPC/fp-branch.ll to:
_intcoord_cond_next55:
LBB1_3: ;cond_next55
        lis r2, ha16(LCPI1_0)
        lfs f0, lo16(LCPI1_0)(r2)
        fcmpu cr0, f1, f0
        blt cr0, LBB1_2 ;cond_next62.exitStub
LBB1_1: ;bb72.exitStub
        li r3, 1
        blr
LBB1_2: ;cond_next62.exitStub
        li r3, 0
        blr

instead of:

_intcoord_cond_next55:
LBB1_3: ;cond_next55
        lis r2, ha16(LCPI1_0)
        lfs f0, lo16(LCPI1_0)(r2)
        fcmpu cr0, f1, f0
        bge cr0, LBB1_1 ;bb72.exitStub
LBB1_4: ;cond_next55
        lis r2, ha16(LCPI1_0)
        lfs f0, lo16(LCPI1_0)(r2)
        fcmpu cr0, f1, f0
        bnu cr0, LBB1_2 ;cond_next62.exitStub
LBB1_1: ;bb72.exitStub
        li r3, 1
        blr
LBB1_2: ;cond_next62.exitStub
        li r3, 0
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31330 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-31 23:06:00 +00:00
Chris Lattner
df19f27d03 look through isunordered to inline it into branch blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31328 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-31 22:37:42 +00:00
Chris Lattner
efa46ce87b handle global address constant sdnodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31323 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-31 20:01:56 +00:00
Chris Lattner
53069fbbae TargetLowering::isOperandValidForConstraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31319 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-31 19:41:18 +00:00
Chris Lattner
dba1aeedd8 Change the prototype for TargetLowering::isOperandValidForConstraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31318 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-31 19:40:43 +00:00
Anton Korobeynikov
ab4022f196 1. Clean up code due to changes in SwitchTo*Section(2)
2. Added partial debug support for mingw\cygwin targets (the same as
   Linux\ELF). Please note, that currently mingw\cygwin uses 'stabs' format
   for storing debug info by default, thus many (runtime) libraries has
   this information included. These formats shouldn't be mixed in one binary
   ('stabs' & 'DWARF'), otherwise binutils tools will be confused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31311 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-31 08:31:24 +00:00
Chris Lattner
d03f1581c8 Turn an assert into an error message. This is commonly triggered when
we don't support a specific constraint yet.  When this happens, print the
unsupported constraint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31310 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-31 07:33:13 +00:00
Evan Cheng
d063189c09 Fix a typo which can break jumptables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31305 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-31 02:31:00 +00:00
Reid Spencer
0de0c5da42 Fix a problem introduced by a last-minute change (logic negation).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31302 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-30 23:34:32 +00:00
Reid Spencer
02b8511364 Add debug support for X86/ELF targets (Linux). This allows llvm-gcc4
generated object modules to be debugged with gdb. Hopefully this helps
pre-release debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31299 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-30 22:32:30 +00:00
Jim Laskey
a9c83fe5e1 Switch abbreviations to use the folding set.a.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31296 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-30 15:59:54 +00:00
Jim Laskey
6519546eda Simplify DwarfWriter header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31295 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-30 13:35:07 +00:00
Evan Cheng
3d4ce11085 Lower jumptable to BR_JT. The legalizer can lower it to a BRIND or let the target custom lower it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31293 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-30 08:00:44 +00:00
Evan Cheng
c41cd9c391 Added a new SDNode type: BR_JT for jumptable branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31292 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-30 07:59:36 +00:00
Chris Lattner
6b0e3f8907 Make CanFallThrough more intelligent (so it can handle blocks with (e.g.) no
successors), and make island block movement more general.

This compiles CodeGen/X86/2006-04-27-ISelFoldingBug.ll to:

_loadAndRLEsource_no_exit_2E_1_label_2E_0:
        subl $8, %esp
        movl %esi, 4(%esp)
        movl %ebx, (%esp)
        movl 16(%esp), %eax
        movl 12(%esp), %ecx
LBB1_3: #label.0
        movl _last, %edx
        movl %edx, %esi
        incl %esi
        movl %esi, _last
        movl %ecx, %ebx
        # TRUNCATE movb %bl, %bl
        movl _block, %esi
        movb %bl, 1(%esi,%edx)
        cmpl %eax, _last
        jge LBB1_2      #codeRepl5.exitStub
LBB1_4: #label.0
        cmpl $257, %ecx
        je LBB1_2       #codeRepl5.exitStub
LBB1_1: #label.0.no_exit.1_crit_edge.exitStub
        movl $1, %eax
        movl (%esp), %ebx
        movl 4(%esp), %esi
        addl $8, %esp
        ret
LBB1_2: #codeRepl5.exitStub
        xorl %eax, %eax
        movl (%esp), %ebx
        movl 4(%esp), %esi
        addl $8, %esp
        ret

instead of:

_loadAndRLEsource_no_exit_2E_1_label_2E_0:
        subl $8, %esp
        movl %esi, 4(%esp)
        movl %ebx, (%esp)
        movl 16(%esp), %eax
        movl 12(%esp), %ecx
        jmp LBB1_3      #label.0
LBB1_1: #label.0.no_exit.1_crit_edge.exitStub
        movl $1, %eax
        movl (%esp), %ebx
        movl 4(%esp), %esi
        addl $8, %esp
        ret
LBB1_2: #codeRepl5.exitStub
        xorl %eax, %eax
        movl (%esp), %ebx
        movl 4(%esp), %esi
        addl $8, %esp
        ret
LBB1_3: #label.0
        movl _last, %edx
        movl %edx, %esi
        incl %esi
        movl %esi, _last
        movl %ecx, %ebx
        # TRUNCATE movb %bl, %bl
        movl _block, %esi
        movb %bl, 1(%esi,%edx)
        cmpl %eax, _last
        jge LBB1_2      #codeRepl5.exitStub
LBB1_4: #label.0
        cmpl $257, %ecx
        jne LBB1_1      #label.0.no_exit.1_crit_edge.exitStub
        jmp LBB1_2      #codeRepl5.exitStub

... which is much better layout :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31282 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-29 21:05:41 +00:00
Chris Lattner
6a586c8d9a fix Generic/2006-10-29-Crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31281 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-29 21:01:20 +00:00
Chris Lattner
5a145f0094 Fix a load folding issue that Evan noticed: there is no need to export values
used by comparisons in the main block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31279 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-29 18:23:37 +00:00
Evan Cheng
ba726ab3ec VLOAD is not the LoadSDNode opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31276 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-29 06:14:47 +00:00
Nick Lewycky
f6aaaaa39e Remove spurious case. EXTLOAD is not one of the node opcodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31275 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-29 02:26:30 +00:00
Chris Lattner
bad7f48c70 split critical edges more carefully and intelligently. In particular, critical
edges whose destinations are not phi nodes don't bother us.  Also, share
split edges, since the split edge can't have a phi.  This significantly
reduces the complexity of generated code in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31274 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 19:22:10 +00:00
Chris Lattner
6acfe12dd6 Teach branch folding to fold identical jump tables together and to delete
jump tables that are dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31273 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 18:34:47 +00:00
Chris Lattner
a4eb44a285 const'ify jump table stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31269 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 18:17:09 +00:00
Chris Lattner
e7251a0377 add an assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31267 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 18:11:20 +00:00
Chris Lattner
0737188220 don't print dead jump tables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31266 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 18:10:06 +00:00
Chris Lattner
cf420cca57 improve deletion of blocks that just contain branches by knowing that
the pred block doesn't fall through into them if it's a jumptable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31263 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 17:32:47 +00:00
Jim Laskey
1c6f01aaa5 Load and stores have not been uniqued properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31261 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 17:25:28 +00:00
Chris Lattner
47e32e6b83 Split *all* critical edges before isel. This resolves issues with spill code
being inserted on unsplit critical edges, which introduces (sometimes large
amounts of) partially dead spill code.

This also fixes PR925 + CodeGen/Generic/switch-crit-edge-constant.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31260 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 17:04:37 +00:00
Chris Lattner
6fb6ef4d65 Fix a serious bug that caused any x86 vector stuff to infinite loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31254 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-28 06:15:26 +00:00
Jim Laskey
def69b92e7 Clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31243 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-27 23:52:51 +00:00
Chris Lattner
8c494ab759 Fix a bug in merged condition handling (CodeGen/Generic/2006-10-27-CondFolding.ll).
Add many fewer CFG edges and PHI node entries.  If there is a switch which has
the same block as multiple destinations, only add that block once as a successor/phi
node (in the jumptable case)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31242 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-27 23:50:33 +00:00
Jim Laskey
583bd47f77 Switch over from SelectionNodeCSEMap to FoldingSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31240 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-27 23:46:08 +00:00
Chris Lattner
1c9b2f312d remove debug code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31233 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-27 21:58:03 +00:00
Chris Lattner
d2f9ee9ea7 Codegen cond&cond with two branches. This compiles (f.e.) PowerPC/and-branch.ll to:
cmpwi cr0, r4, 4
        bgt cr0, LBB1_2 ;UnifiedReturnBlock
LBB1_3: ;entry
        cmplwi cr0, r3, 0
        bne cr0, LBB1_2 ;UnifiedReturnBlock

instead of:

        cmpwi cr7, r4, 4
        mfcr r2
        addic r4, r3, -1
        subfe r3, r4, r3
        rlwinm r2, r2, 30, 31, 31
        or r2, r2, r3
        cmplwi cr0, r2, 0
        bne cr0, LBB1_2 ;UnifiedReturnBlock
LBB1_1: ;cond_true


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31232 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-27 21:54:23 +00:00
Chris Lattner
571e434a34 Turn conditions like x<Y|z==q into multiple blocks.
This compiles Regression/CodeGen/X86/or-branch.ll into:

_foo:
        subl $12, %esp
        call L_bar$stub
        movl 20(%esp), %eax
        movl 16(%esp), %ecx
        cmpl $5, %eax
        jl LBB1_1       #cond_true
LBB1_3: #entry
        testl %ecx, %ecx
        jne LBB1_2      #UnifiedReturnBlock
LBB1_1: #cond_true
        call L_bar$stub
        addl $12, %esp
        ret
LBB1_2: #UnifiedReturnBlock
        addl $12, %esp
        ret

instead of:

_foo:
        subl $12, %esp
        call L_bar$stub
        movl 20(%esp), %eax
        movl 16(%esp), %ecx
        cmpl $4, %eax
        setg %al
        testl %ecx, %ecx
        setne %cl
        testb %cl, %al
        jne LBB1_2      #UnifiedReturnBlock
LBB1_1: #cond_true
        call L_bar$stub
        addl $12, %esp
        ret
LBB1_2: #UnifiedReturnBlock
        addl $12, %esp
        ret

And on ppc to:

        cmpwi cr0, r29, 5
        blt cr0, LBB1_1 ;cond_true
LBB1_3: ;entry
        cmplwi cr0, r30, 0
        bne cr0, LBB1_2 ;UnifiedReturnBlock

instead of:

        cmpwi cr7, r4, 4
        mfcr r2
        addic r4, r3, -1
        subfe r30, r4, r3
        rlwinm r29, r2, 30, 31, 31
        and r2, r29, r30
        cmplwi cr0, r2, 0
        bne cr0, LBB1_2 ;UnifiedReturnBlock


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31230 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-27 21:36:01 +00:00
Evan Cheng
5270cf1b77 getPreIndexedLoad -> getIndexedLoad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31209 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-26 21:53:40 +00:00
Reid Spencer
1628cec4d7 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-26 06:15:43 +00:00