Devang Patel
af0b4b4191
Proivde getAnalysis<FPAnalysis>(Func) support.
...
llvm-svn: 36159
2007-04-16 20:56:24 +00:00
Devang Patel
4bf452b5e4
Do not assert during analysis implementation initialization.
...
llvm-svn: 36158
2007-04-16 20:44:16 +00:00
Devang Patel
814d1deba8
Print and delete on the fly pass managers.
...
llvm-svn: 36157
2007-04-16 20:39:59 +00:00
Devang Patel
3b4e226a87
Update module pass manager to support module passes that require
...
function passes.
llvm-svn: 36154
2007-04-16 20:27:05 +00:00
Devang Patel
c1010840fa
Give each pass manager chance to manage lower level analysis pass, which is
...
pass required by one of pass managed by the manager.
llvm-svn: 36153
2007-04-16 20:12:57 +00:00
Anton Korobeynikov
f3e62a428a
Removed tabs everywhere except autogenerated & external files. Add make
...
target for tabs checking.
llvm-svn: 36146
2007-04-16 18:10:23 +00:00
Reid Spencer
16f6e75cf5
Don't return 0 if the len == 5, let the assert handle that case.
...
Thanks, Chris.
llvm-svn: 36139
2007-04-16 16:56:54 +00:00
Reid Spencer
4b8e900991
Fix test/CodeGen/Generic/vector-constantexpr.ll
...
llvm-svn: 36123
2007-04-16 07:08:44 +00:00
Reid Spencer
f12ab5a55b
For PR1328:
...
Don't assert everytime an intrinsic name isn't recognized. Instead, make
the assert optional when callin getIntrinsicID(). This allows the assembler
to handle invalid intrinsic names gracefully.
llvm-svn: 36120
2007-04-16 06:54:34 +00:00
Owen Anderson
b371956400
Tabs -> Spaces
...
llvm-svn: 36094
2007-04-15 23:14:18 +00:00
Owen Anderson
ea857029ea
Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
...
constructing ImmediateDominator is now folded into DomTree construction.
This is part of the ongoing work for PR217.
llvm-svn: 36063
2007-04-15 08:47:27 +00:00
Owen Anderson
1d837200f2
Fix some unsafe code. Also, tabs -> spaces.
...
llvm-svn: 36035
2007-04-14 23:57:00 +00:00
Owen Anderson
41582c8198
Make ETForest depend on DomTree rather than IDom. This is the first step
...
in the long process that will be fixing PR 217.
llvm-svn: 36034
2007-04-14 23:49:24 +00:00
Chris Lattner
5ed58fc4a9
add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
...
Writing it twice in the same day was too much for me.
llvm-svn: 35978
2007-04-14 00:12:57 +00:00
Lauro Ramos Venancio
a76c2806de
Implement the "thread_local" keyword.
...
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer
82da0eb67c
For PR1284:
...
Implement the "part_set" intrinsic.
llvm-svn: 35938
2007-04-12 02:48:46 +00:00
Reid Spencer
bd2afc8391
Fix a bug where ICmpInst objects instantiated directly with a name would
...
not retain that name. Not noticed because AsmParser always sets name after
construction. However, llvm2cpp noticed.
llvm-svn: 35903
2007-04-11 13:04:48 +00:00
Reid Spencer
2792e203c5
For PR1146:
...
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.
llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Chris Lattner
8557e71577
unbreak the build :(
...
llvm-svn: 35857
2007-04-10 03:18:19 +00:00
Jeff Cohen
9bc2960be6
Fix build problem.
...
llvm-svn: 35856
2007-04-10 03:10:46 +00:00
Reid Spencer
93a57ef458
For PR1146:
...
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
leaks. This will change when ParamAttrsList is uniquified but needs to
be correct until then.
llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer
1acc089771
Remove a memory leak, until ParamAttrsList is uniqued.
...
llvm-svn: 35823
2007-04-09 17:20:18 +00:00
Reid Spencer
d2380cfb76
For PR1146:
...
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp
llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Chris Lattner
730f5588be
Convert ImmediateDominators::DFSPass from being recursive to being iterative.
...
llvm-svn: 35815
2007-04-09 06:44:42 +00:00
Reid Spencer
1f674acbdf
For PR1146:
...
Simplify construction of FunctionType to use default arguments.
llvm-svn: 35810
2007-04-09 06:12:07 +00:00
Reid Spencer
a2b16b4ee5
For PR1146:
...
Parameter attributes can now be defaulted for intrinsics.
llvm-svn: 35809
2007-04-09 06:11:23 +00:00
Reid Spencer
3d414b473d
For PR1146:
...
Adjust writing of parameter attributes to use ParamAttrList class.
llvm-svn: 35808
2007-04-09 06:10:42 +00:00
Chris Lattner
884f49c47e
minor cleanups
...
llvm-svn: 35807
2007-04-09 06:10:06 +00:00
Reid Spencer
6bc0205a2a
For PR1146:
...
Move parameter attributes functionality to ParamAttrsList class.
llvm-svn: 35806
2007-04-09 06:07:52 +00:00
Owen Anderson
e4c29f0b01
Move isReachableFromEntry out of line to avoid an unnecessary #include
...
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Owen Anderson
4b323657b9
Remove DomSet completely. This concludes work on PR1171.
...
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Nick Lewycky
26652f5681
Don't crash when encountering a BasicBlock that hasn't been registered yet.
...
llvm-svn: 35756
2007-04-08 01:02:12 +00:00
Owen Anderson
7cf9d12f2e
Add DomSet back, and revert the changes to LoopSimplify. Apparently the
...
ETForest updating mechanisms don't work as I thought they did. These changes
will be reapplied once the issue is worked out.
llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Owen Anderson
85b0e20f2a
Completely purge DomSet. This is the (hopefully) final patch for PR1171.
...
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Reid Spencer
5d36a01dba
For PR1209:
...
Implement Type class's ContainedTys without using a std::vector.
llvm-svn: 35693
2007-04-06 02:02:20 +00:00
Reid Spencer
6eb55df794
Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
...
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Reid Spencer
d371e2e492
For PR1297:
...
Implement "actual" argument types for the Intrinsic member functions. This
involves changing the getName, getType, and getDeclaration methods to have
optional parameters for the actual types. These are necessary in order for
the type/name to be constructed properly for overloaded intrinsics. Only
the caller knows the actual argument types desired.
llvm-svn: 35541
2007-04-01 07:25:33 +00:00
Reid Spencer
1db694fe4b
For PR1297:
...
1. Clear up confusion between "GotBits" and "ExpectBits". GotBits is the
type actually provided. ExpectedBits is the type expected for the
intrinsics. Before this patch, it was reversed!
2. Implement checks for overloaded intrinsics. This involves computing the
suffix expected and making sure the suffix matches the function name. It
also includes some intrinsic-specific checks such as ensuring that the
bswap parameter and result are the same width and an even number of bytes.
llvm-svn: 35540
2007-04-01 07:22:57 +00:00
Chris Lattner
546138e3dd
add a method to turn a type into a VT.
...
llvm-svn: 35526
2007-03-31 04:03:02 +00:00
Devang Patel
7cde72cbc1
It is not possible to determine dominance between two PHI nodes
...
based on their ordering. This is applicable to ETForest::dominates() also.
llvm-svn: 35423
2007-03-28 14:57:43 +00:00
Reid Spencer
bd89a6ea1c
No need to generate the implementation keyword any more. Its frivolous.
...
llvm-svn: 35405
2007-03-28 01:53:20 +00:00
Devang Patel
67eede36f7
Use SmallPtrSet.
...
llvm-svn: 35388
2007-03-27 20:50:46 +00:00
Devang Patel
8330ee3120
Spell check.
...
llvm-svn: 35374
2007-03-27 00:16:08 +00:00
Devang Patel
58a8e74de6
It is not possible to determie dominance between two PHI nodes
...
based on their ordering.
llvm-svn: 35369
2007-03-26 23:18:28 +00:00
Devang Patel
3062ae001d
Use std::vector<DFCalculateWorkObject> instead of
...
std::vector<DFCalculateWorkObject *> to reduce malloc/free traffic.
llvm-svn: 35368
2007-03-26 23:17:19 +00:00
Reid Spencer
4af99334ea
Add a comment to explain a folding transform.
...
llvm-svn: 35360
2007-03-26 20:09:02 +00:00
Chris Lattner
f4ff1dc689
fold constantexprs more aggressively, fixing PR1265
...
llvm-svn: 35336
2007-03-25 05:47:04 +00:00
Chris Lattner
3a16450eaf
add a valuetype for v1i64, which is needed by mmx.
...
llvm-svn: 35298
2007-03-24 17:36:26 +00:00
Reid Spencer
7a9c981d80
Fix constant fold of div by zero and rem by zero to match IEEE 754
...
requirements. We must return NaN in some cases and correctly signed
infinity in other cases. Passes CFP2006 (not that that says much).
llvm-svn: 35277
2007-03-23 05:33:23 +00:00
Dan Gohman
d0a0ea9916
Change uses of Function::front to Function::getEntryBlock for readability.
...
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Reid Spencer
a2d8b5e7a1
Add the NoUnwind function attribute.
...
llvm-svn: 35260
2007-03-22 02:14:48 +00:00
Devang Patel
3a426e1c86
DominanceFrontier::calculate().
...
Avoid recursion, Use iterative algorithm.
llvm-svn: 35225
2007-03-20 21:25:31 +00:00
Devang Patel
18146cf2a2
LoopSimplify::FindPHIToPartitionLoops()
...
Use ETForest instead of DominatorSet.
llvm-svn: 35221
2007-03-20 20:18:12 +00:00
Chris Lattner
6dbed4d4ca
Fix a nasty memory leak, caused by my revamp of the value symbol table.
...
llvm-svn: 35195
2007-03-20 00:18:10 +00:00
Reid Spencer
7d20e42a97
Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as a
...
negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll
llvm-svn: 35181
2007-03-19 20:39:08 +00:00
Reid Spencer
135ca5e8c4
For PR1258:
...
Radically simplify the SlotMachine. There is no need to keep Value planes
around any more. This change causes slot numbering to number all un-named,
non-void values starting at 0 and incrementing monotonically through the
function, regardless of type (including BasicBlocks). Getting slot numbers
is now a single lookup operation instead of a double lookup.
llvm-svn: 35171
2007-03-19 18:32:53 +00:00
Devang Patel
94228897e7
Speed Up Pass Manager.
...
- Check Immutableness before searching PreservedSet.
- Avoid unnecessary traversal while setting Last User.
llvm-svn: 35028
2007-03-08 19:05:01 +00:00
Evan Cheng
7513c95267
Added ContainsRelocations() to check if a constant might only be resolvable at load time.
...
llvm-svn: 35014
2007-03-08 00:59:12 +00:00
Devang Patel
b9e705f09e
Keep track of higher level analysis.
...
llvm-svn: 34974
2007-03-06 17:52:53 +00:00
Devang Patel
45343b04b3
Keep track of inherited analysis. For example, if a loop pass does not
...
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.
llvm-svn: 34942
2007-03-06 01:55:46 +00:00
Devang Patel
edbde240be
Add preparePassManager() hook. This allows each pass to check whether
...
current active pass manager is appropriate or not.
A loop pass may consider current LPPassManager in appropraite if loop
pass is not preserving analysis information that is used by other
passes managed by current LPPassManager. In such situation, loop pass
can pop current LPPassManager from the PMStack using this hook
and use new LPPassManager for itself.
llvm-svn: 34941
2007-03-06 01:06:16 +00:00
Devang Patel
79495d839e
Current pass manager, not the parent pass manager, assumes the role of
...
last user when one of the managed pass uses info provided by parent pass
manager.
This was exposed by LPPassManager work.
llvm-svn: 34936
2007-03-05 22:57:49 +00:00
Devang Patel
6668a341ae
Avoid constructing std::strings unless pass debugging is ON.
...
llvm-svn: 34933
2007-03-05 20:01:30 +00:00
Devang Patel
ca90313b39
Account for time consumed by releaseMemory() properly.
...
llvm-svn: 34932
2007-03-05 18:20:51 +00:00
Jeff Cohen
98c99a3a02
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Reid Spencer
6037b564a0
Fix constant folding of fp->int bitcast for vectors.
...
llvm-svn: 34880
2007-03-03 08:32:46 +00:00
Reid Spencer
1f970769e8
Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
...
Constant::isNullValue() in situations where it is possible.
llvm-svn: 34821
2007-03-02 00:28:52 +00:00
Reid Spencer
5790924b21
Use the APInt versions of the bit-wise conversions of float/double to int
...
and back. While this is not strictly necessary, it does pave the way for
future changes in casting. It should now be possible to improve vector
casting to deal with un-equal fp/int sizes.
llvm-svn: 34808
2007-03-01 20:44:23 +00:00
Reid Spencer
5d9574f37e
Use modern variable name. ConstantUnsignedInt is long since dead. No
...
functional change with this patch.
llvm-svn: 34806
2007-03-01 20:27:41 +00:00
Reid Spencer
b0a7bfa105
Use a simpler constructor when constructing ConstantInst.
...
llvm-svn: 34793
2007-03-01 19:31:12 +00:00
Reid Spencer
b4e877c488
Drop the ConstantInt(const Type&, const APInt&) constructor. It is
...
redundant and more verbose than the ConstantInt(const APInt&) constructor.
llvm-svn: 34792
2007-03-01 19:30:34 +00:00
Reid Spencer
32d0051c64
Reduce #includage by taking a method out of line.
...
llvm-svn: 34774
2007-03-01 04:02:06 +00:00
Reid Spencer
f632e1cd14
Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
...
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.
llvm-svn: 34760
2007-02-28 22:00:54 +00:00
Reid Spencer
a9d0cc903b
Implement a convenience method to construct a ConstantInt directly from an
...
APInt. The implied type is the integer type that corresponds to the bit
width of the APInt.
llvm-svn: 34757
2007-02-28 19:50:21 +00:00
Reid Spencer
24430077d5
Pull out the stops.
...
llvm-svn: 34703
2007-02-27 23:33:03 +00:00
Reid Spencer
58f7a497bb
Remove some redundancy.
...
llvm-svn: 34702
2007-02-27 23:27:26 +00:00
Reid Spencer
8178fd7bd5
Adjust to changes in the APInt interface.
...
llvm-svn: 34681
2007-02-27 20:25:25 +00:00
Reid Spencer
a3b5b71616
For PR1205:
...
Implement review feedback:
1. Use new APInt::RoundDoubleToAPInt interface to specify the bit width so
that we don't have to truncate or extend in constant folding.
2. Fix a pasteo in SDiv that prevented a check for overflow.
3. Fix the shift operators: undef happens when the shift amount is equal
to the bitwidth.
llvm-svn: 34677
2007-02-27 19:29:54 +00:00
Devang Patel
89791371ce
Make getPassManagerType() const.
...
llvm-svn: 34669
2007-02-27 15:00:39 +00:00
Reid Spencer
b05cb31bdf
Allow the AsmWriter to print out arbitrary precision integers.
...
llvm-svn: 34664
2007-02-27 08:34:09 +00:00
Reid Spencer
74764708fa
Correct the implelmentation of ConstantInt::getAllOnesValue() for bit
...
widths > 64 bits.
llvm-svn: 34663
2007-02-27 07:57:53 +00:00
Reid Spencer
de3bbe0489
For PR1205:
...
Implement constant folding via APInt instead of uint64_t.
llvm-svn: 34660
2007-02-27 06:23:51 +00:00
Chris Lattner
ae7cc3e0e0
ConstantFolding.cpp/h -> ConstantFold.cpp/h to avoid confusion with
...
lib/Analysis/ConstantFolding.
llvm-svn: 34653
2007-02-27 03:05:06 +00:00
Reid Spencer
c8cc0f997e
For PR1205:
...
Implement the first step towards arbitrary precision integer support in
LLVM. The APInt class provides arbitrary precision arithmetic and value
representation. This patch changes ConstantInt to use APInt as its value
representation without supporting bit widths > 64 yet. That change will
come after ConstantFolding handles bit widths > 64 bits.
llvm-svn: 34647
2007-02-26 23:54:03 +00:00
Chris Lattner
cdbef93603
reapply my previous patch with a bugfix.
...
llvm-svn: 34627
2007-02-26 05:02:39 +00:00
Chris Lattner
96aac36de5
revert my previous change, something strange is happening.
...
llvm-svn: 34626
2007-02-26 04:43:19 +00:00
Chris Lattner
50be7cd320
Rework GlobalValue::removeDeadConstantUsers to always remove dead constant
...
exprs hanging off a global, even if the global is not otherwise dead. This
requires some tricky iterator gymnastics.
This implements Transforms/GlobalOpt/constantexpr-dangle.ll by deleting a
constantexpr that made it appear that the address of the function was taken.
llvm-svn: 34608
2007-02-25 21:06:13 +00:00
Chris Lattner
2fbfbcd9cd
disable some noisy debug output
...
llvm-svn: 34606
2007-02-25 20:42:59 +00:00
Chris Lattner
5480ffb904
Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215
...
llvm-svn: 34548
2007-02-24 01:19:50 +00:00
Chris Lattner
0eb72353e4
Refactor the setName stuff, moving it down the inheritance hierarchy, to
...
solve a crash in -instcombine -debug that was hit while investigating PR1217
llvm-svn: 34544
2007-02-24 00:55:48 +00:00
Evan Cheng
0af52bec6b
This cast broke lots of tests.
...
llvm-svn: 34457
2007-02-20 21:30:56 +00:00
Chris Lattner
be8f4becf4
switch ConstantFP's from ValueMap to DenseMap, which is much faster to query
...
and is more memory efficient.
llvm-svn: 34446
2007-02-20 07:17:17 +00:00
Chris Lattner
37a49eb48d
cleanup ConstantInt to use a single DenseMap for uniquing instead of the
...
heavy-weight ValueMap class. This reduces mem usage bc reading kc++ by 29K,
even though it only creates 2955 constant ints!
llvm-svn: 34445
2007-02-20 06:39:57 +00:00
Chris Lattner
adb16a1a53
Make ConstantInt::getTrue/getFalse be llvm_shutdown safe.
...
llvm-svn: 34443
2007-02-20 06:11:36 +00:00
Chris Lattner
c8db23f8a7
Clean up the internals of the ConstantInt machinery
...
llvm-svn: 34441
2007-02-20 05:55:46 +00:00
Chris Lattner
26dc9c9dc8
simplify some code that was not llvm_shutdown safe
...
llvm-svn: 34440
2007-02-20 05:46:39 +00:00
Chris Lattner
502e4b271a
remove dead method
...
llvm-svn: 34436
2007-02-20 05:29:47 +00:00
Chris Lattner
f501d245c8
llvm-gcc issue fixed, revert reversal :)
...
llvm-svn: 34425
2007-02-19 20:01:23 +00:00
Chris Lattner
8f9dc788c1
remove warning
...
llvm-svn: 34424
2007-02-19 19:46:17 +00:00
Evan Cheng
936deee790
Temporarily reverting the patch. It's breaking llvm-gcc build.
...
llvm-svn: 34423
2007-02-19 19:23:41 +00:00
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