oota-llvm.git
22 years agoLink with test/Libraries/libinstr32.a for runtime routines
Vikram S. Adve [Sun, 19 May 2002 16:00:28 +0000 (16:00 +0000)]
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

22 years agoAdded external functions for hashing pointers to sequence numbers.
Vikram S. Adve [Sun, 19 May 2002 15:59:25 +0000 (15:59 +0000)]
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

22 years agoRuntime routines to support tracing.
Vikram S. Adve [Sun, 19 May 2002 15:49:58 +0000 (15:49 +0000)]
Runtime routines to support tracing.
Currently includes code to hash pointers to sequence numbers.
The hash table should be separated out into a separate file
since that is generic.  The rest of this code is pretty small.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2655 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoFix libs and includes for compiling with llc.
Vikram S. Adve [Sun, 19 May 2002 15:47:52 +0000 (15:47 +0000)]
Fix libs and includes for compiling with llc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2654 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdded log2 for log-base-2 and also modified IsPower2 to use it.
Vikram S. Adve [Sun, 19 May 2002 15:46:52 +0000 (15:46 +0000)]
Added log2 for log-base-2 and also modified IsPower2 to use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2653 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdded parameter IntRegSize for standard general-purpose register size.
Vikram S. Adve [Sun, 19 May 2002 15:44:07 +0000 (15:44 +0000)]
Added parameter IntRegSize for standard general-purpose register size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2652 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoNew function CreateSignExtensionInstructions.
Vikram S. Adve [Sun, 19 May 2002 15:43:31 +0000 (15:43 +0000)]
New function CreateSignExtensionInstructions.
Methods now take MachineCodeForInstruction& as an argument and record
temporary values in it directly, instead of return the temps.
Really simplifies callers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2651 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoMany functions that returned a single MachineInstr now take a
Vikram S. Adve [Sun, 19 May 2002 15:42:21 +0000 (15:42 +0000)]
Many functions that returned a single MachineInstr now take a
vector of MachineInstr* to return multiple ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2650 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoInstrnsBefore and InstrnsAfter are now vectors instead of deques.
Vikram S. Adve [Sun, 19 May 2002 15:41:33 +0000 (15:41 +0000)]
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

22 years agoBetter interface to generating machine instr for common cases
Vikram S. Adve [Sun, 19 May 2002 15:40:41 +0000 (15:40 +0000)]
Better interface to generating machine instr for common cases
(many places still need to be updated to use this interface).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2648 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoMachineInstr now inherits from Annotable.
Vikram S. Adve [Sun, 19 May 2002 15:39:59 +0000 (15:39 +0000)]
MachineInstr now inherits from Annotable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2647 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoHash pointer values to a sequence number to get identical results from
Vikram S. Adve [Sun, 19 May 2002 15:39:02 +0000 (15:39 +0000)]
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

22 years agoBetter folding getelementptr operations with mixed
Vikram S. Adve [Sun, 19 May 2002 15:34:29 +0000 (15:34 +0000)]
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

22 years agocpValue2Value now needs a vector of MachineInstr to store return values.
Vikram S. Adve [Sun, 19 May 2002 15:31:08 +0000 (15:31 +0000)]
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

22 years agoAnnotation class for MachineInstr.
Vikram S. Adve [Sun, 19 May 2002 15:30:21 +0000 (15:30 +0000)]
Annotation class for MachineInstr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2643 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoNumerous bug fixes:
Vikram S. Adve [Sun, 19 May 2002 15:29:31 +0000 (15:29 +0000)]
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

22 years agoAdd integer register size field.
Vikram S. Adve [Sun, 19 May 2002 15:28:02 +0000 (15:28 +0000)]
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

22 years agoNumerous bug fixes:
Vikram S. Adve [Sun, 19 May 2002 15:25:51 +0000 (15:25 +0000)]
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

22 years agoFix bug: test/Regression/CBackend/2002-05-16-NameCollide.ll by tracking
Chris Lattner [Fri, 17 May 2002 04:55:35 +0000 (04:55 +0000)]
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

22 years agoNew C backend testcases with first testcase
Chris Lattner [Fri, 17 May 2002 04:53:52 +0000 (04:53 +0000)]
New C backend testcases with first testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2638 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Make debug output conditional on #define
Chris Lattner [Thu, 16 May 2002 04:37:07 +0000 (04:37 +0000)]
* 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

22 years agoAdd tests of redundant load elimination
Chris Lattner [Thu, 16 May 2002 01:03:12 +0000 (01:03 +0000)]
Add tests of redundant load elimination

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2636 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoNew testcases for sub/neg reassociation
Chris Lattner [Thu, 16 May 2002 00:56:59 +0000 (00:56 +0000)]
New testcases for sub/neg reassociation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2635 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoFix testcase
Chris Lattner [Thu, 16 May 2002 00:56:36 +0000 (00:56 +0000)]
Fix testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2634 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoNew testcases to ensure sub's are maximally reassociable
Chris Lattner [Wed, 15 May 2002 21:59:31 +0000 (21:59 +0000)]
New testcases to ensure sub's are maximally reassociable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2633 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoTestcase to ensure trees structures are correctly linearized
Chris Lattner [Wed, 15 May 2002 21:56:51 +0000 (21:56 +0000)]
Testcase to ensure trees structures are correctly linearized

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2632 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoTest to ensure sub -> neg promotion is working and why.
Chris Lattner [Wed, 15 May 2002 20:30:48 +0000 (20:30 +0000)]
Test to ensure sub -> neg promotion is working and why.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2631 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoNew testcase
Chris Lattner [Wed, 15 May 2002 17:22:01 +0000 (17:22 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2630 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Fix bug: test/Regression/Transforms/GCSE/2002-05-14-OperandSwap.ll
Chris Lattner [Tue, 14 May 2002 19:57:25 +0000 (19:57 +0000)]
* 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

22 years agoNew testcase
Chris Lattner [Tue, 14 May 2002 19:56:14 +0000 (19:56 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2628 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoFix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll
Chris Lattner [Tue, 14 May 2002 16:44:07 +0000 (16:44 +0000)]
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

22 years agoNew testcase for bug
Chris Lattner [Tue, 14 May 2002 16:40:43 +0000 (16:40 +0000)]
New testcase for bug

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2626 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoRun another local value numbering phase after redundancy elimination
Chris Lattner [Tue, 14 May 2002 16:23:14 +0000 (16:23 +0000)]
Run another local value numbering phase after redundancy elimination

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2625 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAvoid emitting a useless comment for a basic block with no uses (which
Chris Lattner [Tue, 14 May 2002 16:02:05 +0000 (16:02 +0000)]
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

22 years agoFix bug: test/Regression/Transforms/InstCombine/2002-05-14-TouchDeletedInst.ll
Chris Lattner [Tue, 14 May 2002 15:24:07 +0000 (15:24 +0000)]
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

22 years agoNew testcase
Chris Lattner [Tue, 14 May 2002 15:22:50 +0000 (15:22 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2622 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoFix a major source of "type unsafety", where a cast is neccesary, but can
Chris Lattner [Tue, 14 May 2002 05:23:45 +0000 (05:23 +0000)]
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

22 years agoImplement elimination of loads
Chris Lattner [Tue, 14 May 2002 05:02:40 +0000 (05:02 +0000)]
Implement elimination of loads

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2620 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoInvoke inst has side effects!
Chris Lattner [Tue, 14 May 2002 04:20:25 +0000 (04:20 +0000)]
Invoke inst has side effects!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2619 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoNew file
Chris Lattner [Mon, 13 May 2002 22:19:50 +0000 (22:19 +0000)]
New file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2618 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoTrivial cleanups
Chris Lattner [Mon, 13 May 2002 22:04:46 +0000 (22:04 +0000)]
Trivial cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2617 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd method to check to see if two _Instructions_ dominate each other
Chris Lattner [Mon, 13 May 2002 22:03:16 +0000 (22:03 +0000)]
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

22 years agoInitial checkin of LICM pass
Chris Lattner [Fri, 10 May 2002 22:44:58 +0000 (22:44 +0000)]
Initial checkin of LICM pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2615 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoexpose LICM pass
Chris Lattner [Fri, 10 May 2002 22:44:37 +0000 (22:44 +0000)]
expose LICM pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2614 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd LICM pass to compiler
Chris Lattner [Fri, 10 May 2002 22:44:31 +0000 (22:44 +0000)]
Add LICM pass to compiler

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2613 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd prototype for LICM pass
Chris Lattner [Fri, 10 May 2002 22:44:16 +0000 (22:44 +0000)]
Add prototype for LICM pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2612 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd testcase for when there is no loop header
Chris Lattner [Fri, 10 May 2002 22:43:26 +0000 (22:43 +0000)]
Add testcase for when there is no loop header

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2611 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoA basic test that LICM is working
Chris Lattner [Fri, 10 May 2002 22:27:49 +0000 (22:27 +0000)]
A basic test that LICM is working

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2610 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoRun LICM tests
Chris Lattner [Fri, 10 May 2002 22:21:38 +0000 (22:21 +0000)]
Run LICM tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2609 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agorun LICM tests
Chris Lattner [Fri, 10 May 2002 22:21:25 +0000 (22:21 +0000)]
run LICM tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2608 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoMake sure to call the derived visit versions from the ranged iterator.
Chris Lattner [Fri, 10 May 2002 22:21:05 +0000 (22:21 +0000)]
Make sure to call the derived visit versions from the ranged iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2607 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoWe actually need this code for the release build to prevent link errors,
Chris Lattner [Fri, 10 May 2002 18:54:35 +0000 (18:54 +0000)]
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

22 years agoAdd explicit abort so optimized build knows that the function does not return
Chris Lattner [Fri, 10 May 2002 18:53:55 +0000 (18:53 +0000)]
Add explicit abort so optimized build knows that the function does not return

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2605 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd an explicit abort so that the optimized build knows the function does
Chris Lattner [Fri, 10 May 2002 18:53:21 +0000 (18:53 +0000)]
Add an explicit abort so that the optimized build knows the function does
not return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2604 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Allow a profile'd code build to be done with a simple 'make ENABLE_PROFILING=1'
Chris Lattner [Fri, 10 May 2002 18:51:54 +0000 (18:51 +0000)]
* Allow a profile'd code build to be done with a simple 'make ENABLE_PROFILING=1'
* Only build tags for include, lib, and tools, not tests
* Turn on verbose output from bison to get information about shift/reduce
  conficts (why isn't this the default??)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2603 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoExpose the lowerallocs pass
Chris Lattner [Fri, 10 May 2002 15:43:07 +0000 (15:43 +0000)]
Expose the lowerallocs pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2602 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd support for printing out statistics information when -stats is added to
Chris Lattner [Fri, 10 May 2002 15:38:35 +0000 (15:38 +0000)]
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

22 years agoFix some bugs, straighten stuff out, more work needs to be done.
Chris Lattner [Fri, 10 May 2002 15:37:35 +0000 (15:37 +0000)]
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

22 years agoInitial checkin of Statistic class
Chris Lattner [Fri, 10 May 2002 15:36:56 +0000 (15:36 +0000)]
Initial checkin of Statistic class

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2599 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoInitial checkin of Statistic class.
Chris Lattner [Fri, 10 May 2002 15:36:46 +0000 (15:36 +0000)]
Initial checkin of Statistic class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2598 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Add support for the -stats command line option to report how much is changed
Chris Lattner [Fri, 10 May 2002 15:29:25 +0000 (15:29 +0000)]
* 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

22 years agoNew testcase
Chris Lattner [Fri, 10 May 2002 15:14:54 +0000 (15:14 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2596 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoremove deprecated getInstType() method
Chris Lattner [Fri, 10 May 2002 13:28:47 +0000 (13:28 +0000)]
remove deprecated getInstType() method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2595 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoExpose the pi node insertion pass.
Chris Lattner [Fri, 10 May 2002 05:41:49 +0000 (05:41 +0000)]
Expose the pi node insertion pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2594 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoInitial checkin of the PiNodeInsertion pass
Chris Lattner [Fri, 10 May 2002 05:41:34 +0000 (05:41 +0000)]
Initial checkin of the PiNodeInsertion pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2593 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd prototype for the PiNodeInserter pass
Chris Lattner [Fri, 10 May 2002 05:40:37 +0000 (05:40 +0000)]
Add prototype for the PiNodeInserter pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2592 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoTest the Pi node inserter
Chris Lattner [Fri, 10 May 2002 05:38:39 +0000 (05:38 +0000)]
Test the Pi node inserter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2591 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoInitial checkin of testcases for Pi node inserter
Chris Lattner [Fri, 10 May 2002 05:38:18 +0000 (05:38 +0000)]
Initial checkin of testcases for Pi node inserter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2590 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoLast minor cleanups, this code still does not work for all cases, but it
Chris Lattner [Thu, 9 May 2002 21:31:18 +0000 (21:31 +0000)]
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

22 years agoTwo Cleanups to generated C code:
Chris Lattner [Thu, 9 May 2002 21:18:38 +0000 (21:18 +0000)]
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

22 years ago* Remove CInstPrintVisitor class, incorporating it into the CWriter class
Chris Lattner [Thu, 9 May 2002 20:53:56 +0000 (20:53 +0000)]
* 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

22 years agoRemove CLocalVars data structure entirely, instead of building stuff and
Chris Lattner [Thu, 9 May 2002 20:39:03 +0000 (20:39 +0000)]
Remove CLocalVars data structure entirely, instead of building stuff and
then printing it out, just print as we go.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2585 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoSimplify code by removing InstLocalVarsVisitor, replacing it with a simple
Chris Lattner [Thu, 9 May 2002 20:33:35 +0000 (20:33 +0000)]
Simplify code by removing InstLocalVarsVisitor, replacing it with a simple
inst_iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2584 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Clean up how PHI nodes are handled
Chris Lattner [Thu, 9 May 2002 20:14:10 +0000 (20:14 +0000)]
* 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2583 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoHandle setcc <global*>, 0 instructions, Global pointers are never null!
Chris Lattner [Thu, 9 May 2002 20:11:54 +0000 (20:11 +0000)]
Handle setcc <global*>, 0 instructions, Global pointers are never null!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2582 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoGive the longer name to the instruction that will probably be eliminated later
Chris Lattner [Thu, 9 May 2002 20:11:23 +0000 (20:11 +0000)]
Give the longer name to the instruction that will probably be eliminated later

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2581 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoNew testcase for wierd combine opportunity found in bzip2 benchmark
Chris Lattner [Thu, 9 May 2002 19:52:36 +0000 (19:52 +0000)]
New testcase for wierd combine opportunity found in bzip2 benchmark

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2580 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoEmit:
Chris Lattner [Thu, 9 May 2002 15:59:50 +0000 (15:59 +0000)]
Emit:
  l3_reg109 = l81_this->field0;
Instead of:
  l3_reg109 = l81_this[0u].field0;

where possible

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2579 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Print structures types correctly
Chris Lattner [Thu, 9 May 2002 15:49:41 +0000 (15:49 +0000)]
* 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)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2578 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Continue cleanup of type printing code
Chris Lattner [Thu, 9 May 2002 15:18:52 +0000 (15:18 +0000)]
* 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2577 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoGut the type printing code so there is only one copy of it instead of 3
Chris Lattner [Thu, 9 May 2002 14:40:11 +0000 (14:40 +0000)]
Gut the type printing code so there is only one copy of it instead of 3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2576 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Remove dead "constant printing" code
Chris Lattner [Thu, 9 May 2002 05:16:40 +0000 (05:16 +0000)]
* 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2575 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoRemove gross "Operand" instance variable
Chris Lattner [Thu, 9 May 2002 04:39:00 +0000 (04:39 +0000)]
Remove gross "Operand" instance variable
Remove lots of unneccesary arguments to methods

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2574 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoSimplify and clean up function calls.
Chris Lattner [Thu, 9 May 2002 04:21:21 +0000 (04:21 +0000)]
Simplify and clean up function calls.
Now indirect function calls work, except that function pointer types are not correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2573 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Remove dead function
Chris Lattner [Thu, 9 May 2002 03:56:52 +0000 (03:56 +0000)]
* Remove dead function
* Print C strings correctly
* Expand C escape sequences nicely (ie \n \t, etc get generated instead of hex escapes)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2572 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoMake Getelementptr, load & store all work the right way.
Chris Lattner [Thu, 9 May 2002 03:50:42 +0000 (03:50 +0000)]
Make Getelementptr, load & store all work the right way.
Handle global variables correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2571 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoMany random fixes:
Chris Lattner [Thu, 9 May 2002 03:28:37 +0000 (03:28 +0000)]
Many random fixes:
 * Use binary operator logic for shifts instead of cloning code
 * Unary not is '~' not '!'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2570 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoIncorporate and purge function before and after printing them so unnamed values
Chris Lattner [Thu, 9 May 2002 03:12:34 +0000 (03:12 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2569 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoFactor out the code to print a value to ONE place.
Chris Lattner [Thu, 9 May 2002 03:06:06 +0000 (03:06 +0000)]
Factor out the code to print a value to ONE place.
It turns out that unnamed values DO NOT work at all, that's next on the list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2568 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoFirst wave of cleanups, looks like the first of many.
Chris Lattner [Thu, 9 May 2002 02:28:59 +0000 (02:28 +0000)]
First wave of cleanups, looks like the first of many.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2567 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd ability to transform (x - (y - z)) into (x + (z - y))
Chris Lattner [Thu, 9 May 2002 01:29:19 +0000 (01:29 +0000)]
Add ability to transform (x - (y - z)) into (x + (z - y))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2566 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoFix broken testcase
Chris Lattner [Thu, 9 May 2002 01:28:30 +0000 (01:28 +0000)]
Fix broken testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2565 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoClean up dis so that it does not print out code in various traversal orders.
Chris Lattner [Thu, 9 May 2002 01:25:55 +0000 (01:25 +0000)]
Clean up dis so that it does not print out code in various traversal orders.
Now it only output llvm or C code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2564 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd two new patterns that instcombine should or does handle
Chris Lattner [Wed, 8 May 2002 23:15:01 +0000 (23:15 +0000)]
Add two new patterns that instcombine should or does handle

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2563 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoPrint out post dominance data structures more nicely
Chris Lattner [Wed, 8 May 2002 23:11:08 +0000 (23:11 +0000)]
Print out post dominance data structures more nicely

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2562 91177308-0d34-0410-b5e6-96231b3b80d8

22 years ago* Combine: A-(-B) -> A + B
Chris Lattner [Wed, 8 May 2002 22:46:53 +0000 (22:46 +0000)]
* Combine: A-(-B) -> A + B
* Bugfix:  A + -B and -A + B

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2561 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoNew testcase for LICM reassociation
Chris Lattner [Wed, 8 May 2002 22:20:55 +0000 (22:20 +0000)]
New testcase for LICM reassociation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2560 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoInitial checkin of expression reassociation pass
Chris Lattner [Wed, 8 May 2002 22:19:27 +0000 (22:19 +0000)]
Initial checkin of expression reassociation pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2559 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoAdd expr reassociation pass prototype
Chris Lattner [Wed, 8 May 2002 22:19:01 +0000 (22:19 +0000)]
Add expr reassociation pass prototype

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2558 91177308-0d34-0410-b5e6-96231b3b80d8

22 years agoExpose expression reassociation
Chris Lattner [Wed, 8 May 2002 22:18:34 +0000 (22:18 +0000)]
Expose expression reassociation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2557 91177308-0d34-0410-b5e6-96231b3b80d8