Commit Graph

277 Commits

Author SHA1 Message Date
Chris Lattner
e4d5c441e0 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:54:21 +00:00
Chris Lattner
e7f96c515e Substantially improve the code generated by non-folded setcc instructions.
In particular, instead of compiling this:

bool %test(int %A, int %B) {
  %C = setlt int %A, %B
  ret bool %C
}

to this:

test:
        save %sp, -96, %sp
        subcc %i0, %i1, %g0
        bl .LBBtest_1   !
        nop
        ba .LBBtest_2   !
        nop
.LBBtest_1:     !
        or %g0, 1, %i0
        ba .LBBtest_3   !
        nop
.LBBtest_2:     !
        or %g0, 0, %i0
        ba .LBBtest_3   !
        nop
.LBBtest_3:     !
        restore %g0, %g0, %g0
        retl
        nop

We now compile it to this:

test:
        save %sp, -96, %sp
        subcc %i0, %i1, %g0
        or %g0, 1, %i0
        bl .LBBtest_2   !
        nop
.LBBtest_1:     !
        or %g0, %g0, %i0
.LBBtest_2:     !
        restore %g0, %g0, %g0
        retl
        nop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19213 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 16:06:57 +00:00
Chris Lattner
84c556e92a Remove unused #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19021 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-17 19:07:04 +00:00
Brian Gaeke
5761805d27 The mystery of Olden/tsp solved, and more opportunities for speedup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18932 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-14 09:10:10 +00:00
Brian Gaeke
6b260e2638 Get rid of shifts by zero in most cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18931 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-14 08:21:02 +00:00
Chris Lattner
e171d5c812 Add some notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18911 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 20:13:10 +00:00
Brian Gaeke
a04d959f0c Add V8 SPEC status.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 00:27:35 +00:00
Chris Lattner
3ea78c4276 Use the target triple to pick this target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18830 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 17:40:28 +00:00
Brian Gaeke
367c137f6a Complete the list of MultiSource failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18826 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 08:22:11 +00:00
Brian Gaeke
326f378a8f hbd should be working now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18824 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 07:42:59 +00:00
Brian Gaeke
f731be0dd5 Finally enable the setcc-branch folding code.
Also, fix a bug where ubyte 255 would sometimes be output as -1. This
was afflicting hbd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18823 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 07:42:58 +00:00
Brian Gaeke
81cf150b5d Add (currently disabled) code for canFoldSetCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18820 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 06:22:30 +00:00
Brian Gaeke
6a8c46cde3 Add stubs for setcc-branch folding support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18818 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-12 06:01:26 +00:00
Brian Gaeke
74be3a5794 Print llvm code one function at a time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18805 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 22:17:07 +00:00
Brian Gaeke
b3a86a6d49 JIT should print LLVM each function before selecting instructions for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18803 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 18:41:09 +00:00
Brian Gaeke
56c5d7369b Bools are *also* not ints. Sigh. Furthermore, most of the TargetMachine
ctor parameters can be defaulted.

Print the transformed llvm code input to the instruction selector
when -print-machineinstrs is on, just like V9.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18794 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 05:19:04 +00:00
Brian Gaeke
4658ba13a8 Look for many more moves to fold (previously, we only
*or g0, x      add g0, x          recognized * as a move)
 or  x, g0     add  x, g0
 or  0, x      add  0, x
 or  x, 0      add  x, 0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18793 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 05:19:03 +00:00
Brian Gaeke
4f70b63ebc Make GEPs not suck so much:
* Don't emit the Index * ElementSize multiply if Index is a constant.
* Use a shift, not a multiply, if ElementSize is 1/2/4/8.
* If ElementSize fits in the immediate field of SMUL, then put it there.

Fix a bug where struct offsets might be truncated (ConstantSInt::get is
now used instead of ConstantInt::get).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18792 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 05:19:02 +00:00
Brian Gaeke
9d6ffb47b4 Update lists of failing benchmarks, including info on which
ones are failing in cbe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-11 05:19:01 +00:00
Brian Gaeke
5aefa8a6fe Move -lowerselect later in the chain; some select instructions were
slipping through into the instruction selector, which can't deal with
them yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18758 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 08:39:30 +00:00
Brian Gaeke
c2e5f3635a Add the rest of the multiply instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18757 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 08:39:29 +00:00
Brian Gaeke
1f42181f99 Support binary operations with immediates for <= cInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18756 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 08:39:28 +00:00
Brian Gaeke
2b314430f7 Update lists of failing benchmarks (except C++...something is the
matter with my sparcv8 libstdc++.a) and to-do list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18755 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 08:39:27 +00:00
Brian Gaeke
57600548c7 Adjust paths: Sparc/V8 --> SparcV8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18737 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 04:48:57 +00:00
Brian Gaeke
8fe429d0c2 Make this file self-contained.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18736 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 04:46:30 +00:00
Brian Gaeke
09d8d67066 Update list of failing MultiSource benchmarks. It works out to +5 -5, but I
think some of these might be the CFE's fault; a rebuild should come soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18735 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 04:42:46 +00:00
Brian Gaeke
8ee6a2fb16 When FpMOVDs appeared in pairs, we were mistakenly skipping over the latter of
each pair. I think this fixes that.

One of these days, I swear I'm going to get the hang of C++ iterators.
Really.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18734 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 04:42:45 +00:00
Brian Gaeke
3616f91b71 We're continuing to make progress on MultiSource.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18714 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09 18:54:31 +00:00
Brian Gaeke
20503bd958 Bytes and shorts are aligned differently from words.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18713 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09 18:51:02 +00:00
Brian Gaeke
3bf960ccac Fix asm-printing directives (how did we not see this before...apparently,
everything was an int!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18712 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09 18:51:01 +00:00
Brian Gaeke
1d65645582 This code rotted - change it to call abort() until someone wants
to rewrite this to use relocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18453 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-03 06:57:14 +00:00
Brian Gaeke
cb7a76283b Update list of failing benchmarks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18384 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 08:15:44 +00:00
Brian Gaeke
9e0b9028c7 If we're about to emit something like:
%f0 = fmovs %f0
  %f1 = fmovs %f1

then just delete the FpMOVD pseudo-instruction instead.  Also, add
statistics and debug printouts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18383 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 08:15:15 +00:00
Brian Gaeke
e4ed742588 Update list of failing benchmarks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18202 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 04:07:42 +00:00
Brian Gaeke
31e575901f Fix bug in emitGEPOperation with large struct-member offsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18201 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-24 04:07:33 +00:00
Brian Gaeke
88108b8cfa Support shr long/ulong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18173 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 21:10:50 +00:00
Brian Gaeke
4dd043f090 Support printing ConstantAggregateZeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18172 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 21:10:49 +00:00
Brian Gaeke
8a0c4fd0c6 Update failing SingleSource test-case list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18171 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 21:10:48 +00:00
Brian Gaeke
fbe558c993 pseudocode for 64-bit lshr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18154 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 08:14:09 +00:00
Brian Gaeke
2041d0ca12 Add more known-failing tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18149 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 06:39:50 +00:00
Brian Gaeke
82a4795850 Add the rest of the logical instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18148 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-23 06:39:37 +00:00
Brian Gaeke
9ffcf9fddd Add stub method for long shift codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18100 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 08:02:06 +00:00
Brian Gaeke
6f0b77221c Update to-do list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18099 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 08:02:05 +00:00
Brian Gaeke
c7b4f1033f Implement setcc on longs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18088 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21 08:11:28 +00:00
Brian Gaeke
4351857d78 Add all the rest of the ADD and SUB variants, some of which are important for
64-bit support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21 07:13:17 +00:00
Brian Gaeke
5f91de2b38 Support add, sub, mul, div, rem on longs/ulongs (latter 3 by emitting libcalls).
Add a big comment containing my notes on how to do setcc for longs/ulongs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18086 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21 07:13:16 +00:00
Brian Gaeke
b10fc0343f Update to-do list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18085 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21 07:13:15 +00:00
Brian Gaeke
79fe833411 Fix extraStack calculation -- I think in fact it might be getting a bit *too*
much stack, but that's better than not enough, which leads to miscompilations.

Fix FP vaarg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18079 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21 03:35:22 +00:00
Brian Gaeke
e1e2899e96 Update list of failing benchmarks & to-do list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18078 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21 03:35:21 +00:00
Brian Gaeke
b95cbee930 Support most cases of vaarg (except double).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-20 22:50:42 +00:00