Commit Graph

10235 Commits

Author SHA1 Message Date
Reid Spencer
c29b13d648 Changes for ffs lib call simplification:
* Check for availability of ffsll call in configure script
* Support ffs, ffsl, and ffsll conversion to constant value if the argument
  is constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22027 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 16:42:52 +00:00
Chris Lattner
1ca85d567c Fix construction of ioport intrinsics, fixing X86/io.llx and io-port.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22026 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 13:56:55 +00:00
Chris Lattner
65af1abd1e Preserve calling conv when hacking on calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22025 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:28:32 +00:00
Chris Lattner
e43702695d preserve calling conventions when hacking on code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22024 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:25:32 +00:00
Chris Lattner
16d0db2da8 Make sure to preserve the calling convention when changing an invoke into
a call.  This fixes Prolangs-C++/deriv2, kimwitu++, and Misc-C++/bigfib
on X86 with -enable-x86-fastcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22023 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:21:56 +00:00
Chris Lattner
920c0aa9c2 Pass i64 values correctly split in reg/mem to fastcc calls.
This fixes fourinarow with -enable-x86-fastcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22022 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:03:10 +00:00
Chris Lattner
239738a162 Use target-specific nodes for calls. This allows the fastcc code to not have
to do ugly hackery to avoid emitting code like this:

   call foo
   mov vreg, EAX
   adjcallstackup ...

If foo is a fastcc call and if vreg gets spilled, we might end up with this:

   call foo
   mov [ESP+offset], EAX     ;; Offset doesn't consider the 12!
   sub ESP, 12

Which is bad.  The previous hacky code to deal with this was A) gross B) not
good enough.  In particular, it could miss cases and emit the bad code above.
Now we always emit this:

   call foo
   adjcallstackup ...
   mov vreg, EAX

directly.

This makes fastcc with callees poping the stack work much better.  Next
stop (finally!) really is tail calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22021 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 08:48:15 +00:00
Chris Lattner
2789bde57f allow token chain at start or end of node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22020 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 08:34:53 +00:00
Chris Lattner
3e01136f9f remove special case hacks for readport/readio from the binary operator
codepath


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22019 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:45:46 +00:00
Chris Lattner
385328ce41 Implement fixme's by memoizing nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22018 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:42:29 +00:00
Chris Lattner
b7f7d51422 Turn this into a wrapper for a simpler version of getNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22016 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:32:14 +00:00
Chris Lattner
adf6c2a0cb Eliminate special purpose hacks for dynamic_stack_alloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22015 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:29:57 +00:00
Chris Lattner
e89083a930 Use the general mechanism for creating multi-value nodes instead of using
special case hacks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22014 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 07:25:05 +00:00
Chris Lattner
67649dfc32 use a target-specific node and custom expander to lower long->FP to FILD64m.
This should fix some missing symbols problems on BSD and improve performance
of programs that use that operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22012 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:52:07 +00:00
Chris Lattner
5fa4fa4e0f Wrap long line, actually add node to the graph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22011 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:42:57 +00:00
Chris Lattner
d73cc5d058 legalize target-specific operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22010 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:34:48 +00:00
Chris Lattner
89c34637cb add a getNode() version that allows construction of any node type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22009 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:20:26 +00:00
Chris Lattner
50381b6c41 LowerOperation takes a dag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22004 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 05:50:48 +00:00
Chris Lattner
38135af219 Print the symbolic register name in a register allocator debug dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22002 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 05:34:15 +00:00
Chris Lattner
a88a260dbd Allow targets to have a custom int64->fp expander if desired
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22001 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 05:33:54 +00:00
Chris Lattner
10d2645710 Make sure the start of the arg area and the end (after the RA is pushed)
is always 8-byte aligned for fastcc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21995 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 23:49:10 +00:00
Chris Lattner
bfed9247f1 fix the assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21994 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 23:35:47 +00:00
Chris Lattner
a8217e3000 Align doubles on 8-byte boundaries if possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21993 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 23:14:17 +00:00
Chris Lattner
0db07092a7 print stack object alignment in -print-machineinstr dumps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21992 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 22:54:44 +00:00
Chris Lattner
653f7230ad fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21991 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 22:46:57 +00:00
Chris Lattner
06cebb456a Fix the problems with callee popped argument lists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21988 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 22:13:49 +00:00
Chris Lattner
ca96c8217d Don't emit SAR X, 0 in the case of sdiv Y, 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21986 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:50:27 +00:00
Chris Lattner
a96e577f53 Fix UnitTests/2005-05-13-SDivTwo.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21985 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:48:20 +00:00
Chris Lattner
3648c67eb2 switch to having the callee pop stack operands for fastcc. This is currently buggy
do not use


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21984 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:44:04 +00:00
Chris Lattner
2a82ef317c Tolerate instrs with extra args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21982 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:07:15 +00:00
Chris Lattner
24ddc6d067 allow RETI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21980 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 20:46:35 +00:00
Chris Lattner
b5d8e6ece6 treat TAILCALL nodes identically to CALL nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21977 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 20:29:26 +00:00
Chris Lattner
2e7714ad2b Build TAILCALL nodes in LowerCallTo, treat them like normal calls everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21976 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 20:29:13 +00:00
Chris Lattner
4bf7afcc27 Capitalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21964 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 19:49:09 +00:00
Chris Lattner
7d93727bb2 capitalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21962 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 19:48:34 +00:00
Chris Lattner
f8492193b9 clarify that these are v9 options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21960 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 19:45:45 +00:00
Chris Lattner
6bc2dc7b2c hide this option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21959 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 19:44:21 +00:00
Chris Lattner
adf6a965a3 Add an isTailCall flag to LowerCallTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21958 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 18:50:42 +00:00
Chris Lattner
d71c04199c Handle TAILCALL node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21957 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 18:43:43 +00:00
Chris Lattner
1be4811d34 add 'ret imm' instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21945 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 17:56:48 +00:00
Chris Lattner
32f3cf612e Realize that we don't support fmod directly, fixing CodeGen/Generic/print-arith-fp.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 16:20:22 +00:00
Chris Lattner
63602fb868 Do not CopyFromReg physregs for live-in values. Instead, create a vreg for
each live in, and copy the regs from the vregs.  As the very first thing we
do in the function, insert copies from the pregs to the vregs.  This fixes
problems where the token chain of CopyFromReg was not enough to allow reordering
of the copyfromreg nodes and other unchained nodes (e.g. div, which clobbers
eax on intel).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21932 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:38:09 +00:00
Chris Lattner
405ef9e28d Emit function entry code after lowering hte arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21931 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:33:32 +00:00
Chris Lattner
3aa7832c82 Allow targets to emit code into the entry block of each function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21930 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:23:21 +00:00
Chris Lattner
08b22ecc88 calling a function with the wrong CC is undefined, turn it into an unreachable
instruction.  This is useful for catching optimizers that don't preserve
calling conventions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21928 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:09:09 +00:00
Chris Lattner
712ad0c36d allow a virtual register to be associated with live-in values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21927 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:08:07 +00:00
Reid Spencer
fe07581d78 Make sure that decompression checks for the case that bzip2 returns
BZ_OK (meaning more data is expected) but there is no more input data. In
this case, the input file is probably truncated. Generate an exception that
indicates this case when its detected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21926 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:05:37 +00:00
Chris Lattner
efd9168eae When lowering invokes to calls, amke sure to preserve the calling conv. This
fixes Ptrdist/anagram with x86 llcbeta


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21925 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 06:27:02 +00:00
Chris Lattner
1381dd8a6e Prefer int 0 instead of long 0 for GEP arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21924 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 06:10:12 +00:00
Chris Lattner
eb516e7f0a Fix a problem that nate reduced for me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21923 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 05:17:00 +00:00