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

1909 Commits

Author SHA1 Message Date
Duncan Sands
4106f87b42 Two ParamAttrsVectors which differ by a permutation
of their elements do not yield the same ParamAttrsList,
though they should.  On the other hand, everyone seems
to pass such vectors with elements ordered by increasing
index, so rather than sorting the elements simply assert
that the elements are ordered in this way.

llvm-svn: 41845
2007-09-11 14:40:04 +00:00
Chris Lattner
f08a077fa9 Fix a buggy constant folding transformation when handling aliases.
llvm-svn: 41818
2007-09-10 23:42:42 +00:00
Owen Anderson
4b71e55287 Add lengthof and endof templates that hide a lot of sizeof computations.
Patch by Sterling Stein!

llvm-svn: 41758
2007-09-07 04:06:50 +00:00
Dale Johannesen
86f367a6b7 Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double.  Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)

llvm-svn: 41747
2007-09-06 18:13:44 +00:00
David Greene
8cda5af2e7 Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.

llvm-svn: 41697
2007-09-04 15:46:09 +00:00
Dale Johannesen
e91a908971 Change LegalFPImmediates to use APFloat.
Add APFloat interfaces to ConstantFP, SelectionDAG.
Fix integer bit in double->APFloat conversion.
Convert LegalizeDAG to use APFloat interface in
ConstantFPSDNode uses.

llvm-svn: 41587
2007-08-30 00:23:21 +00:00
David Greene
5b85021be8 Update InvokeInst to work like CallInst
llvm-svn: 41506
2007-08-27 19:04:21 +00:00
Dale Johannesen
9ec1e28e79 Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.
This means backing out the preceding change to Constants.cpp, alas.

llvm-svn: 41378
2007-08-24 22:09:56 +00:00
Chris Lattner
af91aa2f5e sink clone() down the class hierarchy from CmpInst into ICmpInst/FCmpInst.
This eliminates a conditional on that path, and ensures ICmpInst/FCmpInst
both have an out-of-line virtual method to home the class.

llvm-svn: 41371
2007-08-24 20:48:18 +00:00
Dale Johannesen
0aaabb858b Revised per review feedback from previous patch.
llvm-svn: 41353
2007-08-24 05:08:11 +00:00
Dale Johannesen
a3ab055b9d Change internal representation of ConstantFP to use APFloat.
Interface to rest of the compiler unchanged, as yet.

llvm-svn: 41348
2007-08-24 00:56:33 +00:00
Chris Lattner
8e296cc9d9 Fix potentially N^2 behavior handling arrays with many of the
same value which get RAUW'd.  This speeds up reading the .bc
file in PR1616 from 852s to 0.19s on my G5 with a debug build.

llvm-svn: 41209
2007-08-21 00:55:23 +00:00
Chris Lattner
07ac73b539 simplify code, improve a comment.
llvm-svn: 41205
2007-08-21 00:21:07 +00:00
Dan Gohman
908f4e65ed Add Type::isIntOrIntVector, like Type::isFPOrFPVector.
llvm-svn: 41190
2007-08-20 19:25:59 +00:00
Dan Gohman
5da3149de5 When Intrinsic::getName is constructing names for overloaded intrinsics,
use the ValueType name instead of the llvm type name, to match what the
verifier expects. For integers these are the same, but for floating-point
values the intrinsics use f32/f64 instead of float/double.

llvm-svn: 41189
2007-08-20 19:23:34 +00:00
Chris Lattner
a92fddf2cc simplify code and print visibility for declarations.
llvm-svn: 41173
2007-08-19 22:15:26 +00:00
Chris Lattner
d5f075ed16 Compute the argument list as lazily as possible. This ensures that clients
that don't use it don't have to pay the memory cost for the arguments.  This
allows us to avoid creating Argument nodes for many prototypes and for clients
who lazily deserialize code from a bytecode file.

llvm-svn: 41166
2007-08-18 06:14:52 +00:00
Chris Lattner
6e6a77d83b use a nicer accessor.
llvm-svn: 41165
2007-08-18 06:13:19 +00:00
Dan Gohman
644db457f0 Fix the verification for overloaded intrinsic types. Check that they are
what they're supposed to be before using them.

llvm-svn: 41130
2007-08-16 22:06:45 +00:00
Dan Gohman
b499ea1cf6 Add MVT::fAny for overloading intrinsics on floating-point types.
llvm-svn: 41128
2007-08-16 21:57:19 +00:00
Devang Patel
833a8ea187 Assert sooner. Fix wordings.
llvm-svn: 41075
2007-08-14 16:53:52 +00:00
Devang Patel
993388b1ee Add methods to erase basic block entry.
llvm-svn: 41052
2007-08-13 22:10:29 +00:00
Chris Lattner
8674db5fbf Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
Into: inttoptr (i64 0 to i8*)  -> null

This occurs in the example in PR1602.  With this fixed, we now compile
the example in PR1602 into fully "devirtualized" code:

define void @_Z1g1S(%struct.S* noalias  %s) {
entry:        %tmp131415 = getelementptr %struct.S* %s, i32 0, i32 0          ; <i32 (...)***> [#uses=1]        %tmp16 = load i32 (...)*** %tmp131415, align 4          ; <i32 (...)**> [#uses=1]
        %tmp26277 = load i32 (...)** %tmp16             ; <i32 (...)*> [#uses=1]
        %tmp2829 = bitcast i32 (...)* %tmp26277 to void (%struct.S*)*           ; <void (%struct.S*)*> [#uses=1]
        tail call void %tmp2829( %struct.S* %s )
        ret void
}

This still has the vtable dispatch (as required) but does not have any pointer
to method cruft left.

llvm-svn: 41046
2007-08-13 17:09:08 +00:00
Devang Patel
fa7277dd34 Do not overuse std::string. Pass around char * directly.
llvm-svn: 41001
2007-08-10 18:29:32 +00:00
Chris Lattner
de900e3b6c add Value::getNameStart/getNameLen() accessors.
llvm-svn: 40989
2007-08-10 15:34:35 +00:00
Chris Lattner
de5f6f921a minor simplifications.
llvm-svn: 40981
2007-08-10 06:22:25 +00:00
Chris Lattner
bbe3b1dbee avoid copying strings.
llvm-svn: 40980
2007-08-10 06:17:04 +00:00
Dale Johannesen
21c0eac378 Patch 10 for long double. Doing constants right needs expanding ConstantFP
to handle values bigger than double.  If we assume host==target and host
long double works correctly, this is not too bad, but we don't want to
have that limitation longterm.  I could implement accepting double
constants as long double or something like that, which would lead to
incorrect codegen with no errors; the more I think about that the worse
it seems.  Rather than do such a hack that would be backed out later,
I'm settling for giving reasonable error messages, for now.

llvm-svn: 40974
2007-08-09 22:51:36 +00:00
Chris Lattner
b8959ef7a1 Speed up updateDFSNumbers with two observations:
1. domtree is a tree, not a graph.  There is no need to avoid revisiting nodes with a set.
2. the worklist can contain the child iterator pointers so we don't get N^2 rescanning of children.

This speeds up updateDFSNumbers significantly, making it basically free.  On the testcase in PR1432,
this speeds up loopsimplify by another 3x, dropping it from the 12th most expensive pass to the to
the 30th. :)  It used to be #1.

llvm-svn: 40923
2007-08-08 06:24:20 +00:00
Chris Lattner
65d638a918 reimplement dfs number computation to be significantly faster. This speeds up
natural loop canonicalization (which does many cfg xforms) by 4.3x, for 
example.  This also fixes a bug in postdom dfnumber computation.

llvm-svn: 40920
2007-08-08 05:51:24 +00:00
Chris Lattner
2c559ed3dc 1. Random tidiness cleanups
2. Make domtree printing print dfin/dfout #'s
3. Fix the Transforms/LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll failure from last night (in DominanceFrontier::splitBlock).

w.r.t. #3, my patches last night happened to expose the bug, but this 
has been broken since Owen's r35839 patch to LoopSimplify.  The code
was subsequently moved over from LoopSimplify into Dominators, carrying
the latent bug.  Fun stuff.

llvm-svn: 40858
2007-08-06 06:19:47 +00:00
Reid Spencer
3e54e72ef1 Fix minor doxygen nits.
llvm-svn: 40854
2007-08-05 20:06:04 +00:00
Reid Spencer
5963adc510 Fix a doxygen directive.
llvm-svn: 40849
2007-08-05 19:27:01 +00:00
Chris Lattner
4b65325ba7 Fix an iterator invalidation bug I induced.
llvm-svn: 40830
2007-08-05 00:24:30 +00:00
Chris Lattner
7cdaff2298 Switch some std::sets to SmallPtrSet. This speeds up
domtree by 10% and postdomtree by 17%

llvm-svn: 40829
2007-08-05 00:15:57 +00:00
Chris Lattner
9c1a2dfa53 Switch DomTreeNode::assignDFSNumber from using a std::set to using
a smallptrset.  This speeds up domtree by about 15% and postdomtree by 20%.

llvm-svn: 40828
2007-08-05 00:10:08 +00:00
Chris Lattner
a5a692b9bb Switch the internal "Info" map from an std::map to a DenseMap. This
speeds up idom by about 45% and postidom by about 33%.

Some extra precautions must be taken not to invalidate densemap iterators.

llvm-svn: 40827
2007-08-05 00:02:00 +00:00
Chris Lattner
5912537997 switch the DomTreeNodes and IDoms maps in idom/postidom to a
DenseMap instead of an std::map.  This speeds up postdomtree
by about 25% and domtree by about 23%.  It also speeds up clients,
for example, domfrontier by 11%, mem2reg by 4% and ADCE by 6%.

llvm-svn: 40826
2007-08-04 23:48:07 +00:00
Chandler Carruth
00e56b0e81 This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.

llvm-svn: 40807
2007-08-04 01:51:18 +00:00
Dale Johannesen
976a1cf6cf long double patch 3 of N. Add to MVT.
llvm-svn: 40793
2007-08-03 20:51:37 +00:00
Dale Johannesen
dda00eb44d Long double, part 1 of N. Support in IR.
llvm-svn: 40774
2007-08-03 01:03:46 +00:00
Devang Patel
937b07fb5e Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589, again

llvm-svn: 40737
2007-08-02 15:25:57 +00:00
Devang Patel
f21f509c2c Undo previous check-in.
llvm-svn: 40698
2007-08-01 23:24:50 +00:00
Devang Patel
51c61e730a Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589.

llvm-svn: 40695
2007-08-01 22:23:50 +00:00
David Greene
f06a395bb9 New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector.

Updates to all clients.

llvm-svn: 40660
2007-08-01 03:43:44 +00:00
Reid Spencer
c103e8add9 After a discussion with Anton, it turns out that the InReg attribute is not
permitted on function results. So, revert the last patch to make it illegal.

llvm-svn: 40632
2007-07-31 14:39:10 +00:00
Reid Spencer
b0eeb23ce8 The InReg parameter attribute is valid on function results. The llvm-gcc-4.0
front end converts regparm attribute on the gcc function into InReg attribute 
on the llvm function. This fixes test/CFrontend/2002-07-30-SubrefSetAssertion.c

llvm-svn: 40618
2007-07-31 06:33:37 +00:00
Dan Gohman
b757cdd2e6 Fix pastos in comments for doFinalization functions.
llvm-svn: 40588
2007-07-30 14:51:13 +00:00
Devang Patel
780ecf20d1 Add facility to dump pass manager structure
to make it easier to understand failure.

llvm-svn: 40567
2007-07-27 20:06:09 +00:00
Devang Patel
20ffab9de6 Fix edge cases in handling basic block split.
llvm-svn: 40564
2007-07-27 19:13:43 +00:00