1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

1712 Commits

Author SHA1 Message Date
Reid Spencer
9ada0ff0ed Add a FIXME for unwritten code.
llvm-svn: 34422
2007-02-19 19:00:29 +00:00
Chris Lattner
865b2f741a remove dead methods
llvm-svn: 34419
2007-02-19 07:44:24 +00:00
Chris Lattner
dee1492159 temporarily revert Devang's most recent patch, which caused a large
compile-time regression in LLC.

llvm-svn: 34385
2007-02-17 23:14:24 +00:00
Devang Patel
953cadacbc Use inverted map to speedup collectLastUses().
llvm-svn: 34364
2007-02-17 03:53:44 +00:00
Andrew Lenharth
d2c65176e6 fix build
llvm-svn: 34339
2007-02-16 02:25:55 +00:00
Chris Lattner
134ae17654 make mayWriteToMemory a non-virtual function
llvm-svn: 34334
2007-02-15 23:15:00 +00:00
Chris Lattner
9084bb5471 rewrite Value::takeName to take advantage of the new symtab stuff. This
causes it to require no allocations and no symtab lookups in the common
case.  This speeds up instcombine 9.2% on 447.dealII.

llvm-svn: 34324
2007-02-15 20:01:43 +00:00
Chris Lattner
5d0b16f797 Implement Function::getIntrinsicID without it needing to call Value::getName,
which allocates a string.  This speeds up instcombine on 447.dealII by 5%.

llvm-svn: 34318
2007-02-15 19:17:16 +00:00
Chris Lattner
fbd6928545 Add a new Value::getNameStr method, which is preferred over getName.
llvm-svn: 34310
2007-02-15 18:53:54 +00:00
Reid Spencer
e7ff3305d6 For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.

llvm-svn: 34300
2007-02-15 03:39:18 +00:00
Reid Spencer
a0a2689760 For PR1195:
Change a comment: Packed Type -> Vector Type

llvm-svn: 34299
2007-02-15 03:11:50 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Chris Lattner
48b7ed420c better support for i128.
llvm-svn: 34258
2007-02-13 23:57:55 +00:00
Chris Lattner
4534d3fc6e Switch UnaryOperators to default to passing names up by const char* when possible.
This speeds up bcreading by 1.5%.

llvm-svn: 34233
2007-02-13 07:54:42 +00:00
Chris Lattner
cc543b031e add a setName variant that takes a null-terminated string. This can be
used to avoid std::string allocations in common cases.

llvm-svn: 34232
2007-02-13 07:53:34 +00:00
Chris Lattner
326271ee46 eliminate instruction ctors that take vectors.
llvm-svn: 34228
2007-02-13 06:22:32 +00:00
Chris Lattner
bc384d8d50 Add invokeinst and callinst ctors that don't take vectors.
llvm-svn: 34214
2007-02-13 01:04:01 +00:00
Chris Lattner
94ce3e4550 remove some dead methods.
llvm-svn: 34213
2007-02-13 00:58:44 +00:00
Chris Lattner
a48bf1bdbf Add new setName accessor which doesn't require creating a string.
llvm-svn: 34197
2007-02-12 18:52:59 +00:00
Chris Lattner
5a58a65c10 Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
as its main datastructure.  There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.

llvm-svn: 34193
2007-02-12 05:18:08 +00:00
Chris Lattner
676ffe699d fix uninitialized variable
llvm-svn: 34182
2007-02-11 19:12:18 +00:00
Chris Lattner
50ea7bc913 add an optimization for the case where the src has no name
llvm-svn: 34174
2007-02-11 01:04:09 +00:00
Chris Lattner
e8dd3c90f1 add a helper method: Value::takeName
llvm-svn: 34171
2007-02-11 00:37:27 +00:00
Reid Spencer
8594672a45 Assert that elements of packed are pointer/float/opaque.
llvm-svn: 34165
2007-02-10 22:02:45 +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
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
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
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
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
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
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
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
Jim Laskey
7d5ddeb668 Support var arg intrinsics.
llvm-svn: 33962
2007-02-06 18:02:54 +00:00
Chris Lattner
83e39edf72 Fix Transforms/ConstProp/2007-02-05-BitCast.ll
llvm-svn: 33948
2007-02-06 02:22:56 +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
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
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
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
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
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
Devang Patel
f178d112ce cvs commit
llvm-svn: 33765
2007-02-01 22:08:25 +00:00
Chris Lattner
ca583c51b3 silence some warnings when assertions are disabled.
llvm-svn: 33747
2007-02-01 04:59:37 +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
Chris Lattner
55e5440018 implement the new GEP instruction ctors.
llvm-svn: 33708
2007-01-31 19:47:18 +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
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
Devang Patel
61ccc1c4b0 - Undo previous check-in (i.e. Do not export TimingInfo class through
PassManagers.h).

- Add StopPassTimer() and StartPassTimer() to expose TimingInfo to
CallGraphPassManager

- Use these two APIs in CalLgraphPassManager to measure timings.

llvm-svn: 33638
2007-01-29 23:10:37 +00:00
Devang Patel
fa27881c1c Move TimingInfo into PassManagers.h so that other libs can use it.
llvm-svn: 33626
2007-01-29 20:06:26 +00:00
Anton Korobeynikov
611d5e2eda Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Jim Laskey
64f4242072 Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.

llvm-svn: 33550
2007-01-26 21:22:28 +00:00
Reid Spencer
00a7dd7d6b For PR761:
Remove the setEndianess and setPointerSize methods. These are now
handled via the setDataLayout method.

llvm-svn: 33527
2007-01-26 08:07:57 +00:00
Reid Spencer
e2ac333854 For PR645:
Implement new syntax for local and global symbols. Types and local
symbols use the % prefix. Global variables and functions use the @ prefix.

llvm-svn: 33523
2007-01-26 08:02:52 +00:00
Reid Spencer
cca21cf060 For PR645:
Remove the Function::renameLocalSymbols function as it is no longer
needed.

llvm-svn: 33522
2007-01-26 08:01:30 +00:00
Reid Spencer
93b5ba7cd2 IntegerType is a sized DerivedType too.
llvm-svn: 33521
2007-01-26 07:51:36 +00:00
Reid Spencer
641bcdce55 Clean up comments and assert messages that still refer to the old type names.
llvm-svn: 33520
2007-01-26 07:37:34 +00:00
Reid Spencer
25d0264daa Fix an assertion message.
llvm-svn: 33519
2007-01-26 06:30:34 +00:00
Reid Spencer
82909e607c Whoops, fix typo in last commit.
llvm-svn: 33417
2007-01-21 02:29:10 +00:00
Reid Spencer
e33c18f4d2 For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!

llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Chris Lattner
9df9e3e57b Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can.  Patch by Scott Michel!

llvm-svn: 33409
2007-01-20 22:35:55 +00:00
Reid Spencer
4bcddb2f04 Remove dead methods in the ValTypes.
llvm-svn: 33372
2007-01-19 21:25:12 +00:00
Reid Spencer
14b42c0040 For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.

llvm-svn: 33370
2007-01-19 21:13:56 +00:00
Reid Spencer
b52af65aaa Use a cheaper computation.
llvm-svn: 33336
2007-01-18 18:14:49 +00:00
Reid Spencer
80bf052680 Provide an isPowerOf2ByteWidth method for the IntegerType class. This will
mostly be used by back ends that wish to distinguish between integer types
that fit evenly within a natural integer type and those that don't.

llvm-svn: 33328
2007-01-18 02:59:54 +00:00
Devang Patel
cda3b4d76f Update ModulePass::assignPassManager() to take into account Preferred
Pass Manager Type.

llvm-svn: 33308
2007-01-17 21:19:23 +00:00
Devang Patel
b40f9ee72e s/PassDebugging_New/PassDebugging/g
llvm-svn: 33307
2007-01-17 20:33:36 +00:00
Devang Patel
866ecabe21 Update assignPassManager() signature to allow selection of preferred
pass manager type. This allows new FPPassManager to select Call Graph
Pass Manager (if available) as its parent.

llvm-svn: 33306
2007-01-17 20:30:17 +00:00
Reid Spencer
d98055f3fe For PR1117:
Expose the previously hidden checkCast function as CastInst::castIsValid.

llvm-svn: 33282
2007-01-17 02:46:11 +00:00
Devang Patel
c65137140c Pass manager may require certain analysis. In such cases, initially
pass manager is last user.

llvm-svn: 33273
2007-01-16 22:38:10 +00:00
Devang Patel
e3e4fcb70f Undo last check-in.
Remove setupPassManager() and its use.

llvm-svn: 33270
2007-01-16 21:43:18 +00:00
Devang Patel
afc2e45d40 Setup pass manager before scheduling required analysis.
llvm-svn: 33262
2007-01-16 19:46:09 +00:00
Devang Patel
2d421d58d6 Code refactoring.
llvm-svn: 33245
2007-01-16 02:00:38 +00:00
Devang Patel
b61a40bc5a Remove extra white spaces. Fix comments.
llvm-svn: 33244
2007-01-15 23:06:56 +00:00
Devang Patel
67c975490d Do not record last users of Pass Manager.
llvm-svn: 33243
2007-01-15 20:31:54 +00:00
Chris Lattner
b0a126d212 make this more efficient in release builds (time and space)
llvm-svn: 33239
2007-01-15 18:28:18 +00:00
Chris Lattner
c5e1611848 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner
f1797fe8bf teach VMCore to accept i1 add's and shifts
llvm-svn: 33223
2007-01-15 02:05:34 +00:00
Chris Lattner
9bda331dc3 don't discriminate against i1
llvm-svn: 33213
2007-01-15 00:45:50 +00:00
Reid Spencer
40be764463 Fix a FIXME. 1 bit integer types are now printed as i1 not bool.
llvm-svn: 33176
2007-01-13 01:09:33 +00:00
Reid Spencer
42cb213bc9 Make sure the IntegerValType has enough space for 2^23 bits.
llvm-svn: 33168
2007-01-13 00:12:29 +00:00
Jim Laskey
ee29cc6016 Allow isAllOnesValue testing on packed constants
llvm-svn: 33146
2007-01-12 22:39:14 +00:00
Devang Patel
347efe4ce7 s/addPassToManager/add/g
llvm-svn: 33138
2007-01-12 20:07:16 +00:00
Anton Korobeynikov
548b9af9c2 * PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)

llvm-svn: 33136
2007-01-12 19:20:47 +00:00
Devang Patel
9afb283500 Move PMTopLevelManager, PMDataManager and FPPassManger classes into
new PassManagers.h header.

This opens door for implementing CGPassManager in IPA library.

llvm-svn: 33135
2007-01-12 18:52:44 +00:00
Chris Lattner
cb66b7721a Remove a bunch of duplicated code. Among other things, this fixes
constant folding of signed comparisons of bool.

llvm-svn: 33134
2007-01-12 18:42:52 +00:00
Devang Patel
dc1430cb98 Remove dead code.
llvm-svn: 33121
2007-01-12 17:23:48 +00:00
Reid Spencer
eeb33c0716 Always write 1 bit integers as i1 not "bool".
llvm-svn: 33115
2007-01-12 07:25:20 +00:00
Reid Spencer
373d2bccea For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer
3d986f6487 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Devang Patel
da5ae651e9 Start using PMStack. Now each pass is responsibe for assinging
a pass manager for itself.

There is some opportunity to remove some dead code from PassManager.cpp.

llvm-svn: 33087
2007-01-11 22:15:30 +00:00
Devang Patel
5f5c0486fb Use getPassManagerType() instead of dynamic_cast.
llvm-svn: 33078
2007-01-11 19:59:06 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00