Commit Graph

10465 Commits

Author SHA1 Message Date
Tanya Lattner
d70cee2d5a Special dep graph for SMS for superblocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22242 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 04:16:14 +00:00
Tanya Lattner
747e053cba Special versions of the dep graph and scheduled for SMS for superblocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22241 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 04:15:43 +00:00
Tanya Lattner
8352e23d11 Added statistic to count number of spills.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22240 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 04:01:34 +00:00
Tanya Lattner
d454a973a5 Numerous bug fixes and the completed modschedSB algorithm (minor bugs still exist for course).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22239 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 04:00:57 +00:00
Tanya Lattner
770e991bc4 Added SMS for superblocks as an option (experimental)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22238 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 04:00:22 +00:00
Chris Lattner
e88b7533be This is not true: (X != 13 | X < 15) -> X < 15
It is actually always true.  This fixes PR586 and
Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22236 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 03:59:17 +00:00
Chris Lattner
5662503afd Don't crash when dealing with INTMIN. This fixes PR585 and
Transforms/InstCombine/2005-06-16-RangeCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22234 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 02:05:55 +00:00
Chris Lattner
0289929c62 Don't crash on: X = phi (X, X).
This fixes PR584 and Transforms/SimplifyCFG/2005-06-16-PHICrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22232 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 01:45:53 +00:00
Chris Lattner
d7e31cfaae avoid constructing out of range shift amounts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22230 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-17 01:29:28 +00:00
Nate Begeman
41aaf7016e Fix bug 537 test 2, which checks to make sure that we fold A+(B-A) -> B for
integer types.  Add a couple checks to not perform these kinds of transform
on floating point values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22228 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-16 07:06:03 +00:00
Chris Lattner
f9c775c22e Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22227 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-16 04:55:52 +00:00
Chris Lattner
8d7089e1d5 Fix PR571, removing code that does just the WRONG thing :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22225 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-16 03:00:08 +00:00
Chris Lattner
aa457ac2e7 Fix a bug in my previous patch. Do not get the shift amount type (which
is always ubyte, get the type being shifted).  This unbreaks espresso


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22224 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-16 01:52:07 +00:00
Chris Lattner
d286b245be Fix PR575, patch provided by John Mellor-Crummey. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22223 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-15 22:49:30 +00:00
Chris Lattner
4bd09d70cc Fix PR582. The rewriter can move casts around, which invalidated the
BB iterator.  This fixes Transforms/IndVarsSimplify/2005-06-15-InstMoveCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22221 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-15 21:29:31 +00:00
Chris Lattner
553ca52623 Do not promote globals only used by main to locals if there are constantexprs
or other uses hanging off of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22219 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-15 21:11:48 +00:00
Chris Lattner
e17a128a55 Fix PR577 and testcase InstCombine/2005-06-15-ShiftSetCCCrash.ll.
Do not perform undefined out of range shifts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22217 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-15 20:53:31 +00:00
Reid Spencer
877c3e2b81 Put the hack back in that removes features, causes regressions to fail, but
allows test programs to succeed. Actual fix for this is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22213 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-15 18:25:30 +00:00
Nate Begeman
439009c81e Commit fix for generating conditional branch pseudo instructions that
avoids dereferencing the end() iterator when selecting the fallthrough
block.  This requires an ilist change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22212 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-15 18:22:43 +00:00
Nate Begeman
a43b176f51 Commit a small improvement that is already in the x86 and ia64 backends to
not generate unnecessary register copies.  This improves compile time by
2-5% depending on the test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22210 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-14 03:55:23 +00:00
Reid Spencer
16b5644f04 Unbreak several InstCombine regression checks introduced by a hack to
fix the bzip2 test. A better hack is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22209 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-13 06:41:26 +00:00
Nate Begeman
244e92eaab When compiled with GCC 4.0, a latent bug was exposed where both SparcV9
and the target independant register allocator were both using a class named
'LiveRange'.  This lead to the target independant code calling code in the
SparcV9 backend, which crashed.  Fixed by renaming SparcV9's LiveRange to
V9LiveRange.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22208 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-12 23:52:58 +00:00
Nate Begeman
ac609ddf82 Fix a memory smasher caught by Mac OS X's debug malloc library. We were
incorrectly using an iterator after it was invalid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22207 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-12 23:50:33 +00:00
Chris Lattner
71fae1022e Fix a 64-bit problem, passing (int)0 through ... instead of (void*)0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22206 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-09 03:32:54 +00:00
Chris Lattner
5633cd13e2 Fix a problem on 64-bit targets where we passed (int)0 through ... instead of
(void*)0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22205 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-09 02:59:00 +00:00
Andrew Lenharth
09552bff8d fix BranchCC with a setCC with an arg of 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22203 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-08 18:02:21 +00:00
Reid Spencer
eae435de83 For PR572:
Undefine the PPC symbol which is defined by Linux/PPC (erroneously) so it
doesn't pollute the user namespace and clash with our namespace declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22202 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-08 17:44:48 +00:00
Nate Begeman
b2c4bf3ff6 Handle some more real world cases of rlwimi. These don't come up that
regularly in "normal" code, but for things like software graphics, they
make a big difference.

For the following code:
unsigned short Trans16Bit(unsigned srcA,unsigned srcB,unsigned alpha)
{
	unsigned tmpA,tmpB,mixed;
	tmpA = ((srcA & 0x03E0) << 15) | (srcA & 0x7C1F);
	tmpB = ((srcB & 0x03E0) << 15) | (srcB & 0x7C1F);
	mixed = (tmpA * alpha) + (tmpB * (32 - alpha));
	return ((mixed >> 5) & 0x7C1F) | ((mixed >> 20) & 0x03E0);
}

We now generate:
_Trans16Bit:
.LBB_Trans16Bit_0:      ; entry
        andi. r2, r4, 31775
        rlwimi r2, r4, 15, 7, 11
        subfic r4, r5, 32
        mullw r2, r2, r4
        andi. r4, r3, 31775
        rlwimi r4, r3, 15, 7, 11
        mullw r3, r4, r5
        add r2, r2, r3
        srwi r3, r2, 5
        andi. r3, r3, 31775
        rlwimi r3, r2, 12, 22, 26
        blr

Instead of:
_Trans16Bit:
.LBB_Trans16Bit_0:      ; entry
        slwi r2, r4, 15
        rlwinm r2, r2, 0, 7, 11
        andi. r4, r4, 31775
        or r2, r2, r4
        subfic r4, r5, 32
        mullw r2, r2, r4
        slwi r4, r3, 15
        rlwinm r4, r4, 0, 7, 11
        andi. r3, r3, 31775
        or r3, r4, r3
        mullw r3, r3, r5
        add r2, r2, r3
        srwi r3, r2, 5
        andi. r3, r3, 31775
        srwi r2, r2, 20
        rlwimi r3, r2, 0, 22, 26
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22201 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-08 04:14:27 +00:00
Nate Begeman
6dae3308f5 Fix lli linking on Mac OS X 10.4.1 for Intel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22200 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-08 01:02:38 +00:00
Andrew Lenharth
141e488a70 Remove code for conversion from old style va_args. Preparing the way for
returning to the old style :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22199 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-08 00:49:08 +00:00
Misha Brukman
5e96a3a49f Fix spelling of `correlate'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22196 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-06 19:08:04 +00:00
Andrew Lenharth
cd7f8cf70b allow marking of loads and stores in the instruction stream with enough information to reconstruct the Value* if it existed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22195 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-06 19:03:55 +00:00
Andrew Lenharth
eee2a881cf hide basic block labels. The utility of these for debuging is long since passed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22194 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-06 19:03:09 +00:00
Misha Brukman
b8ee91a80f * Replace block of commented-out lines with #if 0
* Remove warning "control reaches end of non-void function"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22193 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-06 17:39:46 +00:00
Andrew Lenharth
837be1ec35 hack to fix bzip2 (bug 571)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22192 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-04 12:43:56 +00:00
Reid Spencer
628214eb74 Make sure that Cygwin assembly includes _ as part of function names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22190 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-02 21:33:19 +00:00
Reid Spencer
932e2e33eb Put in a hack for Cygwin that prevents mkdtemp from being used since
configure seems to find it on Cygwin but linking against it fails.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22189 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-02 05:38:20 +00:00
Andrew Lenharth
e3c8c0a49d try custom expanders, doesn't seem to expand yet, so disabled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22188 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-31 19:49:34 +00:00
Andrew Lenharth
591ec57c09 switch to the new live in thing. Really, this time it works
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22187 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-31 18:42:18 +00:00
Andrew Lenharth
14f30c927d switch to the new live in thing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22186 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-31 18:37:16 +00:00
Andrew Lenharth
fd5e4b778f switch to the new live in thing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22185 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-31 18:35:43 +00:00
Andrew Lenharth
044f31ffb1 match gcc, makes diff easier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22179 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-27 03:39:30 +00:00
Andrew Lenharth
69520ed67a Fix 2005-05-12-Int64ToFP
The issue is there is no unsigned -> double conversion, only signed.  So I
need to test the sign and do a different thing depending on it.  Ideally
this should be in a different BB, but in the mean time, I use a branch
free method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22177 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-26 18:18:34 +00:00
Reid Spencer
89026028d1 Make the registration hash_map static. No other module needs it. Also,
document what its for a little better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22164 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-21 01:27:04 +00:00
Reid Spencer
0660f754df Adjust the file comment to read a little easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22163 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-21 00:57:44 +00:00
Reid Spencer
b82baf04ec Make sure ... arguments are casted to sbyte* where needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22162 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-21 00:39:30 +00:00
Reid Spencer
5845623148 Add a "brief" comment for CastToCStr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22161 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-21 00:23:23 +00:00
Chris Lattner
9375135999 Fix mismatched type problem that crashed on cases like this:
sprintf(P, "%s", X);

Where X is not an sbyte*.  This fixes the bug JohnMC reported on llvm-bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22159 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 22:22:25 +00:00
Chris Lattner
42eb7524ef Fix Transforms/SimplifyCFG/switch-simplify-crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22158 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 22:19:54 +00:00
Nate Begeman
be13634907 C'mon everybody, let's modify X86JITInfo.cpp. This time, we add <iostream>
so that the shiny new use of std::cerr is defined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22156 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 21:29:24 +00:00
Misha Brukman
57ebf3d6a8 Since everyone else has "fixed" this file, might as well join in the fun.
* Change assert() to std::cerr printout, as it will not appear in opt builds
* Add comments to clarify what #ifdef/#else/#endif match what condition(s)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22154 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 19:46:50 +00:00
Chris Lattner
170fbcbc63 Fix this a 3rd time :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22151 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 17:00:21 +00:00
Andrew Lenharth
75a51277d2 fix compilation error due to no abort being defined. There is probably a better way to do this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22150 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 16:34:44 +00:00
Duraid Madina
04aa46d647 re-enable direct calls, this should just be a performance boost
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22148 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 11:39:17 +00:00
Duraid Madina
732c843f0e this seems dead (and broke the ia64 build, so..)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22147 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 06:21:59 +00:00
Chris Lattner
6184febcda Give the asmparser the ability to parse strings. Patch contributed by
Alexander Friedman


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22146 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 03:25:47 +00:00
Jeff Cohen
8bc6f934e8 Fix tail call support in VC++ builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22143 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 01:35:39 +00:00
Chris Lattner
1030f72f8a Fastcc passes arguments in EAX and EDX, make sure the JIT doesn't clobber them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22137 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-19 06:49:17 +00:00
Chris Lattner
16cb6f82eb Tailcalls require stubs to be emitted. Otherwise, the compilation callback
doesn't know who 'called' it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22136 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-19 05:54:33 +00:00
Misha Brukman
29eeea5082 Wrap long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22125 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-18 20:37:33 +00:00
Chris Lattner
49fbff4568 teach the inliner about coldcc and noreturn functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22113 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-18 04:30:33 +00:00
Duraid Madina
26b1d42c84 comment the hpux bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22081 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-16 06:59:53 +00:00
Duraid Madina
aaad8388e9 HP-UX system headers make a mess of isinf(), so much so that gcc fixincludes
can't patch it up for c++ (works in C though)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22079 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-16 06:45:57 +00:00
Reid Spencer
c3f6abdd85 Don't look for __builtin_ffs, we'll never see it from llvm-gcc and there's
not reason to include it for other front ends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22070 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 21:27:34 +00:00
Reid Spencer
f74eb3fa2a Provide this optimization as well:
ffs(x) -> (x == 0 ? 0 : 1+llvm.cttz(x))


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22068 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 21:19:45 +00:00
Chris Lattner
fc87928ebb PPC "branch and link" instructions are branches in the PPC sense, but not
in the LLVM code generator sense (they are calls).  Don't mark them as such,
which fixes the regressions on the ppc tester last night


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22065 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 20:11:44 +00:00
Chris Lattner
022ed327bd Fix andrews changes to fit in 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22064 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 19:54:37 +00:00
Reid Spencer
c64e3e77f9 Duh .. you actually have to #include Config/config.h before you can test
for one of the values that it defines!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22058 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 17:20:47 +00:00
Reid Spencer
edd5d9ece1 Some cleanups for compilation with GCC 4.0.0 to remove warnings:
* Use C++ style casts, not C style casts
* Abstract base classes should have virtual destructor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22057 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 16:13:11 +00:00
Duraid Madina
e75a24a5fa make angry compilers happy again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22054 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 14:44:13 +00:00
Duraid Madina
4560657b4c aCC and STLport complained about this, because they're like that
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22053 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 13:05:48 +00:00
Chris Lattner
ea0354346f don't reserve space for tailcall arg areas. It explicitly managed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22050 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 06:07:10 +00:00
Chris Lattner
5fae9ccd39 Teach reginfo how to deal with ADJSTACKPTRri, allowing us to generate:
add %ESP, 20
        jmp %EDX  # TAIL CALL

instead of:
        add %ESP, -8
        add %ESP, 28
        jmp %EDX  # TAIL CALL


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22047 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 05:49:58 +00:00
Chris Lattner
381e88799e Implement proper tail calls in the X86 backend for all fastcc->fastcc
tail calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22046 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 05:46:45 +00:00
Chris Lattner
e5eb6f829c Add some simplifications for MULH[SU]. This allows us to compile this:
long %bar(long %X) {
  %Y = mul long %X, 4294967297
  ret long %Y
}

to this:

l1_bar:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, %EAX
        add %EDX, DWORD PTR [%ESP + 8]
        ret

instead of:

l1_bar:
        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EDX, 1
        mov %EAX, %ECX
        mul %EDX
        add %EDX, %ECX
        add %EDX, DWORD PTR [%ESP + 8]
        mov %EAX, %ECX
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22044 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 05:39:08 +00:00
Chris Lattner
1e9448bce8 Add markers in the asm file for tail calls, add a new ADJSTACKPTRri
sorta-pseudo-instruction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22042 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 03:10:37 +00:00
Chris Lattner
4fc997941d When inserting callee-save register reloads, make sure to skip over any
terminator instructions before the 'ret' in case the target has a
multi-instruction return sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22041 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 03:09:58 +00:00
Chris Lattner
0dede079e7 Yes, calltarget is the operand of the day.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22040 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 01:10:30 +00:00
Chris Lattner
6972177bd4 When emitting the function epilog, check to see if there already a stack
adjustment.  If so, we merge the adjustment into the existing one.  This
allows us to generate:

caller2:
        sub %ESP, 12
        mov DWORD PTR [%ESP], 0
        mov %EAX, 1234567890
        mov %EDX, 0
        call func2
        add %ESP, 8
        ret 4

intead of:

caller2:
        sub %ESP, 12
        mov DWORD PTR [%ESP], 0
        mov %EAX, 1234567890
        mov %EDX, 0
        call func2
        sub %ESP, 4
        add %ESP, 12
        ret 4

for X86/fast-cc-merge-stack-adj.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22038 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 23:53:43 +00:00
Chris Lattner
2b3d56ee72 Add some new instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 23:35:21 +00:00
Reid Spencer
c29b13d648 Changes for ffs lib call simplification:
* Check for availability of ffsll call in configure script
* Support ffs, ffsl, and ffsll conversion to constant value if the argument
  is constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22027 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 16:42:52 +00:00
Chris Lattner
1ca85d567c Fix construction of ioport intrinsics, fixing X86/io.llx and io-port.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22026 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 13:56:55 +00:00
Chris Lattner
65af1abd1e Preserve calling conv when hacking on calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22025 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:28:32 +00:00
Chris Lattner
e43702695d preserve calling conventions when hacking on code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22024 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:25:32 +00:00
Chris Lattner
16d0db2da8 Make sure to preserve the calling convention when changing an invoke into
a call.  This fixes Prolangs-C++/deriv2, kimwitu++, and Misc-C++/bigfib
on X86 with -enable-x86-fastcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22023 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:21:56 +00:00
Chris Lattner
920c0aa9c2 Pass i64 values correctly split in reg/mem to fastcc calls.
This fixes fourinarow with -enable-x86-fastcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22022 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:03:10 +00:00
Chris Lattner
239738a162 Use target-specific nodes for calls. This allows the fastcc code to not have
to do ugly hackery to avoid emitting code like this:

   call foo
   mov vreg, EAX
   adjcallstackup ...

If foo is a fastcc call and if vreg gets spilled, we might end up with this:

   call foo
   mov [ESP+offset], EAX     ;; Offset doesn't consider the 12!
   sub ESP, 12

Which is bad.  The previous hacky code to deal with this was A) gross B) not
good enough.  In particular, it could miss cases and emit the bad code above.
Now we always emit this:

   call foo
   adjcallstackup ...
   mov vreg, EAX

directly.

This makes fastcc with callees poping the stack work much better.  Next
stop (finally!) really is tail calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22021 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 08:48:15 +00:00
Chris Lattner
2789bde57f allow token chain at start or end of node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22020 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 08:34:53 +00:00
Chris Lattner
3e01136f9f remove special case hacks for readport/readio from the binary operator
codepath


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22019 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:45:46 +00:00
Chris Lattner
385328ce41 Implement fixme's by memoizing nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22018 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:42:29 +00:00
Chris Lattner
b7f7d51422 Turn this into a wrapper for a simpler version of getNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22016 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:32:14 +00:00
Chris Lattner
adf6c2a0cb Eliminate special purpose hacks for dynamic_stack_alloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22015 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:29:57 +00:00
Chris Lattner
e89083a930 Use the general mechanism for creating multi-value nodes instead of using
special case hacks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22014 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:25:05 +00:00
Chris Lattner
67649dfc32 use a target-specific node and custom expander to lower long->FP to FILD64m.
This should fix some missing symbols problems on BSD and improve performance
of programs that use that operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22012 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:52:07 +00:00
Chris Lattner
5fa4fa4e0f Wrap long line, actually add node to the graph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22011 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:42:57 +00:00
Chris Lattner
d73cc5d058 legalize target-specific operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22010 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:34:48 +00:00
Chris Lattner
89c34637cb add a getNode() version that allows construction of any node type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22009 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:20:26 +00:00
Chris Lattner
50381b6c41 LowerOperation takes a dag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22004 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 05:50:48 +00:00
Chris Lattner
38135af219 Print the symbolic register name in a register allocator debug dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22002 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 05:34:15 +00:00
Chris Lattner
a88a260dbd Allow targets to have a custom int64->fp expander if desired
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22001 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 05:33:54 +00:00
Chris Lattner
10d2645710 Make sure the start of the arg area and the end (after the RA is pushed)
is always 8-byte aligned for fastcc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21995 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 23:49:10 +00:00
Chris Lattner
bfed9247f1 fix the assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21994 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 23:35:47 +00:00
Chris Lattner
a8217e3000 Align doubles on 8-byte boundaries if possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21993 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 23:14:17 +00:00
Chris Lattner
0db07092a7 print stack object alignment in -print-machineinstr dumps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21992 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 22:54:44 +00:00
Chris Lattner
653f7230ad fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21991 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 22:46:57 +00:00
Chris Lattner
06cebb456a Fix the problems with callee popped argument lists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21988 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 22:13:49 +00:00
Chris Lattner
ca96c8217d Don't emit SAR X, 0 in the case of sdiv Y, 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21986 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:50:27 +00:00
Chris Lattner
a96e577f53 Fix UnitTests/2005-05-13-SDivTwo.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21985 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:48:20 +00:00
Chris Lattner
3648c67eb2 switch to having the callee pop stack operands for fastcc. This is currently buggy
do not use


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21984 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:44:04 +00:00
Chris Lattner
2a82ef317c Tolerate instrs with extra args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21982 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:07:15 +00:00
Chris Lattner
24ddc6d067 allow RETI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21980 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 20:46:35 +00:00
Chris Lattner
b5d8e6ece6 treat TAILCALL nodes identically to CALL nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21977 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 20:29:26 +00:00
Chris Lattner
2e7714ad2b Build TAILCALL nodes in LowerCallTo, treat them like normal calls everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21976 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 20:29:13 +00:00
Chris Lattner
4bf7afcc27 Capitalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21964 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 19:49:09 +00:00
Chris Lattner
7d93727bb2 capitalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21962 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 19:48:34 +00:00
Chris Lattner
f8492193b9 clarify that these are v9 options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21960 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 19:45:45 +00:00
Chris Lattner
6bc2dc7b2c hide this option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21959 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 19:44:21 +00:00
Chris Lattner
adf6a965a3 Add an isTailCall flag to LowerCallTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21958 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 18:50:42 +00:00
Chris Lattner
d71c04199c Handle TAILCALL node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21957 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 18:43:43 +00:00
Chris Lattner
1be4811d34 add 'ret imm' instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21945 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 17:56:48 +00:00
Chris Lattner
32f3cf612e Realize that we don't support fmod directly, fixing CodeGen/Generic/print-arith-fp.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 16:20:22 +00:00
Chris Lattner
63602fb868 Do not CopyFromReg physregs for live-in values. Instead, create a vreg for
each live in, and copy the regs from the vregs.  As the very first thing we
do in the function, insert copies from the pregs to the vregs.  This fixes
problems where the token chain of CopyFromReg was not enough to allow reordering
of the copyfromreg nodes and other unchained nodes (e.g. div, which clobbers
eax on intel).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21932 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:38:09 +00:00
Chris Lattner
405ef9e28d Emit function entry code after lowering hte arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21931 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:33:32 +00:00
Chris Lattner
3aa7832c82 Allow targets to emit code into the entry block of each function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21930 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:23:21 +00:00
Chris Lattner
08b22ecc88 calling a function with the wrong CC is undefined, turn it into an unreachable
instruction.  This is useful for catching optimizers that don't preserve
calling conventions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21928 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:09:09 +00:00
Chris Lattner
712ad0c36d allow a virtual register to be associated with live-in values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21927 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:08:07 +00:00
Reid Spencer
fe07581d78 Make sure that decompression checks for the case that bzip2 returns
BZ_OK (meaning more data is expected) but there is no more input data. In
this case, the input file is probably truncated. Generate an exception that
indicates this case when its detected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21926 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:05:37 +00:00
Chris Lattner
efd9168eae When lowering invokes to calls, amke sure to preserve the calling conv. This
fixes Ptrdist/anagram with x86 llcbeta


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21925 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 06:27:02 +00:00
Chris Lattner
1381dd8a6e Prefer int 0 instead of long 0 for GEP arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21924 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 06:10:12 +00:00
Chris Lattner
eb516e7f0a Fix a problem that nate reduced for me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21923 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 05:17:00 +00:00
Chris Lattner
9530ddcc60 rename variables and functions to match renamed DAG nodes. Bonus feature:
I can actually remember which one is which now!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21922 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 05:09:11 +00:00
Chris Lattner
66de05b606 do not call expandop on the same value more than once. This fixes
X86/2004-02-22-Casts.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21919 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 04:45:13 +00:00
Chris Lattner
a364fa126a fix a bad typeo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21917 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 23:51:40 +00:00
Chris Lattner
128b52d3d7 update comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21916 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 23:24:44 +00:00
Chris Lattner
16cd04d26c rename the ADJCALLSTACKDOWN/ADJCALLSTACKUP nodes to be CALLSEQ_START/BEGIN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21915 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 23:24:06 +00:00
Chris Lattner
c6f4181923 Add a new -enable-x86-fastcc option that enables passing the first
two integer values in registers for the fastcc calling conv.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21912 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 23:06:28 +00:00
Chris Lattner
9092fa310c Pass calling convention to use into lower call to
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21900 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 19:56:57 +00:00
Chris Lattner
c57f682113 Pass in Calling Convention to use into LowerCallTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21899 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 19:56:45 +00:00
Chris Lattner
6649418598 Enable pattern isel by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21898 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 19:56:09 +00:00
Chris Lattner
3becf2026b fix expansion of ct[lt]z nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21896 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 19:27:51 +00:00
Chris Lattner
39a8f33630 Expand 64-bit ctlz/cttz nodes for 32-bit targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21895 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 19:05:01 +00:00
Chris Lattner
383203b003 Fix uint->fp casts on PPC, allowing UnitTests/2005-05-12-Int64ToFP to
work on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21894 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 18:52:34 +00:00
Chris Lattner
45982dad53 Allow something to be legalized multiple times. This can be used to reduce
legalization iteration


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21892 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 16:53:42 +00:00
Chris Lattner
13689e2009 Oops, don't do this after we figure out where to insert the call chains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21890 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 07:00:44 +00:00
Chris Lattner
44d105b7fa Make sure to expand all nodes, avoiding unintentional node duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21889 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 06:54:21 +00:00
Chris Lattner
6980d8295f handle a common case generated by the uint64 -> FP code path better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21888 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 06:27:02 +00:00
Chris Lattner
e131e5b81e add fixme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21887 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 06:04:14 +00:00
Chris Lattner
4b3141d324 Fix a really horrible problem that causes the JIT to miscompile any program
that use 64-bit integers on 32-bit hosts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21886 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 06:01:28 +00:00
Chris Lattner
b9fa3bc8f3 Fix a problem where early legalization can cause token chain problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21885 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 04:49:08 +00:00
Chris Lattner
9bce0f92c3 These targets don't like setcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21884 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 02:06:00 +00:00
Chris Lattner
88de6e77bf Make legalize a bit more efficient, and canonicalize sub X, C -> add X, -C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21882 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 00:17:04 +00:00
Nate Begeman
d7c4a4a6c0 Necessary changes to codegen cttz efficiently on PowerPC
1. Teach LegalizeDAG how to better legalize CTTZ if the target doesn't have
   CTPOP, but does have CTLZ
2. Teach PPC32 how to do sub x, const -> add x, -const for valid consts
3. Teach PPC32 how to do and (xor a, -1) b -> andc b, a
4. Teach PPC32 that ISD::CTLZ -> PPC::CNTLZW


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21880 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 23:43:56 +00:00
Tanya Lattner
d977095838 Fixed issue that broke ssa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21878 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 21:45:03 +00:00
Chris Lattner
4548a0ed32 fix some GCC 4 warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21877 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 21:40:40 +00:00
John Criswell
3163e2d9f3 Added support for decomposing constant expressions containing shr and shl
instructions.
Review of this commit would be greatly appreciated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21876 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 21:16:42 +00:00
Chris Lattner
98cf45bbf6 Fix lowering of ctlz, so now UnitTests/2005-05-11-Popcount-ffs-fls passes
with the CBE


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21875 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 20:24:12 +00:00
Chris Lattner
a801172e50 Fix lowering of cttz to work with signed values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21874 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 20:02:14 +00:00
Chris Lattner
86f3e0c24e fix and concisify intinsic lowering for ctpop. Unfortunately, this code
looks completely untested. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21873 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 19:42:05 +00:00
Chris Lattner
0d67f0c80f Fix the last remaining bug preventing us from switching the X86 BE over
from the simple isel to the pattern isel.  This forces inserted libcalls
to serialize against other function calls, which was breaking
UnitTests/2005-05-12-Int64ToFP.  Hopefully this will fix issues on other
targets as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21872 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 19:02:11 +00:00
Chris Lattner
27e9b41464 Do not memoize ADJCALLSTACKDOWN nodes, provide a method to hack on them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21871 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 18:57:39 +00:00
Chris Lattner
16ce0df927 wrap long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21870 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 18:57:06 +00:00
Chris Lattner
5c33c9a166 Make sure to legalize generated ctpop nodes, convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21868 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 18:35:21 +00:00
Duraid Madina
57ff7e5f64 expand count-leading/trailing-zeros; the test 2005-05-11-Popcount-ffs-fls.c
should now pass (the "LLVM" and "REF" results should be identical)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21866 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 08:45:08 +00:00
Chris Lattner
18aa680a96 Add some notes for expanding clz/ctz
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21862 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 05:27:09 +00:00
Chris Lattner
e3ef0a8b9f Simplify this code, use the proper shift amount
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21861 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 05:21:31 +00:00
Duraid Madina
63bbed536c add the popcount instruction and support this in the isel
the primary user of this will probably end up being find-first-set-bit/find-
last-set-bit, which i'll get around to...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21860 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 05:16:09 +00:00
Chris Lattner
9b583b4910 Legalize this correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21859 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 05:09:47 +00:00
Chris Lattner
1f38e5c431 No really IA*64* :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21858 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 05:03:56 +00:00
Chris Lattner
c610d4267f X86 has more than just 32-bit registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21857 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 05:00:34 +00:00
Chris Lattner
edb1add9a0 implement expansion of ctpop nodes, implementing CodeGen/Generic/llvm-ct-intrinsics.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21856 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 04:51:16 +00:00
Chris Lattner
276260b16d Print bit count nodes correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21855 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 04:50:30 +00:00
Chris Lattner
6d5857e139 Do not use "" as a sentinal for a missing argument! This fixes PR560.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21850 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 23:20:17 +00:00
Misha Brukman
b5cd8459df Why output multiple strings, let the compiler concatenate them for us for free
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21845 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 22:03:50 +00:00
Misha Brukman
5a2a3826ef * Convert tabs to spaces, fix code alignment
* Remove trailing whitespace
* Wrap long lines


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21844 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 22:02:28 +00:00
Chris Lattner
6415bb4c29 Convert feature of the simple isel over for the pattern isel to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 03:53:18 +00:00
Chris Lattner
641f02f10f Fix Reassociate/shifttest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21839 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 03:39:25 +00:00
Jeff Cohen
19bb2283e6 Silence some VC++ warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21838 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 02:22:38 +00:00
Chris Lattner
7f78f218fd If a function contains no allocas, all of the calls in it are trivially
suitable for tail calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21836 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 23:51:13 +00:00
Chris Lattner
ef311aa7cf The semantics of cast X to bool are a comparison against zero, not a truncation!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21833 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 22:17:13 +00:00
Chris Lattner
966cdfb600 Implement READPORT/WRITEPORT, implementing the last X86 regression tests
that were failing with the pattern selector.  Note that the support that
existed in the simple selector was clearly broken in several ways though
(which has also been fixed).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21831 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 21:17:38 +00:00
Chris Lattner
cecd67b432 do not emit illegal instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21830 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 21:06:04 +00:00
Chris Lattner
82c7897f49 Fix the syntax of the i/o instructions, these are obviously unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21829 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 20:49:20 +00:00
Chris Lattner
4e6ce5f9c7 legalize readio/writeio into load/stores, fixing CodeGen/X86/io.llx with
the pattern isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21828 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 20:37:29 +00:00
Chris Lattner
6d5b8e1646 legalize readio/writeio into a load/store if requested
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21827 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 20:36:57 +00:00
Chris Lattner
52d08bd9d8 legalize READPORT, WRITEPORT, READIO, WRITEIO, at least in the basic cases
where they are directly supported by the architecture.  Wrap a bunch of
long lines :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21826 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 20:23:03 +00:00
Chris Lattner
d0f6c1f52d Add support for matching the READPORT, WRITEPORT, READIO, WRITEIO intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21825 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 20:22:36 +00:00
Chris Lattner
3c6910153c Add support for READPORT, WRITEPORT, READIO, WRITEIO
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21824 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 20:22:17 +00:00
Chris Lattner
a0dbf181e0 restore some non-dead code I removed last night breaking double casts to
uint


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21821 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 18:37:02 +00:00
Chris Lattner
cafb67b250 fold and (shl X, C1), C2 -> rlwinm when possible. Many other cases are possible,
include and (srl)    and the inverses (shl and) etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21820 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 17:39:48 +00:00
Chris Lattner
57aa5961a9 Fold shifts into subsequent SHL's. These shifts often arise due to addrses
arithmetic lowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21818 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 17:06:45 +00:00
Duraid Madina
8a3042c872 fix and cleanup constmul code a bit, this fixes mediabench/toast and
probably a couple of other tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21814 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 13:18:34 +00:00
Chris Lattner
a80d2bd89c Wrap long lines, remove dead code that is now handled by legalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21811 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 05:40:26 +00:00
Chris Lattner
2afa1910d4 Fix FP -> bool casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21810 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 05:33:18 +00:00
Chris Lattner
6e4c6495eb implement and.ll:test33
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21809 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 04:58:36 +00:00
Chris Lattner
fd414a27fd Don't use the load/store instruction as the source pointer, use the pointer
being stored/loaded through!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21806 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 04:28:51 +00:00
Chris Lattner
0437cdd6dc memoize all nodes, even null Value* nodes. Do not add two token chain outputs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21805 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 04:14:13 +00:00
Chris Lattner
369e6db9b6 wrap long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21804 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 04:08:33 +00:00
Chris Lattner
2bf3c26b2b Print SrcValue nodes correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21803 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 04:08:27 +00:00
Chris Lattner
e3e0f2765a Fix X86/2005-05-08-FPStackifierPHI.ll: ugly gross hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21801 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 03:36:39 +00:00
Chris Lattner
cb9048a6e8 Preserve CC's when linking modules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21799 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 01:09:39 +00:00