Chris Lattner
c917d106aa
Testcase for unimplemented feature
...
llvm-svn: 2766
2002-06-24 17:45:37 +00:00
Chris Lattner
0df3511df9
Checkin descriptive note
...
llvm-svn: 2765
2002-06-24 16:49:55 +00:00
Chris Lattner
5d5824b77a
Mark some stuff as done
...
llvm-svn: 2764
2002-06-10 21:15:48 +00:00
Chris Lattner
18b412df5e
New testcases for verifier
...
llvm-svn: 2763
2002-06-08 17:33:16 +00:00
Chris Lattner
2152e03bfd
Fix constness
...
llvm-svn: 2762
2002-06-05 18:11:37 +00:00
Chris Lattner
c0b158b94d
Fix Constness problems
...
llvm-svn: 2761
2002-06-05 18:08:26 +00:00
Chris Lattner
0a5aca621a
Fix const problems
...
llvm-svn: 2760
2002-06-05 17:55:27 +00:00
Chris Lattner
64802e4db8
Fix constness problem
...
llvm-svn: 2759
2002-06-05 17:49:40 +00:00
Chris Lattner
b469cf8361
Fix constness problems now that the cast operators preserve the constness
...
of their argument
llvm-svn: 2758
2002-06-05 17:38:28 +00:00
Chris Lattner
8cb1dfbdc9
* Be more typesafe: cast<x> now no longer discards constness
...
* The newly installed version of Bison now really likes there to be ;'s
after productions. Add them to avoid tons of warnings.
llvm-svn: 2757
2002-06-04 21:58:56 +00:00
Chris Lattner
070cf77a40
Disable debugging output
...
llvm-svn: 2756
2002-06-04 03:09:57 +00:00
Chris Lattner
2db70cea7c
*** empty log message ***
...
llvm-svn: 2755
2002-06-03 22:10:52 +00:00
Chris Lattner
e7779b56a0
Allow const bb's to be checked for containment in a loop
...
llvm-svn: 2754
2002-06-03 22:10:48 +00:00
Chris Lattner
194138cd08
Avoid deleting individual instructions until AFTER dead blocks have dropped
...
their references. This fixes bug:
test/Regression/Transforms/ADCE/2002-05-28-Crash*.ll
llvm-svn: 2753
2002-05-28 21:38:16 +00:00
Chris Lattner
7817cd6833
New testcase that is a distilled form of the other one
...
llvm-svn: 2752
2002-05-28 21:29:28 +00:00
Chris Lattner
d4eaa7e14c
New testcase that crashes ADCE
...
llvm-svn: 2751
2002-05-28 21:22:46 +00:00
Chris Lattner
6457590f1b
Simplify the interface to local dce and constprop
...
llvm-svn: 2750
2002-05-26 20:18:35 +00:00
Chris Lattner
ab038d44b0
Simplify the interface to local DCE and Constant prop
...
llvm-svn: 2749
2002-05-26 20:18:18 +00:00
Chris Lattner
2904f44693
Support opaque type printing a little bit at least
...
llvm-svn: 2748
2002-05-26 20:17:54 +00:00
Chris Lattner
eef79f1af4
Do not remove type names that contain a .
...
llvm-svn: 2747
2002-05-26 20:17:35 +00:00
Chris Lattner
1eb9e6cc47
Fix "unimplemented features":
...
test/Regression/Transforms/FunctionResolve/retmismatch[12].ll
This makes it much more useful for running benchmarks that are missing
prototypes for some functions.
llvm-svn: 2745
2002-05-24 21:33:26 +00:00
Chris Lattner
b9e7186ade
Testcases to show what -funcresolve does.
...
llvm-svn: 2744
2002-05-24 21:27:41 +00:00
Chris Lattner
a17c1f1735
Run FuncResolve tests
...
llvm-svn: 2743
2002-05-24 21:21:36 +00:00
Chris Lattner
5aa9e3e702
Split the FunctionResolution pass out of CleanGCCOutput.cpp.
...
llvm-svn: 2742
2002-05-24 20:42:13 +00:00
Chris Lattner
e80124df80
Fix comments to reflect reality
...
llvm-svn: 2741
2002-05-24 20:41:51 +00:00
Chris Lattner
e3da2980ad
Support programs that do not #include <malloc.h> or give a full prototype
...
for malloc and free. Lots of crufty benchmarks are using stuff like:
char *malloc();
void free();
to forward declare malloc and free. Now we recognize and raise these forms
llvm-svn: 2740
2002-05-24 20:29:18 +00:00
Chris Lattner
88a600a5fd
New testcase, to be inspected by hand
...
llvm-svn: 2739
2002-05-23 20:58:45 +00:00
Chris Lattner
f08d7436ca
No need to run dce with adce right behind!
...
llvm-svn: 2738
2002-05-23 19:27:50 +00:00
Chris Lattner
450d928d3a
New testcase
...
llvm-svn: 2737
2002-05-23 18:51:27 +00:00
Chris Lattner
c17c38f3cc
Make sure the extracted function has external linkage, so that it doesn't
...
get eliminated by globaldce!
llvm-svn: 2736
2002-05-23 18:36:25 +00:00
Chris Lattner
3f3cf8c9e2
New testcase
...
llvm-svn: 2735
2002-05-23 18:27:08 +00:00
Chris Lattner
9c2765d4aa
Fold add X, 0 for floating point types as well
...
llvm-svn: 2734
2002-05-23 17:11:38 +00:00
Chris Lattner
5cd012d58c
Fix bug: test/Regression/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
...
Which contains a description of why this is neccesary.
llvm-svn: 2733
2002-05-23 16:52:34 +00:00
Chris Lattner
2a9150be90
New testcase
...
llvm-svn: 2732
2002-05-23 16:51:25 +00:00
Chris Lattner
abe98198a8
Convert RegClass::IsColorUsedArr from a dynamically allocated array to
...
a vector. This makes asserting on array bounds easier.
llvm-svn: 2731
2002-05-23 15:50:03 +00:00
Chris Lattner
54474c75ec
Add a new setSuccessor method to terminator instructions
...
llvm-svn: 2730
2002-05-23 15:48:41 +00:00
Chris Lattner
d99d9d5aef
Implement DataTypes.h in terms of inttypes.h
...
llvm-svn: 2729
2002-05-23 15:48:12 +00:00
Chris Lattner
e8c7d75dd6
Avoid creating the symbol table if we don't need it.
...
llvm-svn: 2728
2002-05-22 22:53:05 +00:00
Chris Lattner
f4c7dd9c22
Support function declarations with either %XXX or "XXX" style for now
...
"XXX" style should be considered deprecated, and will hopefully be removed
in the future.
llvm-svn: 2727
2002-05-22 22:33:00 +00:00
Chris Lattner
143e5a47c0
Print out function name with % style instead of "" style
...
llvm-svn: 2726
2002-05-22 22:29:26 +00:00
Chris Lattner
bc42e52d9a
Remove spaces from function names
...
While I was at it, I converted functions to new style % name
llvm-svn: 2725
2002-05-22 22:28:27 +00:00
Chris Lattner
de32295d8c
New testcase
...
llvm-svn: 2724
2002-05-22 22:17:54 +00:00
Chris Lattner
b5f3a7d1c0
Run profile paths tests
...
llvm-svn: 2723
2002-05-22 22:02:24 +00:00
Chris Lattner
76792c5190
Test cases for profile paths pass
...
llvm-svn: 2722
2002-05-22 22:02:14 +00:00
Chris Lattner
e1fc2d965f
Convert code to use the DEBUG macro so that debug code can simply be
...
enabled with the -debug command line option.
llvm-svn: 2721
2002-05-22 21:56:32 +00:00
Chris Lattner
559f0ee9c9
Fix and implement ADCE to finally work!
...
llvm-svn: 2720
2002-05-22 21:32:16 +00:00
Chris Lattner
702eacab25
Add the ADCE pass to gccas finally!
...
llvm-svn: 2719
2002-05-22 21:30:24 +00:00
Chris Lattner
3c1d79d091
New testcase
...
llvm-svn: 2718
2002-05-22 20:46:30 +00:00
Chris Lattner
3df8d3e5d6
Build the extract utility
...
llvm-svn: 2717
2002-05-22 20:27:15 +00:00
Chris Lattner
055de1876a
Initial checkin of the "extract" utility
...
llvm-svn: 2716
2002-05-22 20:27:00 +00:00
Chris Lattner
5f1ddb0d94
Add more testcases for ADCE
...
llvm-svn: 2715
2002-05-22 19:22:45 +00:00
Chris Lattner
acd4599e57
Convert transforms over to standardize debugging output on -debug option
...
llvm-svn: 2714
2002-05-22 17:27:12 +00:00
Chris Lattner
71cbd42b98
Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline
...
llvm-svn: 2713
2002-05-22 17:17:27 +00:00
Chris Lattner
afc86e9a35
Move debug options out of header files so that the header does not have
...
to #include CommandLine.h.
llvm-svn: 2712
2002-05-22 17:08:27 +00:00
Chris Lattner
6264c1c0ab
Move the DEBUG_LV option out of the public header file into a private header.
...
llvm-svn: 2711
2002-05-22 17:07:26 +00:00
Chris Lattner
d5ed3694ae
Avoid #including CommandLine.h
...
llvm-svn: 2710
2002-05-22 17:06:56 +00:00
Chris Lattner
5184bdc596
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.
llvm-svn: 2709
2002-05-22 17:06:20 +00:00
Chris Lattner
8f7b500fff
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.
llvm-svn: 2708
2002-05-22 17:03:05 +00:00
Chris Lattner
a482d52ff4
Fix bug: test/Regression/Transforms/SCCP/2002-05-21-InvalidSimplify.ll
...
Improperly handling edges... by not marking them alive properly
llvm-svn: 2707
2002-05-22 16:07:20 +00:00
Chris Lattner
4dd6620dae
Must run cfgsimplify to eliminate dead blocks
...
llvm-svn: 2706
2002-05-22 15:49:14 +00:00
Chris Lattner
279aa6eb45
New testcase
...
llvm-svn: 2705
2002-05-21 22:23:38 +00:00
Chris Lattner
c839a2574e
* Fix typeo
...
* Provide a #include of <malloc.h> so that the sun C compiler does not
miscompile malloc function calls
llvm-svn: 2702
2002-05-21 21:10:04 +00:00
Chris Lattner
466a049b67
Add implementation of SimplifyCFG
...
llvm-svn: 2701
2002-05-21 20:50:24 +00:00
Chris Lattner
fa7dad8cd5
New CFG Simplification pass: removed from the old DCE pass
...
llvm-svn: 2700
2002-05-21 20:49:37 +00:00
Chris Lattner
5972e5cc5c
Expose cfg simplification pass
...
llvm-svn: 2699
2002-05-21 20:05:16 +00:00
Chris Lattner
8c1d9485cd
Simplify CFG after code generation is done
...
llvm-svn: 2698
2002-05-21 20:05:08 +00:00
Chris Lattner
4b009adc77
Simplify interface to ConstantFoldTerminator
...
llvm-svn: 2697
2002-05-21 20:04:50 +00:00
Chris Lattner
c18f65fdae
Expose CFG simplification pass
...
llvm-svn: 2696
2002-05-21 20:04:15 +00:00
Chris Lattner
9ec59c48ce
New testcase
...
llvm-svn: 2695
2002-05-21 20:03:42 +00:00
Chris Lattner
f7373e4bec
Fix bug: test/Regression/Transforms/CFGSimplify/2002-05-21-PHIElimination.ll
...
llvm-svn: 2694
2002-05-21 19:52:49 +00:00
Chris Lattner
317cb8d8c9
Update run line
...
llvm-svn: 2693
2002-05-21 19:33:17 +00:00
Chris Lattner
753dae6fff
This testcase was very broken! The block could not be merged because then
...
there would be a broken PHI node
llvm-svn: 2692
2002-05-21 19:32:58 +00:00
Chris Lattner
d29c9f9a5f
New testcase
...
llvm-svn: 2691
2002-05-21 19:22:10 +00:00
Chris Lattner
e7c7df07f3
Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.ll
...
llvm-svn: 2690
2002-05-21 18:05:19 +00:00
Chris Lattner
14829efdc5
New TEstcase
...
llvm-svn: 2689
2002-05-21 18:04:58 +00:00
Mehwish Nagda
4dbcec4295
Fixed the makefile to not die when compiling a new, empty, source directory
...
llvm-svn: 2688
2002-05-21 15:58:24 +00:00
Chris Lattner
dc682da4fc
Remove unneccesary path from link line now
...
llvm-svn: 2679
2002-05-20 21:47:40 +00:00
Chris Lattner
4b52d7fbac
Allow libraries to specify other libraries to link to
...
llvm-svn: 2678
2002-05-20 21:45:44 +00:00
Chris Lattner
ace7b8d3bd
* Change commandline options a bit to be nicer
...
* Insert accurate prototypes for functions
* Insert casts to use accurate prototypes
llvm-svn: 2677
2002-05-20 21:43:59 +00:00
Chris Lattner
99bd13b415
Hide debugging options
...
llvm-svn: 2676
2002-05-20 21:39:10 +00:00
Chris Lattner
4955d3e1c2
Fix tracing code support to link in the tracing routines if neccesary.
...
This is required because trace code can insert calls to functions that
are (now) in an LLVM library, not a native library.
This change makes it easier to use the tracing code because the native
link options don't have to change, and it fits in a lot better with the
LLVM model.
llvm-svn: 2675
2002-05-20 21:20:08 +00:00
Chris Lattner
1319429f4d
Remove explicit support for tracing code. It should be linked into the
...
executable just like everything else.
llvm-svn: 2674
2002-05-20 21:17:16 +00:00
Chris Lattner
13e8979767
Remove tracing code hack
...
llvm-svn: 2673
2002-05-20 21:16:46 +00:00
Chris Lattner
f7b31cceec
Tracelib is now an LLVM library just like all other libraries in this
...
directory.
If the test code needs to be resurrected in the future, it should be moved
into the test/Programs directory, linking with tracelib.
llvm-svn: 2672
2002-05-20 21:16:19 +00:00
Chris Lattner
008db290b8
* If hashing a pointer, cast it to a 64 bit number so gcc doesn't warn
...
* Don't put extra stuff after #endif
llvm-svn: 2671
2002-05-20 21:15:30 +00:00
Chris Lattner
6132157ab8
New testcase for bug
...
llvm-svn: 2670
2002-05-20 20:48:24 +00:00
Chris Lattner
b710b1fb22
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
2df953ba74
Use literal newline instead of endl
...
llvm-svn: 2668
2002-05-20 19:49:24 +00:00
Chris Lattner
6c1e5c4d3b
Drop something that link will never support, use gccld instead
...
llvm-svn: 2667
2002-05-20 19:48:55 +00:00
Chris Lattner
0c1b51e622
Implement the printf function, used by assert
...
llvm-svn: 2666
2002-05-20 19:11:23 +00:00
Chris Lattner
9af99f8c74
Don't lose namespace qualifications on previous patch.
...
llvm-svn: 2664
2002-05-20 17:38:26 +00:00
Chris Lattner
7f99b6f58c
Rename IsPowerOf2 to isPowerOf2
...
llvm-svn: 2663
2002-05-19 21:20:19 +00:00
Chris Lattner
84dc8633e8
Cleanups, rename IsPowerOf2 to isPowerOf2
...
llvm-svn: 2662
2002-05-19 21:19:55 +00:00
Vikram S. Adve
cf3c90d4c8
Add libsparc.a a second time to resolve link errors.
...
llvm-svn: 2661
2002-05-19 16:01:03 +00:00
Vikram S. Adve
b810407ddb
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
a77150b977
Added external functions for hashing pointers to sequence numbers.
...
llvm-svn: 2659
2002-05-19 15:59:25 +00:00
Vikram S. Adve
be31fcf252
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.
llvm-svn: 2655
2002-05-19 15:49:58 +00:00
Vikram S. Adve
423960a8a9
Fix libs and includes for compiling with llc.
...
llvm-svn: 2654
2002-05-19 15:47:52 +00:00
Vikram S. Adve
e363307e49
Added log2 for log-base-2 and also modified IsPower2 to use it.
...
llvm-svn: 2653
2002-05-19 15:46:52 +00:00
Vikram S. Adve
18d5a88024
Added parameter IntRegSize for standard general-purpose register size.
...
llvm-svn: 2652
2002-05-19 15:44:07 +00:00
Vikram S. Adve
c479fd5cd9
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.
llvm-svn: 2651
2002-05-19 15:43:31 +00:00
Vikram S. Adve
58d578957d
Many functions that returned a single MachineInstr now take a
...
vector of MachineInstr* to return multiple ones.
llvm-svn: 2650
2002-05-19 15:42:21 +00:00
Vikram S. Adve
5d78db2afb
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
d379fe042a
Better interface to generating machine instr for common cases
...
(many places still need to be updated to use this interface).
llvm-svn: 2648
2002-05-19 15:40:41 +00:00
Vikram S. Adve
a98ff36ec1
MachineInstr now inherits from Annotable.
...
llvm-svn: 2647
2002-05-19 15:39:59 +00:00
Vikram S. Adve
47f37c3404
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
16384011d2
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
069d51612f
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
1e45411a31
Annotation class for MachineInstr.
...
llvm-svn: 2643
2002-05-19 15:30:21 +00:00
Vikram S. Adve
2780d2dacb
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
8b831746be
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
e9327f0082
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
5b3057bb82
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
ee451dea68
New C backend testcases with first testcase
...
llvm-svn: 2638
2002-05-17 04:53:52 +00:00
Chris Lattner
7bc532dded
* 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
3557bd055d
Add tests of redundant load elimination
...
llvm-svn: 2636
2002-05-16 01:03:12 +00:00
Chris Lattner
168582d1da
New testcases for sub/neg reassociation
...
llvm-svn: 2635
2002-05-16 00:56:59 +00:00
Chris Lattner
a5d9be115a
Fix testcase
...
llvm-svn: 2634
2002-05-16 00:56:36 +00:00
Chris Lattner
d88f3e8d97
New testcases to ensure sub's are maximally reassociable
...
llvm-svn: 2633
2002-05-15 21:59:31 +00:00
Chris Lattner
8f143b68e0
Testcase to ensure trees structures are correctly linearized
...
llvm-svn: 2632
2002-05-15 21:56:51 +00:00
Chris Lattner
0743fbd763
Test to ensure sub -> neg promotion is working and why.
...
llvm-svn: 2631
2002-05-15 20:30:48 +00:00
Chris Lattner
4b474fc56f
New testcase
...
llvm-svn: 2630
2002-05-15 17:22:01 +00:00
Chris Lattner
cd9837d32e
* 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
a64388a25f
New testcase
...
llvm-svn: 2628
2002-05-14 19:56:14 +00:00
Chris Lattner
170ed7b6a3
Fix bug: test/Regression/Transforms/InstCombine/2002-05-14-SubFailure.ll
...
llvm-svn: 2627
2002-05-14 16:44:07 +00:00
Chris Lattner
86498988e0
New testcase for bug
...
llvm-svn: 2626
2002-05-14 16:40:43 +00:00
Chris Lattner
c914944a61
Run another local value numbering phase after redundancy elimination
...
llvm-svn: 2625
2002-05-14 16:23:14 +00:00
Chris Lattner
408dbdb9ad
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
053c0939e3
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
9e36792753
New testcase
...
llvm-svn: 2622
2002-05-14 15:22:50 +00:00
Chris Lattner
a3c3456e7f
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
d38ddb1164
Implement elimination of loads
...
llvm-svn: 2620
2002-05-14 05:02:40 +00:00
Chris Lattner
3262f9406b
Invoke inst has side effects!
...
llvm-svn: 2619
2002-05-14 04:20:25 +00:00
Chris Lattner
e00d826c7a
New file
...
llvm-svn: 2618
2002-05-13 22:19:50 +00:00
Chris Lattner
7ab51787ca
Trivial cleanups
...
llvm-svn: 2617
2002-05-13 22:04:46 +00:00
Chris Lattner
da6743e60c
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
6ec05f551c
Initial checkin of LICM pass
...
llvm-svn: 2615
2002-05-10 22:44:58 +00:00
Chris Lattner
81525db280
expose LICM pass
...
llvm-svn: 2614
2002-05-10 22:44:37 +00:00
Chris Lattner
47d923c2e0
Add LICM pass to compiler
...
llvm-svn: 2613
2002-05-10 22:44:31 +00:00
Chris Lattner
b9f60c24d9
Add prototype for LICM pass
...
llvm-svn: 2612
2002-05-10 22:44:16 +00:00
Chris Lattner
8d206636c2
Add testcase for when there is no loop header
...
llvm-svn: 2611
2002-05-10 22:43:26 +00:00
Chris Lattner
ccab0fe417
A basic test that LICM is working
...
llvm-svn: 2610
2002-05-10 22:27:49 +00:00
Chris Lattner
a31883eb2c
Run LICM tests
...
llvm-svn: 2609
2002-05-10 22:21:38 +00:00
Chris Lattner
8e0ed6ea2c
run LICM tests
...
llvm-svn: 2608
2002-05-10 22:21:25 +00:00
Chris Lattner
d5696e7125
Make sure to call the derived visit versions from the ranged iterator.
...
llvm-svn: 2607
2002-05-10 22:21:05 +00:00
Chris Lattner
e7ba5fb065
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
94b4c5fe83
Add explicit abort so optimized build knows that the function does not return
...
llvm-svn: 2605
2002-05-10 18:53:55 +00:00
Chris Lattner
e5bf51fc4f
Add an explicit abort so that the optimized build knows the function does
...
not return.
llvm-svn: 2604
2002-05-10 18:53:21 +00:00
Chris Lattner
198d5eb1c4
* 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??)
llvm-svn: 2603
2002-05-10 18:51:54 +00:00
Chris Lattner
6205c268e0
Expose the lowerallocs pass
...
llvm-svn: 2602
2002-05-10 15:43:07 +00:00
Chris Lattner
0b18c1d64e
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
bad1b4dfce
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
529ad64148
Initial checkin of Statistic class
...
llvm-svn: 2599
2002-05-10 15:36:56 +00:00
Chris Lattner
9eb0052548
Initial checkin of Statistic class.
...
llvm-svn: 2598
2002-05-10 15:36:46 +00:00
Chris Lattner
da2eddd5c4
* 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
2d032846d0
New testcase
...
llvm-svn: 2596
2002-05-10 15:14:54 +00:00
Chris Lattner
b621decdad
remove deprecated getInstType() method
...
llvm-svn: 2595
2002-05-10 13:28:47 +00:00
Chris Lattner
35cc0d2027
Expose the pi node insertion pass.
...
llvm-svn: 2594
2002-05-10 05:41:49 +00:00
Chris Lattner
014ee634ce
Initial checkin of the PiNodeInsertion pass
...
llvm-svn: 2593
2002-05-10 05:41:34 +00:00
Chris Lattner
f3d6e41d29
Add prototype for the PiNodeInserter pass
...
llvm-svn: 2592
2002-05-10 05:40:37 +00:00
Chris Lattner
3b13b58ef0
Test the Pi node inserter
...
llvm-svn: 2591
2002-05-10 05:38:39 +00:00
Chris Lattner
6a4fa1c8b5
Initial checkin of testcases for Pi node inserter
...
llvm-svn: 2590
2002-05-10 05:38:18 +00:00
Chris Lattner
e291226f02
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
d4c569c973
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
5d190e2192
* 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
2051c06119
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
5166d35e5d
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
30ad3a3238
* 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
1fc23f382e
Handle setcc <global*>, 0 instructions, Global pointers are never null!
...
llvm-svn: 2582
2002-05-09 20:11:54 +00:00
Chris Lattner
6bd7ac6205
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
ce59a3d5f5
New testcase for wierd combine opportunity found in bzip2 benchmark
...
llvm-svn: 2580
2002-05-09 19:52:36 +00:00
Chris Lattner
48cd6330d7
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
4933e7e02d
* 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
132ba2a411
* 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
eed155e6a0
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
c99a44eb25
* 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
1532dbfead
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
c897bddb17
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
2fca988a57
* 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
af14c8d51f
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
7fbd831ce5
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
ec8243a8d4
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
Chris Lattner
234ad49817
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.
llvm-svn: 2568
2002-05-09 03:06:06 +00:00
Chris Lattner
eabc647e7c
First wave of cleanups, looks like the first of many.
...
llvm-svn: 2567
2002-05-09 02:28:59 +00:00
Chris Lattner
ad3c495225
Add ability to transform (x - (y - z)) into (x + (z - y))
...
llvm-svn: 2566
2002-05-09 01:29:19 +00:00
Chris Lattner
c5a41d8af1
Fix broken testcase
...
llvm-svn: 2565
2002-05-09 01:28:30 +00:00
Chris Lattner
e693f33937
Clean up dis so that it does not print out code in various traversal orders.
...
Now it only output llvm or C code.
llvm-svn: 2564
2002-05-09 01:25:55 +00:00
Chris Lattner
936e9f0e49
Add two new patterns that instcombine should or does handle
...
llvm-svn: 2563
2002-05-08 23:15:01 +00:00
Chris Lattner
f5cbf64ed2
Print out post dominance data structures more nicely
...
llvm-svn: 2562
2002-05-08 23:11:08 +00:00
Chris Lattner
147e975c43
* Combine: A-(-B) -> A + B
...
* Bugfix: A + -B and -A + B
llvm-svn: 2561
2002-05-08 22:46:53 +00:00
Chris Lattner
90f5d5a5b1
New testcase for LICM reassociation
...
llvm-svn: 2560
2002-05-08 22:20:55 +00:00
Chris Lattner
c0f5800678
Initial checkin of expression reassociation pass
...
llvm-svn: 2559
2002-05-08 22:19:27 +00:00
Chris Lattner
5fbada2e21
Add expr reassociation pass prototype
...
llvm-svn: 2558
2002-05-08 22:19:01 +00:00
Chris Lattner
a2f3b65dec
Expose expression reassociation
...
llvm-svn: 2557
2002-05-08 22:18:34 +00:00
Chris Lattner
356ef11e5a
Run expression reassociation as part of gccas
...
llvm-svn: 2556
2002-05-08 22:18:20 +00:00
Chris Lattner
5a2dbc2b3e
Add some simple test of reassociation
...
llvm-svn: 2555
2002-05-08 21:34:22 +00:00
Chris Lattner
d75d5d19ab
run reassociate tests
...
llvm-svn: 2554
2002-05-08 21:34:11 +00:00
Chris Lattner
338a462110
Verify that function call arguments match the function signature
...
llvm-svn: 2553
2002-05-08 19:49:50 +00:00
Sumant Kowshik
cf3afd9dc5
*** empty log message ***
...
llvm-svn: 2552
2002-05-08 18:09:58 +00:00
Chris Lattner
b4bf0c1422
Spell aggressive correctly
...
llvm-svn: 2551
2002-05-07 22:15:01 +00:00