1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
Commit Graph

3357 Commits

Author SHA1 Message Date
Reid Spencer
6d0992dc3d Compensate for loss of DerivedTypes.h in TargetLowering.h
llvm-svn: 33159
2007-01-12 23:31:12 +00:00
Reid Spencer
6468d49755 Move a function out of line.
llvm-svn: 33158
2007-01-12 23:30:31 +00:00
Evan Cheng
e2a6d79cad Minor fix.
llvm-svn: 33149
2007-01-12 22:51:10 +00:00
Chris Lattner
e0b9a74157 Simplify code
llvm-svn: 33123
2007-01-12 18:15:09 +00:00
Reid Spencer
373d2bccea For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer
3d986f6487 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Evan Cheng
032a597692 Store default libgcc routine names and allow them to be redefined by target.
llvm-svn: 33105
2007-01-12 02:11:51 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Evan Cheng
6829d12846 Naming consistency.
llvm-svn: 33026
2007-01-08 23:55:53 +00:00
Evan Cheng
6cba4e114e 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.

llvm-svn: 33025
2007-01-08 23:50:38 +00:00
Chris Lattner
0f765fae89 Implement some trivial FP foldings when -enable-unsafe-fp-math is specified.
This implements CodeGen/PowerPC/unsafe-math.ll

llvm-svn: 33024
2007-01-08 23:04:05 +00:00
Jim Laskey
8cc5a0d2fe Need to handle static declarations properly.
llvm-svn: 33022
2007-01-08 22:15:18 +00:00
Chris Lattner
3e42a4147a llvm 2.0 doesn't support llvm.isunordered.*
llvm-svn: 32994
2007-01-07 08:52:43 +00:00
Chris Lattner
b6f6d3a00c remove support for llvm.isunordered
llvm-svn: 32992
2007-01-07 08:37:22 +00:00
Chris Lattner
aa5051ae7f Change the interface to Module::getOrInsertFunction to be easier to use,to resolve PR1088, and to help PR411.
This simplifies many clients also

llvm-svn: 32989
2007-01-07 08:12:01 +00:00
Evan Cheng
d378a229c5 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
cb71f273ff 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
237ec557ae CopyToReg source operand can be a register as well. e.g. Copy from GlobalBaseReg.
llvm-svn: 32929
2007-01-05 20:59:06 +00:00
Evan Cheng
8d09e52569 GEP subscript is interpreted as a signed value.
llvm-svn: 32888
2007-01-05 01:46:20 +00:00
Chris Lattner
45c7c69c77 fix PowerPC/2007-01-04-ArgExtension.ll, a bug handling K&R prototypes with
the recent signless changes.

llvm-svn: 32884
2007-01-04 22:22:37 +00:00
Evan Cheng
7674a71585 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
20d9040d17 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.

llvm-svn: 32836
2007-01-03 16:49:33 +00:00
Jim Laskey
4308b27af2 NULL names should pass validation.
llvm-svn: 32835
2007-01-03 13:46:20 +00:00
Jim Laskey
c0dfc41747 Silence warning.
llvm-svn: 32834
2007-01-03 13:36:40 +00:00
Reid Spencer
87c68ceb32 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.

llvm-svn: 32831
2007-01-03 05:03:05 +00:00
Reid Spencer
92c52fe025 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.

llvm-svn: 32830
2007-01-03 04:25:33 +00:00
Reid Spencer
206bcb64c1 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
Evan Cheng
09bcc91be2 - Fixing naming inconsistency: calleesave -> calleesaved.
- Make use of spillCalleeSavedRegisters() and restoreCalleeSavedRegisters().

llvm-svn: 32822
2007-01-02 21:31:15 +00:00
Reid Spencer
dda168599d 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
Reid Spencer
4428c3483b 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.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Jim Laskey
7ee1bda593 Need to walk the derived chain of typedefs to get actual size.
llvm-svn: 32744
2006-12-22 20:03:42 +00:00
Evan Cheng
a70d66df55 Debug dump error.
llvm-svn: 32743
2006-12-22 02:04:05 +00:00
Reid Spencer
3dc538fe7c Just print integer constants as signed values. The actual signedness
doesn't matter as it is determined in the way the constant is used.

llvm-svn: 32733
2006-12-21 19:04:23 +00:00
Reid Spencer
66611d3e06 Simplify all the casting business and get rid of isSigned().
llvm-svn: 32731
2006-12-21 08:28:31 +00:00
Evan Cheng
564ef2e7f4 getLoad() and getStore() calls missed SVOffset operand. Thanks to Dan Gohman
for pointing it out!

llvm-svn: 32712
2006-12-20 01:27:29 +00:00
Chris Lattner
a975b95adb Eliminate static ctors from Statistics
llvm-svn: 32698
2006-12-19 22:41:21 +00:00
Anton Korobeynikov
391dc74af0 Fix for PR1059: http://llvm.org/PR1059
llvm-svn: 32685
2006-12-19 21:04:20 +00:00
Evan Cheng
9e0ae42e6d 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
975589f630 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
Reid Spencer
f6bd59ba81 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.

llvm-svn: 32654
2006-12-18 08:47:13 +00:00
Rafael Espindola
08c0825f18 move ExtWeakSymbols to AsmPrinter
llvm-svn: 32648
2006-12-18 03:37:18 +00:00
Bill Wendling
34f4c12ae7 Fixed so that it dereferences the ostream pointer.
llvm-svn: 32640
2006-12-17 11:15:53 +00:00
Bill Wendling
7f6a73eb5c 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.

llvm-svn: 32636
2006-12-17 05:15:13 +00:00
Chris Lattner
8b1e4d1edf 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.

llvm-svn: 32633
2006-12-16 21:14:48 +00:00
Evan Cheng
7775b33a32 Cannot combine an indexed load / store any further.
llvm-svn: 32629
2006-12-16 06:25:23 +00:00
Evan Cheng
a966bf47ec Expand FP undef
llvm-svn: 32623
2006-12-16 02:20:50 +00:00
Jeff Cohen
c396e18e8e The best unbreakage yet, addressing Bill's concerns.
llvm-svn: 32622
2006-12-16 02:15:42 +00:00
Evan Cheng
d4fd650c5f Allow promoted FP_TO_UINT / FP_TO_SINT to expand operand.
llvm-svn: 32621
2006-12-16 02:10:30 +00:00
Evan Cheng
b0292a750a Expand fabs / fneg to and / xor.
llvm-svn: 32619
2006-12-16 00:52:40 +00:00
Jeff Cohen
03161dd132 An even better unbreakage...
llvm-svn: 32617
2006-12-15 22:57:14 +00:00
Evan Cheng
ea9ab75427 Fix select_cc, select expansion to soft-fp bugs.
llvm-svn: 32616
2006-12-15 22:42:55 +00:00
Jim Laskey
0809c79c60 This code was usurping the sextload expand in teh legalizer. Just make
sure the right conditions are checked.

llvm-svn: 32611
2006-12-15 21:38:30 +00:00
Chris Lattner
3e789e232f silence a bogus warning
llvm-svn: 32597
2006-12-15 07:36:19 +00:00
Evan Cheng
a221cb0b2c Minor clean up.
llvm-svn: 32593
2006-12-15 06:41:01 +00:00
Evan Cheng
4e661ebef9 Expand FP compares to soft-fp call(s)
llvm-svn: 32590
2006-12-15 02:59:56 +00:00
Jim Laskey
19b276f67f 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
2f7cae1f57 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.

llvm-svn: 32576
2006-12-14 07:54:05 +00:00
Evan Cheng
10389e802b More soft-fp work.
llvm-svn: 32559
2006-12-13 20:57:08 +00:00
Evan Cheng
e200668366 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
d5d848048f Expand fsqrt, fsin, and fcos to libcalls.
llvm-svn: 32526
2006-12-13 02:38:13 +00:00
Evan Cheng
f72f8a7730 Expand f32 / f64 to i32 / i64 conversion to soft-fp library calls.
llvm-svn: 32523
2006-12-13 01:57:55 +00:00
Reid Spencer
50702907eb Replace CastInst::createInferredCast calls with more accurate cast
creation calls.

llvm-svn: 32521
2006-12-13 00:50:17 +00:00
Evan Cheng
3e6cc1641c Expand FP constant to integers if FP types are not legal.
llvm-svn: 32497
2006-12-12 22:19:28 +00:00
Evan Cheng
aefab1a7c1 Soft fp FNEG, SINT_TO_FP, UINT_TO_FP libcall expansion.
llvm-svn: 32495
2006-12-12 21:51:17 +00:00
Evan Cheng
8a830bc4a1 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
061d636b7a Expand i32/i64 CopyToReg f32/f64 to BIT_CONVERT + CopyToReg.
llvm-svn: 32493
2006-12-12 21:21:32 +00:00
Evan Cheng
75b41e03f6 - 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
Evan Cheng
df11bd2186 Expand formal arguments and call arguments recursively: e.g. f64 -> i64 -> 2 x i32.
llvm-svn: 32476
2006-12-12 07:27:38 +00:00
Chris Lattner
ddb1fa5291 fit in 80 cols
llvm-svn: 32474
2006-12-12 05:22:21 +00:00
Chris Lattner
0405309282 this can only be fptrunc.
llvm-svn: 32473
2006-12-12 05:21:51 +00:00
Chris Lattner
0b46ffb643 This case isn't needed with recent changes to ConstantInt::get
llvm-svn: 32472
2006-12-12 05:19:46 +00:00
Chris Lattner
0ecfce975c split up inttoptr from ptrtoint handling, the cases aren't similar at all.
llvm-svn: 32471
2006-12-12 05:18:19 +00:00
Chris Lattner
4c064bcc3e the operand of a bitcast is always the right size, just emit it in place.
llvm-svn: 32470
2006-12-12 05:14:13 +00:00
Chris Lattner
0fd9c58f6a 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
Chris Lattner
df2345fcbe make this code more aggressive about turning store fpimm into store int imm.
This is not sufficient to fix X86/store-fp-constant.ll

llvm-svn: 32465
2006-12-12 04:16:14 +00:00
Reid Spencer
5af6b6baf1 Tidy up a bit.
llvm-svn: 32462
2006-12-12 01:32:02 +00:00
Reid Spencer
5bc563a190 Change inferred cast creation calls to more specific cast creations.
llvm-svn: 32460
2006-12-12 01:17:41 +00:00
Evan Cheng
e182862c91 Re-apply changes that were backed out and fix a naughty typo.
llvm-svn: 32442
2006-12-11 19:27:14 +00:00
John Criswell
d5817b08f5 It seems the llvm::OStream class does not handle stream manipulators.
For now, just grab the stream and perform the output on it directly.

llvm-svn: 32441
2006-12-11 19:15:36 +00:00
Chris Lattner
7124b0d561 Revert changes that broke oggenc on ppc
llvm-svn: 32440
2006-12-11 18:53:38 +00:00
Evan Cheng
93c75d4cfb Don't convert store double C, Ptr to store long C, Ptr if i64 is not a legal type.
llvm-svn: 32434
2006-12-11 17:25:19 +00:00
Evan Cheng
4eebfee858 f32 / f64 node is expanded to one i32 / i64 node.
llvm-svn: 32433
2006-12-11 06:50:04 +00:00
Evan Cheng
44f9ec68ab Clean up some bad code.
llvm-svn: 32432
2006-12-11 06:25:26 +00:00
Nate Begeman
2566f75e7a 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
Nate Begeman
b1b1aaa4e5 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.

llvm-svn: 32430
2006-12-11 02:20:45 +00:00
Anton Korobeynikov
e76b69846d 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.

llvm-svn: 32415
2006-12-10 23:12:42 +00:00
Evan Cheng
a366d082b5 Preliminary soft float support.
llvm-svn: 32394
2006-12-09 02:42:38 +00:00
Evan Cheng
88a55bdd64 Move findTiedToSrcOperand to TargetInstrDescriptor.
llvm-svn: 32366
2006-12-08 18:45:48 +00:00
Evan Cheng
6f02378443 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.

llvm-svn: 32354
2006-12-08 08:02:34 +00:00
Evan Cheng
79bcfb0e11 findTiedToSrcOperand() changed.
llvm-svn: 32353
2006-12-08 07:59:51 +00:00
Chris Lattner
db346e68a9 Fix CodeGen/PowerPC/2006-12-07-SelectCrash.ll on PPC64
llvm-svn: 32336
2006-12-07 22:36:47 +00:00
Bill Wendling
4d1444725b Removed more <iostream> includes
llvm-svn: 32321
2006-12-07 20:28:15 +00:00
Bill Wendling
23b8b13c9d Removing even more <iostream> includes.
llvm-svn: 32320
2006-12-07 20:04:42 +00:00
Reid Spencer
cfce6d2ee4 Revision 1.83 causes PR1037.
Reverted.

llvm-svn: 32305
2006-12-07 16:21:19 +00:00
Evan Cheng
b5a57532b0 Initialize {Min|Max}CSFrameIndex properly.
llvm-svn: 32299
2006-12-07 02:25:34 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Evan Cheng
f4788fe306 MI keeps a ptr of TargetInstrDescriptor, use it.
llvm-svn: 32296
2006-12-07 01:21:59 +00:00
Evan Cheng
7a6220ddda getOperandConstraint returns -1 if the operand does have the specific constraint. This bug was causing excessive spills.
llvm-svn: 32295
2006-12-07 00:46:04 +00:00
Chris Lattner
a531ce882e Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Jim Laskey
0284aadc80 Some addresssed should be 64-bit and some shouldn't.
llvm-svn: 32278
2006-12-06 17:43:18 +00:00
Evan Cheng
59494f9e3d Move copyKillDeadInfo out-of-line. Add findRegisterUseOperand().
llvm-svn: 32273
2006-12-06 08:27:42 +00:00
Chris Lattner
a7baddddcc eliminate fp statistic
llvm-svn: 32251
2006-12-06 01:48:55 +00:00
Jeff Cohen
f99052befb Unbreak VC++ build.
llvm-svn: 32113
2006-12-02 02:22:01 +00:00
Evan Cheng
bf13611e84 Match TargetInstrInfo changes.
llvm-svn: 32098
2006-12-01 21:52:58 +00:00
Jim Laskey
32137fffa5 better check for version
llvm-svn: 32045
2006-11-30 18:29:23 +00:00
Jim Laskey
0369cab61e Change global descriptor names to provide name, full name and linkage name.
llvm-svn: 32036
2006-11-30 14:35:45 +00:00
Jim Laskey
831e2376f2 Temp fix to deal gdb issue.
llvm-svn: 32035
2006-11-30 11:09:42 +00:00
Evan Cheng
cb65ba1821 - MachineInstr now keeps a ptr to TargetInstrDescriptor instead of Opcode.
- Remove the ugly TargetInstrDescriptors hack.

llvm-svn: 32032
2006-11-30 07:08:44 +00:00
Evan Cheng
c9710a3e29 Avoid inifinite looping if READCYCLECOUNTER isn't custom lowered.
llvm-svn: 32022
2006-11-29 19:13:47 +00:00
Jim Laskey
d7db5b4a9c Eliminate unnecessary scopes.
llvm-svn: 32020
2006-11-29 16:55:57 +00:00
Evan Cheng
2acb6345d8 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
Evan Cheng
0be56fab68 Fix for PR1023 by Dan Gohman.
llvm-svn: 32003
2006-11-29 01:58:12 +00:00
Evan Cheng
f38588a1cd Fix for PR1022 (folding loads of static initializers) by Dan Gohman.
llvm-svn: 32000
2006-11-29 01:38:07 +00:00
Chris Lattner
d00734a230 add a hook to allow targets to hack on inline asms to lower them to llvm
when they want to.

llvm-svn: 31997
2006-11-29 01:12:32 +00:00
Bill Wendling
a29e6c5ec9 Converted to using llvm streams instead of <iostream>s
llvm-svn: 31992
2006-11-29 00:39:47 +00:00
Bill Wendling
d8c0883f20 Use llvm streams instead of <iostream>
llvm-svn: 31985
2006-11-28 22:48:48 +00:00
Bill Wendling
a80e3dc0c0 Put the #include for a module first.
llvm-svn: 31958
2006-11-28 03:31:29 +00:00
Evan Cheng
e176869ec0 Clean up.
llvm-svn: 31957
2006-11-28 02:25:34 +00:00
Bill Wendling
7e9cea955c Changed to using llvm streams.
llvm-svn: 31954
2006-11-28 02:08:17 +00:00
Chris Lattner
37a3db4c3f Fix PR1016
llvm-svn: 31950
2006-11-28 01:03:30 +00:00
Evan Cheng
98fa7ab4d7 Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead
of opcode and number of operands.

llvm-svn: 31947
2006-11-27 23:37:22 +00:00
Chris Lattner
71a7a2d781 Fix the dag combiner bug corresponding to PR1014.
llvm-svn: 31943
2006-11-27 21:50:02 +00:00
Chris Lattner
aa8f67c2b5 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.

llvm-svn: 31933
2006-11-27 04:40:53 +00:00
Chris Lattner
c0bdf03e26 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
Reid Spencer
992d9788b3 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.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Jim Laskey
cd74ba8ae1 Global label not handled correctly.
llvm-svn: 31883
2006-11-20 20:29:06 +00:00
Chris Lattner
a2bbd246e0 Fix PR1011 and CodeGen/Generic/2006-11-20-DAGCombineCrash.ll
llvm-svn: 31878
2006-11-20 18:05:46 +00:00
Chris Lattner
31f45746ad 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

llvm-svn: 31876
2006-11-20 17:57:22 +00:00
Reid Spencer
6e34ef887b 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.

llvm-svn: 31867
2006-11-20 01:22:35 +00:00
Chris Lattner
4946ae54df 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.

llvm-svn: 31864
2006-11-18 22:25:39 +00:00
Chris Lattner
b101c06bce Fix another case we *don't* want to do this xform.
llvm-svn: 31861
2006-11-18 21:56:39 +00:00
Chris Lattner
3a34164b82 Implement operator<< for machine basic blocks to make it easier to dump them.
llvm-svn: 31857
2006-11-18 21:47:36 +00:00
Chris Lattner
514fc3de5c make the previous change more aggressive, moving any block with no fallthrough.
This speeds up yacr2 by 7% on a core2.

llvm-svn: 31856
2006-11-18 21:30:35 +00:00
Chris Lattner
bddc114cfb 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.

llvm-svn: 31855
2006-11-18 20:47:54 +00:00
Jim Laskey
a87c9d8905 Fixing the ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1 build.
llvm-svn: 31822
2006-11-17 13:07:55 +00:00
Bill Wendling
dbea653b5d More removal of std::cerr and DEBUG, replacing with DOUT instead.
llvm-svn: 31806
2006-11-17 02:09:07 +00:00
Bill Wendling
0ae0a45ebe Replace std::cerr uses of the "DEBUG" macro with "DOUT" instead. Removes
a #include of iostream.

llvm-svn: 31800
2006-11-17 00:50:36 +00:00
Bill Wendling
49d6a1169f *** empty log message ***
llvm-svn: 31789
2006-11-16 20:11:33 +00:00
Evan Cheng
263c558c13 Match MachineCodeEmitter changes.
llvm-svn: 31787
2006-11-16 20:04:04 +00:00
Bill Wendling
bcd11344e9 Don't recompute getNumOperands for each iteration.
llvm-svn: 31783
2006-11-16 07:35:18 +00:00
Bill Wendling
985d7e09ec 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.

llvm-svn: 31780
2006-11-16 02:41:50 +00:00
Chris Lattner
0d40275b0e enable the branch folding pass for the JIT.
llvm-svn: 31777
2006-11-16 01:00:07 +00:00
Evan Cheng
43ba439abd Fix an incorrectly inverted condition.
llvm-svn: 31773
2006-11-16 00:08:20 +00:00
Evan Cheng
3ba3e10448 Match live variable changes.
llvm-svn: 31762
2006-11-15 20:55:15 +00:00
Evan Cheng
cf45b9fa95 Minor updates.
llvm-svn: 31761
2006-11-15 20:54:29 +00:00
Evan Cheng
7b19d271c4 A register def can be partially dead when the whole register has use(s) but a subreg does not.
llvm-svn: 31760
2006-11-15 20:54:11 +00:00
Evan Cheng
d79427b22c Do away with kill / dead maps. Move kill / dead info onto MI's.
llvm-svn: 31759
2006-11-15 20:51:59 +00:00
Chris Lattner
ccbbe940eb Simplify IntrinsicLowering and clarify that it is only for use by the
CBE and interpreter.

llvm-svn: 31755
2006-11-15 18:00:10 +00:00
Chris Lattner
286bb6e482 remove dead #include
llvm-svn: 31753
2006-11-15 17:51:15 +00:00
Evan Cheng
0e82270ff2 Matches MachineInstr changes.
llvm-svn: 31712
2006-11-13 23:36:35 +00:00
Evan Cheng
7cabf9d02c - 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.

llvm-svn: 31711
2006-11-13 23:34:06 +00:00
Reid Spencer
60a8a2e025 Make an assert comment match the tested assertion.
llvm-svn: 31686
2006-11-11 20:07:59 +00:00
Evan Cheng
7dab9abfb8 Add methods to add implicit def use operands to a MI.
llvm-svn: 31675
2006-11-11 10:20:02 +00:00
Chris Lattner
edfc824673 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.

llvm-svn: 31661
2006-11-11 01:00:15 +00:00
Chris Lattner
bf0c3e3a02 reduce indentation by using early exits. No functionality change.
llvm-svn: 31660
2006-11-11 00:56:29 +00:00
Chris Lattner
671ea7a93b move big chunks of code out-of-line, no functionality change.
llvm-svn: 31658
2006-11-11 00:39:41 +00:00
Chris Lattner
1f61c6c84d Fix a dag combiner bug exposed by my recent instcombine patch. This fixes
CodeGen/Generic/2006-11-10-DAGCombineMiscompile.ll and PPC gsm/toast

llvm-svn: 31644
2006-11-10 21:37:15 +00:00
Evan Cheng
013597778d Add implicit def / use operands to MachineInstr.
llvm-svn: 31633
2006-11-10 08:43:01 +00:00
Evan Cheng
78ba99caa5 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.
llvm-svn: 31631
2006-11-10 08:28:11 +00:00
Chris Lattner
efb62464b9 commentate
llvm-svn: 31627
2006-11-10 04:41:34 +00:00
Evan Cheng
17dd6dd46c Don't attempt expensive pre-/post- indexed dag combine if target does not support them.
llvm-svn: 31598
2006-11-09 19:10:46 +00:00
Evan Cheng
c050bb298f Add a mechanism to specify whether a target supports a particular indexed load / store.
llvm-svn: 31597
2006-11-09 18:56:43 +00:00
Evan Cheng
22bb3ba200 Rename ISD::MemOpAddrMode to ISD::MemIndexedMode
llvm-svn: 31596
2006-11-09 18:44:21 +00:00
Evan Cheng
89ee587963 Rename ISD::MemOpAddrMode to ISD::MemIndexedMode
llvm-svn: 31595
2006-11-09 17:55:04 +00:00
Jim Laskey
8a5a95d868 Allows debugging llc self hosted.
llvm-svn: 31594
2006-11-09 16:32:26 +00:00
Jim Laskey
19fb42c34d Merging dwarf info to a single compile unit.
llvm-svn: 31593
2006-11-09 14:52:14 +00:00
Evan Cheng
6b7d127df9 getPostIndexedAddressParts change: passes in load/store instead of its loaded / stored VT.
llvm-svn: 31584
2006-11-09 04:29:46 +00:00
Evan Cheng
8743c67826 Remove M_2_ADDR_FLAG.
llvm-svn: 31583
2006-11-09 02:22:54 +00:00
Evan Cheng
fcef896f6e Match more post-indexed ops.
llvm-svn: 31569
2006-11-08 20:27:27 +00:00
Jim Laskey
28fec74f1b Remove redundant <cmath>.
llvm-svn: 31561
2006-11-08 19:16:44 +00:00
Jim Laskey
4d636f03f7 Now can re-enable debug label folding.
llvm-svn: 31549
2006-11-08 14:17:45 +00:00
Evan Cheng
1f5c4a6c43 - 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.

llvm-svn: 31544
2006-11-08 08:30:28 +00:00
Evan Cheng
acc6a98286 Fixed a minor bug preventing some pre-indexed load / store transformation.
llvm-svn: 31543
2006-11-08 06:56:05 +00:00
Reid Spencer
da1f5b882a 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.

llvm-svn: 31542
2006-11-08 06:47:33 +00:00
Evan Cheng
e50f5e4c05 Fix a obscure post-indexed load / store dag combine bug.
llvm-svn: 31537
2006-11-08 02:38:55 +00:00
Chris Lattner
f71921c79d 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.

llvm-svn: 31530
2006-11-08 01:03:21 +00:00
Jim Laskey
f0843a78c4 Accidently reran commit.
llvm-svn: 31516
2006-11-07 21:58:55 +00:00
Jim Laskey
5264310433 Missed a label map, reverting till covered.
llvm-svn: 31514
2006-11-07 21:37:31 +00:00
Jim Laskey
54a8f6f998 Missed a label map, reverting till covered.
llvm-svn: 31512
2006-11-07 20:53:05 +00:00
Jim Laskey
7e0f0b2d24 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.

llvm-svn: 31507
2006-11-07 19:33:46 +00:00
Chris Lattner
3e2e03ef34 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.

llvm-svn: 31504
2006-11-07 18:04:58 +00:00
Jim Laskey
4b1aff4aec Use correct value for float HUGH_VAL.
llvm-svn: 31500
2006-11-07 12:25:45 +00:00
Evan Cheng
3db2b3aab9 Add post-indexed load / store transformations.
llvm-svn: 31498
2006-11-07 09:03:05 +00:00
Chris Lattner
f966846d10 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.

llvm-svn: 31493
2006-11-07 07:18:40 +00:00
Reid Spencer
03e18e905e Unbreak X86/ELF Debugging. Somehow this line got lost in Jim's cleanup.
llvm-svn: 31492
2006-11-07 06:36:36 +00:00
Chris Lattner
c8d5fc4461 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
Evan Cheng
ef1c22b6fa Remove dead code; added a missing null ptr check.
llvm-svn: 31478
2006-11-06 21:33:46 +00:00
Jim Laskey
1f3ff6bcfe Tab interferes with uniqueness.
NOTE: There doesn't seem to be consistency for whether a leading tab
is present in a section heading.

llvm-svn: 31475
2006-11-06 16:23:59 +00:00
Jim Laskey
2008b25d7e D'oh - reversed logic.
llvm-svn: 31474
2006-11-06 13:20:29 +00:00
Evan Cheng
f191d53a9a Add comment.
llvm-svn: 31473
2006-11-06 08:14:30 +00:00
Jeff Cohen
e1003da1a2 Unbreak VC++ build.
llvm-svn: 31464
2006-11-05 19:31:28 +00:00
Evan Cheng
bf7db95159 Added pre-indexed store support.
llvm-svn: 31459
2006-11-05 09:31:14 +00:00
Evan Cheng
ae357e5044 Added getIndexedStore.
llvm-svn: 31458
2006-11-05 09:30:09 +00:00
Jim Laskey
1c8b925a87 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.

llvm-svn: 31454
2006-11-04 10:48:07 +00:00
Evan Cheng
42cb1fd0ac Changes to use operand constraints to process two-address instructions.
llvm-svn: 31453
2006-11-04 09:44:31 +00:00
Evan Cheng
4328919c08 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.

llvm-svn: 31439
2006-11-04 00:21:55 +00:00
Chris Lattner
7628decccf this will work better
llvm-svn: 31419
2006-11-03 19:15:55 +00:00
Chris Lattner
8bf77463ea Fix the build on xcode < 2.4
llvm-svn: 31417
2006-11-03 19:13:59 +00:00
Evan Cheng
047a33d3e3 Fix comments.
llvm-svn: 31414
2006-11-03 07:31:32 +00:00