Commit Graph

15091 Commits

Author SHA1 Message Date
Chris Lattner 257b284038 Hrm, some people complain when the compiler cheerfully tells them what it's
doing... I guess they're right.

llvm-svn: 17142
2004-10-19 06:33:16 +00:00
Misha Brukman 648ad57b85 Fix some grammar
llvm-svn: 17141
2004-10-19 05:55:54 +00:00
Misha Brukman 65af14766f If we're going to make the braces of functions line up for ease of readability
and aesthetic reasons, might as well finish the job

llvm-svn: 17140
2004-10-19 05:50:34 +00:00
Misha Brukman 471400c09b Remove unnecessary spaces in function signature
llvm-svn: 17139
2004-10-19 05:49:46 +00:00
Brian Gaeke f3499acc16 Simplify mapping info generation. In particular, the LLVM-to-MachineInstr map
is no longer emitted, and we do not reference any MachineCodeForInstruction
information.

llvm-svn: 17138
2004-10-19 05:15:21 +00:00
Misha Brukman fc62cd1a85 * Fit constructor initializer on a single line
* Delete blank chars at end of line to fit into 80 cols

llvm-svn: 17137
2004-10-19 00:29:16 +00:00
Reid Spencer 6a11a75f31 Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Misha Brukman 9cba8b39be Move code to redefine INT64_{MIN,MAX} on AIX/PowerPC to a separate header,
because #undef becomes commented out in DataTypes.h.in due to autoheader

llvm-svn: 17135
2004-10-18 22:14:48 +00:00
Nate Begeman b18121e6a9 Initial implementation of the strength reduction for GEP instructions in
loops.  This optimization is not turned on by default yet, but may be run
with the opt tool's -loop-reduce flag.  There are many FIXMEs listed in the
code that will make it far more applicable to a wide range of code, but you
have to start somewhere :)

This limited version currently triggers on the following tests in the
MultiSource directory:
pcompress2: 7 times
cfrac: 5 times
anagram: 2 times
ks: 6 times
yacr2: 2 times

llvm-svn: 17134
2004-10-18 21:08:22 +00:00
Misha Brukman 947cd4569f * AIX on Power defines INT64_MIN and INT64_MAX in ways that annoy GCC, so
special-case those definitions
* Add comments in #ifdef/#else/#endif clauses for ease of reading

llvm-svn: 17132
2004-10-18 18:35:21 +00:00
Misha Brukman 22cf52374e AIX does not have mkdtemp() so emulate its behavior using mktemp() and mkdir()
llvm-svn: 17131
2004-10-18 17:39:45 +00:00
Chris Lattner c1f91b5e11 Fix miscompilations in the SparcV9 backend that were induced by this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041011/019311.html

llvm-svn: 17130
2004-10-18 17:19:20 +00:00
Chris Lattner fbc070bfdc Improve compatibility with VC++, patch contributed by Morten Ofstad!
llvm-svn: 17126
2004-10-18 15:54:17 +00:00
Chris Lattner 88a8a329c3 Get this file compiling with VC++, patch contributed by Morten Ofstad. Thanks Morten!
llvm-svn: 17125
2004-10-18 15:43:46 +00:00
Reid Spencer 69274ad96a Declare a function in the correct namespace.
Patch contributed by Morten Ofstad. Thanks Morten!

llvm-svn: 17124
2004-10-18 14:43:45 +00:00
Reid Spencer ce0783318b Correction to allow compilation with Visual C++.
Patch contributed by Morten Ofstad. Thanks Morten!

llvm-svn: 17123
2004-10-18 14:38:48 +00:00
Chris Lattner 5edb2f32d0 Simplify code by deleting instructions that preceed unreachable instructions.
Simplify code by simplifying terminators that branch to blocks that start
with an unreachable instruction.

llvm-svn: 17116
2004-10-18 04:07:22 +00:00
Chris Lattner 033e156b54 New testcase
llvm-svn: 17115
2004-10-18 04:06:41 +00:00
Reid Spencer 1be07bb526 Actually link all the analysis passes and their dependencies.
llvm-svn: 17114
2004-10-18 03:32:12 +00:00
Reid Spencer e5068ed336 Remove extra comma.
llvm-svn: 17113
2004-10-18 03:26:21 +00:00
Reid Spencer 2097b94c8b Actually link in all the analysis passes.
llvm-svn: 17112
2004-10-18 03:22:48 +00:00
Chris Lattner a67dd32004 Turn store -> null/undef into the LLVM unreachable instruction! This simple
change hacks off 10K of bytecode from perlbmk (.5%) even though the front-end
is not generating them yet and we are not optimizing the resultant code.
This isn't too bad.

llvm-svn: 17111
2004-10-18 03:00:50 +00:00
Chris Lattner 8ba9ec9bbb Turn things with obviously undefined semantics into 'store -> null'
llvm-svn: 17110
2004-10-18 02:59:09 +00:00
Chris Lattner 3b92f17165 My friend the invoke instruction does not dominate all basic blocks if it
occurs in the entry node of a function

llvm-svn: 17109
2004-10-18 01:48:31 +00:00
Chris Lattner 34ae670706 Fix a bug that occurs when the constant value is the result of an invoke. In
particular, invoke ret values are only live in the normal dest of the invoke
not in the unwind dest.

llvm-svn: 17108
2004-10-18 01:21:17 +00:00
Chris Lattner 53058663aa Print a semicolon for the unreacahble instruction. This fixes problems
where C requires semicolons in some cases to indicate null statements.

llvm-svn: 17107
2004-10-17 23:49:11 +00:00
Chris Lattner 6a792feb02 Getting ADCE to interact well with unreachable instructions seems like a nontrivial
exercise that I'm not interested in tackling right now.  Just punt and treat them
like unwind's.

This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll

llvm-svn: 17106
2004-10-17 23:45:06 +00:00
Chris Lattner 61011accfd New testcase that ADCE shouldn't crash on
llvm-svn: 17105
2004-10-17 23:44:02 +00:00
Chris Lattner 6e79e55aea Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll
If a function had no return instruction in it, and the result of the inlined
call instruction was used, we would crash.

llvm-svn: 17104
2004-10-17 23:21:07 +00:00
Chris Lattner 5f8becb224 New testcase that crashes the inliner
llvm-svn: 17103
2004-10-17 23:20:29 +00:00
Nate Begeman e5e5b37b79 Pass -single_module option to gcc when linking dynamic libraries for use with bugpoint, so that we can bugpoint multiple .cp files
llvm-svn: 17102
2004-10-17 23:03:32 +00:00
Nate Begeman 844186b8b4 Generate correct stubs for weak-linked symbols
llvm-svn: 17101
2004-10-17 23:01:34 +00:00
Chris Lattner f60137501f fold gep undef, ... -> undef
This comes up many times in perlbmk and probably others.

llvm-svn: 17100
2004-10-17 21:54:55 +00:00
Chris Lattner 107c15c33d Remove printout, realize that instructions in the entry block dominate all
other blocks.

llvm-svn: 17099
2004-10-17 21:31:34 +00:00
Chris Lattner 215c7ebaa6 When inserting PHI nodes, don't insert any phi nodes that are obviously
unneccesary.  This allows us to delete several hundred phi nodes of the
form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well.

This implements Mem2Reg/UndefValuesMerge.ll

llvm-svn: 17098
2004-10-17 21:25:56 +00:00
Chris Lattner d047673192 New testcase, no PHI should be inserted.
llvm-svn: 17097
2004-10-17 21:25:32 +00:00
Chris Lattner 96db59e48a Enhance hasConstantValue to ignore undef values in phi nodes. This allows it
to think that PHI[4, undef] == 4.

llvm-svn: 17096
2004-10-17 21:23:26 +00:00
Chris Lattner e29d634a94 hasConstantValue will soon return instructions that don't dominate the PHI node,
so prepare for this.

llvm-svn: 17095
2004-10-17 21:22:38 +00:00
Chris Lattner 621c413a1b The first hunk corrects a bug when printing undef null values. We would print
0->field, which is illegal.  Now we print ((foo*)0)->field.

The second hunk is an optimization to not print undefined phi values.

llvm-svn: 17094
2004-10-17 17:48:59 +00:00
Chris Lattner 068555314b Don't print stuff out from the code generator. This broke the JIT horribly
last night. :)  bork!

llvm-svn: 17093
2004-10-17 17:40:50 +00:00
Reid Spencer cb13f6e51f Add HAVE_BZLIB_H and HAVE_ZLIB_H tests.
llvm-svn: 17092
2004-10-17 17:07:29 +00:00
Reid Spencer c1f295a66c Update to reflect building zlib for LLVM
llvm-svn: 17091
2004-10-17 15:02:47 +00:00
Reid Spencer 6889cc2d74 Add missing targets for install/clean
llvm-svn: 17090
2004-10-17 15:01:59 +00:00
Reid Spencer f476d84b69 Make the library name SparcV9 specific
llvm-svn: 17089
2004-10-17 15:01:12 +00:00
Reid Spencer b7c9d5444b Consolidate the definitions
llvm-svn: 17088
2004-10-17 15:00:26 +00:00
Reid Spencer de028a4a69 PPC32GenCodeEmitter instead of PowerPCGenCodeEmitter
llvm-svn: 17087
2004-10-17 14:59:38 +00:00
Reid Spencer 85f1cd7893 Add runtime directories
llvm-svn: 17086
2004-10-17 14:58:49 +00:00
Reid Spencer 60be648481 Support bytecode generation, GenCodeEmitter, etc.
llvm-svn: 17085
2004-10-17 14:57:12 +00:00
Reid Spencer c833b76f00 Add runtime directory, include Makefile_rules
llvm-svn: 17084
2004-10-17 14:56:15 +00:00
Chris Lattner 839abf57a6 Rewrite support for cast uint -> FP. In particular, we used to compile this:
double %test(uint %X) {
        %tmp.1 = cast uint %X to double         ; <double> [#uses=1]
        ret double %tmp.1
}

into:

test:
        sub %ESP, 8
        mov %EAX, DWORD PTR [%ESP + 12]
        mov %ECX, 0
        mov DWORD PTR [%ESP], %EAX
        mov DWORD PTR [%ESP + 4], %ECX
        fild QWORD PTR [%ESP]
        add %ESP, 8
        ret

... which basically zero extends to 8 bytes, then does an fild for an
8-byte signed int.

Now we generate this:


test:
        sub %ESP, 4
        mov %EAX, DWORD PTR [%ESP + 8]
        mov DWORD PTR [%ESP], %EAX
        fild DWORD PTR [%ESP]
        shr %EAX, 31
        fadd DWORD PTR [.CPItest_0 + 4*%EAX]
        add %ESP, 4
        ret

        .section .rodata
        .align  4
.CPItest_0:
        .quad   5728578726015270912

This does a 32-bit signed integer load, then adds in an offset if the sign
bit of the integer was set.

It turns out that this is substantially faster than the preceeding sequence.
Consider this testcase:

unsigned a[2]={1,2};
volatile double G;

void main() {
    int i;
    for (i=0; i<100000000; ++i )
        G += a[i&1];
}

On zion (a P4 Xeon, 3Ghz), this patch speeds up the testcase from 2.140s
to 0.94s.

On apoc, an athlon MP 2100+, this patch speeds up the testcase from 1.72s
to 1.34s.

Note that the program takes 2.5s/1.97s on zion/apoc with GCC 3.3 -O3
-fomit-frame-pointer.

llvm-svn: 17083
2004-10-17 08:01:28 +00:00
Chris Lattner 112fd88a05 Unify handling of constant pool indexes with the other code paths, allowing
us to use index registers for CPI's

llvm-svn: 17082
2004-10-17 07:49:45 +00:00
Chris Lattner af19d396ac Give the asmprinter the ability to print memrefs with a constant pool index,
index reg and scale

llvm-svn: 17081
2004-10-17 07:16:32 +00:00
Chris Lattner 653d8663fe fold:
%X = and Y, constantint
  %Z = setcc %X, 0

instead of emitting:

        and %EAX, 3
        test %EAX, %EAX
        je .LBBfoo2_2   # UnifiedReturnBlock

We now emit:

        test %EAX, 3
        je .LBBfoo2_2   # UnifiedReturnBlock

This triggers 581 times on 176.gcc for example.

llvm-svn: 17080
2004-10-17 06:10:40 +00:00
Chris Lattner e234a21488 All of these labels are off by one now that the unreachable instruction exists
llvm-svn: 17079
2004-10-17 05:37:47 +00:00
Nate Begeman 2c873ca365 Implement bitfield insert by recognizing the following pattern:
1. optional shift left
2. and x, immX
3. and y, immY
4. or z, x, y
==> rlwimi z, x, y, shift, mask begin, mask end

where immX == ~immY and immX is a run of set bits. This transformation
fires 32 times on voronoi, once on espresso, and probably several
dozen times on external benchmarks such as gcc.

To put this in terms of actual code generated for
struct B { unsigned a : 3; unsigned b : 2; };
void storeA (struct B *b, int v) { b->a = v;}
void storeB (struct B *b, int v) { b->b = v;}

Old:
_storeA:
        rlwinm r2, r4, 0, 29, 31
        lwz r4, 0(r3)
        rlwinm r4, r4, 0, 0, 28
        or r2, r4, r2
        stw r2, 0(r3)
        blr

_storeB:
        rlwinm r2, r4, 3, 0, 28
        rlwinm r2, r2, 0, 27, 28
        lwz r4, 0(r3)
        rlwinm r4, r4, 0, 29, 26
        or r2, r2, r4
        stw r2, 0(r3)
        blr

New:
_storeA:
        lwz r2, 0(r3)
        rlwimi r2, r4, 0, 29, 31
        stw r2, 0(r3)
        blr

_storeB:
        lwz r2, 0(r3)
        rlwimi r2, r4, 3, 27, 28
        stw r2, 0(r3)
        blr

llvm-svn: 17078
2004-10-17 05:19:20 +00:00
Chris Lattner 192eaccc1a Fix constant folding relational operators with undef operands.
llvm-svn: 17077
2004-10-17 04:01:51 +00:00
Chris Lattner 0e4818c99a Reid added --version to the CommandLine lib. Don't conflict with it.
llvm-svn: 17076
2004-10-17 02:49:08 +00:00
Chris Lattner f6666db032 I forgot that sparc no longer uses the shared asmwriter. Give it support
for undef.

llvm-svn: 17075
2004-10-17 02:44:45 +00:00
Chris Lattner 37b138a00b Add support for unreachable and undef
llvm-svn: 17074
2004-10-17 02:42:42 +00:00
Reid Spencer 94ffa656eb Initial Makefile.am for building with automake
llvm-svn: 17073
2004-10-17 00:24:24 +00:00
Reid Spencer 3d99608cc4 Initial Makefile.am for building with automake.
llvm-svn: 17072
2004-10-17 00:20:42 +00:00
Reid Spencer c0ec7a65a6 Make sure that for systems where the string functions are actually macros
that we undefine the macro before using its name in the definition. This
can happen on Linux if _GNU_SOURCE is defined.

llvm-svn: 17071
2004-10-17 00:17:54 +00:00
Chris Lattner fd7bf724d3 Implement constant folding of undef values.
llvm-svn: 17070
2004-10-16 23:31:32 +00:00
Chris Lattner 67f0545daf Fix a type violation
llvm-svn: 17069
2004-10-16 23:28:04 +00:00
Nate Begeman 29dc5f2a3e Finally fix one of the oldest FIXMEs in the PowerPC backend: correctly
flag rotate left word immediate then mask insert (rlwimi) as a two-address
instruction, and update the ISel usage of the instruction accordingly.

This will allow us to properly schedule rlwimi, and use it to efficiently
codegen bitfield operations.

llvm-svn: 17068
2004-10-16 20:43:38 +00:00
Chris Lattner 684c5c6587 Kill the bogon that slipped into my buffer before I committed.
llvm-svn: 17067
2004-10-16 19:46:33 +00:00
Chris Lattner 6580e09fef Implement InstCombine/getelementptr.ll:test9, which is the source of many
ugly and giant constnat exprs in some programs.

llvm-svn: 17066
2004-10-16 19:44:59 +00:00
Chris Lattner d2c8ed1170 New testcase, rework testcases to fail if there are any gep's other than those
involving %B instead of allowing any geps except %A's.

llvm-svn: 17065
2004-10-16 19:44:23 +00:00
Misha Brukman bbd150eaa7 * Add a space between words
* Wrap at 80 cols

llvm-svn: 17064
2004-10-16 19:13:58 +00:00
Chris Lattner eba3f46b2f Do not erroneously accept revision 6 bytecode files when the format hasn't
been defined yet!

llvm-svn: 17063
2004-10-16 18:56:02 +00:00
Chris Lattner 552663387b Update release notes
llvm-svn: 17062
2004-10-16 18:35:57 +00:00
Chris Lattner 17ce82f71d New testcase
llvm-svn: 17061
2004-10-16 18:28:01 +00:00
Chris Lattner 5a02a3e963 Add support for undef and unreachable
llvm-svn: 17059
2004-10-16 18:24:35 +00:00
Chris Lattner aef20fbbb9 testcases for undefined and unreachable
llvm-svn: 17058
2004-10-16 18:24:11 +00:00
Chris Lattner fcfe78eaf8 Fix fix fix
llvm-svn: 17057
2004-10-16 18:21:50 +00:00
Chris Lattner 98e541457b Add support for unreachable
llvm-svn: 17056
2004-10-16 18:21:33 +00:00
Chris Lattner 61753bf847 Add support for undef
llvm-svn: 17055
2004-10-16 18:19:26 +00:00
Chris Lattner 770709befe Add support for undef, unreachable, and function flags
llvm-svn: 17054
2004-10-16 18:18:16 +00:00
Chris Lattner 4ff314968e Parse undef and unreachable
llvm-svn: 17053
2004-10-16 18:17:13 +00:00
Chris Lattner 2978437b76 Add support
llvm-svn: 17052
2004-10-16 18:16:19 +00:00
Chris Lattner ea9a85abe4 Add support for undef and unreachable
llvm-svn: 17051
2004-10-16 18:14:10 +00:00
Chris Lattner a3f3c8a1ad ADd support for undef and unreachable
llvm-svn: 17050
2004-10-16 18:13:47 +00:00
Chris Lattner e4bea062c7 Teach the X86 backend about unreachable and undef. Among other things, we
now compile:

'foo() {}' into "ret" instead of "mov EAX, 0; ret"

llvm-svn: 17049
2004-10-16 18:13:05 +00:00
Chris Lattner 583dfdcf86 Add support for unreachable and undef
llvm-svn: 17048
2004-10-16 18:12:13 +00:00
Chris Lattner 81a7a23494 Optimize instructions involving undef values. For example X+undef == undef.
llvm-svn: 17047
2004-10-16 18:11:37 +00:00
Chris Lattner 7e6d4a12b5 Add support for UndefValue
llvm-svn: 17046
2004-10-16 18:10:31 +00:00
Chris Lattner c0e2e82477 When promoting mem2reg, make uninitialized values become undef isntead of 0.
llvm-svn: 17045
2004-10-16 18:10:06 +00:00
Chris Lattner 646354bae1 Handle undef values as undefined on the constant lattice
ignore unreachable instructions

llvm-svn: 17044
2004-10-16 18:09:41 +00:00
Chris Lattner 6ac3ef950d Add note
llvm-svn: 17043
2004-10-16 18:09:25 +00:00
Chris Lattner 8e71c6a33d Add support for the undef value. Implement a new optimization based on globals
that are initialized with undef.  When promoting malloc to a global, start out
initialized to undef

llvm-svn: 17042
2004-10-16 18:09:00 +00:00
Chris Lattner 5e0b9f2eec Add support for undef and unreachable
llvm-svn: 17041
2004-10-16 18:08:06 +00:00
Chris Lattner d5f67d8ca6 Implement UndefValue class
llvm-svn: 17040
2004-10-16 18:07:16 +00:00
Chris Lattner 38a6969894 Add support for the unreachable instruction
llvm-svn: 17039
2004-10-16 18:06:43 +00:00
Chris Lattner bcf508cf6f Add new UndefValueVal type
llvm-svn: 17038
2004-10-16 18:06:07 +00:00
Chris Lattner 3384f9ad40 Add new UnreachableInst class
llvm-svn: 17037
2004-10-16 18:05:54 +00:00
Chris Lattner 278e1dab8e Add new unreachable instruction
llvm-svn: 17036
2004-10-16 18:05:37 +00:00
Chris Lattner 9d4d20b71c Add new UndefValue class
llvm-svn: 17035
2004-10-16 18:05:25 +00:00
Chris Lattner d57b37d1fa UndefValue's are constants
llvm-svn: 17034
2004-10-16 18:05:10 +00:00
Chris Lattner 08b7d5b032 Document unreachable instruction
llvm-svn: 17033
2004-10-16 18:04:13 +00:00
Chris Lattner cd196a9444 Add missing 'Instruction Opcodes' bullet to TOC
Update for changes in LLVM 1.4 bytecode format.

llvm-svn: 17032
2004-10-16 18:03:55 +00:00
Chris Lattner 1a709646e7 Add a missing dependency
llvm-svn: 17031
2004-10-16 17:12:55 +00:00
Chris Lattner 947ecace14 Fix file header
llvm-svn: 17030
2004-10-16 16:37:42 +00:00
Chris Lattner 3c3e058406 Be more careful about looking for constants when we really want constantint's.
llvm-svn: 17029
2004-10-16 16:07:10 +00:00
Chris Lattner db6a9fdf38 None of these have actually been implemented yet.
llvm-svn: 17027
2004-10-16 00:29:30 +00:00
Chris Lattner f22be93428 Move the implementation of the instructions clone methods to this file so
that the vtables for these classes are only instantiated in this translation
unit, not in every xlation unit they are used.

llvm-svn: 17026
2004-10-15 23:52:53 +00:00
Chris Lattner a47839f165 Move the implementation of the clone method for these classes to
Instructions.cpp, so that a vtable is not emitted into every translation unit
that uses the classes.

llvm-svn: 17025
2004-10-15 23:52:05 +00:00
Misha Brukman b889b2ad97 Fix hyphenation and quoting style for great justice
llvm-svn: 17024
2004-10-15 23:22:48 +00:00
Chris Lattner c4f93ac159 There is no reason not to build these in parallel
llvm-svn: 17023
2004-10-15 23:22:15 +00:00
Misha Brukman 65c23ee5d3 Add a space between the type and name of value when printing error message
llvm-svn: 17022
2004-10-15 23:08:50 +00:00
Chris Lattner 0bc0f1d8de Don't print a bunch of metrics that are meaningless for external functions
llvm-svn: 17017
2004-10-15 19:40:31 +00:00
Chris Lattner cf809786dc Fix broken links
llvm-svn: 17016
2004-10-15 17:04:28 +00:00
Chris Lattner 15914416ec Instruction select globals with offsets better. For example, on this test
case:

int C[100];
int foo() {
  return C[4];
}

We now codegen:

foo:
        mov %EAX, DWORD PTR [C + 16]
        ret

instead of:

foo:
        mov %EAX, OFFSET C
        mov %EAX, DWORD PTR [%EAX + 16]
        ret

Other impressive features may be coming later.

This patch is contributed by Jeff Cohen!

llvm-svn: 17011
2004-10-15 05:05:29 +00:00
Chris Lattner 3b78938b9e Give the X86 JIT the ability to encode global+disp constants. Patch
contributed by Jeff Cohen!

llvm-svn: 17010
2004-10-15 04:53:13 +00:00
Chris Lattner 19025d5ad0 Give the X86 asm printer the ability to print out addressing modes that have
constant displacements from global variables.  Patch by Jeff Cohen!

llvm-svn: 17009
2004-10-15 04:44:53 +00:00
Chris Lattner df7b984f5a Allow X86 addressing modes to represent globals with offsets. Patch contributed
by Jeff Cohen!

llvm-svn: 17008
2004-10-15 04:43:20 +00:00
Chris Lattner 3065220deb Allow machine operands to represent global variables with offsets. This is
useful when you have a reference like:

int A[100];

void foo() { A[10] = 1; }

In this case, &A[10] is a single constant and should be treated as such.

Only MO_GlobalAddress and MO_ExternalSymbol are allowed to use this field, no
other operand type is.

This is another fine patch contributed by Jeff Cohen!!

llvm-svn: 17007
2004-10-15 04:38:41 +00:00
Chris Lattner 2152236351 This patch fixes the nasty bug that caused 175.vpr to fail for X86 last night.
The problem occurred when trying to reload this instruction:

MOV32mr %reg2326, 8, %reg2297, 4, %reg2295

The value of reg2326 was available in EBX, so it was reused from there, instead
of reloading it into EDX.

The value of reg2297 was available in EDX, so it was reused from there, instead
of reloading it into EDI.

The value of reg2295 was not available, so we tried reloading it into EBX, its
assigned register.  However, we checked and saw that we already reloaded
something into EBX, so we chose what reg2326 was assigned to (EDX) and reloaded
into that register instead.

Unfortunately EDX had already been used by reg2297, so reloading into EDX
clobbered the value used by the reg2326 operand, breaking the program.

The fix for this is to check that the newly picked register is ok.  In this
case we now find that EDX is already used and try using EDI, which succeeds.

llvm-svn: 17006
2004-10-15 03:19:31 +00:00
Chris Lattner 9af0572a37 This patch adds and improves debugging output. No functionality changes.
llvm-svn: 17005
2004-10-15 03:16:29 +00:00
Nate Begeman a15c246af9 Better codegen of binary integer ops with 32 bit immediate operands.
This transformation fires a few dozen times across the testsuite.

For example, int test2(int X) { return X ^ 0x0FF00FF0; }
Old:
_test2:
        lis r2, 4080
        ori r2, r2, 4080
        xor r3, r3, r2
        blr

New:
_test2:
        xoris r3, r3, 4080
        xori r3, r3, 4080
        blr

llvm-svn: 17004
2004-10-15 00:50:19 +00:00
Misha Brukman aa8f87c83c The field is called `imm22', not simply `imm'
llvm-svn: 17003
2004-10-14 22:33:32 +00:00
Misha Brukman b03f27c96c Synthetic instructions RET and RETL need to have all 3 parameters specified
llvm-svn: 17002
2004-10-14 22:32:49 +00:00
Misha Brukman b34fcdaa46 Class F2_1 already inherits the imm22 field from class F2
llvm-svn: 17001
2004-10-14 22:32:24 +00:00
Misha Brukman 7183fc3a84 Generate the SparcV8 code emitter from .td files
llvm-svn: 17000
2004-10-14 21:57:19 +00:00
Misha Brukman 98ebcd88f2 * In the F3_1 class, default asi to 0 because it's not currently used
* In the F3_3 class, remove mention of asi because it's not part of the format

llvm-svn: 16999
2004-10-14 21:53:39 +00:00
Misha Brukman 692979c1e2 * We don't use the ENABLE_*_JIT flags in the source base anymore
* Convert references to Sparc to SparcV9 to clearly identify CPU type

llvm-svn: 16998
2004-10-14 20:06:36 +00:00
Chris Lattner 5d33e8e73a Fix a bug John tracked down in libstdc++ where we were incorrectly deleting
weak functions.  Thanks for finding this John!

llvm-svn: 16997
2004-10-14 19:53:50 +00:00
Brian Gaeke 1f864b5583 Add FSTOI, FDTOI (fp to integer cast) instructions.
llvm-svn: 16996
2004-10-14 19:39:35 +00:00
Brian Gaeke 1519c24cff Rewrite emitCastOperation, refactoring parts of it into emitIntegerCast, and
adding emitFPToIntegerCast.

llvm-svn: 16995
2004-10-14 19:39:34 +00:00
Brian Gaeke 38a4dd3d15 Add list of libc procedures we'll use, at some point.
Update list of currently failing tests.
ADJCALLSTACK* support is done.

llvm-svn: 16994
2004-10-14 19:39:33 +00:00
Misha Brukman f9898d7189 Use the shared Makefile.JIT for JIT-enablement, which also enables the examples
to have the JIT functioning on more platforms than just x86

llvm-svn: 16993
2004-10-14 19:02:13 +00:00
Misha Brukman 7c169be339 Use the shared Makefile.JIT for JIT-enablement
llvm-svn: 16992
2004-10-14 19:01:25 +00:00
Misha Brukman c04ade7c4f Add Makefile.JIT to the list of Makefiles transferred to the build dir to give
tools and examples a simple way to JIT-enable themselves

llvm-svn: 16991
2004-10-14 18:59:42 +00:00
Misha Brukman e62f4dd7b9 Transfer Makefile.JIT into the build tree for JIT-enabling tools and examples
llvm-svn: 16990
2004-10-14 18:59:09 +00:00
Misha Brukman 68baa6a7a9 Since several tools and examples want JIT support, factor out the process of
adding the right libs for any given architecture's JIT into a single place

llvm-svn: 16989
2004-10-14 18:58:19 +00:00
Misha Brukman 9372c95fde Convert tabs to spaces
llvm-svn: 16988
2004-10-14 18:47:56 +00:00
Chris Lattner eb6b8e5772 Make sure any client of Dominators.h links in Dominators.cpp
Patch by Morten Ofstad

llvm-svn: 16987
2004-10-14 15:47:16 +00:00
Chris Lattner 36e629a3ea Make sure any client of Dominators.h links in Dominators.cpp
llvm-svn: 16986
2004-10-14 15:46:59 +00:00
Chris Lattner 52a126cb3e Do not use the same variable name for two different variables in the
same scope.  This confused VC++ (and probably people too!).  Patch by
Morten Ofstad!

llvm-svn: 16985
2004-10-14 14:59:16 +00:00
Chris Lattner 645d8c2863 Remove unneeded typedef, patch by Morten Ofstad
llvm-svn: 16984
2004-10-14 14:51:09 +00:00
Misha Brukman 1f596c3358 * Claim to support machine code emission - return false from
addPassesToEmitMachineCode()
* Add support for registers and constants in getMachineOpValue()

This enables running "int main() { ret 0 }" via the PowerPC JIT.

llvm-svn: 16983
2004-10-14 06:39:56 +00:00
Misha Brukman 789587f128 Enable the PowerPC JIT by compiling powerpc.o library into lli
llvm-svn: 16982
2004-10-14 06:35:11 +00:00
Misha Brukman 8b1bf4323f * Include the real (generated) version of getBinaryCodeForInstr()
* Add implementation of getMachineOpValue() for generated code emitter
* Convert assert()s in unimplemented functions to abort()s so that non-debug
  builds fail predictably
* Add file header comments

llvm-svn: 16981
2004-10-14 06:07:25 +00:00
Misha Brukman c2d6aaeaa0 * Make a PPC32-specific code emitter because we have separate classes for 32-
and 64-bit code emitters that cannot share code unless we use virtual
  functions
* Identify components being built by tablegen with more detail by assigning them
  to PowerPC, PPC32, or PPC64 more specifically; also avoids seeing 'building
  PowerPC XYZ' messages twice, where one is for PPC32 and one for PPC64

llvm-svn: 16980
2004-10-14 06:04:56 +00:00
Tanya Lattner d38a7605d8 Checking in code that works on my simple test case. However, there is still a bug with branches that I need to fix.
llvm-svn: 16979
2004-10-14 06:04:28 +00:00
Misha Brukman 189f3dc8d2 There is only one field in an instruction, and that is `Inst', the final view of
the instruction binary format, all others are simply operands and should not
have the `field' label

llvm-svn: 16978
2004-10-14 05:55:37 +00:00
Misha Brukman d6ac8f5e5a PowerPC instruction definitions use LittleEndian-style encoding [0..31]
llvm-svn: 16977
2004-10-14 05:54:38 +00:00
Misha Brukman dba1f62eb8 Add isLittleEndianEncoding to InstrInfo class, defaults to `off'
llvm-svn: 16976
2004-10-14 05:53:40 +00:00
Misha Brukman 8393c15b28 * Factor out (into new fn) a loop emitting operand shifts into the instruction
* Reverse instruction bit components for a LittleEndian-style encoding
* Fix some comments and spacing

llvm-svn: 16975
2004-10-14 05:53:01 +00:00
Misha Brukman 243ded5e1a * Add option to read isLittleEndianEncoding for InstrInfo classes
* Doxygen-ify some function comments

llvm-svn: 16974
2004-10-14 05:50:43 +00:00
Chris Lattner 45c35b1d1f When converting phi nodes into select instructions, we shouldn't promote PHI
nodes unless we KNOW that we are able to promote all of them.

This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll

llvm-svn: 16973
2004-10-14 05:13:36 +00:00
Chris Lattner 6299141c4e When converting phi nodes into select instructions, we shouldn't promote PHI
nodes unless we KNOW that we are able to promote all of them.  In this case
promoting the phi to a select is silly because we will always have to do the
call conditionally.  As such, select promotion is actually a pessimization.

llvm-svn: 16972
2004-10-14 05:12:50 +00:00
Reid Spencer 69812714cd Allow this file to compile on Darwin.
llvm-svn: 16971
2004-10-14 03:33:25 +00:00
Reid Spencer 37d4d6b2a2 Use __MINGW instead of __MING. Patch contributed by Henrik Bach.
llvm-svn: 16970
2004-10-14 03:09:02 +00:00
Reid Spencer 2f5fd88036 Get proper BSD #includes for MappedFile implementation.
llvm-svn: 16969
2004-10-14 03:06:59 +00:00
Reid Spencer 9cb9354d17 Implementation of MappedFile for Win32. Patch provided by Jeff Cohen.
llvm-svn: 16968
2004-10-14 03:05:59 +00:00
Chris Lattner 9a0e2546a0 Today is not my day. Fix broken #
llvm-svn: 16967
2004-10-14 02:31:35 +00:00
Chris Lattner bff972d453 unbreak previous checkin :(
llvm-svn: 16966
2004-10-14 02:06:48 +00:00
Chris Lattner e8fe2c2418 Add back a missing paren
llvm-svn: 16965
2004-10-14 01:57:28 +00:00
Chris Lattner 315157df62 Fit to 80 cols
llvm-svn: 16964
2004-10-14 01:49:34 +00:00
Chris Lattner 3d98008553 Wrap to 80 cols, delete some seriously old debugging printouts
llvm-svn: 16963
2004-10-14 01:46:07 +00:00
Chris Lattner da6a885076 Fit in 80 columns
llvm-svn: 16962
2004-10-14 01:39:18 +00:00
Chris Lattner eddbc20e2e Minor cleanups
llvm-svn: 16961
2004-10-14 01:35:17 +00:00
Chris Lattner ac1a547a38 Patch to make VS happier, thanks to Morten Ofstad for pointing this out.
llvm-svn: 16956
2004-10-13 15:25:46 +00:00
Chris Lattner 6017d47064 Use explicit std:: qualification to avoid relying on Koenig lookup, which
VC++ does not do properly.  Thanks to Morten Ofstad for the patch!

llvm-svn: 16955
2004-10-13 15:11:23 +00:00
Chris Lattner 36fca705b1 Get rid of template templates that were preventing VC from compiling the
set_intersect template.  Thanks to Morten Ofstad and Jeff Cohen for the
patch!

llvm-svn: 16954
2004-10-13 15:09:21 +00:00
Reid Spencer def9848a6c Changes for automake.
llvm-svn: 16953
2004-10-13 11:56:07 +00:00
Reid Spencer d385a67c44 Set up BUILD_MODE based on the configuration so the default build mode
is established from configuration. Also, don't make the ENABLE_ options
AM_CONDITIONALs.

llvm-svn: 16952
2004-10-13 11:53:12 +00:00
Reid Spencer 26bfe011f8 Updates for changes in Makefile rules.
llvm-svn: 16951
2004-10-13 11:48:50 +00:00
Reid Spencer ace94df71f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer 5b240ad1d9 Get rid of the horrendous FIND_PATH macro, have libs and progs linked into
a common directory for simplicity. Provide an easy way to relink some
objects

llvm-svn: 16949
2004-10-13 11:39:51 +00:00
Chris Lattner b15f04623b Update doco, make doxygen more, use standard dividers.
llvm-svn: 16948
2004-10-13 04:44:53 +00:00
Misha Brukman ac00eb4eb6 Save Reid's notes from bugzilla on the proper procedure to upgrade libtool
llvm-svn: 16947
2004-10-13 01:07:55 +00:00
Reid Spencer 946085840c Resolution to PR451.
llvm-svn: 16946
2004-10-13 01:01:03 +00:00
Reid Spencer 5fcd5c70ca Changes for libtool 1.5.10
llvm-svn: 16945
2004-10-13 00:51:45 +00:00
Reid Spencer 2c1c1c46a9 Update for libtool 1.5.10
llvm-svn: 16944
2004-10-13 00:19:25 +00:00
Reid Spencer d65d4d0b14 Harden the version requirements to the set that actually works after three
days of trying to figure it out. Despite some developer's penchant for
relaxing the tool versions, this just isn't possible. Only certain versions
work with certain other versions.

llvm-svn: 16943
2004-10-13 00:18:58 +00:00
Misha Brukman 89f77bce58 Fix file comment header
llvm-svn: 16942
2004-10-12 21:48:02 +00:00
Misha Brukman bf24de0939 On second thought, OpaqueType is not really a good first-class type.
llvm-svn: 16941
2004-10-12 20:35:04 +00:00
Misha Brukman dfd7ada4a2 No space allowed between \ and end-of-line
llvm-svn: 16940
2004-10-12 19:17:11 +00:00
Misha Brukman 25754a7703 Wrap lines at 80 cols
llvm-svn: 16939
2004-10-12 18:35:57 +00:00
Chris Lattner 92e37e092c Add comment
llvm-svn: 16937
2004-10-12 17:08:44 +00:00
Misha Brukman 0338401147 Opaque types are considered to be first-class.
llvm-svn: 16936
2004-10-12 17:06:17 +00:00
Chris Lattner 5499551206 Don't emit the method into the llvm namespace, let the #includer decide where it goes
llvm-svn: 16934
2004-10-12 16:21:18 +00:00
Chris Lattner cfa7268e20 Add std:: prefix for compilers without correct koenig lookup implemented.
Patch contributed by Paolo Invernizzi

llvm-svn: 16933
2004-10-12 16:10:39 +00:00
Chris Lattner 00648e1f86 Transform memmove -> memcpy when the source is obviously constant memory.
llvm-svn: 16932
2004-10-12 04:52:52 +00:00
Chris Lattner c14504c92c New testcase for memmove -> memcpy transform
llvm-svn: 16931
2004-10-12 04:51:55 +00:00
Chris Lattner db6ddca8d2 Right, calls have Operand#0 == the called function, don't forget this.
llvm-svn: 16930
2004-10-12 04:45:20 +00:00
Chris Lattner 1ccab843e2 Minor tweaks
llvm-svn: 16929
2004-10-12 04:32:37 +00:00
Chris Lattner 2b33e70e7f New header. Classes can be added as needed.
llvm-svn: 16928
2004-10-12 04:20:46 +00:00
Chris Lattner 89046ca244 Implement a new method
llvm-svn: 16927
2004-10-12 04:20:25 +00:00
Chris Lattner ec901cc6cd This nutty patch has been in my tree since before 1.3 went out, and it needs
to go in.  This patch allows us to compute the trip count of loops controlled
by values loaded from constant arrays.  The cannonnical example of this is
strlen when passed a constant argument:

for (int i = 0; "constantstring"[i]; ++i) ;
return i;

In this case, it will compute that the loop executes 14 times, which means
that the exit value of i is 14.  Because of this, the loop gets DCE'd and
we are happy.  This also applies to anything that does similar things, e.g.
loops like this:

  const float Array[] = { 0.1, 2.1, 3.2, 23.21 };
  for (int i = 0; Array[i] < 20; ++i)

and is actually fairly general.

The problem with this is that it almost never triggers.  The reason is that
we run indvars and the loop optimizer only at compile time, which is before
things like strlen and strcpy have been inlined into the program from libc.
Because of this, it almost never is used (it triggers twice in specint2k).

I'm committing it because it DOES work, may be useful in the future, and
doesn't slow us down at all.  If/when we start running the loop optimizer
at link-time (-O4?) this will be very nice indeed :)

llvm-svn: 16926
2004-10-12 01:49:27 +00:00
Chris Lattner 7cabf6f87a Fix a REALLY obscure bug in my previous checkin, which was splicing the END
marker from one ilist into the middle of another basic block!

llvm-svn: 16925
2004-10-12 01:02:29 +00:00
Chris Lattner 9776f7259b Handle a common case more carefully. In particular, instead of transforming
pointer recurrences into expressions from this:

  %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ]
  %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1            ; <sbyte*> [#uses=2]

into this:

  %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec

Actually create something nice, like this:

  %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec

llvm-svn: 16924
2004-10-11 23:06:50 +00:00
Chris Lattner 13128ab8fb Allow creation of GEP constantexprs with a vector of value* operands as
well as a vector of constant*'s.  It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.

llvm-svn: 16923
2004-10-11 22:52:25 +00:00
Chris Lattner 02a71e7748 Implement remove/eraseFromParent methods
llvm-svn: 16922
2004-10-11 22:21:39 +00:00
Chris Lattner 273207f32f Add long overdue methods
llvm-svn: 16921
2004-10-11 22:21:13 +00:00
Chris Lattner a92af96c56 Reenable the transform, turning X/-10 < 1 into X > -10
llvm-svn: 16918
2004-10-11 19:40:04 +00:00
Chris Lattner 58043a1473 Fix a warning that is emitted on the suns
llvm-svn: 16917
2004-10-11 15:50:40 +00:00
Chris Lattner 004e250cd2 This patch implements two things (sorry).
First, it allows SRA of globals that have embedded arrays, implementing
GlobalOpt/globalsra-partial.llx.  This comes up infrequently, but does allow,
for example, deleting several stores to dead parts of globals in dhrystone.

Second, this implements GlobalOpt/malloc-promote-*.llx, which is the
following nifty transformation:

Basically if a global pointer is initialized with malloc, and we can tell
that the program won't notice, we transform this:

struct foo *FooPtr;
...
  FooPtr = malloc(sizeof(struct foo));
...
  FooPtr->A   FooPtr->B

Into:

struct foo FooPtrBody;
...
   FooPtrBody.A  FooPtrBody.B

This comes up occasionally, for example, the 'disp' global in 183.equake (where
the xform speeds the CBE version of the program up from 56.16s to 52.40s (7%)
on apoc), and the 'desired_accept', 'fixLRBT', 'macroArray', & 'key_queue'
globals in 300.twolf (speeding it up from 22.29s to 21.55s (3.4%)).

The nice thing about this xform is that it exposes the resulting global to
global variable optimization and makes alias analysis easier in addition to
eliminating a few loads.

llvm-svn: 16916
2004-10-11 05:54:41 +00:00
Chris Lattner 615bd303d1 This testcase ensures that we can SRA a global even if part of the global
cannot be SRA'd

llvm-svn: 16915
2004-10-11 05:00:30 +00:00
Chris Lattner 214956dd9d These testcases check to see if we can promote malloc's to globals in some
cases.

llvm-svn: 16914
2004-10-11 05:00:12 +00:00
Chris Lattner 155cfd237b Don't miss global optimizations because we run before the inliner
llvm-svn: 16913
2004-10-11 04:47:18 +00:00
Chris Lattner 6faf3949f6 Fix SingleSource/Benchmarks/McGill/chomp
llvm-svn: 16912
2004-10-11 04:07:27 +00:00
Chris Lattner b2b7f90caf If we are trying to create a ConstantExpr cast that is really a GEP to the
first element of an array, return a GEP instead of a cast.  This allows us
to transparently fold this:

int* getelementptr (int* cast ([100 x int]* %Gbody to int*), int 40)

into this:

int* getelementptr ([100 x int]* %Gbody, int 0, int 40)

llvm-svn: 16911
2004-10-11 03:57:30 +00:00
Misha Brukman 8c8cbb8b71 Fix grammar
llvm-svn: 16910
2004-10-11 02:06:40 +00:00
Misha Brukman 8da107a68f Remove exhuberant-style comments which remained from copying file from `sample'
llvm-svn: 16909
2004-10-11 00:56:41 +00:00
Misha Brukman 6e200dedd7 Fix file header comment; remove sample project (extra-verbose) comments
llvm-svn: 16908
2004-10-11 00:55:47 +00:00
Misha Brukman e67286641e Fix file header comment
llvm-svn: 16907
2004-10-11 00:54:59 +00:00
Misha Brukman 1df01504c6 ModuloScheduling has moved to lib/Target/SparcV9
llvm-svn: 16906
2004-10-10 23:37:40 +00:00
Misha Brukman b4cb9fc7c9 Add ModuloScheduling to the recursive build tree
llvm-svn: 16905
2004-10-10 23:36:09 +00:00
Misha Brukman 9da1134bfb Adjust header file inclusion due to move
llvm-svn: 16904
2004-10-10 23:34:50 +00:00
Misha Brukman c70014bea3 Adjust comment header and paths to refect move
llvm-svn: 16903
2004-10-10 23:34:36 +00:00
Misha Brukman 4a4af7e20c ModuloScheduling moved to lib/Target/SparcV9 as it is SparcV9-specific
llvm-svn: 16902
2004-10-10 23:33:20 +00:00
Chris Lattner e42eb31f7d Just because we cannot completely eliminate all uses of a global, we can
still optimize away all of the indirect calls and loads, etc from it.
This turns code like this:

  if (G != 0)
    G();

into
   if (G != 0)
     ActualCallee();

This triggers a couple of times in gcc and libstdc++.

llvm-svn: 16901
2004-10-10 23:14:11 +00:00
Chris Lattner cd1e756469 Another testcase. We should be able to devirtualize the call even though
we cannot completely eliminate the global.

llvm-svn: 16900
2004-10-10 23:12:33 +00:00
Reid Spencer 98e600b587 Reorganize FINDLIBS to make most comment libs searched first.
llvm-svn: 16899
2004-10-10 22:54:46 +00:00
Reid Spencer 823f302ff9 Initial version of automake Makefile.am file.
llvm-svn: 16898
2004-10-10 22:52:14 +00:00
Reid Spencer ef6ba8db70 Add the new InstrSched directory.
llvm-svn: 16897
2004-10-10 22:51:03 +00:00
Reid Spencer 681a192eb3 Fix named of a library.
llvm-svn: 16896
2004-10-10 22:50:31 +00:00
Tanya Lattner dbac0cb21e Added debug information. Fixed several bugs in the reconstruct loop function.
llvm-svn: 16895
2004-10-10 22:44:35 +00:00
Reid Spencer f6d9ceebc6 Initial version of automake Makefile.am file.
llvm-svn: 16894
2004-10-10 22:36:40 +00:00
Reid Spencer 97327f05fc Initial version of automake Makefile.am file.
llvm-svn: 16893
2004-10-10 22:20:40 +00:00
Reid Spencer e2d1af8be0 Build both archive and relinked objects
llvm-svn: 16892
2004-10-10 22:17:39 +00:00
Reid Spencer 42ea4fcb35 Directory changes
llvm-svn: 16891
2004-10-10 22:17:02 +00:00
Reid Spencer 105b441d5a A configure script to configure LLVM for compilation with automake
llvm-svn: 16890
2004-10-10 22:16:50 +00:00
Reid Spencer 2f13a83e77 Initial version of common automake Rules for LLVM
llvm-svn: 16889
2004-10-10 22:16:37 +00:00
Reid Spencer f5dcbd7ba5 Initial version of automake Makefile.am file.
llvm-svn: 16888
2004-10-10 22:07:57 +00:00
Reid Spencer f92cbf5bb8 Remove the InstrSched directory (moved to SparcV9)
llvm-svn: 16887
2004-10-10 21:19:41 +00:00
Reid Spencer e975e4534c Directory no long exists (moved to Targets/SparcV9).
llvm-svn: 16886
2004-10-10 21:18:31 +00:00
Reid Spencer b84cbf2725 Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Brian Gaeke 4a69c9d667 Fix assertion failure when calling or returning from a function which
returns 'bool' type.

llvm-svn: 16884
2004-10-10 20:34:17 +00:00
Brian Gaeke 7be91b34b8 Implement eliminateCallFramePseudoInstr().
Wrap a long comment line.

llvm-svn: 16883
2004-10-10 19:57:21 +00:00
Brian Gaeke 9770e416c5 Model calls as *both* using *and* killing O0..O5, because callees use the
argument values passed in (so they're not dead until *after* the call),
and callees are free to modify those registers.

llvm-svn: 16882
2004-10-10 19:57:20 +00:00
Brian Gaeke 8a4d5caa76 Fix whitespace and wrap some long lines.
Deal with allocating stack space for outgoing args and copying them into the
correct stack slots (at least, we can copy <=32-bit int args).
We now correctly generate ADJCALLSTACK* instructions.

llvm-svn: 16881
2004-10-10 19:57:18 +00:00
Reid Spencer 4f9650fc71 Top level makefile for building LLVM with automake.
llvm-svn: 16880
2004-10-10 19:13:03 +00:00
Reid Spencer 1d98d2c4b7 Ensure timestamp on saved contents of configure.ac is not changed.
Use correct options to automake.

llvm-svn: 16879
2004-10-10 19:09:33 +00:00
Chris Lattner 604ed7aae8 Fix 2004-10-10-CastStoreOnce.llx, by adjusting types back if we strip off a cast
llvm-svn: 16878
2004-10-10 17:07:12 +00:00
Chris Lattner 89e0b39fe5 New testcase that crashes -globalopt. I found this through inspection, not
actually in the wild :)

llvm-svn: 16877
2004-10-10 17:06:09 +00:00
Chris Lattner a0e769cc81 Implement GlobalOpt/deadglobal-2.llx, deletion of globals that are only
stored to, but are stored at variable indexes.  This occurs at least in
176.gcc, but probably others, and we should handle it for completeness.

llvm-svn: 16876
2004-10-10 16:47:33 +00:00
Chris Lattner 924ce79136 New testcase we were not handling before.
llvm-svn: 16875
2004-10-10 16:46:48 +00:00
Chris Lattner cb9f152d8c Avoid calling use_size() which could (in theory) be expensive if the global
has a large number of users.  Instead, just keep track of whether we're
making changes as we do so.

This patch has no functionlity changes.

llvm-svn: 16874
2004-10-10 16:43:46 +00:00
Chris Lattner 3acdb7fa1b bling bling!
llvm-svn: 16873
2004-10-10 16:26:13 +00:00
Chris Lattner ed8d767883 A testcase that globalopt now handles
llvm-svn: 16872
2004-10-09 21:50:05 +00:00
Chris Lattner 09a527290d Eliminate global pointers that are only stored a single value and null if
we know that all uses of the global will trap if the pointer contained is
null.  In this case, we forward substitute the stored value to any uses.

This has the effect of devirtualizing trivial globals in trivial cases.  For
example, 164.gzip contains this:

gzip.h:extern   int (*read_buf) OF((char *buf, unsigned size));
bits.c: read_buf  = file_read;
deflate.c:    lookahead = read_buf((char*)window,
deflate.c:        n = read_buf((char*)window+strstart+lookahead, more);

Since read_buf has to point to file_read at every use, we just replace
the calls through read_buf with a direct call to file_read.

This occurs in several benchmarks, including 176.gcc and 164.gzip.  Direct
calls are good and stuff.

llvm-svn: 16871
2004-10-09 21:48:45 +00:00
Chris Lattner f9ae6db749 Instead of silently breaking, print notification of why this doesn't work.
llvm-svn: 16870
2004-10-09 21:13:51 +00:00
Chris Lattner b84e1c527f Fix grammaro
llvm-svn: 16869
2004-10-09 19:37:02 +00:00
Chris Lattner 5c91c8f18b Use DEBUG instead of DebugFlag directly, as DebugFlag does not respect
-debug-only!

llvm-svn: 16868
2004-10-09 19:30:36 +00:00
Chris Lattner 99e4111d33 It looks like we're not releasing 1.4 with llvm.org as the official domain
llvm-svn: 16867
2004-10-09 19:19:57 +00:00
Brian Gaeke 74584cd842 update according to tonight's info
llvm-svn: 16866
2004-10-09 05:58:27 +00:00
Brian Gaeke 9c0710781d Implement getModuleMatchQuality and getJITMatchQuality so that v8 will be the
default 32/BE target on sparc hosts, and ppc will continue to be the default
on other hosts.

llvm-svn: 16865
2004-10-09 05:57:01 +00:00