Commit Graph

7366 Commits

Author SHA1 Message Date
Misha Brukman
1013ef5228 * Fix printing of signed immediate values
* Generation of opcodes that take 16 bit immediates
* Rewrote multiply to be correct for 64 bit values
* Rewrote all the long handling to be correct for PowerPC
* Fix visitSelectInst() to define the upper register of the pair of regs
  representing a long value

Patch contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15083 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 20:09:08 +00:00
Chris Lattner
5eb919405c Make cast-cast code a bit more defensive
"simplify" a bit of code for comparison/and folding


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15082 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 19:50:44 +00:00
Misha Brukman
e0380e0c42 Use addSImm() instead of addImm() for stack offsets, which may be negative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15081 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 19:36:57 +00:00
Alkis Evlogimenos
d03451ef47 Fix analysis name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15078 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 17:23:44 +00:00
Misha Brukman
53d9a48855 Add SUBI instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15077 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 15:53:04 +00:00
Alkis Evlogimenos
fc29e63afe Clear spilled list at once. Remove unused vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15073 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 12:00:10 +00:00
Alkis Evlogimenos
2d54705c4b Change std::list into a std::vector for IntervalSets. This reduces
compile time for 176.gcc from 5.6 secs to 4.7 secs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15072 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 09:46:55 +00:00
Alkis Evlogimenos
3b1af0b3fc Improve file comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15069 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 08:28:39 +00:00
Alkis Evlogimenos
910d0d6066 Add Iterative scan register allocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15068 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 08:24:35 +00:00
Alkis Evlogimenos
c8dec2c23e Linearscan is no longer experimental.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15067 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 08:18:50 +00:00
Chris Lattner
6d4b0d723d Add capability to remove aliasing aliassets from an AST
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15066 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 07:04:26 +00:00
Chris Lattner
12c1155403 Make the AST interface a bit richer by returning whether an insertion caused
an insertion or not (because the pointer set already existed).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 05:18:04 +00:00
Chris Lattner
e8a7e593e6 Remove special casing of pointers and treat them generically as integers of
the appopriate size.  This gives us the ability to eliminate int -> ptr -> int


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15063 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 04:27:24 +00:00
Chris Lattner
bb8f43c8fc Do not ignore casts unless they are pointer-pointer casts. This caused us
to miscompile the SingleSource/Regression/C++/pointer_member.cpp program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15062 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 03:56:54 +00:00
Brian Gaeke
0d3ac4cc30 Solaris hack for isinf()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15058 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 03:32:51 +00:00
Brian Gaeke
043c0bb0d9 Emit NaNs and INFs bit-identically to the bytecode file, if the system has
printf("%a") support.
Patch contributed by Bill Wendling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15056 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 03:15:26 +00:00
Brian Gaeke
418f73cbaa Add platform-independent wrapper function for isinf().
Patch contributed by Bill Wendling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15050 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 03:13:50 +00:00
Misha Brukman
cd2273f4a7 Shorts are aligned to 2 bytes, bools to 1 byte (in structs).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 20:59:57 +00:00
Misha Brukman
bf417a6d46 Treat external variables similarly to those with weak linkage: load indirect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15047 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 20:43:05 +00:00
Misha Brukman
86ddcf9d4f Differentiate between global and weak symbol loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15037 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 15:52:25 +00:00
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
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
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
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
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
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
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
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
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
f8083b7f20 Method now returns null, dtor is inlined
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14983 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 00:55:35 +00:00
Reid Spencer
12e7b11a63 A description of what this library is about, reference to the documentation
and a list of don'ts for the library. All so future maintainers don't
break the important contract this library has with its user: LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14979 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 22:33:08 +00:00
Reid Spencer
98b5a34c81 Initiali Makefile for this library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14977 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 22:31:28 +00:00
Chris Lattner
f98cfc716d Add a workaround for a GCC 3.3.2 bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14976 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 21:56:20 +00:00
Chris Lattner
8919cccc3d Fix a performance regression from the CPR patch, simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14974 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 21:34:16 +00:00
Chris Lattner
96940cb522 Strip out and simplify some code. This also fixes the regression last
night compiling cfrac.  It did not realize that code like this:

int G; int *H = &G;

takes the address of G.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14973 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 19:56:20 +00:00
Chris Lattner
9db07b9307 Minor cleanup, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14972 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 18:59:44 +00:00
Chris Lattner
a51e4f6301 Fix infinite loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14971 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 18:45:01 +00:00
Reid Spencer
e95ff9afa0 Remove an if statement that would never be reached.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14968 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 08:41:47 +00:00
Reid Spencer
c88920df66 Delete a redundant if branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14967 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 08:34:52 +00:00
Reid Spencer
c3c2fdf5a8 Expand the coercion of constants to include the newly constant Globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14966 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 08:34:19 +00:00
Reid Spencer
5f0eb64079 Delete a no-op loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14965 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 08:32:43 +00:00
Reid Spencer
c3c92d834a Expand the scope to include global values because they are now constants
too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14964 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 08:32:10 +00:00
Reid Spencer
3188cab989 Avoid an unnecessary isa<Constant>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14963 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 08:31:18 +00:00
Chris Lattner
da6cdfa9e8 Fix infinite loop gccld'ing povray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14962 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 08:12:57 +00:00
Chris Lattner
67910e1eb0 CPR Fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14961 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 07:29:35 +00:00
Chris Lattner
7330248482 CPR fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14960 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 07:26:17 +00:00
Chris Lattner
25c6d68029 Remove useless statistic, fix some slightly broken logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14958 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 07:22:58 +00:00
Chris Lattner
5827aebe64 Fix a rather serious bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14957 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 06:56:58 +00:00
Reid Spencer
acc928042d Shrink some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14956 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 01:04:19 +00:00
Reid Spencer
518310cb0d bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:44:37 +00:00
Reid Spencer
40cf2f954e bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14951 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:41:27 +00:00
Reid Spencer
8863f1814b bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14950 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:38:32 +00:00
Reid Spencer
2786542aad bug 122:
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14949 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:37:35 +00:00
Reid Spencer
460f16c625 bug 122:
- Minimize redundant isa<GlobalValue> usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14948 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:32:14 +00:00
Reid Spencer
21cb67e16a bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14947 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:31:05 +00:00
Reid Spencer
48dc46a512 bug 122:
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14946 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:29:57 +00:00
Reid Spencer
0c4a0418d3 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Rename methods to get ride of ConstantPointerRef usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14945 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:25:04 +00:00
Reid Spencer
3178158918 bug 122:
- Excise dead CPR procesing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14944 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:23:51 +00:00
Reid Spencer
d02fccfdb8 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct test ordering for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14943 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:19:45 +00:00
Reid Spencer
e840434755 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14942 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:18:30 +00:00
Reid Spencer
e0125b6785 bug 122:
- Correct ordering of tests because for GlobalValue isa Constant


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14941 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:16:21 +00:00
Reid Spencer
89fc0e3ce0 User ValueListTy as the type of the ValueList. This avoides the ValueList
from being treated like a Function which can cause the contents of the list
to be come invalidated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14940 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:13:12 +00:00
Reid Spencer
a86037e4d9 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14939 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:12:03 +00:00
Reid Spencer
3c90f9fd12 bug 122:
- Update for BytecodeHandler interface change resuing from CPRs going away


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:10:36 +00:00
Reid Spencer
3271ed554a bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
- Remove tabs
- Fix coments refering to ConstantPointerRef


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14937 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:08:11 +00:00
Reid Spencer
e253cf60fd bug 122:
- Move these functions from other places
- Provide implementations of Constant class overrides in GlobalValue


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14936 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:06:26 +00:00
Reid Spencer
a31fdda275 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Replace tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14935 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:03:48 +00:00
Reid Spencer
38696d2f2b bug 122:
- Correct an assert to not have redundant isa<GlobalValue>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14934 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:02:41 +00:00
Reid Spencer
4ec2e4c578 bug 122:
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14933 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:01:50 +00:00
Reid Spencer
ffe77d36eb bug 122:
- Correct isa<Constant> for GlobalValue subclass
- Fix some tabs and indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14932 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:57:36 +00:00
Reid Spencer
0f7eea5d04 bug 122:
- Module doesn't need to manage ConstantPointerRefs any more.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14931 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:53:23 +00:00
Reid Spencer
00dc479613 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14930 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:50:57 +00:00
Reid Spencer
bb9051531c bug 122:
- Move GlobalValue and GlobalVariable implementations to Globals.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14929 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:50:19 +00:00
Reid Spencer
1c9c8e64d2 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
- Delete ConstantPointerRef member function implementations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14928 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:48:33 +00:00
Reid Spencer
7970396014 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14927 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:47:01 +00:00
Chris Lattner
e1b9536d54 It looks like physref->virtreg joining is working fine. Enable it by default
but make virtreg->virtreg joining stay off by default


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14916 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 21:51:25 +00:00
Chris Lattner
42df461c90 Make sure to emit the immediate byte for instructions like:
shrd [mem], reg, imm

This fixes the jit-ls failure on 186.crafty.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14914 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 20:26:14 +00:00
Chris Lattner
3b5e6e5f84 Reserve the correct amt of space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14913 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 20:24:05 +00:00
Misha Brukman
a57b76fece We don't really need to #include IPO.h into this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14911 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 18:37:46 +00:00
Chris Lattner
cb19d67907 Fix incorrect computation of mod/ref sets. Do not ask for mod/ref information
for objects of size 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14908 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 07:40:34 +00:00
Chris Lattner
ad48cc71dc Print modref information in a useful way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14907 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 06:43:20 +00:00
Chris Lattner
0e872cb470 Cleanups: fold two loops into one
New features: -print-all-alias-modref-info option, print more info


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14906 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 06:28:49 +00:00
Misha Brukman
bebde759e5 * Use LI(S) to copy constants into registers intead of ADDI(S) as the latter is
a funky way to "use" R0 for a 0-valued operand
* Add IMPLICIT_DEFs for incoming function arguments via registers to help the
  register allocator not clobber those registers
* Implement comparisons with longs
* Teach emitSelectOperation() to fold the SetCC operation

Patch contributed by Nate Begeman


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14901 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 21:06:24 +00:00
Misha Brukman
af7f28cdac * Store all non-volatile int registers R13-31 on the stack, restore on exit
* Fix comment formatting


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14900 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:55:20 +00:00
Misha Brukman
be15f67af7 Fix code formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14899 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:54:25 +00:00
Misha Brukman
01d46e9c55 Implement PowerPCInstrInfo::isMoveInstr(), patch by Nate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14898 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:51:55 +00:00
Misha Brukman
6b4ea88e83 Add prototype for TargetInstrInfo::isMoveInstr()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14897 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:50:55 +00:00
Misha Brukman
86fd274790 * Enable allocation of registers r2-r10
* Allocate registers 13-31 backwards (to be able to store them all at once)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14896 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:35:20 +00:00
Misha Brukman
2bf5438931 Add IMPLICIT_DEFS pseudo-instruction; patch by: Nate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14895 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:33:41 +00:00
Misha Brukman
039ba763d1 The generated instruction selector isn't (yet) functional
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14894 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:31:13 +00:00
Misha Brukman
da2b13f694 * Output non-lazy linking stubs for external global variables
* Get rid of dead and #if 0'd code
* Minor for loop speed-up: save end iterator instead of querying every time


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14893 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 20:29:04 +00:00
Misha Brukman
b3998ec5c5 Correctly build shared objects on MacOS X for debugging code generators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14892 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 19:45:45 +00:00
Misha Brukman
6f14ad1ca0 Define double alignment as 8 bytes now that assert(DoubleAlignment == PointerSize)
has been eliminated


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14891 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 19:32:12 +00:00
Misha Brukman
29188c6ff6 * Add spaces between words and numbers in comments printed out for longs/floats
* Print out IMPLICIT_DEFS as comments in the assembly, patch by Nate Begeman


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14890 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 19:01:13 +00:00
Misha Brukman
29baf29b01 Fix grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14888 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 17:40:28 +00:00
Alkis Evlogimenos
8e9b219b67 Add convinience constructor for function calls with two args.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 12:04:28 +00:00
Brian Gaeke
7c4676f341 Add a class for pseudo-instructions. Use it.
Add IMPLICIT_USE and IMPLICIT_DEF, a la X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14884 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 10:32:10 +00:00
Brian Gaeke
7d7ac63366 Add what will eventually be the TSFlags. Big switch(opcode) statements are bad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14883 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 10:31:59 +00:00
Brian Gaeke
d303a2058c Add special handling for pseudo-instructions (print them as comments).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14882 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 10:31:47 +00:00
Brian Gaeke
22b5cd8ac7 Add to-do list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14881 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 10:31:36 +00:00
Brian Gaeke
812c488f0a Do IMPLICIT_DEFs on incoming args' hard regs, to avoid confusing the regalloc.
Support single-fp incoming args.
Support single-fp outgoing args ('call' operands).
Support double-fp return values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14880 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 10:31:25 +00:00
Chris Lattner
81d54465d9 The powerpc is now gone. However it is now just known as the Skeleton target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14877 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 07:14:34 +00:00
Chris Lattner
9404cce349 Build the skeleton target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 07:11:53 +00:00
Chris Lattner
5ad021c8d4 Initial checkin of the rest of the skeleton target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14874 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 07:11:15 +00:00
Chris Lattner
25c29d1e6c Initial skeleton tablegen files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14873 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 06:29:19 +00:00
Chris Lattner
522d9834a2 Add skeleton makefile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14872 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 06:20:55 +00:00
Chris Lattner
6efa9d018c Initial readme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 06:12:28 +00:00
Chris Lattner
a2d4b3cfeb Fix the regressions handling unnamed global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14870 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 01:18:09 +00:00
Chris Lattner
4d143ee019 IA64 compat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14867 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 00:08:28 +00:00
Chris Lattner
b8edf61fa9 Fix IA64 compatibility
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14866 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 00:06:01 +00:00
Chris Lattner
23f9ef062a Use new macro
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14865 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 00:04:54 +00:00
Chris Lattner
f99947c35f Be compatible with IA64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14864 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 00:04:13 +00:00
Chris Lattner
80b2d6c8c4 This patch was contributed by Daniel Berlin!
Speed up SCCP substantially by processing overdefined values quickly.  This
patch speeds up SCCP by about 30-40% on large testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 23:36:43 +00:00
Chris Lattner
fed22aac43 Fix PR404 try #2
This version takes about 1s longer than the previous one (down to 2.35s),
but on the positive side, it actually works :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14856 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 08:20:22 +00:00
Chris Lattner
69e5845a81 Nuke a clearly bogus assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14854 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 07:44:34 +00:00
Chris Lattner
de7aee760e Revert previous patch until I get a bug fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14853 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 05:36:31 +00:00
Chris Lattner
507e3d6dc3 Fix PR404: Loop simplify is really slow on 252.eon
This eliminates an N*N*logN algorithm from the loop simplify pass, replacing
it with a much simpler and faster alternative.  In a debug build, this reduces
gccas time on eon from 85s to 42s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14851 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 04:27:04 +00:00
Chris Lattner
ed6c073097 Fixes for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14848 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:51:32 +00:00
Chris Lattner
0a8e8e1a4e Fixes for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14847 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:51:31 +00:00
Chris Lattner
f51c7f56ca Fix for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14845 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:40:04 +00:00
Chris Lattner
017fdcb76d Revert stuff that I didn't mean to checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:33:38 +00:00
Chris Lattner
1ff1ff70e3 Fixes for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14843 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:31:46 +00:00
Chris Lattner
f92791ace5 Fix for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14842 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:26:49 +00:00
Chris Lattner
76e2df2645 Patches towards fixing PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14841 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:14:30 +00:00
Chris Lattner
30b4344767 Progress on PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14840 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:06:12 +00:00
Chris Lattner
2fc1230dd6 Fixes working towards PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14839 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 01:50:47 +00:00
Chris Lattner
ce36d55cf8 Bug fixes for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14838 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 01:29:12 +00:00
Chris Lattner
dd68469382 Implement folding of expressions like 'uint cast (int* getelementptr (int*
null, uint 1) to uint)' to a constant integer.  We can only do this with
primitive LLVM types, because other types have target-specific sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14837 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 01:16:59 +00:00
Chris Lattner
8bfc2f11a4 Now that we codegen the portable "sizeof" efficiently, we can use it for
malloc lowering.  This means that lowerallocations doesn't need targetdata
anymore.  yaay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14835 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 01:08:08 +00:00
Chris Lattner
d2995df5b7 Improve codegen for the LLVM offsetof/sizeof "operator". Before we compiled
this LLVM function:

int %foo() {
        ret int cast (int** getelementptr (int** null, int 1) to int)
}

into:

foo:
        mov %EAX, 0
        lea %EAX, DWORD PTR [%EAX + 4]
        ret

now we compile it into:

foo:
        mov %EAX, 4
        ret

This sequence is frequently generated by the MSIL front-end, and soon the malloc lowering pass and
Java front-ends as well..

-Chris


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14834 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 00:58:53 +00:00
Chris Lattner
0f01bbc3b2 This is logically part of the last patch. Just more really horrible code
that is made unnecessary by it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14831 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 23:07:13 +00:00
Chris Lattner
a09000db75 ** Finally DeclareNewGlobalValue is dead!
* Simplify a lot of code because type's cannot be in function symbol tables
* Fix memory leaks in handling of redefined function prototypes
* Don't use SymbolTable directly for stuff that we can go through the Module
  for.
* Fix some minor bugs on obscure testcases like:
      test/Feature/globalredefinition.ll
* Do not create GlobalVariable objects for forward referenced Functions!
* When forward referencing a function in a constant expression, do not create
  a placeholder, add a bunch of references to it, then turn around and
  replaceAllUsesOfWith on it with a new global, deleting the placeholder.
  Instead, when we find the real definition of the global, just use the
  placeholder instead of creating a new object.

This substantially simplifies the asmwriter and should even speed it up on
cases heavy in constantexprs (like C++, Java, MSIL)...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14830 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 23:03:46 +00:00
Chris Lattner
8a32784ad4 * Fairly substantial change. Instead of creating new globalvariables, then
replaceAllUsesWith'ing any forward references, just use the forward
  reference if it exists.

This introduces GetForwardRefForGlobal, which will eventually completely
replace the horrible DeclareNewGlobalValue function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14828 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 21:44:00 +00:00
Chris Lattner
cb9d6a8f73 Fold setValueNameMergingDuplicates into ParseGlobalVariable, allowing us
to substantially simplify the result.  In particular, we no longer create
GlobalVariables and then immediately destroy them when they are duplciate
definitions.

The real point of this patch though is that it gets us closer to the
DeclareNewGlobalValue calls...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14827 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 20:42:57 +00:00
Brian Gaeke
fe2102b61d Actually set the endian/pointersize flags on the module being read in!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14826 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 20:33:13 +00:00
Chris Lattner
f70770abd5 Simplify logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14825 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 20:27:12 +00:00
Chris Lattner
d9ce6adfcc Fix a regression from last night. Apparently the CFE is broken and outputs
functions multiple times, expecting them to be merged.  This should be fixed
in the CFE, then here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14823 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 19:33:47 +00:00
Misha Brukman
5f8cce1348 Make sure MTSPR instruction is inserted into the BasicBlock
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14822 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 18:26:31 +00:00
Chris Lattner
33af23d902 Implement new helper methods for creating two-index GEP instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14821 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 18:14:33 +00:00
Misha Brukman
32caa8de62 Don't define the same register twice when loading a ConstantPointerRef to a reg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14819 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 17:57:04 +00:00
Misha Brukman
8d442c2dc4 * Fix multiplication by powers of two and otherwise
* Clarify variable name (StoreInst SI instead of LI)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14818 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 15:29:51 +00:00
Chris Lattner
d88998db01 Pull out code shared between GV forward-decl and definition processing.
This gives us only a single call site for setValueNameMergingDuplicates.
The next stage is the start merging them together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14811 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 08:23:52 +00:00
Chris Lattner
66028f208e Simplify code. Do not allow functions to be redefined more than once.
Since the stupid '%X = const int 4' thing is gone, we can now simplify
setValueNameMergingDuplicates a bit more.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14810 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 07:12:48 +00:00
Chris Lattner
e002694ce2 Remove a gross and crufty "feature" that was never documented and doesn't work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14809 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 06:44:56 +00:00
Chris Lattner
8642763f11 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14808 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 06:39:48 +00:00
Chris Lattner
2e2ed2995a Revamp handling of labels. In particular, if we create a forward reference
for a basic block, use it when the block is defined instead of deleting it
and creating a new one.  Also, only create at most ONE forward reference
for any block, instead of one for each forward reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14807 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 06:28:35 +00:00
Brian Gaeke
d94b6d3fa5 Add Machine-CFG edges to SparcV9 MachineBasicBlocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14806 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 05:40:50 +00:00
Chris Lattner
64116f980e Split the basic block handling case out of getVal into getBBVal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14805 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 01:33:11 +00:00
Chris Lattner
144d9baf5e Make Argument::print more resilient to non-verifiable IR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14801 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 23:14:34 +00:00
Chris Lattner
b4091e548e Catch aggregates passed by value sooner rather than later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14800 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 20:09:51 +00:00
Misha Brukman
a596f8c3aa * Specify that FP arith options have 3 operands
* Correctly load FP constants from the constant pool, should be refactored


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14799 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 15:35:45 +00:00
Chris Lattner
65cd4b0fa7 Fine-grainify namespacification, prune #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14792 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 08:42:12 +00:00
Chris Lattner
22ae232d98 Fix typeo and refactor bb productions to make it possible for us to reuse any
forward reference blocks if they have been created (instead of creating a new
block, replaceAllUsesOfWith, then nuking the placeholder).   This is not yet
implemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 08:39:15 +00:00
Chris Lattner
bc721ed100 Eliminate some mega-cruft here. There is no reason to DERIVE FROM IR CLASSES
just to keep track of some per-object state!  Gaah!  Whoever wrote this stuff...
oh wait, that would be me.  Never mind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14790 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 08:28:21 +00:00
Chris Lattner
c9aea52ae4 Inline the now trivial setValueNameInternal function into both callers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14789 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 08:12:39 +00:00
Chris Lattner
8c89a0a1fd Now that basic blocks are eagerly inserted into the Function, we can use
the funciton symbol table to check for conflicts instead of having to
keep a shadow named LocalSymtab.  Totally eliminate LocalSymtab.  Verified
that this did not cause a regression on the testcase for PR107.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14788 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 08:10:10 +00:00
Chris Lattner
8ab406d5bd A couple of substantial cleanup fixes:
1. Split setValueName into two separate functions, one that is only used
     at function scope and doesn't have to deal with duplicates, and one
     that can be used either at global or function scope but that does deal
     with conflicts.  Conflicts were only in there because of the crappy old
     CFE and probably should be entirely eliminated.
  2. Insert BasicBlock's into the parent functions when they are created
     instead of when they are complete.  This effects name lookup (for the
     better), which will be exploited in the next patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14787 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 07:59:27 +00:00
Brian Gaeke
0859e52582 Fix warning on SparcV9, where sizeof (int) != sizeof (void *).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14786 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 07:37:43 +00:00
Chris Lattner
38ab6bff5d Replace a bunch of complex ConstantPointerRef referring code with simple
code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14785 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 06:58:07 +00:00
Chris Lattner
b89e071aea Factor some code to handle "load (constantexpr cast foo)" just like
"load (cast foo)".  This allows us to compile C++ code like this:

class Bclass {
  public: virtual int operator()() { return 666; }
};

class Dclass: public Bclass {
  public: virtual int operator()() { return 667; }
} ;

int main(int argc, char** argv) {
  Dclass x;
  return x();
}

Into this:

int %main(int %argc, sbyte** %argv) {
entry:
        call void %__main( )
        ret int 667
}

Instead of this:

int %main(int %argc, sbyte** %argv) {
entry:
        %x = alloca "struct.std::bad_typeid"            ; <"struct.std::bad_typeid"*> [#uses=3]
        call void %__main( )
        %tmp.1.i.i = getelementptr "struct.std::bad_typeid"* %x, uint 0, uint 0, uint 0         ; <int (...)***> [#uses=1]
        store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Bclass, int 0, long 2), int (...)*** %tmp.1.i.i
        %tmp.3.i = getelementptr "struct.std::bad_typeid"* %x, int 0, uint 0, uint 0            ; <int (...)***> [#uses=1]
        store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2), int (...)*** %tmp.3.i
        %tmp.5 = load int ("struct.std::bad_typeid"*)** cast (int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2) to int
("struct.std::bad_typeid"*)**)          ; <int ("struct.std::bad_typeid"*)*> [#uses=1]
        %tmp.6 = call int %tmp.5( "struct.std::bad_typeid"* %x )                ; <int> [#uses=1]
	ret int %tmp.6
        ret int 0
}

In order words, we now resolve the virtual function call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14783 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 01:49:43 +00:00
Misha Brukman
d9aa7836e2 Correctly load FP constants out of the constant pool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14782 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-12 23:49:47 +00:00
Misha Brukman
f028f82a58 Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14781 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-12 23:37:18 +00:00
Misha Brukman
01eca8d2c2 Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14780 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-12 23:36:12 +00:00
Chris Lattner
b370c7a41a implement new helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14776 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-12 20:35:11 +00:00
Chris Lattner
aec6dd5bbc Fix unused var warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14775 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-12 20:29:52 +00:00
Chris Lattner
88e2b780cb Fix a really nasty logic error that VC noticed.
Reid, this might matter to you :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14774 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-12 20:27:31 +00:00
Chris Lattner
1c2fe31483 Implement new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14767 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-12 01:17:34 +00:00
Reid Spencer
46b002cd9b Various cleanups:
- Remove tabs
- Standardize use of space around ( and ).
- Consolidate the ConstantPlaceHolder class
- Rename two methods to be more meaningful (ParseType, ParseTypes)
- Correct indentation of blocks
- Add documentation
- Convert input dependent asserts to error(...) so it throws instead.
Provide placeholder implementations of read_float and read_double that
still read in platform-specific endianess. When I figure out how to do
this without knowing the endianess of the platform, it will get implemented
correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14765 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 17:28:43 +00:00
Reid Spencer
66906518ed - Rename two methods to give them more meaning
- Add read_float and read_double in preparation for a correct
  implementation of bytecode floating point support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14764 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 17:24:05 +00:00
Reid Spencer
1d9349a783 Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14763 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 17:22:51 +00:00
Reid Spencer
87bc418334 Prepare the writer for a non-broken implementation of writing floating
point values. This will be fixed when I figure out how to do it correctly
without depending on knowing the endianess of a platform.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14762 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 17:22:07 +00:00
Chris Lattner
beff74f821 The cleanup is done. Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14761 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 08:24:02 +00:00
Chris Lattner
5f90cb8c98 Make add constantexprs work with all types, fixing the regressions from last night
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14760 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 08:01:11 +00:00
Chris Lattner
7c38def077 Implement TargetRegistrationListener
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14759 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 06:03:21 +00:00
Chris Lattner
68905bb6fc Delete the allocate*TargetMachine function, which is now dead.
The shared command line options are now in a header that makes sense.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14757 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:17:58 +00:00
Chris Lattner
0cf0c37469 Delete the allocate*TargetMachine function, which is now dead .
The shared command line options are now in a header that makes sense.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14756 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:17:10 +00:00
Chris Lattner
4e547ec8bf Delete the allocate*TargetMachine function, which is now dead .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14755 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:16:31 +00:00
Chris Lattner
d5e1d9d5f4 Goodbye macro hell, hello nice clean simple extensible code. This change
also gives the JIT the ability to dynamically load targets. e.g.

lli -load libparisc.so -march=parisc foo.bc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14750 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:02:06 +00:00
Chris Lattner
d7099bc608 Implement a couple of methods that TargetMachineRegistry now provides. See,
I told you this file wasn't useless :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14749 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:00:19 +00:00
Chris Lattner
71d24aab2d Make these format a bit nicer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14747 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 03:27:42 +00:00
Chris Lattner
d36c970a11 Auto-registrate target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14745 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 02:48:49 +00:00
Chris Lattner
98599d098f Add compilability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14744 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 02:48:28 +00:00
Chris Lattner
bf5733737f Initial impl of this file. Yes this is pretty useless right now, but it
will grow in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14743 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 02:44:26 +00:00
Chris Lattner
13a253aae7 Implicitly getting a new option by linking to support.o instead of support.a
is a bad idea.  Make tools that want the option #include PluginSupport.h
explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14738 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 01:04:33 +00:00
Reid Spencer
3ba415a770 Replace use of defunct Type::setName method with SymbolTable::insert.
Patch found and provided by Vladimir Merzliakov. Thanks Vladimir!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14732 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-10 16:37:42 +00:00
Reid Spencer
9cb5242574 Make the VBRSavings percentage make sense (as a fraction of the total
expanded size instead of the file size). Thanks Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14731 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-10 08:04:13 +00:00
Reid Spencer
2439972a61 Error Handling Cleanup:
- get rid of PARSE_ERROR macro
- add error(std::string) function
- use error(std::string) for all errors
- make input dependent asserts call error(std::string) instead
- ensure asserts are only for logic bugs, not input discrepancies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14729 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 22:21:33 +00:00
Reid Spencer
011bed5ef8 Fix a backwards compatibility bug found by Tanya. In version 1.2, the
global type plane starts with a length and the TypeTyID value to identify
the type plane has having type definitions. This doesn't happen in 1.3
because the types are read from a known position in the file. However, the
TypeTyID must be read in (and ignored) if its a 1.2 bytecode file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14728 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 21:13:53 +00:00
Chris Lattner
36002e43ec Remove unused method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14726 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 16:48:13 +00:00
Chris Lattner
9fb6cf1d82 Add checks to ensure that there are no unreachable blocks in the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14725 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 16:44:37 +00:00
Chris Lattner
8ca2dc0710 Don't call Type::setName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14724 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 16:43:55 +00:00
Misha Brukman
313efcb886 * Add support for indexing into structures, thanks to Chris (x86)
The large diff is because of indentation of a whole region
* Fix querying predecessor blocks in SelectPHINodes(), thanks to Brian (v8)
* Add support for external functions malloc() and free()
* Fix some code indentation

Remember, kids: It's not plagiarism if you "creatively borrow" from your
sources.  It's called "research"!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14723 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 15:45:07 +00:00
Misha Brukman
c1ef127ae2 Read/write the offset value for stack-relative loads via correct instr operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14722 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 15:37:16 +00:00
Misha Brukman
ce22e76996 * Doxygenify comments
* Fix spacing, grammar in comment
* Make code layout consistent
* Wrap code at 80 cols
* Delete spurious blank lines

No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14721 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 14:45:17 +00:00
Alkis Evlogimenos
80b27ced2d Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14720 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 11:25:27 +00:00
Alkis Evlogimenos
607baea7d2 Improve code comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14719 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 11:10:00 +00:00
Chris Lattner
51662c7beb The uid mapping is no more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14708 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 22:31:09 +00:00
Chris Lattner
735f2700d6 Eliminate uses of the UniqueID field on Type objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14707 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 22:30:50 +00:00
Chris Lattner
d6391d7d3b Do not call Type::getUniqueID
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14706 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 22:09:34 +00:00
Misha Brukman
f3f6382423 Add support for __fixdfdi(), __floatdisf(), and __floatdidf() external functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14703 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 19:41:16 +00:00
Misha Brukman
0aa97c625b * Use several Function* for external functions instead of a std::map
* Non-const FP values must be loaded into int regs (for vararg fns) via memory


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14701 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 18:27:59 +00:00
Misha Brukman
fc879c336b * Add support for loading FP constants from the constant pool
* Load FP values into int regs as well for vararg functions; without memory ops!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14700 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 18:02:38 +00:00
Misha Brukman
05fcd0c891 * Fix header comment, excise references to X86
* Add suport for printing out references to constant pool indices


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14699 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 17:58:04 +00:00
Chris Lattner
e14d7e4f9f Eliminate the SignedType and UnsignedType classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14695 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 17:30:07 +00:00
Brian Gaeke
3a0858957a Support setcc on fp values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14687 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 09:08:35 +00:00
Brian Gaeke
4185d03dc5 Add floating-point branches and compares. Compares don't complete
until the next cycle, and there's no interlock, so they effectively
have a delay slot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14686 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 09:08:22 +00:00
Brian Gaeke
7e540fe2b6 Fix bug where SwitchSection would fail to change to ".bss" successfully.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14685 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 08:08:23 +00:00
Brian Gaeke
ccdd70a5c0 Fix bug involving bool arguments to binary operators.
Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14684 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 08:08:10 +00:00
Brian Gaeke
2a9f539168 Fix bug in copying long constants to register pairs. We were getting
the top and bottom halves backwards...how embarrassing.
Support 'cast long to long' and other similar no-op casts to long.
Support 'ret long'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14683 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 07:52:13 +00:00
Chris Lattner
5ace1e4f6f Disable some code that isn't helping matters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14682 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 07:25:51 +00:00
Brian Gaeke
f9a75460ee Support 'ret float'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14681 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 07:22:27 +00:00
Alkis Evlogimenos
71bf404e9b Add viewCFG() and viewCFGOnly() APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14679 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 00:47:58 +00:00
Misha Brukman
cf617ddd98 There is no error message to print out, end sentence with `!'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14678 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 21:22:05 +00:00
Reid Spencer
f86cafdda4 Make error message consistent with the rest of LLVM by saying that bytecode
is read, not parsed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14677 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 21:20:28 +00:00
Reid Spencer
e294753128 Fix for bug 391.
Improve exeception handling around bcreader invocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14674 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 21:01:38 +00:00
Misha Brukman
2834a4dd1d * Use a map for caching lookups to external functions (fp div/rem)
* Tabs to spaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14673 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 20:07:22 +00:00
Misha Brukman
e62cd37c2a * Wrap long lines (comments and code)
* Tabs to spaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14672 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 20:01:36 +00:00
Chris Lattner
5c45e6db39 Fix regressions in these testcases:
Regression.Assembler.2002-01-24-BadSymbolTableAssert
 Regression.Assembler.2002-01-24-ValueRefineAbsType

Found through the nightly tester :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14671 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 18:07:46 +00:00
Misha Brukman
b093259edd Add fmod() to the Module being compiled so that it gets a stub in the asm file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14670 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 15:36:18 +00:00
Chris Lattner
c964715a76 The bytecode reader wants to be able to read types that are not quite resolved
yet, then resolve them in it's own sweet time.  We must support this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14666 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:48:27 +00:00
Chris Lattner
8adbec89ce Headers moved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14665 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:35:22 +00:00
Chris Lattner
4dabb2c6f3 Move all of the DSA headers into the Analysis/DataStructure subdir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14663 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:32:21 +00:00
Chris Lattner
eaef5685b8 Moving headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14661 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:22:54 +00:00
Chris Lattner
efffdc9408 As much as I hate to say it, the whole setNode interface for DSNodeHandles
is HOPELESSLY broken.  The problem is that the embedded getNode call can
change the offset of the node handle in unpredictable ways.

As it turns out, all of the clients of this method really want to set
both the node and the offset, thus it is more efficient (and less buggy)
to just do both of them in one method call.  This fixes some obscure bugs
handling non-forwarded node handles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14660 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:12:52 +00:00
Chris Lattner
d340867964 When folding constant expr gep's, don't force the use of long indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14658 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 04:45:13 +00:00
Alkis Evlogimenos
3877652e68 Disable coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14655 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 02:03:12 +00:00
Chris Lattner
edfc49de13 Make sure people don't make functiontypes with an invalid return type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14654 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 23:25:19 +00:00
Misha Brukman
d18a31d2fa * Add support for calling vararg functions (must pass doubles in int regs too)
* Make visitSetCondInst() share condition-generating code with EmitComparison()
* There are 13 FPRs for function-passing arguments, not 8
* Do not rely on registers being sequential, use an array lookup
* In unimplemented switch cases, send an error and abort instead of silent
  fall-through
* Add doInitialization() for adding function prototypes for external math fns
* Minor changes: fix indentation, spacing, code clarity


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14653 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 22:51:53 +00:00
Misha Brukman
4cf5112500 Use the more compact bl' instead of cryptic (but equivalent) bcl 20,31'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14652 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 22:40:34 +00:00
Brian Gaeke
a4c7c414ef Work around apparent Apple compiler bug which was making all mangled
names start with l0_.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14651 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 20:29:05 +00:00
Chris Lattner
fae1010218 Check to make sure types are sized before calling getTypeSize on them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14649 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 19:28:42 +00:00
Brian Gaeke
08cc64ebfe It doesn't matter what the 2nd operand is; if the GEP has 2 operands and
the first is a zero, we should leave it alone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14648 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 19:24:47 +00:00
Brian Gaeke
10585d92da Add helper function.
Don't touch GEPs for which DecomposeArrayRef is not going to do anything
special (e.g., < 2 indices, or 2 indices and the last one is a constant.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14647 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 18:15:39 +00:00
Chris Lattner
a9e7781b3b Find bugs sooner rather than later. In this case, don't allow the creation
of instructions that don't have a first-class or void type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14646 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 17:44:17 +00:00
Alkis Evlogimenos
5de868b0b2 Do not crash when joining two intervals of registers of different
classes: just ignore that move. Thanks to Vladimir Prus who found the
bug!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14644 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 16:03:21 +00:00
Misha Brukman
e9c6551fed * Add utility functions: convert SetCC => PPC opcode and invert PPC opcode
* If SetCondInst is folded into BranchInst (and it is the only user), do not
  emit code for SetCondInst
* Fix assembly opcodes in comments in visitSetCondInst()
* Fix codegen of conditional branches


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14643 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 15:32:44 +00:00
Chris Lattner
3571b72606 Implement rem.ll:test3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14640 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 07:38:18 +00:00
Chris Lattner
1e3564ef05 Fix a minor bug where we would go into infinite loops on some constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14638 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 07:11:42 +00:00
Chris Lattner
5b73c08896 Implement InstCombine/sub.ll:test15: X % -Y === X % Y
Also, remove X % -1 = 0, because it's not true for unsigneds, and the
signed case is superceeded by this new handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14637 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 07:01:22 +00:00
Chris Lattner
7f0566c123 Fix a bug in the unreachable block elim pass. Dropping all references on a
basic block clear()'s all of the operands lists, including phis.  This
caused removePredecessor to get confused later.  Because of this, we just
nuke (without prejudice) PHI nodes in unreachable blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14635 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 06:36:11 +00:00
Reid Spencer
ba466362c4 Remove definition and use of OtherVal enumerator. This just fixes a thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14634 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 01:30:36 +00:00
Reid Spencer
5c15fe5cf8 Finalize bytecode dumping. The "handleFinish" method was getting called
too soon so the function data was not getting dumped (it was generated
after the call handleFinish). Also cleaned up the output format for
proper indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14627 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-05 00:57:50 +00:00
Alkis Evlogimenos
c156095b17 Correctly compute the ration of iterations/#intervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14626 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 17:23:35 +00:00
Chris Lattner
38343f6cfe Add #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14625 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 17:19:21 +00:00
Reid Spencer
954da37bb4 Add #include <iostream> since Value.h does not #include it any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14622 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:19:56 +00:00
Reid Spencer
8ce1da781e - remove use of isa<Type>(Val) since there's no inheritance relationship
any more. Needed for bug 122
- #include <iostream> since Value.h doesn't include it any more.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14621 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:19:05 +00:00
Reid Spencer
77f4d868d7 Remove use of Type::TypeTy which is no longer defined. This change needed
for bug 122 since the "Type Type" concept is gone now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14620 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:17:44 +00:00
Reid Spencer
7474d03578 Correct syntax typo .. ; -> :
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14619 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:15:11 +00:00
Reid Spencer
6e885d0dd5 - Changes for bug 122
- Remove Tabs
- Add inserters  needed since Value doesn't implement them any more
- Move some functions here to avoid cyclic header file dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14618 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:14:17 +00:00
Reid Spencer
e2fac77ad3 - #include <iostream> since its not in Value.h any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14617 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:55:37 +00:00
Reid Spencer
db8e515b43 Constify SymbolTable's use of Type* so that it never modifies them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14616 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:55:08 +00:00
Reid Spencer
c28a224c68 - #include <iostream> since its not in Value.h any more.
- constify use of Type* returned from symbol table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14615 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:52:49 +00:00
Reid Spencer
57f6efc095 #include <iostream> since its not in Value.h any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14614 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:51:24 +00:00
Reid Spencer
0e25e1cdcf Adjust the slot machine to handle Types separately from Values. This was
done by doubling up the data structures so that Type based equivalents are
used. A consequence of this is overloading of function members that take a
Type* instead of a Value*. Various other cleanups related to Type != Value
(bug 122) were also implemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14613 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:50:43 +00:00
Reid Spencer
d57da4b27d Implementation of SlotTable went into header file. Note that this header
is currently not being used but is retained because it will be the basis
for a clean up of the SlotCalculator class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14612 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:47:22 +00:00
Reid Spencer
0852c80e38 Remove Tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14611 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:46:15 +00:00
Reid Spencer
cb3595c3d1 Implement new output functions for types and compacted type planes. Also
remove use of Type::TypeTyID and Type::TypeTy since Type no longer inherits
Value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14610 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:45:47 +00:00
Reid Spencer
d1fb1b7440 Add new methods outputTypes and outputCompactionTypes for handling Types
separately from Values. This needed for bug 122.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14609 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:44:27 +00:00
Reid Spencer
24ab28f1e5 For bug 122:
Separate Types from Values because Type no longer inherits from Value. The
changes for this are too numerous to list. In essence, any data structure
that contained a Value was doubled so that Types could be contained
similarly. New members include Types, TypeMap, CompactionTypes, and
CompactionTypeMap. Functions taking a Value* were overloaded with a variant
that takes a Type* that acts on the new data structures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14608 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:42:49 +00:00
Reid Spencer
5e394ff01b - Type::TypeTyID doesn't exist any more (bug 122)
- Types don't have names any more, just write them on ostream directly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14606 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:37:54 +00:00
Reid Spencer
04cde2ce59 - Don't use macros to call the BytecodeHandler
- Don't use PARSE_ERROR macro unnecessarily (for simple strings)
- Add comments before each function
- Convert for bug 122 (Type != Value)
- Handle new value range on Type::PrimitiveTypeId enumeration by augmenting
  the reader with a new read_typeid method and sanitizeTypeId method.
- Remove BytecodeHandler's default method implementations to header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14604 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:33:49 +00:00
Reid Spencer
a86159cd4b - Make ValueList an "OtherVal" user of Values to ensure it doesn't get
mistaken for anything else.
- Move function descriptions to Reader.cpp file per Chris.
- Remove tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14602 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:04:56 +00:00
Reid Spencer
97c7d74d04 Remove tabs. Move function declaration to Reader.h where it belongs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14601 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:03:03 +00:00
Reid Spencer
77cf296c5d Add #include <iostream> which is needed now that Value.h doesn't include it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14600 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:01:27 +00:00
Reid Spencer
b61cdb7f10 Excise tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14599 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:00:39 +00:00
Alkis Evlogimenos
d55b2b1067 Add efficiency statistic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14590 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 07:59:06 +00:00
Chris Lattner
5114004110 Fix compilation on internix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14588 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-03 01:21:05 +00:00
Chris Lattner
46238a6150 Implement add.ll:test22, a common case in MSIL files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14587 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-03 00:26:11 +00:00
Chris Lattner
c5f143b6e7 Fix Type::isSized() to realize that "{ opaque }" is not sized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14585 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 23:20:17 +00:00
Chris Lattner
cf27afb64e Do not call getTypeSize on a type that has no size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14584 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 22:55:47 +00:00
Misha Brukman
68a9b04e77 Add FIXME notes for spilling int/fp regs (need to calculate stack space).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14581 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 17:54:38 +00:00
Brian Gaeke
e0e3589949 Fix use-before-def thinko
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14570 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 07:01:31 +00:00
Chris Lattner
230b4fb8a0 Revert patches 1.79 and 1.80 which had to do with dead MBB's. Now that they
don't exist, we don't have to pretend to handle them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14567 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:52:23 +00:00
Chris Lattner
a9a582fbb6 Fix potential problems with unreachable basic blocks.
Also, while noone's looking, add support for constant expressions.  Wait,
I said not to look!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14566 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:49:11 +00:00
Chris Lattner
fab96f0b69 Fix all of those problems that the PPC backend has running 176.gcc :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14565 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:48:42 +00:00
Chris Lattner
9a9ca0f06b Remove dead blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14564 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:46:41 +00:00
Chris Lattner
fc3c82a804 Add a trivially simple pass to delete unreachable blocks from the CFG. This
pass is required to paper over problems in the code generator (primarily
live variables and its clients) which doesn't really have any well defined
semantics for unreachable code.

The proper solution to this problem is to have instruction selectors not
select blocks that are unreachable.  Until we have a instruction selection
framework available for use, however, we can't expect all instruction
selector writers to do this.  Until then, this pass should be used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14563 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:46:10 +00:00
Brian Gaeke
1c4b6de4e7 Get rid of a dead variable, and fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14560 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:30:01 +00:00
Brian Gaeke
90c5bbe100 Add M_TERMINATOR_FLAG to terminator instructions (branches and returns).
Also, the RETURN instructions are not used in the sparcv9 backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14559 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 04:57:37 +00:00
Brian Gaeke
3c95d3a9dc RETURN instructions are not used in the sparc backend.
When in doubt, stamp it out!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14558 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 04:57:35 +00:00
Misha Brukman
452069abcc * Follow the PowerPC convention of leaving 24 bytes for linking on the stack.
* Also leave space for spilling integer registers (this should be calculated)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14554 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:35:00 +00:00
Misha Brukman
425ff24bb3 * Get rid of constant-expr handling code: we use the ConstantExpr lowering pass
* Use the SetCC handling code in the format of Brian's V8
* Add FIXMEs where calls to functions are being made without adding them to the
  Module first... they cause missing symbols at assembly-time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14553 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:34:10 +00:00
Misha Brukman
f233a84b3c Wrap long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14552 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:27:59 +00:00
Misha Brukman
15eb0a15e5 * Do not allocate r0 as we use it indiscriminantly in the instr selector.
* Do not define CR register class because we don't (yet) have the i4 type


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14551 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:24:50 +00:00
Misha Brukman
4363bdb0e5 Check if operand has an allocated reg before requesting it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14550 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 21:09:12 +00:00
Chris Lattner
4d13294d47 Add much better assertion checking for load and store insts.
Contributed by Vladimir Merzliakov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14546 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 20:23:52 +00:00
Brian Gaeke
a9160a064f Make this pass use a more specific debug message than "Processing:".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14541 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 19:27:10 +00:00
Chris Lattner
59b0067334 Handle targets where alignment can be bigger than the size of the data.
Contributed by Vladimir Prus!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14534 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 17:32:59 +00:00
Chris Lattner
4b9a400674 Make sure that we destroy the MBB's, with all of their instructions, before
any other data structures


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14524 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 06:29:07 +00:00
Chris Lattner
8490f9c92e Now that MachineFunction/MachineBasicBlock keep a mapping of blocks to ID #'s
use them instead of a local LiveVariables numbering


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14523 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 06:15:32 +00:00
Chris Lattner
ca48eb9f51 Change MBB autonumber a bit to get the reverse mapping as well as a forward
mapping


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14521 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 06:02:27 +00:00
Chris Lattner
51289aa520 Instance var no longer exists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14520 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 06:02:07 +00:00
Chris Lattner
8ba9771549 Start using MBB numbers directly instead of going through the live variables
map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14518 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 04:29:47 +00:00
Chris Lattner
a5287a6376 Instead of building a private numbering of MBB's use brg's nifty auto-numbering.
Also convert df_iterator -> df_ext_iterator for subsequent stuff I'm doing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14517 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 04:24:29 +00:00
Misha Brukman
d2d5df207a Fix indentation to be 2 spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14512 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 22:11:03 +00:00
Misha Brukman
c661c3001c * Coalesce the handy CALL* alias opcodes with the standard ones
* Congregate more branch-and-link opcodes together
* Mark FP, CPR, and special registers as volatile across calls


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14511 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 22:00:45 +00:00
Misha Brukman
da7515a378 * Allow more registers to be allocated from the general register pool
* Define the condition register class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14510 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 21:54:50 +00:00
Misha Brukman
b9e8f97aef * Inquire about the number of operands from the instruction directly
* Only check for a register if we are sure the instruction has one allocated


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14509 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 21:54:12 +00:00
Misha Brukman
ea09126414 visitSetCondInst() takes a parameter of type `SetCondInst'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14508 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 21:47:40 +00:00
Misha Brukman
ce76db9083 Always assume a function may have calls because the printer may add `bl' to get
the PC in a code sequence for global variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14506 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-30 00:09:12 +00:00
Misha Brukman
14d8c7a6a0 * Don't save LR when outputting globals: it's already saved on the stack once
for the function
* Registers aren't necessarily sequential wrt their enums, don't rely on it
  when emitting function arguments into sequential registers
* Remove X86-specific comments about AL/BL/AH/BH/EDX/etc
* Add an abort() for an unimplemented signed right shift
* The src operand for a GEP was never emitted!  Fixed.
* We can skip zero-valued GEP indices as they are no-ops.

"Hello, World!" now works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14505 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:45:05 +00:00
Misha Brukman
61297ee118 * Stop using BBNumbering, we don't really need it
* Only increment labelNumber once, because it's used by both Load{hi,lo}Addr
* There is no .bss section on PowerPC
* Use .align 2 instead of other random numbers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14504 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:40:57 +00:00
Misha Brukman
cbcdb9c0a7 Set up the prologue and epilogue to be more like the manual and GCC output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14502 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:38:26 +00:00
Misha Brukman
5fa2b028b8 * Use LA instead of LWZ for LoadLoAddr
* Specify the isCall bit and caller-save registers for some call instrs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14501 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:37:36 +00:00
Misha Brukman
8ee0100880 Only allocate non-volatile registers R13-31 (for now).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14500 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:35:32 +00:00
Misha Brukman
60f35813fc Lower ConstantExpressions before the code generator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14497 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:33:20 +00:00
Reid Spencer
0692dbfa10 Remove files no longer needed. ConstantReader and InstructionReader were
integrated into Reader. Parser.* was just a bad idea. AnalyzerInternals.h
is no longer needed. ReaderPrimitives.h was integrated into Reader.h and
Reader.cpp. Dumper.cpp was integrated into Analyzer.cpp. ReaderInternals.h
became Reader.h. AnalyzerWrappers.cpp was integerated into
ReaderWrappers.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14496 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:32:41 +00:00
Reid Spencer
f89143c7de This is a slimming down of the previous ReaderInternals.h that just
declares the BytecodeReader class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14495 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:31:01 +00:00
Reid Spencer
060d25d1dc MAJOR REWRITE.
- stop passing Buf/BufEnd to every function (now member vars)
- internalize things that used to be in a header file that no one else
  included/needed.
- Remove defunct BCR_TRACE lines
- Standardize error handling with the PARSE_ERROR macro.
- Integrate ConstantReader.cpp and InstructionReader.cpp and reorgnize
  the definition order so that gcc has a chance at optimizing this module
- Standardize case and style of method names.
- Eliminate unneeded header files
- Prepare for Type != Value (bug122) change by splitting Types into their
  own data structures.
- Implement the BytecodeHandler interface calls.
- Provide default implementation of BytecodeHandler interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14494 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:29:38 +00:00
Reid Spencer
df45a5485d Adjustments to allow Bytecode Reading to support the BytecodeHandler
interface which is called by the reader if a BytecodeHandler is provided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14493 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:24:14 +00:00
Reid Spencer
f41aa7397c Merge Dumper.cpp and AnalyzerWrappers.cpp into this file. Also, adjust the
dumping facility to produce useful output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14492 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:23:12 +00:00
Reid Spencer
cc1091e66b Analyzer moved to ../Reader directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14491 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:21:53 +00:00
Reid Spencer
46bd33f336 Remove newly defunct Analyzer directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14490 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:21:16 +00:00
Misha Brukman
c1f901c589 Fix associativity of parameters to assert(): now it actually makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14483 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 19:43:20 +00:00
Misha Brukman
e8d8fb26a6 Convert tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14482 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 19:28:53 +00:00
Misha Brukman
e19ca38a32 * Fix saving LR in function prologue
* Adjust epilogue restore sequence to match the PowerPC documentation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14480 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 17:14:42 +00:00
Misha Brukman
218bec7bd3 Assembly syntax/comment fixes by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14479 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 17:13:26 +00:00
Vikram S. Adve
39c2a8ead5 Restoring this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14478 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 14:20:27 +00:00
Chris Lattner
1b17438aa8 The code generator should work with unreachable blocks. If not, then this
is a bug that should be fixed in the code generator, not papered over with
the simplifycfg pass.  Eliminating this makes bugpoint much more useful


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14477 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 07:20:16 +00:00
Chris Lattner
23a53aa9c4 I believe that the code generator now properly handles dead basic blocks. If not,
this is a bug, and should be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14476 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 07:17:12 +00:00
Chris Lattner
91a350ddd1 In line with the previous patch, do not assert out if analyzing a dead basic block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14475 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 07:16:23 +00:00
Chris Lattner
59850a8f8f Do not dereference end iterators. It hurts when you do that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14474 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 06:56:51 +00:00
Chris Lattner
8b486a114e Fix a regression from r1.224. In particular, codegen a cast from double ->
float as a truncation by going through memory.  This truncation was being
skipped, which caused 175.vpr to fail after aggressive register promotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14473 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 00:14:38 +00:00
Misha Brukman
7cd444082e Can't print out machine code before it is constructed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14472 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-28 21:16:57 +00:00