1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

6501 Commits

Author SHA1 Message Date
Evan Cheng
db47eab2a3 Re-commit 97860 with fix. getMallocAllocatedType may return null.
llvm-svn: 98000
2010-03-08 22:54:36 +00:00
Devang Patel
176dc29a62 Avoid using DIDescriptor.isNull().
This is a first step towards eliminating checks in Descriptor constructors.

llvm-svn: 97975
2010-03-08 20:52:55 +00:00
Devang Patel
a716e313d6 Revert r97947.
llvm-svn: 97963
2010-03-08 19:20:38 +00:00
Devang Patel
1527b2657b Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.

llvm-svn: 97947
2010-03-08 18:25:48 +00:00
Eric Christopher
b7e9bf6e57 Let the fallthrough handle whether or not we've changed anything
before we try to optimize.

llvm-svn: 97876
2010-03-06 10:59:25 +00:00
Eric Christopher
a671e4f7aa Migrate _chk call lowering from SimplifyLibCalls to InstCombine. Stub
out the remainder of the calls that we should lower in some way and
move the tests to the new correct directory. Fix up tests that are now
optimized more than they were before by -instcombine.

llvm-svn: 97875
2010-03-06 10:50:38 +00:00
Eric Christopher
b3f0926f84 Temporarily revert:
Log:
Transform @llvm.objectsize to integer if the argument is a result of malloc of known size.

Modified:
   llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
   llvm/trunk/test/Transforms/InstCombine/objsize.ll

It appears to be causing swb and nightly test failures.

llvm-svn: 97866
2010-03-06 03:11:35 +00:00
Evan Cheng
071e007ce6 Transform @llvm.objectsize to integer if the argument is a result of malloc of known size.
llvm-svn: 97860
2010-03-06 01:01:42 +00:00
Ted Kremenek
24e16cd322 Update CMake build.
llvm-svn: 97846
2010-03-05 22:34:16 +00:00
Eric Christopher
dfb465a816 Move SimplifyLibCalls's LibCall builders to a separate file so they
can be used in more places.  Add an argument for the TargetData that
most of them need. Update for the getInt8PtrTy() change.  Should be
no functionality change.

llvm-svn: 97844
2010-03-05 22:25:30 +00:00
Evan Cheng
3346ea1d4e Safely turn memset_chk etc. to non-chk variant if the known object size is >= memset / memcpy / memmove size.
llvm-svn: 97828
2010-03-05 20:59:47 +00:00
Evan Cheng
782183fe4a Instcombine should turn llvm.objectsize of a alloca with static size to an integer.
llvm-svn: 97827
2010-03-05 20:47:23 +00:00
Chris Lattner
789121d6e2 fix PR6512, a case where instcombine would incorrectly merge loads
from different addr spaces.

llvm-svn: 97813
2010-03-05 18:53:28 +00:00
Chris Lattner
617f774b4e Fix PR6503. This turned into a much more interesting and nasty bug. Various
parts of the cmp|cmp and cmp&cmp folding logic wasn't prepared for vectors
(unrelated to the bug but noticed while in the code) and the code was 
*definitely* not safe to use by the (cast icmp)|(cast icmp) handling logic
that I added in r95855.  Fix all this up by changing the various routines
to more consistently use IRBuilder and not pass in the I which had the wrong 
type.

llvm-svn: 97801
2010-03-05 08:46:26 +00:00
Chris Lattner
bb443e70aa simplify some functions and make them work with vector
compares, noticed by inspection.

llvm-svn: 97795
2010-03-05 07:47:57 +00:00
Chris Lattner
e457488032 fix a nice subtle reassociate bug which would only occur
in a very specific use pattern embodied in the carefully
reduced testcase.

llvm-svn: 97794
2010-03-05 07:18:54 +00:00
Eric Christopher
3e3c445c81 Move GetStringLength and helper from SimplifyLibCalls to ValueTracking.
No functionality change.

llvm-svn: 97793
2010-03-05 06:58:57 +00:00
Evan Cheng
340941a422 Add missing break for Intrinsic::objectsize case. It was falling through to the following Intrinsic::bswap code. I have no idea why it wasn't breaking stuff.
llvm-svn: 97774
2010-03-05 01:22:47 +00:00
Dan Gohman
4d2339f18d Make SCEVExpander and LSR more aggressive about hoisting expressions out
of loops.

llvm-svn: 97642
2010-03-03 05:29:13 +00:00
Bill Wendling
d1f658563d This test case:
long test(long x) { return (x & 123124) | 3; }

Currently compiles to:

_test:
        orl     $3, %edi
        movq    %rdi, %rax
        andq    $123127, %rax
        ret

This is because instruction and DAG combiners canonicalize

  (or (and x, C), D) -> (and (or, D), (C | D))

However, this is only profitable if (C & D) != 0. It gets in the way of the
3-addressification because the input bits are known to be zero.

llvm-svn: 97616
2010-03-03 00:35:56 +00:00
Dan Gohman
1625456786 Non-affine post-inc SCEV expansions have more code which must be
emitted after the increment. Make sure the insert position
reflects this. This fixes PR6453.

llvm-svn: 97537
2010-03-02 01:59:21 +00:00
Dan Gohman
37bf232609 Floating-point add, sub, and mul are now spelled fadd, fsub, and fmul,
respectively.

llvm-svn: 97531
2010-03-02 01:11:08 +00:00
Bob Wilson
12797a7a6c Don't attempt load PRE when there is no real redundancy (i.e., the load is in
a loop and is itself the only dependency).

llvm-svn: 97526
2010-03-02 00:09:29 +00:00
Bob Wilson
9207e3f81f When GVN needs to split critical edges for load PRE, check all of the
predecessors before returning.  Otherwise, if multiple predecessor edges need
splitting, we only get one of them per iteration.  This makes a small but
measurable compile time improvement with -enable-full-load-pre.

llvm-svn: 97521
2010-03-01 23:37:32 +00:00
Evan Cheng
c97b5fe4b9 MemoryDepAnalysis is not used if redundant load processing is disabled.
llvm-svn: 97512
2010-03-01 22:23:12 +00:00
Dan Gohman
3691dbc5cf Add some debug output to LoopSimplify.
llvm-svn: 97458
2010-03-01 17:55:27 +00:00
Dan Gohman
c08c48c9f3 Spelling fixes.
llvm-svn: 97453
2010-03-01 17:49:51 +00:00
Dan Gohman
25af6486ae Prune #includes.
llvm-svn: 97448
2010-03-01 17:42:17 +00:00
Bob Wilson
6d8360b3d8 Revert r97245 which seems to be causing performance problems.
llvm-svn: 97366
2010-02-28 05:34:05 +00:00
Chris Lattner
ca018ea20b fix grammaro's pointed out by daniel
llvm-svn: 97313
2010-02-27 07:50:40 +00:00
Chris Lattner
93fd3ddf24 fix PR6414, a nondeterminism issue in IPSCCP which was because
of a subtle interation in a loop operating in densemap order.

llvm-svn: 97288
2010-02-27 00:07:42 +00:00
Chris Lattner
8e0bfd5ce0 Fix rdar://7694996 a miscompile of 183.equake from my patch yesterday,
confusing the old MAT variable with the new GlobalType one.  This caused
us to promote the @disp global pointer into:

@disp.body = internal global double*** undef

instead of:

@disp.body = internal global [3 x double**] undef

llvm-svn: 97285
2010-02-26 23:42:13 +00:00
Chris Lattner
995bac5839 remove dead code, by this point all uses of CI are gone.
llvm-svn: 97283
2010-02-26 23:35:25 +00:00
Bob Wilson
139fdbd4d2 Move the EnableFullLoadPRE flag from a separate command-line option to an
argument of createGVNPass and set it automatically for -O3.

llvm-svn: 97245
2010-02-26 19:09:47 +00:00
Bob Wilson
cf20a07501 Remove unused "NoPRE" parameter in GVN and createGVNPass().
llvm-svn: 97235
2010-02-26 18:35:19 +00:00
Chris Lattner
3832b527d8 fix PR6435 another bug from the MallocInst elimination work.
llvm-svn: 97231
2010-02-26 18:23:13 +00:00
Chris Lattner
8cb1dc746d rewrite OptimizeGlobalAddressOfMalloc to fix PR6422, some bugs
introduced when mallocinst was eliminated. 

llvm-svn: 97178
2010-02-25 22:33:52 +00:00
Dan Gohman
52ed61204b Make LoopSimplify change conditional branches in loop exiting blocks
which branch on undef to branch on a boolean constant for the edge
exiting the loop. This helps ScalarEvolution compute trip counts for
loops.

Teach ScalarEvolution to recognize single-value PHIs, when safe, and
ForgetSymbolicName to forget such single-value PHI nodes as apprpriate
in ForgetSymbolicName.

llvm-svn: 97126
2010-02-25 06:57:05 +00:00
Nick Lewycky
e0601cb7f8 Modernize comment.
llvm-svn: 97121
2010-02-25 06:39:10 +00:00
Nick Lewycky
772e9deb48 Correct whitespace.
llvm-svn: 97120
2010-02-25 06:38:51 +00:00
Daniel Dunbar
8adb7774dc Reapply r97010, the speculative revert failed.
llvm-svn: 97036
2010-02-24 08:48:04 +00:00
Daniel Dunbar
8b33ce41d0 Speculatively revert r97010, "Add an argument to PHITranslateValue to specify
the DominatorTree. ...", in hopes of restoring poor old PPC bootstrap.

llvm-svn: 97027
2010-02-24 06:55:22 +00:00
Dan Gohman
c97d42a5d5 Fix indentation.
llvm-svn: 97024
2010-02-24 06:46:09 +00:00
Bob Wilson
437d85dd57 Add an argument to PHITranslateValue to specify the DominatorTree. If this
argument is non-null, pass it along to PHITranslateSubExpr so that it can
prefer using existing values that dominate the PredBB, instead of just
blindly picking the first equivalent value that it finds on a uselist.
Also when the DominatorTree is specified, have PHITranslateValue filter
out any result that does not dominate the PredBB.  This is basically just
refactoring the check that used to be in GetAvailablePHITranslatedSubExpr
and also in GVN.

Despite my initial expectations, this change does not affect the results
of GVN for any testcases that I could find, but it should help compile time.
Before this change, if PHITranslateSubExpr picked a value that does not
dominate, PHITranslateWithInsertion would then insert a new value, which GVN
would later determine to be redundant and would replace.  By picking a good
value to begin with, we save GVN the extra work of inserting and then
replacing a new value.

llvm-svn: 97010
2010-02-24 01:39:00 +00:00
Dan Gohman
b3bf4992c5 Don't do (X != Y) ? X : Y -> X for floating-point values; it doesn't
handle NaN properly.

Do (X une Y) ? X : Y  -> X if one of X and Y is not zero.

llvm-svn: 96955
2010-02-23 17:17:57 +00:00
Bob Wilson
b3640f8018 Update memdep when load PRE inserts a new load, and add some debug output.
I don't have a small testcase for this.

llvm-svn: 96890
2010-02-23 05:55:00 +00:00
Evan Cheng
d9816ef946 Instcombine constant folding can normalize gep with negative index to index with large offset. When instcombine objsize checking transformation sees these geps where the offset seemingly point out of bound, it should just return "i don't know" rather than asserting.
llvm-svn: 96825
2010-02-22 23:34:00 +00:00
Bob Wilson
e075edf725 Erase deleted instructions from GVN's ValueTable. This fixes assertion
failures from ValueTable::verifyRemoved() when using -debug.

llvm-svn: 96805
2010-02-22 21:39:41 +00:00
Dan Gohman
2575392bf1 Remove unused variables and parameters.
llvm-svn: 96780
2010-02-22 04:11:59 +00:00
Dan Gohman
c44dee5fbd When emitting an instruction which depends on both a post-incremented
induction variable value and a loop-variant value, don't force the
insert position to be at the post-increment position, because it may
not be dominated by the loop-variant value. This fixes a
use-before-def problem noticed on PPC.

llvm-svn: 96774
2010-02-22 03:59:54 +00:00