Commit Graph

9503 Commits

Author SHA1 Message Date
Andrew Lenharth
445171aaf6 BranchCC, nifty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20067 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-08 00:40:03 +00:00
Andrew Lenharth
760270da51 fix store issue and an FP conversion (segfault) issue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20066 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 23:02:23 +00:00
Chris Lattner
bcc70bcb25 IndCallGraphMap is now a pointer to a new'd map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20065 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 16:09:15 +00:00
Andrew Lenharth
2921916ffc copytoreg fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20063 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 06:31:44 +00:00
Andrew Lenharth
06342c3484 copyfromreg fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20062 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 06:21:37 +00:00
Andrew Lenharth
0382401356 fix load bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20061 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 05:55:55 +00:00
Andrew Lenharth
a549deb025 more FP load store fixes and Load store simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20060 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 05:33:15 +00:00
Andrew Lenharth
f311e8b901 clean up load and stores alot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20059 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 05:18:02 +00:00
Andrew Lenharth
0538034a82 teach all loads and stores about the stack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20058 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 05:07:00 +00:00
Andrew Lenharth
2c9e38c285 prefer FP scratch registers and more check in LowerArguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20057 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-06 21:07:31 +00:00
Andrew Lenharth
6583890c2b fix oopso
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20056 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-06 16:22:15 +00:00
Andrew Lenharth
9e8d1094f2 smarter loads and stores. can now handle base+offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20055 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-06 15:40:40 +00:00
Andrew Lenharth
0bc68a87e7 fix build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20053 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 19:46:51 +00:00
Andrew Lenharth
97127a1391 clean up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20051 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 17:41:39 +00:00
Andrew Lenharth
d4bdd548fc fix f32 setcc, and fp select
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20050 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 16:41:03 +00:00
Andrew Lenharth
9818c05bb8 added ugly support for fp compares
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20049 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 13:19:12 +00:00
Misha Brukman
2a8350a25c Make the rest of file header comments consistent in format and style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20048 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 02:24:26 +00:00
Chris Lattner
286629736f Instead of initializing the volatile field, use accessors to set it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20045 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 01:38:38 +00:00
Chris Lattner
905547b02b Initialize new field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20044 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 01:37:58 +00:00
Misha Brukman
bc9ccf663c Make file header comment consistent: extend the whole 80 cols to fill the line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20039 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 20:25:52 +00:00
Chris Lattner
86db364f02 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 19:59:49 +00:00
Chris Lattner
e859444a91 Split mergeInGraph into two methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20035 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 19:58:28 +00:00
Chris Lattner
d7be188323 Fix the Regression/Transforms/DSAnalysis/recursion.ll regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20031 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 18:58:04 +00:00
Chris Lattner
595dc5408a Fix a case where were incorrectly compiled cast from short to int on 64-bit
targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20030 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 18:39:19 +00:00
Andrew Lenharth
440e688b8d alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20028 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 14:09:38 +00:00
Andrew Lenharth
968a30eb8f get alignment printing correctly and get rid of __main hack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20027 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 14:01:21 +00:00
Andrew Lenharth
571c9c314f fix constant pointer outputing on 64 bit machines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20026 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 13:47:16 +00:00
Andrew Lenharth
12dd2621bb FP fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20019 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-03 21:01:15 +00:00
Chris Lattner
bb753c4f80 Refactor getFunctionArgumentsForCall out of mergeInGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20018 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-03 18:40:25 +00:00
Chris Lattner
032ad0848a This is no longer needed. Global variables with undef initializers can be
initialized to anything, including garbage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20010 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 20:50:50 +00:00
Andrew Lenharth
b014d3e35b Store fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20004 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 17:32:39 +00:00
Andrew Lenharth
ddfacc35d9 oops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20003 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 17:01:31 +00:00
Andrew Lenharth
879ef22bdb prevent register allocator from using the stack pointer :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20002 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 17:00:21 +00:00
Andrew Lenharth
22088bb102 fix loading of floats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19997 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 15:05:33 +00:00
Andrew Lenharth
8d163d2222 marked mem* as not supported
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19992 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 05:49:42 +00:00
Alkis Evlogimenos
83874c9571 Fix crash on MallocInsts of unsized types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19988 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 04:43:37 +00:00
Andrew Lenharth
c23d696e71 fix Load bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19987 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 04:35:44 +00:00
Chris Lattner
272455b404 Fix yet another memset issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19986 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 03:44:41 +00:00
Andrew Lenharth
2afc821996 try to make a bug bugpointable, add yet more constant pool stuff, fixup constant loads for FP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19985 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 03:36:35 +00:00
Andrew Lenharth
22d5a41f9a better constant handling, should fix many remaining cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19984 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-02 00:51:15 +00:00
Chris Lattner
269dbf5f5e Eliminate some duplicated debug code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19980 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:55:40 +00:00
Chris Lattner
20cd136c5d Eliminate self-recursion as a special case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19979 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:49:43 +00:00
Chris Lattner
af8650e9c7 Eliminate use of DSCallSiteIterator in key loop. This is a half step to
a tasty speedup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19978 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 21:37:27 +00:00
Andrew Lenharth
e76797c223 fix FP arg passing bug, Add unsigned to/from int, fix SELECT, fix Constant pool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19976 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 20:40:27 +00:00
Andrew Lenharth
f61ed95a03 Print the Constant pool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19975 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 20:38:53 +00:00
Andrew Lenharth
ae088f4b1d Make cmov work right and loads for fp from constant pool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19974 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 20:36:44 +00:00
Andrew Lenharth
2a8fc23411 Correct stack stuff for FP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19973 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 20:35:57 +00:00
Andrew Lenharth
2f40163323 try to match alpha pattern
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19972 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 20:35:11 +00:00
Andrew Lenharth
daf4b0477f fix register names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19971 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 20:34:29 +00:00
Chris Lattner
1e759999ca 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19970 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 19:10:48 +00:00
Chris Lattner
deb692e756 Fix some bugs andrew noticed legalizing memset for alpha
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19969 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 18:38:28 +00:00
Chris Lattner
f189bcec00 Do not revisit nodes in the SCC traversal. This speeds up the BU pass a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19968 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 17:35:52 +00:00
Chris Lattner
595f06c6da Fix test/Regression/Assembler/2005-01-31-CallingAggregateFunction.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19966 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:47:42 +00:00
Chris Lattner
4047a49cdc Apparently := confuses makellvm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19965 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:47:12 +00:00
Andrew Lenharth
c1faced5ff pecimise loads, put indirect call addr in right register. still doesn't fix methcall
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19963 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:37:24 +00:00
Chris Lattner
29d1ca6c42 Updates for new use list changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19961 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:24:21 +00:00
Chris Lattner
5c461404fe Update for API change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19960 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:24:01 +00:00
Chris Lattner
ac930048d6 API change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19959 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:23:49 +00:00
Chris Lattner
d514d8294d Adjust to changes in APIs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19958 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:23:31 +00:00
Chris Lattner
5a87447286 Hacks to make this ugly ugly code work with the new use lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19957 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:22:56 +00:00
Chris Lattner
caa7c19fb4 Fix a problem where we could infinitely recurse on phi nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19955 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 00:18:30 +00:00
Misha Brukman
41ce39cbd7 Fix hyphenation in output comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19954 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 06:19:57 +00:00
Chris Lattner
fcfe33acda Implement InstCombine/cast.ll:test25, a case that occurs many times
in spec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19953 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 05:51:45 +00:00
Chris Lattner
2f503e6c27 Implement the trivial cases in InstCombine/store.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19950 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 05:36:43 +00:00
Chris Lattner
f9527850e6 Implement Transforms/InstCombine/cast-load-gep.ll, which allows us to devirtualize
11 indirect calls in perlbmk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19947 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 04:50:46 +00:00
Andrew Lenharth
b8b6e6a524 indirect call fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19945 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 03:19:31 +00:00
Andrew Lenharth
7efadce56e fp to int and back conversion sequences
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19944 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 01:44:26 +00:00
Chris Lattner
613233230b 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! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19943 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 01:11:13 +00:00
Chris Lattner
f9aace20fb Rename variables to work with VC++'s hokey scoping rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19942 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 00:10:58 +00:00
Chris Lattner
cff8ac20ca Fix some scary bugs that VC++ detected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19941 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 00:10:45 +00:00
Chris Lattner
6538f42208 Make things more const-correct, adjust to changes in DSA interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 23:51:25 +00:00
Chris Lattner
a9548d9fd9 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 23:51:02 +00:00
Andrew Lenharth
7b2a5270b7 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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19938 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 20:42:36 +00:00
Chris Lattner
e2752ddefc This code is really unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19934 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 16:33:46 +00:00
Chris Lattner
d7b59d0181 Fix warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19933 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 16:32:48 +00:00
Andrew Lenharth
684f229895 support for larger calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19932 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 00:35:27 +00:00
Chris Lattner
bca81448ac Improve conformance with the Misha spelling benchmark suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19930 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 00:09:23 +00:00
Tanya Lattner
5c3fa1ec79 Make this work on systems where size_t == unsigned and where they are not
the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19929 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 23:29:55 +00:00
Tanya Lattner
445cdd3aad Make this work on systems where size_t is not the same as unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19928 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 23:08:01 +00:00
Chris Lattner
ea622d53e2 Unbreak the build :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19926 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 19:27:28 +00:00
Chris Lattner
9d5d7598db adjust to ilist changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19924 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 18:41:25 +00:00
Chris Lattner
3cf8e6857e Adjust to ilist changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19923 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 18:41:12 +00:00
Chris Lattner
5ae3571f75 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19918 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 17:17:18 +00:00
Chris Lattner
8c2cb42f08 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19916 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 17:05:56 +00:00
Chris Lattner
52b8752780 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19915 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 16:53:02 +00:00
Andrew Lenharth
2c59435ca5 first step towards a correct and complete stack. also add some forms for things that were getting stuck in the nightly tester.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19914 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 15:42:07 +00:00
Chris Lattner
3725c12b26 Due to previous simplifications, we can simplify the data structures being
used here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19913 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 07:04:10 +00:00
Chris Lattner
ee379a16ee Properly handle volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19912 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:42:34 +00:00
Chris Lattner
4f16bd7a74 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19911 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:39:25 +00:00
Chris Lattner
15774df4d3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19910 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:31:53 +00:00
Chris Lattner
e212d62a34 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%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19907 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:20:55 +00:00
Chris Lattner
e233b8c64b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19906 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 06:11:16 +00:00
Chris Lattner
2652da6af9 If we see:
%A = alloca int
  %V = load int* %A

value number %V to undef, not 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19905 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 05:57:01 +00:00
Chris Lattner
6cfbd62680 Memory used is a delta between memuse at the start of the time and the
memuse at the end, thus it is signed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19904 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 05:21:16 +00:00
Chris Lattner
1f377fcaad Make sure that we always grow a multiple of 2 operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19902 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 01:05:12 +00:00
Chris Lattner
5551706b0f Adjust to changes in instruction interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19900 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:39:08 +00:00
Chris Lattner
667fdaef9f Switchinst takes a hint for the number of cases it will have.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19899 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:38:45 +00:00
Chris Lattner
378805969e switchinst ctor now takes a hint for the number of cases that it will have.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19898 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:38:26 +00:00
Chris Lattner
5598aa0328 Adjust Valuehandle to hold its operand directly in it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19897 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:37:36 +00:00
Chris Lattner
23ba420550 Finegrainify namespacification.
Adjust TmpInstruction to work with the new User model.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19896 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:36:59 +00:00
Chris Lattner
3d80f90394 add namespace qualifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19895 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:36:38 +00:00
Chris Lattner
cad28bd3a0 Adjust to changes in User class and minor changes in instruction ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19894 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:36:19 +00:00
Chris Lattner
ce1df9e9e8 Adjust to slight changes in instruction interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19893 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:35:55 +00:00
Chris Lattner
96d83f63cd Adjust to changes in User class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19892 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:35:33 +00:00
Chris Lattner
b12261ac69 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19891 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:35:16 +00:00
Chris Lattner
e467147b30 Adjust to changes in User class. Aggregate constants now must explicitly
manage their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19890 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:34:39 +00:00
Chris Lattner
265287f714 This file is now merged into Instructions.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19889 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:33:32 +00:00
Andrew Lenharth
cc1b16faed fix ExprMap, partially teach about add long
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19882 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 23:17:54 +00:00
Chris Lattner
f4aa3351de Fix a nasty thinko in my previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19881 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 23:17:27 +00:00
Chris Lattner
99939d39c9 Alpha doesn't have a native f32 extload instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19880 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 22:58:25 +00:00
Chris Lattner
e76ad6de40 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19879 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 22:52:50 +00:00
Chris Lattner
e560521f1a Get alpha working with memset/memcpy/memmove
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19878 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 22:29:18 +00:00
Chris Lattner
ad5fec12a0 * 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19875 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 19:32:01 +00:00
Chris Lattner
ce04a6d7f6 Fix ConstProp/2005-01-28-SetCCGEP.ll: indexing over zero sized elements does
not change the address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19874 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 19:09:51 +00:00
Andrew Lenharth
6b9870abce fix ExprMap and constant check in setcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19870 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 14:06:46 +00:00
Andrew Lenharth
40831c5e0e move FP into it's own select
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19867 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 06:57:18 +00:00
Chris Lattner
13c184de29 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19866 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 06:27:38 +00:00
Chris Lattner
9cb992ab72 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19864 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 06:12:46 +00:00
Jeff Cohen
d19d89a04c Properly close mapped files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19863 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-28 01:17:07 +00:00
Andrew Lenharth
04c868ef50 stack frame fix and zero FP reg fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19857 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 08:31:19 +00:00
Andrew Lenharth
10b400705d Floating point instructions like Floating point registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19856 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 07:58:15 +00:00
Andrew Lenharth
d2bb960d8c int to float conversion and another setcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19855 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 07:50:35 +00:00
Misha Brukman
1bae291cb9 Fix grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19854 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 06:46:38 +00:00
Andrew Lenharth
3d65d31e20 teach isel about comparison with constants and zero extending bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19853 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 03:49:45 +00:00
Jeff Cohen
9437bb6d27 Fix some Path bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19852 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 03:49:03 +00:00
Andrew Lenharth
7e57bd518e perhaps this will let me have calls again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19851 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 01:22:48 +00:00
Andrew Lenharth
c0d502e20f minor bug fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19850 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 00:52:26 +00:00
Andrew Lenharth
51d3ab4ad4 minor bug fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19849 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 00:51:05 +00:00
Andrew Lenharth
98a32d09f3 added instructions for fp to int to fp moves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19848 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-26 23:56:48 +00:00
Andrew Lenharth
3e98fde96b initial fp support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19847 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-26 21:54:09 +00:00
Andrew Lenharth
fc16691925 hum, writing on one machine, testing on another...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19844 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-26 02:53:56 +00:00
Andrew Lenharth
0298118cbb add some operations, fix others. should compile several more tests now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19843 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-26 01:24:38 +00:00
Chris Lattner
3576c84baf We can fold promoted and non-promoted loads into divs also!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19835 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 20:35:10 +00:00
Chris Lattner
44129b5b68 Fold promoted loads into binary ops for FP, allowing us to generate m32 forms
of FP ops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19834 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 20:03:11 +00:00
Andrew Lenharth
d279b4157a problems with bools, and their work arounds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19833 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 19:58:40 +00:00
Alkis Evlogimenos
193904a663 Add a dependency to the trace library so that it gets pulled in
automatically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19828 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 16:23:57 +00:00
Andrew Lenharth
2f8fb77297 more load choices, better add with imm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19821 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 00:35:34 +00:00
Chris Lattner
851b534b89 Make -ds-aa more useful, allowing it to be updated as xforms hack on the program.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19818 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 20:00:14 +00:00
Andrew Lenharth
2d6f022a98 Clean ups, and taught the instruction selector about immediate forms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19816 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 19:44:07 +00:00
Andrew Lenharth
a7246caf8f Alpha JIT prune
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19815 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 18:48:22 +00:00
Andrew Lenharth
886470efec include prune and JIT prune
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19814 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 18:45:41 +00:00
Andrew Lenharth
01269524ce Pruned includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19813 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 18:37:48 +00:00
Chris Lattner
bb4dca3286 Fix a spurious warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19799 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 01:40:18 +00:00
Chris Lattner
0a07883694 Silence a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19798 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 23:20:06 +00:00
Chris Lattner
fed5577066 Silence optimized warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19797 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 23:19:44 +00:00
Chris Lattner
42e25b387f 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... ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19796 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 23:13:59 +00:00
Chris Lattner
3563015b0d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19795 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 23:13:12 +00:00
Chris Lattner
786116337e Update physregsused info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19793 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 22:55:45 +00:00
Chris Lattner
0648b16c48 Update this pass to set PhysRegsUsed info in MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19792 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 22:51:56 +00:00
Chris Lattner
b0f31bf19b Update these register allocators to set the PhysRegUsed info in MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19791 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 22:45:13 +00:00
Chris Lattner
ce9c41e77a Add support for the PhysRegsUsed array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19789 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 22:13:58 +00:00
Chris Lattner
92b9fcea7b Speed this up a bit by making ModifiedRegs a vector<char> not vector<bool>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19787 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 21:45:01 +00:00
Chris Lattner
ad1e302723 Get rid of a several dozen more and instructions in specint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19786 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 20:26:55 +00:00
Chris Lattner
da7e70e058 Fix crash comparing empty file against nonempty file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19782 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 06:02:40 +00:00
Chris Lattner
9c32d3b798 Adjust to changes in SelectionDAG interfaces
The first half of correct chain insertion for libcalls. This is not enough
to fix Fhourstones yet though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19781 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 04:42:50 +00:00
Chris Lattner
b48da39536 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19780 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 04:39:44 +00:00
Chris Lattner
ac9dc08c7f Adjust to changes in SelectionDAG interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19779 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 04:36:26 +00:00
Chris Lattner
1fefef1b27 Build Alpha by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19777 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 04:34:46 +00:00
Reid Spencer
a8411a698e Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19776 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 04:32:47 +00:00
Reid Spencer
5dc81f63d1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19775 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 03:52:14 +00:00
Chris Lattner
cc1b90b0e7 Make DiffFilesWithTolerance take sys::Path's instead of std::strings
Delete dead functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19771 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 03:31:02 +00:00
Chris Lattner
c95b5604e0 Fix a bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19769 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 03:19:13 +00:00
Chris Lattner
4454253923 Add a new method, refactored out of fpcmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19766 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 03:13:43 +00:00
Andrew Lenharth
304d0f3076 Let me introduce you to the early stages of the llvm backend for the alpha processor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19764 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 23:41:55 +00:00
Chris Lattner
68cd65ea68 Get this to work for 64-bit systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19763 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 23:04:37 +00:00
Jeff Cohen
5fb6ed4ae6 Use binary mode for reading/writing bytecode files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19751 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 17:36:17 +00:00
Jeff Cohen
c690cc0465 Fix destroyDirectory bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19746 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 16:28:33 +00:00
Chris Lattner
5037a15910 Implicitly defined registers can clobber callee saved registers too!
This fixes the return-address-not-being-saved problem in the Alpha backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19741 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 00:49:16 +00:00
Chris Lattner
7cd50cf286 More bugfixes for IA64 shifts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19739 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 00:33:03 +00:00
Chris Lattner
27ff112948 Fix problems with non-x86 targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19738 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 00:31:52 +00:00
Chris Lattner
a7306db5f7 Add a nasty hack to fix Alpha/IA64 multiplies by a power of two.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19737 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 00:20:42 +00:00
Chris Lattner
9bb86f46e1 Remove unneeded line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19736 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 23:43:12 +00:00
Chris Lattner
1e7ceaf0a0 test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19735 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 23:38:56 +00:00
Chris Lattner
45f57b8ee3 Handle comparisons of gep instructions that have different typed indices
as long as they are the same size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19734 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 23:06:49 +00:00
Chris Lattner
fb0f53f9c1 Speed up folding operations into loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19733 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 21:43:02 +00:00
Chris Lattner
67b1c3c404 The ever-important vanity pass name :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19731 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 21:35:14 +00:00
Chris Lattner
4e7dd8f7c4 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??


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19729 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 19:59:37 +00:00
Chris Lattner
b62e1e296e Fix a FIXME: realize that argument stores are all independent (don't alias)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19728 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 19:46:38 +00:00
Chris Lattner
a93ec3ebfb Unary token factor nodes are unneeded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19727 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 18:01:22 +00:00
Chris Lattner
77e77a6aa0 Refactor libcall code a bit. Initial implementation of expanding int -> FP
operations for 64-bit integers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19724 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 06:05:23 +00:00
Chris Lattner
e5544f851a Simplify the shift-expansion code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19721 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 20:29:23 +00:00
Chris Lattner
19ad0620bc Implement ADD_PARTS/SUB_PARTS so that 64-bit integer add/sub work. This
fixes most of the remaining llc-beta failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19716 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 18:53:00 +00:00
Chris Lattner
84f6788044 Expand add/sub into ADD_PARTS/SUB_PARTS instead of a non-existant libcall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19715 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 18:52:28 +00:00
Chris Lattner
17eee18f40 implement add_parts/sub_parts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19714 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 18:50:55 +00:00
Chris Lattner
353c3e4981 Add missing entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19712 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 17:32:28 +00:00
Chris Lattner
bf52d49f36 Fix a crash compiling 134.perl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19711 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 16:50:16 +00:00
Chris Lattner
2c49f27955 Support targets that do not use i8 shift amounts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19707 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 22:31:21 +00:00
Chris Lattner
6fb5a4a5f8 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19706 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 21:50:18 +00:00
Chris Lattner
3ca6a2c72c Add an assertion that would have made more sense to duraid
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19704 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 21:32:07 +00:00
Chris Lattner
3d9dffc586 Add support for targets that pass args in registers to calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19703 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 20:24:35 +00:00
Chris Lattner
1e81b9e511 Fold single use token factor nodes into other token factor nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19701 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 19:10:54 +00:00
Chris Lattner
ec39a45bdb Realize the individual pieces of an expanded copytoreg/store/load are
independent of each other.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19700 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 18:02:17 +00:00
Chris Lattner
39908e0ce0 Know some identities about tokenfactor nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19699 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 18:01:40 +00:00
Chris Lattner
88218ef706 Know some simple identities. This improves codegen for (1LL << N).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19698 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 17:29:49 +00:00
Chris Lattner
c3c021bcad 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19697 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 17:24:34 +00:00
Chris Lattner
2a6e163edc Just in case, handle something that is both a use and a def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19696 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 17:11:51 +00:00
Chris Lattner
d45be36965 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19695 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 17:09:15 +00:00
Chris Lattner
a76f04828a When commuting these instructions, make sure to actually swap the operands too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19694 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 16:55:52 +00:00
Chris Lattner
7d719c3cd8 Fix 'raise' to work with packed types. Patch by Morten Ofstad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19693 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 16:16:35 +00:00
Chris Lattner
4053b1e30b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19692 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 08:07:05 +00:00
Chris Lattner
40ff633b05 Add rotate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19690 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:50:03 +00:00
Chris Lattner
30ea1e9411 Match 16-bit shld/shrd instructions as well, implementing shift-double.llx:test5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19689 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:37:26 +00:00
Chris Lattner
0df53d22c3 Improve coverage of the X86 instruction set by adding 16-bit shift doubles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19687 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:31:24 +00:00
Chris Lattner
41e431ba04 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19686 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:11:01 +00:00
Chris Lattner
c71d6949b9 Use the TargetInstrInfo::commuteInstruction method to commute instructions
instead of doing it manually.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19685 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:08:42 +00:00
Chris Lattner
167b10cba4 Finegrainify namespacification
Add default impl of commuteInstruction
Add notes about ugly V9 code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19684 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 06:53:34 +00:00
Chris Lattner
8571637ee9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19681 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 06:18:43 +00:00
Chris Lattner
e34b396ab7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19679 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 04:19:40 +00:00
Chris Lattner
009b55b6f6 X86 shifts mask the amount.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19678 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 03:36:30 +00:00
Chris Lattner
d6e496732b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19677 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 03:36:14 +00:00
Chris Lattner
d5d5682512 Zero is cheaper than sign extend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19675 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 21:57:59 +00:00
Chris Lattner
477c931852 Code to handle FP_EXTEND is dead now. X86 doesn't support any data types to
FP_EXTEND from!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19674 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 20:05:56 +00:00
Chris Lattner
3dd68151dc Remove more dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19673 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 19:50:08 +00:00
Chris Lattner
a7a4c0f7c4 The selection dag code handles the promotions from F32 to F64 for us, so we
don't need to even think about F32 in the X86 code anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19672 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 19:46:54 +00:00
Chris Lattner
47e9223e06 Fix some fixmes (promoting bools for select and brcond), fix promotion
of zero and sign extends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19671 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 19:27:06 +00:00
Chris Lattner
4a9b4f1943 Keep track of the retval type as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19670 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 19:26:36 +00:00
Chris Lattner
ef5cd1d3cf Teach legalize to promote copy(from|to)reg, instead of making the isel pass
do it.  This results in better code on X86 for floats (because if strict
precision is not required, we can elide some more expensive double -> float
conversions like the old isel did), and allows other targets to emit
CopyFromRegs that are not legal for arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19668 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 17:54:55 +00:00
Chris Lattner
b422aeac9e Fix 124.m88ksim.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19667 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 17:35:28 +00:00
Chris Lattner
811482a82b Do not emit loads multiple times, potentially in the wrong places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19661 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 04:18:32 +00:00
Tanya Lattner
0111474bde Minor changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19660 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 04:15:41 +00:00
Chris Lattner
b71f8fc99d Eliminate bad assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19659 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 04:00:54 +00:00
Chris Lattner
4a108668df * Eliminate the TokenSet and just use the ExprMap for both tokens and values.
* Insert some really pedantic assertions that will notice when we emit the
  same loads more than one time, exposing bugs.  This turns a miscompilation in
  bzip2 into a compile-fail.  yaay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19658 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 03:51:59 +00:00
Chris Lattner
82fbfb6984 Teach legalize to promote SetCC results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19657 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 02:59:52 +00:00
Chris Lattner
f30b73b1c6 Allow setcc operations to have nonbool types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19656 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 02:52:03 +00:00
Chris Lattner
883c86f510 Rely on the code in MatchAddress to do this work. Otherwise we fail to
match (X+Y)+(Z << 1), because we match the X+Y first, consuming the index
register, then there is no place to put the Z.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19652 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 02:25:52 +00:00
Chris Lattner
6e4e7652d8 Fix the completely broken FP constant folds for setcc's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19651 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 02:11:55 +00:00
Chris Lattner
98a8ba0393 Fix a problem where probing for addressing modes caused expressions to be
emitted too early.  In particular, this fixes
Regression/CodeGen/X86/regpressure.ll:regpressure3.

This also improves the 2nd basic block in 164.gzip:flush_block, which went from

.LBBflush_block_1:      # loopentry.1.i
        movzx %EAX, WORD PTR [dyn_ltree + 20]
        movzx %ECX, WORD PTR [dyn_ltree + 16]
        mov DWORD PTR [%ESP + 32], %ECX
        movzx %ECX, WORD PTR [dyn_ltree + 12]
        movzx %EDX, WORD PTR [dyn_ltree + 8]
        movzx %EBX, WORD PTR [dyn_ltree + 4]
        mov DWORD PTR [%ESP + 36], %EBX
        movzx %EBX, WORD PTR [dyn_ltree]
        add DWORD PTR [%ESP + 36], %EBX
        add %EDX, DWORD PTR [%ESP + 36]
        add %ECX, %EDX
        add DWORD PTR [%ESP + 32], %ECX
        add %EAX, DWORD PTR [%ESP + 32]
        movzx %ECX, WORD PTR [dyn_ltree + 24]
        add %EAX, %ECX
        mov %ECX, 0
        mov %EDX, %ECX

to

.LBBflush_block_1:      # loopentry.1.i
        movzx %EAX, WORD PTR [dyn_ltree]
        movzx %ECX, WORD PTR [dyn_ltree + 4]
        add %ECX, %EAX
        movzx %EAX, WORD PTR [dyn_ltree + 8]
        add %EAX, %ECX
        movzx %ECX, WORD PTR [dyn_ltree + 12]
        add %ECX, %EAX
        movzx %EAX, WORD PTR [dyn_ltree + 16]
        add %EAX, %ECX
        movzx %ECX, WORD PTR [dyn_ltree + 20]
        add %ECX, %EAX
        movzx %EAX, WORD PTR [dyn_ltree + 24]
        add %ECX, %EAX
        mov %EAX, 0
        mov %EDX, %EAX

... which results in less spilling in the function.

This change alone speeds up 164.gzip from 37.23s to 36.24s on apoc.  The
default isel takes 37.31s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19650 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 01:06:26 +00:00
Chris Lattner
e9fe2bcac2 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19649 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 23:25:45 +00:00
Chris Lattner
869e0434ae Don't bother using max here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19647 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 23:02:13 +00:00
Chris Lattner
90d1be7eef Do not give token factor nodes outrageous weights
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19645 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 22:56:09 +00:00
Chris Lattner
d3948116b8 Non-volatile loads can be freely reordered against each other. This fixes
X86/reg-pressure.ll again, and allows us to do nice things in other cases.
For example, we now codegen this sort of thing:

int %loadload(int *%X, int* %Y) {
  %Z = load int* %Y
  %Y = load int* %X      ;; load between %Z and store
  %Q = add int %Z, 1
  store int %Q, int* %Y
  ret int %Y
}

Into this:

loadload:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%EAX]
        mov %ECX, DWORD PTR [%ESP + 8]
        inc DWORD PTR [%ECX]
        ret

where we weren't able to form the 'inc [mem]' before.  This also lets the
instruction selector emit loads in any order it wants to, which can be good
for register pressure as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19644 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 22:19:26 +00:00
Chris Lattner
5c65981a57 Two changes:
1. Fold  [mem] += (1|-1) into inc [mem]/dec [mem] to save some icache space.
 2. Do not let token factor nodes prevent forming '[mem] op= val' folds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19643 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 22:10:42 +00:00
Chris Lattner
a651cf67b7 Don't call SelectionDAG.getRoot() directly, go through a forwarding method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19642 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 19:43:36 +00:00
Chris Lattner
e10269ba30 Refactor load/op/store folding into it's own method, no functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19641 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 19:25:26 +00:00
Chris Lattner
0afa8e348e Implement a target independent optimization to codegen arguments only into
the basic block that uses them if possible.  This is a big win on X86, as it
lets us fold the argument loads into instructions and reduce register pressure
(by not loading all of the arguments in the entry block).

For this (contrived to show the optimization) testcase:

int %argtest(int %A, int %B) {
        %X = sub int 12345, %A
        br label %L
L:
        %Y = add int %X, %B
        ret int %Y
}

we used to produce:

argtest:
        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EAX, 12345
        sub %EAX, %ECX
        mov %EDX, DWORD PTR [%ESP + 8]
.LBBargtest_1:  # L
        add %EAX, %EDX
        ret


now we produce:

argtest:
        mov %EAX, 12345
        sub %EAX, DWORD PTR [%ESP + 4]
.LBBargtest_1:  # L
        add %EAX, DWORD PTR [%ESP + 8]
        ret

This also fixes the FIXME in the code.

BTW, this occurs in real code.  164.gzip shrinks from 8623 to 8608 lines of
.s file.  The stack frame in huft_build shrinks from 1644->1628 bytes,
inflate_codes shrinks from 116->108 bytes, and inflate_block from 2620->2612,
due to fewer spills.

Take that alkis. :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19639 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 17:55:19 +00:00
Chris Lattner
ae3ffba466 Fix a major regression last night that prevented us from producing [mem] op= reg
operations.

The body of the if is less indented but unmodified in this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19638 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 17:49:14 +00:00
Chris Lattner
068a81e9fc Refactor code into a new method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19635 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 17:15:02 +00:00
Chris Lattner
2a4e508281 Codegen this:
int %foo(int %X) {
        %T = add int %X, 13
        %S = mul int %T, 3
        ret int %S
}

as this:

        mov %ECX, DWORD PTR [%ESP + 4]
        lea %EAX, DWORD PTR [%ECX + 2*%ECX + 39]
        ret

instead of this:

        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EAX, %ECX
        add %EAX, 13
        imul %EAX, %EAX, 3
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19633 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 06:48:02 +00:00
Tanya Lattner
7a866d9a43 Added tmp instructions to preserve ssa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19632 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 06:47:26 +00:00
Chris Lattner
4ff348befa Fix test/Regression/CodeGen/X86/2005-01-17-CycleInDAG.ll and 132.ijpeg.
Do not fold a load into an operation if it will induce a cycle in the DAG.

Repeat after me: dAg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19631 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 06:26:58 +00:00
Chris Lattner
a3fd1c569c Delete PHI nodes that are not dead but are locked in a cycle of single
useness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19629 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 05:10:15 +00:00
Chris Lattner
b352fa5853 Move code out of indentation one level to make it easier to read.
Disable the xform for < > cases.  It turns out that the following is being
miscompiled:

bool %test(sbyte %S) {
        %T = cast sbyte %S to uint
        %V = setgt uint %T, 255
        ret bool %V
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19628 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 03:20:02 +00:00
Chris Lattner
cb1aa8d772 Do not fold a load into a comparison that is used by more than one place.
The comparison will probably be folded, so this is not ok to do.
This fixed 197.parser.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19624 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 01:34:14 +00:00
Chris Lattner
c98279d371 Do not codegen 'xor bool, true' as 'not reg'. not reg inverts the upper bits
of the bytereg.  This fixes yacr2, 300.twolf and probably others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19622 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 00:23:16 +00:00
Chris Lattner
4df0de975a Set up the shift and setcc types.
If we emit a load because we followed a token chain to get to it, try to
fold it into its single user if possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19620 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-17 00:00:33 +00:00
Chris Lattner
714b69d047 Shift and setcc types default to the pointer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19619 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 23:59:48 +00:00
Chris Lattner
8ac532c55e Implement legalize of call nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19617 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 19:46:48 +00:00
Tanya Lattner
7600587e66 Added paramters to a few functions in order to allow me to change the functions to preserve SSA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19615 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 08:51:10 +00:00
Chris Lattner
da2ce11407 * Adjust to changes in TargetLowering interfaces.
* Remove custom promotion for bool and byte select ops.  Legalize now
  promotes them for us.
* Allow folding ConstantPoolIndexes into EXTLOAD's, useful for float immediates.
* Declare which operations are not supported better.
* Add some hacky code for TRUNCSTORE to pretend that we have truncstore
  for i16 types.  This is useful for testing promotion code because I can
  just remove 16-bit registers all together and verify that programs work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19614 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 07:34:08 +00:00
Chris Lattner
55ba8fba75 Revamp supported ops. Instead of just being supported or not, we now keep
track of how to deal with it, and provide the target with a hook that they
can use to legalize arbitrary operations in arbitrary ways.

Implement custom lowering for a couple of ops, implement promotion for select
operations (which x86 needs).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19613 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-16 07:29:19 +00:00