Chandler Carruth
af6432924d
Mark some functions as used which are used within debug-only code. This
...
silences Clang's -Wunused-function when building in release mode.
llvm-svn: 129709
2011-04-18 18:49:44 +00:00
Devang Patel
eddab1d186
Introduce support to encode Objective-C property information in debugging information generated for an interface.
...
llvm-svn: 129624
2011-04-16 00:11:51 +00:00
Chris Lattner
0304b82f80
Fix a ton of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Jay Foad
c29ba4ecd6
PR9214: Convert ConstantExpr::getIndices() to return an ArrayRef, plus
...
related tweaks to ExprMapKeyType.
llvm-svn: 129443
2011-04-13 15:22:40 +00:00
Jay Foad
0d5ca4cf44
Don't include Operator.h from InstrTypes.h.
...
llvm-svn: 129271
2011-04-11 09:35:34 +00:00
Eli Friedman
d3b1c5df33
PR9604; try to deal with RAUW updates correctly in the AST. I'm not convinced
...
it's completely safe to cache the AST across LICM runs even with this fix,
but this fix can't hurt.
llvm-svn: 129198
2011-04-09 06:55:46 +00:00
Devang Patel
03d0891c10
Add support to encode function's template parameters.
...
llvm-svn: 128947
2011-04-05 22:52:06 +00:00
Chris Lattner
a2345ee59d
remove postdom frontiers, because it is dead. Forward dom frontiers are
...
still used by RegionInfo :(
llvm-svn: 128943
2011-04-05 21:57:17 +00:00
Tobias Grosser
df319b5f91
Region: Allow user control the printing style of the print function.
...
Contributed by: etherzhhb@gmail.com
llvm-svn: 128808
2011-04-04 07:19:18 +00:00
Eli Friedman
823b0d6c77
Don't assume something which might be a constant expression is an instruction.
...
Based on PR9429, but no testcase because I can't figure out how to trigger it
anymore given other changes to the relevant code.
llvm-svn: 128781
2011-04-02 22:11:56 +00:00
Jay Foad
53632b7c03
Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
...
PHINode::Create() giving the (known or expected) number of operands.
llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Jay Foad
dc5a008237
(Almost) always call reserveOperandSpace() on newly created PHINodes.
...
llvm-svn: 128535
2011-03-30 11:19:20 +00:00
Frits van Bommel
c234349939
Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code.
...
llvm-svn: 128379
2011-03-27 14:26:13 +00:00
Anders Carlsson
8681fe2359
Revert r128140 for now.
...
llvm-svn: 128149
2011-03-23 15:51:12 +00:00
Anders Carlsson
556ad25dec
A global variable with internal linkage where all uses are in one function and whose address is never taken is a non-escaping local object and can't alias anything else.
...
llvm-svn: 128140
2011-03-23 02:19:48 +00:00
Nick Lewycky
e8f6eb49ee
Fix INT_MIN gotcha pointed out by Eli Friedman.
...
llvm-svn: 128028
2011-03-21 21:40:32 +00:00
Andrew Trick
dd6faad20a
Avoid creating canonical induction variables for non-native types.
...
For example, on 32-bit architecture, don't promote all uses of the IV
to 64-bits just because one use is a 64-bit cast.
Alternate implementation of the patch by Arnaud de Grandmaison.
llvm-svn: 127884
2011-03-18 16:50:32 +00:00
Andrew Trick
07887af00c
Added isValidRewrite() to check the result of ScalarEvolutionExpander.
...
SCEV may generate expressions composed of multiple pointers, which can
lead to invalid GEP expansion. Until we can teach SCEV to follow strict
pointer rules, make sure no bad GEPs creep into IR.
Fixes rdar://problem/9038671.
llvm-svn: 127839
2011-03-17 23:51:11 +00:00
Nick Lewycky
50afb5a262
Add comments for the demanglings. Correct mangled form of operator delete!
...
llvm-svn: 127801
2011-03-17 05:20:12 +00:00
Nick Lewycky
e30c07ab2b
Add C++ global operator {new,new[],delete,delete[]}(unsigned {int,long}) to the
...
memory builtins as equivalent to malloc/free.
This is different from any attribute we have. For example, you can delete the
allocators when their result is unused, but you can't collapse two calls to the
same function, even if no global/memory state has changed in between. The
noalias return states that the result does not alias any other pointer, but
instcombine optimizes malloc() as though the result is non-null for the purpose
of eliminating unused pointers.
llvm-svn: 127673
2011-03-15 07:31:32 +00:00
Andrew Trick
09d2dcd9ef
Remove getMinusSCEVForExitTest().
...
This function performed acrobatics to prove no-self-wrap, which we now
have for free.
llvm-svn: 127643
2011-03-15 01:16:14 +00:00
Andrew Trick
5c8b815e5f
Propagate SCEV no-wrap flags whenever possible.
...
This needs review.
llvm-svn: 127638
2011-03-15 00:37:00 +00:00
Andrew Trick
da253e79f0
Negating a recurrence preserves no-self-wrap.
...
llvm-svn: 127593
2011-03-14 17:38:54 +00:00
Andrew Trick
dab71254b6
HowFarToZero can compute a trip count as long as the recurrence has no-self-wrap.
...
llvm-svn: 127591
2011-03-14 17:28:02 +00:00
Andrew Trick
5d45b563c5
Added SCEV::NoWrapFlags to manage unsigned, signed, and self wrap
...
properties.
Added the self-wrap flag for SCEV::AddRecExpr.
A slew of temporary FIXMEs indicate the intention of the no-self-wrap flag
without changing behavior in this revision.
llvm-svn: 127590
2011-03-14 16:50:06 +00:00
Benjamin Kramer
5986a24bae
Teach ComputeMaskedBits about sub nsw.
...
llvm-svn: 127548
2011-03-12 17:18:11 +00:00
Benjamin Kramer
d4ea449e7e
ComputeMaskedBits: sub falls through to add, and sub doesn't have the same overflow semantics as add.
...
Should fix the selfhost failures that started with r127463.
llvm-svn: 127465
2011-03-11 14:46:49 +00:00
Nick Lewycky
cf0e3e88df
Teach ComputeMaskedBits about nsw on add. I don't think there's anything we can
...
do with nuw here, but sub and mul should be given similar treatment.
Fixes PR9343 #15 !
llvm-svn: 127463
2011-03-11 09:00:19 +00:00
Devang Patel
73d68195ce
Introduce DebugInfoProbe. This is used to monitor how llvm optimizer is treating debugging information.
...
It generates output that lools like
8 times line number info lost by Scalar Replacement of Aggregates (SSAUp)
1 times line number info lost by Simplify well-known library calls
12 times variable info lost by Jump Threading
llvm-svn: 127381
2011-03-10 00:21:25 +00:00
Andrew Trick
c4703f6ea1
When SCEV can determine the loop test is X < X, set ExactBECount=0.
...
When ExactBECount is a constant, use it for MaxBECount.
When MaxBECount cannot be computed, replace it with ExactBECount.
Fixes PR9424.
llvm-svn: 127342
2011-03-09 17:29:58 +00:00
Andrew Trick
de565b0456
whitespace
...
llvm-svn: 127340
2011-03-09 17:23:39 +00:00
Nick Lewycky
c2b564b36f
Fix two cases I forgot to update when doing a mental "getSwappedPredicate".
...
Thanks Duncan Sands!
llvm-svn: 127323
2011-03-09 08:20:06 +00:00
Nick Lewycky
485af203fc
Add another micro-optimization. Apologies for the lack of refactoring, but I
...
gave up when I realized I couldn't come up with a good name for what the
refactored function would be, to describe what it does.
This is PR9343 test12, which is test3 with arguments reordered. Whoops!
llvm-svn: 127318
2011-03-09 06:26:03 +00:00
Duncan Sands
41075b3ffb
Fix PR9331. Simplified version of a patch by Jakub Staszak.
...
llvm-svn: 127243
2011-03-08 12:39:03 +00:00
Nick Lewycky
2cbaf887bb
Add more analysis of the sign bit of an srem instruction. If the LHS is negative
...
then the result could go either way. If it's provably positive then so is the
srem. Fixes PR9343 #7 !
llvm-svn: 127146
2011-03-07 01:50:10 +00:00
Nick Lewycky
a2cb87f86d
Thread comparisons over udiv/sdiv/ashr/lshr exact and lshr nuw/nsw whenever
...
possible. This goes into instcombine and instsimplify because instsimplify
doesn't need to check hasOneUse since it returns (almost exclusively) constants.
This fixes PR9343 #4 #5 and #8 !
llvm-svn: 127064
2011-03-05 05:19:11 +00:00
Dan Gohman
a8389213a0
When decling to reuse existing expressions that involve casts, ignore
...
bitcasts, which are really no-ops here. This fixes slowdowns on
MultiSource/Applications/aha and others.
llvm-svn: 127031
2011-03-04 20:46:46 +00:00
Nick Lewycky
75a3dd996d
Revert broken srem logic from r126991.
...
llvm-svn: 127021
2011-03-04 19:26:08 +00:00
Nick Lewycky
3bc3a84ba8
Fold "icmp pred (srem X, Y), Y" like we do for urem. Handle signed comparisons
...
in the urem case, though not the other way around. This is enough to get #3 from
PR9343!
llvm-svn: 126991
2011-03-04 10:06:52 +00:00
Nick Lewycky
a5f309e983
Teach instruction simplify to use constant ranges to solve problems of the form
...
"icmp pred %X, CI" and a number of examples where "%X = binop %Y, CI2".
Some of these cases (div and rem) used to make it through opt -O2, but the
others are probably now making code elsewhere redundant (probably instcombine).
llvm-svn: 126988
2011-03-04 07:00:57 +00:00
Duncan Sands
a7c3ebafe4
Remove DIFactory. Patch by Devang.
...
llvm-svn: 126871
2011-03-02 20:30:37 +00:00
Dan Gohman
0823ebc79b
Don't re-use existing addrec expansions if they contain casts.
...
This fixes PR9259.
llvm-svn: 126812
2011-03-02 01:34:10 +00:00
Devang Patel
5c7b3c4228
Today, the language front ends produces llvm.dbg.* intrinsics, used to encode arguments' debug info, in order any way, most of the times. However, if a front end mix-n-matches llvm.dbg.declare and llvm.dbg.value intrinsics to encode debug info for arguments then code generator needs a way to find argument order.
...
Use 8 bits from line number field to keep track of argument ordering while encoding debug info for an argument. That leaves 24 bit for line no, DebugLoc also allocates 24 bit for line numbers. If a function has more than 255 arguments then rest of the arguments will be ordered by llvm.dbg.* intrinsics' ordering in IR.
llvm-svn: 126793
2011-03-01 22:58:13 +00:00
Nick Lewycky
e9d448e997
Optimize "icmp pred (urem X, Y), Y" --> true/false depending on pred. There's
...
more work to do here, "icmp ult (urem X, 10), 11" doesn't optimize away yet.
Fixes example 3 from PR9343!
llvm-svn: 126741
2011-03-01 08:15:50 +00:00
Ted Kremenek
8c2e50117d
Unbreak CMake build.
...
llvm-svn: 126717
2011-03-01 00:02:51 +00:00
Dan Gohman
1ee6941aca
Delete the LiveValues pass. I won't get get back to the project it
...
was started for in the foreseeable future.
llvm-svn: 126668
2011-02-28 19:37:59 +00:00
Nick Lewycky
fe02856d37
Fix comment.
...
llvm-svn: 126645
2011-02-28 09:18:11 +00:00
Nick Lewycky
dcc97b5f44
srem doesn't actually have the same resulting sign as its numerator, you could
...
also have a zero when numerator = denominator. Reverts parts of r126635 and
r126637.
llvm-svn: 126644
2011-02-28 09:17:39 +00:00
Nick Lewycky
dd5df7ef0a
Teach value tracking to make use of flags in more situations.
...
llvm-svn: 126642
2011-02-28 08:02:21 +00:00
Nick Lewycky
aa03b76c53
Teach ValueTracking to look at the dividend when determining the sign bit of an
...
srem instruction.
llvm-svn: 126637
2011-02-28 06:52:12 +00:00