Misha Brukman
ab3b2ea95c
* Allow passing in an unsigned configuration to allocateSparcTargetMachine()
...
a default value is set in the header file.
* Fixed some code layout to make it more consistent with the rest of codebase
* Added addPassesToJITCompile() with relevant passes
llvm-svn: 6369
2003-05-27 22:24:48 +00:00
Misha Brukman
30ca3282a1
Moved generation of the SparcV9CodeEmitter.inc file higher in the Makefile so
...
that Makefile.common would see it.
llvm-svn: 6367
2003-05-27 22:04:38 +00:00
Misha Brukman
0d507cb055
Add prototypes to add passes to JIT compilation and code emission.
...
Also, added annotations to how instructions are modified (reg/imm operands).
Added prototype for adding register numbers to values pass for interfacing with
the target-independent register allocators in the JIT.
llvm-svn: 6366
2003-05-27 22:01:10 +00:00
Misha Brukman
125a99a9a3
Broke out class definition from SparcV9CodeEmitter, and added ability to take a
...
MachineCodeEmitter to make a pass-through debugger -- output to memory and to
std::cerr.
llvm-svn: 6363
2003-05-27 21:45:05 +00:00
Misha Brukman
4931c59635
Link in Sparc libs for the JIT, even on X86 to be able to support debugging
...
of Sparc JIT (printing out instrs) on X86. Con: this increases linking time.
llvm-svn: 6361
2003-05-27 21:42:05 +00:00
Misha Brukman
afffd58fe6
Allow for specification of which JIT to run on the commandline.
...
`lli -march=x86' or `lli -march=sparc' will forcefully select the JIT even on a
different platform. Running lli without the -march option will select the JIT
for the platform that it's currently running on.
Pro: can test Sparc JIT (debug printing mode) on X86 -- faster to compile/link
LLVM source base to test changes.
Con: Linking lli on x86 now pulls in all the Sparc libs -> longer link time
(but X86 can bear it, right?)
In the future, perhaps this should be a ./configure option to enable/disable
target JITting...
llvm-svn: 6360
2003-05-27 21:40:39 +00:00
Misha Brukman
e315a4f211
SparcV9CodeEmitter.cpp is a part of the Sparc code emitter. The main function
...
that assembles instructions is generated via TableGen (and hence must be built
before building this directory, but that's already the case in the top-level
Makefile).
Also added is .cvsignore to ignore the generated file `SparcV9CodeEmitter.inc',
which is included by SparcV9CodeEmitter.cpp .
llvm-svn: 6357
2003-05-27 20:07:58 +00:00
Misha Brukman
ae0cac1d7a
Added definitions for a bunch of floating-point instructions.
...
llvm-svn: 6356
2003-05-27 20:03:29 +00:00
Chris Lattner
66432896b4
Fix constant folding to ALWAYS work.
...
llvm-svn: 6355
2003-05-27 19:16:07 +00:00
Chris Lattner
416e30b07b
Fix bug: Instcombine/2003-05-27-ConstExprCrash.ll
...
llvm-svn: 6352
2003-05-27 16:40:51 +00:00
Chris Lattner
6796f5a374
Make _sure_ we don't go into an infinite loop if a signal happens!
...
llvm-svn: 6351
2003-05-27 16:25:04 +00:00
Chris Lattner
8a6c3b5cbe
* Actually USE the statistic that we made
...
* Implement SRoA for arrays
llvm-svn: 6349
2003-05-27 16:09:27 +00:00
Chris Lattner
5c093a1a93
Implementation of the simple "scalar replacement of aggregates" transformation
...
llvm-svn: 6346
2003-05-27 15:45:27 +00:00
Vikram S. Adve
ab50c0aee5
Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
...
and related functions and flags. Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".
llvm-svn: 6342
2003-05-27 00:06:48 +00:00
Vikram S. Adve
681b3c77fa
(1) Added special register class containing (for now) %fsr.
...
Fixed spilling of %fcc[0-3] which are part of %fsr.
(2) Moved some machine-independent reg-class code to class TargetRegInfo
from SparcReg{Class,}Info.
(3) Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags. Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".
llvm-svn: 6341
2003-05-27 00:05:23 +00:00
Vikram S. Adve
743adbaff7
Renamed opIsDef to opIsDefOnly.
...
llvm-svn: 6340
2003-05-27 00:03:17 +00:00
Vikram S. Adve
66969014b2
Added special register class containing (for now) %fsr.
...
Fixed spilling of %fcc[0-3] which are part of %fsr.
Moved some machine-independent reg-class code to class TargetRegInfo
from SparcReg{Class,}Info.
llvm-svn: 6339
2003-05-27 00:02:22 +00:00
Chris Lattner
1fde83c9b5
Fix bug: InstCombine/2003-05-26-CastMiscompile.ll
...
llvm-svn: 6338
2003-05-26 23:41:32 +00:00
Vikram S. Adve
ba61ed4fc2
Bug fix: right shift for int divide-by-power-of-2 was incorrect for
...
negative values. Need to add one to a negative value before right shift!
llvm-svn: 6334
2003-05-25 21:59:47 +00:00
Vikram S. Adve
f8bb6381df
Bug fix: padding bytes within a structure should go after each field!
...
llvm-svn: 6333
2003-05-25 21:59:09 +00:00
Vikram S. Adve
b78161976c
Bug fix: sign-extension was not happening for C = -MININT since C == -C!
...
llvm-svn: 6332
2003-05-25 21:58:11 +00:00
Chris Lattner
fbb45c1b92
Fix problem with last checkin.
...
llvm-svn: 6328
2003-05-25 16:15:32 +00:00
Vikram S. Adve
5553ed755a
Add support for compiling varargs functions.
...
llvm-svn: 6325
2003-05-25 15:59:47 +00:00
Misha Brukman
6ffaa5b188
Reword to remove reference to how things worked in the past.
...
llvm-svn: 6323
2003-05-24 01:08:43 +00:00
Misha Brukman
b7a0d570a8
Implement the TargetInstrInfo's createNOPinstr() and isNOPinstr() interface.
...
llvm-svn: 6320
2003-05-24 00:09:50 +00:00
Chris Lattner
500984b918
Fix Bug: Linker/2003-04-26-NullPtrLinkProblem.ll
...
This was a problem with constants having their types resolved to some new type,
but there was already a constant of the new type created. Before, these types
were never merged together, now they are.
llvm-svn: 6314
2003-05-23 20:03:32 +00:00
Misha Brukman
b385c22d80
Cleaned up code layout; no functional changes.
...
llvm-svn: 6312
2003-05-23 19:20:57 +00:00
Chris Lattner
e58f6153f4
Remove using declarations
...
llvm-svn: 6306
2003-05-22 22:00:07 +00:00
Chris Lattner
6751acb59b
Add using declarations
...
llvm-svn: 6305
2003-05-22 21:59:35 +00:00
Misha Brukman
daf2cc3c48
Cleaned up code layout. No functional changes.
...
llvm-svn: 6304
2003-05-22 21:49:18 +00:00
Chris Lattner
1cab8ed666
Remove using declarations and extraneous #includes
...
llvm-svn: 6303
2003-05-22 21:47:17 +00:00
Chris Lattner
2fb982f365
Fix static constructor ordering problem
...
llvm-svn: 6302
2003-05-22 21:31:52 +00:00
Misha Brukman
7d91017b21
Kill `using' directives.
...
llvm-svn: 6301
2003-05-22 21:24:35 +00:00
Chris Lattner
20c876a592
Remove using declarations
...
llvm-svn: 6300
2003-05-22 21:21:43 +00:00
Chris Lattner
e1d3dfec23
Make the list accept comma separated names
...
llvm-svn: 6295
2003-05-22 20:27:13 +00:00
Chris Lattner
7099c87692
Add new CommaSeparated option modifier
...
llvm-svn: 6294
2003-05-22 20:26:17 +00:00
Chris Lattner
802d657a39
Destroy using declarations
...
llvm-svn: 6291
2003-05-22 20:06:43 +00:00
Chris Lattner
ab034e55b5
* Revert to old behavior of ignoring a module if it doesn't contain a main
...
function and no symbols were explicitly marked to be externalized.
* Add new -internalize-public-api-list option that can be used if the symbol
list is small, and making a new file is annoying.
llvm-svn: 6289
2003-05-22 19:48:00 +00:00
Chris Lattner
f26f3f74a3
Add option to internalize to allow it to read a file to determine which symbols
...
should not be internalized
llvm-svn: 6288
2003-05-22 19:34:49 +00:00
Chris Lattner
91c5d68261
Minor cleanups.
...
This hunk:
- } else if (Src->getNumOperands() == 2 && Src->use_size() == 1) {
+ } else if (Src->getNumOperands() == 2) {
Allows GEP folding to be more aggressive, which reduces the number of instructions
and can dramatically speed up BasicAA in some cases.
llvm-svn: 6286
2003-05-22 19:07:21 +00:00
Chris Lattner
0b18a0d886
Fix bug: Assembler/2003-05-03-BytecodeReaderProblem.llx
...
by emitting the type planes before any constants (which could be constant
expressions involving undefined types!)
llvm-svn: 6285
2003-05-22 18:35:38 +00:00
Chris Lattner
f354fef44b
Do not assert fail or crash when a bytecode parse fails!
...
llvm-svn: 6284
2003-05-22 18:26:48 +00:00
Chris Lattner
bb4bd699e0
Eliminate the uchar typedef, use unsigned char explicitly
...
llvm-svn: 6283
2003-05-22 18:08:30 +00:00
Chris Lattner
2fba72b389
Fix bug: FunctionResolve/2003-05-21-MissingArguments.ll
...
llvm-svn: 6273
2003-05-21 20:51:52 +00:00
Chris Lattner
777fdfc135
Fix Bug: BasicAA/2003-05-21-GEP-Problem.ll
...
llvm-svn: 6270
2003-05-21 20:23:26 +00:00
Misha Brukman
99adbddaec
Fixed `volatile' typo.
...
llvm-svn: 6266
2003-05-21 19:34:28 +00:00
Misha Brukman
5205d6449e
Cleaned up code layout, spacing, etc. for readability purposes and to be more
...
consistent with the style of LLVM's code base (and itself! it's inconsistent in
some places.)
No functional changes were made.
llvm-svn: 6265
2003-05-21 18:48:06 +00:00
Chris Lattner
6253a2a210
* Fix divide by zero error with empty structs
...
* Empty structs should have ALIGNMENT 1, not SIZE 1.
llvm-svn: 6263
2003-05-21 18:08:44 +00:00
Misha Brukman
06de8c06e7
Cleaned up code layout, spacing, etc. for readability purposes and to be more
...
consistent with the style of LLVM's code base (and itself! it's inconsistent in
some places.)
No functional changes were made.
llvm-svn: 6262
2003-05-21 18:05:35 +00:00
Misha Brukman
581190c0a3
Namespacified vector' and
cerr' to always use the `std::' namespace.
...
Eliminated `using' directives.
llvm-svn: 6261
2003-05-21 17:59:06 +00:00
Chris Lattner
0462d7b16d
Add support for shift constant expressions
...
llvm-svn: 6260
2003-05-21 17:49:25 +00:00
Chris Lattner
0a678611b8
Fix bugs:
...
Assembler/2003-05-21-MalformedShiftCrash.llx
Assembler/2003-05-21-ConstantShiftExpr.ll
llvm-svn: 6258
2003-05-21 17:48:56 +00:00
Chris Lattner
676a07589b
Fix bugs:
...
Assembler/2003-05-21-EmptyStructTest.ll
Assembler/2003-05-21-MalformedStructCrash.llx
llvm-svn: 6255
2003-05-21 16:06:56 +00:00
Misha Brukman
825e174bf7
Hopefully, the final fix for `[Pp]ropogate'.
...
llvm-svn: 6251
2003-05-20 21:01:22 +00:00
Misha Brukman
58c5ef0f4d
The word operands' has an
r' in it.
...
llvm-svn: 6250
2003-05-20 20:36:39 +00:00
Misha Brukman
80e11dcb30
Sparc instruction opcodes now all live under the `V9' namespace.
...
llvm-svn: 6249
2003-05-20 20:32:24 +00:00
Misha Brukman
74cf3f5246
s/convertable/convertible/g
...
llvm-svn: 6248
2003-05-20 18:45:36 +00:00
Chris Lattner
435e5592a9
Add support for setjmp/longjmp primitives
...
Patch checked in for Bill Wendling :)
llvm-svn: 6241
2003-05-17 22:26:33 +00:00
Chris Lattner
fc6cdc252d
Fix bug: Assembler/2003-05-15-SwitchBug.ll
...
llvm-svn: 6239
2003-05-15 21:30:00 +00:00
Chris Lattner
872fe63520
Fix bug: Assembler/2003-05-15-AssemblerProblem.llx
...
llvm-svn: 6234
2003-05-15 19:37:21 +00:00
Chris Lattner
d8234cfa3a
Fix long standing bug
...
llvm-svn: 6232
2003-05-15 18:25:13 +00:00
Chris Lattner
648e9d9cff
Fix bug: Analysis/LoopInfo/2003-05-15-NestingProblem.ll
...
llvm-svn: 6230
2003-05-15 18:03:51 +00:00
Chris Lattner
d0f6311c43
Fix Bug: Linker/2003-05-15-TypeProblem.ll
...
llvm-svn: 6225
2003-05-15 16:30:55 +00:00
Chris Lattner
bfb822f655
Fix typeos
...
llvm-svn: 6204
2003-05-14 17:53:49 +00:00
Chris Lattner
5e5564a8de
Add support for more constant expressions
...
llvm-svn: 6203
2003-05-14 17:51:49 +00:00
Chris Lattner
e02634b9aa
Remove unnecessary casts
...
llvm-svn: 6201
2003-05-14 17:51:05 +00:00
Chris Lattner
cb3df29c52
Print opaque types
...
llvm-svn: 6200
2003-05-14 17:50:47 +00:00
Chris Lattner
0353c32bbe
Casts are now unnecessary
...
llvm-svn: 6199
2003-05-14 17:50:19 +00:00
Chris Lattner
cbf31910a5
Add support for atexit function, remove support for __main function
...
llvm-svn: 6194
2003-05-14 14:21:30 +00:00
Chris Lattner
e7f979708b
Add support for atexit handlers to the JIT, fixing 2003-05-14-AtExit.c
...
llvm-svn: 6193
2003-05-14 13:53:40 +00:00
Chris Lattner
6f80e1b3c7
Fix compilation problems with previous checking *blush*
...
llvm-svn: 6191
2003-05-14 13:27:36 +00:00
Chris Lattner
bda312754a
Add a framework for intercepting system calls
...
llvm-svn: 6190
2003-05-14 13:26:47 +00:00
Chris Lattner
be0b81a4e9
Fix major problem with appending linkage changes
...
llvm-svn: 6185
2003-05-14 12:11:51 +00:00
Chris Lattner
722c3ee6c5
Fix bug
...
llvm-svn: 6184
2003-05-14 02:47:13 +00:00
Chris Lattner
90bd5a8004
Implement another getelementptr folding opportunity that arises when
...
linking stuff with appending linkage
llvm-svn: 6180
2003-05-13 21:50:52 +00:00
Chris Lattner
a33d9882ce
Eliminate using declarations
...
llvm-svn: 6179
2003-05-13 21:37:02 +00:00
Chris Lattner
576323e25e
Implement linkage of appending global variables!
...
llvm-svn: 6178
2003-05-13 21:33:43 +00:00
Chris Lattner
65d299c1fa
Clean up cast
...
llvm-svn: 6174
2003-05-13 20:29:17 +00:00
Chris Lattner
f365fdec06
Clean up #includes
...
llvm-svn: 6173
2003-05-13 20:21:19 +00:00
Chris Lattner
c6eab62a9e
Fix bug: CBackend/2003-05-13-VarArgFunction.ll
...
In C, a prototype with no arguments is varargs. A prototype that takes void
has zero args.
llvm-svn: 6172
2003-05-13 20:15:37 +00:00
Chris Lattner
6a0cf6f937
Fix bug: Dominators/2003-05-12-UnreachableCode.ll
...
llvm-svn: 6158
2003-05-12 22:35:13 +00:00
Chris Lattner
6cb27840a7
Fix bug: LoopPreheaders/2003-05-12-PreheaderExitOfChild.ll
...
llvm-svn: 6153
2003-05-12 22:04:34 +00:00
Chris Lattner
19ca50fe2a
Make abort more explicit
...
llvm-svn: 6151
2003-05-12 21:16:26 +00:00
Chris Lattner
f1a6a1fde1
Remove the assertion failure of course... doh
...
llvm-svn: 6150
2003-05-12 20:39:39 +00:00
Chris Lattner
ed3b3d7c99
Implement casts from unsigned integers to floating point
...
llvm-svn: 6148
2003-05-12 20:36:13 +00:00
Chris Lattner
a9a5cdb2be
Make error messages more useful than jsut an abort
...
llvm-svn: 6146
2003-05-12 20:16:58 +00:00
Chris Lattner
d2bbdec4bc
Remove wierd printout
...
llvm-svn: 6145
2003-05-12 20:10:12 +00:00
Chris Lattner
a4fe60d3c1
Use a kill, not a dead definition, update comment
...
llvm-svn: 6131
2003-05-12 17:37:30 +00:00
Chris Lattner
4152a8b0f7
Fix bug: CWriter/2003-05-12-IntegerSizeWarning.c
...
llvm-svn: 6128
2003-05-12 15:39:31 +00:00
Chris Lattner
fe799356fd
Fix Bug: ConstProp/2003-05-12-DivideError.ll
...
llvm-svn: 6125
2003-05-12 15:26:25 +00:00
Chris Lattner
a8490da0eb
Fix Bug: Assembler/2003-05-12-MinIntProblem.llx
...
llvm-svn: 6123
2003-05-12 15:13:52 +00:00
Chris Lattner
e78921f048
* Keep LiveVariable information more up-to-date and consistent
...
* *** Finally mark values that are inputs to PHIs as killed when appropriate.
This should make the generated code quite a bit better. For example, the
local-ra will not have to spill PHI inputs at the end of predecessor BB's
anymore.
llvm-svn: 6117
2003-05-12 14:28:28 +00:00
Chris Lattner
ce4b5cd9bf
Fix bug where we could iterate off the end of a basic block
...
llvm-svn: 6116
2003-05-12 14:26:38 +00:00
Chris Lattner
a8497e3094
* Keep the BBMap around as long as the pass is live
...
* Change getVarInfo to take real virtual register numbers and offset them
itself. This has caused me so much grief, it's not even funny.
llvm-svn: 6115
2003-05-12 14:24:00 +00:00
Chris Lattner
56f8186e3e
Do not insert multiple initializations for the same value in a PHI node
...
llvm-svn: 6113
2003-05-12 14:22:21 +00:00
Chris Lattner
3ab77b0589
Fix N^2 algorithm
...
llvm-svn: 6112
2003-05-12 04:08:54 +00:00
Chris Lattner
30e6616afa
* Fix several comments
...
* Update LiveVar info better, fixing bug: Jello/2003-05-11-PHIRegAllocBug.ll
llvm-svn: 6110
2003-05-12 03:55:21 +00:00
Chris Lattner
738ee6f0fd
Fix tab infestation!
...
llvm-svn: 6109
2003-05-12 03:54:14 +00:00
Chris Lattner
46f2fc75da
Make sure that globals are emitted AFTER the passmanager is set up for the JIT,
...
because the globals may refer to functions that need to be compiled!
llvm-svn: 6105
2003-05-12 02:14:34 +00:00
Chris Lattner
023c628a58
switch main LLI core execution to use an InstVisitor instead of a switch statement
...
llvm-svn: 6081
2003-05-10 21:22:39 +00:00
Chris Lattner
011dba165e
Fix testcase: SingleSource/UnitTests/2003-05-02-DependantPHI.c
...
llvm-svn: 6074
2003-05-10 20:21:16 +00:00
Chris Lattner
805f8d646e
Add a new info-output-file option (hidden from --help) which is to be used by
...
the testing scripts to avoid breaking diffs while still gathering stats.
llvm-svn: 6067
2003-05-09 20:05:44 +00:00
Chris Lattner
62fa228a18
Add support for function stubs, which allow calling functions which need to
...
have an address available, but have not yet been code generated.
llvm-svn: 6059
2003-05-09 03:30:07 +00:00
Chris Lattner
99520168c9
This blank line has GOT to go.
...
llvm-svn: 6057
2003-05-09 03:28:13 +00:00
Chris Lattner
3160b1235e
Allow const functions
...
llvm-svn: 6056
2003-05-09 03:27:41 +00:00
Chris Lattner
a24e816c31
Add methods for stub function generation
...
llvm-svn: 6054
2003-05-08 21:54:18 +00:00
Chris Lattner
3656ffff9b
Minor speedup by avoiding callbacks to functions already generated
...
llvm-svn: 6052
2003-05-08 21:44:21 +00:00
Chris Lattner
d397ac4aaf
Improve efficiency of JIT by having it use direct function calls instead of
...
signals to regain control from the executing code
llvm-svn: 6051
2003-05-08 21:34:11 +00:00
Chris Lattner
35b3a10cf3
assert early instead of late for unimplemented feature
...
llvm-svn: 6050
2003-05-08 21:08:43 +00:00
Chris Lattner
78f5953056
Add support for Add, Sub, And, Or, & Xor constant exprs
...
llvm-svn: 6049
2003-05-08 20:49:25 +00:00
Chris Lattner
d747f762ff
Add support for variable argument functions!
...
llvm-svn: 6046
2003-05-08 19:44:13 +00:00
Chris Lattner
4cdf86adaf
Add support for variable argument functions!
...
llvm-svn: 6044
2003-05-08 18:41:45 +00:00
Chris Lattner
f5a5ed1a59
Implement varargs support for LLI!
...
llvm-svn: 6043
2003-05-08 16:52:43 +00:00
Chris Lattner
ba9142280a
Add a pointersize/endianness safe load routine to match the store routine
...
llvm-svn: 6042
2003-05-08 16:52:16 +00:00
Chris Lattner
818643d3e9
A large number of simple changes:
...
* s/Method/Function
* Kill some obsolete (external) functions that used to be to support tracing
llvm-svn: 6041
2003-05-08 16:18:31 +00:00
Chris Lattner
6aa2e81ec4
Add support for recording arguments passed through the ... of a varargs function
...
llvm-svn: 6040
2003-05-08 16:06:52 +00:00
Chris Lattner
746e408dd9
llvm.va_start only takes on argument now
...
Verify that va_start doesn't occur in functions with no varargs
llvm-svn: 6038
2003-05-08 15:55:31 +00:00
Chris Lattner
5dd2913d57
Add more support for intrinsic functions and for varargs stuff
...
llvm-svn: 6035
2003-05-08 03:47:33 +00:00
Chris Lattner
a7ee27e0fd
Handle va_arg instruction correctly
...
llvm-svn: 6030
2003-05-08 02:50:13 +00:00
Chris Lattner
e1faff42f4
Add support for the new va_arg instruction
...
llvm-svn: 6029
2003-05-08 02:44:12 +00:00
Chris Lattner
f1f55e385c
Don't inline functions that take variable numbers of arguments!
...
llvm-svn: 6024
2003-05-08 02:36:43 +00:00
Chris Lattner
d381dc9316
Remove using decl
...
llvm-svn: 6023
2003-05-08 02:34:52 +00:00
Chris Lattner
c412b950d2
Remove using declarations
...
llvm-svn: 6022
2003-05-08 02:08:14 +00:00
Misha Brukman
3e328da21d
Added the initial version of the TableGen description for the Sparc backend.
...
llvm-svn: 6021
2003-05-07 21:52:39 +00:00
Chris Lattner
ba6d6034d5
Fix bug: Jello/2003-05-07-ArgumentTest.llx
...
Also fixes yacr2/ks benchmarks
llvm-svn: 6017
2003-05-07 20:31:37 +00:00
Chris Lattner
d3d53723a2
Add a vector to keep track of which registers are allocatable. Remove FIXMEs
...
llvm-svn: 6015
2003-05-07 20:08:36 +00:00
Chris Lattner
59c46ee655
IMPLICIT_DEF was not the beautiful elegant solution I thought it was going
...
to be. In fact, it made stuff worse. :(
llvm-svn: 6013
2003-05-07 19:21:28 +00:00
Chris Lattner
15d2a1b0b9
Re-add gross hack, it's still necessary. :(
...
llvm-svn: 6012
2003-05-06 21:44:54 +00:00
Chris Lattner
bfeffcec97
Remove hideously nasty hack
...
llvm-svn: 6011
2003-05-06 21:32:39 +00:00
Chris Lattner
54c4b56baf
Emit pseudo instructions to indicate that some registers are live on entrance
...
and exit of the function. This fixes bug: Jello/2003-05-06-LivenessClobber.llx
and the Fhourstones benchmark
llvm-svn: 6010
2003-05-06 21:32:22 +00:00
Chris Lattner
b6fab2a875
Don't have a cow with new pseudo instructions
...
llvm-svn: 6009
2003-05-06 21:31:47 +00:00
Chris Lattner
e4c33a0ca0
Add two new pseudo instructions
...
llvm-svn: 6008
2003-05-06 21:31:31 +00:00
Misha Brukman
cf277f9143
Debug output should go to cerr, not cout, because that's where bytecode goes.
...
llvm-svn: 6002
2003-05-04 22:51:30 +00:00
Chris Lattner
5636fe923e
Fix bug: UnitTests/2003-05-02-DependantPHI.c
...
Fix testcase MultiSource/Ptrdist-ks
llvm-svn: 6000
2003-05-03 07:11:00 +00:00
Chris Lattner
0ec2b1188a
Fix miscompilation in Fhourstones and bug: LICM/2003-05-02-LoadHoist.ll
...
llvm-svn: 5994
2003-05-03 03:42:08 +00:00
Chris Lattner
21b4596a3a
* Eliminate using decls
...
* Fix some styleistic things
* Fix bug: CWriter/2002-05-16-NameCollide.ll
llvm-svn: 5988
2003-05-03 03:14:35 +00:00
Misha Brukman
bd9b827093
The Hyphenation-Adding Committee is now in session.
...
llvm-svn: 5986
2003-05-03 02:18:17 +00:00
Chris Lattner
984bb45d4a
Attempt to fix sumant's typesafety issue
...
llvm-svn: 5984
2003-05-02 19:32:04 +00:00
Chris Lattner
e006ca4580
Fix spelling
...
llvm-svn: 5983
2003-05-02 19:26:34 +00:00
Chris Lattner
8f2c71cae2
Fix a bug which occurred with empty basic blocks
...
llvm-svn: 5982
2003-05-02 18:44:42 +00:00
Chris Lattner
f13fe891d1
Fix Bug: LowerSwitch/2003-05-01-PHIProblem.ll
...
llvm-svn: 5979
2003-05-01 22:21:21 +00:00
Chris Lattner
00a12b165a
Minor cleanup
...
llvm-svn: 5976
2003-05-01 21:18:47 +00:00
Chris Lattner
c2eb77b84f
Fix bug: LevelRaise/2003-05-01-CallCast.ll
...
llvm-svn: 5975
2003-05-01 21:02:53 +00:00
Chris Lattner
1d25d9e048
Eliminate use of NonCopyable so that doxygen documentation doesn't link
...
the Annotation classes with the noncopyable classes for no reason
llvm-svn: 5973
2003-05-01 20:28:45 +00:00
Chris Lattner
5045ab0fac
Fix another case where constexprs could cause a crash
...
llvm-svn: 5972
2003-04-30 22:34:06 +00:00
Chris Lattner
caa766b40f
Fix constant folding of constexprs
...
llvm-svn: 5971
2003-04-30 22:19:10 +00:00
Chris Lattner
a1250081cc
Create constant expression casts instead of constant instructions if possible
...
llvm-svn: 5968
2003-04-28 01:25:38 +00:00
Chris Lattner
b74f4c1462
Fix several bugs:
...
* Warnings were emitted all of the time and were really annoying
* Functions could not be resolved unless they had external linkage. Linkonce
linkage was not allowed
* ConstantPointerRef's were not handled when linking functions
we now actually handle cast (CPR) to X -> cast (NewCPR) to X
llvm-svn: 5967
2003-04-28 01:23:29 +00:00
Chris Lattner
7e9f0ea3fd
Avoid naming things exactly the same
...
llvm-svn: 5966
2003-04-27 22:55:56 +00:00
Chris Lattner
bbe1aba425
Remove two fields from TargetData which are target specific.
...
llvm-svn: 5963
2003-04-26 20:11:09 +00:00
Chris Lattner
1039176b52
The promotion rules are the same for all targets, they are set by the C standard.
...
llvm-svn: 5962
2003-04-26 19:47:36 +00:00
Chris Lattner
cb8a4add15
IntegerRegSize is always 8 for sparc
...
llvm-svn: 5961
2003-04-26 19:44:35 +00:00
Chris Lattner
72338826c9
Fix bug: LoopPreheaders/2003-04-25-AssertFail.ll
...
llvm-svn: 5959
2003-04-26 19:34:18 +00:00
Chris Lattner
f5dce6b6f1
Fix a bug that occurred when removing the last predecessor INTO an
...
infinite loop
llvm-svn: 5953
2003-04-25 23:14:19 +00:00
Chris Lattner
d2960ee802
Fix bug: ADCE/2003-04-25-PHIPostDominateProblem.ll
...
llvm-svn: 5952
2003-04-25 22:53:27 +00:00
Chris Lattner
1f7fab6047
Fix bogus assert
...
llvm-svn: 5949
2003-04-25 21:58:54 +00:00
Chris Lattner
c5d76a4e74
Fix bug: Assembler/2003-04-25-UnresolvedGlobalReference.ll
...
llvm-svn: 5948
2003-04-25 21:47:33 +00:00
Chris Lattner
dc49712791
Only do the %ld -> %lld promotion when running a 64 bit bytecode on a 32 bit host
...
llvm-svn: 5942
2003-04-25 18:28:44 +00:00
Chris Lattner
e8eb2cb855
Add __strdup
...
llvm-svn: 5941
2003-04-25 18:23:38 +00:00
Chris Lattner
43e38979b5
Fix BasicAA/2003-04-25-GEPCrash.ll
...
llvm-svn: 5940
2003-04-25 18:03:06 +00:00
Chris Lattner
4196cc4916
MAke sure that LLI properly configures align_of(double)
...
llvm-svn: 5938
2003-04-25 06:15:05 +00:00
Chris Lattner
e26e308afb
Whoops, 32 bit targets have _4_ byte pointers, not _32_ byte pointers!
...
llvm-svn: 5937
2003-04-25 06:06:43 +00:00
Chris Lattner
844b1148f4
Fix compatibility bug: X86 aligns doubles to 4 bytes, not 8!
...
llvm-svn: 5935
2003-04-25 06:05:57 +00:00
Chris Lattner
38d40c0ea9
Fix obvious type-o
...
llvm-svn: 5932
2003-04-25 05:23:10 +00:00
Chris Lattner
b72c6d38da
Fix problem where we would read 64 bits worth of pointer information, even on 32 bit targets!
...
llvm-svn: 5930
2003-04-25 04:21:19 +00:00
Chris Lattner
c78cd5c758
Fix major problem with PHI node traversal: rechecking PHIs should go into
...
the visit function. The worklist is for when their lattice value changes.
llvm-svn: 5927
2003-04-25 03:35:10 +00:00
Chris Lattner
dac0d4bafb
** CORRECTLY, conservatively handle constant expressions
...
llvm-svn: 5924
2003-04-25 02:52:06 +00:00
Chris Lattner
b258ffd600
Allow for easy detection of when a "default" TargetData is created by the
...
passmanager, which is never the right thing to do.
llvm-svn: 5922
2003-04-25 02:50:45 +00:00
Chris Lattner
7b67a6e77d
Minor non-functional changes:
...
* Spell propagate right
* Improve performance of phi node handling
* Delete using directive
* Other minor changes
llvm-svn: 5920
2003-04-25 02:50:03 +00:00
Chris Lattner
e1c995e9b6
Fix bug: mem2reg/2003-04-24-MultipleIdenticalSuccessors.ll
...
llvm-svn: 5919
2003-04-25 00:54:58 +00:00
Chris Lattner
6e2ea5ccff
Fix a nasty bug where the ConstantMerge pass was invalidating the TargetData pass
...
even though it was immutable. Immutable passes should never end up in CurrentAnalyses!
llvm-svn: 5906
2003-04-24 20:07:38 +00:00
Chris Lattner
c06795629d
add a new targetdata ctor to create a target data appropriate to the module
...
llvm-svn: 5903
2003-04-24 19:09:05 +00:00
Chris Lattner
473df86e0b
Trivial cleanup
...
llvm-svn: 5899
2003-04-24 18:35:51 +00:00
Chris Lattner
3dbf3f0ac1
Make the levelraise pass be well behaved w.r.t the TargetData that the current
...
PassMAnager provides.
llvm-svn: 5896
2003-04-24 18:25:27 +00:00
Chris Lattner
043b4a7621
Fix iterator invalidation problem
...
llvm-svn: 5895
2003-04-24 17:52:20 +00:00
Chris Lattner
f0c01a508b
Make sure that the cloned module retains the type symbol table entries!
...
llvm-svn: 5894
2003-04-24 17:15:33 +00:00
Chris Lattner
868b3316c9
Make sure to preserve endiannes and pointer size when cloning modules!
...
llvm-svn: 5892
2003-04-24 15:54:40 +00:00
Chris Lattner
ec21fdc5ce
Fix bug where pointers were assumed to always be 64 bits in size!
...
llvm-svn: 5890
2003-04-23 20:41:01 +00:00
Chris Lattner
84efc8b467
Add memcpy
...
llvm-svn: 5887
2003-04-23 20:23:16 +00:00
Chris Lattner
55a3471dab
Fix a problem with setcc instructions and pointers
...
llvm-svn: 5886
2003-04-23 19:55:35 +00:00
Chris Lattner
34be06fad1
Implement a bunch of new external functions
...
llvm-svn: 5885
2003-04-23 19:55:24 +00:00
Chris Lattner
90d0ad7683
Implement &|^ on bool values
...
llvm-svn: 5884
2003-04-23 19:21:00 +00:00
Chris Lattner
48e894f97b
Add support for _IO_getc function used on linux
...
llvm-svn: 5883
2003-04-23 19:20:50 +00:00
Chris Lattner
7054d8f1f1
Fix problem where labels were being incorrectly elided, and fix problem
...
where PHI copies where not emitted for the default label of switch insts
llvm-svn: 5882
2003-04-23 19:15:13 +00:00
Chris Lattner
1e44b1562a
Fix the super obnoxious "cast to pointer from integer of different size" warnings
...
llvm-svn: 5881
2003-04-23 19:09:22 +00:00
Chris Lattner
896c6970fa
* Implement access to external variables in LLI
...
* Implement GetElementPtr constant expressions when initializing global variables
llvm-svn: 5880
2003-04-23 19:01:49 +00:00
Chris Lattner
b6050c264d
Fix Bug: Linker/2003-04-23-LinkOnceLost.ll
...
llvm-svn: 5879
2003-04-23 18:38:39 +00:00
Chris Lattner
6ae5107de6
Fix iterator invalidation problem with cast instructions
...
llvm-svn: 5876
2003-04-23 17:57:48 +00:00
Chris Lattner
c40d8cd8cd
Implement the constantexpr CAST instruction correctly
...
llvm-svn: 5875
2003-04-23 17:22:12 +00:00
Chris Lattner
9938a43aac
We now need to link libscalar to get the switch lowering pass
...
llvm-svn: 5874
2003-04-23 16:43:02 +00:00
Chris Lattner
db6b7ba364
Remove unnecesary &*'s
...
llvm-svn: 5872
2003-04-23 16:37:45 +00:00
Chris Lattner
3e687b8b65
Remove unneccesary &*
...
llvm-svn: 5871
2003-04-23 16:36:11 +00:00
Chris Lattner
ec5f9a7c4f
Add support for the Switch instruction by running the lowerSwitch pass first
...
llvm-svn: 5867
2003-04-23 16:24:55 +00:00
Chris Lattner
a9eaa10358
New pass to lower switch instructions to branch instructions
...
llvm-svn: 5865
2003-04-23 16:23:59 +00:00
Chris Lattner
d609c99c87
Minor cleanups
...
llvm-svn: 5863
2003-04-23 16:18:14 +00:00
Misha Brukman
c881f68151
Fixed 'prevalent'.
...
llvm-svn: 5860
2003-04-23 02:59:05 +00:00
Misha Brukman
1d82003535
Just some code beautification changes I had sitting around in my tree.
...
llvm-svn: 5859
2003-04-22 23:00:08 +00:00
Chris Lattner
72a506d1f2
Fix bug: BasicAA/2003-04-22-GEPProblem.ll
...
llvm-svn: 5858
2003-04-22 22:00:27 +00:00
Chris Lattner
4ffd4c9cd8
Kill using declarations
...
Kill code for invalid operations on pointers
llvm-svn: 5856
2003-04-22 21:22:33 +00:00
Chris Lattner
56dc44e98a
Implement cast to bool
...
llvm-svn: 5855
2003-04-22 21:15:56 +00:00
Chris Lattner
bdfa086221
Get rid of extraneous arguments to implementation functions
...
llvm-svn: 5852
2003-04-22 20:37:39 +00:00
Chris Lattner
43d3c3666b
Add support to LLI for switch instruction
...
llvm-svn: 5851
2003-04-22 20:34:47 +00:00
Chris Lattner
839e486b99
Use a union to cast int to fp
...
llvm-svn: 5849
2003-04-22 20:20:28 +00:00
Misha Brukman
4147d10d28
It's "necessary"...
...
llvm-svn: 5848
2003-04-22 20:20:11 +00:00
Chris Lattner
8ca18dd9fa
Add support for the switch instruction to the CWriter
...
llvm-svn: 5847
2003-04-22 20:19:52 +00:00
Chris Lattner
69b54208f4
Add warning when linking modules with disagreeing target properties
...
llvm-svn: 5845
2003-04-22 19:13:20 +00:00
Chris Lattner
fcad09d3c1
Emit information about target
...
llvm-svn: 5844
2003-04-22 19:07:19 +00:00
Chris Lattner
b70bd26701
Allow information about the target to be specified in the .ll file
...
llvm-svn: 5843
2003-04-22 19:07:06 +00:00
Chris Lattner
a39c962c1d
Namespacify
...
llvm-svn: 5840
2003-04-22 18:42:41 +00:00
Chris Lattner
08a79481cd
Add support for reading and writing pointersize/endianness to and from bytecode
...
llvm-svn: 5839
2003-04-22 18:15:10 +00:00
Chris Lattner
3327cb03d4
Preserve module source information in the ModuleID
...
llvm-svn: 5836
2003-04-22 18:02:52 +00:00
Chris Lattner
ce0beca3fc
Preserve the new moduleID field
...
llvm-svn: 5835
2003-04-22 18:02:26 +00:00
Chris Lattner
b5fc5522fb
Add support for tracking whether a module is 64/32 bit and big/little endian
...
Also add a moduleID field which can be used for diagnostics
llvm-svn: 5834
2003-04-22 18:02:04 +00:00
Misha Brukman
c06beb4c03
It's "necessary" to spell "necessarily" correctly.
...
llvm-svn: 5833
2003-04-22 17:54:23 +00:00
Chris Lattner
b315dbe98a
Make stderr, stdout, stdin work with LLI
...
llvm-svn: 5832
2003-04-21 22:44:36 +00:00
Chris Lattner
dd3c1121d0
Fix wierd idiom
...
llvm-svn: 5831
2003-04-21 22:43:32 +00:00
Chris Lattner
2fc856e8b6
fprintf CAN take exactly 2 args
...
llvm-svn: 5830
2003-04-21 22:43:20 +00:00
Chris Lattner
a48a91d095
Add support for a simple constantexpr: cast of one ptr type to another
...
llvm-svn: 5829
2003-04-21 21:33:44 +00:00
Chris Lattner
21967df20a
Fix bug: 2003-01-30-LinkerRename.ll
...
llvm-svn: 5828
2003-04-21 21:15:04 +00:00
Chris Lattner
6da72fd92a
Fix linking a function with qualifiers to a external function declaration:
...
Fixed bug: Linker/2003-04-21-Linkage.ll
llvm-svn: 5827
2003-04-21 21:07:05 +00:00
Chris Lattner
a489b529fe
Fix bug where use still existed in dead code
...
llvm-svn: 5824
2003-04-21 19:15:26 +00:00
Chris Lattner
c1da4513e0
Initial support for reading standard .a files
...
llvm-svn: 5820
2003-04-19 21:45:34 +00:00
Chris Lattner
8b1c27945b
Add support for reading unaligned bytecode buffers
...
llvm-svn: 5819
2003-04-19 21:45:17 +00:00
Chris Lattner
869d67b885
Remove arbitrary limitation
...
llvm-svn: 5818
2003-04-19 00:50:37 +00:00
Chris Lattner
5931df28b7
Implement: FunctionResolve/2003-04-18-ForwardDeclGlobal.ll
...
llvm-svn: 5816
2003-04-19 00:15:27 +00:00
Chris Lattner
61d704329e
Fix bug: Mem2reg/2003-04-18-DeadBlockProblem.ll
...
llvm-svn: 5810
2003-04-18 19:25:22 +00:00
Chris Lattner
08b5392e07
Global constants CAN be external
...
llvm-svn: 5808
2003-04-18 04:34:29 +00:00
Chris Lattner
8453f87c9c
Fix a big bad bug I checked in yesterday :(
...
llvm-svn: 5807
2003-04-18 04:11:56 +00:00
Chris Lattner
f171f30deb
Refactor CloneFunction to expose the new CloneBasicBlock function
...
llvm-svn: 5806
2003-04-18 03:50:09 +00:00
Chris Lattner
5403f79db0
New const_cast instead of c style cast
...
llvm-svn: 5805
2003-04-18 03:49:49 +00:00
Chris Lattner
32af8814ce
Allow hexadecimal integer constants to be used
...
llvm-svn: 5802
2003-04-17 22:17:32 +00:00
Chris Lattner
eacb88d2e9
Don't build constantexprs that could be folded
...
llvm-svn: 5801
2003-04-17 19:24:48 +00:00
Chris Lattner
719fd86bdc
Allow constant folding of GEP instructions, even if we don't do a whole lot yet.
...
Fold ConstExpr casts better
castToPointer shouldn't be forced to return a constantpointer
llvm-svn: 5800
2003-04-17 19:24:18 +00:00
Chris Lattner
23615ca1b5
Fix bug: IndVarSimplify/2003-04-16-ExprAnalysis.ll
...
llvm-svn: 5795
2003-04-16 22:50:19 +00:00
Chris Lattner
bb00f755ed
Change the interface to constant expressions to allow automatic folding
...
llvm-svn: 5793
2003-04-16 22:40:51 +00:00
Chris Lattner
545bebf00c
Add support to the bytecode reader/writer for the new linkage types
...
llvm-svn: 5790
2003-04-16 21:16:05 +00:00
Chris Lattner
a9a0e4e780
Add code to verify correctly linkages
...
llvm-svn: 5788
2003-04-16 20:42:40 +00:00
Chris Lattner
fa4f750f3e
Add new linkage types to support a real frontend
...
llvm-svn: 5786
2003-04-16 20:28:45 +00:00
Chris Lattner
343a212f2b
Improve the efficiency and cleanup writing a bit
...
llvm-svn: 5782
2003-04-16 20:20:02 +00:00
Chris Lattner
638d4b0f28
Don't allow declaring an external internal variable
...
llvm-svn: 5781
2003-04-16 18:13:57 +00:00
Chris Lattner
f5ce9b1a74
Fix bug: Assember2003-04-15-ConstantInitAssertion.llx
...
llvm-svn: 5777
2003-04-15 16:09:31 +00:00
Chris Lattner
fc93e77390
Make help message more clear
...
llvm-svn: 5775
2003-04-13 03:50:14 +00:00
Chris Lattner
0ac391e6c8
* Fix bug: Mem2Reg/2003-04-10-DFNotFound.ll
...
* Make Mem2Reg assign version numbers now for renamed variables instead of
.mem2reg suffixes. This produces what people think of as SSA.
llvm-svn: 5771
2003-04-10 19:41:13 +00:00
Misha Brukman
127a46eeba
Fixed compilation errors, command-line argument declarations, cleaned up code to
...
look nicer and removed useless stuff.
Also renamed a few variables, moved them into namespaces, converted outputting
to a file into a print to std::cerr with a DEBUG() guard, as all passes should
do anyway.
No functional changes have been made. However, this code now compiles.
llvm-svn: 5769
2003-04-10 19:19:23 +00:00
Misha Brukman
1db4cefc28
Made the code readable:
...
* Lines must be wrapped at 80 chars. This is a hard limit.
* Consistent style on functions, braces, if, for, etc. Code must be readable.
No functional changes have been made, even though I added a new typedef.
llvm-svn: 5768
2003-04-09 21:51:34 +00:00
Guochun Shi
478533bb86
change the include file names and some class names to make it compile
...
llvm-svn: 5764
2003-04-06 23:56:19 +00:00
Chris Lattner
7bfad931b8
Implement scanf and fix sscanf to actually endian swap the results correctly
...
llvm-svn: 5763
2003-03-31 22:12:37 +00:00
Chris Lattner
731913bab3
Initial checkin of PRE on LLVM. This implementation is still lacking in
...
several ways:
* Load expressions are not PRE'd well. Alias Analysis should be used to
get accurate information when computing anticipatibility.
* The expression collection implementation does not handle PHI nodes properly,
thus the implementation misses many opportunities to PRE.
* This code could be sped up quite a bit
Despite these flaws, the code seems to work well, and handles PR's as one
would expect.
llvm-svn: 5759
2003-03-31 19:55:43 +00:00
Chris Lattner
44370a85d9
* We now preserve the no-critical-edge pass (because we cannot insert critical edges)
...
* Small modification to be more efficient
llvm-svn: 5757
2003-03-31 17:30:25 +00:00
Guochun Shi
9ba51857c1
*** empty log message ***
...
llvm-svn: 5755
2003-03-27 17:57:44 +00:00