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

4007 Commits

Author SHA1 Message Date
Eli Friedman
0c3b1df94e A FIXME about block addresses and indirectbr.
llvm-svn: 142569
2011-10-20 04:05:33 +00:00
Eli Friedman
6ff41ea07a Simplify; no intended functional change.
llvm-svn: 142567
2011-10-20 03:23:14 +00:00
Nick Lewycky
21a67a1454 "@string = constant i8 0" is a value i8* string of length zero. Analyze that
correctly in GetStringLength, fixing PR11181!

llvm-svn: 142558
2011-10-20 00:34:35 +00:00
Chandler Carruth
12a645d6f6 Generalize the reading of probability metadata to work for both branches
and switches, with arbitrary numbers of successors. Still optimized for
the common case of 2 successors for a conditional branch.

Add a test case for switch metadata showing up in the BlockFrequencyInfo pass.

llvm-svn: 142493
2011-10-19 10:32:19 +00:00
Chandler Carruth
18a382b4b6 Teach the BranchProbabilityInfo analysis pass to read any metadata
encoding of probabilities. In the absense of metadata, it continues to
fall back on static heuristics.

This allows __builtin_expect, after lowering through llvm.expect
a branch instruction's metadata, to actually enter the branch
probability model. This is one component of resolving PR2577.

llvm-svn: 142492
2011-10-19 10:30:30 +00:00
Chandler Carruth
13b475d4f6 Add pass printing support to BlockFrequencyInfo pass. The implementation
layer already had support for printing the results of this analysis, but
the wiring was missing.

Now that printing the analysis works, actually bring some of this
analysis, and the BranchProbabilityInfo analysis that it wraps, under
test! I'm planning on fixing some bugs and doing other work here, so
having a nice place to add regression tests and a way to observe the
results is really useful.

llvm-svn: 142491
2011-10-19 10:12:41 +00:00
Devang Patel
fb32a2ca1b Update DebugInfoFinder to match recent debug info encoding changes.
llvm-svn: 142295
2011-10-17 22:30:34 +00:00
Bill Wendling
584c5f9c62 Correct over-zealous removal of hack.
Some code want to check that *any* call within a function has the 'returns
twice' attribute, not just that the current function has one.

llvm-svn: 142221
2011-10-17 18:43:40 +00:00
Bill Wendling
2ee7de36b8 Now that we have the ReturnsTwice function attribute, this method is
obsolete. Check the attribute instead.
<rdar://problem/8031714>

llvm-svn: 142212
2011-10-17 18:22:52 +00:00
Chandler Carruth
0334d27ec8 Delete a dead member. Dunno if this was ever used, but the current code
directly manipulates the weights inside of the BranchProbabilityInfo
that is passed in.

llvm-svn: 142163
2011-10-16 22:27:54 +00:00
Andrew Trick
0ef2965563 Fix SCEVExpander assert during LSR: "argument of incompatible type".
Just because we're dealing with a GEP doesn't mean we can assert the
SCEV has a pointer type. The fix is simply to ignore the SCEV pointer
type, which we really didn't need.
Fixes PR11138 webkit crash.

llvm-svn: 142058
2011-10-15 06:19:55 +00:00
Nick Lewycky
610fc64d78 An instruction's operands aren't necessarily instructions or constants. They
could be arguments, for example.

No testcase because this is a bug-fix broken out of a larger optimization patch.

llvm-svn: 141951
2011-10-14 09:38:46 +00:00
Eli Friedman
e702d68556 Enhance the memdep interface so that users can tell the difference between a dependency which cannot be calculated and a path reaching the entry point of the function. This patch introduces isNonFuncLocal, which replaces isUnknown in some cases.
Patch by Xiaoyi Guo.

llvm-svn: 141896
2011-10-13 22:14:57 +00:00
Andrew Trick
923129b028 Reapply r141870, SCEV expansion of post-inc.
Speculatively reapply to see if this test case still crashes on
linux. I may have fixed it in my last checkin.

llvm-svn: 141895
2011-10-13 21:55:29 +00:00
Andrew Trick
03cd1b6a5d Fix memory corruption I introduced a few checkins ago.
Self-review easily caught this obvious bug.

llvm-svn: 141880
2011-10-13 18:49:23 +00:00
Andrew Trick
109f7dbd1e Revert r141870. The test case crashes on linux with data corruption. A deeper issue was exposed.
llvm-svn: 141873
2011-10-13 17:58:24 +00:00
Andrew Trick
05d7cb17d5 LSR: Reuse the post-inc expansion of expressions.
This avoids unnecessary expansion of expressions and allows the SCEV
expander to work on expression DAGs, not just trees.
Fixes PR11090.

llvm-svn: 141870
2011-10-13 17:31:47 +00:00
Andrew Trick
38d4b87695 SCEV: Rewrite TrandformForPostIncUse to handle expression DAGs, not
just expression trees.

Partially fixes PR11090. Test case will be with the full fix.

llvm-svn: 141868
2011-10-13 17:21:09 +00:00
Andrew Trick
5286636188 Slightly more useful tracing.
llvm-svn: 141867
2011-10-13 17:06:38 +00:00
Eric Christopher
57c57a3260 Add a new wrapper node for a DILexicalBlock that encapsulates it and a
file. Since it should only be used when necessary propagate it through
the backend code generation and tweak testcases accordingly.

This helps with code like in clang's test/CodeGen/debug-info-line.c where
we have multiple #line directives within a single lexical block and want
to generate only a single block that contains each file change.

Part of rdar://10246360

llvm-svn: 141729
2011-10-11 22:59:11 +00:00
Andrew Trick
d36852e6b1 Move replaceCongruentIVs into SCEVExapander and bias toward "expanded"
IVs.

Indvars previously chose randomly between congruent IVs. Now it will
bias the decision toward IVs that SCEVExpander likes to create. This
was not done to fix any problem, it's just a welcome side effect of
factoring code.

llvm-svn: 141633
2011-10-11 02:28:51 +00:00
Andrew Trick
430029d79a Add an extra safety check in front of the optimization in r141442.
llvm-svn: 141470
2011-10-08 02:16:39 +00:00
Andrew Trick
75743b069e LSR should only reuse phis that match its formula.
Fixes rdar://problem/5064068

llvm-svn: 141442
2011-10-07 23:46:21 +00:00
Eli Friedman
4d63ca106a Remove the old atomic instrinsics. autoupgrade functionality is included with this patch.
llvm-svn: 141333
2011-10-06 23:20:49 +00:00
Andrew Trick
671f73b951 Fixes PR11070 - assert in SCEV getConstantEvolvingPHIOperands.
llvm-svn: 141219
2011-10-05 22:06:53 +00:00
Andrew Trick
94a7b27585 Typo. Thanks Bob.
llvm-svn: 141188
2011-10-05 16:52:28 +00:00
Chandler Carruth
9fc5856d54 Fix a broken assert found by -Wparentheses.
llvm-svn: 141168
2011-10-05 07:02:23 +00:00
Andrew Trick
79a14ca34e Fix disabled SCEV analysis caused r141161 and add unit test.
I noticed during self-review that my previous checkin disabled some
analysis. Even with the reenabled analysis the test case runs in about
5ms. Without the fix, it will take several minutes at least.

llvm-svn: 141164
2011-10-05 05:58:49 +00:00
Andrew Trick
5789485111 Avoid exponential recursion in SCEV getConstantEvolvingPHI and EvaluateExpression.
Note to compiler writers: never recurse on multiple instruction
operands without memoization.
Fixes rdar://10187945. Was taking 45s, now taking 5ms.

llvm-svn: 141161
2011-10-05 03:25:31 +00:00
Nick Lewycky
6833d72fc0 The product of two chrec's can always be represented as a chrec.
llvm-svn: 141066
2011-10-04 06:51:26 +00:00
Nick Lewycky
4898eef762 Reapply r140979 with fix! We never did get a testcase, but careful review of the
logic by David Meyer revealed this bug.

llvm-svn: 140992
2011-10-03 07:10:45 +00:00
Nick Lewycky
79fec8116f Revert r140979 due to reports of bootstrap failure.
llvm-svn: 140980
2011-10-03 05:14:59 +00:00
Nick Lewycky
a760a29395 Add one more case we compute a max trip count.
llvm-svn: 140979
2011-10-03 01:03:57 +00:00
Andrew Trick
0489c5410d Inlining and unrolling heuristics should be aware of free truncs.
We want heuristics to be based on accurate data, but more importantly
we don't want llvm to behave randomly. A benign trunc inserted by an
upstream pass should not cause a wild swings in optimization
level. See PR11034. It's a general problem with threshold-based
heuristics, but we can make it less bad.

llvm-svn: 140919
2011-10-01 01:39:05 +00:00
Andrew Trick
a1161d94f5 whitespace
llvm-svn: 140916
2011-10-01 01:27:56 +00:00
Andrew Trick
50915b5136 indvars: generalize SCEV getPreStartForSignExtend.
Handle general Add expressions to avoid leaving around redundant
32-bit IVs.

llvm-svn: 140701
2011-09-28 17:02:54 +00:00
Eli Friedman
f4f4a75d2b PR10628: Fix getModRefInfo so it queries the underlying alias() implementation correctly while checking nocapture calls.
llvm-svn: 140666
2011-09-28 00:34:27 +00:00
Benjamin Kramer
355b353595 Stop emitting instructions with the name "tmp" they eat up memory and have to be uniqued, without any benefit.
If someone prefers %tmp42 to %42, run instnamer.

llvm-svn: 140634
2011-09-27 20:39:19 +00:00
Eli Friedman
9c1a430966 Enhance alias analysis for atomic instructions a bit. Upgrade a couple alias-analysis tests to the new atomic instructions.
llvm-svn: 140557
2011-09-26 20:15:28 +00:00
Galina Kistanova
5d64adbe43 Fix for DbgInfoPrinter.cpp:174:12: warning: ‘LineNo’ may be used uninitialized in this function.
llvm-svn: 140281
2011-09-21 23:34:23 +00:00
Devang Patel
e5dc3a1f1e Add support to emit debug info for C++0x nullptr type.
llvm-svn: 139751
2011-09-14 23:13:28 +00:00
Eric Christopher
665ace6bce Fix typo.
llvm-svn: 139530
2011-09-12 19:58:22 +00:00
Devang Patel
c7a1210467 Add asserts to keep front-ends honest while encoding debug info into LLVM IR using DIBuilder.
llvm-svn: 139515
2011-09-12 18:26:08 +00:00
Andrew Trick
8af62b87e4 Set NSW/NUW flags on SCEVAddExpr when the operation is flagged as
such.

I'm doing this now for completeness because I can't think of/remember
any reason that it was left out. I'm not sure it will help anything,
but if we don't do it we need to explain why in comments.

llvm-svn: 139450
2011-09-10 01:09:50 +00:00
Eli Friedman
c933295353 A couple minor corrections to r139276.
llvm-svn: 139277
2011-09-08 02:37:07 +00:00
Eli Friedman
6e9cab83b0 Fix the logic in BasicAliasAnalysis::aliasGEP for comparing GEP's with variable differences so that it actually does something sane. Fixes PR10881.
llvm-svn: 139276
2011-09-08 02:23:31 +00:00
Owen Anderson
9ae90800a2 memset_pattern16 uses a 16 BYTE pattern, not a 16 BIT pattern. Add comments to that effect.
llvm-svn: 139205
2011-09-06 23:43:26 +00:00
Owen Anderson
483f94e8d1 Teach BasicAA about the aliasing properties of memset_pattern16.
Fixes PR10872 and <rdar://problem/10065079>.

llvm-svn: 139204
2011-09-06 23:33:25 +00:00
Nick Lewycky
8203bcfd03 This transform only handles two-operand AddRec's. Prevent it from trying to
handle anything more complex. Fixes PR10383 again!

llvm-svn: 139186
2011-09-06 21:42:18 +00:00
Devang Patel
2c2dd9114e Now, named mdnode llvm.dbg.cu keeps track of all compile units in a module. Update DebugInfoFinder to collect compile units from llvm.dbg.cu.
llvm-svn: 139147
2011-09-06 17:40:08 +00:00