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

2223 Commits

Author SHA1 Message Date
Christopher Lamb
051a1320e8 Fix comments
llvm-svn: 45170
2007-12-18 20:33:11 +00:00
Christopher Lamb
d56318b885 Remove an orthogonal transformation of the selection condition from my most recent submission.
llvm-svn: 45169
2007-12-18 20:30:28 +00:00
Duncan Sands
242f80be86 Rename isNoReturn to doesNotReturn, and isNoUnwind to
doesNotThrow.

llvm-svn: 45160
2007-12-18 09:59:50 +00:00
Christopher Lamb
437b4d229e Fix typos.
llvm-svn: 45159
2007-12-18 09:45:40 +00:00
Christopher Lamb
aeb76743dc Fold certain additions through selects (and their compares) so as to eliminate subtractions. This code is often produced by the SMAX expansion in SCEV.
This implements test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll

llvm-svn: 45158
2007-12-18 09:34:41 +00:00
David Greene
3f3a521a33 Get rid of annoying spaces.
llvm-svn: 45100
2007-12-17 17:40:29 +00:00
David Greene
8fda00ca05 Fix GLIBCXX_DEBUG errors. Erase invalidates std::vector iterators
passed the erased element.

llvm-svn: 45099
2007-12-17 17:39:51 +00:00
Christopher Lamb
a608afb52e Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
llvm-svn: 45082
2007-12-17 01:12:55 +00:00
Duncan Sands
bf62f62058 Make instcombine promote inline asm calls to 'nounwind'
calls.  Remove special casing of inline asm from the
inliner.  There is a potential problem: the verifier
rejects invokes of inline asm (not sure why).  If an
asm call is not marked "nounwind" in some .ll, and
instcombine is not run, but the inliner is run, then
an illegal module will be created.  This is bad but
I'm not sure what the best approach is.  I'm tempted
to remove the check in the verifier...

llvm-svn: 45073
2007-12-16 15:51:49 +00:00
Evan Cheng
4acb4eb95e Fix typo.
llvm-svn: 44997
2007-12-13 07:50:36 +00:00
Evan Cheng
a152909956 Be extra careful with extension use optimation. Now turned on by default.
llvm-svn: 44981
2007-12-13 03:32:53 +00:00
Wojciech Matyjewicz
8bb1d9e67c 1. "Upgrage" comments.
2. Using zero-extended value of Scale and unsigned division is safe provided
   that Scale doesn't have the sign bit set.
   Previously these 2 instructions:
        %p = bitcast [100 x {i8,i8,i8}]* %x to i8*
        %q = getelementptr i8* %p, i32 -4
   were combined into:
        %q = getelementptr [100 x { i8, i8, i8 }]* %x, i32 0,
               i32 1431655764, i32 0
   what was incorrect.

llvm-svn: 44936
2007-12-12 15:21:32 +00:00
Evan Cheng
bb418c4551 Don't muck with phi nodes; bug fixes.
llvm-svn: 44905
2007-12-12 02:53:41 +00:00
Evan Cheng
d6ecb2e58d Bug fix. Only safe to perform extension uses optimization if the source of extension is also defined in the same BB as the extension.
llvm-svn: 44896
2007-12-12 00:51:06 +00:00
Duncan Sands
b7ac459292 Make PruneEH update the nounwind/noreturn attributes
on functions as it calculates them.

llvm-svn: 44802
2007-12-10 19:09:40 +00:00
Owen Anderson
e3de18ac1d Fix several cache coherence bugs in MemDep/GVN that were found. Also add some (disabled) debugging code
to make such problems easier to diagnose in the future, written by Duncan Sands.

llvm-svn: 44695
2007-12-08 01:37:09 +00:00
Chris Lattner
861df2f4e9 simplify some code.
llvm-svn: 44655
2007-12-06 06:25:04 +00:00
Chris Lattner
1f2a96f9c1 move some ashr-specific code out of commonShiftTransforms into visitAShr.
llvm-svn: 44650
2007-12-06 01:59:46 +00:00
Evan Cheng
9e69c0ada8 If both result of the {s|z}xt and its source are live out, rewrite all uses of the source with result of extension.
llvm-svn: 44643
2007-12-05 23:58:20 +00:00
Duncan Sands
1e2e4972ff Rather than having special rules like "intrinsics cannot
throw exceptions", just mark intrinsics with the nounwind
attribute.  Likewise, mark intrinsics as readnone/readonly
and get rid of special aliasing logic (which didn't use
anything more than this anyway).

llvm-svn: 44544
2007-12-03 20:06:50 +00:00
Chris Lattner
0c41f32943 update file comment.
llvm-svn: 44543
2007-12-03 19:43:18 +00:00
Devang Patel
c47f68e747 If ExitValue operand is also defined in Loop header then
insert new ExitValue after this operand definition.

This fixes PR1828.

llvm-svn: 44539
2007-12-03 19:17:21 +00:00
Duncan Sands
14f11d6836 Integrate the readonly/readnone logic more deeply
into alias analysis.  This meant updating the API
which now has versions of the getModRefBehavior,
doesNotAccessMemory and onlyReadsMemory methods
which take a callsite parameter.  These should be
used unless the callsite is not known, since in
general they can do a better job than the versions
that take a function.  Also, users should no longer
call the version of getModRefBehavior that takes
both a function and a callsite.  To reduce the
chance of misuse it is now protected.

llvm-svn: 44487
2007-12-01 07:51:45 +00:00
Owen Anderson
3b893e1f84 Fix a miscompilation in spiff on PPC.
llvm-svn: 44437
2007-11-29 18:02:22 +00:00
Duncan Sands
1b0feb42e2 Add some convenience methods for querying attributes, and
use them.

llvm-svn: 44403
2007-11-28 17:07:01 +00:00
Duncan Sands
3602011bec Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.

llvm-svn: 44359
2007-11-27 13:23:08 +00:00
Owen Anderson
43d4a82d4b Make LoopInfoBase more generic, in preparation for having MachineLoopInfo. This involves a small interface change.
llvm-svn: 44348
2007-11-27 03:43:35 +00:00
Owen Anderson
2aa0218a6c Fix another bug that was causing siod to fail.
llvm-svn: 44325
2007-11-26 07:17:19 +00:00
Owen Anderson
05275b7b14 Allow GVN to eliminate read-only function calls when it can detect that they are redundant.
llvm-svn: 44323
2007-11-26 02:26:36 +00:00
Anton Korobeynikov
14246a2eba Remove another leak. Due to some reason AliasSetTracker didn't had any dtor...
llvm-svn: 44320
2007-11-25 23:52:02 +00:00
Chris Lattner
d1e03b5387 Implement PR1822
llvm-svn: 44318
2007-11-25 21:27:53 +00:00
Duncan Sands
114968a3e8 Fix PR1816. If a bitcast of a function only exists because of a
trivial difference in function attributes, allow calls to it to
be converted to direct calls.  Based on a patch by Török Edwin.
While there, move the various lists of mutually incompatible
parameters etc out of the verifier and into ParameterAttributes.h.

llvm-svn: 44315
2007-11-25 14:10:56 +00:00
Chris Lattner
642ae99085 add a comment.
llvm-svn: 44293
2007-11-23 22:35:18 +00:00
Duncan Sands
0973ae4c8c Remove some logic I thoughtlessly copied over
from the old ADCE implementation (there it was
correct because the transform was being done
for read-only functions).

llvm-svn: 44287
2007-11-23 09:10:17 +00:00
Chris Lattner
bff48b8f0d Fix PR1817.
llvm-svn: 44284
2007-11-22 23:47:13 +00:00
Duncan Sands
e79932aed4 Turn invokes of nounwind functions into ordinary calls.
llvm-svn: 44280
2007-11-22 22:24:59 +00:00
Duncan Sands
6ec98952e0 Readonly/readnone functions are allowed to throw
exceptions, so don't turn invokes of them into
calls.

llvm-svn: 44278
2007-11-22 21:40:06 +00:00
Nick Lewycky
a734aa84f3 typo
llvm-svn: 44262
2007-11-21 05:21:54 +00:00
Dan Gohman
760d574313 Add explicit keywords.
llvm-svn: 44234
2007-11-19 15:30:20 +00:00
Dale Johannesen
c5032e5366 Remove indeterminism from a loop. We think this will
fix an occasional nonrepeatable bootstrap failure we've
been seeing on Darwin.

llvm-svn: 44202
2007-11-17 02:48:01 +00:00
Chris Lattner
5574ba5ce6 Fix PR1800 by correcting mistaken logic.
llvm-svn: 44188
2007-11-16 06:04:17 +00:00
Chris Lattner
3b66875602 Implement PR1796 and Transforms/SimplifyCFG/noreturn-call.ll
by inserting unreachable after no-return calls.

llvm-svn: 44099
2007-11-14 06:19:25 +00:00
Chris Lattner
2d15a52df0 Implement PR1786 by iterating between dead cycle elimination
and simplifycfg in the rare cases when it is needed.

llvm-svn: 44044
2007-11-13 07:32:38 +00:00
Andrew Lenharth
83adca5075 Better check
llvm-svn: 43897
2007-11-08 18:45:15 +00:00
Andrew Lenharth
310a65171d Fix PR1780
llvm-svn: 43893
2007-11-08 17:39:28 +00:00
Chris Lattner
8e982efdc5 fix const correctness, BB is const, so its predecessors are too
llvm-svn: 43780
2007-11-06 22:07:40 +00:00
Chris Lattner
2a909d32b6 don't put erase or query for non-allocainst pointers in an set of allocainsts*'s
llvm-svn: 43779
2007-11-06 22:07:22 +00:00
Chris Lattner
907b9b92fe Implement PR1777 by detecting dependent phis that
all compute the same value.

llvm-svn: 43777
2007-11-06 21:52:06 +00:00
Duncan Sands
59b08debe3 At the point of calculating the shift amount, the
type of SV has changed from what it originally was.
However we need the store width of the original.

llvm-svn: 43775
2007-11-06 20:39:11 +00:00
Chris Lattner
e194944b29 wrap long lines
llvm-svn: 43745
2007-11-06 01:15:27 +00:00