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

4583 Commits

Author SHA1 Message Date
Chris Lattner
cba75c1b7b simplify code.
llvm-svn: 59390
2008-11-16 04:26:55 +00:00
Chris Lattner
21f18c9760 Handle the case where there is no "not". It is possible it got
folded into the select.

llvm-svn: 59389
2008-11-16 04:25:26 +00:00
Chris Lattner
6afddeeed1 factor a bunch of copy/paste code out into a helper function.
Eliminate the cases checking for cond?0:-1, since that is already
handled by commutative checking.

llvm-svn: 59388
2008-11-16 04:24:12 +00:00
Chris Lattner
9dd963a73a rearrange some code, no functionality change.
llvm-svn: 59381
2008-11-16 03:56:24 +00:00
Chris Lattner
0c0c68bab4 if we're going to use a macro, use it maximally. no functionality change.
llvm-svn: 59380
2008-11-16 03:54:57 +00:00
Devang Patel
86c9f12e47 Refactor code.
Strip debug information before stripping symbol names. 

llvm-svn: 59328
2008-11-14 22:49:37 +00:00
Devang Patel
2876af73db Really remove all debug information.
llvm-svn: 59208
2008-11-13 01:28:40 +00:00
Oscar Fuentes
444fd3cc2d CMake: Remove removed source file.
llvm-svn: 59098
2008-11-12 00:14:12 +00:00
Devang Patel
0a73799659 Remove
llvm-svn: 59093
2008-11-11 23:58:15 +00:00
Devang Patel
0616706919 Undo previous check-in.
llvm-svn: 59092
2008-11-11 23:57:33 +00:00
Oscar Fuentes
ac819d0394 CMake: Updated list of source files for lib/Transforms/Utils.
llvm-svn: 59077
2008-11-11 19:51:36 +00:00
Devang Patel
c9fdfd2f0b Add utility pass to remove dbg info.
llvm-svn: 59068
2008-11-11 19:33:39 +00:00
Devang Patel
ef6a48b56f Use actual function name in comments.
llvm-svn: 59063
2008-11-11 19:16:41 +00:00
Cedric Venet
49a701ae17 Update CMakeLists.txt
llvm-svn: 59039
2008-11-11 09:55:48 +00:00
Devang Patel
fbb29cdaee Cleanup debug info. assocated with deleted instructions.
llvm-svn: 59012
2008-11-11 00:54:10 +00:00
Devang Patel
ec4ae29ae4 Add utility routines to remove dead debug info.
llvm-svn: 59011
2008-11-11 00:53:02 +00:00
Devang Patel
f0d6bd18d5 If the sign of exit condition and split condition does not match
then do not split loop index.

llvm-svn: 58995
2008-11-10 19:48:34 +00:00
Bill Wendling
b7d5ca543e Third time's a charm.
The previous patches didn't match correctly. Also, we need to make sure that
the conditional is the same before doing the transformation.

llvm-svn: 58978
2008-11-10 06:59:06 +00:00
Mon P Wang
911ee5bf8b Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> 

llvm-svn: 58964
2008-11-10 04:46:22 +00:00
Bill Wendling
137550d34d Correction for the last patch. Should match the conditional in the first part
of the select match, not the select instruction itself.

llvm-svn: 58947
2008-11-09 23:37:53 +00:00
Bill Wendling
3b91357ef0 The method of doing the matching with a 'select' instruction was wrong. The
original code was matching like this:

	if (match(A, m_Not(m_Value(B))))

B was already matched as a 'select' instruction. However, this isn't matching
what we think it's matching. It would match B as a 'Value', so basically
anything would match to it. In this case, a Constant matched. B was replaced
with a constant representation. And then the wrong value would be used in the
SelectInst::Create statement, causing a crash.

After thinking on this for a moment, and after Nick L. told me how the pattern
matching stuff was supposed to work, the solution was to match NOT an m_Value,
but an m_Select.

llvm-svn: 58946
2008-11-09 23:17:42 +00:00
Nuno Lopes
6dfcc8cf45 fix leakage of ValueNumbering
llvm-svn: 58933
2008-11-09 12:45:23 +00:00
Bill Wendling
436d4cce83 If the LHS of the FCMP is coming from a UIToFP instruction, then we don't want
to generate signed ICMP instructions to replace the FCMP. This would violate
the following:

define i1 @test1(i32 %val) {
  %1 = uitofp i32 %val to double
  %2 = fcmp ole double %1, 0.000000e+00
  ret i1 %2
}

would be transformed into:

define i1 @test1(i32 %val) {
  %1 = icmp slt i33 %val, 1
  ret i1 %1
}

which is obviously wrong. This patch modifes InstCombiner::FoldFCmp_IntToFP_Cst
to handle when the LHS comes from UIToFP.

llvm-svn: 58929
2008-11-09 04:26:50 +00:00
Daniel Dunbar
ce947e0039 Rework r58829, allowing removal of dbg info intrinsics during alloca
promotion.
 - Eliminate uses after free and simplify tests.

Devang: Please check that this is still doing what you intended.
llvm-svn: 58887
2008-11-08 04:12:17 +00:00
Bill Wendling
a5eb92b137 BCUI + 1 doesn't work. Use next instead.
llvm-svn: 58830
2008-11-07 01:59:41 +00:00
Devang Patel
0958cd6437 Handle (delete) dbg intrinsics while promoting alloca.
llvm-svn: 58826
2008-11-07 01:30:07 +00:00
Mon P Wang
888f4e6fb0 Fixed scalarizing an extract subvector and prevent an infinite loop
when simplify a vector. 

llvm-svn: 58820
2008-11-06 22:52:21 +00:00
Devang Patel
cea9dfa11f InstructionNamer preserves everything.
llvm-svn: 58787
2008-11-06 01:00:16 +00:00
Devang Patel
de9b95965a Do now allow InlineAlways pass to remove dead functions.
llvm-svn: 58744
2008-11-05 01:39:16 +00:00
Devang Patel
bc6ef4c191 Check Attribute::NoInline.
llvm-svn: 58742
2008-11-05 01:37:05 +00:00
Oscar Fuentes
afb65a6c2a CMake: updated list of source files.
llvm-svn: 58736
2008-11-05 00:11:22 +00:00
Dan Gohman
c162a200ad Add a new pass to simplify specific half_powr function calls. This is
a specialized pass that it not likely to be generally useful.

llvm-svn: 58732
2008-11-04 23:41:45 +00:00
Dale Johannesen
e51c5296a6 Allow SROA of vectors. Removing this caused a
huge performance regression in something we care
about.  This may not be final fix.

llvm-svn: 58718
2008-11-04 20:54:03 +00:00
Devang Patel
40cfcf7ce2 Fix unused variable warnings.
llvm-svn: 58651
2008-11-03 23:14:09 +00:00
Devang Patel
c959b4dbd3 Ignore conditions that are outside the loop.
llvm-svn: 58631
2008-11-03 19:38:07 +00:00
Andrew Lenharth
97343f0e8b add a period at the end of the comment, ignoring the fact that the comment would be hard pressed to be considered a sentence, but if it makes Bill happy...
llvm-svn: 58630
2008-11-03 19:29:29 +00:00
Devang Patel
78b7de25d1 Turn floating point IVs into integer IVs where possible.
This allows SCEV users to effectively calculate trip count.
LSR later on transforms back integer IVs to floating point IVs
later on to avoid int-to-float casts inside the loop.

llvm-svn: 58625
2008-11-03 18:32:19 +00:00
Andrew Lenharth
312c00cdd4 Ensure that we are checking only calls to the function we are interested in specializing
llvm-svn: 58615
2008-11-03 16:05:35 +00:00
Nick Lewycky
f393d56364 Replace explicit loop with utility function.
llvm-svn: 58593
2008-11-03 03:49:14 +00:00
Nick Lewycky
49abbde699 Changes from Duncan's review:
* merge two weak functions by making them both alias a third non-weak fn
 * don't reimplement CallSite::hasArgument
 * whitelist the safe linkage types

llvm-svn: 58568
2008-11-02 16:46:26 +00:00
Duncan Sands
613d060c2e Get this building on 64 bit machines (error:
cast from ‘const llvm::PointerType*’ to ‘unsigned int’
loses precision).

llvm-svn: 58561
2008-11-02 09:00:33 +00:00
Oscar Fuentes
45b63793cf CMake: added a source file.
llvm-svn: 58559
2008-11-02 06:01:39 +00:00
Nick Lewycky
15a23d029c Add a new MergeFunctions pass. It finds identical functions and merges them.
This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.

llvm-svn: 58557
2008-11-02 05:52:50 +00:00
Nick Lewycky
bcadcbb1ec Fix demanded bits analysis with srem by negative number. Based on a patch
by Richard Osborne.

llvm-svn: 58555
2008-11-02 02:41:50 +00:00
Dan Gohman
1f1ebc5389 Fix this recently moved code to use the correct type. CI is now a
ConstantInt, and SI is the original cast instruction. This fixes
PR2996.

llvm-svn: 58549
2008-11-02 00:17:33 +00:00
Daniel Dunbar
8abdac1eb4 Fix warning.
llvm-svn: 58486
2008-10-31 01:50:01 +00:00
Dan Gohman
50061675c5 Canonicalize sext(i1) to i1?-1:0, and update various instcombine
optimizations accordingly.

llvm-svn: 58457
2008-10-30 20:40:10 +00:00
Daniel Dunbar
097da598fb Add InlineCost class for represent the estimated cost of inlining a
function.
 - This explicitly models the costs for functions which should
   "always" or "never" be inlined. This fixes bugs where such costs
   were not previously respected.

llvm-svn: 58450
2008-10-30 19:26:59 +00:00
Chris Lattner
4af91a146a Fix PR2967 by not deleting volatile load/stores that occur before unreachable.
I don't really see this as being needed, but there is little harm from doing
it.

llvm-svn: 58385
2008-10-29 17:46:26 +00:00
Daniel Dunbar
2265cf485e Factor shouldInline method out of Inliner.
- No functionality change.

llvm-svn: 58355
2008-10-29 01:02:02 +00:00