1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

456 Commits

Author SHA1 Message Date
Nate Begeman
6b0fbf811f Fix that pesky floats in integer regs problem by assigning the f32 type to
the correct register class.  Also remove the loading of float data into int
regs part of varargs; it will need to be implemented differently later.

llvm-svn: 20857
2005-03-26 08:25:22 +00:00
Nate Begeman
31d175d1e5 Get closer to having varargs working. There's still something strange
going on with copies between floating point and integer register files
being generated.  Once that is solved, varargs will be done.

llvm-svn: 20856
2005-03-26 07:46:36 +00:00
Nate Begeman
69742e6ea1 Make 64bit args and float args work correct with calls. Thanks to Chris
for explaining EXTRACT_ELEMENT to me.

llvm-svn: 20847
2005-03-26 02:17:46 +00:00
Nate Begeman
d3b5925b38 Next round of pattern isel changes, mostly dealing with calls.
llvm-svn: 20841
2005-03-26 01:28:53 +00:00
Nate Begeman
4106e81966 Correct a documention link
llvm-svn: 20840
2005-03-26 01:28:05 +00:00
Nate Begeman
ba1cd37734 Support global addresses and fix call returns. Varargs still aren't
handled correctly for floating point arguments, or more than 8 arguemnts.
This does however, allow hello world to run.

llvm-svn: 20832
2005-03-25 08:34:25 +00:00
Nate Begeman
6b11098886 Implement next round of Pattern ISel fixes
1. void returns
2. multiplies
3. calls

llvm-svn: 20822
2005-03-24 23:35:30 +00:00
Nate Begeman
613e54d5f0 Fix an incorrect argument being passed to BuildMI for indirect calls.
llvm-svn: 20821
2005-03-24 23:34:38 +00:00
Nate Begeman
4584ca0554 Commit Gabor Greif's patch to use iterators in lowering intrinsics.
llvm-svn: 20816
2005-03-24 20:07:16 +00:00
Chris Lattner
ad07b1bc54 eliminate dead variables, patch contributed by Gabor Greif!
llvm-svn: 20812
2005-03-24 17:32:20 +00:00
Nate Begeman
833c1d0994 Implement more of the PPC32 Pattern ISel:
1) dynamic stack alloc
2) loads
3) shifts
4) subtract
5) immediate form of add, and, or, xor
6) change flag from -pattern-isel to -enable-ppc-pattern-isel

Remove dead arguments from getGlobalBaseReg in the simple ISel

llvm-svn: 20810
2005-03-24 06:28:42 +00:00
Chris Lattner
a42c4a0874 Fix silly "no newline at end of file" warning
llvm-svn: 20809
2005-03-24 06:16:18 +00:00
Nate Begeman
0e77845b7e Addition of the PPC32 Pattern ISel. While it is far from complete, it will
be brought up to parity with the current simple ISel in the coming days.
Currently, -pattern-isel is required to trigger it.

llvm-svn: 20805
2005-03-24 04:41:43 +00:00
Misha Brukman
04d6d0666d We may be adding functions to the Module during initialization, so
conservatively, it's modified

llvm-svn: 20735
2005-03-21 19:22:14 +00:00
Chris Lattner
4b688a1c70 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!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
496d623600 Fix a crash handling 'undef bool', fixing an llc crash on 186.crafty
llvm-svn: 20523
2005-03-08 22:53:09 +00:00
Chris Lattner
b205d87afe cleanup the cfg after lsr
llvm-svn: 20410
2005-03-02 21:56:00 +00:00
Chris Lattner
798b18474c Add a temporary option for llc-beta: -enable-lsr-for-ppc, which turns on
Loop Strength Reduction.

llvm-svn: 20399
2005-03-02 06:19:22 +00:00
Chris Lattner
5174b9cb60 Fix a problem where the PPC backend lost track of the fact that it had
to save and restore the LR register on entry and exit of a leaf function
that needed to access globals or the constant pool.  This should hopefully
fix oscar from sending the PPC tester spinning out of control.

llvm-svn: 20197
2005-02-15 20:26:49 +00:00
Chris Lattner
c032990335 Fix Regression/CodeGen/PowerPC/2005-01-14-UndefLong.ll
llvm-svn: 19557
2005-01-14 20:22:02 +00:00
Chris Lattner
b0b49268c4 Fix: Regression/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll
llvm-svn: 19555
2005-01-14 19:31:00 +00:00
Chris Lattner
93fc4bd9cb This hunk:
-  unsigned TrueValue = getReg(TrueVal, BB, BB->begin());
+  unsigned TrueValue = getReg(TrueVal);

Fixes the PPC regressions from last night.

The other hunk is just a clarity improvement.

llvm-svn: 19263
2005-01-02 23:07:31 +00:00
Chris Lattner
ad63a0d6a4 Fix a FIXME: Select instructions on longs were miscompiled.
While we're at it, improve codegen of select instructions.  For this
testcase:

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

We used to generate this code:

_test:
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        b .LBB_test_3   ;
.LBB_test_2:    ;
        or r5, r4, r4
.LBB_test_3:    ;
        or r3, r5, r5
        blr

Now we emit:

_test:
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        or r4, r5, r5
.LBB_test_2:    ;
        or r3, r4, r4
        blr

-Chris

llvm-svn: 19214
2005-01-01 16:10:12 +00:00
Chris Lattner
cea3ae9792 Specify all of the targets built.
llvm-svn: 18985
2004-12-16 17:26:44 +00:00
Chris Lattner
a0561d43b2 Factor out common .td file chunks.
llvm-svn: 18982
2004-12-16 16:31:57 +00:00
Chris Lattner
9f0237ca85 Fix Regression/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll, and all programs
when compiled with debug information.

llvm-svn: 18835
2004-12-12 20:36:19 +00:00
Chris Lattner
dc33000e67 CSE calls to getTypeSize.
llvm-svn: 18833
2004-12-12 20:31:00 +00:00
Chris Lattner
6131b06f73 Use the target triple to pick this target.
llvm-svn: 18830
2004-12-12 17:40:28 +00:00
Chris Lattner
2231d21dad Fix several bugs in 'op x, imm' handling. Foremost is that we now emit
addi r3, r3, -1
instead of
   addi r3, r3, 1

for 'sub int X, 1'.

Secondarily, this fixes several cases where we could crash given an unsigned
constant.  And fixes a couple of minor missed optimization cases, such as
xor X, ~0U -> not X

llvm-svn: 18379
2004-11-30 07:30:20 +00:00
Chris Lattner
1e093bfb2b Fix CodeGen/PowerPC/2004-11-30-shr-var-crash.ll
llvm-svn: 18376
2004-11-30 06:40:04 +00:00
Chris Lattner
629965fbe0 Fix test/Regression/CodeGen/PowerPC/2004-11-29-ShrCrash.ll
llvm-svn: 18374
2004-11-30 06:36:11 +00:00
Chris Lattner
23a2a6e5d3 Fix test/Regression/CodeGen/PowerPC/2004-11-30-shift-crash.ll
llvm-svn: 18371
2004-11-30 06:29:10 +00:00
Chris Lattner
1de5cd0fd0 The LLVM bool type shall have 1 byte alignment on PPC.
llvm-svn: 18311
2004-11-28 21:16:45 +00:00
Nate Begeman
6048139b1f Remove the ISel->AsmPrinter link via the TargetMachine that was put in
place to help bring up the PowerPC back end on Darwin.  This code is no
longer serves any purpose now that the AsmPrinter does the right thing
all the time printing GlobalValues.  --Cruft.

llvm-svn: 18267
2004-11-27 04:45:11 +00:00
Chris Lattner
47987cf373 There is no reason to store <x,x>, just store <x>.
llvm-svn: 18263
2004-11-26 20:25:17 +00:00
Nate Begeman
6405f5e9b3 Enable optimization suggested by Chris Lattner to not emit reloc stubs for
static global variables whose addresses are taken.  This allows us to
convert the following code for taking the address of a static function foo

        addis r2, r30, ha16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb")
        lwz r3, lo16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb")(r2)

which also includes linker stub code emitted at the end of the .s file not
shown here, and replace it with this:

        addis r2, r30, ha16(l1__2E_foo_2-"L00001$pb")
        la r3, lo16(l1__2E_foo_2-"L00001$pb")(r2)

which in addition to not needing linker help, also has no load instruction.
For those not up on PowerPC mnemonics, la is shorthand for add immediate.

llvm-svn: 18239
2004-11-25 07:09:01 +00:00
Chris Lattner
98ddaa680d Fix the build on non ppc machines
llvm-svn: 18235
2004-11-25 06:14:45 +00:00
Chris Lattner
026387ccbc The JIT works enough
llvm-svn: 18228
2004-11-25 04:14:54 +00:00
Chris Lattner
671d625e17 Fix encoding of fsel, fixing olden/power, McCat/bisort and several others.
All of Olden passes now! :)

llvm-svn: 18227
2004-11-25 04:11:07 +00:00
Chris Lattner
1f6882a401 Fix encoding of fneg instruction
llvm-svn: 18226
2004-11-25 03:53:44 +00:00
Chris Lattner
1a5a39e9ec Fix encoding of swari, fixing several programs, including Olden/mst
llvm-svn: 18225
2004-11-25 03:40:20 +00:00
Chris Lattner
01269e6ad3 There is not a 1-1 mappign between llvm blocks and PPC blocks, do not use
LLVM blocks as the keys for the branch rewriter.  This fixes treeadd and
many other programs with the JIT.

llvm-svn: 18223
2004-11-25 00:33:57 +00:00
Chris Lattner
ebbfaa3db8 * Rename existing relocations to be more specific
* Add relocations for refernces to non-lazy darwin stubs and implement
  them correctly.

With this change, we can correctly references external globals, and now
all but two UnitTests and all but 1 Regression/C tests pass.

More importantly, bugpoint-jit will start giving us useful testcases,
instead of always telling us that references to external globals don't
work :)

llvm-svn: 18222
2004-11-24 22:30:08 +00:00
Nate Begeman
e9b752c4e3 Add the same optimization that we do loading from fixed alloca slots to
storing to fixed alloca slots.

llvm-svn: 18221
2004-11-24 21:53:14 +00:00
Chris Lattner
4b48c12388 Write CompilationCallback as an explicit assembly stub to avoid getting GCC's
prolog.

llvm-svn: 18220
2004-11-24 21:01:46 +00:00
Chris Lattner
961fae4d82 When rewriting the original call instruction, make sure to rewrite it to
call the right address.

llvm-svn: 18213
2004-11-24 18:00:02 +00:00
Chris Lattner
8cd0215f14 Force the intregs ptr into R2 and the FPregs ptr into R3. This fixes a really
obscure problem where we were doing:

lmw     r3,0(r9)

which is undefined on PPC.  Now we do:

lmw     r3,0(r2)

by force, not relying on the GCC register allocator for luck :)

llvm-svn: 18212
2004-11-24 17:42:55 +00:00
Chris Lattner
de6bb17359 Fix a few more tests by encoding the extsb and other XForm11 instructions
correctly.

llvm-svn: 18200
2004-11-24 03:52:02 +00:00
Chris Lattner
338b1b4634 Fix the encoding of ORi and other DForm4 instructions. This brings us to
36/42 SingleSource/UnitTests passing!

llvm-svn: 18199
2004-11-24 02:15:41 +00:00
Chris Lattner
2c1b140d62 Loads are relocatable too
llvm-svn: 18198
2004-11-24 02:03:44 +00:00