Commit Graph

13487 Commits

Author SHA1 Message Date
Misha Brukman
ec6319a00c * Differentiate between global and weak symbol loads
* Fix functions that take more than 32 bytes of args
* Alignment of doubles in structs is 4 bytes, not 8
* Fix passing long args: rN = hi, rN+1 = lo
* Rewrite signed divide
* Rewrite Intrinsic::returnaddress

Patch courtesy of Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15036 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 15:51:37 +00:00
Misha Brukman
e48178e8a6 Differentiate between global and weak symbol loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15035 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 15:45:27 +00:00
Misha Brukman
5c4544160f Double alignment in structs is 4 bytes, not 8. Patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15034 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 15:43:25 +00:00
Alkis Evlogimenos
a39fc0efcf Add function to clear all virtual->physical mappings but not assigned
stack slots. This is in preparation for the iterative linear scan.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15032 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 13:28:17 +00:00
Alkis Evlogimenos
6bd23c0832 Remove unneeded functor. LiveInterval has a < operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15031 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 10:20:03 +00:00
Chris Lattner
adfd32f8ee Fix a serious code pessimization problem. If an inlined function has a single
return, clone the 'ret' BB code into the block AFTER the inlined call, not the
other way around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15030 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 05:45:24 +00:00
Chris Lattner
59a20773f8 Implement Transforms/InstCombine/IntPtrCast.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15029 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 05:21:00 +00:00
Chris Lattner
c0de837ad2 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15028 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 05:20:39 +00:00
Chris Lattner
9ce300013d Ignore instructions that are in trivially dead functions. This allows us
to constify 14 globals instead of 4 in a trivial C++ testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15027 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 03:58:07 +00:00
Misha Brukman
d43b9fd1ae Fix stack frame layout in prologue/epilogue. Patch courtesy of Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15026 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 02:23:09 +00:00
Misha Brukman
913e1b4bdd Dump the old-fashioned C-style <ctype.h> in favor of new `C++'-style <cctype>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15025 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 02:18:25 +00:00
Chris Lattner
67769e5efa Implement InstCombine/GEPIdxCanon.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15024 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 01:48:15 +00:00
Chris Lattner
247d62c77b New testcase that instcombine should help out with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15023 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 01:47:49 +00:00
Chris Lattner
af17b1df84 Implement SimplifyCFG/BrUnwind.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15022 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 01:17:38 +00:00
Chris Lattner
c6c9db2fd7 test that unconditional branches to unwinds are always eliminated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15021 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 01:17:19 +00:00
Misha Brukman
ba1c1da36a Move handing of GlobalValues from getReg() to copyConstantToRegister(), this
will avoid extra register-to-register copies.  Thanks to Chris for the idea.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15019 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:59:38 +00:00
Chris Lattner
bee7e7644b Rewrite cast->cast elimination code completely based on the information we
actually care about.  Someday when the cast instruction is gone, we can do
better here, but this will do for now.  This implements
instcombine/cast.ll:test17/18 as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15018 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:59:32 +00:00
Chris Lattner
6c08892814 Testcases missed by the instruction combiner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15017 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:57:21 +00:00
Misha Brukman
497b52f381 isupper() and tolower() are declared in <ctype.h>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15016 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:52:16 +00:00
Misha Brukman
61114619bc * Fn args passed in registers are now recorded as used by the call instruction
`-> asm printer updated to not print out those registers with the call instr

All of Shootout tests now work.  Great thanks to Nate Begeman for the patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15015 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:42:19 +00:00
Misha Brukman
7e898c3e04 * cFP class split into cFP32 and cFP64
* Fn args passed in registers are now recorded as used by the call instruction
`-> asm printer updated to not print out those registers with the call instr
* Stack frame layout in prolog/epilog fixed, spills and vararg fns now work
* float/double to signed int codegen now correct
* various single precision float codegen bugs fixed
* const integer multiply codegen fixed
* select and setcc blocks inserted into the correct place in machine CFG
* load of integer constant code optimized

All of Shootout tests now work.  Great thanks to Nate Begeman for the patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15014 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 00:41:46 +00:00
Chris Lattner
4771288fe3 While I'm at it, don't break codegen of mul by 3,5,9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15013 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 23:50:57 +00:00
Chris Lattner
596b97f1ab Generate better code for multiplies by negative constants like -4, -1, -9, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15012 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 23:47:21 +00:00
Alkis Evlogimenos
da77c44c2c Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15011 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 23:35:55 +00:00
Misha Brukman
a32355bb8e Tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15010 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 21:22:02 +00:00
Misha Brukman
049c48f1ad Convert tabs to spaces; fix name of function in assert() description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15009 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 21:11:45 +00:00
Chris Lattner
cbf1edb875 Fix broken link
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15008 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 19:30:40 +00:00
Chris Lattner
9f9398e519 Just run 'make', not all-gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15007 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 18:47:59 +00:00
John Criswell
7ed43ad3ab Added support for stdint.h. It is now automatically included by
DataTypes.h.  So far, it doesn't seem to break Linux, Solaris, or MacOS X.
This should automatically include it for those people who need it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15006 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 16:12:29 +00:00
Chris Lattner
8640f4e666 Fix a bug that occurs when the last instruction in a range is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15005 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 15:16:53 +00:00
Chris Lattner
cc0d156f7b When joining intervals, join intervals in deeply nested loops first. This
is a simple change, but seems to improve code a little.  For example, on
256.bzip2, we went from 75.0s -> 73.33s (2% speedup).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15004 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 14:40:29 +00:00
Chris Lattner
1c5c0444f1 Split joinIntervals into two methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15003 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 14:08:10 +00:00
Chris Lattner
c49c872a1a Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15002 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 13:28:39 +00:00
Reid Spencer
2a4cb68ea6 bug 122:
Simplify a conditional operator for a constant result from
GV->isNullValue()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15001 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 13:25:02 +00:00
Chris Lattner
f4fc36e738 Inline 4 methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15000 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 07:52:35 +00:00
Chris Lattner
81e26ce1da Delete 4 methods, make clients use hte mark* methods directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14999 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 07:52:25 +00:00
Chris Lattner
74de8b1b26 There is no need to store the MBB along with the MI any more, we can now
ask instructions for their parent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14998 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 07:04:55 +00:00
Chris Lattner
472405e0dc Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14997 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 06:55:21 +00:00
Chris Lattner
73d4adfb1e Remove the DefBlock element of VarInfo. DefBlock is always DefInst->getParent()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14996 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 06:26:50 +00:00
Chris Lattner
e312e156c3 Err, fix last checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14995 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 06:03:51 +00:00
Chris Lattner
5fbf29ce53 Fix bugpoint miscompilation support on OS/X
Patch contributed by the fabulous Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14994 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 06:00:17 +00:00
Chris Lattner
8ea13c6233 Two changes, both very significant:
* vreg <-> vreg joining now works, enable it unconditionally when joining
  is enabled (which is the default).
* Fix a serious pessimization of spill code where we were saying that a
  spilled DEF operand was live into the subsequent instruction.  This allows
  for substantially better code when spilling starts to happen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14993 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 05:55:50 +00:00
Chris Lattner
57eb15e316 See comments. The live intervals were not coming out of the spiller in sorted
order, causing the inactive list in the linearscan list to get unsorted, which
basically fuxored everything up severely.

These seems to fix the joiner, so with more testing I will enable it by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14992 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 05:15:10 +00:00
Chris Lattner
331cb7dde1 Fix assertion to not dereference end!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14991 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 05:02:09 +00:00
Chris Lattner
59073e02cc Add some asserts that the list of intervals returned by addIntervalsForSpills
is sorted.  This is not the case currently, which is causing no end of
problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14990 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 04:47:36 +00:00
Chris Lattner
6097d13b2a remove the mbbi2mbbMap_, which was just keeping track of mbb order anyway.
Heavily refactor handleVirtualRegisterDef, adding comments and making it more
efficient.  It is also much easier to follow and convince ones self that it is
correct :)

Add -debug output to the joine, showing the result of joining the intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14989 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 02:15:56 +00:00
Chris Lattner
6b92906010 fill comment to 80 cols
remove map that is not needed


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14988 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 02:13:59 +00:00
Chris Lattner
ab4c19ec3e classof implementations are now inlined
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14987 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 00:59:10 +00:00
Chris Lattner
52eb13c58e inline classof implementations, eliminate use of virtual methods.
classof<ConstantXXX> is now MUCH faster than it used to be.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14986 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 00:58:47 +00:00
Chris Lattner
9344063f5f eliminate isConstantExpr, changes to isa<Constant> implementation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14985 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 00:58:02 +00:00