Commit Graph

1487 Commits

Author SHA1 Message Date
Chris Lattner
70e60cbd4d Move debug options out of header files so that the header does not have
to #include CommandLine.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2712 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:08:27 +00:00
Chris Lattner
59dcbf9c03 Move the DEBUG_LV option out of the public header file into a private header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:07:26 +00:00
Chris Lattner
e87adaac31 Avoid #including CommandLine.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:06:56 +00:00
Chris Lattner
4435ac0097 Implement a new command line option, -debug, which is meant to unify all of
the random debugging macros scattered throughout llvm.

The new DEBUG(x) macro should be used instead of special purpose debug macros.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2709 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:06:20 +00:00
Chris Lattner
71fb71628a Add ability to update existing variables with values read from the command line
to certain classes.  This is nice because it means that in header files we can
just declare a value, and still have that value be set based on a command-line
argument.  The difference is now that the #include of CommandLine.h does not
need to go into the header file as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2708 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 17:03:05 +00:00
Chris Lattner
7f9412b50d Fix bug: test/Regression/Transforms/SCCP/2002-05-21-InvalidSimplify.ll
Improperly handling edges... by not marking them alive properly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2707 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 16:07:20 +00:00
Chris Lattner
594b9fadb8 * Fix typeo
* Provide a #include of <malloc.h> so that the sun C compiler does not
  miscompile malloc function calls


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2702 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 21:10:04 +00:00
Chris Lattner
01d1ee3a4c Add implementation of SimplifyCFG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2701 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 20:50:24 +00:00
Chris Lattner
573527bd5d New CFG Simplification pass: removed from the old DCE pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2700 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 20:49:37 +00:00
Chris Lattner
76ae3445f8 Simplify interface to ConstantFoldTerminator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2697 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 20:04:50 +00:00
Chris Lattner
87a09b10f8 Fix bug: test/Regression/Transforms/CFGSimplify/2002-05-21-PHIElimination.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2694 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 19:52:49 +00:00
Chris Lattner
963b70bbf8 Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2690 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 18:05:19 +00:00
Mehwish Nagda
8532fb0d13 Fixed the makefile to not die when compiling a new, empty, source directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2688 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 15:58:24 +00:00
Chris Lattner
2e0769ea16 * Change commandline options a bit to be nicer
* Insert accurate prototypes for functions
* Insert casts to use accurate prototypes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2677 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:43:59 +00:00
Chris Lattner
ad86b74baf Hide debugging options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2676 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:39:10 +00:00
Chris Lattner
1ee34a5a5b Remove explicit support for tracing code. It should be linked into the
executable just like everything else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2674 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:17:16 +00:00
Chris Lattner
0fe380c683 Remove tracing code hack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2673 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 21:16:46 +00:00
Chris Lattner
618b4a11bb Fix bug: test/Regression/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll
That was causing a miscompilation of strtol/atoi plus others


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2669 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 20:48:03 +00:00
Chris Lattner
5245f853c5 Don't lose namespace qualifications on previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2664 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-20 17:38:26 +00:00
Chris Lattner
36346c7a1e Rename IsPowerOf2 to isPowerOf2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2663 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 21:20:19 +00:00
Vikram S. Adve
53835b8081 Link with test/Libraries/libinstr32.a for runtime routines
supporting tracing.  That should be moved to a "runtime" directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2660 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 16:00:28 +00:00
Vikram S. Adve
eb1a8453f9 Added external functions for hashing pointers to sequence numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2659 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:59:25 +00:00
Vikram S. Adve
0243ff9e62 InstrnsBefore and InstrnsAfter are now vectors instead of deques.
May be slightly less efficient but significantly reduces special
cases interfaces in code generation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:41:33 +00:00
Vikram S. Adve
1e2ddcf741 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2646 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:39:02 +00:00
Vikram S. Adve
36f0a9e5a6 Better folding getelementptr operations with mixed
array and struct indexes.
Update operand values in CallArgsDescriptor (a new class)
when replacing constant values with immediates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2645 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:34:29 +00:00
Vikram S. Adve
629b70f274 cpValue2Value now needs a vector of MachineInstr to store return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2644 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:31:08 +00:00
Vikram S. Adve
7e684a956a Annotation class for MachineInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2643 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:30:21 +00:00
Vikram S. Adve
dabb41d93d 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2642 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:29:31 +00:00
Vikram S. Adve
f66723fc4b Add integer register size field.
Make all sizes and offsets uint64_t instead of uint.
Fixed GetIndexedOffset to handle mixed array and struct indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2641 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:28:02 +00:00
Vikram S. Adve
242a8086aa 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2640 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-19 15:25:51 +00:00
Chris Lattner
78771c886a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2639 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-17 04:55:35 +00:00
Chris Lattner
a36e6c8cd5 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2637 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-16 04:37:07 +00:00
Chris Lattner
0f9fd5b0f8 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2629 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 19:57:25 +00:00
Chris Lattner
86c25fd556 Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2627 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 16:44:07 +00:00
Chris Lattner
afc38686b4 Avoid emitting a useless comment for a basic block with no uses (which
often happens for the entry basic block of a function)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2624 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 16:02:05 +00:00
Chris Lattner
b3bc8fa755 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."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2623 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 15:24:07 +00:00
Chris Lattner
c99428f3c9 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2621 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 05:23:45 +00:00
Chris Lattner
18fb2a6682 Implement elimination of loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2620 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 05:02:40 +00:00
Chris Lattner
2172db04e7 Trivial cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2617 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-13 22:04:46 +00:00
Chris Lattner
ef704a23b4 Add method to check to see if two _Instructions_ dominate each other
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2616 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-13 22:03:16 +00:00
Chris Lattner
e0e734eea0 Initial checkin of LICM pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2615 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 22:44:58 +00:00
Chris Lattner
d6b60805e8 We actually need this code for the release build to prevent link errors,
un#ifdef it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2606 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 18:54:35 +00:00
Chris Lattner
3dec1f2722 Add support for printing out statistics information when -stats is added to
the command line


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2601 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 15:38:35 +00:00
Chris Lattner
55547274bc Fix some bugs, straighten stuff out, more work needs to be done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2600 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 15:37:35 +00:00
Chris Lattner
f3f4fd50f2 Initial checkin of Statistic class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2598 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 15:36:46 +00:00
Chris Lattner
3c0193742a * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2597 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 15:29:25 +00:00
Chris Lattner
87fea85934 Initial checkin of the PiNodeInsertion pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2593 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 05:41:34 +00:00
Chris Lattner
3af3ba8b38 Last minor cleanups, this code still does not work for all cases, but it
works much better than it used to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2588 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 21:31:18 +00:00
Chris Lattner
d0c668c380 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2587 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 21:18:38 +00:00
Chris Lattner
4fbf26d2fc * Remove CInstPrintVisitor class, incorporating it into the CWriter class
* Reorder code in the file to make it more logically laid out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2586 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09 20:53:56 +00:00