1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

17456 Commits

Author SHA1 Message Date
Chris Lattner
7223d491cb eliminate temporary vectors.
llvm-svn: 34161
2007-02-10 20:31:59 +00:00
Chris Lattner
d079b34aa0 Switch LayoutInfo to be a DenseMap instead of an std::map. This speeds up
-load-vn -gcse by 2.3%.

llvm-svn: 34160
2007-02-10 20:26:17 +00:00
Chris Lattner
8fa88af5f0 add a typedef
llvm-svn: 34159
2007-02-10 20:18:06 +00:00
Chris Lattner
863b62eb50 eliminate the std::vector from StructLayout, allocating the elements immediately
after the StructLayout object in memory.  This marginally improves locality,
speeding up -load-vn -gcse by ~0.8%.

llvm-svn: 34158
2007-02-10 20:15:41 +00:00
Chris Lattner
109373538b encapsulate the rest of the StructLayout members.
llvm-svn: 34157
2007-02-10 19:59:22 +00:00
Chris Lattner
9dafd9fe90 Privatize StructLayout::MemberOffsets, adding an accessor
llvm-svn: 34156
2007-02-10 19:55:17 +00:00
Chris Lattner
13b4f184fd Use ManagedStatic to manage LayoutInfo, instead of rolling our own.
llvm-svn: 34154
2007-02-10 19:43:18 +00:00
Chris Lattner
eaceeb61fb Change TargetData::getIndexedOffset interface to not require indices
in a vector.

llvm-svn: 34153
2007-02-10 19:33:15 +00:00
Reid Spencer
b8c5bbce4b Allow PackedType to be constructed with an abstract type.
llvm-svn: 34152
2007-02-10 19:03:01 +00:00
Reid Spencer
66bb33845e Compaction tables don't exist any more.
llvm-svn: 34148
2007-02-10 14:07:56 +00:00
Reid Spencer
d5427f5249 For PR1194:
The bcreader counts on "primitive" types being inserted before they are
referenced in other types. With recent changes to the bcwriter, this fact
became exposed since IntegerType is no longer "primitive". We can no longer
count on all IntegerTypes being inserted early. This patch modifies
getOrCreateTypeSlot to insert any sub-type that can't possibly recurse
before we create the slot for the type. This has the benefit of reducing
the number of OpaqueType objects the reader needs to deal with.

llvm-svn: 34147
2007-02-10 14:04:08 +00:00
Reid Spencer
42791fc876 Fix a comment.
llvm-svn: 34146
2007-02-10 11:59:10 +00:00
Chris Lattner
a7ed569db1 convert some vectors to smallvector.
llvm-svn: 34145
2007-02-10 08:33:11 +00:00
Chris Lattner
8eb2002881 speed up the verifier 8.5% by using a smallvector instead of vector.
llvm-svn: 34144
2007-02-10 08:30:29 +00:00
Chris Lattner
a0792c722e Change an std::set to a SmallPtrSet. This speeds up the verifier on
447.dealII from 1.27s to 0.86s.

llvm-svn: 34143
2007-02-10 08:19:44 +00:00
Chris Lattner
02141c9762 Change the table datastructure to be a vector<smallvector>, instead of
vector<vector> to avoid allocations.  This speeds up bcwriting of 447.dealII
from 0.8276 to 0.7637s (8.4%).

This concludes this round of proding the bcwriter into submission.  Final
speedup from 24.4s to 0.7637s (32x).

llvm-svn: 34142
2007-02-10 07:42:59 +00:00
Chris Lattner
6301eb8919 Make BytecodeWriter::outputValueSymbolTable *significantly* less abusive
of memory, through a combination of DenseMap and SmallVector.  This speeds
up bcwriter on 447.dealII from 1.31s to 0.82s (60% faster).

llvm-svn: 34141
2007-02-10 07:31:44 +00:00
Chris Lattner
c2542fe089 make the datastructure used in BytecodeWriter::outputValueSymbolTable
*slightly* less abusive of memory.  This speeds up the bcwriter from
1.83s to 1.32s (39% faster) on 447.dealII.

llvm-svn: 34140
2007-02-10 07:11:51 +00:00
Chris Lattner
5397f397fe Switch typemap over to DenseMap. No significant speedup.
llvm-svn: 34139
2007-02-10 07:06:46 +00:00
Chris Lattner
1b93c3207e Switch NodeMap from an std::map to a DenseMap. This speeds up bcwriting
of 447.dealII from 3.3s to 1.8s (80% faster).

llvm-svn: 34138
2007-02-10 07:01:05 +00:00
Chris Lattner
279770b88d use typedefs where appropriate
llvm-svn: 34136
2007-02-10 06:42:23 +00:00
Chris Lattner
98373d22fb The ModuleLevel vector is often quite sparse. Switch it to a DenseMap. This
speeds up bcwriting of 447.dealII by 40%, from 4.63s to 3.32s.

llvm-svn: 34135
2007-02-10 06:38:19 +00:00
Chris Lattner
dc8f129004 Make the ModuleLevel datastructure more sane. When a function-local value
is inserted into the table, it remembers that the value needs to be popped
off.  This makes purgeFunction much faster, speeding up bcwriting of 447.dealII
from 6.8->4.6s (47%).

llvm-svn: 34133
2007-02-10 06:09:41 +00:00
Chris Lattner
d043d112d0 Only compute the module levels info once per module, instead of once
per function.  This speeds up bcwriting on 447.dealII from 10.16s to 6.81s
(49%).

llvm-svn: 34132
2007-02-10 05:54:33 +00:00
Chris Lattner
b005a435cd Clone and specialize CreateSlotIfNeeded into CreateFunctionValueSlot to handle
function-local values.  This speeds up bcwriting a small 2.2% (10.384->10.156s
on 447.dealII), but paves the way for more important changes.

llvm-svn: 34131
2007-02-10 05:45:09 +00:00
Chris Lattner
31d8a25842 make getSlot/getTypeSlot inline
llvm-svn: 34130
2007-02-10 05:18:35 +00:00
Chris Lattner
cbbfa88ced getTypeSlot can never fail
llvm-svn: 34129
2007-02-10 05:17:48 +00:00
Chris Lattner
78926ecd8e getSlot can never fail. Make it assert internally, eliminate checks in
clients.  Same for getTypeSlot.

llvm-svn: 34128
2007-02-10 05:13:03 +00:00
Chris Lattner
83352c4de3 simplify getOrCreateTypeSlot, eliminat doInsertType. Eliminate post-order iteration stuff.
llvm-svn: 34127
2007-02-10 05:02:50 +00:00
Chris Lattner
e6d3af76f8 simplify and speed up recursive type processing.
llvm-svn: 34126
2007-02-10 04:57:36 +00:00
Chris Lattner
b4d5d53916 rename getOrCreateSlot -> CreateSlotIfNeeded. Noone cares about the retval
llvm-svn: 34125
2007-02-10 04:54:01 +00:00
Chris Lattner
2965283d9f refactor callers of insertType. inline insertType into its one remaining caller.
llvm-svn: 34124
2007-02-10 04:51:21 +00:00
Chris Lattner
fea071b3c8 simplify code.
llvm-svn: 34123
2007-02-10 04:47:51 +00:00
Chris Lattner
8e07ddf937 simplify some logic, reduce nesting
llvm-svn: 34122
2007-02-10 04:42:30 +00:00
Chris Lattner
7301538f7e Remove dead ctor
llvm-svn: 34121
2007-02-10 04:38:34 +00:00
Chris Lattner
01a1b6aff1 ModuleContainsAllFunctionConstants is always true
llvm-svn: 34120
2007-02-10 04:36:10 +00:00
Chris Lattner
beafca02d1 only one client of getOrCreateSlot can pass a void typed value. Check type
there.

llvm-svn: 34119
2007-02-10 04:31:52 +00:00
Chris Lattner
2e462f53e4 inline hasNullValue, rename some variables, simplify some code.
llvm-svn: 34118
2007-02-10 04:29:03 +00:00
Chris Lattner
49365fa142 merge insertValue into its single caller, eliminate some redundant checks.
llvm-svn: 34117
2007-02-10 04:25:02 +00:00
Chris Lattner
fc3dd4e7a6 merge doInsertValue into insertValue
llvm-svn: 34116
2007-02-10 04:22:30 +00:00
Chris Lattner
ce0ce46355 insertvalue's second operand is always false
llvm-svn: 34115
2007-02-10 04:19:31 +00:00
Chris Lattner
639d8b9636 remove dead 'dontIgnore' flag for insertType
llvm-svn: 34114
2007-02-10 04:17:41 +00:00
Chris Lattner
7141ac8812 rename getSlot -> getSlotType and getOrCreateSlot ->getOrCreateTypeSlot
for types.

llvm-svn: 34113
2007-02-10 04:15:40 +00:00
Evan Cheng
a86214b294 Add function live-ins to entry block live-in set.
llvm-svn: 34112
2007-02-10 02:43:39 +00:00
Evan Cheng
6dc088ffd4 Add live-ins to MachineBasicBlock.
llvm-svn: 34111
2007-02-10 02:38:19 +00:00
Evan Cheng
14f837357e Rename some variables to avoid confusion with SelectionDAGISel::BB.
llvm-svn: 34110
2007-02-10 01:08:18 +00:00
Evan Cheng
af3b119b29 These vectors are frequently large. Use std::vector instead.
llvm-svn: 34109
2007-02-09 23:59:14 +00:00
Chris Lattner
27cff151e2 Fix clients like this:
delete ParseBytecodeFile(InputFilename, 0, &ErrorMessage);
  llvm_shutdown();
  delete ParseBytecodeFile(InputFilename, 0, &ErrorMessage);

The primitive type objects failed to ressurect themselves after shutdown, leading
to crashes in clients that used them after llvm_shutdown().

This solution isn't wonderful, because we clearly have static ctors.  However,
the code it replaces was just as bad, so it's not a regression.

llvm-svn: 34106
2007-02-09 22:24:04 +00:00
Evan Cheng
5e8eb0c198 Add reference counting to constantpool entries. Delete the unused ones.
llvm-svn: 34105
2007-02-09 20:54:44 +00:00
Reid Spencer
b1e839a4d3 Use int32_t and uint32_t to hopefully help weak compilers (cygwin) not
generate errors about being unable to resolve overloaded type.

llvm-svn: 34103
2007-02-09 18:03:35 +00:00
Chris Lattner
31e202922a add a note
llvm-svn: 34101
2007-02-09 17:38:01 +00:00
Reid Spencer
6d293c2160 Make SlotCalculator::getPlane an inline function. It is used inside loops.
llvm-svn: 34091
2007-02-09 15:25:50 +00:00
Chris Lattner
672e5475d1 remove unneeded #includes
llvm-svn: 34086
2007-02-09 07:54:13 +00:00
Chris Lattner
096b7f662b remove dead code, the outputConstants function is now only called at module scope.
llvm-svn: 34085
2007-02-09 07:53:20 +00:00
Chris Lattner
5796c232a4 1. constants can never occur in the symbol table.
2. All function-level constants are now incorporated into the module-level
  constant pool, since the compaction table was removed.  Eliminate extra
  work to check for them.

This speeds up the bcwriter from 24.4s to 13.1s on 447.dealII and .73 -> .56s
on kc++ in a release build.

llvm-svn: 34084
2007-02-09 07:51:47 +00:00
Zhou Sheng
20d0f4e319 Eliminates friend function declaration inside APInt, instead, adds public
methods as those global function's internal implementation.

llvm-svn: 34083
2007-02-09 07:48:24 +00:00
Nate Begeman
e7902cc8ba Remove fixed item
llvm-svn: 34081
2007-02-09 04:19:54 +00:00
Evan Cheng
400120abe5 This is done.
llvm-svn: 34072
2007-02-08 23:53:38 +00:00
Evan Cheng
14f4a6715d Make use of TLI.SimplifySetCC() in LegalizeSetCCOperands().
llvm-svn: 34066
2007-02-08 22:16:19 +00:00
Evan Cheng
1b155ac243 Move SimplifySetCC to TargetLowering and allow it to be shared with legalizer.
llvm-svn: 34065
2007-02-08 22:13:59 +00:00
Chris Lattner
d16cc5ebcb Rename CStringMap -> StringMap, since it now supports nul characters in the
strings.

llvm-svn: 34064
2007-02-08 19:20:57 +00:00
Chris Lattner
3705cf294c Allow cstringmap to contain strings with nul characters in them.
llvm-svn: 34062
2007-02-08 19:08:37 +00:00
Andrew Lenharth
fc510fe358 return addresses, those I already have
llvm-svn: 34056
2007-02-08 17:37:41 +00:00
Zhou Sheng
a6babf6288 Switched this file on accidently.
llvm-svn: 34054
2007-02-08 16:45:48 +00:00
Zhou Sheng
6efcdc8049 As Chris and Reid suggested, remove "isSigned" field from APInt, instead,
add some signed/unsigned arithmetic operation functions into APInt.h to
handle the signed/unsigned issue. These functions will be defined inside a
namespace "APIntOps" which is inside llvm namespace.

llvm-svn: 34053
2007-02-08 14:35:19 +00:00
Bill Wendling
4b33b03487 Fixed comments.
llvm-svn: 34040
2007-02-08 06:05:08 +00:00
Evan Cheng
96b886b846 Fixed a long standing spiller bug that's exposed by Thumb:
The code sequence before the spiller is something like:
                 = tMOVrr
        %reg1117 = tMOVrr
        %reg1078 = tLSLri %reg1117, 2

The it starts spilling:
        %r0 = tRestore <fi#5>, 0
        %r1 = tRestore <fi#7>, 0
        %r1 = tMOVrr %r1<kill>
        tSpill %r1, <fi#5>, 0
        %reg1078 = tLSLri %reg1117, 2

It restores the value while processing the first tMOVrr. At this point, the
spiller remembers fi#5 is available in %r0. Next it processes the second move.
It restores the source before the move and spills the result afterwards. The
move becomes a noop and is deleted. However, a spill has been inserted and that
should invalidate reuse of %r0 for fi#5 and add reuse of %r1 for fi#5.
Therefore, %reg1117 (which is also assigned fi#5) should get %r1, not %r0.

llvm-svn: 34039
2007-02-08 06:04:54 +00:00
Bill Wendling
289ab30051 Moved the MachOWriter and ELFWriter out of the Target/* files. Placed the
definition of it into the CodeGen library. This is so that a backend doesn't
necessarily add in these writers if it doesn't use them (like in the lli
program).

llvm-svn: 34034
2007-02-08 01:39:44 +00:00
Bill Wendling
1620ef9a95 Added new method to add a "simple" code emitter. That is, to only add
the code emitter and not set variables.

llvm-svn: 34033
2007-02-08 01:38:33 +00:00
Bill Wendling
ccf772cc6b Split the addPassesToEmitFile method up into two. This is so that we can
do some common stuff, then on our own add an object file writer (by calling
a concrete function), and then do some finishing stuff, if need be.

llvm-svn: 34032
2007-02-08 01:36:53 +00:00
Bill Wendling
55a2facbf9 Add function to create a file writer.
llvm-svn: 34031
2007-02-08 01:35:27 +00:00
Bill Wendling
abb65b1d4d Dead files. Functionality has been taken over by the Add*Writer functions.
llvm-svn: 34029
2007-02-08 01:32:51 +00:00
Bill Wendling
48653bfaa4 Moved from include/llvm/CodeGen to lib/CodeGen.
llvm-svn: 34027
2007-02-08 01:30:50 +00:00
Reid Spencer
6e19d7114f For PR1188:
Compute BitMask correctly.

Patch by Leo (wenwenti@hotmail.com).

llvm-svn: 34026
2007-02-08 00:29:31 +00:00
Chris Lattner
3cac8eac4e move archive-specific stuff out of bcreader into archive library.
llvm-svn: 34022
2007-02-07 23:53:17 +00:00
Chris Lattner
1c17d65878 move an llvmc-specific function out of the bcreader into llvmc.
llvm-svn: 34021
2007-02-07 23:48:32 +00:00
Chris Lattner
c5f3b3b01b move AnalyzeBytecodeFile out of ReaderWrappers.cpp into Analyzer.cpp. Now
lli doesn't link in Analyzer.cpp.

llvm-svn: 34020
2007-02-07 23:46:55 +00:00
Evan Cheng
dc15bc54a4 isLowRegister() expects input is a physical register.
llvm-svn: 34013
2007-02-07 21:44:33 +00:00
Chris Lattner
43d0b955a3 push bytecode decompressor out through APIs. Now the bytecode reader
api's look like this:

ModuleProvider *getBytecodeModuleProvider(
  const std::string &Filename,  ///< Name of file to be read
  BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
  std::string* ErrMsg = 0,      ///< Optional error message holder
  BytecodeHandler* H = 0        ///< Optional handler for reader events
);

This is ugly, but allows a client to say:

  getBytecodeModuleProvider("foo", 0);

If they do this, there is no dependency on the compression libraries, saving
codesize.

llvm-svn: 34012
2007-02-07 21:41:02 +00:00
Evan Cheng
03ffd4a6d5 Rename.
llvm-svn: 34011
2007-02-07 21:24:09 +00:00
Evan Cheng
2bbe03a4df If sp offset will be materialized in a register. Clear the offset field of str / ldr.
llvm-svn: 34010
2007-02-07 21:19:58 +00:00
Evan Cheng
fe7242e9bb Get rid of references to iostream.
llvm-svn: 34009
2007-02-07 21:18:32 +00:00
Jim Laskey
c27aed3dc0 Automatically generating intrinsic declarations from Dan Gohman. Modified
to construct FunctionType in separate function, and, have getDeclaration
return a Function instead of a Constant.

llvm-svn: 34008
2007-02-07 20:38:26 +00:00
Chris Lattner
ad6f4d102f Move compressor out of the core Reader.cpp file.
llvm-svn: 34007
2007-02-07 19:49:01 +00:00
Devang Patel
a667307d74 Do not drop transferred last uses on the floor.
Use handleLastUserOverflow().

llvm-svn: 34006
2007-02-07 19:37:53 +00:00
Chris Lattner
12663c4a66 Fix Transforms/DeadArgElim/2007-02-07-FuncRename.ll, fallout from PR411.
This happened because deadargelim now causes VMCore to auto-rename every
function that it hacks arguments out of.  Because it hacks arguments out of
functions in a non-deterministic order, this caused the resultant numbering
to be nondet.  The fix is to just be careful to not rename functions!

llvm-svn: 34005
2007-02-07 19:31:33 +00:00
Evan Cheng
808cf2b6a1 New entry.
llvm-svn: 34000
2007-02-07 09:22:15 +00:00
Evan Cheng
d5921e8a32 In thumb mode, R3 is reserved, but it can be live in to the function. If
that is the case, whenever we use it as a scratch register, save it to R12
first and then restore it after the use.
This is a temporary and truly horrible workaround!

llvm-svn: 33999
2007-02-07 09:17:36 +00:00
Evan Cheng
8f5c613d03 Update
llvm-svn: 33998
2007-02-07 08:37:57 +00:00
Evan Cheng
efeb81a8c4 - If fp (r7) is used to reference stack objects, use [r, r] address mode.
- If there is a dynamic alloca, in the epilogue, restore the value of sp
  using r7 - offset.
- Other bug fixes.

llvm-svn: 33997
2007-02-07 08:37:31 +00:00
Chris Lattner
c363dcf19e remove dead ivars, thanks to Reid for noticing this!
llvm-svn: 33995
2007-02-07 07:19:19 +00:00
Chris Lattner
36c2f9ea6d remove the handleVBR32/handleVBR64 callbacks. They are very fine-grained.
llvm-svn: 33994
2007-02-07 06:53:02 +00:00
Chris Lattner
940f9c8549 constants can't be in the symtab anymore
llvm-svn: 33993
2007-02-07 06:28:48 +00:00
Chris Lattner
3cbaee07ce update comment.
llvm-svn: 33992
2007-02-07 06:25:36 +00:00
Chris Lattner
22fc4be632 shrink vmcore by moving symbol table stripping support out of VMCore into
the one IPO pass that uses it.

llvm-svn: 33990
2007-02-07 06:22:45 +00:00
Zhou Sheng
9495a1a5c7 As Chris suggested, fixed some problems. (This is the first part)
llvm-svn: 33989
2007-02-07 06:14:53 +00:00
Chris Lattner
a1455127ae eliminate ValueSymbolTable::rename, it has no advantage over using remove+insert.
Make insert/remove assert if used incorrectly instead of returning a bool.

llvm-svn: 33988
2007-02-07 06:13:49 +00:00
Chris Lattner
c46811575d speed up conflict handling.
llvm-svn: 33985
2007-02-07 05:52:51 +00:00
Nate Begeman
fe7a46c1e1 Fix a fixme by correctly calculating preferred alignments for functions,
based on the alignment of the symbol and the target data's preferred align
for that type.

Also, rename some arguments for consistency.

llvm-svn: 33984
2007-02-07 05:47:16 +00:00
Chris Lattner
bdde131dac Eliminate the O(n) version of TypeSymbolTable::remove, it is dead. When
inserting a type into the type symbol table, only compute unique name if not
in symtab already.

llvm-svn: 33983
2007-02-07 05:35:58 +00:00
Chris Lattner
bf91625f67 TypeSymbolTable::rename is dead, remove it
llvm-svn: 33982
2007-02-07 05:29:34 +00:00
Chris Lattner
d69c837c73 Eliminate a bunch of work from ValueSymbolTable::insert for the common case
where a symbol name doesn't conflict.  This speeds up bc reading 16% on 176.gcc!

llvm-svn: 33981
2007-02-07 05:22:49 +00:00
Chris Lattner
e4fd0b7514 parse constantexpr arguments into a smallvector: 1.5% speedup reading 176.gcc
llvm-svn: 33980
2007-02-07 05:15:28 +00:00
Chris Lattner
cc1fbc16fa Eliminate std::vectors from the bcanalyzer interface.
llvm-svn: 33978
2007-02-07 05:08:39 +00:00
Evan Cheng
b6cdeca59d eliminateFrameIndex() is even more complicated if frame ptr is used instead of SP when there are dynamic alloca's.
llvm-svn: 33975
2007-02-07 02:44:23 +00:00
Chris Lattner
474d7b219d redesign the primary datastructure used by mem2reg to eliminate an
std::map of std::vector's (ouch!).  This speeds up mem2reg by 10% on 176.gcc.

llvm-svn: 33974
2007-02-07 01:15:04 +00:00
Chris Lattner
2c3df2a958 do not let the table fill up with tombstones.
llvm-svn: 33973
2007-02-07 01:11:25 +00:00
Evan Cheng
60bde0ebb1 Spill / restore should avoid modifying the condition register.
llvm-svn: 33971
2007-02-07 00:06:56 +00:00
Chris Lattner
c0fcd78ca0 Two fixes:
1. Memset takes an i32 for the value to set, not i8.  This was causing GCC to
   ICE all over the place (PR1183).
2. memcpy/memmove were not properly zext/trunc'ing the size in some cases.

llvm-svn: 33970
2007-02-06 19:06:38 +00:00
Jim Laskey
7d5ddeb668 Support var arg intrinsics.
llvm-svn: 33962
2007-02-06 18:02:54 +00:00
Evan Cheng
b3ff5f65d4 Select add FI, c correctly.
llvm-svn: 33960
2007-02-06 09:11:20 +00:00
Evan Cheng
1f1a01403a foldMemoryOperand() cannot fold tMOVrr sp into load / store in thumb mode. tLDRspi / tSTRspi cannot target / store high registers.
llvm-svn: 33958
2007-02-06 06:13:29 +00:00
Chris Lattner
fc117b2338 Fix PR1181 and CodeGen/CBackend/2007-02-05-memset.ll
llvm-svn: 33957
2007-02-06 06:07:51 +00:00
Zhou Sheng
cdcd2d0201 As Reid suggested, fixed some problems.
llvm-svn: 33955
2007-02-06 06:04:53 +00:00
Chris Lattner
5a58c58552 Disable this for now.
llvm-svn: 33953
2007-02-06 05:38:37 +00:00
Zhou Sheng
677cc21b01 Add a class APInt to represent arbitrary precision constant integral values.
It is a functional replacement for common case integer type like "unsigned",
"uint64_t", but also allows non-byte-width integer type and large integer
value types such as 3-bits, 15-bits, or more than 64-bits of precision. For
more details, see pr1043.

llvm-svn: 33951
2007-02-06 03:00:16 +00:00
Chris Lattner
83e39edf72 Fix Transforms/ConstProp/2007-02-05-BitCast.ll
llvm-svn: 33948
2007-02-06 02:22:56 +00:00
Chris Lattner
775422640b Oops, swap this. This fixes a regression I introduced in the ARM backend.
llvm-svn: 33946
2007-02-06 01:56:31 +00:00
Evan Cheng
119b5e3558 eliminateFrameIndex() bug when frame pointer is used as base register.
llvm-svn: 33945
2007-02-06 00:23:31 +00:00
Evan Cheng
c4ba711e91 - Store val, [sp, c] must be selected to tSTRsp.
- If c does not fit in the offset field, materialize sp + c into a register
  using tADDhirr.

llvm-svn: 33944
2007-02-06 00:22:06 +00:00
Reid Spencer
4881e131eb Although targets are not required to support integers > 64bits, TargetData
must in order for backends that do want to support large integer types to be
able to function. Consequently, don't assert if the bitwidth > 64 bits
when computing the size and alignment. Instead, compute the size by rounding
up to the next even number of bytes for the size. Compute the alignment
as the same as the LongABIAlignment. These provide reasonable defaults
that the target can override.

llvm-svn: 33943
2007-02-05 23:51:43 +00:00
Reid Spencer
6da19310e3 A value of 64 or fewer bits is valid if the ConstantInt has more then 64 bits.
llvm-svn: 33942
2007-02-05 23:47:56 +00:00
Reid Spencer
598f6d293b Make classes in anonymous namespaces use VISIBILITY_HIDDEN to help reduce
LLVM's footprint and speed up linking.

llvm-svn: 33941
2007-02-05 23:42:17 +00:00
Chris Lattner
5fee493a8c With the last change, we no longer need both directions of mapping from
BBNumbers.  Instead of using a bi-directional mapping, just use a single
densemap.  This speeds up mem2reg on 176.gcc by 8%, from  1.3489 to
1.2485s.

llvm-svn: 33940
2007-02-05 23:37:20 +00:00
Reid Spencer
8749d297f5 Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.

llvm-svn: 33939
2007-02-05 23:32:05 +00:00
Chris Lattner
7703e811eb Simplify use of DFBlocks, this makes no noticable performance difference,
but paves the way to eliminate BBNumbers.

llvm-svn: 33938
2007-02-05 23:31:26 +00:00
Reid Spencer
b509040034 This file should have been removed when -raise was removed. It isn't
used any more.

llvm-svn: 33937
2007-02-05 23:27:02 +00:00
Chris Lattner
c7487c93da Switch InsertedPHINodes back to SmallPtrSet now that the SmallPtrSet::erase
bug is fixed.

llvm-svn: 33932
2007-02-05 23:11:37 +00:00
Chris Lattner
153ccbe7f9 Fix a bug in smallptrset::erase: in the small case, return true if the
element was in the set.

llvm-svn: 33931
2007-02-05 23:10:31 +00:00
Chris Lattner
0ae77ee391 switch a SmallPtrSet back to an std::set for now, this caused problems.
llvm-svn: 33930
2007-02-05 22:28:52 +00:00
Chris Lattner
9a99e6ee24 switch an std::set over to a SmallPtrSet, speeding up mem2reg 6% on 176.gcc.
llvm-svn: 33929
2007-02-05 22:15:21 +00:00
Chris Lattner
19e7a5695d switch an std::set over to SmallPtrSet, speeding up mem2reg 3.4% on 176.gcc.
llvm-svn: 33928
2007-02-05 22:13:11 +00:00
Chris Lattner
5d5bf2ed87 eliminate some malloc traffic, this speeds up mem2reg by 3.4%.
llvm-svn: 33927
2007-02-05 21:58:48 +00:00
Reid Spencer
eaf3451a3b Add missing and needed #include.
llvm-svn: 33926
2007-02-05 21:47:39 +00:00
Reid Spencer
d6dc4cc8e9 Make the class VISIBILITY_HIDDEN.
Reduce lexical size of the anonymous namespace.

llvm-svn: 33925
2007-02-05 21:45:12 +00:00
Chris Lattner
b9788ffe38 Fix PR1178
llvm-svn: 33924
2007-02-05 21:23:52 +00:00
Reid Spencer
83803ddedb For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)

llvm-svn: 33922
2007-02-05 21:19:13 +00:00
Reid Spencer
6af21b3029 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.

llvm-svn: 33918
2007-02-05 20:47:22 +00:00
Reid Spencer
d8c5428a48 For PR411:
This pass is no longer needed.

llvm-svn: 33917
2007-02-05 20:41:05 +00:00
Reid Spencer
4885d68272 Create a pass to strip dead function declarations (prototypes). This is
for use by llvm-extract and bugpoint.

llvm-svn: 33916
2007-02-05 20:24:25 +00:00
Devang Patel
a2287f3205 Fix PR1158
Do not insert Analysis pass, if it is already available.

llvm-svn: 33915
2007-02-05 19:34:17 +00:00
Reid Spencer
aabb0ec479 Regenerate.
llvm-svn: 33912
2007-02-05 17:04:00 +00:00
Reid Spencer
c48637fa58 ! removal was a little over zealous. Put the ! back in asserts.
llvm-svn: 33911
2007-02-05 17:01:20 +00:00
Reid Spencer
28005c25b4 Regenerate.
llvm-svn: 33909
2007-02-05 10:18:06 +00:00
Reid Spencer
1479edf229 There is nothing exclamatory about an error message. No other compiler
or assembler uses ! at the end of every message. We shouldn't either.

llvm-svn: 33907
2007-02-05 10:16:10 +00:00
Chris Lattner
1441407576 Fix miscompilations of consumer-typeset, telecomm-gsm, and 176.gcc.
llvm-svn: 33902
2007-02-05 05:57:49 +00:00
Reid Spencer
21f40213a8 For PR1177:
Revert last patch which caused iteration invalidation.

llvm-svn: 33901
2007-02-05 05:23:32 +00:00
Chris Lattner
4402e15b4b fix a miscompilation of 176.gcc
llvm-svn: 33900
2007-02-05 04:09:35 +00:00
Owen Anderson
0fbb2d629f Use DenseMap for pointer->pointer maps.
llvm-svn: 33897
2007-02-05 02:39:47 +00:00
Chris Lattner
49be595b1f rewrite shift/shift folding, now that types are not signed.
llvm-svn: 33892
2007-02-05 00:57:54 +00:00
Nick Lewycky
7439ef2aba Fix indenting, remove tabs.
Learn from sext and zext. The destination value falls within the range of the
source type.

Generalize properties regarding constant ints.

Get smarter about marking blocks as unreachable. If 1 >= 2 in order for this
block to execute, then it isn't reachable.

llvm-svn: 33889
2007-02-04 23:43:05 +00:00
Anton Korobeynikov
a4e7de7c93 Fixing silly "not-implemented" bug in AsmPrinter. This fixes PR1169.
llvm-svn: 33888
2007-02-04 23:27:42 +00:00
Chris Lattner
3e01807e87 Fix a miscompilation in the addr mode code trying to implement X | C and
X + C to promote LEA formation.  We would incorrectly apply it in some cases
(test) and miss it in others.

This fixes CodeGen/X86/2007-02-04-OrAddrMode.ll

llvm-svn: 33884
2007-02-04 20:18:17 +00:00
Chris Lattner
15fb4ef992 switch the VRBaseMap in the scheduler from an std::map to a DenseMap. This
speeds up the isel pass from 2.5570s to 2.4722s on kc++ (3.4%).

llvm-svn: 33879
2007-02-04 08:47:20 +00:00
Chris Lattner
59d7c680b5 Introduce new UnarySDNode/BinarySDNode/TernarySDNode nodes, which coallocate
their operands with the node itself.  This reduces malloc traffic for operand
lists.  This reduces isel time on kc++ from 2.6164 to 2.5570s, about 2.3%.

llvm-svn: 33878
2007-02-04 08:35:21 +00:00
Chris Lattner
dcdf1edd93 eliminate the SDNode::setValueTypes method.
llvm-svn: 33876
2007-02-04 07:37:24 +00:00
Chris Lattner
2b6734a983 eliminate a bunch of duplicate ctors and helper functions.
llvm-svn: 33875
2007-02-04 07:28:00 +00:00
Reid Spencer
e86b73d7ce Fix some comments and other minor sundry things.
llvm-svn: 33873
2007-02-04 04:43:17 +00:00
Reid Spencer
0759b38041 Ensure that visibility and section are properly propagated.
llvm-svn: 33872
2007-02-04 04:30:33 +00:00
Reid Spencer
080fc7bf3f Back out last revision which was committed by accident.
llvm-svn: 33871
2007-02-04 04:29:21 +00:00
Reid Spencer
8fa4e4be1f Make sure that section and visibility are properly propagated.
llvm-svn: 33870
2007-02-04 04:28:18 +00:00
Chris Lattner
8bbd45cd6e move MorphNode to out of line and merge setNodeOperands into it. There is
no behavior or performance change here.

llvm-svn: 33869
2007-02-04 02:49:29 +00:00
Chris Lattner
ccd1f36346 simplify MorphNodeTo to take a VTList operand.
llvm-svn: 33868
2007-02-04 02:41:42 +00:00
Chris Lattner
7e8b8e7a68 eliminate some extraneous methods in SDNode
llvm-svn: 33867
2007-02-04 02:32:44 +00:00
Chris Lattner
f3b4a0cc95 Give each selectiondag node class a home for it's vtable and rtti info
llvm-svn: 33866
2007-02-04 02:23:32 +00:00
Chris Lattner
8b8100ecf5 Encode small integers more densely in foldingset, avoiding overflowing the SmallVector as often.
llvm-svn: 33864
2007-02-04 01:48:10 +00:00
Chris Lattner
1d3dd991ca Switch VAlueMap from std::map to DenseMap.
llvm-svn: 33863
2007-02-04 01:35:11 +00:00
Chris Lattner
e5eccb6d76 Switch NodeMap from std::map to DenseMap, this speeds up isel by 2.3%
llvm-svn: 33862
2007-02-04 01:31:47 +00:00
Chris Lattner
4ca925808f swtich vector-> smallvector, speeding up selectiondag stuff 1%
llvm-svn: 33861
2007-02-04 01:20:02 +00:00
Chris Lattner
135ccecbfb Switch promoted/expanded ops over to using a DenseMap. Vector related maps
aren't worth it.

llvm-svn: 33860
2007-02-04 01:17:38 +00:00
Chris Lattner
703db6bfd8 switch LegalizedNodes from std::map to a DenseMap. This speeds up isel
time as a whole on kc++ by 11%.

llvm-svn: 33857
2007-02-04 00:50:02 +00:00
Reid Spencer
310b497b59 For PR1163:
Make the Module's dependent library use a std::vector instead of SetVector
adjust #includes in .cpp files because SetVector.h is no longer included.

llvm-svn: 33855
2007-02-04 00:40:42 +00:00
Chris Lattner
3ff6e94719 Eliminate some malloc traffic from LegalizeAllNodesNotLeadingTo, speeding
up isel on kimwitu by 0.7%.

llvm-svn: 33853
2007-02-04 00:27:56 +00:00
Chris Lattner
6af2a892de Eliminate some std::sets. This speeds up isel of kimwitu by about 0.9%
llvm-svn: 33852
2007-02-04 00:24:41 +00:00
Chris Lattner
ff53aecb1a Switch SelectionDAG::ReplaceAllUsesOfValueWith to use a SmallSetVector for
the users set (most nodes have 1 or 2 users).  This speeds up the isel pass
3.2% on kimwitu.

llvm-svn: 33849
2007-02-04 00:14:31 +00:00
Chris Lattner
471e586dd4 remove some dead code
llvm-svn: 33845
2007-02-03 23:28:07 +00:00
Reid Spencer
45d9d72ac0 For PR1072:
Removing -raise has neglible positive or negative side effects so we are
opting to remove it. See the PR for comparison details.

llvm-svn: 33844
2007-02-03 23:15:56 +00:00
Evan Cheng
bf4ca3b491 ARM callseq_end should have a input flag operand so it would be scheduled right after the call.
llvm-svn: 33832
2007-02-03 09:11:58 +00:00
Evan Cheng
ece3d334c2 Fix comments.
llvm-svn: 33831
2007-02-03 08:53:01 +00:00
Bill Wendling
4423d49d94 Moved the GetTargetRelocation method from PPCMachOWriter to here. It uses
non-Mach-O-specific information.

llvm-svn: 33819
2007-02-03 02:41:58 +00:00
Bill Wendling
2831f1ae0d Moved the GetTargetRelocation method to the PPCMachOWriterInfo object. The
PPCMachOWriter is now trivial.

llvm-svn: 33818
2007-02-03 02:40:57 +00:00
Bill Wendling
ed60103206 Put destructor out-of-line.
llvm-svn: 33817
2007-02-03 02:40:10 +00:00
Bill Wendling
2a34ef4219 Pass in non-Mach-O-specific parameters to the GetTargetRelocation method.
llvm-svn: 33816
2007-02-03 02:39:40 +00:00
Evan Cheng
b4c6dfa3e7 - Branch max. displacement calculation bug.
- Add debugging info.

llvm-svn: 33811
2007-02-03 02:08:34 +00:00
Chris Lattner
b35593a1c5 switch the sched unit map over to use a DenseMap instead of std::map. This
speeds up isel as a whole time by 2.6%.

llvm-svn: 33810
2007-02-03 01:34:13 +00:00
Chris Lattner
f1b9b2068c Switch ComputeTopDownOrdering over to using a densemap. This speeds up
isel as a whole by 3.3%.

llvm-svn: 33809
2007-02-03 01:12:36 +00:00
Evan Cheng
99236f5cfe Pasto
llvm-svn: 33806
2007-02-03 00:43:46 +00:00
Chris Lattner
71fe09f397 Switch inliner over to use DenseMap instead of std::map for ValueMap. This
speeds up the inliner 16%.

llvm-svn: 33801
2007-02-03 00:08:31 +00:00
Lauro Ramos Venancio
1b8a04e036 bugfix: SP isn't resetted when function has FP and there is no spills.
llvm-svn: 33800
2007-02-02 23:08:40 +00:00
Chris Lattner
d3fb549bdc Switch this back to using an std::map. DenseMap entries are getting invalidated
llvm-svn: 33799
2007-02-02 22:36:16 +00:00
Chris Lattner
3ae99a1181 Remove more malloc thrashing, this speeds up IPSCCP on kimwitu another 6.7%.
llvm-svn: 33796
2007-02-02 21:15:06 +00:00
Evan Cheng
d308af8c1f Another thumb large stack offset codegen bug.
llvm-svn: 33795
2007-02-02 21:08:39 +00:00
Chris Lattner
dec49cea56 Convert an std::set to SmallSet, this speeds up IPSCCP 17% on kimwitu.
llvm-svn: 33794
2007-02-02 20:57:39 +00:00
Chris Lattner
e9c0bac4c5 eliminate a malloc/free for (almost) every GEP processed. This speeds up
IPSCCP 3.3% on kimwitu.

llvm-svn: 33793
2007-02-02 20:51:48 +00:00
Chris Lattner
449f7d0d63 switch hash_map's over to DenseMap in SCCP. This speeds up SCCP by 30% in
a release-assert build on kimwitu++.

llvm-svn: 33792
2007-02-02 20:38:30 +00:00
Evan Cheng
496c67ee3e Use MBB.empty() instead of MBB.size() for speed.
llvm-svn: 33789
2007-02-02 19:09:19 +00:00
Evan Cheng
6a428320d6 Watch out for empty BB.
llvm-svn: 33788
2007-02-02 18:49:02 +00:00
Reid Spencer
bbb8dc1b9f Remove dead code and fix indentation per Chris' review comments.
llvm-svn: 33785
2007-02-02 14:41:37 +00:00
Reid Spencer
05c293d1f0 Use short form of BinaryOperator create function.
llvm-svn: 33784
2007-02-02 14:09:34 +00:00
Reid Spencer
f5f46b0082 Use short form of binary operator create functions.
llvm-svn: 33783
2007-02-02 14:08:20 +00:00
Reid Spencer
da848a64ce Fix a comment that needed to change after SHIFT patch landed.
llvm-svn: 33781
2007-02-02 13:54:55 +00:00
Evan Cheng
e450d1bfa4 Ugh. Only meant to do this in thumb mode.
llvm-svn: 33780
2007-02-02 08:58:48 +00:00
Chris Lattner
1f032e74ae bugfix for reid's shift patch.
llvm-svn: 33779
2007-02-02 05:29:55 +00:00
Chris Lattner
63479262b4 add a note
llvm-svn: 33778
2007-02-02 04:36:46 +00:00
Reid Spencer
591bfa1e0b Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Evan Cheng
689b0a4a62 Fix a bug in getARMCMP (which translate CondCode to ARM specific CC) when the RHS is a constant.
llvm-svn: 33775
2007-02-02 01:53:26 +00:00
Evan Cheng
73975a6076 Thumb does not have clz.
llvm-svn: 33773
2007-02-01 23:34:03 +00:00
Devang Patel
e5e4a44cca Dump function names when debug-pass=Executions is used.
llvm-svn: 33772
2007-02-01 22:38:33 +00:00
Chris Lattner
2d85458c52 Fix Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll, a serious code
pessimization where instcombine can sink a load (good for code size) that
prevents an alloca from being promoted by mem2reg (bad for everything).

llvm-svn: 33771
2007-02-01 22:30:07 +00:00
Devang Patel
015a474023 Pretty print pass manager
llvm-svn: 33766
2007-02-01 22:09:37 +00:00
Devang Patel
f178d112ce cvs commit
llvm-svn: 33765
2007-02-01 22:08:25 +00:00
Lauro Ramos Venancio
5765bcd825 Define PrivateGlobalPrefix for ARM Linux. (Fix CodeGen/ARM/large_stack.ll)
llvm-svn: 33763
2007-02-01 21:43:53 +00:00
Evan Cheng
3d9b702988 Pasto. Lots of it.
llvm-svn: 33762
2007-02-01 20:44:52 +00:00
Reid Spencer
eb51781c22 Ensure that ConvertOperandToType generates a result conversion by
initializing the Res variable to 0 and asserting it is not zero after the
result should have been created.

llvm-svn: 33761
2007-02-01 19:14:51 +00:00
Chris Lattner
618f24b0ed Fix bugs in the inliner having to do with single-entry phi nodes and valuemap
updating.  These were exposed by Devang's recent passmgr changes (with
non-default passorderings) because now the inliner can be interleved with
the LCSSA pass.

llvm-svn: 33760
2007-02-01 18:48:38 +00:00
Lauro Ramos Venancio
5781691b22 Fix .thumb_func directive on linux.
llvm-svn: 33759
2007-02-01 18:25:34 +00:00
Jim Laskey
56f947d112 Slip up
llvm-svn: 33758
2007-02-01 17:48:20 +00:00
Jim Laskey
13d6220cbb Emit labels as label_n and not as debug_n
llvm-svn: 33757
2007-02-01 17:46:10 +00:00
Andrew Lenharth
95c86563cd preserve sections of globals
llvm-svn: 33756
2007-02-01 17:12:54 +00:00
Jim Laskey
52a12383a4 Support for non-landing pad exception handling.
llvm-svn: 33755
2007-02-01 16:31:34 +00:00
Evan Cheng
88b703eec4 - Off by one bugs in maximum displacement calculation / testing.
- In thumb mode, a new constpool island BB size should be 4 + 2 to
  compensate for the potential padding due to alignment requirement.

llvm-svn: 33753
2007-02-01 10:16:15 +00:00
Anton Korobeynikov
c469cbc2e7 Fixed uninitialized stuff inside LegalizeDAG. Fortunately, the only
affected part is codegen of "memove" inside x86 backend. This fixes
PR1144

llvm-svn: 33752
2007-02-01 08:39:52 +00:00
Chris Lattner
9795be05c4 improve comments, add an assertion
llvm-svn: 33750
2007-02-01 05:33:21 +00:00
Chris Lattner
a24a3aaa94 rename DenseMap to IndexedMap.
llvm-svn: 33749
2007-02-01 05:32:05 +00:00
Chris Lattner
ca583c51b3 silence some warnings when assertions are disabled.
llvm-svn: 33747
2007-02-01 04:59:37 +00:00
Chris Lattner
51faab4a6f silence warning
llvm-svn: 33746
2007-02-01 04:57:00 +00:00
Chris Lattner
36dbbd2550 Fit in 80 columns
llvm-svn: 33745
2007-02-01 04:55:59 +00:00
Evan Cheng
d3dc2eefc2 .set pc relative displacement bug: label should be moved down one instruction
to just before the add r1, pc:

Before:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
LPCRELL0:
        mov r1, #PCRELV0
        add r1, pc

Now:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
        mov r1, #PCRELV0
LPCRELL0:
        add r1, pc

llvm-svn: 33744
2007-02-01 03:04:49 +00:00
Evan Cheng
eafe1f7bd9 Add a note.
llvm-svn: 33743
2007-02-01 02:46:20 +00:00
Evan Cheng
9f177f9058 Also set alignment of stack-based structs to 4 in thumb mode.
llvm-svn: 33741
2007-02-01 02:18:36 +00:00
Evan Cheng
439dcbedba Special epilogue for vararg functions. We cannot do a pop to pc because
there follows a sp increment for the va register save region. Instead issue
a separate pop to another register, increment sp, and then return:
        pop {r4, r5, r6, r7}
        pop {r3}
        add sp, #3 * 4
        bx r3

llvm-svn: 33739
2007-02-01 01:49:46 +00:00
Devang Patel
46a1a617f5 Add PrintVersionMessage() that tools can use to print version number
without exiting program.

llvm-svn: 33737
2007-02-01 01:43:37 +00:00
Chris Lattner
18483c395e Emit a better assertion message for PR1133
llvm-svn: 33736
2007-02-01 01:21:12 +00:00
Evan Cheng
9f87fca49c Pessmistically assume the .align 2 before the first constpool entry adds
two bytes padding.

llvm-svn: 33734
2007-02-01 01:09:47 +00:00
Evan Cheng
3d8d381600 Possible JT improvements.
llvm-svn: 33733
2007-02-01 01:07:48 +00:00
Chris Lattner
f4e5c29cb9 Fix CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll
llvm-svn: 33732
2007-02-01 00:39:08 +00:00
Evan Cheng
54a1324bae Don't emit unnecessary .align directive.
llvm-svn: 33729
2007-01-31 23:39:39 +00:00
Evan Cheng
765de99fac Handle an interesting corner case: the constpool_entry being reference is two
instructions away, i.e. its address is equal to PC.
        %r0 = tLDRpci <cp#0>
        bx
        CONSTPOOL_ENTRY 0 <cp#0>, 4

llvm-svn: 33728
2007-01-31 23:35:18 +00:00
Evan Cheng
082e441207 Don't want to add FramePtr to callee save spill list twice.
llvm-svn: 33727
2007-01-31 23:17:29 +00:00
Reid Spencer
a22881da40 Fix build breakage by using correct arguments to getIndexedType in the
GEP constructors.

llvm-svn: 33726
2007-01-31 22:30:26 +00:00
Evan Cheng
457d429cab Darwin ABI requires FP to point to stack slot of prev FP.
llvm-svn: 33724
2007-01-31 22:25:33 +00:00
Evan Cheng
0ce094c7a8 Add entry.
llvm-svn: 33723
2007-01-31 22:11:38 +00:00
Evan Cheng
41bee13a0e Thumb add sp, #imm requires the immediate value be multiple of 4. For now,
change preferred alignment of short, byte, bool to 4.

llvm-svn: 33722
2007-01-31 22:08:40 +00:00
Evan Cheng
476cd5c2d1 Update comment.
llvm-svn: 33721
2007-01-31 22:06:44 +00:00
Evan Cheng
8596afac45 Dead comment.
llvm-svn: 33719
2007-01-31 21:31:25 +00:00
Reid Spencer
6d6e7a072b Add some debug output.
llvm-svn: 33718
2007-01-31 21:27:38 +00:00
Evan Cheng
a08ef111bb Thumb asm syntax does not want 's' suffix for flag setting opcodes.
llvm-svn: 33717
2007-01-31 20:12:31 +00:00
Chris Lattner
bebab8c026 remove temporary vectors.
llvm-svn: 33715
2007-01-31 20:08:52 +00:00
Chris Lattner
237fa61eb7 eliminate temporary vectors
llvm-svn: 33713
2007-01-31 20:07:32 +00:00
Chris Lattner
8b052ca7d0 eliminate temporary vectors
llvm-svn: 33712
2007-01-31 19:59:55 +00:00
Evan Cheng
1df8529721 When determining whether a pc relative branch / load displacement fits in the
instruction field, adjust it for PC value (4 for thumb, 8 for arm).

llvm-svn: 33711
2007-01-31 19:57:44 +00:00
Chris Lattner
539d9c81fd eliminate a temporary vector while parsing gep's from bc files.
llvm-svn: 33710
2007-01-31 19:56:15 +00:00
Chris Lattner
084d1d8706 A relatively simple PPC optimization.
llvm-svn: 33709
2007-01-31 19:49:20 +00:00
Chris Lattner
55e5440018 implement the new GEP instruction ctors.
llvm-svn: 33708
2007-01-31 19:47:18 +00:00
Evan Cheng
f6e0e6cada Some comments.
llvm-svn: 33707
2007-01-31 18:29:27 +00:00
Evan Cheng
16edf4f9bf ConstPool island bug: watch out for cases where UserMI is the last MI of the BB.
llvm-svn: 33706
2007-01-31 18:19:07 +00:00
Chris Lattner
b32b59cd84 Revert another incorrectly applied chunk, which fixes InstCombine/vec_insert_to_shuffle.ll
llvm-svn: 33705
2007-01-31 18:09:17 +00:00
Chris Lattner
46ce2a4cca Fix a minor bug in my patch yesterday that broken ConstProp/bswap.ll
llvm-svn: 33704
2007-01-31 18:04:55 +00:00
Lauro Ramos Venancio
e22bc8635e ARM fix: Miscompilation when frame pointer can't be eliminated. Uninitialized frame pointer register is used.
llvm-svn: 33703
2007-01-31 13:12:46 +00:00
Evan Cheng
608ad034b0 Specify the right CC for comparison libcalls.
llvm-svn: 33702
2007-01-31 09:30:58 +00:00
Evan Cheng
3ec2e08a37 Allow the target to override the ISD::CondCode that's to be used to test the
result of the comparison libcall against zero.

llvm-svn: 33701
2007-01-31 09:29:11 +00:00
Evan Cheng
e5f5439313 Observe -soft-float.
llvm-svn: 33699
2007-01-31 08:40:13 +00:00
Chris Lattner
b8f4cada84 minor cleanups. Fix off-by-one in accounting the number of nodes when the
table grows.

llvm-svn: 33698
2007-01-31 06:04:41 +00:00
Chris Lattner
0deac2a51d regenerate
llvm-svn: 33696
2007-01-31 04:44:08 +00:00
Chris Lattner
b0a0d4f999 eliminate a temporary vector
llvm-svn: 33695
2007-01-31 04:43:46 +00:00
Chris Lattner
9888e0a048 elimiante a temporary vector
llvm-svn: 33694
2007-01-31 04:42:05 +00:00
Chris Lattner
f456997cb6 eliminate temporary vectors
llvm-svn: 33693
2007-01-31 04:40:53 +00:00
Chris Lattner
b5aa990588 Revise APIs for creating constantexpr GEPs to not require the use of vectors.
This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs.

llvm-svn: 33692
2007-01-31 04:40:28 +00:00
Evan Cheng
0ee9a27976 - Added Thumb constpool island support.
- Islands are inserted right after the user MI since thumb LDR cannot encode
  negative offset.

llvm-svn: 33690
2007-01-31 02:22:22 +00:00
Chris Lattner
eb3d93c6a8 Move symbolic constant folding code to libanalysis.
llvm-svn: 33688
2007-01-31 00:53:10 +00:00
Chris Lattner
be153e31f3 Move some symbolic constant folding code out of instcombine into a place
it can be used by multiple clients.  This specifically allows the inliner
to constant fold symbolically.

llvm-svn: 33687
2007-01-31 00:51:48 +00:00
Chris Lattner
937bf05f43 The local "ConstantFold" method is now just a watered down version of
ConstantFoldInstOperands.  Switch to ConstantFoldInstOperands and remove
ConstantFold.

llvm-svn: 33683
2007-01-30 23:52:44 +00:00
Chris Lattner
7db51ec161 Adjust #includes to match movement of constant folding code from transformutils to libanalysis.
llvm-svn: 33680
2007-01-30 23:46:24 +00:00
Chris Lattner
1765c2eed8 move a bunch of constant folding code f rom Transforms/Utils/Local.cpp into
libanalysis/ConstantFolding.cpp.

llvm-svn: 33679
2007-01-30 23:45:45 +00:00
Chris Lattner
4c01d0055a remove now-dead code.
llvm-svn: 33678
2007-01-30 23:29:47 +00:00
Chris Lattner
a49a1d15dc the inliner pass now passes targetdata down through the inliner api's
llvm-svn: 33677
2007-01-30 23:28:39 +00:00
Chris Lattner
23628987e2 The inliner/cloner can now optionally take TargetData info, which can be
used by constant folding.

llvm-svn: 33676
2007-01-30 23:22:39 +00:00
Chris Lattner
6bd1447e03 reformat comment
llvm-svn: 33675
2007-01-30 23:16:22 +00:00
Chris Lattner
d1acbffe1b pass TD to constant folding apis
llvm-svn: 33674
2007-01-30 23:16:15 +00:00
Chris Lattner
116b82d058 adjust to constant folding api changes.
llvm-svn: 33673
2007-01-30 23:15:43 +00:00
Chris Lattner
129e04aa43 use smallvector instead of vector to make constant folding a bit more efficient
llvm-svn: 33672
2007-01-30 23:15:19 +00:00
Chris Lattner
58e09aa521 adjust to api change
llvm-svn: 33671
2007-01-30 23:14:52 +00:00
Chris Lattner
659afcca15 Change constant folding APIs to take an optional TargetData, and change
ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array
of operands + size, instead of an std::vector.

In some cases, switch to using a SmallVector instead of a vector.
This allows us to get rid of some special case gross code that was there
to avoid the cost of constructing a vector.

llvm-svn: 33670
2007-01-30 23:13:49 +00:00
Evan Cheng
26ee4f882b During PEI, if the immediate value of sp + offset is too large (i.e. something
that would require > 3 instructions to materialize), load the immediate from a
constpool entry.

llvm-svn: 33667
2007-01-30 23:01:46 +00:00
Chris Lattner
27f0acaaec remove some bits that are not yet meant to land.
llvm-svn: 33666
2007-01-30 22:50:32 +00:00
Chris Lattner
b1ada91005 Symbolically evaluate constant expressions like &A[123] - &A[4].f.
This occurs in C++ code like:

#include <iostream>
#include <iterator>
int a[] = { 1, 2, 3, 4, 5 };
int main() {
  using namespace std;
  copy(a, a + sizeof(a)/sizeof(a[0]), ostream_iterator<int>(cout, "\n"));
  return 0;
}

Before we would decide the loop trip count is:
sdiv (i32 sub (i32 ptrtoint (i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) to i32), i32 ptrtoint ([5 x i32]* @a to i32)), i32 4)

Now we decide it is "5".  Amazing.

This code will need to be refactored, but I'm doing that as a separate
commit.

llvm-svn: 33665
2007-01-30 22:32:46 +00:00
Evan Cheng
0f07707270 - Fix codegen for pc relative constant (e.g. JT) in thumb mode:
.set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
LPCRELL0:
        add r1, pc, #PCRELV0
This is not legal since add r1, pc, #c requires the constant be a multiple of 4.
Do the following instead:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
LPCRELL0:
        mov r1, #PCRELV0
        add r1, pc

- In thumb mode, it's not possible to use .set generate a pc relative stub
  address. The stub is ARM code which is in a different section from the thumb
  code. Load the value from a constpool instead.
- Some asm printing clean up.

llvm-svn: 33664
2007-01-30 20:37:08 +00:00
Reid Spencer
19af04a142 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Reid Spencer
00309bbef6 Bye, Bye Compaction Tables. The benefit compaction tables provides doesn't
outweight its computational costs. This patch removes all compaction
table handling from the bcreader and bcwriter. For the record, here's the
difference betweeen having and not having compaction tables for some tests:

Test             With       Without   Size Chg
Olden/mst       5,602         5,598      +0.1%
viterbi        18,026        17,795      +1.3%
obsequi       162,133       166,663      -2.8%
burg          224,090       228,148      -1.8%
kimwitu++   4,933,263     5,121,159      -3.8%
176.gcc     8,470,424     9,141,539      -7.3%

It seems that it is more beneficial to larger files, but even on the largest
test case we have (176.gcc) it only amounts ot an I/O saving of 7.3%.

llvm-svn: 33661
2007-01-30 19:36:46 +00:00
Evan Cheng
5e0f0364d0 Copy and paste bug.
llvm-svn: 33658
2007-01-30 08:22:33 +00:00
Evan Cheng
3f02e5b1e7 Darwin -static should codegen static ctors / dtors to .constructor / .destructor sections.
llvm-svn: 33657
2007-01-30 08:04:53 +00:00
Evan Cheng
78628c7f32 Misseed thumb jumptable branch.
llvm-svn: 33656
2007-01-30 08:03:06 +00:00
Evan Cheng
d0ed3f753b In thumb mode, round up stack frame size to multiple of 4 since add/sub
sp, imm instructions implicitly multiply the offset by 4.

llvm-svn: 33653
2007-01-30 02:57:02 +00:00
Evan Cheng
36f03730d0 Thumb eliminateFrameIndex fixes.
llvm-svn: 33652
2007-01-30 02:36:01 +00:00
Evan Cheng
99a2f7d598 Change the operand orders to t_addrmode_s* to make it easier to morph
instructions that use these address modes to instructions that use
t_addrmode_sp.

llvm-svn: 33651
2007-01-30 02:35:32 +00:00
Evan Cheng
91ad06dd75 - In thumb mode, if size of MachineFunction is >= 2048, force LR to be
spilled (if it is not already).
- If LR is spilled, use BL to implement far jumps. LR is not used as a GPR
  in thumb mode so it can be clobbered if it is properly spilled / restored
  in prologue / epilogue.
- If LR is force spilled but no far jump has been emitted, try undo'ing the
  spill by:
  push lr -> delete
  pop pc -> bx lr

llvm-svn: 33650
2007-01-30 01:18:38 +00:00
Evan Cheng
a16118a6cf Use BL to implement Thumb far jumps.
llvm-svn: 33649
2007-01-30 01:13:37 +00:00
Evan Cheng
171943e26e Factor GetInstSize() out of constpool island pass.
llvm-svn: 33644
2007-01-29 23:45:17 +00:00
Chris Lattner
ad740ef059 add initial support for handling inline asms with multiple constraints.
This doesn't do the "right thing" but will probably work in most cases.

This implements CodeGen/PowerPC/2007-01-29-lbrx-asm.ll.

llvm-svn: 33643
2007-01-29 23:45:14 +00:00
Jim Laskey
fc450bfd0d Out of line function.
llvm-svn: 33641
2007-01-29 23:40:33 +00:00