Commit Graph

1028 Commits

Author SHA1 Message Date
Chris Lattner
c3afd9bf4b Make this pass substantially stronger by having it delete dead return values
as well as arguments.  Now it can delete arguments and return values which are
only passed into other arguments or are returned, if they are dead.  This causes
it to delete several hundred extra args/retvals from the C++ hello world program,
shrinking it by about 2K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9398 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 03:48:17 +00:00
Chris Lattner
ce94319558 This important patch fixes two warnings in the linker which can occur from linking
valid pieces of code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9390 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 23:03:38 +00:00
Chris Lattner
6be5e567ce Update the 'used' flag correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9366 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 04:43:18 +00:00
Chris Lattner
4cb766af4a Loop over the module, not the symbol table. This makes the code handle
unused external functions again


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9365 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 04:42:20 +00:00
Chris Lattner
efd47ba3ac Implement FunctionResolve/2003-10-21-GlobalResolveHack.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9363 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 03:35:34 +00:00
Chris Lattner
5858e1e3f3 Fix bug: FunctionResolve/2003-10-21-GlobalTypeDifference.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9359 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 23:17:56 +00:00
Chris Lattner
aeb18ce9c0 Fix bug: Linker/2003-10-21-ConflictingTypesTolerance.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9357 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 22:46:38 +00:00
Chris Lattner
f85770c9a6 Fix message to make more sense and confuse Chris less
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9354 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 21:52:20 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
bacc773d20 Reorder for minor efficiency gain
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9285 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:54:26 +00:00
Chris Lattner
3b237fcd38 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:34:28 +00:00
Chris Lattner
3c4a34e8db Fix PR#50
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9227 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 06:14:59 +00:00
Chris Lattner
cda965e28a ADd support for the new varargs instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9225 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:56:52 +00:00
Chris Lattner
9493101409 Do not crash on empty structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9195 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:03:54 +00:00
Chris Lattner
72ac148d49 Add support for 'weak' linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9171 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 18:29:00 +00:00
Chris Lattner
76590640cf This code does not require random access use_lists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9156 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 16:49:12 +00:00
Chris Lattner
28b2265eb9 Eliminate using declaration
Rewrite code to work with use_lists what are either random access or bidirectional


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9155 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 16:48:53 +00:00
Chris Lattner
fd05924946 Decrease usage of use_size()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 16:48:29 +00:00
Chris Lattner
fb42dd83f8 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9133 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 16:42:21 +00:00
Chris Lattner
f775f95369 Do not move variable sized allocations to the top of the caller, which might
break dominance relationships, and is otherwise bad.  This fixes bug:
Inline/2003-10-13-AllocaDominanceProblem.ll.  This also fixes miscompilation
of 3 176.gcc source files (reload1.c, global.c, flow.c)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 01:11:07 +00:00
Chris Lattner
8b716f66ad Whoops, we inserted into the wrong set. What's up with the dead set anyway?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9094 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 16:49:21 +00:00
Chris Lattner
46e033d28d Use external df iterators to avoid revisiting blocks in functions with
multiple setjmp calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9093 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 16:44:50 +00:00
Chris Lattner
4a650af599 Wrap code at 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9073 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 05:04:27 +00:00
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Chris Lattner
21fb3afe73 Regularize header file comment, eliminate using's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9069 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:30:47 +00:00
Chris Lattner
6d3906be28 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9067 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 01:02:33 +00:00
Chris Lattner
bb2d4de409 Checkin an improvement contributed by Bill:
Only transform call sites in a setjmp'ing function which are reachable from
the setjmp.  If the call dominates the setjmp (for example), the called
function cannot longjmp to the setjmp.

This dramatically reduces the number of invoke instructions created in some
large testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9066 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 00:57:16 +00:00
Chris Lattner
2ab6a7358e Add support to the loop canonicalization pass to make it transform loops to
have a SINGLE backedge.  This is useful to, for example, the -indvars pass.

This implements testcase LoopSimplify/single-backedge.ll and closes PR#34


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9065 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 00:37:13 +00:00
Chris Lattner
98bf436e2e Rename loop preheaders pass to loop simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9061 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-12 21:52:28 +00:00
Chris Lattner
67a9801bc5 File is renamed to LoopSimplify.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9059 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-12 21:44:18 +00:00
Chris Lattner
ee2c50cca5 First step in renaming the preheaders pass to loopsimplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9058 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-12 21:43:28 +00:00
Chris Lattner
bebd86d58e The preheader insertion pass only depends on the CFG. Mark it as such, which
allows GCCAS to only run it once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9056 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-12 19:33:10 +00:00
Brian Gaeke
17634f7668 Include <cstdio> instead of <stdio.h>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9032 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 18:46:52 +00:00
Brian Gaeke
e24b616faa Don't include Config/stdio.h or <stdio.h>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9031 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 18:46:29 +00:00
Misha Brukman
cf00c4ab3b Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:57:28 +00:00
Misha Brukman
9c9c90df8f Fixing the spelling of this filename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9009 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 16:57:31 +00:00
Chris Lattner
929c6fbcbc Update comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8965 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-08 16:56:11 +00:00
Chris Lattner
16b18fdc35 Use a set to keep track of which edges have been noticed as executable already
to avoid reprocessing PHI nodes needlessly.  This speeds up the big bad PHI
testcase 43%: from 104.9826 to 73.5157s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8964 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-08 16:55:34 +00:00
Chris Lattner
3d405b07b4 Minor fixes here and there
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8963 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-08 16:21:03 +00:00
Chris Lattner
7d275f459b Avoid building data structures we don't really need. This improves the runtime
of a test that Bill Wendling sent me from 228.5s to 105s.  Obviously there is
more improvement to be had, but this is a nice speedup which should be "felt"
by many programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8962 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-08 15:47:41 +00:00
Chris Lattner
d558dc3464 whoops, don't accidentally lose variable names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8955 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 22:58:41 +00:00
Chris Lattner
6c266db54c Fix bug: InstCombine/cast.ll:test11 / PR#7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8954 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 22:54:13 +00:00
Chris Lattner
a44d8a2897 Refactor code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8952 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 22:32:43 +00:00
Chris Lattner
da78b002ca Fix bugzilla bug #5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8930 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 19:33:31 +00:00
Chris Lattner
ebbc1a5aa0 Bill contributed this major rewrite of the -lowerswitch pass to make it generate
logarithmic conditional branch sequences instead of linear sequences.  Thanks Bill!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8928 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 18:46:23 +00:00
Chris Lattner
6061000b54 Fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8922 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 15:17:02 +00:00
Chris Lattner
4bb7c02eba Minor speedups for the instcombine pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8894 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 17:11:01 +00:00
Chris Lattner
884d6c4e10 Speed up the predicate used to decide when to inline by caching the size
of callees between executions.

On eon, in release mode, this changes the inliner from taking 11.5712s
to taking 2.2066s.  In debug mode, it went from taking 14.4148s to
taking 7.0745s.  In release mode, this is a 24.7% speedup of gccas, in
debug mode, it's a total speedup of 11.7%.

This also makes it slightly more aggressive.  This could be because we
are not judging the size of the functions quite as accurately as before.
When we start looking at the performance of the generated code, this can
be investigated further.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8893 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 15:52:43 +00:00