1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

1455 Commits

Author SHA1 Message Date
Chris Lattner
7563f3d1fb Remove tracing code hack
llvm-svn: 2673
2002-05-20 21:16:46 +00:00
Chris Lattner
c3d944c4f7 Fix bug: test/Regression/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll
That was causing a miscompilation of strtol/atoi plus others

llvm-svn: 2669
2002-05-20 20:48:03 +00:00
Chris Lattner
0cfea31aee Don't lose namespace qualifications on previous patch.
llvm-svn: 2664
2002-05-20 17:38:26 +00:00
Chris Lattner
db193d32ca Rename IsPowerOf2 to isPowerOf2
llvm-svn: 2663
2002-05-19 21:20:19 +00:00
Vikram S. Adve
db5bc3b4a2 Link with test/Libraries/libinstr32.a for runtime routines
supporting tracing.  That should be moved to a "runtime" directory.

llvm-svn: 2660
2002-05-19 16:00:28 +00:00
Vikram S. Adve
02f9033264 Added external functions for hashing pointers to sequence numbers.
llvm-svn: 2659
2002-05-19 15:59:25 +00:00
Vikram S. Adve
21ed1be093 InstrnsBefore and InstrnsAfter are now vectors instead of deques.
May be slightly less efficient but significantly reduces special
cases interfaces in code generation.

llvm-svn: 2649
2002-05-19 15:41:33 +00:00
Vikram S. Adve
c0db1765f4 Hash pointer values to a sequence number to get identical results from
lli and llc.  This is controlled with options -tracehash on|off.

Also, added an option to specify which functions should be traced.
Particularly useful to reduce output volume in basic-block tracing.

llvm-svn: 2646
2002-05-19 15:39:02 +00:00
Vikram S. Adve
3d968bccd8 Better folding getelementptr operations with mixed
array and struct indexes.
Update operand values in CallArgsDescriptor (a new class)
when replacing constant values with immediates.

llvm-svn: 2645
2002-05-19 15:34:29 +00:00
Vikram S. Adve
883c425f15 cpValue2Value now needs a vector of MachineInstr to store return values.
llvm-svn: 2644
2002-05-19 15:31:08 +00:00
Vikram S. Adve
1f8badf623 Annotation class for MachineInstr.
llvm-svn: 2643
2002-05-19 15:30:21 +00:00
Vikram S. Adve
6133689517 Numerous bug fixes:
-- passing FP arguments to functions with more than 6 arguments
-- passing FP arguments to varargs functions
-- passing FP arguments to functions with no prototypes
-- incorrect coloring for CC registers (both int and FP): interferences
   were being completely ignored for int CC and were considered but no
   spills were marked for fp CC!

Also some code improvements:
-- better interface to generating machine instr for common cases
   (many places still need to be updated to use this interface)
-- annotations on MachineInstr to communicate information from
   one codegen phase to another (now used to pass information about
   CALL/JMPLCALL operands from selection to register allocation)
-- all sizes and offests in class TargetData are uint64_t instead of uint

llvm-svn: 2642
2002-05-19 15:29:31 +00:00
Vikram S. Adve
a5968c518f Add integer register size field.
Make all sizes and offsets uint64_t instead of uint.
Fixed GetIndexedOffset to handle mixed array and struct indices.

llvm-svn: 2641
2002-05-19 15:28:02 +00:00
Vikram S. Adve
fa6c24db76 Numerous bug fixes:
-- correct sign extensions for integer casts and for shift-by-constant
   instructions generated for integer multiply
-- passing FP arguments to functions with more than 6 arguments
-- passing FP arguments to varargs functions
-- passing FP arguments to functions with no prototypes
-- incorrect stack frame size when padding a section
-- folding getelementptr operations with mixed array and struct indexes
-- use uint64_t instead of uint for constant offsets in mem operands
-- incorrect coloring for CC registers (both int and FP): interferences
   were being completely ignored for int CC and were considered but no
   spills were marked for fp CC!

Also some code improvements:
-- better interface to generating machine instr for common cases
   (many places still need to be updated to use this interface)
-- annotations on MachineInstr to communicate information from
   one codegen phase to another (now used to pass information about
   CALL/JMPLCALL operands from selection to register allocation)
-- all sizes and offests in class TargetData are uint64_t instead of uint

llvm-svn: 2640
2002-05-19 15:25:51 +00:00
Chris Lattner
4d98351cea Fix bug: test/Regression/CBackend/2002-05-16-NameCollide.ll by tracking
which global variables would have name collisions if they were not mangled,
and use this info to mangle them iff they would collide.

llvm-svn: 2639
2002-05-17 04:55:35 +00:00
Chris Lattner
a524df6d1d * Make debug output conditional on #define
* Add optimization to rank computation to not recursively search when
  unneccesary.
* More agressively negate expressions to open reassociation opportunities.
* Linearize (A+B)+(C+D) into ((A+B)+C)+D

llvm-svn: 2637
2002-05-16 04:37:07 +00:00
Chris Lattner
fc21b26332 * Fix bug: test/Regression/Transforms/GCSE/2002-05-14-OperandSwap.ll
By making sure to consider binary expressions identical if their operands
are backwards, but swappable.

llvm-svn: 2629
2002-05-14 19:57:25 +00:00
Chris Lattner
8106c7a841 Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll
llvm-svn: 2627
2002-05-14 16:44:07 +00:00
Chris Lattner
f7333e31a1 Avoid emitting a useless comment for a basic block with no uses (which
often happens for the entry basic block of a function)

llvm-svn: 2624
2002-05-14 16:02:05 +00:00
Chris Lattner
0ee0c26f4e Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-TouchDeletedInst.ll
"This testcase caused instcombine to fail because it got the same instruction on
it's worklist more than once (which is ok), but then deleted the instruction.
Since the inst stayed on the worklist, as soon as it came back up to be
processed, bad things happened, and opt asserted."

llvm-svn: 2623
2002-05-14 15:24:07 +00:00
Chris Lattner
f98fefc1ea Fix a major source of "type unsafety", where a cast is neccesary, but can
be put either before or after a load.  We chose to cast the value loaded
instead of the pointer to load from.

Fixes bug: test/Regression/Transforms/LevelRaise/2002-05-10-LoadPeephole.ll

llvm-svn: 2621
2002-05-14 05:23:45 +00:00
Chris Lattner
b7688286c1 Implement elimination of loads
llvm-svn: 2620
2002-05-14 05:02:40 +00:00
Chris Lattner
fc14cb90a2 Trivial cleanups
llvm-svn: 2617
2002-05-13 22:04:46 +00:00
Chris Lattner
2735171cf5 Add method to check to see if two _Instructions_ dominate each other
llvm-svn: 2616
2002-05-13 22:03:16 +00:00
Chris Lattner
1b769f2a94 Initial checkin of LICM pass
llvm-svn: 2615
2002-05-10 22:44:58 +00:00
Chris Lattner
590bcc9629 We actually need this code for the release build to prevent link errors,
un#ifdef it.

llvm-svn: 2606
2002-05-10 18:54:35 +00:00
Chris Lattner
adba963886 Add support for printing out statistics information when -stats is added to
the command line

llvm-svn: 2601
2002-05-10 15:38:35 +00:00
Chris Lattner
1bf8912c74 Fix some bugs, straighten stuff out, more work needs to be done.
llvm-svn: 2600
2002-05-10 15:37:35 +00:00
Chris Lattner
8c131ef721 Initial checkin of Statistic class.
llvm-svn: 2598
2002-05-10 15:36:46 +00:00
Chris Lattner
0671b3db5d * Add support for the -stats command line option to report how much is changed
* Make cast-of-self-ty DCE the dead cast instruction immediately instead of
  waiting for it to be DCE'd by another sweep over the function.  This speeds
  this up noticably.

llvm-svn: 2597
2002-05-10 15:29:25 +00:00
Chris Lattner
2d91be1ab7 Initial checkin of the PiNodeInsertion pass
llvm-svn: 2593
2002-05-10 05:41:34 +00:00
Chris Lattner
a98304f4fa Last minor cleanups, this code still does not work for all cases, but it
works much better than it used to.

llvm-svn: 2588
2002-05-09 21:31:18 +00:00
Chris Lattner
4ece8deba5 Two Cleanups to generated C code:
1. Avoid printing *(&globalvariable), instead print globalvariable alone
   as a special case.
2. Inline subexpressions into expressions as much as legal that preserves
   execution characteristics of expressions.  Now we get nice (but
   over-parenthesized, oh well) things like:

     ltmp_428_7 = spec__putc(((unsigned char )((bsBuff) >> 24)), (bsStream));

   instead of five seperate instructions (bsBuff & bsStream are globals).

llvm-svn: 2587
2002-05-09 21:18:38 +00:00
Chris Lattner
9a9b801669 * Remove CInstPrintVisitor class, incorporating it into the CWriter class
* Reorder code in the file to make it more logically laid out.

llvm-svn: 2586
2002-05-09 20:53:56 +00:00
Chris Lattner
3fd3c03371 Remove CLocalVars data structure entirely, instead of building stuff and
then printing it out, just print as we go.

llvm-svn: 2585
2002-05-09 20:39:03 +00:00
Chris Lattner
5ed180c1bd Simplify code by removing InstLocalVarsVisitor, replacing it with a simple
inst_iterator.

llvm-svn: 2584
2002-05-09 20:33:35 +00:00
Chris Lattner
aa1d35be51 * Clean up how PHI nodes are handled
* Correct global variable references
* Fix loads & stores with zero indices
* Do not emit an else part of a branch if there is no code (no phi node
  and a fallthrough branch), makes code more readable to get:
  if (l2_cond240) {
    goto l13_bb10;
  }

with no else{} branch

llvm-svn: 2583
2002-05-09 20:14:10 +00:00
Chris Lattner
cd326f096f Handle setcc <global*>, 0 instructions, Global pointers are never null!
llvm-svn: 2582
2002-05-09 20:11:54 +00:00
Chris Lattner
9de1aeb91c Give the longer name to the instruction that will probably be eliminated later
llvm-svn: 2581
2002-05-09 20:11:23 +00:00
Chris Lattner
94e4578db4 Emit:
l3_reg109 = l81_this->field0;
Instead of:
  l3_reg109 = l81_this[0u].field0;

where possible

llvm-svn: 2579
2002-05-09 15:59:50 +00:00
Chris Lattner
97ae8c039e * Print structures types correctly
* Clean up generated code to not emit basic block labels and goto
  instructions if they are unneccesary (for example, fall throughs)

llvm-svn: 2578
2002-05-09 15:49:41 +00:00
Chris Lattner
93fb65370c * Continue cleanup of type printing code
* Print a newline after a malloc instruction
* Convert unprintable characters to x_ instead of _x so that we don't
  generate identifiers that start with underscores

llvm-svn: 2577
2002-05-09 15:18:52 +00:00
Chris Lattner
b3acea93cf Gut the type printing code so there is only one copy of it instead of 3
llvm-svn: 2576
2002-05-09 14:40:11 +00:00
Chris Lattner
619c55baec * Remove dead "constant printing" code
* Mangle names with only a prefix so that they are easier on the eyes.
* Put spaces around binary operators with low precedence to make them easier to read
* Don't prefix function names with &, although it's correct, it's unnecesary and
  easier to read without it.

llvm-svn: 2575
2002-05-09 05:16:40 +00:00
Chris Lattner
cde698978f Remove gross "Operand" instance variable
Remove lots of unneccesary arguments to methods

llvm-svn: 2574
2002-05-09 04:39:00 +00:00
Chris Lattner
e8573f21c7 Simplify and clean up function calls.
Now indirect function calls work, except that function pointer types are not correct.

llvm-svn: 2573
2002-05-09 04:21:21 +00:00
Chris Lattner
72286b8a3b * Remove dead function
* Print C strings correctly
* Expand C escape sequences nicely (ie \n \t, etc get generated instead of hex escapes)

llvm-svn: 2572
2002-05-09 03:56:52 +00:00
Chris Lattner
c7b3367aad Make Getelementptr, load & store all work the right way.
Handle global variables correctly.

llvm-svn: 2571
2002-05-09 03:50:42 +00:00
Chris Lattner
2a4f66f21d Many random fixes:
* Use binary operator logic for shifts instead of cloning code
 * Unary not is '~' not '!'

llvm-svn: 2570
2002-05-09 03:28:37 +00:00
Chris Lattner
87d656d2a6 Incorporate and purge function before and after printing them so unnamed values
have some hope of working right.

Function calls do not try to emit an lvalue if they return void.

llvm-svn: 2569
2002-05-09 03:12:34 +00:00