Commit Graph

4564 Commits

Author SHA1 Message Date
Chris Lattner
a75b3ef9a8 If the basic block has no name, make sure to print the % number of it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9375 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 16:22:42 +00:00
Chris Lattner
002362c837 Implement the Function::viewCFG* methods, for use in a debugger. Also, the
-print-cfg pass now lives here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9374 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 16:03:49 +00:00
Misha Brukman
0b51e4a438 Add comments to describe what these functions actually do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9370 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 05:50:40 +00:00
Misha Brukman
3494329a26 * Use <cmath> instead of <math.h>
* Order #includes according to LLVM coding standards


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9369 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 05:09:56 +00:00
Misha Brukman
f978ef56fc Removed completely duplicated function comment (an identical one appears later).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9368 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 04:55:09 +00:00
Misha Brukman
bb8c863e27 No, really, order the #includes correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9367 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 04:51:36 +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
Misha Brukman
523b30cb59 * Fix order of #includes to follow style guide
* It's no longer a BasicBlock pass: update comment on run() method
* Fix placement of braces to be consistent
* Delete extraneous whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9361 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 03:27:45 +00:00
Misha Brukman
2e385b4622 Converted tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9360 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-22 03:10:26 +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
Brian Gaeke
f1fce0881f Fix off-by-one error in processing of libraries named on command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9351 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 21:07:12 +00:00
Chris Lattner
2765c41c98 Make sure to add a type for va_next operands, which may not other wise
occur in the module


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9336 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 17:40:54 +00:00
Chris Lattner
389dbfbd8b Fix problem which effected linking apache
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9335 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 17:39:59 +00:00
Chris Lattner
08d702b61d Hrm, unbreak stuph :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9334 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 17:22:23 +00:00
Chris Lattner
ff3d5d9702 Fix preselection/lowerswitches bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9333 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 16:29:23 +00:00
Chris Lattner
4c62e79c59 Pull the PHI special case into it's own visit* method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9332 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 16:09:23 +00:00
Chris Lattner
d48a1d797f The lastOp operand is never used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9331 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 16:06:07 +00:00
John Criswell
aefb666d07 Added LLVM copyright notice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9324 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:29:18 +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
Chris Lattner
dac9131e28 Preselection is _not_ a basicblock pass, because it adds global variables to
the module.  This change converts it from being a basic block pass to being
a simple pass.  This allows elimination of the annotation and simplification
of the logic for moving constants into global variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 14:49:19 +00:00
Vikram S. Adve
d248652b8b When opcodes like ADD were split into reg. and immed. versions (ADDi and ADDr),
this code wasn't fixed correctly so it missed copy operations that used ADDi.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9318 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 12:29:45 +00:00
Vikram S. Adve
472c3046fe Why does g++ not even generate a warning when you miss a break statement?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9317 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 12:28:27 +00:00
Vikram S. Adve
40dee51544 Implement the new varargs instructions and intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9316 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 11:25:09 +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
Chris Lattner
e9d3c6b919 Convert this code from using annotations to using a local map
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9310 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 20:52:23 +00:00
Brian Gaeke
5c288becab Goodbye, AddRegNumToValues
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9309 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 20:44:03 +00:00
Chris Lattner
0beae0cdac Remove using declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9307 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 20:38:17 +00:00
John Criswell
6fbcc26f14 Added LLVM copyright header (for lack of a better term).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9304 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 20:19:47 +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
ce439b539f "Function"[0] == 'F', not 'M'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9297 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:10:06 +00:00
Brian Gaeke
0522b0846c Minor leftover fixups from replaceMachineCodeForFunction () change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 17:59:09 +00:00
Chris Lattner
1dd27b157b fix file header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9294 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 17:58:43 +00:00
John Criswell
7c0e022c5c Added copyright header to all C++ source files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9291 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 17:47:21 +00:00
Brian Gaeke
17b53a8733 Make replaceMachineCodeForFunction() return void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9289 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 15:17:12 +00:00
Brian Gaeke
682ce72e60 Make replaceMachineCodeForFunction return void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 15:15:17 +00:00
Chris Lattner
f6cd38d2fc Apparently the dependencies are wrong for this file, so it didn't rebuild it
when changing Instruction.def.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9286 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 14:12:52 +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
43a5ff8d40 Emit x86 instructions for: A = B op C, where A and B are 16-bit registers,
C is a constant which can be sign-extended from 8 bits without value loss,
and op is one of: add, sub, imul, and, or, xor.

This allows the JIT to emit the one byte version of the constant instead of
the two or 4 byte version.  Because these instructions are very common, this
can save a LOT of code space.  For example, I sampled two benchmarks, 176.gcc
and 254.gap.

BM        Old     New    Reduction
176.gcc 2673621 2548962  4.89%
254.gap  498261  475104  4.87%

Note that while the percentage is not spectacular, this did eliminate
124.6 _KILOBYTES_ of codespace from gcc.  Not bad.

Note that this doesn't effect the llc version at all, because the assembler
already does this optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9284 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:53:31 +00:00
Chris Lattner
e738656c0b Hrm, a relic from the past. How cute :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9283 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:45:49 +00:00
Chris Lattner
6ac1d71588 Further cleanups and simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9282 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 04:48:06 +00:00
Chris Lattner
6c09db2959 Eliminate code for pointer size and endianness emulation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9281 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 04:11:23 +00:00
Misha Brukman
44ffd5adac The Grammar Police was here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9280 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 04:03:10 +00:00
Chris Lattner
c01d1232fe * Rename X86::IMULr16 -> X86::IMULrr16
* Implement R1 = R2 * C where R1 and R2 are 32 or 16 bits. This avoids an
  extra copy into a register, reducing register pressure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9278 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 03:42:58 +00:00
Chris Lattner
a626e0242e Eliminate unused class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9270 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:39:41 +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
b2acc51bb2 * Multiplications by 2^X are turned into shifts. This factors code out of the
getelementptr code path for use by other code paths (like malloc and alloca).
* Optimize comparisons with zero
* Generate neg, not, inc, and dec instructions, when possible.

This gives some code size wins, which might translate into performance.  We'll
see tommorow in the nightly tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9267 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:09:10 +00:00