Reid Spencer
b6dd32889e
Add a square root function.
...
llvm-svn: 34775
2007-03-01 05:39:56 +00:00
Reid Spencer
32d0051c64
Reduce #includage by taking a method out of line.
...
llvm-svn: 34774
2007-03-01 04:02:06 +00:00
Evan Cheng
ad431d7a94
A restore is promoted to copy (or deleted entirely), remove the kill from the last use of the targetted register.
...
llvm-svn: 34773
2007-03-01 02:27:30 +00:00
Evan Cheng
ce7f2618a9
Interface clean up.
...
llvm-svn: 34772
2007-03-01 02:25:51 +00:00
Evan Cheng
15a878202b
Interface clean up.
...
llvm-svn: 34770
2007-03-01 02:19:39 +00:00
Evan Cheng
938b4d7817
Oops.
...
llvm-svn: 34768
2007-03-01 02:05:35 +00:00
Evan Cheng
d1fa618990
Track all joined registers and eliminate unneeded kills after all joining are done.
...
llvm-svn: 34767
2007-03-01 02:03:03 +00:00
Reid Spencer
67eedb21b7
For PR1205:
...
Make GetConstantFactor compute its result using an APInt.
llvm-svn: 34765
2007-02-28 23:31:17 +00:00
Dale Johannesen
f38e3d7085
Changes requested in review of last pass. Also pulled isThumb into a
...
member, instead of resetting in every function that uses it.
llvm-svn: 34764
2007-02-28 23:20:38 +00:00
Evan Cheng
5dc0ece7cb
Doh. ARM::PC is obvious a reserved register.
...
llvm-svn: 34763
2007-02-28 23:12:34 +00:00
Reid Spencer
19e5279a38
For PR1205:
...
Adjust to changes in ConstantRange interface.
llvm-svn: 34762
2007-02-28 22:03:51 +00:00
Reid Spencer
f119927a6f
Move ConstantRange class to lib/Support from lib/Analysis and make its
...
interface not depend on Type or ICmpInst.
llvm-svn: 34761
2007-02-28 22:02:48 +00:00
Reid Spencer
f632e1cd14
Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
...
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.
llvm-svn: 34760
2007-02-28 22:00:54 +00:00
Jim Laskey
6dd0f88e75
Chain is on second operand.
...
llvm-svn: 34759
2007-02-28 20:43:58 +00:00
Reid Spencer
965067a054
For PR1205:
...
Remove ConstantInt from ConstantRange interface and adjust its users to
compensate.
llvm-svn: 34758
2007-02-28 19:57:34 +00:00
Reid Spencer
a9d0cc903b
Implement a convenience method to construct a ConstantInt directly from an
...
APInt. The implied type is the integer type that corresponds to the bit
width of the APInt.
llvm-svn: 34757
2007-02-28 19:50:21 +00:00
Reid Spencer
e2b4631435
For PR1205:
...
First round of ConstantRange changes. This makes all CR constructors use
only APInt and not use ConstantInt. Clients are adjusted accordingly.
llvm-svn: 34756
2007-02-28 18:57:32 +00:00
Dale Johannesen
5ec68034ee
Add intelligence about where to break large blocks.
...
llvm-svn: 34755
2007-02-28 18:41:23 +00:00
Chris Lattner
bcc44762bc
remove dead option
...
llvm-svn: 34754
2007-02-28 18:39:53 +00:00
Jim Laskey
6b2170fefe
Handle mix of personalities.
...
llvm-svn: 34752
2007-02-28 18:38:31 +00:00
Jim Laskey
1fea0fa316
Provide a more meaningful name.
...
llvm-svn: 34751
2007-02-28 18:37:50 +00:00
Jim Laskey
83d6baee5b
MERGE_VALUES unnecessary.
...
llvm-svn: 34750
2007-02-28 18:37:04 +00:00
Chris Lattner
d8c7e8999e
bugfix: fastcall does not require the first two params to be marked 'inreg',
...
they always get registers.
llvm-svn: 34748
2007-02-28 18:35:11 +00:00
Reid Spencer
2b933467ad
For PR1205:
...
Convert ConstantRange class to use APInt internally as its value type for
the constant range, instead of ConstantInt.
llvm-svn: 34745
2007-02-28 17:36:23 +00:00
Reid Spencer
d91c898cc0
Make the trunc/sext/zext methods return APInt& so that these operations
...
can be chained together with other operations.
llvm-svn: 34743
2007-02-28 17:34:32 +00:00
Nate Begeman
7beafa54b3
Fix a typo, thanks Bill!
...
llvm-svn: 34741
2007-02-28 09:16:38 +00:00
Nate Begeman
2288ec3331
More Mach-O writer improvements.
...
llvm-svn: 34740
2007-02-28 07:40:50 +00:00
Chris Lattner
a66d550298
use high-level functions in CCState
...
llvm-svn: 34739
2007-02-28 07:09:55 +00:00
Chris Lattner
6d383bd2f1
add methods for analysis of call results and return nodes.
...
llvm-svn: 34738
2007-02-28 07:09:40 +00:00
Chris Lattner
3663b6e73a
make use of helper functions in CCState for analyzing formals and calls.
...
llvm-svn: 34737
2007-02-28 07:00:42 +00:00
Chris Lattner
a68a949ba5
add methods to analyze calls and formals.
...
llvm-svn: 34736
2007-02-28 06:56:37 +00:00
Chris Lattner
5a20764bbb
add a newline at end of file
...
llvm-svn: 34735
2007-02-28 06:42:11 +00:00
Chris Lattner
3762b44a0c
switch LowerFastCCCallTo over to using the new fastcall description.
...
llvm-svn: 34734
2007-02-28 06:26:33 +00:00
Chris Lattner
a8dd712470
switch LowerFastCCArguments over to using the autogenerated Fastcall description.
...
llvm-svn: 34733
2007-02-28 06:21:19 +00:00
Chris Lattner
9a1f1c41b0
add new CC_X86_32_FastCall calling conv, which describes fastcall on win32.
...
Factor out a CC_X86_32_Common convention, which is the part shared between
ccc, stdcall and fastcall
llvm-svn: 34732
2007-02-28 06:20:01 +00:00
Chris Lattner
3b16744840
rearrange code
...
llvm-svn: 34731
2007-02-28 06:10:12 +00:00
Chris Lattner
023751c20b
remove fastcc (not fastcall) support
...
llvm-svn: 34730
2007-02-28 06:05:16 +00:00
Chris Lattner
012066f78b
switch LowerCCCArguments over to using autogenerated CC.
...
llvm-svn: 34729
2007-02-28 05:46:49 +00:00
Chris Lattner
6424f8e245
simplify sret handling
...
llvm-svn: 34728
2007-02-28 05:39:26 +00:00
Chris Lattner
76147834d6
switch LowerCCCCallTo over to using an autogenerated callingconv
...
llvm-svn: 34727
2007-02-28 05:31:48 +00:00
Chris Lattner
d663281088
rename stuff
...
llvm-svn: 34726
2007-02-28 05:30:29 +00:00
Chris Lattner
99f65b22c9
rename some CCActions, add CCIfInReg
...
llvm-svn: 34725
2007-02-28 05:29:33 +00:00
Chris Lattner
eef57fed6e
switch return value passing and the x86-64 calling convention information
...
over to being autogenerated from the X86CallingConv.td file.
llvm-svn: 34722
2007-02-28 04:55:35 +00:00
Chris Lattner
3eb95551d7
make subtarget references work.
...
llvm-svn: 34721
2007-02-28 04:51:41 +00:00
Reid Spencer
f8e59cd357
Implement reading of arbitrary precision integers.
...
llvm-svn: 34718
2007-02-28 02:25:48 +00:00
Reid Spencer
4beda9543b
Implement writing of arbitrary precision integers.
...
llvm-svn: 34717
2007-02-28 02:25:20 +00:00
Reid Spencer
2f6d8e2243
Regenerate.
...
llvm-svn: 34716
2007-02-28 02:24:54 +00:00
Reid Spencer
36f506df46
Implement arbitrary integer constants through the use of APInt values.
...
Positive, negative, and hexadecimal integer constants will now return an
APInt for values having > 64 bits of precision.
llvm-svn: 34715
2007-02-28 02:24:27 +00:00
Reid Spencer
14d26ed070
Implement support for aribrary precision integers by creating two new
...
tokens: ESAPINTVAL and EUAPINTVAL and adding an APInt* as a semantic value.
This allows us to extend the definition of an integer constant to allow
arbitrary precision integer constant values.
llvm-svn: 34714
2007-02-28 02:23:44 +00:00
Reid Spencer
b1eaa7bd52
Fix a bug in RoundDoubleToAPInt where it would force the size to 64 bits
...
instead of honoring the client's requested bit width.
llvm-svn: 34712
2007-02-28 01:30:08 +00:00
Evan Cheng
db591ecaa8
Make requiresRegisterScavenging determination on a per MachineFunction basis.
...
llvm-svn: 34711
2007-02-28 00:59:19 +00:00
Evan Cheng
cfb0f8cfc6
Temporary: make R12 available in ARM mode if RegScavenger is being used.
...
llvm-svn: 34709
2007-02-28 00:22:44 +00:00
Evan Cheng
fa23d8e51f
Start making use of RegScavenger.
...
llvm-svn: 34708
2007-02-28 00:21:58 +00:00
Evan Cheng
116f97f2c7
PEI now passes a RegScavenger ptr to eliminateFrameIndex.
...
llvm-svn: 34707
2007-02-28 00:21:17 +00:00
Evan Cheng
ee2e5de4fb
MRegisterInfo disowns RegScavenger. It's immutable.
...
llvm-svn: 34706
2007-02-28 00:17:36 +00:00
Reid Spencer
e306ef6798
Join two lines that can be joined.
...
llvm-svn: 34705
2007-02-27 23:49:07 +00:00
Reid Spencer
24430077d5
Pull out the stops.
...
llvm-svn: 34703
2007-02-27 23:33:03 +00:00
Reid Spencer
58f7a497bb
Remove some redundancy.
...
llvm-svn: 34702
2007-02-27 23:27:26 +00:00
Evan Cheng
4357509984
Minor tweak. Allocate r0 to r3 in reverse order, r3 is least likely to be livein to a function.
...
llvm-svn: 34701
2007-02-27 23:03:55 +00:00
Evan Cheng
ec12bdd7ea
Some more code clean up.
...
llvm-svn: 34700
2007-02-27 22:58:43 +00:00
Chris Lattner
da909a2df7
reenable generation of CC info
...
llvm-svn: 34699
2007-02-27 22:12:19 +00:00
Evan Cheng
2402ddad92
Oops.
...
llvm-svn: 34698
2007-02-27 22:10:52 +00:00
Reid Spencer
edbe747bab
Implement countLeadingOnes() and getMinSignedBits(). This helps to minimize
...
the bit width of negative numbers by computing the minimum bit width for a
negative value. E.g. 0x1800000000000000 could be just 0x8000000000000000
llvm-svn: 34695
2007-02-27 21:59:26 +00:00
Evan Cheng
b314459812
Back out previous commit temporarily.
...
llvm-svn: 34694
2007-02-27 21:47:22 +00:00
Evan Cheng
a19dd6f388
Let MRegisterInfo now owns RegScavenger; eliminateFrameIndex must preserve register kill info.
...
llvm-svn: 34692
2007-02-27 21:12:35 +00:00
Evan Cheng
4c4e56df47
Let MRegisterInfo now owns RegScavenger.
...
llvm-svn: 34691
2007-02-27 21:10:33 +00:00
Evan Cheng
f03b87c1ff
RegScavenger interface change to make it more flexible.
...
llvm-svn: 34690
2007-02-27 21:09:48 +00:00
Chris Lattner
0d05dc2523
implement CCMatchIfCC in terms of CCMatchIf
...
llvm-svn: 34685
2007-02-27 20:45:02 +00:00
Chris Lattner
4d29a90170
build cc info
...
llvm-svn: 34684
2007-02-27 20:44:31 +00:00
Reid Spencer
8178fd7bd5
Adjust to changes in the APInt interface.
...
llvm-svn: 34681
2007-02-27 20:25:25 +00:00
Reid Spencer
9e66d0921a
Improve APInt interface:
...
1. Add unsigned and signed versions of methods so a "bool" argument doesn't
need to be passed in.
2. Make the various getMin/getMax functions all be inline since they are
so simple.
3. Simplify sdiv and srem code.
llvm-svn: 34680
2007-02-27 20:24:31 +00:00
Reid Spencer
e0c8670bfe
Conform to single person attribution in file comment.
...
llvm-svn: 34678
2007-02-27 19:31:09 +00:00
Reid Spencer
a3b5b71616
For PR1205:
...
Implement review feedback:
1. Use new APInt::RoundDoubleToAPInt interface to specify the bit width so
that we don't have to truncate or extend in constant folding.
2. Fix a pasteo in SDiv that prevented a check for overflow.
3. Fix the shift operators: undef happens when the shift amount is equal
to the bitwidth.
llvm-svn: 34677
2007-02-27 19:29:54 +00:00
Reid Spencer
b61f731ddd
1. Fix three serious bugs in the comparison code.
...
2. Change RoundDoubleToAPInt to take a bit width parameter. Use that
parameter to limit the bit width of the result.
llvm-svn: 34673
2007-02-27 18:23:40 +00:00
Chris Lattner
da49dee51d
a note
...
llvm-svn: 34670
2007-02-27 17:21:09 +00:00
Devang Patel
89791371ce
Make getPassManagerType() const.
...
llvm-svn: 34669
2007-02-27 15:00:39 +00:00
Nicolas Geoffray
a144ebf568
Fix parenthesis for BCTRL_{ELF|Macho} test.
...
llvm-svn: 34668
2007-02-27 13:10:41 +00:00
Nicolas Geoffray
a562e5c1c5
Differentiate between the MachO and the ELF ABI the CALL instruction.
...
llvm-svn: 34667
2007-02-27 13:01:19 +00:00
Jim Laskey
f5b5a3cf77
Duplicate use of LR, take 2.
...
llvm-svn: 34666
2007-02-27 11:55:45 +00:00
Reid Spencer
b05cb31bdf
Allow the AsmWriter to print out arbitrary precision integers.
...
llvm-svn: 34664
2007-02-27 08:34:09 +00:00
Reid Spencer
74764708fa
Correct the implelmentation of ConstantInt::getAllOnesValue() for bit
...
widths > 64 bits.
llvm-svn: 34663
2007-02-27 07:57:53 +00:00
Reid Spencer
1e498b04f5
Get rid of extraneous // in file comment.
...
llvm-svn: 34662
2007-02-27 07:35:18 +00:00
Chris Lattner
90c768b913
Add calling convention info
...
llvm-svn: 34661
2007-02-27 06:59:52 +00:00
Reid Spencer
de3bbe0489
For PR1205:
...
Implement constant folding via APInt instead of uint64_t.
llvm-svn: 34660
2007-02-27 06:23:51 +00:00
Chris Lattner
9f0e5d8b03
move target independent calling convention stuff to TargetCallingConv.td
...
llvm-svn: 34659
2007-02-27 05:57:32 +00:00
Chris Lattner
2b737abea1
fill in some holes
...
llvm-svn: 34658
2007-02-27 05:51:05 +00:00
Chris Lattner
9117648533
switch x86-64 return value lowering over to using same mechanism as argument
...
lowering uses.
llvm-svn: 34657
2007-02-27 05:28:59 +00:00
Chris Lattner
11a1c2113c
Minor refactoring of CC Lowering interfaces
...
llvm-svn: 34656
2007-02-27 05:13:54 +00:00
Chris Lattner
e34136f6d5
move CC Lowering stuff to its own public interface
...
llvm-svn: 34655
2007-02-27 04:43:02 +00:00
Chris Lattner
cac44e283d
refactor x86-64 argument lowering yet again, this time eliminating templates,
...
'clients', etc, and adding CCValAssign instead.
llvm-svn: 34654
2007-02-27 04:18:15 +00:00
Chris Lattner
ae7cc3e0e0
ConstantFolding.cpp/h -> ConstantFold.cpp/h to avoid confusion with
...
lib/Analysis/ConstantFolding.
llvm-svn: 34653
2007-02-27 03:05:06 +00:00
Evan Cheng
f54dbab209
Backing out Jim's LR spill changes. This was causing llvm-gcc bootstrapping
...
to infinite loop:
PPCMachineFunctionInfo.h updated: 1.2 -> 1.3
PPCRegisterInfo.cpp updated: 1.110 -> 1.111
PPCRegisterInfo.h updated: 1.28 -> 1.29
llvm-svn: 34652
2007-02-27 02:55:29 +00:00
Evan Cheng
341fc2bf88
forward() should not increment internal iterator. Its client may insert instruction between now and next forward() call.
...
llvm-svn: 34649
2007-02-27 01:58:48 +00:00
Reid Spencer
67498a4072
Simplify and document RoundDoubleToAPInt.
...
llvm-svn: 34648
2007-02-27 01:28:10 +00:00
Reid Spencer
c8cc0f997e
For PR1205:
...
Implement the first step towards arbitrary precision integer support in
LLVM. The APInt class provides arbitrary precision arithmetic and value
representation. This patch changes ConstantInt to use APInt as its value
representation without supporting bit widths > 64 yet. That change will
come after ConstantFolding handles bit widths > 64 bits.
llvm-svn: 34647
2007-02-26 23:54:03 +00:00
Reid Spencer
97d7d18442
1. Make sure all delete operators of arrays use the array form of delete.
...
2. Rewrite operator=(const APInt& RHS) to allow the RHS to be a different
bit width than the LHS. This makes it possible to use APInt as the key
of a DenseMap, as needed for the IntConstants map in Constants.cpp
3. Fix operator=(uint64_t) to clear unused bits in case the client assigns
a value that has more bits than the APInt allows.
4. Assert that bit widths are equal in operator==
5. Revise getHashValue() to put the bit width in the low order six bits.
This should help to make i1 0, i2 0, ... i64 0 all distinct in the
IntConstants DenseMap.
llvm-svn: 34646
2007-02-26 23:38:21 +00:00
Evan Cheng
0fd5788077
Joining an interval with a dead copy instruction. Shorten the live range to the last use.
...
llvm-svn: 34645
2007-02-26 21:37:37 +00:00
Reid Spencer
2dc808284e
Implement the getHashValue method.
...
Fix toString use of getValue to use getZExtValue()
llvm-svn: 34642
2007-02-26 21:02:27 +00:00
Devang Patel
c13055b251
Use efficient container SmallPtrSet
...
llvm-svn: 34640
2007-02-26 20:22:50 +00:00
Chris Lattner
d4cd3a31e6
always lower to RETFLAG, never leave it as just ret.
...
llvm-svn: 34639
2007-02-26 19:44:02 +00:00
Devang Patel
b0b949f93e
Do not unswitch loop on same value again and again.
...
llvm-svn: 34638
2007-02-26 19:31:58 +00:00
Chris Lattner
656996aab8
fix attribution
...
llvm-svn: 34637
2007-02-26 18:56:07 +00:00
Chris Lattner
948965f809
Add a description of the X86-64 calling convention and the return
...
conventions. This doesn't do anything yet, but may in the future.
llvm-svn: 34636
2007-02-26 18:17:14 +00:00
Reid Spencer
728cf2d5cf
Re-enable this. The header was committed.
...
llvm-svn: 34634
2007-02-26 08:10:54 +00:00
Chris Lattner
7165ee9b6b
switch to smallvector
...
llvm-svn: 34633
2007-02-26 07:59:53 +00:00
Chris Lattner
4b7b0a145a
another missing header :( :( :(
...
llvm-svn: 34632
2007-02-26 07:51:00 +00:00
Chris Lattner
3fe1132dcd
initial hack at splitting the x86-64 calling convention info out from the
...
mechanics that process it. I'm still not happy with this, but it's a step
in the right direction.
llvm-svn: 34631
2007-02-26 07:50:02 +00:00
Reid Spencer
050bd4479e
1. Remove redundant calls to clearUsedBits().
...
2. Fix countTrailingZeros to use a faster algorithm.
3. Simplify sext() slightly by using isNegative().
4. Implement ashr using word-at-a-time logic instead of bit-at-a-time
5. Rename locals named isNegative so they don't clash with method name.
6. Fix fromString to compute negated value correctly.
llvm-svn: 34629
2007-02-26 07:44:38 +00:00
Chris Lattner
d0c941c89e
the truncate must always be done, it's only the assert that is conditional.
...
llvm-svn: 34628
2007-02-26 05:21:05 +00:00
Chris Lattner
cdbef93603
reapply my previous patch with a bugfix.
...
llvm-svn: 34627
2007-02-26 05:02:39 +00:00
Chris Lattner
96aac36de5
revert my previous change, something strange is happening.
...
llvm-svn: 34626
2007-02-26 04:43:19 +00:00
Chris Lattner
decf97fae2
add an accessor.
...
llvm-svn: 34625
2007-02-26 04:01:25 +00:00
Chris Lattner
2e7125dc74
in X86-64 CCC, i8/i16 arguments are already properly zext/sext'd on input.
...
Capture this so that downstream zext/sext's are optimized out. This
compiles:
int test(short X) { return (int)X; }
to:
_test:
movl %edi, %eax
ret
instead of:
_test:
movswl %di, %eax
ret
GCC produces this bizarre code:
_test:
movw %di, -12(%rsp)
movswl -12(%rsp),%eax
ret
llvm-svn: 34623
2007-02-26 03:18:56 +00:00
Chris Lattner
65de507797
Fold (sext (truncate x)) more aggressively, by avoiding creation of a
...
sextinreg if not needed. This is useful in two cases: before legalize,
it avoids creating a sextinreg that will be trivially removed. After legalize
if the target doesn't support sextinreg, the trunc/sext would not have been
removed before.
llvm-svn: 34621
2007-02-26 03:13:59 +00:00
Chris Lattner
38db1ad2ab
track signedness of formal argument, though we have a fixme here.
...
llvm-svn: 34620
2007-02-26 02:56:58 +00:00
Reid Spencer
6177d67365
Rewrite lshr to not do bit by bit copy but to copy and shift whole words.
...
This makes it much more efficient.
llvm-svn: 34618
2007-02-26 01:19:48 +00:00
Reid Spencer
82a5b300ad
Fix sext operation. Shifting by zero would leave an incorrect mask.
...
llvm-svn: 34617
2007-02-25 23:54:00 +00:00
Reid Spencer
c0d07ad61a
1. Fix the flip() method to correctly flip all words of the APInt.
...
2. Implement the trunc, sext, and zext operations.
3. Improve fromString to accept negative values as input.
llvm-svn: 34616
2007-02-25 23:44:53 +00:00
Chris Lattner
ad14e21b97
Fix an X86-64 abi bug. We now compile:
...
void foo(short);
void bar(unsigned short A) {
foo(A);
}
into:
_bar:
subq $8, %rsp
movswl %di, %edi
call _foo
addq $8, %rsp
ret
instead of:
_bar:
subq $8, %rsp
call _foo
addq $8, %rsp
ret
Testcase here: test/CodeGen/X86/x86-64-shortint.ll
llvm-svn: 34615
2007-02-25 23:10:46 +00:00
Chris Lattner
15c167cc61
fix CodeGen/X86/2007-02-25-FastCCStack.ll, a regression from my patch last
...
night: fastcc returns should only go in XMM0 if we have SSE2 or above.
llvm-svn: 34613
2007-02-25 22:23:46 +00:00
Jim Laskey
c2e9ceb475
Fix for PR1224.
...
llvm-svn: 34610
2007-02-25 21:43:59 +00:00
Chris Lattner
50be7cd320
Rework GlobalValue::removeDeadConstantUsers to always remove dead constant
...
exprs hanging off a global, even if the global is not otherwise dead. This
requires some tricky iterator gymnastics.
This implements Transforms/GlobalOpt/constantexpr-dangle.ll by deleting a
constantexpr that made it appear that the address of the function was taken.
llvm-svn: 34608
2007-02-25 21:06:13 +00:00
Chris Lattner
2fbfbcd9cd
disable some noisy debug output
...
llvm-svn: 34606
2007-02-25 20:42:59 +00:00
Chris Lattner
796625a49d
no really, this is the right patch
...
llvm-svn: 34605
2007-02-25 20:01:40 +00:00
Chris Lattner
49fc72110a
always promote float varargs to double.
...
llvm-svn: 34604
2007-02-25 19:59:18 +00:00
Reid Spencer
e6f7201099
1. Provide more detail in file comment.
...
2. Move comments for methods to .h file, delete them in .cpp file.
3. All places that were doing manual clear of high order bits now call the
clearUnusedBits() method in order to not depend on undefined behavior
of the >> operator when the number of bits shifted equals the word size.
4. Reduced # of loc by using the new result of clearUnusedBits() method.
5. Simplified logic (decreased indentation) in a few places.
6. Added code comments to larger functions that needed them.
7. Added FIXME notes about weak implementations of things (e.g. bit-by-bit
shift right is sub-optimal).
llvm-svn: 34603
2007-02-25 19:32:03 +00:00
Chris Lattner
b5ce97a83a
one important bugfix: PPC32 didn't have both elf and macho support for
...
external symbols and global addresses. Add the missing ones.
one important workaround: PPCISD::CALL is matched by both PPCcall_ELF
and PPCcall_Macho, disable the _ELF patterns for now.
llvm-svn: 34601
2007-02-25 19:20:53 +00:00
Chris Lattner
a9c561b9e6
optimize duplicate ValueMap lookups
...
llvm-svn: 34599
2007-02-25 18:40:32 +00:00
Dale Johannesen
f6f34ec2e0
cosmetic changes from review of last patch. obvious
...
llvm-svn: 34598
2007-02-25 18:31:31 +00:00
Evan Cheng
550798e5d5
A couple of more places where a register liveness has been extended and its last kill should be updated accordingly.
...
llvm-svn: 34597
2007-02-25 09:51:27 +00:00
Evan Cheng
13e48f975c
Add an assertion.
...
llvm-svn: 34596
2007-02-25 09:47:31 +00:00
Evan Cheng
189678c421
Fix a couple of bugs related IsDead back propagation during coalescing.
...
llvm-svn: 34595
2007-02-25 09:46:31 +00:00
Evan Cheng
8f3e6bfeb3
If the liveinterval of the source instruction has been extended, remove the IsKill marker.
...
llvm-svn: 34594
2007-02-25 09:41:59 +00:00
Evan Cheng
9968353d64
Only add liveinterval to livein set if it isn't assigned a stack slot.
...
llvm-svn: 34593
2007-02-25 09:39:02 +00:00
Chris Lattner
65ba08d627
fastcc functions that return double values now return them in xmm0 on x86-32.
...
This implements CodeGen/X86/fp-stack-ret.ll:test[23]
llvm-svn: 34592
2007-02-25 09:31:16 +00:00
Chris Lattner
e4ba88824d
allow vectors to be passed to stdcall/fastcall functions
...
llvm-svn: 34590
2007-02-25 09:14:25 +00:00
Chris Lattner
fac0b30da0
move LowerRET into the 'Return Value Calling Convention Implementation'
...
section of the file.
llvm-svn: 34589
2007-02-25 09:12:39 +00:00
Chris Lattner
65d915a3b6
make all Lower*CallTo implementations use LowerCallResult to handle their
...
result value stuff. This eliminates a bunch of duplicated code and now
GetRetValueLocs is the sole place that decides where a value is returned.
llvm-svn: 34588
2007-02-25 09:10:05 +00:00
Chris Lattner
423224a7b4
pass the calling convention into Lower*CallTo, instead of using ad-hoc flags.
...
llvm-svn: 34587
2007-02-25 09:06:15 +00:00
Chris Lattner
8fa75c3ae8
factor a bunch of code out of LowerCCCCallTo into a new LowerCallResult
...
function. This function now uses GetRetValueLocs to determine *where*
the result values are located and concerns itself with *how* to pull the
values out.
llvm-svn: 34586
2007-02-25 08:59:22 +00:00
Chris Lattner
3bfbc23ccd
move some code around, pass in calling conv, even though it is unused
...
llvm-svn: 34585
2007-02-25 08:29:00 +00:00
Chris Lattner
e9c4c19b27
fold trivial token factor nodes. This allows us to compile
...
test/CodeGen/X86/fp-stack-ret.ll into:
movl 4(%esp), %eax
fldl (%eax)
ret
instead of:
subl $12, %esp
movl 16(%esp), %eax
movsd (%eax), %xmm0
movsd %xmm0, (%esp)
fldl (%esp)
addl $12, %esp
ret
by eliminating a token factor that blocked a check.
llvm-svn: 34584
2007-02-25 08:24:27 +00:00
Chris Lattner
f119813ff4
simplify result value lowering by splitting the selection of *where* to return
...
registers out from the logic of *how* to return them.
This changes X86-64 to mark EAX live out when returning a 32-bit value,
where before it marked RAX liveout.
llvm-svn: 34582
2007-02-25 08:15:11 +00:00
Reid Spencer
ec6159bbea
Allow this to compile now that the header file is checked in.
...
llvm-svn: 34581
2007-02-25 07:30:14 +00:00
Chris Lattner
bcce79717b
make void-return not a special case
...
llvm-svn: 34579
2007-02-25 07:18:38 +00:00
Chris Lattner
d00fcb3277
eliminate a bunch more temporary vectors from X86 lowering.
...
llvm-svn: 34578
2007-02-25 07:10:00 +00:00
Chris Lattner
f7eeef816d
eliminate temporary vectors created during X86 lowering.
...
llvm-svn: 34577
2007-02-25 06:40:16 +00:00
Chris Lattner
6f25082e67
remove std::vector's in RET lowering.
...
llvm-svn: 34576
2007-02-25 06:21:57 +00:00
Chris Lattner
041fb5bc67
implement support for the linux/ppc function call ABI. Patch by
...
Nicolas Geoffray!
llvm-svn: 34574
2007-02-25 05:34:32 +00:00
Chris Lattner
ed4920842f
Add XLForm_1_ext template, patch by Nicolas Geoffray.
...
llvm-svn: 34573
2007-02-25 05:07:49 +00:00