Commit Graph

11253 Commits

Author SHA1 Message Date
Chris Lattner d689a5eb9c Oh right, casts can interfere. Test this too
llvm-svn: 12354
2004-03-13 00:11:38 +00:00
Chris Lattner 92295c5031 Implement InstCombine/sub.ll:test12 & test13
llvm-svn: 12353
2004-03-12 23:53:13 +00:00
Chris Lattner b4e933ba14 new testcases
llvm-svn: 12352
2004-03-12 23:52:51 +00:00
Chris Lattner f9e69b4553 Fix a couple of minor problems. Because PHI nodes can use themselves, this
could cause infinite loops.  Also, getUnderlyingObject can return null

llvm-svn: 12351
2004-03-12 23:12:55 +00:00
John Criswell 13875932b2 Performed some updates on the new options to these command line tools.
llvm-svn: 12350
2004-03-12 22:45:35 +00:00
Chris Lattner a036253872 Implement mod/ref analysis for a trivial case where locals don't escape.
This comes up when you have a local array on the stack and you never pass
the address of elements around.

llvm-svn: 12349
2004-03-12 22:39:00 +00:00
Chris Lattner 1f91c54600 new testcase
llvm-svn: 12348
2004-03-12 22:38:31 +00:00
Brian Gaeke afb74be0ce Revise comment and error message for the Bug 38 situation. Also, make it
print out the name of the function being used.

llvm-svn: 12347
2004-03-12 21:37:46 +00:00
John Criswell 5d6345a01b Fixed grammar typo.
llvm-svn: 12345
2004-03-12 21:29:42 +00:00
Brian Gaeke 1694dafece Make -print-machineinstrs show us the code both before and after reg. alloc.
llvm-svn: 12344
2004-03-12 21:19:08 +00:00
John Criswell eb55b52a58 Fixed grammar typo.
llvm-svn: 12343
2004-03-12 21:19:06 +00:00
John Criswell faba462a9a Added minor information on C++.
llvm-svn: 12341
2004-03-12 20:42:16 +00:00
John Criswell 64f13ab753 Updated to LLVM 1.2.
Added information on getting the LLVM GCC front end from CVS.
Added new configure script options.
Made other minor corrections and modifications.

llvm-svn: 12340
2004-03-12 20:31:37 +00:00
Chris Lattner 6e8d083a8b Fix PR266: Make Module Not Inherit From Annotable
llvm-svn: 12339
2004-03-12 19:51:16 +00:00
John Criswell d89dbd0236 Point to the new license (includes year 2004).
Changed crtend.o to libcrtend.a.

llvm-svn: 12338
2004-03-12 18:20:15 +00:00
John Criswell 50f289ace1 Added a header indicating that the Linux and MacOS configure procedures are
the same.

Added LLVM copyright and warranty disclaimer information.

llvm-svn: 12337
2004-03-12 18:02:17 +00:00
Alkis Evlogimenos 9884bda541 Add support for a wider range of CMOV instructions.
llvm-svn: 12336
2004-03-12 17:59:56 +00:00
John Criswell 18d7b688cf Updated copyright to year 2004.
llvm-svn: 12335
2004-03-12 17:29:20 +00:00
Misha Brukman 4483c9b864 Simplify code to process CallSites (thanks to Chris).
llvm-svn: 12334
2004-03-12 16:20:49 +00:00
Misha Brukman 8340686112 Test the mod/ref analysis in DSA.
llvm-svn: 12333
2004-03-12 06:17:22 +00:00
Misha Brukman a447feac33 Keep transitively-required passes alive for queries to work after the initial
user pass is destroyed.

llvm-svn: 12332
2004-03-12 06:16:28 +00:00
Misha Brukman bf28cf6b7d Evaluate ModRef information in addition to regular ol' pointer analysis.
llvm-svn: 12331
2004-03-12 06:15:08 +00:00
Misha Brukman 362841dccc Implement getModRefInfo() for DSA to calculate whether a function modifies or
references a pointer.

llvm-svn: 12330
2004-03-12 06:14:22 +00:00
Misha Brukman 386ef6dec8 Add AnalysisUsage::addRequiredTransitive() to keep analysis info alive for
future queries by clients.

llvm-svn: 12329
2004-03-12 06:13:15 +00:00
Chris Lattner fd747f8db8 test instruction combiner opts for select instruction
llvm-svn: 12328
2004-03-12 06:01:00 +00:00
Chris Lattner 8988f92470 Teach vim about the select instruction. Allow it to forget about the long-dead
not instruction.

llvm-svn: 12327
2004-03-12 05:55:07 +00:00
Chris Lattner be3c688488 Teach emacs about the select instruction
llvm-svn: 12326
2004-03-12 05:54:48 +00:00
Chris Lattner 75648e7ae4 Add support for checking the select instruction
llvm-svn: 12325
2004-03-12 05:54:31 +00:00
Chris Lattner 8337d4462f Know the opcode name of the select instruction
llvm-svn: 12324
2004-03-12 05:54:20 +00:00
Chris Lattner 6e415c06c2 Add support for select constant expressions. Use reserve a bit more to avoid
memory wasteage.

llvm-svn: 12323
2004-03-12 05:54:04 +00:00
Chris Lattner 16375e30b0 Add new function
llvm-svn: 12322
2004-03-12 05:53:41 +00:00
Chris Lattner 6ea4b52903 Teach the constant folder how to do select instructions
llvm-svn: 12321
2004-03-12 05:53:32 +00:00
Chris Lattner 52bd5cb967 Print select instructions correctly
llvm-svn: 12320
2004-03-12 05:53:14 +00:00
Chris Lattner cb015ee6c0 Add constant folding wrapper support for select instructions.
llvm-svn: 12319
2004-03-12 05:53:03 +00:00
Chris Lattner 59db22dcd4 Add sccp support for select instructions
llvm-svn: 12318
2004-03-12 05:52:44 +00:00
Chris Lattner b909e8b0d4 Add trivial optimizations for select instructions
llvm-svn: 12317
2004-03-12 05:52:32 +00:00
Chris Lattner 65a64e1e7a ADd support for select instructions
llvm-svn: 12316
2004-03-12 05:52:14 +00:00
Chris Lattner e7c9f6f7ae Write select instructions to bytecode
llvm-svn: 12315
2004-03-12 05:52:01 +00:00
Chris Lattner 92412466b6 Read select instrs from bytecode
llvm-svn: 12314
2004-03-12 05:51:49 +00:00
Chris Lattner 6536f0c35f Allow parsing select instruction and constant expr
llvm-svn: 12313
2004-03-12 05:51:36 +00:00
Chris Lattner 26cca63a7e Add the visitSelectInst visitor method
llvm-svn: 12312
2004-03-12 05:51:22 +00:00
Chris Lattner 5dec674075 Add the SelectInst class
llvm-svn: 12311
2004-03-12 05:51:05 +00:00
Chris Lattner 439b128ce7 Add the Instruction::Select enum
llvm-svn: 12310
2004-03-12 05:50:53 +00:00
Chris Lattner e75c0c0eac Add support for select constant exprs
llvm-svn: 12309
2004-03-12 05:50:39 +00:00
Chris Lattner ec98a76eb6 This is no longer an open project
llvm-svn: 12308
2004-03-12 05:50:24 +00:00
Chris Lattner b53c28d6ca Cleanup the cast section, add the select instruction
llvm-svn: 12307
2004-03-12 05:50:16 +00:00
Chris Lattner b24b5165dc New testcase
llvm-svn: 12306
2004-03-12 05:50:02 +00:00
Misha Brukman 96d3b0a6de Make code more readable.
llvm-svn: 12305
2004-03-12 00:58:41 +00:00
Misha Brukman 1df51ed4e5 Fix indentation.
llvm-svn: 12298
2004-03-11 23:53:51 +00:00
Misha Brukman 505a0838f6 Move implementations of functions here, which avoids #including <cstdlib> in the
header file and all those who #include it.

llvm-svn: 12297
2004-03-11 23:52:43 +00:00
Misha Brukman 5c24fb6b48 Move function implementations to a .cpp file, avoid #including <cstdlib> here.
llvm-svn: 12296
2004-03-11 23:52:03 +00:00
Misha Brukman d8abb840f2 Forward-declare templates for fix compilation when Argument.h is included first.
llvm-svn: 12295
2004-03-11 23:42:24 +00:00
Misha Brukman 94eeb90cd4 Doxygenified and cleand up comments.
llvm-svn: 12294
2004-03-11 23:08:20 +00:00
Misha Brukman fff0ac8c3d Miscellaneous additions are a separate section.
llvm-svn: 12293
2004-03-11 21:26:29 +00:00
Brian Gaeke 24d24e3e5b Make sure libcrtend.a gets installed when you make install-bytecode.
llvm-svn: 12292
2004-03-11 20:55:23 +00:00
Brian Gaeke 14e98b9d96 Get rid of the abort in PhyRegAlloc::finishSavingState().
Make an explicit call to it from runOnFunction() if we know we're supposed to
write into the global. This is lame (esp. the const_cast), but it solves
the problem.

llvm-svn: 12291
2004-03-11 19:46:30 +00:00
Brian Gaeke c028910d25 Give pass a name
llvm-svn: 12290
2004-03-11 19:23:15 +00:00
Misha Brukman d313bdfa43 Fix compilation on Sparc: assert(0) => abort()
llvm-svn: 12289
2004-03-11 19:08:24 +00:00
Misha Brukman aed39f9d1e SparcV8 removed until it grows up becomes a mature backend.
llvm-svn: 12288
2004-03-11 18:16:33 +00:00
Alkis Evlogimenos 4b98c4412f Fix spelling.
llvm-svn: 12287
2004-03-11 10:14:21 +00:00
Brian Gaeke 5935e0a002 In PhyRegAlloc::saveState(), dump Arguments' saved-state, and try to
make the output more compact.

Divorce state-saving from the doFinalization method; for some reason it's not
getting called when I want it to, at Reoptimizer time. Put the guts in
PhyRegAlloc::finishSavingState(). Put an abort() in it so that I can be really
really sure that it's getting called.

Update comments.

llvm-svn: 12286
2004-03-11 06:45:52 +00:00
Brian Gaeke 44a540e869 Remove ghostly directory from the build
llvm-svn: 12285
2004-03-11 04:42:41 +00:00
Alkis Evlogimenos 9d08818de9 Embed a floating frame of the bugzilla query in the page. This way
people looking for open projects cannot miss the link :-)

llvm-svn: 12284
2004-03-11 02:50:35 +00:00
Chris Lattner d2d7ccdb4b Minor additions and cleanups
llvm-svn: 12279
2004-03-11 00:50:54 +00:00
Brian Gaeke 0e09916d60 Move all the SaveState options and stuff inton one spot at the top of the file.
De-constify SaveStateToModule; we have to set both it and SaveRegAllocState
explicitly in the reoptimizer.
Make SaveRegAllocState an 'external location' option.

llvm-svn: 12278
2004-03-10 22:21:03 +00:00
Brian Gaeke f819263cc1 Only call verifySavedState if SaveRegAllocState is set AND debugging flag is on.
llvm-svn: 12277
2004-03-10 22:01:59 +00:00
Chris Lattner d68b5893a6 Bugz fixed
llvm-svn: 12276
2004-03-10 21:43:47 +00:00
Chris Lattner 61f57617d7 Fix PR284: [indvars] Induction variable analysis violates LLVM invariants
llvm-svn: 12275
2004-03-10 21:42:19 +00:00
Chris Lattner 6fdbd60ed6 New testcase for PR284: [indvars] Induction variable analysis violates LLVM invariants
llvm-svn: 12274
2004-03-10 21:41:47 +00:00
Alkis Evlogimenos 1ccca74a65 Add link to bugzilla query of unassigned enhancements. Specific open
projects like 'port glibc to llvm' or 'improve nightly tester', should
have an unassigned enhancement bug opened for them so that they can be
tracked more easily. Open projects should only list generic projects
like 'compile programs with the LLVM compiler' or 'write a new backend
for target'.

llvm-svn: 12273
2004-03-10 19:38:33 +00:00
Misha Brukman 12f1eddc90 We need a logo.
llvm-svn: 12272
2004-03-10 19:22:29 +00:00
Brian Gaeke 53d2513820 Add brainstorm for a random test vector generator
llvm-svn: 12271
2004-03-10 19:15:50 +00:00
Brian Gaeke 73121d9395 Recommend using install-bytecode target
llvm-svn: 12270
2004-03-10 19:08:52 +00:00
Brian Gaeke 1eec234f91 My fix for PR274 broke the build on Darwin/PPC. As I'm fairly certain this
bug only affects Linux systems that use GLIBC, I'm going to put ifdefs around
the array.

llvm-svn: 12269
2004-03-10 17:38:28 +00:00
Brian Gaeke 0f31060c5a Add support for 'install-bytecode' target, used for ONLY installing
bytecode-libs.

llvm-svn: 12268
2004-03-10 17:38:01 +00:00
Brian Gaeke 8f1977ac07 Fix up a seriously outdated comment.
llvm-svn: 12267
2004-03-10 17:37:50 +00:00
Chris Lattner 6f61db7f8a New testcase for PR275
llvm-svn: 12266
2004-03-10 03:07:45 +00:00
Chris Lattner 30f984671a New testcase for PR276: llvm-g++ does not mangle method names that match stdlib function names
llvm-svn: 12265
2004-03-09 22:51:03 +00:00
Chris Lattner b26b6fe9a7 implement new method
llvm-svn: 12264
2004-03-09 19:37:06 +00:00
Chris Lattner f53977cd42 new method
llvm-svn: 12263
2004-03-09 19:36:59 +00:00
Alkis Evlogimenos 6623cd78f9 Spill explicit physical register defs as well.
llvm-svn: 12260
2004-03-09 08:35:13 +00:00
Brian Gaeke 0766126e2e Now that I read it again, this part in particular strikes me as kind of
pushy and contentious...

llvm-svn: 12259
2004-03-09 07:20:26 +00:00
Alkis Evlogimenos f234284986 Check if printing of implicit uses is required for all types of shift
instructions.

llvm-svn: 12258
2004-03-09 06:10:15 +00:00
Brian Gaeke 75a2efdd6c b00g fixed
llvm-svn: 12257
2004-03-09 05:43:59 +00:00
Brian Gaeke 96e450b3b2 Address PR274 - '[JIT] Programs cannot resolve the fstat function'
by trying to get the compiler to generate an undefined reference for it
and related functions which live in libc_nonshared.a on Linux.

Linkers... sigh.

llvm-svn: 12256
2004-03-09 05:22:10 +00:00
Brian Gaeke 3a27bd889b Hmm, who left this sitting around in my tree
llvm-svn: 12255
2004-03-09 04:49:13 +00:00
Alkis Evlogimenos 8a3f2f3600 Differentiate between extended precision floats (80-bit) and double precision floats (64-bit)
llvm-svn: 12254
2004-03-09 03:37:54 +00:00
Alkis Evlogimenos 8ac958bf43 Use newly added API to emit bytes for instructions that gas misassembles
llvm-svn: 12253
2004-03-09 03:35:34 +00:00
Alkis Evlogimenos 508b459d12 Add emitInstruction() API so that we can get the bytes of a simple instruction
llvm-svn: 12252
2004-03-09 03:34:53 +00:00
Alkis Evlogimenos a7c2da3af5 Constify things a bit
llvm-svn: 12251
2004-03-09 03:30:12 +00:00
Chris Lattner c567f402e5 Bug fixed
llvm-svn: 12250
2004-03-09 00:59:15 +00:00
Chris Lattner 349910567e Checkin testcase for PR261
llvm-svn: 12249
2004-03-09 00:55:58 +00:00
Chris Lattner 0536f8df6e John fixed this bug
llvm-svn: 12248
2004-03-09 00:40:49 +00:00
Brian Gaeke d734587436 Change PhyRegAlloc::saveStateForValue()'s arg type to deal with
AllocInfo.Instruction becoming an int.

llvm-svn: 12247
2004-03-08 23:22:03 +00:00
Brian Gaeke f0a73a3f42 Save argument list alloc state by recording it as the operands of Instruction
#-1. Other minor changes to deal with AllocInfo.Instruction becoming an int.

llvm-svn: 12246
2004-03-08 23:22:02 +00:00
Brian Gaeke 0be7ea7289 Make AllocInfo's Instruction an int, so that we can overload it for arguments.
(Instruction #-1's operands = argument list).

llvm-svn: 12245
2004-03-08 23:22:01 +00:00
Misha Brukman b22926616e Fix some spelling and grammar.
llvm-svn: 12244
2004-03-08 23:06:46 +00:00
Chris Lattner d6e1b28837 Update the profiling section
llvm-svn: 12243
2004-03-08 22:29:35 +00:00
Chris Lattner 9bde783c5c Switch to using edge profiling information as the basic source of profile info
from using basic block counts.

llvm-svn: 12242
2004-03-08 22:04:08 +00:00
Chris Lattner d6eda1a9ef Switch over to using edge profile information as the basic profiling representation,
from basic block counts.

llvm-svn: 12241
2004-03-08 22:03:45 +00:00
Chris Lattner bd481d588a Refactor implementations
llvm-svn: 12240
2004-03-08 21:30:35 +00:00
Chris Lattner 755ffeb292 We don't want to make this a pure interface, as it makes all implementors
bear the burden of implementing what will be all exactly the same methods.
They just want to provide the information in differing ways.

llvm-svn: 12239
2004-03-08 21:30:18 +00:00
Chris Lattner b08e4653cb Rearrange some methods, implement the dominates method
llvm-svn: 12237
2004-03-08 21:07:12 +00:00
Chris Lattner 63b49d0574 Import the trace class from the reoptimizer
llvm-svn: 12236
2004-03-08 20:57:27 +00:00
Chris Lattner 9c222ed4b5 Default to using edge counts
llvm-svn: 12234
2004-03-08 20:04:46 +00:00
Chris Lattner c71ea6e3d4 Annotate functions with edge counts as well, if they are available.
llvm-svn: 12233
2004-03-08 20:04:32 +00:00
Chris Lattner 5302943ff7 If we have edge counts, we can produce block counts. I've verified that
using an edge profile to produce block counts gives the exact same numbers
as using a block count directly.

llvm-svn: 12232
2004-03-08 20:03:52 +00:00
Chris Lattner 96cdd27b65 Adjust to new interface
llvm-svn: 12231
2004-03-08 18:51:45 +00:00
Chris Lattner 03745f3e80 Add the ability to put an annotation at the end of a basic block as well.
llvm-svn: 12230
2004-03-08 18:51:05 +00:00
Chris Lattner 8b8a0641a1 Add initial support for reading edge counts. This will be improved to enable
translation of edge counts into block/function counts when possible.

llvm-svn: 12229
2004-03-08 18:20:18 +00:00
Chris Lattner 178608ee2b Add support for representing edge counts
llvm-svn: 12228
2004-03-08 18:19:37 +00:00
Chris Lattner 29ba1be907 Add edge profiling support to the runtime library
llvm-svn: 12227
2004-03-08 18:04:31 +00:00
Misha Brukman 3702b9d79b Fix link to license: point to current version in CVS.
llvm-svn: 12226
2004-03-08 17:59:31 +00:00
Chris Lattner 721264aecc Initial support for edge profiling
llvm-svn: 12225
2004-03-08 17:54:34 +00:00
Chris Lattner dae48f93b0 Split utility functions out of BlockProfiling.cpp
llvm-svn: 12224
2004-03-08 17:06:13 +00:00
Chris Lattner b16526108c Remove the comment "Constants must always have an initial value.", which
is incorrect.  Fix some formatting nastiness.

llvm-svn: 12223
2004-03-08 16:49:10 +00:00
Chris Lattner d91e676700 finegrainify namespacification
llvm-svn: 12221
2004-03-08 16:45:53 +00:00
Chris Lattner e2b27080e7 Insert functions into the module promptly, not lazily. This fixes a bug
I introduced last night.  Note to self: test the *correct* tree...

llvm-svn: 12220
2004-03-08 16:14:19 +00:00
Chris Lattner ea0789ca7b Implement test/Regression/Assembler/2004-03-07-FunctionAddressAlignment.llx
llvm-svn: 12218
2004-03-08 06:17:35 +00:00
Chris Lattner be3a169d18 New testcase for folding in some important situations. The first two
come up a lot in the code generated by the C++ front-end for pointers
to member functions.  See PR166.

llvm-svn: 12217
2004-03-08 06:17:15 +00:00
Chris Lattner c3ecaae16c Remove Module::mutateConstantPointerRef, which is now thankfully dead!
This is one small step towards the complete obliteration of
ConstantPointerRef's entirely!! Woot!

llvm-svn: 12216
2004-03-08 06:16:10 +00:00
Chris Lattner 8301a593a9 Remove Module::mutateConstantPointerRef, which is now thankfully dead!
llvm-svn: 12215
2004-03-08 06:15:33 +00:00
Chris Lattner 9f4918ab93 Eliminate nightmarish API
llvm-svn: 12214
2004-03-08 06:11:10 +00:00
Chris Lattner 16e27f3af3 remove *THANKFULLY* dead method
llvm-svn: 12213
2004-03-08 06:10:32 +00:00
Chris Lattner 75998c0885 Eliminate a REALLY HORRIBLE API: mutateReferences, which is gross gross gross.
llvm-svn: 12212
2004-03-08 06:09:57 +00:00
Chris Lattner 7e201ecc31 New testcase for PR269
llvm-svn: 12211
2004-03-08 05:35:12 +00:00
Chris Lattner f0cbbabea7 Bug fixed
llvm-svn: 12210
2004-03-08 04:55:45 +00:00
Chris Lattner 451e10e46a Testcase that crashes the C front-end.
llvm-svn: 12209
2004-03-08 04:41:32 +00:00
Chris Lattner 84c697d520 Fix a bug handling globals that are constants, but are still external
llvm-svn: 12208
2004-03-08 03:52:24 +00:00
Chris Lattner 98502aae76 Avoid allocating special registers a bit more robustly
llvm-svn: 12207
2004-03-08 03:48:07 +00:00
Chris Lattner 0653e1167d New code-quality testcase.
llvm-svn: 12205
2004-03-08 02:12:36 +00:00
Chris Lattner 653e662a93 Implement folding explicit load instructions into binary operations. For a
testcase like this:

int %test(int* %P, int %A) {
        %Pv = load int* %P
        %B = add int %A, %Pv
        ret int %B
}

We now generate:
test:
        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP + 8]
        add %EAX, DWORD PTR [%ECX]
        ret

Instead of:
test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        mov %EAX, DWORD PTR [%EAX]
        add %EAX, %ECX
        ret

... saving one instruction, and often a register.  Note that there are a lot
of other instructions that could use this, but they aren't handled.  I'm not
really interested in adding them, but mul/div and all of the FP instructions
could be supported as well if someone wanted to add them.

llvm-svn: 12204
2004-03-08 01:58:35 +00:00
Chris Lattner 1dd6afe6a2 Rearrange and refactor some code. No functionality changes.
llvm-svn: 12203
2004-03-08 01:18:36 +00:00
Chris Lattner fe6f2e3e80 Implement ArgumentPromotion/aggregate-promote.ll
This allows pointers to aggregate objects, whose elements are only read, to
be promoted and passed in by element instead of by reference.  This can
enable a LOT of subsequent optimizations in the caller function.

It's worth pointing out that this stuff happens a LOT of C++ programs, because
objects in templates are generally passed around by reference.  When these
templates are instantiated on small aggregate or scalar types, however, it is
more efficient to pass them in by value than by reference.

This transformation triggers most on C++ codes (e.g. 334 times on eon), but
does happen on C codes as well.  For example, on mesa it triggers 72 times,
and on gcc it triggers 35 times.  this is amazingly good considering that
we are using 'basicaa' so far.

llvm-svn: 12202
2004-03-08 01:04:36 +00:00
Chris Lattner 1f7f22c42c New testcase
llvm-svn: 12201
2004-03-08 00:58:19 +00:00
Chris Lattner cc544e57f3 Implement: ArgumentPromotion/chained.ll
llvm-svn: 12200
2004-03-07 22:52:53 +00:00
Chris Lattner 332a8bdf31 New testcase for missed case
llvm-svn: 12199
2004-03-07 22:52:41 +00:00
Chris Lattner 64b8d697ad Fix another minor bug, exposed by perlbmk
llvm-svn: 12198
2004-03-07 22:43:27 +00:00
Chris Lattner 538fee7aa2 Since 'load null' is undefined, we can make it do whatever we want. Returning
a zero value is the most likely way to cause further simplification, so we do it.

llvm-svn: 12197
2004-03-07 22:16:24 +00:00
Chris Lattner ac2e2d3bdd Run the new pass in gccld now that it passes all tests
llvm-svn: 12196
2004-03-07 22:12:40 +00:00
Chris Lattner 6770842b67 Fix a minor bug and turn debug output into, well, debug output.
llvm-svn: 12195
2004-03-07 21:54:50 +00:00
Chris Lattner 1f607f2f2e Add prototype
llvm-svn: 12194
2004-03-07 21:30:08 +00:00
Chris Lattner 483ae01c9c New LLVM pass: argument promotion. This version only handles simple scalar
variables.

llvm-svn: 12193
2004-03-07 21:29:54 +00:00
Chris Lattner f2b8692b73 New testcase
llvm-svn: 12192
2004-03-07 21:28:54 +00:00
Alkis Evlogimenos d6f62ba55b Add memory operand version of conditional move.
llvm-svn: 12190
2004-03-07 03:19:11 +00:00
Alkis Evlogimenos cb98644e9b As I wrote in the docs, simple is the default spiller :-)
llvm-svn: 12189
2004-03-06 23:08:44 +00:00
Alkis Evlogimenos 79850121ad Add simple spiller.
llvm-svn: 12188
2004-03-06 22:38:29 +00:00
Alkis Evlogimenos 36fd868f08 The default register allocator is local not simple.
llvm-svn: 12187
2004-03-06 22:27:41 +00:00
Brian Gaeke 4e0669cef0 Support return values of basic integer types.
Emit RETL instruction to return instead of funny JMPL.
Fix indentation.

llvm-svn: 12186
2004-03-06 05:32:28 +00:00
Brian Gaeke c65b97d4f6 Sort stanzas into Sparc V8 book page number order.
Add RET, RETL.  Rename SAVE, RESTORE & JMPL for consistency.

llvm-svn: 12185
2004-03-06 05:32:13 +00:00
Brian Gaeke 84b4c9208d Hack it so we do not try to allocate values to G0.
llvm-svn: 12184
2004-03-06 05:31:32 +00:00
Brian Gaeke 901cfa9e2e Make prolog align stack properly. Make epilog not touch any registers.
llvm-svn: 12183
2004-03-06 05:31:21 +00:00
Brian Gaeke 5a1c7a8be3 Emit register names in lowercase, as required by the assembler.
llvm-svn: 12182
2004-03-06 05:30:21 +00:00
Brian Gaeke 639b04aca3 Teach getRegClassForType where to find FP registers
llvm-svn: 12180
2004-03-06 03:54:13 +00:00
Chris Lattner 2cb2905c96 Fix a minor bug
llvm-svn: 12169
2004-03-05 22:04:07 +00:00
Misha Brukman d2e88a21b7 Unbreak the build on Sparc.
llvm-svn: 12161
2004-03-05 20:04:40 +00:00
Brian Gaeke 0c76d1146f Asm output is looking a lot better; not correct for all operands yet though.
llvm-svn: 12143
2004-03-05 08:39:09 +00:00
Chris Lattner 6c271edcd7 Fix a bug in a previous checkin that broke 175.vpr
llvm-svn: 12128
2004-03-04 21:36:57 +00:00
Chris Lattner bc3381f267 Add support for strto* and v*printf
llvm-svn: 12127
2004-03-04 21:03:54 +00:00
Chris Lattner 0ed8162c1a Add non-crappy support for varargs
llvm-svn: 12126
2004-03-04 20:33:47 +00:00
Chris Lattner 3562ea84ab Implement a FIXME, improving the efficiency of DSA on povray.
This reduces CBU time from 145s -> 122s (debug build), reduces # allocated nodes
from 129420 to 116477.

llvm-svn: 12125
2004-03-04 19:47:04 +00:00
Brian Gaeke 9c609df3c9 Support -print-machineinstrs
llvm-svn: 12124
2004-03-04 19:22:16 +00:00
Chris Lattner 30f94a72f4 Speed up the cbu pass from taking somewhere near the age of the universe to about 90s on povray
llvm-svn: 12123
2004-03-04 19:16:35 +00:00
Brian Gaeke 8351d8c1a8 make -print-machineinstrs work for both SparcV9 and X86
llvm-svn: 12122
2004-03-04 19:16:23 +00:00
Alkis Evlogimenos b9501c1f8c Add assertion for scale verification.
llvm-svn: 12120
2004-03-04 18:05:02 +00:00
Alkis Evlogimenos 8a4159708b Fix bug introduced by yesterday's changes.
llvm-svn: 12119
2004-03-04 18:02:07 +00:00
Alkis Evlogimenos 33cb4260a5 Hide variable from other functions.
llvm-svn: 12118
2004-03-04 17:50:44 +00:00
Chris Lattner 536b131c9c Fix BU datastructures with povray!
The problem was that we were merging a field of a node with a value that was
deleted.  Thanks to bugpoint for reducing povray to a nice small 3 function
example.  :)

llvm-svn: 12116
2004-03-04 17:06:53 +00:00
Chris Lattner 8db52980b7 Minor changes, remove some debugging code that got checked in somehow.
Make sure to scope the NodeMap passed into cloneInto so that it doesn't point
to nodes that are deleted.  Add some FIXME's for future performance enhancements.

llvm-svn: 12115
2004-03-04 17:05:28 +00:00
Brian Gaeke 82ec4a561b Asm printer support, based on x86 - only prints mnemonics for now
llvm-svn: 12113
2004-03-04 06:00:41 +00:00
Brian Gaeke 8ace44fe0d Double-FP pseudo-registers.
llvm-svn: 12112
2004-03-04 05:15:03 +00:00
Brian Gaeke 92c95f812d Subtract instructions; minor cleanups
llvm-svn: 12111
2004-03-04 04:37:45 +00:00
Brian Gaeke d2e89190d9 Floating point regs
llvm-svn: 12110
2004-03-04 04:37:22 +00:00
Chris Lattner f48eb7519a Only clone nodes that are needed in the caller, don't clone ALL aux calls. This improves
povray from having ~600K nodes and 300K call nodes to 65K nodes and 25K call nodes.

llvm-svn: 12109
2004-03-04 03:57:53 +00:00
Brian Gaeke 956fb06a4a Simple copyConstantToReg support, SETHIi and ORri
llvm-svn: 12107
2004-03-04 00:56:25 +00:00
Brian Gaeke 165ff998e0 Support add - note, still missing important copyConstantToRegister stuff
llvm-svn: 12106
2004-03-03 23:03:14 +00:00
Chris Lattner 559487301f Fix a minor bug handling incomplete programs
llvm-svn: 12105
2004-03-03 23:00:19 +00:00
Chris Lattner d9da2678fc Fix a DSA bug that caused DSA to generate incredibly huge graphs and take forever to
do it on povray.  The problem is that we were not copying globals from callees to
callers unless the existed in both graphs.  We should have copied them in the case
where the global pointed to a node that was copied as well.

llvm-svn: 12104
2004-03-03 22:01:09 +00:00
Chris Lattner 91be5332b2 Rename method, add new method
llvm-svn: 12103
2004-03-03 22:00:20 +00:00
Chris Lattner 5fc189157c Deinline methods, add fast exit
llvm-svn: 12102
2004-03-03 20:55:27 +00:00
Chris Lattner 06bd20676d De-inline methods
llvm-svn: 12101
2004-03-03 20:55:15 +00:00
Brian Gaeke 015972103d Make MachineOperand's value named 'contents'. Make really, really sure
it is always completely initialized and copied.
Also, fix up many comments and asserts.

llvm-svn: 12100
2004-03-03 19:07:27 +00:00
Brian Gaeke 3001c6e264 Squash /usr/dcs path; use a 'require <version>' instead.
llvm-svn: 12099
2004-03-03 17:38:51 +00:00
Brian Gaeke c0c260dd37 Add my regression finding by binary searching cvs script.
llvm-svn: 12095
2004-03-03 08:14:25 +00:00
Chris Lattner 140b2cbd28 Fix a node mapping problem that was causing the pool allocator to locally allocate
nodes that were globally live, thus breaking programs.

llvm-svn: 12094
2004-03-03 05:34:31 +00:00
Chris Lattner 93e9878c2c SPECIFY a target data to initialize the CBE target with. Until now we have
been using the default target data layout object to lower malloc instructions,
causing us to allocate more memory than we needed!  This could improve the
performance of the CBE generated code substantially!

llvm-svn: 12088
2004-03-03 02:14:15 +00:00
Chris Lattner 87ed2a4096 Add a new constructor
llvm-svn: 12087
2004-03-03 02:12:47 +00:00
Chris Lattner 7abcc387de Don't emit things like malloc(16*1). Allocation instructions are fixed arity now.
llvm-svn: 12086
2004-03-03 01:40:53 +00:00
Chris Lattner 2e92b469c8 FINALLY be able to get symbolic type names in the globals graph!
llvm-svn: 12082
2004-03-02 21:39:43 +00:00
Chris Lattner 9e100fc3f7 Really, only if reopen
llvm-svn: 12080
2004-03-02 20:46:18 +00:00
John Criswell 626f47f946 Added EH support.
llvm-svn: 12075
2004-03-02 15:54:25 +00:00
Alkis Evlogimenos cb8937197e Make <di> into <dt> (definition list term).
llvm-svn: 12072
2004-03-02 03:36:10 +00:00
Misha Brukman c566ca36a1 Doxygenify comments.
llvm-svn: 12071
2004-03-02 00:22:19 +00:00
Misha Brukman f44acae31e Implement ExtractCodeRegion()
llvm-svn: 12070
2004-03-02 00:20:57 +00:00
Misha Brukman 1998b73492 Add prototype for ExtractCodeRegion()
llvm-svn: 12069
2004-03-02 00:20:32 +00:00
Misha Brukman f272f9b3d5 Make a note that this is usually used via bugpoint.
llvm-svn: 12068
2004-03-02 00:19:09 +00:00
Misha Brukman a6025e6480 Doxygenify some comments.
llvm-svn: 12064
2004-03-01 23:53:11 +00:00
Alkis Evlogimenos 45da18d2a4 Fix <p> missing <p> tag
llvm-svn: 12063
2004-03-01 23:25:38 +00:00
Alkis Evlogimenos 31953c7a10 Add a spiller option to llc. A simple spiller will come soon. When we get CFG in the machine code represenation a global spiller will also be possible. Also document the linear scan register allocator but mark it as experimental for now.
llvm-svn: 12062
2004-03-01 23:18:15 +00:00
Alkis Evlogimenos b76d234ee9 Add the long awaited memory operand folding support for linear scan
llvm-svn: 12058
2004-03-01 20:05:10 +00:00
Misha Brukman b22d09cc5e * If a badref has a name, print it out for ease of debugging
* Doxygenify (some) comments

llvm-svn: 12057
2004-03-01 19:48:13 +00:00
Chris Lattner d86982547f Add new method
llvm-svn: 12056
2004-03-01 19:36:50 +00:00
Chris Lattner c8d23b19fb Correctly add an array marker on a node when appropriate!
llvm-svn: 12055
2004-03-01 19:02:54 +00:00
Misha Brukman 88cc178e3b Fix grammar and doxygenify comments.
llvm-svn: 12054
2004-03-01 18:31:19 +00:00
Misha Brukman 5af2be7d09 * Add implementation of ExtractBasicBlock()
* Add comments to ExtractLoop()

llvm-svn: 12053
2004-03-01 18:28:34 +00:00
Misha Brukman f68f121dd3 Add ability to extract a single basic block into a new function.
llvm-svn: 12052
2004-03-01 18:27:13 +00:00
Misha Brukman 773d6f66db * HTML 4.01 Strict compliance
* Removed unnecessary tabs in the entire file

llvm-svn: 12051
2004-03-01 18:21:04 +00:00
Misha Brukman c501f5530b HTML 4.01 Strict compliance.
llvm-svn: 12050
2004-03-01 17:47:27 +00:00
Chris Lattner f96405a1ce Add this back, as its absence introduces assertions, and it seems to work now
that Instructions are annotable again

llvm-svn: 12045
2004-03-01 15:28:27 +00:00
Tanya Lattner e63e8ea884 fix bug in previous checkin
llvm-svn: 12044
2004-03-01 15:05:17 +00:00
Brian Gaeke 427cec1395 TargetCacheInfo has been removed; its only uses were to propagate a constant
(16) into certain areas of the SPARC V9 back-end. I'm fairly sure the US IIIi's
dcache has 32-byte lines, so I'm not sure where the 16 came from. However, in
the interest of not breaking things any more than they already are, I'm going
to leave the constant alone.

llvm-svn: 12043
2004-03-01 06:43:29 +00:00
Tanya Lattner 48a503be04 Adding new Modulo Scheduling graph files.
llvm-svn: 12031
2004-03-01 02:50:57 +00:00
Tanya Lattner dd10fbe775 Removing old graph files with new graph files that I wrote. Updated ModuloScheduling pass, but still in progress.
llvm-svn: 12030
2004-03-01 02:50:01 +00:00
Chris Lattner 6f6e0f29ad Expand on my note-to-self
llvm-svn: 12029
2004-03-01 02:44:44 +00:00
Chris Lattner 1f4642c47c Handle passing constant integers to functions much more efficiently. Instead
of generating this code:

        mov %EAX, 4
        mov DWORD PTR [%ESP], %EAX
        mov %AX, 123
        movsx %EAX, %AX
        mov DWORD PTR [%ESP + 4], %EAX
        call Y

we now generate:
        mov DWORD PTR [%ESP], 4
        mov DWORD PTR [%ESP + 4], 123
        call Y

Which hurts the eyes less.  :)

Considering that register pressure around call sites is already high (with all
of the callee clobber registers n stuff), this may help a lot.

llvm-svn: 12028
2004-03-01 02:42:43 +00:00
Brian Gaeke b19dcc6651 Don't look in the .libs directories that libtool makes
llvm-svn: 12027
2004-03-01 02:41:22 +00:00
Chris Lattner 5c7d3cda78 Fix a minor code-quality issue. When passing 8 and 16-bit integer constants
to function calls, we would emit dead code, like this:

int Y(int, short, double);
int X() {
  Y(4, 123, 4);
}

--- Old
X:
        sub %ESP, 20
        mov %EAX, 4
        mov DWORD PTR [%ESP], %EAX
***     mov %AX, 123
        mov %AX, 123
        movsx %EAX, %AX
        mov DWORD PTR [%ESP + 4], %EAX
        fld QWORD PTR [.CPIX_0]
        fstp QWORD PTR [%ESP + 8]
        call Y
        mov %EAX, 0
        # IMPLICIT_USE %EAX %ESP
        add %ESP, 20
        ret

Now we emit:
X:
        sub %ESP, 20
        mov %EAX, 4
        mov DWORD PTR [%ESP], %EAX
        mov %AX, 123
        movsx %EAX, %AX
        mov DWORD PTR [%ESP + 4], %EAX
        fld QWORD PTR [.CPIX_0]
        fstp QWORD PTR [%ESP + 8]
        call Y
        mov %EAX, 0
        # IMPLICIT_USE %EAX %ESP
        add %ESP, 20
        ret

Next up, eliminate the mov AX and movsx entirely!

llvm-svn: 12026
2004-03-01 02:34:08 +00:00
Chris Lattner 482cf01a1e Fix the "partial pool allocator" on em3d and others. The problem is that
DSNodes, unlike other GraphTraits nodes, can have null outgoing edges, and
df_iterator doesn't take this into consideration.  As a workaround, the
successor iterator now handles null nodes and 'indicates' that null has
no successors.

llvm-svn: 12025
2004-03-01 01:42:26 +00:00
Chris Lattner b4c203ce67 Make Module annotable. Reid has a bunch of code that depends on this, and
we really don't win that much by eliminating this (not many Modules are
allocated), so it's not worth it.  When we can, we should revisit this in
the future.

llvm-svn: 12023
2004-03-01 01:25:37 +00:00
Chris Lattner 5cf39339d1 Disable tail duplication in a case that breaks on Olden/tsp
llvm-svn: 12021
2004-03-01 01:12:13 +00:00
Misha Brukman 2a4c5b050e Doxygenify comments.
llvm-svn: 12015
2004-02-29 23:55:11 +00:00
Misha Brukman c91e1ff50d * Remove function to find "main" in a Module, there's a method for that
* Removing extraneous empty space and empty comment lines

llvm-svn: 12014
2004-02-29 23:09:10 +00:00
Chris Lattner 43640d7138 Fix -debug-pass=Executions, which relied on Function, Module, and BasicBlock
being annotable

llvm-svn: 12013
2004-02-29 22:37:04 +00:00
Chris Lattner 2de229f31b Fix bug: test/Regression/Transforms/LowerInvoke/2004-02-29-PHICrash.llx
... which tickled the lowerinvoke pass because it used the BCE routines.

llvm-svn: 12012
2004-02-29 22:24:41 +00:00
Chris Lattner 9c9a4c4abd Testcase for a bug that caused a whole bunch of testcases to die in the nightly
tester last night.

llvm-svn: 12011
2004-02-29 22:15:51 +00:00
Chris Lattner 604cc83933 Add an assert
llvm-svn: 12010
2004-02-29 22:01:51 +00:00
Chris Lattner e0c3c18802 Add back #include I messed up
llvm-svn: 12009
2004-02-29 21:40:53 +00:00
Chris Lattner 90ecb92838 Urg, forgot to check this in.
llvm-svn: 12007
2004-02-29 21:03:08 +00:00
Chris Lattner f2bb31c5fd Module does not need to be annotatable aka annotable
llvm-svn: 12005
2004-02-29 19:27:55 +00:00
Chris Lattner fcb4f9d00b Remove public header. It's been moved to lib/Target/SparcV9
llvm-svn: 12004
2004-02-29 19:13:20 +00:00
Chris Lattner 3859031b9b Move the private MachineInstrAnnot.h into a private directory.
llvm-svn: 12003
2004-02-29 19:12:51 +00:00
Chris Lattner d5a49c477d Remove use of an ugly header
llvm-svn: 12002
2004-02-29 19:04:31 +00:00
Chris Lattner 6194ee84ba Move methods out of .h file
llvm-svn: 12001
2004-02-29 19:02:39 +00:00
Chris Lattner 23840c7db5 Do not use explicit casts that hide the dependence on Instruction being
annotable

llvm-svn: 12000
2004-02-29 19:02:26 +00:00
Chris Lattner 79b8d467da Ugh, the old sparc backend attaches MachineCodeForInstruction annotations on
LLVM instructions.  Because it contains an explicit cast, we didn't catch it.
I guess instruction's will be annotable for the duration of the sparcv9's
existence.

llvm-svn: 11999
2004-02-29 18:54:23 +00:00
Alkis Evlogimenos 9a4653edfa Add instruction name description.
llvm-svn: 11998
2004-02-29 18:44:03 +00:00
Alkis Evlogimenos 0824ffc697 Use correct template for SHLD and SHRD instructions so that the memory
operand size is correctly specified.

llvm-svn: 11997
2004-02-29 09:19:40 +00:00
Alkis Evlogimenos c7fd0770a0 Improve allocation order:
1) For 8-bit registers try to use first the ones that are parts of the
   same register (AL then AH). This way we only alias 2 16/32-bit
   registers after allocating 4 8-bit variables.

2) Move EBX as the last register to allocate. This will cause less
   spills to happen since we will have 8-bit registers available up to
   register excaustion (assuming we use the allocation order). It
   would be nice if we could push all of the 8-bit aliased registers
   towards the end but we much prefer to keep callee saved register to
   the end to avoid saving them on entry and exit of the function.

For example this gives a slight reduction of spills with linear scan
on 164.gzip.

Before:

11221 asm-printer           - Number of machine instrs printed
  975 spiller               - Number of loads added
  675 spiller               - Number of stores added
  398 spiller               - Number of register spills

After:

11182 asm-printer           - Number of machine instrs printed
  952 spiller               - Number of loads added
  652 spiller               - Number of stores added
  386 spiller               - Number of register spills

llvm-svn: 11996
2004-02-29 09:17:01 +00:00
Alkis Evlogimenos ea81b79a97 A big X86 instruction rename. The instructions are renamed to make
their names more decriptive. A name consists of the base name, a
default operand size followed by a character per operand with an
optional special size. For example:

ADD8rr -> add, 8-bit register, 8-bit register

IMUL16rmi -> imul, 16-bit register, 16-bit memory, 16-bit immediate

IMUL16rmi8 -> imul, 16-bit register, 16-bit memory, 8-bit immediate

MOVSX32rm16 -> movsx, 32-bit register, 16-bit memory

llvm-svn: 11995
2004-02-29 08:50:03 +00:00
Brian Gaeke 2f80d586b8 Remove dead member variables of SparcV9SchedInfo and TargetSchedInfo
llvm-svn: 11994
2004-02-29 08:40:03 +00:00
Chris Lattner 1e36fb030c Eliminate the X86-specific BMI functions, using BuildMI instead.
Replace uses of addZImm with addImm.

llvm-svn: 11992
2004-02-29 07:22:16 +00:00
Chris Lattner 9a97573267 Fix a miscompilation of 197.parser that occurs when you have single basic
block loops.

llvm-svn: 11990
2004-02-29 07:10:16 +00:00
Chris Lattner bf2963ef91 Fix PR255: [tailduplication] Single basic block loops are very rare
Note that this is a band-aid put over a band-aid.  This just undisables
tail duplication in on very specific case that it seems to work in.

llvm-svn: 11989
2004-02-29 06:41:20 +00:00
Brian Gaeke d470a0f042 Update comment at head of file. Also fix C 'typedef struct' nonsense I
inadvertently left in here.

llvm-svn: 11988
2004-02-29 06:33:28 +00:00
Chris Lattner ed01da8f0b Adjust to change in TII ctor arguments
llvm-svn: 11987
2004-02-29 06:31:44 +00:00
Chris Lattner f20abac9bc Eliminate the distinction between "real" and "unreal" instructions
llvm-svn: 11986
2004-02-29 06:31:16 +00:00
Brian Gaeke e65125dcdf Add more architectures, and ELF64 stuff.
llvm-svn: 11985
2004-02-29 06:30:25 +00:00
Chris Lattner ca89812db7 These two virtual methods are never called.
llvm-svn: 11984
2004-02-29 05:59:33 +00:00
Chris Lattner 71a899dea6 Remove a TON of flags that noone cares about
llvm-svn: 11983
2004-02-29 05:58:30 +00:00
Chris Lattner 59d9e9126d Noone calls these virtual methods
llvm-svn: 11982
2004-02-29 05:58:16 +00:00