Commit Graph

9688 Commits

Author SHA1 Message Date
Chris Lattner 2eff970892 After finishing BU analysis, move all global variables from the globals
graph into main and mark them complete.

llvm-svn: 20583
2005-03-13 20:15:06 +00:00
Chris Lattner 68c3caccb1 ADd support for printing eqgraphs.
llvm-svn: 20582
2005-03-13 19:51:24 +00:00
Chris Lattner 9cc2c3e9d6 Replace linear search with logrithmic one.
llvm-svn: 20580
2005-03-13 19:05:05 +00:00
Chris Lattner 3434004dce add a StructLayout::getElementContainingOffset method.
llvm-svn: 20579
2005-03-13 19:04:41 +00:00
Andrew Lenharth af9a15fe64 Should fix mesa
llvm-svn: 20577
2005-03-13 00:43:20 +00:00
Chris Lattner 97ac0a8780 make sure to mark nodes returned from functions as incomplete
llvm-svn: 20576
2005-03-12 14:58:28 +00:00
Chris Lattner dd6bcbe820 remove this from the PA namespace, leaving it in the llvm ns
llvm-svn: 20574
2005-03-12 12:08:52 +00:00
Chris Lattner 2dd9a09837 Move this from the pool allocator project to here, where it logically belongs.
llvm-svn: 20570
2005-03-12 11:51:30 +00:00
Andrew Lenharth 27a3df07a0 remove a pseudo instruction and improve inline constant generation
llvm-svn: 20563
2005-03-11 17:48:05 +00:00
Chris Lattner 6f6ecad995 I didn't mean to check this in. :(
llvm-svn: 20555
2005-03-10 20:59:51 +00:00
Chris Lattner 85e7163947 Fix a bug where we would incorrectly do a sign ext instead of a zero ext
because we were checking the wrong thing.  Thanks to andrew for pointing
this out!

llvm-svn: 20554
2005-03-10 20:55:51 +00:00
Andrew Lenharth 7054073bb6 yay for camel_cvs diff
llvm-svn: 20552
2005-03-10 20:15:09 +00:00
Andrew Lenharth 7728eb7b80 some typoes and .bss isn't liked, at all
llvm-svn: 20542
2005-03-10 19:02:02 +00:00
Chris Lattner 76aa8e071b Allow the live interval analysis pass to be a bit more aggressive about
numbering values in live ranges for physical registers.

The alpha backend currently generates code that looks like this:

  vreg = preg
...
  preg = vreg
  use preg
...
  preg = vreg
  use preg

etc.  Because vreg contains the value of preg coming in, each of the
copies back into preg contain that initial value as well.

In the case of the Alpha, this allows this testcase:

void "foo"(int %blah) {
        store int 5, int *%MyVar
        store int 12, int* %MyVar2
        ret void
}

to compile to:

foo:
        ldgp $29, 0($27)
        ldiq $0,5
        stl $0,MyVar
        ldiq $0,12
        stl $0,MyVar2
        ret $31,($26),1

instead of:

foo:
        ldgp $29, 0($27)
        bis $29,$29,$0
        ldiq $1,5
        bis $0,$0,$29
        stl $1,MyVar
        ldiq $1,12
        bis $0,$0,$29
        stl $1,MyVar2
        ret $31,($26),1

This does not seem to have any noticable effect on X86 code.

This fixes PR535.

llvm-svn: 20536
2005-03-09 23:05:19 +00:00
Andrew Lenharth 8145fec740 minor correction for Register that isn't used
llvm-svn: 20535
2005-03-09 20:48:23 +00:00
Chris Lattner 7f26946709 constant fold FP_ROUND_INREG, ZERO_EXTEND_INREG, and SIGN_EXTEND_INREG
This allows the alpha backend to compile:

bool %test(uint %P) {
        %c = seteq uint %P, 0
        ret bool %c
}

into:

test:
        ldgp $29, 0($27)
        ZAP $16,240,$0
        CMPEQ $0,0,$0
        AND $0,1,$0
        ret $31,($26),1

instead of:

test:
        ldgp $29, 0($27)
        ZAP $16,240,$0
        ldiq $1,0
        ZAP $1,240,$1
        CMPEQ $0,$1,$0
        AND $0,1,$0
        ret $31,($26),1

... and fixes PR534.

llvm-svn: 20534
2005-03-09 18:37:12 +00:00
Chris Lattner b1d901427a correct the computation of the isAbstract bit for types.
llvm-svn: 20533
2005-03-09 17:34:27 +00:00
Chris Lattner 562c180879 Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis!

llvm-svn: 20531
2005-03-09 16:29:52 +00:00
Reid Spencer f064bb2617 Fix a typo in an assertion comment.
Patch contributed by Vladimir Merzliakov.

llvm-svn: 20529
2005-03-09 15:19:41 +00:00
Chris Lattner adb043c2d8 Export two methods for getting -X and A-B.
llvm-svn: 20527
2005-03-09 05:34:41 +00:00
Chris Lattner b9f0cebeb5 get bugpoint working on ia64, by building .so's with -fpic. :)
llvm-svn: 20525
2005-03-09 03:31:02 +00:00
Chris Lattner 1f1462fafa Fix a crash handling 'undef bool', fixing an llc crash on 186.crafty
llvm-svn: 20523
2005-03-08 22:53:09 +00:00
Reid Spencer 00658b80fb Patch to make assembly output compatible with mingw compilation (identical
to cygwin)

llvm-svn: 20520
2005-03-08 17:02:05 +00:00
Chris Lattner ea50620eec Make sure to remove all dead type names from the symbol table, not just
struct types.  This fixes Regression/CodeGen/CBackend/2005-03-08-RecursiveTypeCrash.ll,
a crash on Java output that Alkis reported.

llvm-svn: 20519
2005-03-08 16:19:59 +00:00
Misha Brukman 20238eb963 Single characters should be printed out as chars, not strings.
llvm-svn: 20515
2005-03-08 00:26:08 +00:00
Chris Lattner e9328b319c Fix an apparent ambiguity compiling on PPC
llvm-svn: 20507
2005-03-07 02:59:36 +00:00
Chris Lattner 8c79559443 fix a bug where we thought arguments were constants :(
llvm-svn: 20506
2005-03-06 22:52:29 +00:00
Chris Lattner 2ce303b406 Fix Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll,
hopefully not breaking too many other things.

llvm-svn: 20505
2005-03-06 22:36:12 +00:00
Chris Lattner 45403e5052 implement Transforms/LoopStrengthReduce/invariant_value_first_arg.ll
llvm-svn: 20501
2005-03-06 22:06:22 +00:00
Chris Lattner d3874fad44 minor simplifications of the code.
llvm-svn: 20497
2005-03-06 21:58:22 +00:00
Chris Lattner dd3ec92085 trivial simplification
llvm-svn: 20494
2005-03-06 21:35:38 +00:00
Chris Lattner 238f6df546 Fix a bug where we could corrupt a parent loop's header info if we unrolled
a nested loop.  This fixes Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll
and PR532

llvm-svn: 20493
2005-03-06 20:57:32 +00:00
Chris Lattner 86fe3a1fdb rename insertEntry to insert
llvm-svn: 20484
2005-03-06 05:55:40 +00:00
Chris Lattner 533805e6da Merge SymbolTable::removeEntry into SymbolTable::remove, its only caller
llvm-svn: 20483
2005-03-06 05:51:09 +00:00
Chris Lattner 290d881f84 Delete the really inefficient method: void remove(const Type* Typ);
Speed up the symbol stripping code by avoiding a linear search of the
type table.

Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.

llvm-svn: 20481
2005-03-06 05:46:41 +00:00
Chris Lattner 1b032f59e7 Make this MUCH faster by avoiding a linear search in the symbol table code.
llvm-svn: 20479
2005-03-06 05:42:36 +00:00
Chris Lattner bad0e7e2d9 Remove some really gross and hard to understand code now that
InternallyInconsistent is always false.

llvm-svn: 20477
2005-03-06 05:21:40 +00:00
Chris Lattner cd56f5a8e4 Simplify some code.
llvm-svn: 20476
2005-03-06 05:13:42 +00:00
Chris Lattner eb9a12cbce remove these methods.
llvm-svn: 20474
2005-03-06 02:37:47 +00:00
Chris Lattner 8a982e10be simplify and speed up some code
llvm-svn: 20472
2005-03-06 02:32:00 +00:00
Chris Lattner c9b0984666 simplify some code.
llvm-svn: 20471
2005-03-06 02:28:23 +00:00
Chris Lattner ffb3778f87 This fixes PR531, a crash when running the CBE on a bytecode file.
The problem is that Function::renameLocalSymbols is iterating through
the symbol table planes, occasionally calling setName to rename a value
(which used to do a symbol table remove/insert pair).

The problem is that if there is only a single value in a particular type
plane that the remove will nuke the symbol table plane, and the insert
will create and insert a new one.  This hoses Function::renameLocalSymbols
because it has an iterator to the old plane, under the (very reasonable)
assumption that simply renaming a value won't cause the type plane to
disappear.

This patch fixes the bug by making the rename operation a single atomic
operation, which has a side effect of making the whole thing faster too. :)

llvm-svn: 20469
2005-03-06 02:14:28 +00:00
Jeff Cohen 4abcea3a69 Reformat comments to fix 80 columns.
llvm-svn: 20467
2005-03-05 22:45:40 +00:00
Jeff Cohen be37fa07fd Reuse induction variables created for strength-reduced GEPs by other similar GEPs.
llvm-svn: 20466
2005-03-05 22:40:34 +00:00
Chris Lattner cdb9bfc150 remove all of the various setName implementations, consolidating them into
Value::setName, which is no longer virtual.

llvm-svn: 20464
2005-03-05 19:51:50 +00:00
Chris Lattner 6d0a24c608 second argument to Value::setName is now gone.
llvm-svn: 20463
2005-03-05 19:05:20 +00:00
Chris Lattner 7c832fb0b2 Make sure the two arguments of a setcc instruction point to the same node.
llvm-svn: 20462
2005-03-05 19:04:31 +00:00
Chris Lattner aa72c889a6 zap
llvm-svn: 20461
2005-03-05 19:04:07 +00:00
Chris Lattner f66165674f 2nd arg to setName goes away.
llvm-svn: 20460
2005-03-05 19:02:15 +00:00
Chris Lattner cc77b84fcb Constants never get names.
llvm-svn: 20459
2005-03-05 19:01:59 +00:00
Chris Lattner ed2fb1cf93 Remove the 2nd argument to Value::setName
llvm-svn: 20458
2005-03-05 19:01:49 +00:00
Chris Lattner f246ef3e2f don't break the build on 32-bit hosts.
llvm-svn: 20455
2005-03-05 17:47:38 +00:00
Andrew Lenharth 7c954c6d13 fix data size stuff for architectures with bit challenged data types
llvm-svn: 20453
2005-03-05 15:30:33 +00:00
Chris Lattner cfe2822cdf Do not compute 1ULL << 64, which is undefined. This fixes Ptrdist/ks on the
sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll

llvm-svn: 20445
2005-03-04 23:21:33 +00:00
Andrew Lenharth f3cd1477c3 fix up stack pointer adjustments
llvm-svn: 20442
2005-03-04 21:40:02 +00:00
Chris Lattner c01e2f76c3 Trivial cleanup patch
llvm-svn: 20436
2005-03-04 20:27:46 +00:00
Andrew Lenharth 8df62dda57 fix FCMOVxx typo, set rem and div to hardcode target reg to be the same as the one the assembler uese, update ISel to put values in regs used by assembler for rem and div
llvm-svn: 20434
2005-03-04 20:09:23 +00:00
Jeff Cohen a2c59b7423 Add support for not strength reducing GEPs where the element size is a small
power of two.  This emphatically includes the zeroeth power of two.

llvm-svn: 20429
2005-03-04 04:04:26 +00:00
Andrew Lenharth f0ab14aa24 turn on IEEE for compares
llvm-svn: 20425
2005-03-03 22:12:11 +00:00
Andrew Lenharth 6a5f52d15a beter Select on FP
llvm-svn: 20424
2005-03-03 21:47:53 +00:00
Chris Lattner 00ee68c612 Print -X like this:
double test(double l1_X) {
  return (-l1_X);
}

instead of like this:

double test(double l1_X) {
  return (-0x0p+0 - l1_X);
}

llvm-svn: 20423
2005-03-03 21:12:04 +00:00
Andrew Lenharth 00348ce902 LSR cleanup patch
llvm-svn: 20422
2005-03-03 19:03:21 +00:00
Chris Lattner 1a678c67c9 Do not lower malloc's to pass "sizeof" expressions like this:
ltmp_0_7 = malloc(((unsigned )(&(((signed char (*)[784])/*NULL*/0)[1u]))));

Instead, just emit the literal constant, like this:

  ltmp_0_7 = malloc(784u);

This works around a bug in ICC 8.1 compiling the CBE generated code.  :-(

llvm-svn: 20415
2005-03-03 01:04:50 +00:00
Chris Lattner ef1e989e4f Add an optional argument to lower to a specific constant value instead of
to a "sizeof" expression.

llvm-svn: 20414
2005-03-03 01:03:43 +00:00
Misha Brukman f090d1b3ab Fix the spelling of the word `the'
llvm-svn: 20412
2005-03-02 23:17:31 +00:00
Chris Lattner 4d8689edcb Print the module ID as a comment.
llvm-svn: 20411
2005-03-02 23:12:40 +00:00
Chris Lattner 5b5caaf3cd cleanup the cfg after lsr
llvm-svn: 20410
2005-03-02 21:56:00 +00:00
Andrew Lenharth 180a04a4bb remove 32 sign extend after 32 sextload and handle small negative constant
llvm-svn: 20408
2005-03-02 17:23:03 +00:00
Andrew Lenharth ed4b6488a7 Added LSR as a beta pass for alpha
llvm-svn: 20407
2005-03-02 17:21:38 +00:00
Chris Lattner c8bb99760a 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
Reid Spencer a556669219 Be slightly more accurate in an error message.
llvm-svn: 20397
2005-03-02 05:45:56 +00:00
Chris Lattner fe760deb75 Fix a nasty order of evaluation bug that Gabor Greif ran into. Here's an
explanation from IRC:

	|sabre|	I think it's an order of evaluation thing
	|sabre|	for me, the RHS of the assignment is evaluated first
	|sabre|	getTypeDescription checks to see if ConcreteTypeDescription[Ty] contains anything
	|sabre|	since it doesn't, it computes and returns the value
	|sabre|	this gets put into the map.
	|sabre|	For you, the LHS is evaluated first.
	|sabre|	Map[Ty] (aka ConcreteTypeDescriptions[Ty]) inserts an empty string into the map, returning a reference
	|sabre|	getTypeDesc then sees the empty string in the map
	|sabre|	and returns it
	|sabre|	bork :)

llvm-svn: 20394
2005-03-02 03:54:43 +00:00
Jeff Cohen 8ea6f9e821 Fixed the following LSR bugs:
* Loop invariant code does not dominate the loop header, but rather
    the end of the loop preheader.

  * The base for a reduced GEP isn't a constant unless all of its
    operands (preceding the induction variable) are constant.

  * Allow induction variable elimination for the simple case after all.

Also made changes recommended by Chris for properly deleting
instructions.

llvm-svn: 20383
2005-03-01 03:46:11 +00:00
Alkis Evlogimenos b3846f4b06 Lower llvm.isunordered(a, b) into a != a | b != b.
llvm-svn: 20382
2005-03-01 02:07:58 +00:00
Chris Lattner 12328e9378 Remove tabs from file.
llvm-svn: 20380
2005-02-28 19:36:15 +00:00
Chris Lattner 811107350a Add support to the C backend for llvm.prefetch. Patch contributed by
Justin Wick!

llvm-svn: 20378
2005-02-28 19:29:46 +00:00
Chris Lattner 1772c1a672 recognize llvm.prefetch. Patch contributed by Justin Wick!
llvm-svn: 20377
2005-02-28 19:28:00 +00:00
Chris Lattner 39637ef023 Verify llvm.prefetch.
llvm-svn: 20376
2005-02-28 19:27:42 +00:00
Chris Lattner c87e03aeea Lower prefetch to a noop, patch contributed by Justin Wick!
llvm-svn: 20375
2005-02-28 19:27:23 +00:00
Andrew Lenharth 76eff48195 fix integer division and stuff
llvm-svn: 20372
2005-02-28 17:22:18 +00:00
Jeff Cohen dcaa48b5c4 Fix crash in LSR due to attempt to remove original induction variable. However,
for reasons explained in the comments, I also deactivated this code as it needs
more thought.

llvm-svn: 20367
2005-02-28 00:08:56 +00:00
Jeff Cohen fd63d3af0d PHI nodes were incorrectly placed when more than one GEP is reduced in a loop.
llvm-svn: 20360
2005-02-27 21:08:04 +00:00
Jeff Cohen 39751c3b7c First pass at improved Loop Strength Reduction. Still not yet ready for prime time.
llvm-svn: 20358
2005-02-27 19:37:07 +00:00
Chris Lattner 7f32c4aa36 Use const iterators where possible. Patch by Evan Jones!
llvm-svn: 20354
2005-02-27 19:06:10 +00:00
Chris Lattner 7561ca1d15 Teach globalopt how memset/cpy/move affect memory, to allow better optimization.
llvm-svn: 20352
2005-02-27 18:58:52 +00:00
Chris Lattner 0ce80cd542 Fix spelling, patch contributed by Gabor Greif!
llvm-svn: 20343
2005-02-27 06:18:25 +00:00
Chris Lattner dc166eb8f7 Fix spelling, patch contributed by Gabor Greif
llvm-svn: 20342
2005-02-27 06:15:51 +00:00
Chris Lattner 5315aa0ec6 Remove some stuff I checked in accidentally
llvm-svn: 20340
2005-02-27 04:32:35 +00:00
Chris Lattner 0b0f3520cb DCE a dead function
llvm-svn: 20339
2005-02-26 23:36:45 +00:00
Reid Spencer 709e10ed92 Implement an isBytecodeArchive method to determine if an archive contains
bytecode file members or not.
Patch Contributed By Adam Treat

llvm-svn: 20338
2005-02-26 22:00:32 +00:00
Chris Lattner f05d2b3178 1 + 100 + 51 == 152, not 52.
If we fold three constants together (c1+c2+c3), make sure to keep
LHSC updated, instead of reusing (in this case), the 1 instead of the
partial sum.

llvm-svn: 20337
2005-02-26 18:50:19 +00:00
Chris Lattner cc6d75fddf remove extraneous cast
llvm-svn: 20334
2005-02-26 18:33:28 +00:00
Andrew Lenharth 10bc4c0ff6 make BB labels be exported for debuging, add fp negation optimization, further pecimise the FP instructions
llvm-svn: 20332
2005-02-25 22:55:15 +00:00
Chris Lattner e99ee2b35d Handle null a bit more carefully.
Actually teach dsa about select instructions.  This doesn't affect the
graph in any way other than not setting a spurious U marker on pointer
nodes that are selected.

llvm-svn: 20324
2005-02-25 01:27:48 +00:00
Chris Lattner 468fd33abb This instruction:
X = gep null, ...

Used to not create a scalar map entry for X, which caused clients to barf.
This is bad.

llvm-svn: 20316
2005-02-24 19:55:31 +00:00
Chris Lattner d13cc49e19 Fix a bug introduced by revision 1.187 of this file.
llvm-svn: 20308
2005-02-24 18:48:07 +00:00
Andrew Lenharth 904650cdd0 fix Allocas. Really. I mean it this time.
llvm-svn: 20306
2005-02-24 18:36:32 +00:00
Chris Lattner 08f7d0c262 Fix some problems where the verifier would crash on invalid input instead of
reporting the problem and exiting.

llvm-svn: 20302
2005-02-24 16:58:29 +00:00
Chris Lattner 1cca959e5d Implement Transforms/SimplifyCFG/switch_thread.ll
This does a simple form of "jump threading", which eliminates CFG edges that
are provably dead.  This triggers 90 times in the external tests, and
eliminating CFG edges is always always a good thing! :)

llvm-svn: 20300
2005-02-24 06:17:52 +00:00
Chris Lattner 47ac187c08 switch instructions only allow constantints for their values, be more specific.
llvm-svn: 20298
2005-02-24 05:32:09 +00:00
Chris Lattner 75f5b42624 use more specific cast.
llvm-svn: 20297
2005-02-24 05:26:04 +00:00
Chris Lattner fc824c1a7e add more checking
llvm-svn: 20296
2005-02-24 05:25:17 +00:00
Chris Lattner 5f0df0c1e6 Do not read free'd memory when printing an error message.
llvm-svn: 20295
2005-02-24 04:59:49 +00:00
Chris Lattner ce046ac9c6 add a new method.
llvm-svn: 20293
2005-02-24 02:37:26 +00:00
Tanya Lattner ee47100d44 Only print out machine instructions before modulo scheduling if we are actually doing modulo scheduling! :)
llvm-svn: 20292
2005-02-24 02:14:44 +00:00
Andrew Lenharth 27cf4eb1c7 Ah the problems you have to fix when you stray from the One True Way (TM)
llvm-svn: 20290
2005-02-23 17:33:42 +00:00
Chris Lattner 25169caa80 make this more efficient. Scan up to 16 nodes, not the whole list.
llvm-svn: 20289
2005-02-23 16:53:04 +00:00
Chris Lattner d36552f34f new method
llvm-svn: 20288
2005-02-23 16:51:11 +00:00
Chris Lattner cf08c21f2c Reduce the amount of searching this assertion does. On a testcase of mine,
this reduces the time for -simplifycfg in a debug build from 106s to 14.82s

llvm-svn: 20286
2005-02-23 07:09:08 +00:00
Chris Lattner 80c5b97046 Silence some uninit variable warnings.
llvm-svn: 20284
2005-02-23 05:57:21 +00:00
Tanya Lattner a31ad5172e Fixed bug in findAllcircuits. Fixed branch addition to schedule. Added debug information.
llvm-svn: 20280
2005-02-23 02:01:42 +00:00
Andrew Lenharth ccdfdd7aee oops
llvm-svn: 20278
2005-02-22 23:29:25 +00:00
Chris Lattner 3166471603 Remove use of bind_obj, deleter, and finegrainify namespacification.
llvm-svn: 20277
2005-02-22 23:27:21 +00:00
Chris Lattner 52e931b37d Remove use of bind_obj
llvm-svn: 20276
2005-02-22 23:22:58 +00:00
Chris Lattner 06b6c4bbde C++ is not a functional programming language.
llvm-svn: 20274
2005-02-22 23:13:58 +00:00
Andrew Lenharth 7ac0143fa6 dynamic stack allocas
llvm-svn: 20273
2005-02-22 21:59:48 +00:00
Chris Lattner a474313902 Fix a bug in the 'store fpimm, ptr' -> 'store intimm, ptr' handling code.
Changing 'op' here caused us to not enter the store into a map, causing
reemission of the code!!  In practice, a simple loop like this:

no_exit:                ; preds = %no_exit, %entry
        %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %tmp.4 = getelementptr "complex long double"* %P, uint %indvar, uint 0          ; <double*> [#uses=1]
        store double 0.000000e+00, double* %tmp.4
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
        %exitcond = seteq uint %indvar.next, %N         ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit

was being code gen'd to:

.LBBtest_1:     # no_exit
        movl %edx, %esi
        shll $4, %esi
        movl $0, 4(%eax,%esi)
        movl $0, (%eax,%esi)
        incl %edx
        movl $0, (%eax,%esi)
        movl $0, 4(%eax,%esi)
        cmpl %ecx, %edx
        jne .LBBtest_1  # no_exit

Note that we are doing 4 32-bit stores instead of 2.  Now we generate:

.LBBtest_1:     # no_exit
        movl %edx, %esi
        incl %esi
        shll $4, %edx
        movl $0, (%eax,%edx)
        movl $0, 4(%eax,%edx)
        cmpl %ecx, %esi
        movl %esi, %edx
        jne .LBBtest_1  # no_exit

This is much happier, though it would be even better if the increment of ESI
was scheduled after the compare :-/

llvm-svn: 20265
2005-02-22 07:23:39 +00:00
Andrew Lenharth 5ab3986e49 no longer build as a shared library
llvm-svn: 20264
2005-02-22 04:58:26 +00:00
Chris Lattner ec3f094489 Fix problems running the HowToUseJIT on powerpc, and probably problems with
ANY program that does not have all functions internalized.

llvm-svn: 20258
2005-02-20 18:43:35 +00:00
Jeff Cohen 18cf7ebcee Fix silly mistake.
llvm-svn: 20256
2005-02-20 02:48:51 +00:00
Jeff Cohen 4220bf5726 Implement standard I/O redirection in ExecuteAndWait().
llvm-svn: 20255
2005-02-20 02:43:04 +00:00
Chris Lattner e68dae0eb6 Add support for ".so" files compiled with LLVM which contain LLVM bytecode.
llvm-svn: 20253
2005-02-19 18:30:29 +00:00
Chris Lattner fe723a7c05 Eliminate silly warnings from the linker of the form:
WARNING: Type conflict between types named 'union.._604.'.
    Src=' %union.._604.'.
   Dest=' %union.._604.'
llvm-svn: 20252
2005-02-19 17:52:37 +00:00
Jeff Cohen 07e22ba2c7 Change __MINGW to __MINGW32__. Patch submitted by Henrik Bach.
llvm-svn: 20243
2005-02-19 03:01:13 +00:00
Jeff Cohen 81549a57b8 Make PreventCoreFiles() do the right thing on Windows.
llvm-svn: 20237
2005-02-18 07:05:18 +00:00
Misha Brukman 20430321c2 Fix compilation errors with VS 2005, patch contributed by Aaron Gray.
llvm-svn: 20232
2005-02-17 21:40:27 +00:00
Misha Brukman 73e929f89d Fix compilation errors with VS 2005, patch by Aaron Gray.
llvm-svn: 20231
2005-02-17 21:39:27 +00:00
Chris Lattner 381dddc90c Don't rely on doubles comparing identical to each other, which doesn't work
for 0.0 and -0.0.

llvm-svn: 20230
2005-02-17 20:17:32 +00:00
Chris Lattner 0c56a548ed Don't sink argument loads into loops or other bad places. This disables folding of argument loads with instructions that are not in the entry block.
llvm-svn: 20228
2005-02-17 19:40:32 +00:00
Chris Lattner 7b5d9e2217 Do not mark obviously unreachable blocks live when processing PHI nodes,
and handle incomplete control dependences correctly.  This fixes:

Regression/Transforms/ADCE/dead-phi-edge.ll
  -> a missed optimization

Regression/Transforms/ADCE/dead-phi-edge.ll
  -> a compiler crash distilled from QT4

llvm-svn: 20227
2005-02-17 19:28:49 +00:00
Chris Lattner 47555decfb Scary typo that fixes Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll
and PR515.

llvm-svn: 20224
2005-02-17 16:54:16 +00:00
Jeff Cohen 97a41e238e Arg list already has program name in it.
llvm-svn: 20208
2005-02-16 04:43:45 +00:00
Tanya Lattner c28fd0db2e Fixed node deletion bug.
llvm-svn: 20207
2005-02-16 04:00:59 +00:00
Chris Lattner 3e7a193bd7 Instead of doing a manual comparison loop, just use memcmp, thanks to JohnC
for the suggestion! :)

llvm-svn: 20203
2005-02-15 22:12:10 +00:00
Chris Lattner 9d0db6f602 Make this more efficient now that we know both files are the same length.
llvm-svn: 20202
2005-02-15 22:01:43 +00:00
Misha Brukman f232a4582d Fix spelling
llvm-svn: 20201
2005-02-15 21:59:53 +00:00
Reid Spencer f4425b0208 Adjust DiffFilesWithTolerance to help poor cygwin's mmap facility by
handling zero length files a little more intelligently. If both files are
zero length then we return 0 (true) indicating a match. If only one of the
files is zero length then we return 1 (false) indicating that the files
differ. If the files don't agree in length then they can't match so we
skip the first loop that looks for a quick match.

llvm-svn: 20200
2005-02-15 21:47:02 +00:00
Chris Lattner 915fd0de4b 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 3e708301d2 Add a sanity check.
llvm-svn: 20195
2005-02-15 18:48:48 +00:00
Chris Lattner 219002ed8f Add a new method to make it easy to update graphs.
llvm-svn: 20194
2005-02-15 18:40:55 +00:00
Chris Lattner 3bef66fcf3 Fix volatile load/store of pointers. Consider this testcase:
void %test(int** %P) {
  %A = volatile load int** %P
  ret void
}

void %test2(int*** %Q) {
  %P = load int*** %Q
  volatile store int** %P, int*** %Q
  ret void
}

instead of emitting:

void test(int **l1_P) {
  int *l2_A;

  l2_A = (int **((volatile int **)l1_P));
  return;
}
void test2(int ***l2_Q) {
  int **l1_P;

  l1_P = *l2_Q;
  *((volatile int ***)l2_Q) = l1_P;
  return;
}

... which is loading/storing volatile pointers, not through volatile pointers,
emit this (which is right):

void test(int **l1_P) {
  int *l3_A;

  l3_A = *((int * volatile*)l1_P);
  return;
}
void test2(int ***l2_Q) {
  int **l1_P;

  l1_P = *l2_Q;
  *((int ** volatile*)l2_Q) = l1_P;
  return;
}

llvm-svn: 20191
2005-02-15 05:52:14 +00:00
Chris Lattner 6e528dce90 Fix a bug in my previous change to this, which broke the build on sparcs.
llvm-svn: 20184
2005-02-14 21:42:10 +00:00
Chris Lattner 145569b076 Print GEP offsets as signed values instead of unsigned values. On X86, this
prints:

getelementptr (int* %A, int -1)

as: "(A) - 4" instead of "(A) + 18446744073709551612", which makes the
assembler much happier.

This fixes test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll,
and Benchmarks/Prolangs-C/cdecl with LLC on X86.

llvm-svn: 20183
2005-02-14 21:40:26 +00:00
Chris Lattner 31f3382b3b Fix the second bug attached to PR504.
llvm-svn: 20181
2005-02-14 20:11:45 +00:00
Chris Lattner a3a55bf997 Work around GCC PR19958, which causes programs to sometimes crash after
printing help output or version info.

llvm-svn: 20180
2005-02-14 19:17:29 +00:00
Misha Brukman 2b1e10031f Write out single characters as chars, not strings.
llvm-svn: 20179
2005-02-14 18:52:35 +00:00
Chris Lattner 7afbdcad15 Implement CodeGen/CBackend/2005-02-14-VolatileOperations.ll
Volatile loads and stores need to emit volatile pointer operations in C.

llvm-svn: 20177
2005-02-14 16:47:52 +00:00
Andrew Lenharth cae2f21e3b fix setcc on floats, fixes singlesource:pi, perhaps others
llvm-svn: 20172
2005-02-14 05:41:43 +00:00
Chris Lattner 259df2bf3c Fix the llvm bootstrap
llvm-svn: 20170
2005-02-13 23:37:09 +00:00
Chris Lattner dc01c3f058 Move helper function here.
llvm-svn: 20168
2005-02-13 23:13:47 +00:00
Chris Lattner 743dd2cd80 If errno is zero strerror_r does not modify the buffer, leaving it unterminated.
This causes garbage to be printed out after error messages.

llvm-svn: 20165
2005-02-13 22:46:37 +00:00
Reid Spencer 8d0f126b74 Make the check for global variables the same as the one for functions. In
both cases they are looking for non-external variables/functions that do
not have internal linkage. Using "!isExternal()" is a little more
understandable than "hasInitializer()"

llvm-svn: 20155
2005-02-13 18:12:20 +00:00
Chris Lattner 8d54dd37c9 Nuke blank line.
llvm-svn: 20154
2005-02-13 17:54:21 +00:00
Chris Lattner 08a5eb3cf0 Minor cleanup. No need to explicitly tell the compiler the template arguments.
llvm-svn: 20153
2005-02-13 17:50:16 +00:00
Chris Lattner 147c561432 Make sure to clear the LazyFunctionLoadMap after we ParseAllFunctionBodies.
Otherwise, clients who call ParseAllFunctionBodies will attempt to parse
the function bodies twice, which is (uh) very very bad (tm).

This fixes gccld on python.

llvm-svn: 20152
2005-02-13 17:48:18 +00:00
Chris Lattner 1b9f9c5f67 Do not put internal symbols into the symbol table. This shrinks the symbol
table for archives in common cases, and prevents trying to resolve a
external reference with an internal reference.  This shrinks the libpython.a
symbol table from 126302 to 19770 bytes.

llvm-svn: 20151
2005-02-13 17:42:11 +00:00
Chris Lattner 71a44087d4 Print something useful for gccld -v with an archive.
llvm-svn: 20148
2005-02-13 15:26:14 +00:00
Chris Lattner 7b0fbe7ccf Correct the recursive PHI node handling routines in a way that CANNOT induce
infinite loops (using the new replaceSymbolicValuesWithConcrete method).

This patch reverts this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050131/023830.html

... which was an attempted fix for this problem.  Unfortunately, that patch
caused test/Regression/Transforms/IndVarsSimplify/exit_value_tests.llx to fail
and slightly castrated the entire analysis.  This patch fixes it right.

This patch is dedicated to jeffc, for making me deal with this.  :)

llvm-svn: 20146
2005-02-13 04:37:18 +00:00
Andrew Lenharth d39febfc66 try to do better match for i32 adds
llvm-svn: 20143
2005-02-12 21:11:17 +00:00
Andrew Lenharth ab4db0522a make FP conversion more conservative (matches gcc)
llvm-svn: 20142
2005-02-12 21:10:58 +00:00
Andrew Lenharth df5cd0868f oops, I was sure this had already gond though the nightly tester
llvm-svn: 20141
2005-02-12 20:42:09 +00:00
Andrew Lenharth 76c5d97750 added sign extend for boolean
llvm-svn: 20137
2005-02-12 19:35:12 +00:00
Chris Lattner 16277c1775 Allow globals to be of different const'nesses when we link.
This finally resolves PR502, PR450,
and test/Regression/Linker/2005-02-12-ConstantGlobals{,-2}.ll correctly

llvm-svn: 20135
2005-02-12 19:20:28 +00:00
Chris Lattner e616fea3bc Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll
and PR504.

llvm-svn: 20129
2005-02-12 03:26:49 +00:00
Andrew Lenharth b301af712e fix a bunch of regressions due to call behavior
llvm-svn: 20110
2005-02-10 20:10:38 +00:00
Alkis Evlogimenos c4a44c6b3d Localize globals if they are only used in main(). This replaces the
global with an alloca, which eventually gets promoted into a
register. This enables a lot of other optimizations later on.

llvm-svn: 20109
2005-02-10 18:36:30 +00:00
Tanya Lattner 56807c6f4a Added new circuit finding alogrithm.
Fixed bug in graph so that phi ite diff edges are added.

llvm-svn: 20108
2005-02-10 17:02:58 +00:00
Tanya Lattner 1137d7c6a1 Allow modsched and local scheduling to both be run.
llvm-svn: 20107
2005-02-10 17:02:06 +00:00
Andrew Lenharth e0b789fdf5 so, if you beat on it, you too can talk emacs into having a sane indenting policy... Also, optimize many function calls with pc-relative calls (partial prologue skipping for that case coming soon), try to fix the random jumps to strange places problem by pesimizing div et. al. register usage and fixing up GP before using, some calling convention tweaks, and make frame pointer unallocatable (not strickly necessary, but let's go for correctness first)
llvm-svn: 20106
2005-02-10 06:25:22 +00:00
Andrew Lenharth f70ef47ee1 fix fp branch
llvm-svn: 20105
2005-02-10 05:17:38 +00:00
Misha Brukman 06a1d47f96 * Fix spelling of `volatile'
* Align comments with tablegen elements

llvm-svn: 20103
2005-02-10 01:52:22 +00:00
Chris Lattner 610ce2c678 Don't print a 'Total Execution Time' line for the 'Miscellaneous Ungrouped
Timers' section.  Since these are random timers in the program it doesn't
make sense to sum them up.

llvm-svn: 20090
2005-02-09 18:41:32 +00:00
Chris Lattner 159485ff1b Fix test/Regression/Assembler/2005-02-09-AsmWriterStoreBug.ll
llvm-svn: 20089
2005-02-09 17:45:03 +00:00
Chris Lattner 5ce5a094aa Use new edge iterators to simplify some code.
llvm-svn: 20086
2005-02-09 03:20:43 +00:00
Andrew Lenharth 8ec0a2b13a BranchCC, nifty
llvm-svn: 20067
2005-02-08 00:40:03 +00:00
Andrew Lenharth d4f440de0f fix store issue and an FP conversion (segfault) issue
llvm-svn: 20066
2005-02-07 23:02:23 +00:00
Chris Lattner 863d9c9068 IndCallGraphMap is now a pointer to a new'd map.
llvm-svn: 20065
2005-02-07 16:09:15 +00:00
Andrew Lenharth 9d3f7704fd copytoreg fix
llvm-svn: 20063
2005-02-07 06:31:44 +00:00
Andrew Lenharth 57047720ce copyfromreg fix
llvm-svn: 20062
2005-02-07 06:21:37 +00:00
Andrew Lenharth 351df0c2dc fix load bug
llvm-svn: 20061
2005-02-07 05:55:55 +00:00
Andrew Lenharth 5d004edc3d more FP load store fixes and Load store simplifications
llvm-svn: 20060
2005-02-07 05:33:15 +00:00
Andrew Lenharth 5fb9b53060 clean up load and stores alot
llvm-svn: 20059
2005-02-07 05:18:02 +00:00
Andrew Lenharth a9e02156ce teach all loads and stores about the stack
llvm-svn: 20058
2005-02-07 05:07:00 +00:00
Andrew Lenharth 0021f55863 prefer FP scratch registers and more check in LowerArguments
llvm-svn: 20057
2005-02-06 21:07:31 +00:00
Andrew Lenharth eefd410522 fix oopso
llvm-svn: 20056
2005-02-06 16:22:15 +00:00
Andrew Lenharth 6c018f77d1 smarter loads and stores. can now handle base+offset.
llvm-svn: 20055
2005-02-06 15:40:40 +00:00
Andrew Lenharth d9bf7b81eb fix build
llvm-svn: 20053
2005-02-05 19:46:51 +00:00
Andrew Lenharth 7be9854594 clean up
llvm-svn: 20051
2005-02-05 17:41:39 +00:00
Andrew Lenharth ea9224a69a fix f32 setcc, and fp select
llvm-svn: 20050
2005-02-05 16:41:03 +00:00
Andrew Lenharth 060d58b88f added ugly support for fp compares
llvm-svn: 20049
2005-02-05 13:19:12 +00:00
Misha Brukman ffe9968b5a Make the rest of file header comments consistent in format and style
llvm-svn: 20048
2005-02-05 02:24:26 +00:00
Chris Lattner df57a02be4 Instead of initializing the volatile field, use accessors to set it.
llvm-svn: 20045
2005-02-05 01:38:38 +00:00
Chris Lattner a29c92ffdd Initialize new field.
llvm-svn: 20044
2005-02-05 01:37:58 +00:00
Misha Brukman 076b9f4507 Make file header comment consistent: extend the whole 80 cols to fill the line
llvm-svn: 20039
2005-02-04 20:25:52 +00:00
Chris Lattner 4585abd549 If we have an indirect call site that calls N functions, inline the N functions
into a temporary graph, remember it for later, then inline the tmp graph into
the call site.

In the case where there are other call sites to the same set of functions, this
permits us to just inline the temporary graph instead of all of the callees.

This turns N*M inlining situations into an N+M inlining situation.

llvm-svn: 20036
2005-02-04 19:59:49 +00:00
Chris Lattner d1000686cd Split mergeInGraph into two methods.
llvm-svn: 20035
2005-02-04 19:58:28 +00:00
Chris Lattner ba954f3284 Fix the Regression/Transforms/DSAnalysis/recursion.ll regression.
llvm-svn: 20031
2005-02-04 18:58:04 +00:00
Chris Lattner 0559691163 Fix a case where were incorrectly compiled cast from short to int on 64-bit
targets.

llvm-svn: 20030
2005-02-04 18:39:19 +00:00
Andrew Lenharth 5152be292a alignment
llvm-svn: 20028
2005-02-04 14:09:38 +00:00
Andrew Lenharth 202011fcc7 get alignment printing correctly and get rid of __main hack
llvm-svn: 20027
2005-02-04 14:01:21 +00:00
Andrew Lenharth c8770aa507 fix constant pointer outputing on 64 bit machines
llvm-svn: 20026
2005-02-04 13:47:16 +00:00
Andrew Lenharth 799479138e FP fixes
llvm-svn: 20019
2005-02-03 21:01:15 +00:00
Chris Lattner 3dd3df2b55 Refactor getFunctionArgumentsForCall out of mergeInGraph.
llvm-svn: 20018
2005-02-03 18:40:25 +00:00
Chris Lattner 45a6a18393 This is no longer needed. Global variables with undef initializers can be
initialized to anything, including garbage.

llvm-svn: 20010
2005-02-02 20:50:50 +00:00
Andrew Lenharth 75c6225f32 Store fix
llvm-svn: 20004
2005-02-02 17:32:39 +00:00
Andrew Lenharth cf2e21e879 oops
llvm-svn: 20003
2005-02-02 17:01:31 +00:00
Andrew Lenharth fe6e7a30c0 prevent register allocator from using the stack pointer :)
llvm-svn: 20002
2005-02-02 17:00:21 +00:00
Andrew Lenharth c7042c2d8b fix loading of floats
llvm-svn: 19997
2005-02-02 15:05:33 +00:00
Andrew Lenharth 0f42d92ca0 marked mem* as not supported
llvm-svn: 19992
2005-02-02 05:49:42 +00:00
Alkis Evlogimenos 346bb20409 Fix crash on MallocInsts of unsized types.
llvm-svn: 19988
2005-02-02 04:43:37 +00:00
Andrew Lenharth 07c0b0d92b fix Load bug
llvm-svn: 19987
2005-02-02 04:35:44 +00:00
Chris Lattner 5aa75e4ce5 Fix yet another memset issue.
llvm-svn: 19986
2005-02-02 03:44:41 +00:00
Andrew Lenharth c7e55f430c try to make a bug bugpointable, add yet more constant pool stuff, fixup constant loads for FP
llvm-svn: 19985
2005-02-02 03:36:35 +00:00
Andrew Lenharth ae88b6a8a8 better constant handling, should fix many remaining cases
llvm-svn: 19984
2005-02-02 00:51:15 +00:00
Chris Lattner 16a53243c6 Eliminate some duplicated debug code
llvm-svn: 19980
2005-02-01 21:55:40 +00:00
Chris Lattner 5ce51e83af Eliminate self-recursion as a special case.
llvm-svn: 19979
2005-02-01 21:49:43 +00:00
Chris Lattner 50cebc6b9b Eliminate use of DSCallSiteIterator in key loop. This is a half step to
a tasty speedup.

llvm-svn: 19978
2005-02-01 21:37:27 +00:00
Andrew Lenharth 9df6a764b9 fix FP arg passing bug, Add unsigned to/from int, fix SELECT, fix Constant pool
llvm-svn: 19976
2005-02-01 20:40:27 +00:00
Andrew Lenharth 20d8b2ff71 Print the Constant pool
llvm-svn: 19975
2005-02-01 20:38:53 +00:00
Andrew Lenharth 32124c0a70 Make cmov work right and loads for fp from constant pool
llvm-svn: 19974
2005-02-01 20:36:44 +00:00
Andrew Lenharth c777d4f03d Correct stack stuff for FP
llvm-svn: 19973
2005-02-01 20:35:57 +00:00
Andrew Lenharth 8fb0d5002b try to match alpha pattern
llvm-svn: 19972
2005-02-01 20:35:11 +00:00
Andrew Lenharth 7703d1ab25 fix register names
llvm-svn: 19971
2005-02-01 20:34:29 +00:00
Chris Lattner 63a46cee87 Signficantly speed up printing by not emitting the same file twice with
different names.  Large SCC's tend to be big, so this saves a lot of time.

llvm-svn: 19970
2005-02-01 19:10:48 +00:00
Chris Lattner 4487b2e5a6 Fix some bugs andrew noticed legalizing memset for alpha
llvm-svn: 19969
2005-02-01 18:38:28 +00:00
Chris Lattner d6106a41fe Do not revisit nodes in the SCC traversal. This speeds up the BU pass a bit.
llvm-svn: 19968
2005-02-01 17:35:52 +00:00
Chris Lattner 085c981345 Fix test/Regression/Assembler/2005-01-31-CallingAggregateFunction.ll
llvm-svn: 19966
2005-02-01 01:47:42 +00:00
Chris Lattner 29b97d53c1 Apparently := confuses makellvm
llvm-svn: 19965
2005-02-01 01:47:12 +00:00
Andrew Lenharth cdc9e33ae5 pecimise loads, put indirect call addr in right register. still doesn't fix methcall
llvm-svn: 19963
2005-02-01 01:37:24 +00:00
Chris Lattner 4947e67c4f Updates for new use list changes.
llvm-svn: 19961
2005-02-01 01:24:21 +00:00
Chris Lattner b6c21dbb1e Update for API change.
llvm-svn: 19960
2005-02-01 01:24:01 +00:00
Chris Lattner 82b42c5d85 API change.
llvm-svn: 19959
2005-02-01 01:23:49 +00:00
Chris Lattner d6a4492f81 Adjust to changes in APIs
llvm-svn: 19958
2005-02-01 01:23:31 +00:00
Chris Lattner f98a7bffb3 Hacks to make this ugly ugly code work with the new use lists.
llvm-svn: 19957
2005-02-01 01:22:56 +00:00
Chris Lattner 1230cf25ba Fix a problem where we could infinitely recurse on phi nodes.
llvm-svn: 19955
2005-02-01 00:18:30 +00:00
Misha Brukman 8dfa2e4465 Fix hyphenation in output comment
llvm-svn: 19954
2005-01-31 06:19:57 +00:00
Chris Lattner 72684fecf8 Implement InstCombine/cast.ll:test25, a case that occurs many times
in spec

llvm-svn: 19953
2005-01-31 05:51:45 +00:00
Chris Lattner 31f486c775 Implement the trivial cases in InstCombine/store.ll
llvm-svn: 19950
2005-01-31 05:36:43 +00:00
Chris Lattner fe1b0b8b24 Implement Transforms/InstCombine/cast-load-gep.ll, which allows us to devirtualize
11 indirect calls in perlbmk.

llvm-svn: 19947
2005-01-31 04:50:46 +00:00
Andrew Lenharth ae25bb1dc5 indirect call fix
llvm-svn: 19945
2005-01-31 03:19:31 +00:00
Andrew Lenharth c40d156dc9 fp to int and back conversion sequences
llvm-svn: 19944
2005-01-31 01:44:26 +00:00
Chris Lattner ccf22fb182 Fix the regressions my User changes introduced. Apparently some parts of
LLVM make the very reasonable assumption that constant expressions will
have at least one operand! :)

llvm-svn: 19943
2005-01-31 01:11:13 +00:00
Chris Lattner 2ca79d339e Rename variables to work with VC++'s hokey scoping rules.
llvm-svn: 19942
2005-01-31 00:10:58 +00:00
Chris Lattner 2977b857c2 Fix some scary bugs that VC++ detected.
llvm-svn: 19941
2005-01-31 00:10:45 +00:00
Chris Lattner a1b39fa5ad * Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
  This makes many operations on these lists much more natural, and avoids
  *exteremely* expensive copying of DSCallSites (e.g. moving nodes around
  between lists, erasing a node from not the end of the vector, etc).

With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc.  I expect that it would help TD even more, but I don't
have data for it.

This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.

llvm-svn: 19939
2005-01-30 23:51:02 +00:00
Andrew Lenharth 7141334f98 added fp extend and removed a forgotten assert in more than 6 arg support (should break somewhere else now :) ) and fix an incorrect asm sequence for indirect calls
llvm-svn: 19938
2005-01-30 20:42:36 +00:00
Chris Lattner 8e62f434cd This code is really unreachable.
llvm-svn: 19934
2005-01-30 16:33:46 +00:00
Chris Lattner bfa060c5d2 Fix warnings.
llvm-svn: 19933
2005-01-30 16:32:48 +00:00
Andrew Lenharth 918a29fc51 support for larger calls
llvm-svn: 19932
2005-01-30 00:35:27 +00:00
Chris Lattner f6c93e36c7 Improve conformance with the Misha spelling benchmark suite
llvm-svn: 19930
2005-01-30 00:09:23 +00:00
Tanya Lattner 5ca41e2b68 Make this work on systems where size_t == unsigned and where they are not
the same.

llvm-svn: 19929
2005-01-29 23:29:55 +00:00
Tanya Lattner 238cf92000 Make this work on systems where size_t is not the same as unsigned.
llvm-svn: 19928
2005-01-29 23:08:01 +00:00
Chris Lattner fdec565f1f Unbreak the build :(
llvm-svn: 19926
2005-01-29 19:27:28 +00:00
Chris Lattner e6074aa08b adjust to ilist changes.
llvm-svn: 19924
2005-01-29 18:41:25 +00:00
Chris Lattner e5c7b9a215 Adjust to ilist changes.
llvm-svn: 19923
2005-01-29 18:41:12 +00:00
Chris Lattner 800b72445f This file was schizophrenic when it came to representing sizes. In some
cases it represented them as 'unsigned's, which are not enough for 64-bit
hosts.  In other cases, it represented them as uint64_t's, which are
inefficient for 32-bit hosts.

This patch unifies all of the sizes to use size_t instead.

llvm-svn: 19918
2005-01-29 17:17:18 +00:00
Chris Lattner bb4384ba71 After reading in a bc file, trim the resultant buffer down to what we
really need.  This reduces 4M of memory consumption reading 176.gcc.

llvm-svn: 19916
2005-01-29 17:05:56 +00:00
Chris Lattner 173340640a Finegrainify namespacification
llvm-svn: 19915
2005-01-29 16:53:02 +00:00
Andrew Lenharth 41bc2c2897 first step towards a correct and complete stack. also add some forms for things that were getting stuck in the nightly tester.
llvm-svn: 19914
2005-01-29 15:42:07 +00:00
Chris Lattner 1ec230e665 Due to previous simplifications, we can simplify the data structures being
used here.

llvm-svn: 19913
2005-01-29 07:04:10 +00:00
Chris Lattner ce0fa4c109 Properly handle volatile.
llvm-svn: 19912
2005-01-29 06:42:34 +00:00
Chris Lattner a194357025 Remove some useless map operations. Loads/stores that are in the same
BB as the load are not included in the Cand* sets at all.

llvm-svn: 19911
2005-01-29 06:39:25 +00:00
Chris Lattner be62e72273 Before doing expensive global analysis, check to make sure the pointer is
not invalidated on entry and on exit of the block.  This fixes some N^2
behavior in common cases, and speeds up gcc another 5% to 22.35s.

llvm-svn: 19910
2005-01-29 06:31:53 +00:00
Chris Lattner fe7a9a242e Minor simplification/speedup. Replaces a set lookup with a pointer comparison.
This speeds up 176.gcc from 25.73s to 23.48s, which is 9.5%

llvm-svn: 19907
2005-01-29 06:20:55 +00:00
Chris Lattner 787aed675d Eliminate generality that is not buying us anything. In particular, this
will cause us to miss cases where the input pointer to a load could be value
numbered to another load.  Something like this:


  %X = load int* %P1
  %Y = load int* %P2

Those are obviously the same if P1/P2 are the same.  The code this patch
removes attempts to handle that.  However, since GCSE iterates, this doesn't
actually buy us anything: GCSE will first replace P1 or P2 with the other
one, then the load can be value numbered as equal.

Removing this code speeds up gcse a lot.  On 176.gcc in debug mode, this
speeds up gcse from 29.08s -> 25.73s, a 13% savings.

llvm-svn: 19906
2005-01-29 06:11:16 +00:00
Chris Lattner b25abcb1fa If we see:
%A = alloca int
  %V = load int* %A

value number %V to undef, not 0.

llvm-svn: 19905
2005-01-29 05:57:01 +00:00
Chris Lattner 2295d0b7de Memory used is a delta between memuse at the start of the time and the
memuse at the end, thus it is signed.

llvm-svn: 19904
2005-01-29 05:21:16 +00:00
Chris Lattner f711f8db41 Make sure that we always grow a multiple of 2 operands.
llvm-svn: 19902
2005-01-29 01:05:12 +00:00
Chris Lattner d8e20188c6 Adjust to changes in instruction interfaces.
llvm-svn: 19900
2005-01-29 00:39:08 +00:00
Chris Lattner a3f06fa2dd Switchinst takes a hint for the number of cases it will have.
llvm-svn: 19899
2005-01-29 00:38:45 +00:00
Chris Lattner a35dfcedd3 switchinst ctor now takes a hint for the number of cases that it will have.
llvm-svn: 19898
2005-01-29 00:38:26 +00:00
Chris Lattner 84d3137da7 Adjust Valuehandle to hold its operand directly in it.
llvm-svn: 19897
2005-01-29 00:37:36 +00:00
Chris Lattner 3479f9cca8 Finegrainify namespacification.
Adjust TmpInstruction to work with the new User model.

llvm-svn: 19896
2005-01-29 00:36:59 +00:00
Chris Lattner 68afd89730 add namespace qualifier
llvm-svn: 19895
2005-01-29 00:36:38 +00:00
Chris Lattner 616b8fc630 Adjust to changes in User class and minor changes in instruction ctors.
llvm-svn: 19894
2005-01-29 00:36:19 +00:00
Chris Lattner 2c08949c62 Adjust to slight changes in instruction interfaces.
llvm-svn: 19893
2005-01-29 00:35:55 +00:00
Chris Lattner 5d1bc2c408 Adjust to changes in User class.
llvm-svn: 19892
2005-01-29 00:35:33 +00:00
Chris Lattner afdb3de4d7 Merge InstrTypes.cpp into this file
Adjust to changes in the User class, operand handling is very different.
PHI node and switch statements must handle explicit resizing of operand
lists.

llvm-svn: 19891
2005-01-29 00:35:16 +00:00
Chris Lattner d0df99ce86 Adjust to changes in User class. Aggregate constants now must explicitly
manage their operands.

llvm-svn: 19890
2005-01-29 00:34:39 +00:00
Chris Lattner 03adb1aa83 This file is now merged into Instructions.cpp
llvm-svn: 19889
2005-01-29 00:33:32 +00:00
Andrew Lenharth 4a0d200c13 fix ExprMap, partially teach about add long
llvm-svn: 19882
2005-01-28 23:17:54 +00:00
Chris Lattner feaf92f7ad Fix a nasty thinko in my previous commit.
llvm-svn: 19881
2005-01-28 23:17:27 +00:00
Chris Lattner bc7497d5f5 Alpha doesn't have a native f32 extload instruction.
llvm-svn: 19880
2005-01-28 22:58:25 +00:00
Chris Lattner bf8c1ad313 implement legalization of truncates whose results and sources need to be
truncated, e.g. (truncate:i8 something:i16) on a 32 or 64-bit RISC.

llvm-svn: 19879
2005-01-28 22:52:50 +00:00
Chris Lattner a4cfafe31a Get alpha working with memset/memcpy/memmove
llvm-svn: 19878
2005-01-28 22:29:18 +00:00
Chris Lattner cd517ff0c7 * add some DEBUG statements
* Properly compile this:

struct a {};
int test() {
  struct a b[2];
  if (&b[0] != &b[1])
    abort ();
  return 0;
}

to 'return 0', not abort().

llvm-svn: 19875
2005-01-28 19:32:01 +00:00
Chris Lattner 60c47267a9 Fix ConstProp/2005-01-28-SetCCGEP.ll: indexing over zero sized elements does
not change the address.

llvm-svn: 19874
2005-01-28 19:09:51 +00:00
Andrew Lenharth 579a324137 fix ExprMap and constant check in setcc
llvm-svn: 19870
2005-01-28 14:06:46 +00:00
Andrew Lenharth 479bc61455 move FP into it's own select
llvm-svn: 19867
2005-01-28 06:57:18 +00:00
Chris Lattner eb6614d719 CopyFromReg produces two values. Make sure that we remember that both are
legalized, and actually return the correct result when we legalize the chain first.

llvm-svn: 19866
2005-01-28 06:27:38 +00:00
Chris Lattner c782335e33 Remove this code as it is currently completely broken and unmaintained.
If needed, this can be resurrected from CVS.

Note that several of the interfaces (e.g. the IPModRef ones) are supersumed
by generic AliasAnalysis interfaces that have been written since this code
was developed (and they are not DSA specific).

llvm-svn: 19864
2005-01-28 06:12:46 +00:00
Jeff Cohen 971e03d74a Properly close mapped files.
llvm-svn: 19863
2005-01-28 01:17:07 +00:00
Andrew Lenharth 7c538a6593 stack frame fix and zero FP reg fix
llvm-svn: 19857
2005-01-27 08:31:19 +00:00
Andrew Lenharth 96515adad6 Floating point instructions like Floating point registers
llvm-svn: 19856
2005-01-27 07:58:15 +00:00
Andrew Lenharth 0cceb5165e int to float conversion and another setcc
llvm-svn: 19855
2005-01-27 07:50:35 +00:00
Misha Brukman 3852f652bf Fix grammar
llvm-svn: 19854
2005-01-27 06:46:38 +00:00
Andrew Lenharth 3c361fd6f7 teach isel about comparison with constants and zero extending bits
llvm-svn: 19853
2005-01-27 03:49:45 +00:00
Jeff Cohen 9671b213b6 Fix some Path bugs
llvm-svn: 19852
2005-01-27 03:49:03 +00:00
Andrew Lenharth 5374789198 perhaps this will let me have calls again
llvm-svn: 19851
2005-01-27 01:22:48 +00:00
Andrew Lenharth 9e27e54d70 minor bug fix
llvm-svn: 19850
2005-01-27 00:52:26 +00:00
Andrew Lenharth 9748b623a4 minor bug fix
llvm-svn: 19849
2005-01-27 00:51:05 +00:00
Andrew Lenharth 267908ad47 added instructions for fp to int to fp moves
llvm-svn: 19848
2005-01-26 23:56:48 +00:00
Andrew Lenharth 5ae5f81720 initial fp support
llvm-svn: 19847
2005-01-26 21:54:09 +00:00
Andrew Lenharth 589304de7f hum, writing on one machine, testing on another...
llvm-svn: 19844
2005-01-26 02:53:56 +00:00
Andrew Lenharth 02c5459948 add some operations, fix others. should compile several more tests now
llvm-svn: 19843
2005-01-26 01:24:38 +00:00
Chris Lattner 1b20615173 We can fold promoted and non-promoted loads into divs also!
llvm-svn: 19835
2005-01-25 20:35:10 +00:00
Chris Lattner 30607ec66e Fold promoted loads into binary ops for FP, allowing us to generate m32 forms
of FP ops.

llvm-svn: 19834
2005-01-25 20:03:11 +00:00
Andrew Lenharth ba2bcd867f problems with bools, and their work arounds
llvm-svn: 19833
2005-01-25 19:58:40 +00:00
Alkis Evlogimenos fbd921987f Add a dependency to the trace library so that it gets pulled in
automatically.

llvm-svn: 19828
2005-01-25 16:23:57 +00:00
Andrew Lenharth 122489bcab more load choices, better add with imm
llvm-svn: 19821
2005-01-25 00:35:34 +00:00
Chris Lattner 2e2edef9c6 Make -ds-aa more useful, allowing it to be updated as xforms hack on the program.
llvm-svn: 19818
2005-01-24 20:00:14 +00:00
Andrew Lenharth 2f0f845534 Clean ups, and taught the instruction selector about immediate forms
llvm-svn: 19816
2005-01-24 19:44:07 +00:00
Andrew Lenharth 6d1a96bccc Alpha JIT prune
llvm-svn: 19815
2005-01-24 18:48:22 +00:00
Andrew Lenharth 3c12772190 include prune and JIT prune
llvm-svn: 19814
2005-01-24 18:45:41 +00:00
Andrew Lenharth 4680f89526 Pruned includes
llvm-svn: 19813
2005-01-24 18:37:48 +00:00
Chris Lattner 39837024ae Fix a spurious warning.
llvm-svn: 19799
2005-01-24 01:40:18 +00:00
Chris Lattner 0e1de101a1 Silence a warning.
llvm-svn: 19798
2005-01-23 23:20:06 +00:00
Chris Lattner 0dfd7d3a0d Silence optimized warnings.
llvm-svn: 19797
2005-01-23 23:19:44 +00:00
Chris Lattner debae1e3c3 Allow the FP stackifier to completely ignore functions that do not use FP at
all.  This should speed up the X86 backend fairly significantly on integer
codes.  Now if only we didn't have to compute livevar still... ;-)

llvm-svn: 19796
2005-01-23 23:13:59 +00:00
Chris Lattner fb5614506e Simplify/speedup the PEI by not having to scan for uses of the callee saved
registers.  This information is computed directly by the register allocator
now.

llvm-svn: 19795
2005-01-23 23:13:12 +00:00
Chris Lattner 3d527f7b61 Update physregsused info.
llvm-svn: 19793
2005-01-23 22:55:45 +00:00
Chris Lattner 24f0f0e28f Update this pass to set PhysRegsUsed info in MachineFunction.
llvm-svn: 19792
2005-01-23 22:51:56 +00:00
Chris Lattner ae09d93b35 Update these register allocators to set the PhysRegUsed info in MachineFunction.
llvm-svn: 19791
2005-01-23 22:45:13 +00:00
Chris Lattner 304053c6ec Add support for the PhysRegsUsed array.
llvm-svn: 19789
2005-01-23 22:13:58 +00:00
Chris Lattner ef2de322c6 Speed this up a bit by making ModifiedRegs a vector<char> not vector<bool>
llvm-svn: 19787
2005-01-23 21:45:01 +00:00
Chris Lattner 9e2c7facb2 Get rid of a several dozen more and instructions in specint.
llvm-svn: 19786
2005-01-23 20:26:55 +00:00
Chris Lattner 6c43f5e5fe Fix crash comparing empty file against nonempty file.
llvm-svn: 19782
2005-01-23 06:02:40 +00:00
Chris Lattner 4add7e356f Adjust to changes in SelectionDAG interfaces
The first half of correct chain insertion for libcalls. This is not enough
to fix Fhourstones yet though.

llvm-svn: 19781
2005-01-23 04:42:50 +00:00
Chris Lattner 90b7c13f3a Remove the 3 HACK HACK HACKs I put in before, fixing them properly with
the new TLI that is available.

Implement support for handling out of range shifts.  This allows us to
compile this code (a 64-bit rotate):

unsigned long long f3(unsigned long long x) {
  return (x << 32) | (x >> (64-32));
}

into this:

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

GCC produces this:

$ gcc t.c -masm=intel -O3 -S -o - -fomit-frame-pointer
..
f3:
        push    %ebx
        mov     %ebx, DWORD PTR [%esp+12]
        mov     %ecx, DWORD PTR [%esp+8]
        mov     %eax, %ebx
        mov     %edx, %ecx
        pop     %ebx
        ret

The Simple ISEL produces (eww gross):

f3:
        sub %ESP, 4
        mov DWORD PTR [%ESP], %ESI
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %ECX, DWORD PTR [%ESP + 12]
        mov %EAX, 0
        mov %ESI, 0
        or %EAX, %ECX
        or %EDX, %ESI
        mov %ESI, DWORD PTR [%ESP]
        add %ESP, 4
        ret

llvm-svn: 19780
2005-01-23 04:39:44 +00:00
Chris Lattner ffcb0ae329 Adjust to changes in SelectionDAG interface.
llvm-svn: 19779
2005-01-23 04:36:26 +00:00
Chris Lattner 28939a222e Build Alpha by default.
llvm-svn: 19777
2005-01-23 04:34:46 +00:00
Reid Spencer d5d45b8d1a Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca
llvm-svn: 19776
2005-01-23 04:32:47 +00:00
Reid Spencer 30226da5b3 Support Cygwin assembly generation. The cygwin version of Gnu ASsembler
doesn't support certain directives and symbols on cygwin are prefixed with
an underscore. This patch makes the necessary adjustments to the output.

llvm-svn: 19775
2005-01-23 03:52:14 +00:00
Chris Lattner b782187b32 Make DiffFilesWithTolerance take sys::Path's instead of std::strings
Delete dead functions.

llvm-svn: 19771
2005-01-23 03:31:02 +00:00
Chris Lattner 364e8b771d Fix a bug in previous checkin
llvm-svn: 19769
2005-01-23 03:19:13 +00:00
Chris Lattner 16a4368c40 Add a new method, refactored out of fpcmp
llvm-svn: 19766
2005-01-23 03:13:43 +00:00
Andrew Lenharth a1b5ca2b9d Let me introduce you to the early stages of the llvm backend for the alpha processor
llvm-svn: 19764
2005-01-22 23:41:55 +00:00
Chris Lattner eccb73d57f Get this to work for 64-bit systems.
llvm-svn: 19763
2005-01-22 23:04:37 +00:00
Jeff Cohen c8f1f4bc8e Use binary mode for reading/writing bytecode files
llvm-svn: 19751
2005-01-22 17:36:17 +00:00
Jeff Cohen ccbd3f0d57 Fix destroyDirectory bug
llvm-svn: 19746
2005-01-22 16:28:33 +00:00
Chris Lattner 52c97fbea9 Implicitly defined registers can clobber callee saved registers too!
This fixes the return-address-not-being-saved problem in the Alpha backend.

llvm-svn: 19741
2005-01-22 00:49:16 +00:00
Chris Lattner 3bc78b2e0b More bugfixes for IA64 shifts.
llvm-svn: 19739
2005-01-22 00:33:03 +00:00
Chris Lattner ec2183713c Fix problems with non-x86 targets.
llvm-svn: 19738
2005-01-22 00:31:52 +00:00
Chris Lattner d637c96fac Add a nasty hack to fix Alpha/IA64 multiplies by a power of two.
llvm-svn: 19737
2005-01-22 00:20:42 +00:00
Chris Lattner d53e763f18 Remove unneeded line.
llvm-svn: 19736
2005-01-21 23:43:12 +00:00
Chris Lattner 4f987bf16d test commit
llvm-svn: 19735
2005-01-21 23:38:56 +00:00
Chris Lattner fc4429e7c1 Handle comparisons of gep instructions that have different typed indices
as long as they are the same size.

llvm-svn: 19734
2005-01-21 23:06:49 +00:00
Chris Lattner e70eb9da7d Speed up folding operations into loads.
llvm-svn: 19733
2005-01-21 21:43:02 +00:00
Chris Lattner e1e844c416 The ever-important vanity pass name :)
llvm-svn: 19731
2005-01-21 21:35:14 +00:00
Chris Lattner 28edd69eb4 If the interpreter tries to execute an external function, kill it. Of course
since we are dirty, special case __main.  This should fix the infinite loop
horrible stuff that happens on linux-alpha when configuring llvm-gcc.  It
might also help cygwin, who knows??

llvm-svn: 19729
2005-01-21 19:59:37 +00:00