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

4467 Commits

Author SHA1 Message Date
Dan Gohman
5e154a591d Fix a vectorshuffle instcombine bug introduced by r55995.
Patch by Nicolas Capens!

llvm-svn: 56129
2008-09-11 22:47:57 +00:00
Dan Gohman
4ae5fa57b4 Fix a copy+paste bug that Duncan spotted. For several
cases it was still getting lucky and detecting overflow
but it was clearly incorrect.

llvm-svn: 56113
2008-09-11 18:53:02 +00:00
Dan Gohman
36e01356ec In my analysis for r56076 I missed the case where the original
multiplication overflows.

llvm-svn: 56082
2008-09-11 00:25:00 +00:00
Dan Gohman
ebfb483309 Fix an icmp+sdiv optimization to check for and handle an overflow
condition. This fixes PR2740.

llvm-svn: 56076
2008-09-10 23:30:57 +00:00
Devang Patel
092285d4e4 fix white spaces.
llvm-svn: 56056
2008-09-10 14:49:55 +00:00
Dan Gohman
3809753d3b Fix a warning about comparing signed and unsigned values.
llvm-svn: 56040
2008-09-10 01:09:32 +00:00
Devang Patel
7365754925 if loop induction variable is always sign or zero extended then
extend the type of induction variable.

llvm-svn: 56017
2008-09-09 21:41:07 +00:00
Devang Patel
36ad68421e fix overflow check.
llvm-svn: 56011
2008-09-09 20:54:34 +00:00
Anton Korobeynikov
6ad8b060d0 Make safer variant of alias resolution routine to be default
llvm-svn: 56005
2008-09-09 20:05:04 +00:00
Anton Korobeynikov
4676c09dc8 Resolve aliases, when possible
llvm-svn: 56001
2008-09-09 19:04:59 +00:00
Dan Gohman
28c911b79b Make SimplifyDemandedVectorElts simplify vectors with multiple
users, and teach it about shufflevector instructions.

Also, fix a subtle bug in SimplifyDemandedVectorElts'
insertelement code.

This is a patch that was originally written by Eli Friedman,
with some fixes and cleanup by me.

llvm-svn: 55995
2008-09-09 18:11:14 +00:00
Devang Patel
b6380f607d Fix simplifycfg crash in handing block merge.
llvm-svn: 55971
2008-09-09 01:06:56 +00:00
Devang Patel
7df7366784 s/RemoveUnreachableBlocks/RemoveUnreachableBlocksFromFn/g
llvm-svn: 55965
2008-09-08 22:14:17 +00:00
Devang Patel
f341d87755 Remove unused counter.
llvm-svn: 55924
2008-09-08 17:14:54 +00:00
Devang Patel
071f99e1df Remove OptimizeIVType()
llvm-svn: 55913
2008-09-08 16:13:27 +00:00
Duncan Sands
0fcef7437c Update the callgraph correctly.
llvm-svn: 55896
2008-09-08 11:08:09 +00:00
Duncan Sands
62431a29a5 Update the callgraph correctly in ArgumentPromotion.
llvm-svn: 55895
2008-09-08 11:07:35 +00:00
Duncan Sands
58d434d3e8 Reapply 55859. This doesn't change anything as
long as the callgraph is correct.  It checks
for wrong callgraphs more strictly.

llvm-svn: 55894
2008-09-08 11:05:51 +00:00
Duncan Sands
ae32389a41 Correct a comment and strip trailing whitespace.
llvm-svn: 55883
2008-09-07 09:54:09 +00:00
Nuno Lopes
a03bc9ce10 fix crash when the malloc/free function is defined or is a declaration with 0 parameters.
this pass doesnt seem to be used, but still it's now a little more correct

llvm-svn: 55873
2008-09-06 17:44:06 +00:00
Duncan Sands
c4ec7871bf When PruneEH turned an invoke into an ordinary
call (thus changing the call site) it didn't
inform the callgraph about this.  But the
call site does matter - as shown by the testcase,
the callgraph become invalid after the inliner
ran (with an edge between two functions simply
missing), resulting in wrong deductions by
GlobalsModRef.

llvm-svn: 55872
2008-09-06 17:19:29 +00:00
Owen Anderson
453bcfcf8d Revert r55859. This is breaking the build in the abscence of its companion commit.
llvm-svn: 55865
2008-09-05 23:36:01 +00:00
Devang Patel
4148488e49 Remove unused map.
llvm-svn: 55861
2008-09-05 21:55:33 +00:00
Duncan Sands
fdfa2d24fe Delete the removeCallEdgeTo callgraph method,
because it does not maintain a correct list
of callsites.  I discovered (see following
commit) that the inliner will create a wrong
callgraph if it is fed a callgraph with
correct edges but incorrect callsites.  These
were created by Prune-EH, and while it wasn't
done via removeCallEdgeTo, it could have been
done via removeCallEdgeTo, which is an accident
waiting to happen.  Use removeCallEdgeFor
instead.

llvm-svn: 55859
2008-09-05 21:43:04 +00:00
Duncan Sands
b63fde1edb Use removeAllCalledFunctions rather than removing
edges one by one by hand.

llvm-svn: 55836
2008-09-05 14:56:53 +00:00
Duncan Sands
c568792f0a Remove trailing whitespace.
llvm-svn: 55835
2008-09-05 12:37:12 +00:00
Duncan Sands
8de0cd8f10 Make this pass return that it made a change if
it modifies a functions attributes.

llvm-svn: 55831
2008-09-05 09:08:37 +00:00
Devang Patel
3d42ac68df A loop may be unswitched multiple times. Reconstruct dom info. at the end.
llvm-svn: 55806
2008-09-04 22:43:59 +00:00
Devang Patel
25b88b66e8 Initialize loop data first.
llvm-svn: 55792
2008-09-04 20:36:36 +00:00
Devang Patel
c96f319a3c Do not unswitch if the function notes say we're optimizing this function for size.
llvm-svn: 55786
2008-09-04 18:55:13 +00:00
Andrew Lenharth
4523deb38b try to seperate the mechanism into something others can use
llvm-svn: 55785
2008-09-04 18:51:26 +00:00
Dale Johannesen
bbd799c544 Add intrinsic forms of pow and exp2. The non-intrinsic
forms remain to handle older IR files, but will go away soon.

llvm-svn: 55781
2008-09-04 18:30:46 +00:00
Dan Gohman
e1f9be27bc Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Andrew Lenharth
9e27a7b4b0 cleanup as per Duncan's review
llvm-svn: 55766
2008-09-04 14:34:22 +00:00
Devang Patel
49483d797e Update inline threshold for current function if the notes say, optimize for size.
llvm-svn: 55745
2008-09-03 23:06:09 +00:00
Owen Anderson
94bd638e81 Fix a bug that prevented PRE from applying in some cases.
llvm-svn: 55744
2008-09-03 23:06:07 +00:00
Andrew Lenharth
4a69775c64 Initial version of a Partial Specialization IPO pass. It triggers a couple hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still.
llvm-svn: 55734
2008-09-03 21:00:28 +00:00
Devang Patel
41331065dd Fix typo in a comment.
llvm-svn: 55720
2008-09-03 20:25:40 +00:00
Devang Patel
b25dcdea78 Add parentheses to make code more readable.
llvm-svn: 55717
2008-09-03 19:57:15 +00:00
Devang Patel
24618c5a6a Fix comments.
llvm-svn: 55716
2008-09-03 19:52:17 +00:00
Devang Patel
c70392bfcd Add custom inliner that handles only functions that are marked as always_inline.
llvm-svn: 55713
2008-09-03 18:50:53 +00:00
Devang Patel
42fe8ff6e8 Handle "always inline" note during inline cost analysis.
llvm-svn: 55712
2008-09-03 18:47:45 +00:00
Devang Patel
dae7f0b9d7 Check noinline note and ignore other notes.
llvm-svn: 55711
2008-09-03 18:46:35 +00:00
Devang Patel
653bcea20d Handle "noinline" note inside the simple inliner.
llvm-svn: 55708
2008-09-03 18:10:21 +00:00
Nick Lewycky
3b35dcc455 Don't apply this transform to vectors. Fixes PR2756.
llvm-svn: 55690
2008-09-03 06:24:21 +00:00
Devang Patel
5fa8cc79ed Add additional check to ensure that iv is canonicalized.
llvm-svn: 55682
2008-09-03 00:29:13 +00:00
Devang Patel
4dfecae8fe Check iteration count.
llvm-svn: 55680
2008-09-03 00:10:56 +00:00
Devang Patel
df5dce4aa8 While removing PHI, use basicblock to identify incoming value.
llvm-svn: 55678
2008-09-03 00:02:42 +00:00
Devang Patel
5659d2508e s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
llvm-svn: 55676
2008-09-02 22:43:57 +00:00
Devang Patel
a1e2066b1d If all IV uses are extending integer IV then change the type of IV itself, if possible.
llvm-svn: 55674
2008-09-02 22:18:08 +00:00