Chris Lattner
bec3b4ede1
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.
llvm-svn: 9320
2003-10-21 14:49:19 +00:00
Vikram S. Adve
b289dff9a8
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.
llvm-svn: 9318
2003-10-21 12:29:45 +00:00
Vikram S. Adve
abf40e897c
Why does g++ not even generate a warning when you miss a break statement?
...
llvm-svn: 9317
2003-10-21 12:28:27 +00:00
Vikram S. Adve
062fda7446
Implement the new varargs instructions and intrinsics.
...
llvm-svn: 9316
2003-10-21 11:25:09 +00:00
John Criswell
71d2894956
Added LLVM copyright notice to Makefiles.
...
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
Brian Gaeke
f9b97fda86
Goodbye, AddRegNumToValues
...
llvm-svn: 9309
2003-10-20 20:44:03 +00:00
John Criswell
b402729b30
Added LLVM project notice to the top of every C++ source file.
...
Header files will be on the way.
llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Brian Gaeke
9501118e3b
Minor leftover fixups from replaceMachineCodeForFunction () change.
...
llvm-svn: 9295
2003-10-20 17:59:09 +00:00
Brian Gaeke
b4ceb43a43
Make replaceMachineCodeForFunction() return void.
...
llvm-svn: 9289
2003-10-20 15:17:12 +00:00
Brian Gaeke
afbe8787cc
Make replaceMachineCodeForFunction return void.
...
llvm-svn: 9288
2003-10-20 15:15:17 +00:00
Chris Lattner
332429f023
Apparently the dependencies are wrong for this file, so it didn't rebuild it
...
when changing Instruction.def. :(
llvm-svn: 9286
2003-10-20 14:12:52 +00:00
Chris Lattner
c4f8226aaf
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.
llvm-svn: 9284
2003-10-20 05:53:31 +00:00
Chris Lattner
c83d8249cb
Further cleanups and simplifications
...
llvm-svn: 9282
2003-10-20 04:48:06 +00:00
Chris Lattner
fce0650cee
Eliminate code for pointer size and endianness emulation.
...
llvm-svn: 9281
2003-10-20 04:11:23 +00:00
Misha Brukman
be506fc1c5
The Grammar Police was here.
...
llvm-svn: 9280
2003-10-20 04:03:10 +00:00
Chris Lattner
5a577c0b28
* 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.
llvm-svn: 9278
2003-10-20 03:42:58 +00:00
Chris Lattner
87843f87b8
Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
...
llvm-svn: 9269
2003-10-19 21:34:28 +00:00
Chris Lattner
3d519c7bab
* 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.
llvm-svn: 9267
2003-10-19 21:09:10 +00:00
Chris Lattner
57825f087d
Add some new instructions. Wheee
...
llvm-svn: 9266
2003-10-19 19:25:35 +00:00
Chris Lattner
9107ee3a11
.string adds an implicit zero at the end. This is not what we wanted.
...
This fixes PR#44.
llvm-svn: 9252
2003-10-19 02:51:01 +00:00
Chris Lattner
de87c8a892
Fix bug: Jello/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.llx
...
This also fixes miscompilation of 176.gcc.
llvm-svn: 9249
2003-10-19 00:26:11 +00:00
Chris Lattner
0a276257ae
Add support for the new varargs intrinsics
...
llvm-svn: 9224
2003-10-18 05:56:40 +00:00
Chris Lattner
080765e65d
Update the sparc backend to at least compile correctly with the new varargs stuff even if it's not all implemented yet.
...
llvm-svn: 9223
2003-10-18 05:55:58 +00:00
Brian Gaeke
821c0e653c
You can't just blat the address into memory, you have to blat its
...
displacement.
llvm-svn: 9210
2003-10-17 21:47:25 +00:00
Brian Gaeke
21797d71d9
Implement replaceMachineCodeForFunction() for x86.
...
llvm-svn: 9204
2003-10-17 18:27:46 +00:00
Brian Gaeke
e966765990
Refactor jump insertion code from CompilationCallback() into insertJumpAtAddr().
...
Make insertFarJumpAtAddr() return void, because nothing uses its return value.
Remove some commented-out code.
Implement replaceMachineCodeForFunction() for SPARC.
llvm-svn: 9203
2003-10-17 18:27:37 +00:00
Brian Gaeke
4380148f33
Add prototype for replaceMachineCodeForFunction().
...
llvm-svn: 9202
2003-10-17 18:27:25 +00:00
Brian Gaeke
7157eed00f
Remove extra blank line.
...
llvm-svn: 9196
2003-10-17 18:09:10 +00:00
Alkis Evlogimenos
5a1f705c88
Eliminate some extraneous code in SlotCalculator::insertVal().
...
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().
llvm-svn: 9190
2003-10-17 02:02:40 +00:00
Brian Gaeke
edea9eca83
Fix typo in comment.
...
llvm-svn: 9187
2003-10-16 23:45:05 +00:00
Chris Lattner
f46c45682a
Add support for 'weak' linkage.
...
llvm-svn: 9171
2003-10-16 18:29:00 +00:00
Chris Lattner
f2ed60c0b7
Decrease usage of use_size()
...
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Chris Lattner
c115e75755
Output a contorted sequence of instructions to make sure that we don't access
...
off the bottom of the stack. This fixes PR#41
llvm-svn: 9114
2003-10-14 19:09:05 +00:00
Chris Lattner
907de53acb
Disable the leaf function optimization, which is apparently not legal on
...
X86/linux. :( The problem is that a signal delivered while the function
is executing could clobber the functions stack. This is a partial fix
for PR41.
llvm-svn: 9113
2003-10-14 18:52:41 +00:00
Brian Gaeke
add2fc5294
Remove WordsEmitted statistic; there's already a non-backend-specific
...
jello statistic for this (just divide #-bytes-of-code-emitted by 4).
Rewrite head-of-file comment.
llvm-svn: 9098
2003-10-13 19:51:20 +00:00
Chris Lattner
b6c8569f05
Regularize header file comments
...
llvm-svn: 9071
2003-10-13 03:32:08 +00:00
Brian Gaeke
acbc37a19e
Don't include "Config/stdlib.h".
...
llvm-svn: 9037
2003-10-10 19:12:22 +00:00
Brian Gaeke
e5249bf429
Include <cstdio> instead of <stdio.h>.
...
llvm-svn: 9032
2003-10-10 18:46:52 +00:00
Misha Brukman
868eac95dd
Fix spelling.
...
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Brian Gaeke
f9a4341b54
Add # of printed instructions statistic to both the SPARC and X86 LLC backends.
...
llvm-svn: 8892
2003-10-06 15:41:21 +00:00
Chris Lattner
e0ae24753d
Add support for the Invoke instruction by using the LowerInvoke pass
...
llvm-svn: 8872
2003-10-05 19:16:09 +00:00
Chris Lattner
fc3f9605a7
Instead of hacking in custom support for Invoke/Unwind, use the LowerInvoke pass
...
llvm-svn: 8871
2003-10-05 19:15:47 +00:00
Alkis Evlogimenos
a37b58ce09
Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
...
llvm-svn: 8819
2003-10-02 16:57:49 +00:00
Alkis Evlogimenos
42a09316bb
Change llc command line for register allocators
...
llvm-svn: 8815
2003-10-02 06:13:19 +00:00
Alkis Evlogimenos
a50598c684
Revert previous change. For some reason this went into the main branch
...
llvm-svn: 8805
2003-10-01 19:40:13 +00:00
Alkis Evlogimenos
e3af981096
Added command line option for linear scan allocator
...
llvm-svn: 8804
2003-10-01 19:38:10 +00:00
Misha Brukman
15fd4fd90c
The comment seems irrelevant as the pass has become a BasicBlock pass.
...
llvm-svn: 8803
2003-10-01 05:24:50 +00:00
Chris Lattner
bdca1b438d
Make sure to get the definition of getRegisterAllocator
...
llvm-svn: 8801
2003-09-30 22:24:00 +00:00
Chris Lattner
5509b86d74
RegisterAllocation.h is going away
...
llvm-svn: 8795
2003-09-30 20:15:04 +00:00
Brian Gaeke
ed1c780821
Add statistic for # of emitWord() calls.
...
llvm-svn: 8772
2003-09-30 17:49:41 +00:00
Misha Brukman
6d1b1553c1
Fixed spelling.
...
llvm-svn: 8687
2003-09-23 17:28:11 +00:00
Misha Brukman
c52311be4f
Fix spelling.
...
llvm-svn: 8686
2003-09-23 17:27:28 +00:00
Vikram S. Adve
be3b73177f
Fix assertion so it doesn't not trip incorrectly.
...
llvm-svn: 8650
2003-09-21 07:55:27 +00:00
Brian Gaeke
180144d19e
Fix a typo in Sparc.cpp.
...
Update names of some pass creator fns in addPassesToEmitAssembly().
FunctionInfo is gone.
llvm-svn: 8599
2003-09-18 17:37:46 +00:00
Brian Gaeke
425a189248
Rename the pass creator fn to mimic the other creator fn names.
...
llvm-svn: 8598
2003-09-18 17:37:35 +00:00
Brian Gaeke
b22c819f96
Fix (and properly doxygenify) some comments. Incorporate
...
functionality of FunctionInfo pass as doFinalization method.
Rename pass to match names of other passes like it.
Rename the pass creator fn to mimic the other creator fn names.
Include StringExtras for utostr().
Make symbol prologue/epilogue stuff redundant with
EmitBytecodeToAssembly, in preparation for refactoring.
llvm-svn: 8597
2003-09-18 17:37:25 +00:00
Brian Gaeke
bbbb03f96a
Make the symbol prologue/epilogue stuff redundant with MappingInfo, in
...
preparation for refactoring.
Rename the pass creator fn to mimic the other creator fn names.
llvm-svn: 8596
2003-09-18 17:37:14 +00:00
Vikram S. Adve
e92c22c656
Fix longjmp case so that, along with the call to abort(), we also
...
generate the appropriate CallArgsDescriptor and tmp. virtual regs.
llvm-svn: 8554
2003-09-16 05:56:22 +00:00
Chris Lattner
5468c196f3
Be a little more specific about what is begin generated. Only print
...
command line if VERBOSE=1
llvm-svn: 8453
2003-09-10 19:52:54 +00:00
Chris Lattner
f9db4af8bf
Only emit inter-field-padding if the amount of padding is != 0
...
llvm-svn: 8452
2003-09-10 19:52:24 +00:00
John Criswell
29a0f79c05
Don't explicitly use $SourceDir to find the tblgen files. This causes make
...
some confusion when trying to generate files (it probably couldn't tell that
./file and $(SourceDir)/file may be the same file).
Now, just let VPATH find everything, and list the primary tblgen file first in
the list of dependencies so that we can just use $< to reference it in the make
rule.
This should hopefully fix the nightly tester.
llvm-svn: 8433
2003-09-10 14:10:44 +00:00
John Criswell
e783801878
Updated to find source files using VPATH. This makes writing build rules
...
much cleaner and easier.
Labeled .td as a suffix for tblgen files in Makefile.rules.
Modified build rules so that source files generated during the build are placed
in the build directory and not the source directory (and not in a Debug
directory). This makes the system cleaner and allows us to have a read-only
source tree.
llvm-svn: 8424
2003-09-09 20:57:03 +00:00
Chris Lattner
e35b8fabc4
* Simplify printConstantValueOnly by moving the tail padding stuff directly
...
into the struct case.
* Extend printConstantValueOnly to print .zero's if the initializer is zero
* Delete dead isConstantFunctionPointerRef function
* Emit the appropriate assembly for the various linkage types!
llvm-svn: 8417
2003-09-09 16:23:36 +00:00
Chris Lattner
e8ae7bf114
Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
...
llvm-svn: 8411
2003-09-08 19:44:26 +00:00
Chris Lattner
4ad8720f91
Add support for the unwind instruction
...
llvm-svn: 8408
2003-09-08 18:54:55 +00:00
John Criswell
bd1d21a0b4
Checkin of autoconf-style object root.
...
Adjusted Makefile to work with new autoconf-style object root.
Specifically, use the new -I option of tblgen to find include files.
llvm-svn: 8379
2003-09-06 14:50:22 +00:00
Misha Brukman
a17b761043
Added some optimizations:
...
* Generate a single BA instead of 6-instruction JUMP if possible
(this occurs both in the creation and overwriting of the stub code)
* If possible, rewrite the ORIGINAL call to call the generated function
directly, thus bypassing the stub entirely
Also added some statistics on how often calls are overwritten and how often the
CompilationCallback is invoked.
llvm-svn: 8376
2003-09-05 22:59:31 +00:00
Chris Lattner
3d53c382ba
OptInfo is no longer required
...
llvm-svn: 8312
2003-09-01 20:41:07 +00:00
Chris Lattner
6d92264f5a
No longer provide an optinfo, noone uses it
...
llvm-svn: 8311
2003-09-01 20:40:59 +00:00
Chris Lattner
2eb5de925f
Inline simple comparison which is sparc specific anyway
...
llvm-svn: 8309
2003-09-01 20:38:03 +00:00
Chris Lattner
3d6b7d1b44
Move private interfaces into private .h file
...
llvm-svn: 8306
2003-09-01 20:33:07 +00:00
Chris Lattner
cd2980ec8c
Simplify code a bit
...
llvm-svn: 8301
2003-09-01 20:24:06 +00:00
Chris Lattner
049f0b8b37
LiveRange.h is now in lib/CodeGen/RegAlloc
...
llvm-svn: 8299
2003-09-01 20:17:13 +00:00
Chris Lattner
74e93a318b
LiveRangeInfo got moved into the lib/CodeGen/RegAlloc directory
...
llvm-svn: 8297
2003-09-01 20:12:17 +00:00
Chris Lattner
8ebc13b6ca
IGNode got moved to lib/CodeGen/RegAlloc
...
llvm-svn: 8294
2003-09-01 20:00:08 +00:00
Chris Lattner
ee413804c7
This file just needs LiveRange.h not IGNode.h
...
llvm-svn: 8293
2003-09-01 19:58:02 +00:00
Chris Lattner
a43cd2a9c9
No longer include IGNode.h in the Sparc global header
...
llvm-svn: 8292
2003-09-01 19:56:48 +00:00
Misha Brukman
6202e8a9ea
* Use alloca() to force GCC not to eliminate frame pointer
...
* Break apart saving and restoring registers into separate functions
* Instead of saving single and double FP registers, just save the double
registers -- aliasing helps preserve the single FP registers as well.
* Request just as much memory for a stub as we actually use
llvm-svn: 8200
2003-08-29 04:22:54 +00:00
Chris Lattner
062cc9d341
Add support for the llvm.unwind intrinsic, which we codegen to just do an abort
...
until we implement unwinding.
Add support for the invoke instruction, which codegens just like a call with
a branch after it.
The end effect of this change is that programs using the invoke instruction,
but never unwinding, will work fine. Programs that unwind will abort until
we get unwind support.
llvm-svn: 8187
2003-08-28 21:23:43 +00:00
Chris Lattner
f31d84d7c5
Targets should configure themselves based on a Module, not some wierd flags
...
llvm-svn: 8132
2003-08-24 19:49:48 +00:00
Chris Lattner
d627d84e23
Implement: Jello/test-constantexpr.ll
...
llvm-svn: 8127
2003-08-24 19:19:47 +00:00
Chris Lattner
d22a618a27
Add support for 'any' pointer size and endianness
...
llvm-svn: 8120
2003-08-24 13:49:22 +00:00
Chris Lattner
ce3c869e38
Change all #include'd files to be :: rules instead of : rules
...
llvm-svn: 8019
2003-08-21 20:37:17 +00:00
Chris Lattner
f54b131a49
Add support for the sig(set|long)jmp intrinsics
...
llvm-svn: 7951
2003-08-18 16:06:09 +00:00
Misha Brukman
56f7db4178
Spell `necessary' correctly.
...
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner
c5e9b1f3cd
Fix ABI issue: Longs really do need to be only 4 byte aligned on X86.
...
This bug caused miscompilation of programs using 'struct stat', but only if
compiled with support for 64-bit filesystems. This could in theory effect
other things, but only if the LLVM code shared data structures with native code.
llvm-svn: 7928
2003-08-17 23:20:40 +00:00
Brian Gaeke
705b78146e
Rename -emitmaps to -enable-maps
...
llvm-svn: 7913
2003-08-16 00:23:16 +00:00
Misha Brukman
cddc1c4f9c
Now that the JIT memory manager allocates as many bytes as necessary rather than
...
rounding up to a page, we need to request (num instrs * 4) bytes. However, I
think that 64 bytes is overkill for the stub function.
llvm-svn: 7888
2003-08-15 18:03:06 +00:00
Misha Brukman
16cd96bf4a
Fix register and parameter numbers in saving double FP registers.
...
llvm-svn: 7884
2003-08-15 16:15:28 +00:00
Chris Lattner
fb986e7b44
Adjust to new API, add expandCall stub
...
llvm-svn: 7873
2003-08-15 04:51:59 +00:00
Chris Lattner
8d79ae7383
Add support for unconditional branches and for emitting JE instructions
...
llvm-svn: 7872
2003-08-15 04:50:49 +00:00
Chris Lattner
250f26f066
Add a bunch of new node types, including a new Void dummy register class
...
llvm-svn: 7870
2003-08-15 04:35:14 +00:00
Misha Brukman
a45f4930ed
* Must save FP registers when calling CompilationCallback(), because FP
...
registers are global, are NOT windowed, and hence can be clobbered!
* Removed unused register shorthand notations
* Fixed and cleaned up comments in inline assembly
llvm-svn: 7853
2003-08-15 00:26:50 +00:00
Misha Brukman
fd3dc24fc4
Since we now have TableGen editing modes for VIM and (X)Emacs, we no longer need
...
to mark TableGen description files with "C++ mode".
llvm-svn: 7841
2003-08-14 15:16:28 +00:00
Chris Lattner
c8890366ee
Restore 'nice name' to pass
...
llvm-svn: 7840
2003-08-14 14:43:24 +00:00
Brian Gaeke
4651096037
Factory methods for function passes now return type FunctionPass *.
...
llvm-svn: 7839
2003-08-14 06:09:32 +00:00
Brian Gaeke
bff292410d
Unbreak SPARC backend: addPassesToJITCompile and
...
addPassesToEmitMachineCode now both take a FunctionPassManager.
llvm-svn: 7837
2003-08-14 06:04:59 +00:00
Brian Gaeke
af3bc2b895
Factory methods for function passes now return type FunctionPass *.
...
Get rid of RegisterLLC, which can't handle FunctionPasses anyway.
llvm-svn: 7836
2003-08-14 06:04:49 +00:00
Brian Gaeke
dbdd3c6717
Unbreak SPARC backend: addPassesToJITCompile and
...
addPassesToEmitMachineCode now both take a FunctionPassManager.
Factory methods for function passes now return type FunctionPass *.
llvm-svn: 7835
2003-08-14 06:04:29 +00:00
Brian Gaeke
4fff8d3bd8
X86 static backend: smacked
...
Function at a time: smacked
Who you gonna call!!! :-)
llvm-svn: 7826
2003-08-13 19:02:09 +00:00