Commit Graph

17655 Commits

Author SHA1 Message Date
Andrew Lenharth 76c5d97750 added sign extend for boolean
llvm-svn: 20137
2005-02-12 19:35:12 +00:00
Chris Lattner 5d5aede33b Document the newly generalized model for constant globals.
llvm-svn: 20136
2005-02-12 19:30:21 +00:00
Chris Lattner 16277c1775 Allow globals to be of different const'nesses when we link.
This finally resolves PR502, PR450,
and test/Regression/Linker/2005-02-12-ConstantGlobals{,-2}.ll correctly

llvm-svn: 20135
2005-02-12 19:20:28 +00:00
Chris Lattner 36f3eb82a1 New test, adjust other test.
llvm-svn: 20134
2005-02-12 19:19:36 +00:00
Chris Lattner 6af31478ef Reinstate this test, it is correct after all.
llvm-svn: 20133
2005-02-12 19:14:11 +00:00
Chris Lattner 3b4f6c4a73 This test is invalid
llvm-svn: 20131
2005-02-12 19:02:30 +00:00
Chris Lattner e616fea3bc Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll
and PR504.

llvm-svn: 20129
2005-02-12 03:26:49 +00:00
Chris Lattner 4c916478e5 new testcase for PR504
llvm-svn: 20128
2005-02-12 03:26:30 +00:00
Chris Lattner 82e87e4d0c Actually, this testcase is invalid, the bug is in the C++ FE.
llvm-svn: 20123
2005-02-11 23:18:40 +00:00
Chris Lattner 1afcaf601f New testcase that manyoso found compiling QT 4.0.
llvm-svn: 20122
2005-02-11 23:08:34 +00:00
Chris Lattner bebf14d28e Slightly expand on the instructions.
llvm-svn: 20121
2005-02-11 21:17:26 +00:00
Chris Lattner 2a38aea0a7 Bug fixed
llvm-svn: 20118
2005-02-11 19:29:52 +00:00
Chris Lattner e6138f4240 New testcase for PR501
llvm-svn: 20117
2005-02-11 19:26:06 +00:00
Chris Lattner 72b5054afb The pool allocator is now the llvm-poolalloc module in public CVS
llvm-svn: 20116
2005-02-11 04:46:58 +00:00
Andrew Lenharth b301af712e fix a bunch of regressions due to call behavior
llvm-svn: 20110
2005-02-10 20:10:38 +00:00
Alkis Evlogimenos c4a44c6b3d Localize globals if they are only used in main(). This replaces the
global with an alloca, which eventually gets promoted into a
register. This enables a lot of other optimizations later on.

llvm-svn: 20109
2005-02-10 18:36:30 +00:00
Tanya Lattner 56807c6f4a Added new circuit finding alogrithm.
Fixed bug in graph so that phi ite diff edges are added.

llvm-svn: 20108
2005-02-10 17:02:58 +00:00
Tanya Lattner 1137d7c6a1 Allow modsched and local scheduling to both be run.
llvm-svn: 20107
2005-02-10 17:02:06 +00:00
Andrew Lenharth e0b789fdf5 so, if you beat on it, you too can talk emacs into having a sane indenting policy... Also, optimize many function calls with pc-relative calls (partial prologue skipping for that case coming soon), try to fix the random jumps to strange places problem by pesimizing div et. al. register usage and fixing up GP before using, some calling convention tweaks, and make frame pointer unallocatable (not strickly necessary, but let's go for correctness first)
llvm-svn: 20106
2005-02-10 06:25:22 +00:00
Andrew Lenharth f70ef47ee1 fix fp branch
llvm-svn: 20105
2005-02-10 05:17:38 +00:00
Misha Brukman 8d343e77f8 Give props to Brian for V8 backend
llvm-svn: 20104
2005-02-10 02:07:57 +00:00
Misha Brukman 06a1d47f96 * Fix spelling of `volatile'
* Align comments with tablegen elements

llvm-svn: 20103
2005-02-10 01:52:22 +00:00
Chris Lattner 38de952115 This will be moved elsewhere.
llvm-svn: 20101
2005-02-09 22:52:46 +00:00
Misha Brukman b139a7dbb9 * Use doc_code style for blocks of code
* Convert < to &lt; in <pre> block
* Use doc_hilite instead of doc_red style
* Put some classes and options in <tt> blocks

llvm-svn: 20100
2005-02-09 22:49:05 +00:00
Misha Brukman 64f8d07090 Do not mention colors in style names, we might want to change styles themselves
llvm-svn: 20099
2005-02-09 22:47:47 +00:00
Misha Brukman 0c4b8b6db4 * Use an HTML list <ol> instead of custom superscripts in the platform notes
* Reorder software requirements list to show relative importance
* Use superscripts for footnotes in software list rather than "Note 1"
* Use new doc_notes class to separate footnotes from main doc text

llvm-svn: 20098
2005-02-09 22:38:47 +00:00
Misha Brukman 649b77858d Add style to display notes on a different background than the main text
llvm-svn: 20097
2005-02-09 22:36:44 +00:00
Chris Lattner ac648f5375 Turn footnotes into links, make the page validate.
llvm-svn: 20096
2005-02-09 21:15:51 +00:00
Chris Lattner 59a486ace6 If needed, this should be in the 'how to compile the cfe' doc.
llvm-svn: 20095
2005-02-09 21:07:21 +00:00
Chris Lattner 09cc355153 this should be incorporated into the build
llvm-svn: 20094
2005-02-09 21:05:01 +00:00
Misha Brukman 7772309b70 * Separate superscript footnotes with a comma, otherwise it's a 2-digit number
* Make a URL into an HTML link using anchor tag
* Put code in fixed-width font
* Since the MinGW footnote is significantly more than the rest of the footnotes
  combined, it needs to have a border and background color to separate it from
  the regular flow of text for readability purposes.

llvm-svn: 20093
2005-02-09 21:01:26 +00:00
Chris Lattner 093ffb0a5c Add instructions for MINGW, contributed by Henrik Bach
llvm-svn: 20092
2005-02-09 20:43:48 +00:00
Chris Lattner 610ce2c678 Don't print a 'Total Execution Time' line for the 'Miscellaneous Ungrouped
Timers' section.  Since these are random timers in the program it doesn't
make sense to sum them up.

llvm-svn: 20090
2005-02-09 18:41:32 +00:00
Chris Lattner 159485ff1b Fix test/Regression/Assembler/2005-02-09-AsmWriterStoreBug.ll
llvm-svn: 20089
2005-02-09 17:45:03 +00:00
Chris Lattner 60fb167b6e New testcase that the asmwriter botches.
llvm-svn: 20088
2005-02-09 17:42:24 +00:00
Chris Lattner 5ce5a094aa Use new edge iterators to simplify some code.
llvm-svn: 20086
2005-02-09 03:20:43 +00:00
Chris Lattner 06e353c5a9 Add some iterators that should have come in long ago
llvm-svn: 20085
2005-02-09 03:14:29 +00:00
Chris Lattner 81bfc9eda8 Fix installation of configured headers when objdir != srcdir. Patch
contributed by Vladimir Merzliakov!

llvm-svn: 20084
2005-02-09 02:24:00 +00:00
Andrew Lenharth 8ec0a2b13a BranchCC, nifty
llvm-svn: 20067
2005-02-08 00:40:03 +00:00
Andrew Lenharth d4f440de0f fix store issue and an FP conversion (segfault) issue
llvm-svn: 20066
2005-02-07 23:02:23 +00:00
Chris Lattner 863d9c9068 IndCallGraphMap is now a pointer to a new'd map.
llvm-svn: 20065
2005-02-07 16:09:15 +00:00
Chris Lattner 67aeddc423 Hopefully fix the build on Darwin with GCC 3.3
llvm-svn: 20064
2005-02-07 16:09:01 +00:00
Andrew Lenharth 9d3f7704fd copytoreg fix
llvm-svn: 20063
2005-02-07 06:31:44 +00:00
Andrew Lenharth 57047720ce copyfromreg fix
llvm-svn: 20062
2005-02-07 06:21:37 +00:00
Andrew Lenharth 351df0c2dc fix load bug
llvm-svn: 20061
2005-02-07 05:55:55 +00:00
Andrew Lenharth 5d004edc3d more FP load store fixes and Load store simplifications
llvm-svn: 20060
2005-02-07 05:33:15 +00:00
Andrew Lenharth 5fb9b53060 clean up load and stores alot
llvm-svn: 20059
2005-02-07 05:18:02 +00:00
Andrew Lenharth a9e02156ce teach all loads and stores about the stack
llvm-svn: 20058
2005-02-07 05:07:00 +00:00
Andrew Lenharth 0021f55863 prefer FP scratch registers and more check in LowerArguments
llvm-svn: 20057
2005-02-06 21:07:31 +00:00
Andrew Lenharth eefd410522 fix oopso
llvm-svn: 20056
2005-02-06 16:22:15 +00:00
Andrew Lenharth 6c018f77d1 smarter loads and stores. can now handle base+offset.
llvm-svn: 20055
2005-02-06 15:40:40 +00:00
Andrew Lenharth d9bf7b81eb fix build
llvm-svn: 20053
2005-02-05 19:46:51 +00:00
Andrew Lenharth 7be9854594 clean up
llvm-svn: 20051
2005-02-05 17:41:39 +00:00
Andrew Lenharth ea9224a69a fix f32 setcc, and fp select
llvm-svn: 20050
2005-02-05 16:41:03 +00:00
Andrew Lenharth 060d58b88f added ugly support for fp compares
llvm-svn: 20049
2005-02-05 13:19:12 +00:00
Misha Brukman ffe9968b5a Make the rest of file header comments consistent in format and style
llvm-svn: 20048
2005-02-05 02:24:26 +00:00
Chris Lattner 423c04c75c Eliminate the explicit opcode field in ConstantExpr, using the SubclassData
field to hold it instead.  This shrinks memory usage for 176.gcc from
57628728 to 57598144 bytes, a small reduction of about 30K.

llvm-svn: 20047
2005-02-05 02:00:12 +00:00
Chris Lattner 0a9a2e734b Eliminate the explicit volatile fields in LoadInst and StoreInst. This shrinks
LoadInst from 60 -> 56 bytes and StoreInst from 76 -> 72 bytes.

Note however, that this doesn't actually save any memory on common systems
where 'malloc' returns 8-byte aligned memory, as the saved space is replaced
by useless alignment padding.  :(

llvm-svn: 20046
2005-02-05 01:44:18 +00:00
Chris Lattner df57a02be4 Instead of initializing the volatile field, use accessors to set it.
llvm-svn: 20045
2005-02-05 01:38:38 +00:00
Chris Lattner a29c92ffdd Initialize new field.
llvm-svn: 20044
2005-02-05 01:37:58 +00:00
Chris Lattner 9cd92de64b SubclassID is really a small field. Split it into half and let subclasses
play with the unused part.

llvm-svn: 20043
2005-02-05 01:37:44 +00:00
Chris Lattner f60c170ea5 Add support for .cc and .hpp files. Patch contributed by Vladimir Merzliakov!
llvm-svn: 20042
2005-02-04 21:28:50 +00:00
Misha Brukman 076b9f4507 Make file header comment consistent: extend the whole 80 cols to fill the line
llvm-svn: 20039
2005-02-04 20:25:52 +00:00
Chris Lattner 4585abd549 If we have an indirect call site that calls N functions, inline the N functions
into a temporary graph, remember it for later, then inline the tmp graph into
the call site.

In the case where there are other call sites to the same set of functions, this
permits us to just inline the temporary graph instead of all of the callees.

This turns N*M inlining situations into an N+M inlining situation.

llvm-svn: 20036
2005-02-04 19:59:49 +00:00
Chris Lattner d1000686cd Split mergeInGraph into two methods.
llvm-svn: 20035
2005-02-04 19:58:28 +00:00
Chris Lattner 377507b125 Add some new members
llvm-svn: 20034
2005-02-04 19:58:06 +00:00
Chris Lattner 28bfbb70dd add new member
llvm-svn: 20033
2005-02-04 19:57:57 +00:00
Chris Lattner ba954f3284 Fix the Regression/Transforms/DSAnalysis/recursion.ll regression.
llvm-svn: 20031
2005-02-04 18:58:04 +00:00
Chris Lattner 0559691163 Fix a case where were incorrectly compiled cast from short to int on 64-bit
targets.

llvm-svn: 20030
2005-02-04 18:39:19 +00:00
Andrew Lenharth 5152be292a alignment
llvm-svn: 20028
2005-02-04 14:09:38 +00:00
Andrew Lenharth 202011fcc7 get alignment printing correctly and get rid of __main hack
llvm-svn: 20027
2005-02-04 14:01:21 +00:00
Andrew Lenharth c8770aa507 fix constant pointer outputing on 64 bit machines
llvm-svn: 20026
2005-02-04 13:47:16 +00:00
Misha Brukman 20b8a65627 * Fix broken link to directions to get llvm, llvm-gcc, and llvm-test from CVS
* Remove duplicated CVS directions and refer reader to the CVS section
* Clean up directions to be brief

llvm-svn: 20023
2005-02-03 22:25:23 +00:00
Andrew Lenharth 799479138e FP fixes
llvm-svn: 20019
2005-02-03 21:01:15 +00:00
Chris Lattner 3dd3df2b55 Refactor getFunctionArgumentsForCall out of mergeInGraph.
llvm-svn: 20018
2005-02-03 18:40:25 +00:00
Chris Lattner 446b15f3a3 Add a new method.
llvm-svn: 20017
2005-02-03 18:40:05 +00:00
Misha Brukman cd673250ba * Clearly mark LLVM_LIB_SEARCH_PATH as being optional
* llvmgcc and llvmg++ aliases are no longer needed (binaries have llvm- prefix)

llvm-svn: 20016
2005-02-03 18:28:08 +00:00
Chris Lattner 45a6a18393 This is no longer needed. Global variables with undef initializers can be
initialized to anything, including garbage.

llvm-svn: 20010
2005-02-02 20:50:50 +00:00
Misha Brukman d4528ea031 * Instead of fixing the version numbers before every release, mark them as x.y
* Eliminate the redundant "This is the..." in released file listing
* Fix grammar

llvm-svn: 20005
2005-02-02 18:01:57 +00:00
Andrew Lenharth 75c6225f32 Store fix
llvm-svn: 20004
2005-02-02 17:32:39 +00:00
Andrew Lenharth cf2e21e879 oops
llvm-svn: 20003
2005-02-02 17:01:31 +00:00
Andrew Lenharth fe6e7a30c0 prevent register allocator from using the stack pointer :)
llvm-svn: 20002
2005-02-02 17:00:21 +00:00
Andrew Lenharth c7042c2d8b fix loading of floats
llvm-svn: 19997
2005-02-02 15:05:33 +00:00
Jeff Cohen fc9f146966 Put libraries in a common directory
llvm-svn: 19995
2005-02-02 06:33:11 +00:00
Andrew Lenharth 0f42d92ca0 marked mem* as not supported
llvm-svn: 19992
2005-02-02 05:49:42 +00:00
Jeff Cohen d44e5dae0f Add additional source of Win32 GNU utilities.
llvm-svn: 19991
2005-02-02 05:46:20 +00:00
Alkis Evlogimenos 346bb20409 Fix crash on MallocInsts of unsized types.
llvm-svn: 19988
2005-02-02 04:43:37 +00:00
Andrew Lenharth 07c0b0d92b fix Load bug
llvm-svn: 19987
2005-02-02 04:35:44 +00:00
Chris Lattner 5aa75e4ce5 Fix yet another memset issue.
llvm-svn: 19986
2005-02-02 03:44:41 +00:00
Andrew Lenharth c7e55f430c try to make a bug bugpointable, add yet more constant pool stuff, fixup constant loads for FP
llvm-svn: 19985
2005-02-02 03:36:35 +00:00
Andrew Lenharth ae88b6a8a8 better constant handling, should fix many remaining cases
llvm-svn: 19984
2005-02-02 00:51:15 +00:00
Alkis Evlogimenos 7c04a3ddb6 Add variable for bugpoint.
llvm-svn: 19981
2005-02-02 00:40:15 +00:00
Chris Lattner 16a53243c6 Eliminate some duplicated debug code
llvm-svn: 19980
2005-02-01 21:55:40 +00:00
Chris Lattner 5ce51e83af Eliminate self-recursion as a special case.
llvm-svn: 19979
2005-02-01 21:49:43 +00:00
Chris Lattner 50cebc6b9b Eliminate use of DSCallSiteIterator in key loop. This is a half step to
a tasty speedup.

llvm-svn: 19978
2005-02-01 21:37:27 +00:00
Chris Lattner eb5febea34 remove dead method
llvm-svn: 19977
2005-02-01 21:37:06 +00:00
Andrew Lenharth 9df6a764b9 fix FP arg passing bug, Add unsigned to/from int, fix SELECT, fix Constant pool
llvm-svn: 19976
2005-02-01 20:40:27 +00:00
Andrew Lenharth 20d8b2ff71 Print the Constant pool
llvm-svn: 19975
2005-02-01 20:38:53 +00:00
Andrew Lenharth 32124c0a70 Make cmov work right and loads for fp from constant pool
llvm-svn: 19974
2005-02-01 20:36:44 +00:00
Andrew Lenharth c777d4f03d Correct stack stuff for FP
llvm-svn: 19973
2005-02-01 20:35:57 +00:00
Andrew Lenharth 8fb0d5002b try to match alpha pattern
llvm-svn: 19972
2005-02-01 20:35:11 +00:00
Andrew Lenharth 7703d1ab25 fix register names
llvm-svn: 19971
2005-02-01 20:34:29 +00:00
Chris Lattner 63a46cee87 Signficantly speed up printing by not emitting the same file twice with
different names.  Large SCC's tend to be big, so this saves a lot of time.

llvm-svn: 19970
2005-02-01 19:10:48 +00:00
Chris Lattner 4487b2e5a6 Fix some bugs andrew noticed legalizing memset for alpha
llvm-svn: 19969
2005-02-01 18:38:28 +00:00
Chris Lattner d6106a41fe Do not revisit nodes in the SCC traversal. This speeds up the BU pass a bit.
llvm-svn: 19968
2005-02-01 17:35:52 +00:00
Jeff Cohen c04c0dbd19 Put finishing touches on GettingStartedVS.html and link it to the index.
llvm-svn: 19967
2005-02-01 15:59:28 +00:00
Chris Lattner 085c981345 Fix test/Regression/Assembler/2005-01-31-CallingAggregateFunction.ll
llvm-svn: 19966
2005-02-01 01:47:42 +00:00
Chris Lattner 29b97d53c1 Apparently := confuses makellvm
llvm-svn: 19965
2005-02-01 01:47:12 +00:00
Chris Lattner 4298e1fea4 This bug crashes the assembler, distilled from a testcase produced by Andrew.
llvm-svn: 19964
2005-02-01 01:44:54 +00:00
Andrew Lenharth cdc9e33ae5 pecimise loads, put indirect call addr in right register. still doesn't fix methcall
llvm-svn: 19963
2005-02-01 01:37:24 +00:00
Chris Lattner f87e05be26 Update speedup and shrinkage info
llvm-svn: 19962
2005-02-01 01:33:52 +00:00
Chris Lattner 4947e67c4f Updates for new use list changes.
llvm-svn: 19961
2005-02-01 01:24:21 +00:00
Chris Lattner b6c21dbb1e Update for API change.
llvm-svn: 19960
2005-02-01 01:24:01 +00:00
Chris Lattner 82b42c5d85 API change.
llvm-svn: 19959
2005-02-01 01:23:49 +00:00
Chris Lattner d6a4492f81 Adjust to changes in APIs
llvm-svn: 19958
2005-02-01 01:23:31 +00:00
Chris Lattner f98a7bffb3 Hacks to make this ugly ugly code work with the new use lists.
llvm-svn: 19957
2005-02-01 01:22:56 +00:00
Chris Lattner ef55a1a775 Switch from using an ilist for uses to using a custom doubly linked list.
This list does not provide the ability to go backwards in the list (its
more of an unordered collection, stored in the shape of a list).

This change means that use iterators are now only forward iterators, not
bidirectional.

This improves the memory usage of use lists from '5 + 4*#use' per value to
'1 + 4*#use'.  While it would be better to reduce the multiplied factor,
I'm not smart enough to do so.  This list also has slightly more efficient
operators for manipulating list nodes (a few less loads/stores), due to not
needing to be able to iterate backwards through the list.

This change reduces the memory footprint required to hold 176.gcc from
66.025M -> 57.687M, a 14% reduction.  It also speeds up the compiler,
7.73% in the case of bytecode loading alone (release build loading 176.gcc).

llvm-svn: 19956
2005-02-01 01:22:06 +00:00
Chris Lattner 1230cf25ba Fix a problem where we could infinitely recurse on phi nodes.
llvm-svn: 19955
2005-02-01 00:18:30 +00:00
Misha Brukman 8dfa2e4465 Fix hyphenation in output comment
llvm-svn: 19954
2005-01-31 06:19:57 +00:00
Chris Lattner 72684fecf8 Implement InstCombine/cast.ll:test25, a case that occurs many times
in spec

llvm-svn: 19953
2005-01-31 05:51:45 +00:00
Chris Lattner 46452d4558 New testcase
llvm-svn: 19952
2005-01-31 05:51:18 +00:00
Jeff Cohen 1b0d750ade Add LLVM with Visual Studio overview
llvm-svn: 19951
2005-01-31 05:42:10 +00:00
Chris Lattner 31f486c775 Implement the trivial cases in InstCombine/store.ll
llvm-svn: 19950
2005-01-31 05:36:43 +00:00
Chris Lattner 2357f255ca New testcase
llvm-svn: 19949
2005-01-31 05:36:19 +00:00
Chris Lattner c456eac1b9 Rename these to start with %c, as they are the only ones that are checked.
No change to the tests themselves.

llvm-svn: 19948
2005-01-31 05:17:31 +00:00
Chris Lattner fe1b0b8b24 Implement Transforms/InstCombine/cast-load-gep.ll, which allows us to devirtualize
11 indirect calls in perlbmk.

llvm-svn: 19947
2005-01-31 04:50:46 +00:00
Chris Lattner 340ab5bbbb New testcase
llvm-svn: 19946
2005-01-31 04:49:22 +00:00
Andrew Lenharth ae25bb1dc5 indirect call fix
llvm-svn: 19945
2005-01-31 03:19:31 +00:00
Andrew Lenharth c40d156dc9 fp to int and back conversion sequences
llvm-svn: 19944
2005-01-31 01:44:26 +00:00
Chris Lattner ccf22fb182 Fix the regressions my User changes introduced. Apparently some parts of
LLVM make the very reasonable assumption that constant expressions will
have at least one operand! :)

llvm-svn: 19943
2005-01-31 01:11:13 +00:00
Chris Lattner 2ca79d339e Rename variables to work with VC++'s hokey scoping rules.
llvm-svn: 19942
2005-01-31 00:10:58 +00:00
Chris Lattner 2977b857c2 Fix some scary bugs that VC++ detected.
llvm-svn: 19941
2005-01-31 00:10:45 +00:00
Chris Lattner a1b39fa5ad * Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
  This makes many operations on these lists much more natural, and avoids
  *exteremely* expensive copying of DSCallSites (e.g. moving nodes around
  between lists, erasing a node from not the end of the vector, etc).

With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc.  I expect that it would help TD even more, but I don't
have data for it.

This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.

llvm-svn: 19939
2005-01-30 23:51:02 +00:00
Andrew Lenharth 7141334f98 added fp extend and removed a forgotten assert in more than 6 arg support (should break somewhere else now :) ) and fix an incorrect asm sequence for indirect calls
llvm-svn: 19938
2005-01-30 20:42:36 +00:00
Jeff Cohen 391380ee97 Silence VC++ warnings about using 'this' in base member initializations.
llvm-svn: 19937
2005-01-30 17:54:12 +00:00
Chris Lattner 8e62f434cd This code is really unreachable.
llvm-svn: 19934
2005-01-30 16:33:46 +00:00
Chris Lattner bfa060c5d2 Fix warnings.
llvm-svn: 19933
2005-01-30 16:32:48 +00:00
Andrew Lenharth 918a29fc51 support for larger calls
llvm-svn: 19932
2005-01-30 00:35:27 +00:00
Chris Lattner 79a85fada1 Improve spelling
llvm-svn: 19931
2005-01-30 00:13:34 +00:00
Chris Lattner f6c93e36c7 Improve conformance with the Misha spelling benchmark suite
llvm-svn: 19930
2005-01-30 00:09:23 +00:00
Tanya Lattner 5ca41e2b68 Make this work on systems where size_t == unsigned and where they are not
the same.

llvm-svn: 19929
2005-01-29 23:29:55 +00:00
Tanya Lattner 238cf92000 Make this work on systems where size_t is not the same as unsigned.
llvm-svn: 19928
2005-01-29 23:08:01 +00:00
Chris Lattner fdec565f1f Unbreak the build :(
llvm-svn: 19926
2005-01-29 19:27:28 +00:00
Chris Lattner 2f0a1108ff Adjust to ilist changes.
Based on the ilist changes avoid allocating an entire Use object for the
end of the Use chain.  This saves 8 bytes of memory for each Value allocated
in the program.  For 176.gcc, this reduces us from 69.5M -> 66.0M, a 5.3%
memory savings.

llvm-svn: 19925
2005-01-29 18:43:28 +00:00
Chris Lattner e6074aa08b adjust to ilist changes.
llvm-svn: 19924
2005-01-29 18:41:25 +00:00
Chris Lattner e5c7b9a215 Adjust to ilist changes.
llvm-svn: 19923
2005-01-29 18:41:12 +00:00
Chris Lattner f84ecca5f3 Adjust to changes in ilist
llvm-svn: 19922
2005-01-29 18:41:00 +00:00
Chris Lattner 02ccc2d7a0 Rename createNode -> createSentinal.
Add a new method, destroySentinal, that is used to delete it (instead of
requiring use of delete.

llvm-svn: 19921
2005-01-29 18:40:19 +00:00
Chris Lattner 0174b52dd9 clean up comments
llvm-svn: 19920
2005-01-29 17:29:05 +00:00
Chris Lattner e89f022ba7 This has been deprecated for long enough, nuke it.
llvm-svn: 19919
2005-01-29 17:27:26 +00:00
Chris Lattner 800b72445f This file was schizophrenic when it came to representing sizes. In some
cases it represented them as 'unsigned's, which are not enough for 64-bit
hosts.  In other cases, it represented them as uint64_t's, which are
inefficient for 32-bit hosts.

This patch unifies all of the sizes to use size_t instead.

llvm-svn: 19918
2005-01-29 17:17:18 +00:00
Chris Lattner 0701b78768 There is no reason to include ostream here, include iosfwd instead.
This file was schizophrenic when it came to representing sizes.  In some
cases it represented them as 'unsigneds', which are not enough for 64-bit
hosts.  In other cases, it represented them as uint64_t's, which are
inefficient for 32-bit hosts.

This patch unifies all of the sizes to use size_t instead.

llvm-svn: 19917
2005-01-29 17:16:07 +00:00
Chris Lattner bb4384ba71 After reading in a bc file, trim the resultant buffer down to what we
really need.  This reduces 4M of memory consumption reading 176.gcc.

llvm-svn: 19916
2005-01-29 17:05:56 +00:00
Chris Lattner 173340640a Finegrainify namespacification
llvm-svn: 19915
2005-01-29 16:53:02 +00:00
Andrew Lenharth 41bc2c2897 first step towards a correct and complete stack. also add some forms for things that were getting stuck in the nightly tester.
llvm-svn: 19914
2005-01-29 15:42:07 +00:00
Chris Lattner 1ec230e665 Due to previous simplifications, we can simplify the data structures being
used here.

llvm-svn: 19913
2005-01-29 07:04:10 +00:00
Chris Lattner ce0fa4c109 Properly handle volatile.
llvm-svn: 19912
2005-01-29 06:42:34 +00:00
Chris Lattner a194357025 Remove some useless map operations. Loads/stores that are in the same
BB as the load are not included in the Cand* sets at all.

llvm-svn: 19911
2005-01-29 06:39:25 +00:00
Chris Lattner be62e72273 Before doing expensive global analysis, check to make sure the pointer is
not invalidated on entry and on exit of the block.  This fixes some N^2
behavior in common cases, and speeds up gcc another 5% to 22.35s.

llvm-svn: 19910
2005-01-29 06:31:53 +00:00
Chris Lattner afdbae2b55 Fix quotes.
llvm-svn: 19909
2005-01-29 06:29:45 +00:00
Jeff Cohen b49177f017 Unbreak VC++ build
llvm-svn: 19908
2005-01-29 06:27:16 +00:00
Chris Lattner fe7a9a242e Minor simplification/speedup. Replaces a set lookup with a pointer comparison.
This speeds up 176.gcc from 25.73s to 23.48s, which is 9.5%

llvm-svn: 19907
2005-01-29 06:20:55 +00:00
Chris Lattner 787aed675d Eliminate generality that is not buying us anything. In particular, this
will cause us to miss cases where the input pointer to a load could be value
numbered to another load.  Something like this:


  %X = load int* %P1
  %Y = load int* %P2

Those are obviously the same if P1/P2 are the same.  The code this patch
removes attempts to handle that.  However, since GCSE iterates, this doesn't
actually buy us anything: GCSE will first replace P1 or P2 with the other
one, then the load can be value numbered as equal.

Removing this code speeds up gcse a lot.  On 176.gcc in debug mode, this
speeds up gcse from 29.08s -> 25.73s, a 13% savings.

llvm-svn: 19906
2005-01-29 06:11:16 +00:00
Chris Lattner b25abcb1fa If we see:
%A = alloca int
  %V = load int* %A

value number %V to undef, not 0.

llvm-svn: 19905
2005-01-29 05:57:01 +00:00
Chris Lattner 2295d0b7de Memory used is a delta between memuse at the start of the time and the
memuse at the end, thus it is signed.

llvm-svn: 19904
2005-01-29 05:21:16 +00:00
Jeff Cohen a7f83cf6b3 Unbreak VC++ build
llvm-svn: 19903
2005-01-29 03:32:49 +00:00
Chris Lattner f711f8db41 Make sure that we always grow a multiple of 2 operands.
llvm-svn: 19902
2005-01-29 01:05:12 +00:00
Chris Lattner e9c61fbb51 noteworthy.
llvm-svn: 19901
2005-01-29 00:44:22 +00:00
Chris Lattner d8e20188c6 Adjust to changes in instruction interfaces.
llvm-svn: 19900
2005-01-29 00:39:08 +00:00
Chris Lattner a3f06fa2dd Switchinst takes a hint for the number of cases it will have.
llvm-svn: 19899
2005-01-29 00:38:45 +00:00
Chris Lattner a35dfcedd3 switchinst ctor now takes a hint for the number of cases that it will have.
llvm-svn: 19898
2005-01-29 00:38:26 +00:00
Chris Lattner 84d3137da7 Adjust Valuehandle to hold its operand directly in it.
llvm-svn: 19897
2005-01-29 00:37:36 +00:00
Chris Lattner 3479f9cca8 Finegrainify namespacification.
Adjust TmpInstruction to work with the new User model.

llvm-svn: 19896
2005-01-29 00:36:59 +00:00
Chris Lattner 68afd89730 add namespace qualifier
llvm-svn: 19895
2005-01-29 00:36:38 +00:00
Chris Lattner 616b8fc630 Adjust to changes in User class and minor changes in instruction ctors.
llvm-svn: 19894
2005-01-29 00:36:19 +00:00
Chris Lattner 2c08949c62 Adjust to slight changes in instruction interfaces.
llvm-svn: 19893
2005-01-29 00:35:55 +00:00
Chris Lattner 5d1bc2c408 Adjust to changes in User class.
llvm-svn: 19892
2005-01-29 00:35:33 +00:00
Chris Lattner afdb3de4d7 Merge InstrTypes.cpp into this file
Adjust to changes in the User class, operand handling is very different.
PHI node and switch statements must handle explicit resizing of operand
lists.

llvm-svn: 19891
2005-01-29 00:35:16 +00:00
Chris Lattner d0df99ce86 Adjust to changes in User class. Aggregate constants now must explicitly
manage their operands.

llvm-svn: 19890
2005-01-29 00:34:39 +00:00
Chris Lattner 03adb1aa83 This file is now merged into Instructions.cpp
llvm-svn: 19889
2005-01-29 00:33:32 +00:00
Chris Lattner 00b82c25bc Adjust to changes in the User class.
llvm-svn: 19888
2005-01-29 00:33:00 +00:00
Chris Lattner 5e9de0e083 Adjust to changes in the User class. Introduce a new UnaryInstruction
class.

llvm-svn: 19887
2005-01-29 00:32:51 +00:00
Chris Lattner 9d8da6a9f4 Adjust to user changes.
llvm-svn: 19886
2005-01-29 00:32:00 +00:00
Chris Lattner 4921cdf9c0 Many changes to cope with the User.h changes. Instructions now generally
directly embed their operands.

llvm-svn: 19885
2005-01-29 00:31:36 +00:00
Chris Lattner 893314cd3a Adjust to User.h changes.
llvm-svn: 19884
2005-01-29 00:30:52 +00:00
Chris Lattner f11ea56ef6 Instead of storing operands as std::vector<Use>, just maintain a pointer
and num operands in the User class.  this allows us to embed the operands
directly in the subclasses if possible.  For example, for binary operators
we store the two operands in the derived class.

The has several effects:
  1. it improves locality because the operands and instruction are together
  2. it makes accesses to operands faster (one less load) if you access them
     through the derived class pointer.  For example this:

Value *GetBinaryOperatorOp(BinaryOperator *I, int i) {
  return I->getOperand(i);
}

Was compiled to:

_Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi:
        movl    4(%esp), %edx
        movl    8(%esp), %eax
        sall    $4, %eax
        movl    24(%edx), %ecx
        addl    %ecx, %eax
        movl    (%eax), %eax
        ret

and is now compiled to:

_Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi:
        movl    8(%esp), %eax
        movl    4(%esp), %edx
        sall    $4, %eax
        addl    %edx, %eax
        movl    44(%eax), %eax
        ret

Accesses through "Instruction*" are unmodified.

   3. This reduces memory consumption (by about 3%) by eliminating 1 word of
      vector overhead and a malloc header on a seperate object.
   4. This speeds up gccas about 10% (both debug and release builds) on
      large things (such as 176.gcc).  For example, it takes a debug build
      from 172.9 -> 155.6s and a release gccas from 67.7 -> 61.8s

llvm-svn: 19883
2005-01-29 00:29:39 +00:00
Andrew Lenharth 4a0d200c13 fix ExprMap, partially teach about add long
llvm-svn: 19882
2005-01-28 23:17:54 +00:00
Chris Lattner feaf92f7ad Fix a nasty thinko in my previous commit.
llvm-svn: 19881
2005-01-28 23:17:27 +00:00
Chris Lattner bc7497d5f5 Alpha doesn't have a native f32 extload instruction.
llvm-svn: 19880
2005-01-28 22:58:25 +00:00
Chris Lattner bf8c1ad313 implement legalization of truncates whose results and sources need to be
truncated, e.g. (truncate:i8 something:i16) on a 32 or 64-bit RISC.

llvm-svn: 19879
2005-01-28 22:52:50 +00:00
Chris Lattner a4cfafe31a Get alpha working with memset/memcpy/memmove
llvm-svn: 19878
2005-01-28 22:29:18 +00:00
Reid Spencer 3a46875e54 Fix some typos in the Makefile.rules.
Patch contributed by Vladimer Merzliakov.

llvm-svn: 19877
2005-01-28 19:52:32 +00:00
Chris Lattner cd96168c95 Hrm, who knows what 'uint' is, but it seems to work sometimes? Wierd.
llvm-svn: 19876
2005-01-28 19:37:35 +00:00
Chris Lattner cd517ff0c7 * add some DEBUG statements
* Properly compile this:

struct a {};
int test() {
  struct a b[2];
  if (&b[0] != &b[1])
    abort ();
  return 0;
}

to 'return 0', not abort().

llvm-svn: 19875
2005-01-28 19:32:01 +00:00
Chris Lattner 60c47267a9 Fix ConstProp/2005-01-28-SetCCGEP.ll: indexing over zero sized elements does
not change the address.

llvm-svn: 19874
2005-01-28 19:09:51 +00:00
Chris Lattner e3aa4c01d5 New testcase.
llvm-svn: 19873
2005-01-28 19:08:32 +00:00
Chris Lattner 54903b68f2 Add some initial documentation for the SelectionDAG based instruction selectors
llvm-svn: 19872
2005-01-28 17:22:53 +00:00
Chris Lattner 5d88f184e2 Do not clean up if the MappedFile was never used or if the client already
closed the file.  This unbreaks the build.

llvm-svn: 19871
2005-01-28 16:08:23 +00:00
Andrew Lenharth 579a324137 fix ExprMap and constant check in setcc
llvm-svn: 19870
2005-01-28 14:06:46 +00:00
Jeff Cohen c723678541 Get VC++ compiling again
llvm-svn: 19869
2005-01-28 07:29:32 +00:00
Reid Spencer adabeccd02 Convert some old C-style casts to C++ style.
llvm-svn: 19868
2005-01-28 07:22:20 +00:00
Andrew Lenharth 479bc61455 move FP into it's own select
llvm-svn: 19867
2005-01-28 06:57:18 +00:00
Chris Lattner eb6614d719 CopyFromReg produces two values. Make sure that we remember that both are
legalized, and actually return the correct result when we legalize the chain first.

llvm-svn: 19866
2005-01-28 06:27:38 +00:00
Chris Lattner 38389b1633 These passes are no more.
llvm-svn: 19865
2005-01-28 06:13:52 +00:00
Chris Lattner c782335e33 Remove this code as it is currently completely broken and unmaintained.
If needed, this can be resurrected from CVS.

Note that several of the interfaces (e.g. the IPModRef ones) are supersumed
by generic AliasAnalysis interfaces that have been written since this code
was developed (and they are not DSA specific).

llvm-svn: 19864
2005-01-28 06:12:46 +00:00
Jeff Cohen 971e03d74a Properly close mapped files.
llvm-svn: 19863
2005-01-28 01:17:07 +00:00
Misha Brukman df77835166 Mark -parallel pass as `experimental'
llvm-svn: 19858
2005-01-27 17:59:51 +00:00
Andrew Lenharth 7c538a6593 stack frame fix and zero FP reg fix
llvm-svn: 19857
2005-01-27 08:31:19 +00:00
Andrew Lenharth 96515adad6 Floating point instructions like Floating point registers
llvm-svn: 19856
2005-01-27 07:58:15 +00:00
Andrew Lenharth 0cceb5165e int to float conversion and another setcc
llvm-svn: 19855
2005-01-27 07:50:35 +00:00
Misha Brukman 3852f652bf Fix grammar
llvm-svn: 19854
2005-01-27 06:46:38 +00:00
Andrew Lenharth 3c361fd6f7 teach isel about comparison with constants and zero extending bits
llvm-svn: 19853
2005-01-27 03:49:45 +00:00
Jeff Cohen 9671b213b6 Fix some Path bugs
llvm-svn: 19852
2005-01-27 03:49:03 +00:00
Andrew Lenharth 5374789198 perhaps this will let me have calls again
llvm-svn: 19851
2005-01-27 01:22:48 +00:00
Andrew Lenharth 9e27e54d70 minor bug fix
llvm-svn: 19850
2005-01-27 00:52:26 +00:00
Andrew Lenharth 9748b623a4 minor bug fix
llvm-svn: 19849
2005-01-27 00:51:05 +00:00
Andrew Lenharth 267908ad47 added instructions for fp to int to fp moves
llvm-svn: 19848
2005-01-26 23:56:48 +00:00
Andrew Lenharth 5ae5f81720 initial fp support
llvm-svn: 19847
2005-01-26 21:54:09 +00:00
Chris Lattner 651ffb1df8 xfail this.
llvm-svn: 19846
2005-01-26 07:09:44 +00:00
Chris Lattner a710180bba XFAIL this for now.
llvm-svn: 19845
2005-01-26 07:08:42 +00:00
Andrew Lenharth 589304de7f hum, writing on one machine, testing on another...
llvm-svn: 19844
2005-01-26 02:53:56 +00:00
Andrew Lenharth 02c5459948 add some operations, fix others. should compile several more tests now
llvm-svn: 19843
2005-01-26 01:24:38 +00:00
Chris Lattner 1b20615173 We can fold promoted and non-promoted loads into divs also!
llvm-svn: 19835
2005-01-25 20:35:10 +00:00
Chris Lattner 30607ec66e Fold promoted loads into binary ops for FP, allowing us to generate m32 forms
of FP ops.

llvm-svn: 19834
2005-01-25 20:03:11 +00:00
Andrew Lenharth ba2bcd867f problems with bools, and their work arounds
llvm-svn: 19833
2005-01-25 19:58:40 +00:00
Alkis Evlogimenos fbd921987f Add a dependency to the trace library so that it gets pulled in
automatically.

llvm-svn: 19828
2005-01-25 16:23:57 +00:00
Reid Spencer 97f0f7646d Document the --load option.
llvm-svn: 19822
2005-01-25 05:04:49 +00:00
Andrew Lenharth 122489bcab more load choices, better add with imm
llvm-svn: 19821
2005-01-25 00:35:34 +00:00
Chris Lattner 2e2edef9c6 Make -ds-aa more useful, allowing it to be updated as xforms hack on the program.
llvm-svn: 19818
2005-01-24 20:00:14 +00:00
Chris Lattner d64fafd937 Add some methods.
llvm-svn: 19817
2005-01-24 19:55:34 +00:00
Andrew Lenharth 2f0f845534 Clean ups, and taught the instruction selector about immediate forms
llvm-svn: 19816
2005-01-24 19:44:07 +00:00
Andrew Lenharth 6d1a96bccc Alpha JIT prune
llvm-svn: 19815
2005-01-24 18:48:22 +00:00
Andrew Lenharth 3c12772190 include prune and JIT prune
llvm-svn: 19814
2005-01-24 18:45:41 +00:00
Andrew Lenharth 4680f89526 Pruned includes
llvm-svn: 19813
2005-01-24 18:37:48 +00:00
Andrew Lenharth f36418f618 let configure recognize Alphas
llvm-svn: 19811
2005-01-24 17:33:52 +00:00
Andrew Lenharth 3c3de91b79 let configure recognize Alphas
llvm-svn: 19810
2005-01-24 17:25:41 +00:00
Misha Brukman 454c06f5a4 Mark CVS versions different from releases
llvm-svn: 19809
2005-01-24 16:29:24 +00:00
Misha Brukman 664d251443 `primitive' has no `a'
llvm-svn: 19808
2005-01-24 16:28:03 +00:00
Chris Lattner 5b9c49b6f2 Do not return true from isSized for things without a size (like functions and
labels) even though they are concrete.  This fixes the DSA regressions from
last night.

llvm-svn: 19807
2005-01-24 16:00:52 +00:00
Chris Lattner b6627702b4 This giant patch speeds up Type::isSized(). Before, this would have to search
large nested types over and over again to determine if they are sized or not.
Now, isSized() is able to make snap decisions about all concrete types, which
are a common occurance (and includes all primitives).

On 177.mesa, this speeds up DSE from 39.5s -> 21.3s and GCSE from
13.2s -> 11.3s, reducing gccas time from 80s -> 61s (this is a debug build).

DSE and GCSE are still too slow on this testcase, but this is a simple
improvement.

llvm-svn: 19800
2005-01-24 02:08:34 +00:00
Chris Lattner 39837024ae Fix a spurious warning.
llvm-svn: 19799
2005-01-24 01:40:18 +00:00
Chris Lattner 0e1de101a1 Silence a warning.
llvm-svn: 19798
2005-01-23 23:20:06 +00:00
Chris Lattner 0dfd7d3a0d Silence optimized warnings.
llvm-svn: 19797
2005-01-23 23:19:44 +00:00
Chris Lattner debae1e3c3 Allow the FP stackifier to completely ignore functions that do not use FP at
all.  This should speed up the X86 backend fairly significantly on integer
codes.  Now if only we didn't have to compute livevar still... ;-)

llvm-svn: 19796
2005-01-23 23:13:59 +00:00
Chris Lattner fb5614506e Simplify/speedup the PEI by not having to scan for uses of the callee saved
registers.  This information is computed directly by the register allocator
now.

llvm-svn: 19795
2005-01-23 23:13:12 +00:00
Chris Lattner 90b491f46a Add an accessor.
llvm-svn: 19794
2005-01-23 22:57:27 +00:00
Chris Lattner 3d527f7b61 Update physregsused info.
llvm-svn: 19793
2005-01-23 22:55:45 +00:00
Chris Lattner 24f0f0e28f Update this pass to set PhysRegsUsed info in MachineFunction.
llvm-svn: 19792
2005-01-23 22:51:56 +00:00
Chris Lattner ae09d93b35 Update these register allocators to set the PhysRegUsed info in MachineFunction.
llvm-svn: 19791
2005-01-23 22:45:13 +00:00
Chris Lattner 304053c6ec Add support for the PhysRegsUsed array.
llvm-svn: 19789
2005-01-23 22:13:58 +00:00
Chris Lattner 1def519f3d Expose more information from register allocation to passes that run after
it.

llvm-svn: 19788
2005-01-23 22:13:36 +00:00
Chris Lattner ef2de322c6 Speed this up a bit by making ModifiedRegs a vector<char> not vector<bool>
llvm-svn: 19787
2005-01-23 21:45:01 +00:00
Chris Lattner 9e2c7facb2 Get rid of a several dozen more and instructions in specint.
llvm-svn: 19786
2005-01-23 20:26:55 +00:00
Chris Lattner 6c43f5e5fe Fix crash comparing empty file against nonempty file.
llvm-svn: 19782
2005-01-23 06:02:40 +00:00
Chris Lattner 4add7e356f Adjust to changes in SelectionDAG interfaces
The first half of correct chain insertion for libcalls. This is not enough
to fix Fhourstones yet though.

llvm-svn: 19781
2005-01-23 04:42:50 +00:00
Chris Lattner 90b7c13f3a Remove the 3 HACK HACK HACKs I put in before, fixing them properly with
the new TLI that is available.

Implement support for handling out of range shifts.  This allows us to
compile this code (a 64-bit rotate):

unsigned long long f3(unsigned long long x) {
  return (x << 32) | (x >> (64-32));
}

into this:

f3:
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP + 8]
        ret

GCC produces this:

$ gcc t.c -masm=intel -O3 -S -o - -fomit-frame-pointer
..
f3:
        push    %ebx
        mov     %ebx, DWORD PTR [%esp+12]
        mov     %ecx, DWORD PTR [%esp+8]
        mov     %eax, %ebx
        mov     %edx, %ecx
        pop     %ebx
        ret

The Simple ISEL produces (eww gross):

f3:
        sub %ESP, 4
        mov DWORD PTR [%ESP], %ESI
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %ECX, DWORD PTR [%ESP + 12]
        mov %EAX, 0
        mov %ESI, 0
        or %EAX, %ECX
        or %EDX, %ESI
        mov %ESI, DWORD PTR [%ESP]
        add %ESP, 4
        ret

llvm-svn: 19780
2005-01-23 04:39:44 +00:00
Chris Lattner ffcb0ae329 Adjust to changes in SelectionDAG interface.
llvm-svn: 19779
2005-01-23 04:36:26 +00:00
Chris Lattner 2877e9e826 Give SelectionDAG a TargetLowering instance instead of TM instance.
llvm-svn: 19778
2005-01-23 04:36:06 +00:00
Chris Lattner 28939a222e Build Alpha by default.
llvm-svn: 19777
2005-01-23 04:34:46 +00:00
Reid Spencer d5d45b8d1a Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca
llvm-svn: 19776
2005-01-23 04:32:47 +00:00
Reid Spencer 30226da5b3 Support Cygwin assembly generation. The cygwin version of Gnu ASsembler
doesn't support certain directives and symbols on cygwin are prefixed with
an underscore. This patch makes the necessary adjustments to the output.

llvm-svn: 19775
2005-01-23 03:52:14 +00:00
Chris Lattner ece10a420e Add support for fp tolerances
llvm-svn: 19774
2005-01-23 03:45:26 +00:00
Chris Lattner 580f5bfae3 This method takes sys::Path objects now.
llvm-svn: 19773
2005-01-23 03:32:16 +00:00
Chris Lattner 411bbeeac7 Adjust to changed interface.
llvm-svn: 19772
2005-01-23 03:31:39 +00:00
Chris Lattner b782187b32 Make DiffFilesWithTolerance take sys::Path's instead of std::strings
Delete dead functions.

llvm-svn: 19771
2005-01-23 03:31:02 +00:00
Chris Lattner 7e264b2ec6 Remove two dead methods and improve the comments for DiffFilesWithTolerance.
Also, make DiffFilesWithTolerance take sys::Path objects instead of std::strings.

llvm-svn: 19770
2005-01-23 03:30:39 +00:00
Chris Lattner 364e8b771d Fix a bug in previous checkin
llvm-svn: 19769
2005-01-23 03:19:13 +00:00
Chris Lattner dff29cd72e Drop dead #include
llvm-svn: 19768
2005-01-23 03:16:56 +00:00
Chris Lattner c5a20a5dd4 The meat of this utility has been moved to FileUtilities, where it can be
used by other tools.

llvm-svn: 19767
2005-01-23 03:15:47 +00:00
Chris Lattner 16a4368c40 Add a new method, refactored out of fpcmp
llvm-svn: 19766
2005-01-23 03:13:43 +00:00
Chris Lattner ca2bf0b67a New method.
llvm-svn: 19765
2005-01-23 03:11:38 +00:00
Andrew Lenharth a1b5ca2b9d Let me introduce you to the early stages of the llvm backend for the alpha processor
llvm-svn: 19764
2005-01-22 23:41:55 +00:00
Chris Lattner eccb73d57f Get this to work for 64-bit systems.
llvm-svn: 19763
2005-01-22 23:04:37 +00:00
Reid Spencer 12b25a12a6 We're working towards LLVM 1.5 now so bump the version number. This change
won't be propagated to the configure script until there's a need to change
configure.ac for some larger purpose.

llvm-svn: 19762
2005-01-22 21:29:42 +00:00
Chris Lattner 97cf8fd4a9 Minor fix.
llvm-svn: 19761
2005-01-22 20:59:38 +00:00
Chris Lattner 59a7f5c2f3 This is the final big of factoring. This shares cases in suboperand
differences, which means that identical instructions (after stripping off
the first literal string) do not run any different code at all.  On the X86,
this turns this code:

    switch (MI->getOpcode()) {
    case X86::ADC32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::ADC32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::ADC32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ADD32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::ADD32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::ADD32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::AND32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::AND32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::AND32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::CMP32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::CMP32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::MOV32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::MOV32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::OR32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::OR32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::OR32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ROL32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::ROR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SAR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SBB32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::SBB32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::SBB32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::SHL32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SHLD32mrCL: printOperand(MI, 4, MVT::i32); break;
    case X86::SHR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SHRD32mrCL: printOperand(MI, 4, MVT::i32); break;
    case X86::SUB32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::SUB32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::SUB32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST8mi: printOperand(MI, 4, MVT::i8); break;
    case X86::XCHG32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::XOR32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::XOR32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::XOR32mr: printOperand(MI, 4, MVT::i32); break;
    }

into this:

    switch (MI->getOpcode()) {
    case X86::ADC32mi:
    case X86::ADC32mr:
    case X86::ADD32mi:
    case X86::ADD32mr:
    case X86::AND32mi:
    case X86::AND32mr:
    case X86::CMP32mi:
    case X86::CMP32mr:
    case X86::MOV32mi:
    case X86::MOV32mr:
    case X86::OR32mi:
    case X86::OR32mr:
    case X86::SBB32mi:
    case X86::SBB32mr:
    case X86::SHLD32mrCL:
    case X86::SHRD32mrCL:
    case X86::SUB32mi:
    case X86::SUB32mr:
    case X86::TEST32mi:
    case X86::TEST32mr:
    case X86::XCHG32mr:
    case X86::XOR32mi:
    case X86::XOR32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ADC32mi8:
    case X86::ADD32mi8:
    case X86::AND32mi8:
    case X86::OR32mi8:
    case X86::ROL32mi:
    case X86::ROR32mi:
    case X86::SAR32mi:
    case X86::SBB32mi8:
    case X86::SHL32mi:
    case X86::SHR32mi:
    case X86::SUB32mi8:
    case X86::TEST8mi:
    case X86::XOR32mi8: printOperand(MI, 4, MVT::i8); break;
    }

After this, the generated asmwriters look pretty much as though they were
generated by hand.  This shrinks the X86 asmwriter.inc files from 55101->39669
and 55429->39551 bytes each, and PPC from 16766->12859 bytes.

llvm-svn: 19760
2005-01-22 20:31:17 +00:00
Chris Lattner 92275bb6bb Implement *even more* factoring. In particular, if all of the instruction
strings starts out with a constant string, we emit the string first, using
a table lookup (instead of a switch statement).

Because this is usually the opcode portion of the asm string, the differences
between the instructions have now been greatly reduced.  This allows many
more case statements to be grouped together.

This patch also allows instruction cases to be grouped together when the
instruction patterns are exactly identical (common after the opcode string
has been ripped off), and when the differing operand is a MachineInstr
operand that needs to be formatted.

The end result of this is a mean and lean generated AsmPrinter!

llvm-svn: 19759
2005-01-22 19:22:23 +00:00
Chris Lattner 945e8655dd Refactor code for numbering instructions into CodeGenTarget.
llvm-svn: 19758
2005-01-22 18:58:51 +00:00
Jeff Cohen da636b3783 Fix VC++ compilation error
llvm-svn: 19757
2005-01-22 18:50:10 +00:00
Chris Lattner 64d9d2b819 QOI feature implemented.
llvm-svn: 19756
2005-01-22 18:45:35 +00:00
Chris Lattner 9ceb7c8f23 Implement factoring of instruction pattern strings. In particular, instead of
emitting code like this:

  case PPC::ADD: O  << "add ";  printOperand(MI, 0, MVT::i64); O  << ", ";  prin
tOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '\n
'; break;
  case PPC::ADDC: O  << "addc ";  printOperand(MI, 0, MVT::i64); O  << ", ";  pr
intOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '
\n'; break;
  case PPC::ADDE: O  << "adde ";  printOperand(MI, 0, MVT::i64); O  << ", ";  pr
intOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '
\n'; break;
...

Emit code like this:

  case PPC::ADD:
  case PPC::ADDC:
  case PPC::ADDE:
  ...
    switch (MI->getOpcode()) {
    case PPC::ADD: O << "add "; break;
    case PPC::ADDC: O << "addc "; break;
    case PPC::ADDE: O << "adde "; break;
    ...
    }
    printOperand(MI, 0, MVT::i64);
    O << ", ";
    printOperand(MI, 1, MVT::i64);
    O << ", ";
    printOperand(MI, 2, MVT::i64);
    O << "\n";
    break;

This shrinks the PPC asm writer from 24785->15205 bytes (even though the new
asmwriter has much more whitespace than the old one), and the X86 printers shrink
quite a bit too.  The important implication of this is that GCC no longer hits swap
when building the PPC backend in optimized mode.  Thus this fixes PR448.

-Chris

llvm-svn: 19755
2005-01-22 18:38:13 +00:00
Chris Lattner b6f5d9a82a Fix the ::: problem
llvm-svn: 19754
2005-01-22 18:18:59 +00:00
Chris Lattner 3baf682110 Minor refactoring, no functionality change.
llvm-svn: 19753
2005-01-22 17:40:38 +00:00
Jeff Cohen ff696def84 oops
llvm-svn: 19752
2005-01-22 17:37:13 +00:00
Jeff Cohen c8f1f4bc8e Use binary mode for reading/writing bytecode files
llvm-svn: 19751
2005-01-22 17:36:17 +00:00
Jeff Cohen e90b0c5469 Add (non-working) project bugpoint to Visual Studio
llvm-svn: 19750
2005-01-22 17:35:30 +00:00
Chris Lattner 0c23ba5c0f Seperate asmstring parsing from emission. This allows the code to be simpler
and more understandable.  It also allows us to do simple things like fold
consequtive literal strings together.  For example, instead of emitting this
for the X86 backend:

  O  << "adc" << "l" << " ";

we now generate this:

  O << "adcl ";

*whoa* :)

This shrinks the X86 asmwriters from 62729->58267 and 65176->58644 bytes
for the intel/att asm writers respectively.

llvm-svn: 19749
2005-01-22 17:32:42 +00:00
Jeff Cohen 0e64c73e67 Don't exclude FileUtilies and ToolRunner from VC++ build
llvm-svn: 19748
2005-01-22 16:32:47 +00:00
Jeff Cohen 142b4a721f Fix VC++ complaint
llvm-svn: 19747
2005-01-22 16:30:58 +00:00
Jeff Cohen ccbd3f0d57 Fix destroyDirectory bug
llvm-svn: 19746
2005-01-22 16:28:33 +00:00
Chris Lattner 52c97fbea9 Implicitly defined registers can clobber callee saved registers too!
This fixes the return-address-not-being-saved problem in the Alpha backend.

llvm-svn: 19741
2005-01-22 00:49:16 +00:00
Andrew Lenharth 67e2e21353 make double-dollar properly escape asmstrings
llvm-svn: 19740
2005-01-22 00:35:22 +00:00
Chris Lattner 3bc78b2e0b More bugfixes for IA64 shifts.
llvm-svn: 19739
2005-01-22 00:33:03 +00:00
Chris Lattner ec2183713c Fix problems with non-x86 targets.
llvm-svn: 19738
2005-01-22 00:31:52 +00:00
Chris Lattner d637c96fac Add a nasty hack to fix Alpha/IA64 multiplies by a power of two.
llvm-svn: 19737
2005-01-22 00:20:42 +00:00
Chris Lattner d53e763f18 Remove unneeded line.
llvm-svn: 19736
2005-01-21 23:43:12 +00:00
Chris Lattner 4f987bf16d test commit
llvm-svn: 19735
2005-01-21 23:38:56 +00:00
Chris Lattner fc4429e7c1 Handle comparisons of gep instructions that have different typed indices
as long as they are the same size.

llvm-svn: 19734
2005-01-21 23:06:49 +00:00
Chris Lattner e70eb9da7d Speed up folding operations into loads.
llvm-svn: 19733
2005-01-21 21:43:02 +00:00
Chris Lattner e85a8d8f92 Keep track of node depth for each node
llvm-svn: 19732
2005-01-21 21:39:38 +00:00
Chris Lattner e1e844c416 The ever-important vanity pass name :)
llvm-svn: 19731
2005-01-21 21:35:14 +00:00
Chris Lattner 28edd69eb4 If the interpreter tries to execute an external function, kill it. Of course
since we are dirty, special case __main.  This should fix the infinite loop
horrible stuff that happens on linux-alpha when configuring llvm-gcc.  It
might also help cygwin, who knows??

llvm-svn: 19729
2005-01-21 19:59:37 +00:00
Chris Lattner c78776d209 Fix a FIXME: realize that argument stores are all independent (don't alias)
llvm-svn: 19728
2005-01-21 19:46:38 +00:00
Chris Lattner 96e809c47d Unary token factor nodes are unneeded.
llvm-svn: 19727
2005-01-21 18:01:22 +00:00
Chris Lattner aac464e6c0 Refactor libcall code a bit. Initial implementation of expanding int -> FP
operations for 64-bit integers.

llvm-svn: 19724
2005-01-21 06:05:23 +00:00
Chris Lattner 4105d5f249 Apparently destroyFile() now throws an exception. Since this class is
designed to be put on the stack, that's not cool.  Catch and ignore the
exception.

llvm-svn: 19723
2005-01-20 23:31:35 +00:00
Chris Lattner ac4e5ef023 Remove this test. This test is already in PR269, so it should be
readded when the bug is fixed.

llvm-svn: 19722
2005-01-20 20:58:42 +00:00
Chris Lattner 4d25c04f94 Simplify the shift-expansion code.
llvm-svn: 19721
2005-01-20 20:29:23 +00:00
Chris Lattner 2a631fa406 Implement ADD_PARTS/SUB_PARTS so that 64-bit integer add/sub work. This
fixes most of the remaining llc-beta failures.

llvm-svn: 19716
2005-01-20 18:53:00 +00:00
Chris Lattner b3f83b28a5 Expand add/sub into ADD_PARTS/SUB_PARTS instead of a non-existant libcall.
llvm-svn: 19715
2005-01-20 18:52:28 +00:00
Chris Lattner 1fe9b40981 implement add_parts/sub_parts.
llvm-svn: 19714
2005-01-20 18:50:55 +00:00
Chris Lattner ad1ffcc358 Eliminate the unimplemented ADDC/SUBB operations, add ADD_PARTS/SUB_PARTS instead.
llvm-svn: 19713
2005-01-20 18:50:39 +00:00
Chris Lattner 28d15860bd Add missing entry.
llvm-svn: 19712
2005-01-20 17:32:28 +00:00
Chris Lattner 5b04f33405 Fix a crash compiling 134.perl.
llvm-svn: 19711
2005-01-20 16:50:16 +00:00
Jeff Cohen 90f0dc8fc6 Get analyze to show all analysis options when compiled with VC++
llvm-svn: 19710
2005-01-20 05:19:40 +00:00
Jeff Cohen e1fde90bac Add analyze project to Visual Studio
llvm-svn: 19709
2005-01-20 04:52:59 +00:00
Jeff Cohen 6eaf83e172 Add project llvm-proj to Visual Studio
llvm-svn: 19708
2005-01-20 04:41:49 +00:00
Chris Lattner 96c26751ec Support targets that do not use i8 shift amounts.
llvm-svn: 19707
2005-01-19 22:31:21 +00:00
Chris Lattner 411336fe04 Add two optimizations. The first folds (X+Y)-X -> Y
The second folds operations into selects, e.g. (select C, (X+Y), (Y+Z))
-> (Y+(select C, X, Z)

This occurs a few times across spec, e.g.

         select    add/sub
mesa:    83        0
povray:  5         2
gcc      4         2
parser   0         22
perlbmk  13        30
twolf    0         3

llvm-svn: 19706
2005-01-19 21:50:18 +00:00
Chris Lattner 2547f05be8 Add some new tests
llvm-svn: 19705
2005-01-19 21:48:31 +00:00
Chris Lattner f840289291 Add an assertion that would have made more sense to duraid
llvm-svn: 19704
2005-01-19 21:32:07 +00:00
Chris Lattner 3d95c14d94 Add support for targets that pass args in registers to calls.
llvm-svn: 19703
2005-01-19 20:24:35 +00:00
Chris Lattner 5695864a41 Add an accessor for targets that pass args in regs
llvm-svn: 19702
2005-01-19 20:19:58 +00:00
Chris Lattner 55562fa99a Fold single use token factor nodes into other token factor nodes.
llvm-svn: 19701
2005-01-19 19:10:54 +00:00
Chris Lattner 0d03eb45a8 Realize the individual pieces of an expanded copytoreg/store/load are
independent of each other.

llvm-svn: 19700
2005-01-19 18:02:17 +00:00
Chris Lattner 9b75e148fd Know some identities about tokenfactor nodes.
llvm-svn: 19699
2005-01-19 18:01:40 +00:00
Chris Lattner 32a5f02598 Know some simple identities. This improves codegen for (1LL << N).
llvm-svn: 19698
2005-01-19 17:29:49 +00:00
Chris Lattner 474aac4da9 Fix a problem where were were literally selecting for INCREASED register
pressure, not decreases register pressure.  Fix problem where we accidentally
swapped the operands of SHLD, which caused fourinarow to fail.  This fixes
fourinarow.

llvm-svn: 19697
2005-01-19 17:24:34 +00:00
Chris Lattner 1cffa73f2a Just in case, handle something that is both a use and a def.
llvm-svn: 19696
2005-01-19 17:11:51 +00:00
Chris Lattner 00c436824f When an instruction moves, make sure to update the VarInfo::Kills list as
well as all of teh other stuff in livevar. This fixes the compiler crash
on fourinarow last night.

llvm-svn: 19695
2005-01-19 17:09:15 +00:00
Chris Lattner 25be208e02 When commuting these instructions, make sure to actually swap the operands too.
llvm-svn: 19694
2005-01-19 16:55:52 +00:00
Chris Lattner a3cc1835ad Fix 'raise' to work with packed types. Patch by Morten Ofstad.
llvm-svn: 19693
2005-01-19 16:16:35 +00:00
Chris Lattner de87d146ab Implement Regression/CodeGen/X86/rotate.ll: emit rotate instructions (which
typically cost 1 cycle) instead of shld/shrd instruction (which are typically
6 or more cycles).  This also saves code space.

For example, instead of emitting:

rotr:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %CL, BYTE PTR [%ESP + 8]
        shrd %EAX, %EAX, %CL
        ret
rotli:
        mov %EAX, DWORD PTR [%ESP + 4]
        shrd %EAX, %EAX, 27
        ret

Emit:

rotr32:
        mov %CL, BYTE PTR [%ESP + 8]
        mov %EAX, DWORD PTR [%ESP + 4]
        ror %EAX, %CL
        ret
rotli32:
        mov %EAX, DWORD PTR [%ESP + 4]
        ror %EAX, 27
        ret

We also emit byte rotate instructions which do not have a sh[lr]d counterpart
at all.

llvm-svn: 19692
2005-01-19 08:07:05 +00:00
Chris Lattner c4adfbbd0b New testcase for rotate instructions. Each function should codegen to a
rotate.

llvm-svn: 19691
2005-01-19 08:04:08 +00:00
Chris Lattner 0edf9535b9 Add rotate instructions.
llvm-svn: 19690
2005-01-19 07:50:03 +00:00
Chris Lattner 29f5819158 Match 16-bit shld/shrd instructions as well, implementing shift-double.llx:test5
llvm-svn: 19689
2005-01-19 07:37:26 +00:00
Chris Lattner 603677549f Add a test for 16-bit sh*d.
llvm-svn: 19688
2005-01-19 07:37:01 +00:00
Chris Lattner d54845f530 Improve coverage of the X86 instruction set by adding 16-bit shift doubles.
llvm-svn: 19687
2005-01-19 07:31:24 +00:00
Chris Lattner 2947801735 Teach the code generator that shrd/shld is commutable if it has an immediate.
This allows us to generate this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        shld %EDX, %EDX, 2
        shl %EAX, 2
        ret

instead of this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        mov %EDX, %EAX
        shrd %EDX, %ECX, 30
        shl %EAX, 2
        ret

Note the magically transmogrifying immediate.

llvm-svn: 19686
2005-01-19 07:11:01 +00:00
Chris Lattner ea42c15da9 Use the TargetInstrInfo::commuteInstruction method to commute instructions
instead of doing it manually.

llvm-svn: 19685
2005-01-19 07:08:42 +00:00
Chris Lattner f6932b700b Finegrainify namespacification
Add default impl of commuteInstruction
Add notes about ugly V9 code.

llvm-svn: 19684
2005-01-19 06:53:34 +00:00
Chris Lattner eadd41207d Add a new method, described in the comment.
llvm-svn: 19683
2005-01-19 06:53:02 +00:00
Chris Lattner 892336a1b5 Ensure that each these functions generates a sh[rl]d instruction.
llvm-svn: 19682
2005-01-19 06:30:36 +00:00
Chris Lattner 41fe201b61 Codegen long >> 2 to this:
foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        shrd %EAX, %EDX, 2
        sar %EDX, 2
        ret

instead of this:

test1:
        mov %ECX, DWORD PTR [%ESP + 4]
        shr %ECX, 2
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %EAX, %EDX
        shl %EAX, 30
        or %EAX, %ECX
        sar %EDX, 2
        ret

and long << 2 to this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
***     mov %EDX, %EAX
        shrd %EDX, %ECX, 30
        shl %EAX, 2
        ret

instead of this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        shr %ECX, 30
        mov %EDX, DWORD PTR [%ESP + 8]
        shl %EDX, 2
        or %EDX, %ECX
        shl %EAX, 2
        ret

The extra copy (marked ***) can be eliminated when I teach the code generator
that shrd32rri8 is really commutative.

llvm-svn: 19681
2005-01-19 06:18:43 +00:00
Jeff Cohen 7230239553 Add missing data types for VC++
llvm-svn: 19680
2005-01-19 05:08:31 +00:00
Chris Lattner 2a7f8a94f4 Implement a way of expanding shifts. This applies to targets that offer
select operations or to shifts that are by a constant.  This automatically
implements (with no special code) all of the special cases for shift by 32,
shift by < 32 and shift by > 32.

llvm-svn: 19679
2005-01-19 04:19:40 +00:00
Chris Lattner d8d306601a X86 shifts mask the amount.
llvm-svn: 19678
2005-01-19 03:36:30 +00:00
Chris Lattner a05cd83d2f Add a hook to find out how the target handles shift amounts that are out of
range.  Either they are undefined (the default), they mask the shift amount
to the size of the register (X86, Alpha, etc), or they extend the shift (PPC).

This defaults to undefined, which is conservatively correct.

llvm-svn: 19677
2005-01-19 03:36:14 +00:00
Chris Lattner 9aa4886283 Move all data members to the end of the class.
Add a hook to find out how the target handles shift amounts that are out of
range.  Either they are undefined (the default), they mask the shift amount
to the size of the register (X86, Alpha, etc), or they extend the shift (PPC).

This defaults to undefined, which is conservatively correct.

llvm-svn: 19676
2005-01-19 03:36:03 +00:00
Chris Lattner 42993e45b6 Zero is cheaper than sign extend.
llvm-svn: 19675
2005-01-18 21:57:59 +00:00