Dan Gohman
6f9646e1c5
Add const qualifiers.
...
llvm-svn: 95582
2010-02-08 22:00:06 +00:00
Devang Patel
6efc8e5120
Set DW_AT_artificial only if argument is marked as artificial.
...
llvm-svn: 95461
2010-02-06 01:02:37 +00:00
Jakob Stoklund Olesen
b0b2297066
Update CodeMetrics to count 'big' function calls explicitly.
...
llvm-svn: 95453
2010-02-05 23:21:18 +00:00
Dan Gohman
9946b5109c
Change the argument to getIntegerSCEV to be an int64_t, rather
...
than int. This will make it more convenient for LSR, which does
a lot of things with int64_t offsets.
llvm-svn: 95281
2010-02-04 02:43:51 +00:00
Devang Patel
999b499024
Provide interface to identifiy artificial methods.
...
llvm-svn: 95240
2010-02-03 19:57:19 +00:00
Dan Gohman
7e5f1b2773
Various code simplifications.
...
llvm-svn: 95044
2010-02-02 01:38:49 +00:00
Bill Wendling
c5829c4a50
Add "dump" method to IVUsersOneStride.
...
llvm-svn: 95022
2010-02-01 22:51:23 +00:00
Dan Gohman
e5e1b7b05a
Generalize target-independent folding rules for sizeof to handle more
...
cases, and implement target-independent folding rules for alignof and
offsetof. Also, reassociate reassociative operators when it leads to
more folding.
Generalize ScalarEvolution's isOffsetOf to recognize offsetof on
arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr
to getOffsetOfExpr, for consistency with analagous ConstantExpr routines.
Make the target-dependent folder promote GEP array indices to
pointer-sized integers, to make implicit casting explicit and exposed
to subsequent folding.
And add a bunch of testcases for this new functionality, and a bunch
of related existing functionality.
llvm-svn: 94987
2010-02-01 18:27:38 +00:00
Devang Patel
7f8be9ba95
Before inserting llvm.dbg.declare intrinsic at the end of a basic block, check whether the basic block has a terminator or not.
...
This API is used by clang and the test case is test/CodeGen/debug-info-crash.c in clang module.
llvm-svn: 94820
2010-01-29 18:30:57 +00:00
Duncan Sands
26cd6bd0b0
It looks like the changes to the SRem logic of SimplifyDemandedUseBits
...
(fix for PR6165) are needed here too.
llvm-svn: 94801
2010-01-29 06:18:37 +00:00
Dan Gohman
9f4ea22c88
Check Type::isSized before calling ScalarEvolution::getAllocSizeExpr,
...
rather than after.
llvm-svn: 94742
2010-01-28 06:32:46 +00:00
Dan Gohman
cf9138307d
Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
...
use plain SCEVUnknowns with ConstantExpr::getSizeOf and
ConstantExpr::getOffsetOf constants. This eliminates a bunch of
special-case code.
Also add code for pattern-matching these expressions, for clients that
want to recognize them.
Move ScalarEvolution's logic for expanding array and vector sizeof
expressions into an element count times the element size, to expose
the multiplication to subsequent folding, into the regular constant
folder.
llvm-svn: 94737
2010-01-28 02:15:55 +00:00
Jakob Stoklund Olesen
0234628284
Fix inline cost predictions with SCIENCE.
...
After running a batch of measurements, it is clear that the inliner metrics
need some adjustments:
Own argument bonus: 20 -> 5
Outgoing argument penalty: 0 -> 5
Alloca bonus: 10 -> 5
Constant instr bonus: 7 -> 5
Dead successor bonus: 40 -> 5*(avg instrs/block)
The new cost metrics are generaly 25 points higher than before, so we may need
to move thresholds.
With this change, InlineConstants::CallPenalty becomes a political correction:
if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction()))
NumInsts += InlineConstants::CallPenalty + CS.arg_size();
The code size is accurately modelled by CS.arg_size(). CallPenalty is added
because calls tend to take a long time, so it may not be worth it to inline a
function with lots of calls.
All of the political corrections are in the InlineConstants namespace:
IndirectCallBonus, CallPenalty, LastCallToStaticBonus, ColdccPenalty,
NoreturnPenalty.
llvm-svn: 94615
2010-01-26 23:21:56 +00:00
Jakob Stoklund Olesen
87256d8fe1
Revert test polarity to match comment and desired outcome. Remove undeserved bonus.
...
A GEP with all constant indices is already considered free by
analyzeBasicBlock(), so don't give it an extra bonus in
CountCodeReductionForAlloca().
This patch should remove a small positive bias toward inlining functions with
variable-index GEPs, and remove a smaller negative bias from functions with
all-constant index GEPs.
llvm-svn: 94591
2010-01-26 21:31:35 +00:00
Jakob Stoklund Olesen
832e79ca32
Remove dead code.
...
Functions containing indirectbr are marked NeverInline by analyzeBasicBlock(),
so there is no point in giving indirectbr special treatment in
CountCodeReductionForConstant. It is never called.
No functional change intended.
llvm-svn: 94590
2010-01-26 21:31:30 +00:00
Jakob Stoklund Olesen
cab470b17a
Skip calculation of ArgumentWeights if it will never be used.
...
Save a few bytes by allocating the correct size vector.
No functional change intended.
llvm-svn: 94589
2010-01-26 21:31:24 +00:00
Devang Patel
f4b25d6d7b
Add extra element to composite type. This new element will be used to record c++ class that holds current class's vtable.
...
llvm-svn: 94586
2010-01-26 21:14:59 +00:00
Dan Gohman
85be4333ad
Make the unsigned-range code more consistent with the signed-range code,
...
and clean up some loose ends.
llvm-svn: 94572
2010-01-26 19:19:05 +00:00
Dan Gohman
a01418d75a
Fix a typo in a comment that Duncan noticed.
...
llvm-svn: 94562
2010-01-26 18:32:54 +00:00
Dan Gohman
fdb744b203
Rename ItCount to BECount, since it holds a backedge-taken count rather
...
than an iteration count.
llvm-svn: 94549
2010-01-26 16:46:18 +00:00
Dan Gohman
51aaf02821
Fix the the ceiling-division used in computing the MaxBECount so that it doesn't
...
have trouble with an intermediate add overflowing. Also, be more conservative
about the case where the induction variable in an SLT loop exit can step past
the RHS of the SLT and overflow in a single step.
Make getSignedRange more aggressive, to recover for some common cases which
the above fixes pessimized.
This addresses rdar://7561161.
llvm-svn: 94512
2010-01-26 04:40:18 +00:00
Victor Hernandez
907bdbb6be
Assert when debug intrinsic insert functions are passed empty arguments
...
llvm-svn: 94491
2010-01-26 02:07:38 +00:00
Chris Lattner
823aed16f9
make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
...
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Devang Patel
0e44c51a3e
Avoid using "Type" as the variable name.
...
llvm-svn: 94262
2010-01-23 00:26:28 +00:00
Victor Hernandez
73b0f99f17
Make sure ValueFn starts off empty
...
llvm-svn: 94256
2010-01-23 00:03:28 +00:00
Chris Lattner
7ba0661f27
Stop building RTTI information for *most* llvm libraries. Notable
...
missing ones are libsupport, libsystem and libvmcore. libvmcore is
currently blocked on bugpoint, which uses EH. Once it stops using
EH, we can switch it off.
This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.
llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Chris Lattner
e0701f987f
drop the pass name from the output.
...
llvm-svn: 94158
2010-01-22 05:52:51 +00:00
Chris Lattner
0b1c7235aa
eliminate dynamic_cast from this file.
...
llvm-svn: 94157
2010-01-22 05:46:59 +00:00
Chris Lattner
9efd4fcceb
eliminate a bunch more unneeded dynamic_cast's.
...
llvm-svn: 94156
2010-01-22 05:37:10 +00:00
Chris Lattner
2fa26e5fd0
eliminate a bunch of dynamic_cast's.
...
llvm-svn: 94155
2010-01-22 05:24:46 +00:00
Dan Gohman
60a9bf414e
When re-using an existing cast for a user, it's still necessary to call
...
rememberInstruction so that future users of that user will be inserted
in the correct position. This fixes the Darwin selfhost.
llvm-svn: 94070
2010-01-21 10:08:42 +00:00
Dan Gohman
51ad99d2c5
Re-implement the main strength-reduction portion of LoopStrengthReduction.
...
This new version is much more aggressive about doing "full" reduction in
cases where it reduces register pressure, and also more aggressive about
rewriting induction variables to count down (or up) to zero when doing so
reduces register pressure.
It currently uses fairly simplistic algorithms for finding reuse
opportunities, but it introduces a new framework allows it to combine
multiple strategies at once to form hybrid solutions, instead of doing
all full-reduction or all base+index.
llvm-svn: 94061
2010-01-21 02:09:26 +00:00
Chris Lattner
da363d9af8
adopt getAdjustedAnalysisPointer in a few more passes.
...
llvm-svn: 94018
2010-01-20 20:09:02 +00:00
Chris Lattner
3b03327c14
adopt getAdjustedAnalysisPointer in two more passes.
...
llvm-svn: 94017
2010-01-20 19:53:32 +00:00
Chris Lattner
397af34e6f
adopt getAdjustedAnalysisPointer in BasicCallGraph.
...
llvm-svn: 94015
2010-01-20 19:51:46 +00:00
Chris Lattner
af362f014d
add some new methods to adjust this pointers. Not used yet.
...
llvm-svn: 94013
2010-01-20 19:26:14 +00:00
Victor Hernandez
20425abea4
Avoid unnecessary Elts array
...
llvm-svn: 93978
2010-01-20 05:44:11 +00:00
Dan Gohman
8d67d2f5f8
Add a comment and tidy up some whitespace.
...
llvm-svn: 93932
2010-01-19 22:27:22 +00:00
Dan Gohman
510bffca45
Fix a typo and an 80-column violation in comments.
...
llvm-svn: 93931
2010-01-19 22:26:02 +00:00
Dan Gohman
f86d904b7d
Give ScalarEvolution access to the DominatorTree. It'll need this
...
to make more intellegent AddRec folding decisions.
llvm-svn: 93930
2010-01-19 22:21:27 +00:00
Dan Gohman
d693472821
Add a new helper function to IVUsers for returning the "canonical"
...
form of an expression. This is the expression without the
post-increment adjustment made, which is useful in determining
which registers will be used by the expansion.
llvm-svn: 93921
2010-01-19 21:55:32 +00:00
Victor Hernandez
870913f707
Make findDbgDeclare/findDbgGlobalDeclare local static functions; avoid Elts array
...
llvm-svn: 93764
2010-01-18 20:42:09 +00:00
Tobias Grosser
53da3f8da8
Create Generic DOTGraphTraits Printer/Viewer
...
Move the DOTGraphTraits dotty printer/viewer templates, that were developed for
the dominance tree into their own header file. This will allow reuse in future
passes.
llvm-svn: 93632
2010-01-16 10:56:41 +00:00
Devang Patel
c0e17df3ce
Replace DebugLocTuple with DILocation.
...
llvm-svn: 93630
2010-01-16 06:09:35 +00:00
Victor Hernandez
b324e66f4c
Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
...
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.
llvm-svn: 93531
2010-01-15 19:04:09 +00:00
Victor Hernandez
8d4904b639
Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
...
llvm-svn: 93515
2010-01-15 17:36:47 +00:00
Victor Hernandez
5d6551816b
Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
...
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
llvm-svn: 93504
2010-01-15 03:37:48 +00:00
Eric Christopher
f567e1b426
Pad my commit stats by reducing indentation in this now separate
...
commit.
llvm-svn: 93473
2010-01-14 23:00:10 +00:00
Eric Christopher
35dd9e8e1d
Few minor changes that were requested. No functional change.
...
llvm-svn: 93462
2010-01-14 21:48:00 +00:00
Evan Cheng
8e670ee381
Small tweak to inline cost computation. Ext of i/fcmp results are mostly optimized away in codegen.
...
llvm-svn: 93453
2010-01-14 21:04:31 +00:00
Eric Christopher
f3ac066418
Reduce the inlining cost of functions that contain calls to easily,
...
and frequently optimized functions.
llvm-svn: 93448
2010-01-14 20:12:34 +00:00
Victor Hernandez
9ce5b5134d
Respond to Chris' review:
...
Make InsertDbgValueIntrinsic() and get Offset take and recieve a uint64_t.
Get constness correct for getVariable() and getValue().
llvm-svn: 93149
2010-01-11 07:45:19 +00:00
Chris Lattner
25963c6113
"In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
...
Patch by James Y Knight!
llvm-svn: 93079
2010-01-09 22:27:07 +00:00
Dan Gohman
bc694918cc
Use WriteAsOperand instead of getName() to print loop header names,
...
so that unnamed blocks are handled.
llvm-svn: 93059
2010-01-09 18:17:45 +00:00
Chris Lattner
a69f89c17a
fix PR5978 by peeling the loop so that we avoid shifting the
...
result int by 8 for the first byte. While normally harmless,
if the result is smaller than a byte, this shift is invalid.
llvm-svn: 93018
2010-01-08 19:02:23 +00:00
Chris Lattner
35d3b9dcd0
teach ComputeNumSignBits to look through PHI nodes.
...
llvm-svn: 92964
2010-01-07 23:44:37 +00:00
Duncan Sands
78376ad7e1
Partially address a README by having functionattrs consider calls to
...
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.
llvm-svn: 92829
2010-01-06 08:45:52 +00:00
Dan Gohman
c3f2137c06
Restore dump() methods to Loop and MachineLoop.
...
llvm-svn: 92772
2010-01-05 21:08:02 +00:00
Benjamin Kramer
d2564e3afb
Move remaining stuff to the isInteger predicate.
...
llvm-svn: 92771
2010-01-05 21:05:54 +00:00
Benjamin Kramer
a81a6dff0d
Convert a ton of simple integer type equality tests to the new predicate.
...
llvm-svn: 92760
2010-01-05 20:07:06 +00:00
Devang Patel
be94f23992
Remove dead debug info intrinsics.
...
Intrinsic::dbg_stoppoint
Intrinsic::dbg_region_start
Intrinsic::dbg_region_end
Intrinsic::dbg_func_start
AutoUpgrade simply ignores these intrinsics now.
llvm-svn: 92557
2010-01-05 01:10:40 +00:00
Chris Lattner
8fb74c6ee2
constant fold nasty constant expressions formed by llvm-gcc,
...
wrapping up PR3351.
llvm-svn: 92410
2010-01-02 01:22:23 +00:00
Chris Lattner
6a0ca6aa90
fix Analysis/DebugInfo.h to not include Metadata.h. Do this
...
by moving one method out of line and eliminating redundant checks
from other methods.
llvm-svn: 92337
2009-12-31 03:02:08 +00:00
Chris Lattner
9b493028df
rename "elements" of metadata to "operands". "Elements" are
...
things that occur in types. "operands" are things that occur
in values.
llvm-svn: 92322
2009-12-31 01:22:29 +00:00
Chris Lattner
8cb6c3476d
Optimize MDNode to coallocate the operand list immediately
...
after the MDNode in memory. This eliminates the operands
pointer and saves a new[] per node.
Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary. A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related! Debug info should use something non-mdnode for
declarations.
llvm-svn: 92321
2009-12-31 01:05:46 +00:00
Chris Lattner
8e805be369
remove a bunch of unneeded functions.
...
llvm-svn: 92263
2009-12-29 09:32:19 +00:00
Chris Lattner
047fd2fd97
major cleanups, much of this file was incorrectly indented.
...
llvm-svn: 92262
2009-12-29 09:22:47 +00:00
Chris Lattner
573f294c00
one pass of cleanup over DebugInfo.h. Much more is still needed.
...
llvm-svn: 92261
2009-12-29 09:15:46 +00:00
Chris Lattner
a0566979b7
Final step in the metadata API restructuring: move the
...
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.
llvm-svn: 92259
2009-12-29 09:01:33 +00:00
Chris Lattner
2f2aa2b067
This is a major cleanup of the instruction metadata interfaces that
...
I asked Devang to do back on Sep 27. Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().
This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte. Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.
This also fixes some confusion in getMDs and its clients about
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.
This introduces a number of fixme's which I'll follow up on.
llvm-svn: 92235
2009-12-28 23:41:32 +00:00
Chris Lattner
7093946ab1
rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
...
doesn't exist already, eliminate registerMDKind. Tidy up a bunch
of random stuff.
llvm-svn: 92225
2009-12-28 20:45:51 +00:00
David Greene
1495b5f887
Change dbgs() back to errs() as Chris requested.
...
llvm-svn: 92086
2009-12-23 23:29:28 +00:00
David Greene
f790593e6e
Change dbgs() back to errs() as Chris requested.
...
llvm-svn: 92085
2009-12-23 23:27:15 +00:00
David Greene
91b6bcefc6
Change dbgs() back to errs() for assert messages as Chris requested.
...
llvm-svn: 92081
2009-12-23 23:14:41 +00:00
David Greene
3d64631fef
Change dbgs() back to errs() for assert messages as Chris requested.
...
llvm-svn: 92080
2009-12-23 23:09:39 +00:00
David Greene
3fe18e72b3
Change dbgs() back to errs() for assert messages as Chris requested.
...
llvm-svn: 92077
2009-12-23 23:00:50 +00:00
David Greene
d79102d6f2
Change dbgs() back to errs() for assert messages as Chris requested.
...
llvm-svn: 92076
2009-12-23 22:59:29 +00:00
David Greene
2330f78075
Remove dump routine and the associated Debug.h from a header. Patch up
...
other files to compensate.
llvm-svn: 92075
2009-12-23 22:58:38 +00:00
David Greene
0295ecfea0
Change dbgs() back to errs() as Chris requested.
...
llvm-svn: 92073
2009-12-23 22:49:57 +00:00
David Greene
452fc61a26
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92071
2009-12-23 22:35:10 +00:00
David Greene
faa00b7a7f
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92068
2009-12-23 22:28:01 +00:00
David Greene
df1c497c2f
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92067
2009-12-23 22:18:14 +00:00
David Greene
2e23db1156
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92066
2009-12-23 22:10:20 +00:00
David Greene
8135870f23
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92063
2009-12-23 21:58:29 +00:00
David Greene
cf1884c246
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92060
2009-12-23 21:48:18 +00:00
David Greene
1e4ea201d5
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92050
2009-12-23 21:27:29 +00:00
David Greene
047ac4aa79
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92048
2009-12-23 21:16:54 +00:00
David Greene
04e7ae6a57
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92046
2009-12-23 21:06:14 +00:00
David Greene
9507879bca
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92042
2009-12-23 20:52:41 +00:00
David Greene
37e9809294
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92040
2009-12-23 20:43:58 +00:00
David Greene
a7b92ee147
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92039
2009-12-23 20:34:27 +00:00
David Greene
069857ea31
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92037
2009-12-23 20:20:46 +00:00
David Greene
f8ed991e5a
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92035
2009-12-23 20:10:59 +00:00
David Greene
ba44b3ed59
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92034
2009-12-23 20:03:58 +00:00
David Greene
23e8c74d69
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92033
2009-12-23 19:51:44 +00:00
David Greene
83d478145d
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92032
2009-12-23 19:45:49 +00:00
David Greene
2ec90035e8
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92029
2009-12-23 19:27:59 +00:00
David Greene
2281998095
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92026
2009-12-23 19:21:19 +00:00
David Greene
a4375f1ffd
Convert debug messages to use dbgs(). Generally this means
...
s/errs/dbgs/g except for certain special cases.
llvm-svn: 92024
2009-12-23 19:15:13 +00:00
Chris Lattner
9b7d99eb76
The phi translated pointer can be computed when returning a partially cached result
...
instead of stored. This reduces memdep memory usage, and also eliminates a bunch of
weakvh's. This speeds up gvn on gcc.c-torture/20001226-1.c from 23.9s to 8.45s (2.8x)
on a different machine than earlier.
llvm-svn: 91885
2009-12-22 04:25:02 +00:00
Chris Lattner
2ee6787c1b
avoid calling extractMallocCall when it's obvious we don't have
...
a call. This speeds up memdep ~1.5%
llvm-svn: 91869
2009-12-22 01:00:32 +00:00
Chris Lattner
25bf6f8946
fix an overly conservative caching issue that caused memdep to
...
cache a pointer as being unavailable due to phi trans in the
wrong place. This would cause later queries to fail even when
they didn't involve phi trans.
llvm-svn: 91787
2009-12-19 21:29:22 +00:00
Dan Gohman
876f45d7d2
Fix a spello in a comment that Nick spotted.
...
llvm-svn: 91742
2009-12-19 01:46:34 +00:00
Dan Gohman
f902c8c1b5
Eliminate unnecessary LLVMContexts.
...
llvm-svn: 91729
2009-12-18 23:42:08 +00:00
Dan Gohman
7db230f5c9
Make this comment more precise.
...
llvm-svn: 91722
2009-12-18 23:18:03 +00:00
Dan Gohman
51f13056bd
Revert this use of NUW/NSW also. Overflow-undefined multiplication isn't
...
associative either.
llvm-svn: 91701
2009-12-18 18:45:31 +00:00
Dan Gohman
7a2dab8826
Revert this use of NSW; this one isn't actually safe. NSW addition
...
is not reassociative.
llvm-svn: 91667
2009-12-18 03:57:04 +00:00
Dan Gohman
916fec41fb
Delete an unused variable.
...
llvm-svn: 91659
2009-12-18 02:14:37 +00:00
Dan Gohman
b256ccfbe5
Preserve NSW information in more places.
...
llvm-svn: 91656
2009-12-18 02:09:29 +00:00
Dan Gohman
18fa5686f6
Add Loop contains utility methods for testing whether a loop
...
contains another loop, or an instruction. The loop form is
substantially more efficient on large loops than the typical
code it replaces.
llvm-svn: 91654
2009-12-18 01:24:09 +00:00
Dan Gohman
cb0efecd33
Whitespace cleanups.
...
llvm-svn: 91651
2009-12-18 01:14:11 +00:00
Dan Gohman
92c3696524
Reapply LoopStrengthReduce and IVUsers cleanups, excluding the part
...
of 91296 that caused trouble -- the Processed list needs to be
preserved for the livetime of the pass, as AddUsersIfInteresting
is called from other passes.
llvm-svn: 91641
2009-12-18 00:06:20 +00:00
Evan Cheng
090ac0865a
Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently introduced a non-deterministic behavior in the optimizer somewhere.
...
llvm-svn: 91598
2009-12-17 09:39:49 +00:00
Chris Lattner
a3aef788ec
Fix GetConstantStringInfo to not look into MDString (it works on
...
real data, not metadata) and fix DbgInfoPrinter to not abuse
GetConstantStringInfo.
llvm-svn: 91444
2009-12-15 19:34:20 +00:00
Devang Patel
1f4690c624
Add support to emit debug info for C++ namespaces.
...
llvm-svn: 91440
2009-12-15 19:16:48 +00:00
Chris Lattner
45d040bd85
Remove isPod() from DenseMapInfo, splitting it out to its own
...
isPodLike type trait. This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.
llvm-svn: 91421
2009-12-15 07:26:43 +00:00
John McCall
4ea24f19f5
You can't use typedefs to declare template member specializations, and
...
clang enforces it.
llvm-svn: 91397
2009-12-15 02:35:24 +00:00
Dan Gohman
2a07fd94f1
Clear the Processed set when it is no longer used, and clear the
...
IVUses list in releaseMemory().
llvm-svn: 91296
2009-12-14 17:35:17 +00:00
Dan Gohman
fbeec7270c
Fix a thinko; isNotAlreadyContainedIn had a built-in negative, so the
...
condition was inverted when the code was converted to contains().
llvm-svn: 91295
2009-12-14 17:31:01 +00:00
Dan Gohman
57eb6cda7a
Drop Loop::isNotAlreadyContainedIn in favor of Loop::contains. The
...
former was just exposing a LoopInfoBase implementation detail.
llvm-svn: 91286
2009-12-14 17:06:50 +00:00
Dan Gohman
84ba039cf2
Make getUniqueExitBlocks's precondition assert more precise, to
...
avoid spurious failures. This fixes PR5758.
llvm-svn: 91147
2009-12-11 20:05:23 +00:00
Dan Gohman
220b196c94
Reuse the Threshold value to size these containers because it's
...
currently somewhat convenient for them to have the same value.
llvm-svn: 90980
2009-12-09 18:48:53 +00:00
Chris Lattner
9f9010ef47
Add a minor optimization: if we haven't changed the operands of an
...
add, there is no need to scan the world to find the same add again.
This invalidates the previous testcase, which wasn't wonderful anyway,
because it needed a run of instcombine to permute the use-lists in
just the right way to before GVN was run (so it was really fragile).
Not a big loss.
llvm-svn: 90973
2009-12-09 17:27:45 +00:00
Chris Lattner
fa2e536831
fix PR5733, a case where we'd replace an add with a lexically identical
...
binary operator that wasn't an add. In this case, a xor. Whoops.
llvm-svn: 90971
2009-12-09 17:18:49 +00:00
Chris Lattner
eea0f58393
enhance NonLocalDepEntry to keep the per-block phi translated address
...
of the query.
llvm-svn: 90958
2009-12-09 07:31:04 +00:00
Chris Lattner
0c31547168
change NonLocalDepEntry from being a typedef for an std::pair to be its
...
own small class. No functionality change.
llvm-svn: 90956
2009-12-09 07:08:01 +00:00
Chris Lattner
972e6d8d00
Switch GVN and memdep to use PHITransAddr, which correctly handles
...
phi translation of complex expressions like &A[i+1]. This has the
following benefits:
1. The phi translation logic is all contained in its own class with
a strong interface and verification that it is self consistent.
2. The logic is more correct than before. Previously, if intermediate
expressions got PHI translated, we'd miss the update and scan for
the wrong pointers in predecessor blocks. @phi_trans2 is a testcase
for this.
3. We have a lot less code in memdep.
We can handle phi translation across blocks of things like @phi_trans3,
which is pretty insane :).
This patch should fix the miscompiles of 255.vortex, and I tested it
with a bootstrap of llvm-gcc, llvm-test and dejagnu of course.
llvm-svn: 90926
2009-12-09 01:59:31 +00:00
Chris Lattner
9af9d0f74e
fix a nasty variable that was shadowing the real CurBB but with the wrong value.
...
llvm-svn: 90920
2009-12-09 01:19:16 +00:00
Chris Lattner
11da6b0050
fix many input tracking bugs.
...
llvm-svn: 90915
2009-12-09 00:56:14 +00:00
Dan Gohman
56a5f19c70
Fix a typo in a comment, and adjust SmallSet and SmallVector sizes,
...
that Chris noticed.
llvm-svn: 90910
2009-12-09 00:28:42 +00:00
Chris Lattner
37251f8375
fix PHI translation to take the PHI out of the instinputs set and add
...
the translated value back to it if an instruction.
llvm-svn: 90909
2009-12-09 00:18:13 +00:00
Chris Lattner
cfd76375e3
instructions defined in CurBB may be intermediate nodes of the computation.
...
llvm-svn: 90908
2009-12-09 00:10:55 +00:00
Chris Lattner
0aa75680d6
add dumping and sanity checking support.
...
llvm-svn: 90906
2009-12-09 00:01:00 +00:00
Dan Gohman
2d27b191d9
Put a threshold on the number of users PointerMayBeCaptured
...
examines; fall back to a conservative answer if there are
more. This works around some several compile time problems
resulting from BasicAliasAnalysis calling PointerMayBeCaptured.
The value has been chosen arbitrarily.
This fixes rdar://7438917 and may partially address PR5708.
llvm-svn: 90905
2009-12-08 23:59:12 +00:00
Chris Lattner
5cf4b74b45
make sure that PHITransAddr keeps its 'InstInputs' list up to
...
date when instsimplify kicks in.
llvm-svn: 90901
2009-12-08 23:42:51 +00:00
Devang Patel
512001ac7d
Revert 90858 90875 and 90805 for now.
...
llvm-svn: 90898
2009-12-08 23:21:45 +00:00
Chris Lattner
6425a23c8c
fix a typo (and -> add) and fix GetAvailablePHITranslatedSubExpr to not
...
side-effect the current object.
llvm-svn: 90837
2009-12-08 06:06:26 +00:00
Victor Hernandez
58fd941eab
Rename DIFactory::InsertValue() as DIFactory::InsertDbgValueIntrinsic()
...
llvm-svn: 90807
2009-12-07 21:54:43 +00:00
Devang Patel
b074d1783b
Add support to emit debug info for c++ style namespaces.
...
llvm-svn: 90805
2009-12-07 21:41:32 +00:00
Chris Lattner
9e34d156d3
fix typo
...
llvm-svn: 90793
2009-12-07 19:52:57 +00:00
Chris Lattner
dccf7ad8b9
add accessor, improve comment.
...
llvm-svn: 90792
2009-12-07 19:45:30 +00:00
Victor Hernandez
fb7c680b61
Introduce the "@llvm.dbg.value" debug intrinsic.
...
The semantics of llvm.dbg.value are that starting from where it is executed, an offset into the specified user source variable is specified to get a new value.
An example:
call void @llvm.dbg.value(metadata !{ i32 7 }, i64 0, metadata !2 )
Here the user source variable associated with metadata #2 gets the value "i32 7" at offset 0.
llvm-svn: 90788
2009-12-07 19:36:34 +00:00
Chris Lattner
77b0d3b217
add support for phi translation and incorpation of new expression.
...
llvm-svn: 90782
2009-12-07 19:04:49 +00:00
Chris Lattner
e60244db8c
checkpoint of the new PHITransAddr code, still not done and not used by
...
anything.
llvm-svn: 90779
2009-12-07 18:36:53 +00:00
Nick Lewycky
e91765fdbb
Fix indentation in switch statement.
...
llvm-svn: 90650
2009-12-05 06:37:24 +00:00
Chris Lattner
1ddfd9f96c
Fix PR5551 by not ignoring the top level constantexpr when
...
folding a load from constant.
llvm-svn: 90545
2009-12-04 06:29:29 +00:00
Chris Lattner
6d947a0774
add to cmake
...
llvm-svn: 90539
2009-12-04 04:15:36 +00:00
Chris Lattner
b63051caf6
add the start of a class used to handle phi translation in memdep and
...
gvn (this is just a skeleton so far). This will ultimately be used
to fix a nasty miscompilation with GVN.
llvm-svn: 90518
2009-12-04 02:10:16 +00:00
Bob Wilson
2107eb70d9
Fix a comment typo.
...
llvm-svn: 90511
2009-12-04 01:33:04 +00:00
Devang Patel
eb57c59b66
Add support to emit debug info for virtual functions and virtual base classes.
...
llvm-svn: 90474
2009-12-03 19:11:07 +00:00
Benjamin Kramer
daea8420e9
Fix MSVC build.
...
llvm-svn: 90454
2009-12-03 13:23:03 +00:00
Andreas Neustifter
506891de63
Convert ProfileVerifier to template so it can be used for different types of ProfileInfo.
...
llvm-svn: 90451
2009-12-03 12:55:57 +00:00
Andreas Neustifter
7dd85bfdff
Do not create negative edge weights in ProfileEstimator.
...
Use integer values for weights to prevent rounding errors.
Make ProfileEstimator more robust in general CFGs.
llvm-svn: 90449
2009-12-03 12:41:14 +00:00
Andreas Neustifter
b87d0f0662
Use ProfileInfo-API in ProfileInfo Loader and do more assertions.
...
llvm-svn: 90446
2009-12-03 11:00:37 +00:00
Andreas Neustifter
312288b30c
Converted ProfileInfo to template, added more API for ProfileInfo-preserving.
...
llvm-svn: 90445
2009-12-03 09:30:12 +00:00
Chris Lattner
77c36d68f3
fix PR5673 by being more careful about pointers to functions.
...
llvm-svn: 90369
2009-12-03 01:05:45 +00:00
Chris Lattner
a48f44d9ee
improve portability to avoid conflicting with std::next in c++'0x.
...
Patch by Howard Hinnant!
llvm-svn: 90365
2009-12-03 00:50:42 +00:00
Benjamin Kramer
eee88bc5d2
Silence compiler warnings.
...
llvm-svn: 90319
2009-12-02 15:33:44 +00:00
Owen Anderson
b9878ee6b6
Cleanup/remove some parts of the lifetime region handling code in memdep and GVN,
...
per Chris' comments. Adjust testcases to match.
llvm-svn: 90304
2009-12-02 07:35:19 +00:00
Mon P Wang
bb3eac9e7a
Fixed an assertion failure for tracking sext of a vector of integers
...
llvm-svn: 90290
2009-12-02 04:59:58 +00:00
Devang Patel
a5749bda2c
Add utility routine to create subprogram definition entry from subprogram declaration entry.
...
llvm-svn: 90282
2009-12-01 23:09:02 +00:00
Chris Lattner
e914c0eaa0
rename some variables.
...
llvm-svn: 90258
2009-12-01 21:16:01 +00:00
Chris Lattner
506b858c45
tidy
...
llvm-svn: 90257
2009-12-01 21:15:15 +00:00
Chris Lattner
9c2053b242
fix 255.vortex again, third time's the charm.
...
llvm-svn: 90217
2009-12-01 07:33:32 +00:00
Tobias Grosser
dd7f2e797f
Remove ShortNames from getNodeLabel in DOTGraphTraits
...
llvm-svn: 90134
2009-11-30 12:38:47 +00:00
Tobias Grosser
90d334032a
Instantiate DefaultDOTGraphTraits
...
llvm-svn: 90133
2009-11-30 12:38:13 +00:00
Tobias Grosser
f7495f497a
Small PostDominatorTree improvements
...
* Do not SEGFAULT if tree entryNode() is NULL
* Print function names in dotty printer
llvm-svn: 90130
2009-11-30 12:06:37 +00:00
Nick Lewycky
2d32947099
Revert r90107, fixing test/Transforms/GVN/2009-11-29-ReverseMap.ll and the
...
llvm-gcc build.
llvm-svn: 90113
2009-11-30 07:05:51 +00:00
Chris Lattner
4d252d20e8
reapply r90093 with an addition of keeping the forward
...
and reverse nonlocal memdep maps in synch, this should
fix 255.vortex.
llvm-svn: 90107
2009-11-30 02:26:29 +00:00
Nick Lewycky
e35e6f097d
Teach ConstantFolding to do a better job when folding gep(bitcast).
...
This permits the devirtualization of llvm.org/PR3100#c9 when compiled by clang.
llvm-svn: 90099
2009-11-29 21:40:55 +00:00
Chris Lattner
0311ade94c
revert this patch for now, it causes failures of:
...
LLVM::Transforms/GVN/2009-02-17-LoadPRECrash.ll
LLVM::Transforms/GVN/2009-06-17-InvalidPRE.ll
llvm-svn: 90096
2009-11-29 21:14:59 +00:00
Chris Lattner
52e7715b0b
Fix a really nasty caching bug I introduced in memdep. An entry
...
was being added to the Result vector, but not being put in the
cache. This means that if the cache was reused wholesale for a
later query that it would be missing this entry and we'd do an
incorrect load elimination.
Unfortunately, it's not really possible to write a useful
testcase for this, but this unbreaks 255.vortex.
llvm-svn: 90093
2009-11-29 21:09:36 +00:00
Nick Lewycky
0a1f25b927
Detabify.
...
llvm-svn: 90085
2009-11-29 18:10:39 +00:00
Nick Lewycky
218a3393f4
Teach memdep to look for memory use intrinsics during dependency queries. Fixes
...
PR5574.
llvm-svn: 90045
2009-11-28 21:27:49 +00:00
Chris Lattner
44da5bd837
Enhance InsertPHITranslatedPointer to be able to return a list of newly
...
inserted instructions. No functionality change until someone starts using it.
llvm-svn: 90039
2009-11-28 15:39:14 +00:00
Chris Lattner
c7bc66dfc6
implement a FIXME: limit the depth that DecomposeGEPExpression goes the same
...
way that getUnderlyingObject does it.
This fixes the 'DecomposeGEPExpression and getUnderlyingObject disagree!'
assertion on sqlite3.
llvm-svn: 90038
2009-11-28 15:12:41 +00:00
Chris Lattner
d5bd369a0f
enable code to handle un-phi-translatable cases more aggressively:
...
if we don't have an address expression available in a predecessor,
then model this as the value being clobbered at the end of the pred
block instead of being modeled as a complete phi translation failure.
This is important for PRE of loads because we want to see that the
load is available in all but this predecessor, and complete phi
translation failure results in not getting any information about
predecessors.
This doesn't do anything until I renable code insertion since PRE
now sees that it is available in all but one predecessors, but can't
insert the addressing in the predecessor that is missing it to
eliminate the redundancy.
llvm-svn: 90037
2009-11-28 14:54:10 +00:00
Chris Lattner
2be52e72ae
Rework InsertPHITranslatedPointer to handle the recursive case, this
...
fixes PR5630 and sets the stage for the next phase of goodness (testcase
pending).
llvm-svn: 90019
2009-11-27 22:05:15 +00:00
Chris Lattner
4ee17e1482
recursively phi translate bitcast operands too, for consistency.
...
llvm-svn: 90016
2009-11-27 20:25:30 +00:00
Chris Lattner
2f0354ecf0
add support for recursive phi translation and phi
...
translation of add with immediate. This allows us
to optimize this function:
void test(int N, double* G) {
long j;
G[1] = 1;
for (j = 1; j < N - 1; j++)
G[j+1] = G[j] + G[j+1];
}
to only do one load every iteration of the loop.
llvm-svn: 90013
2009-11-27 19:11:31 +00:00
Chris Lattner
3d9823b9cf
factor some logic out of instcombine into a new SimplifyAddInst method.
...
llvm-svn: 90011
2009-11-27 17:42:22 +00:00
Chris Lattner
6d294de548
add comment.
...
llvm-svn: 90002
2009-11-27 08:40:14 +00:00
Chris Lattner
ac323297e0
reduce nesting, no functionality change.
...
llvm-svn: 90001
2009-11-27 08:37:22 +00:00
Chris Lattner
8e62d0a93d
limit the recursion depth of GetLinearExpression. This
...
fixes a crash analyzing consumer-lame, which had an "%X = add %X, 1"
in unreachable code.
llvm-svn: 90000
2009-11-27 08:32:52 +00:00
Chris Lattner
25be93dfed
teach GVN's load PRE to insert computations of the address in predecessors
...
where it is not available. It's unclear how to get this inserted
computation into GVN's scalar availability sets, Owen, help? :)
llvm-svn: 89997
2009-11-27 08:25:10 +00:00
Chris Lattner
a9a76ccf56
Fix phi translation in load PRE to agree with the phi
...
translation done by memdep, and reenable gep translation
again.
llvm-svn: 89992
2009-11-27 06:31:14 +00:00
Chris Lattner
b018bda665
redisable this, my bootstrap worked because it wasn't an optimized build, whoops.
...
llvm-svn: 89991
2009-11-27 05:53:01 +00:00
Chris Lattner
fb8a718fc3
try again.
...
llvm-svn: 89990
2009-11-27 05:19:56 +00:00
Chris Lattner
14444f5c1a
this is causing buildbot failures, disable for now.
...
llvm-svn: 89985
2009-11-27 01:52:22 +00:00
Chris Lattner
5030c6ab21
teach phi translation of GEPs to simplify geps like 'gep x, 0'.
...
This allows us to compile the example from PR5313 into:
LBB1_2: ## %bb
incl %ecx
movb %al, (%rsi)
movslq %ecx, %rax
movb (%rdi,%rax), %al
testb %al, %al
jne LBB1_2
instead of:
LBB1_2: ## %bb
movslq %eax, %rcx
incl %eax
movb (%rdi,%rcx), %cl
movb %cl, (%rsi)
movslq %eax, %rcx
cmpb $0, (%rdi,%rcx)
jne LBB1_2
llvm-svn: 89981
2009-11-27 00:34:38 +00:00
Chris Lattner
8574aba4ea
factor some instcombine simplifications for getelementptr out to a new
...
SimplifyGEPInst method in InstructionSimplify.h. No functionality change.
llvm-svn: 89980
2009-11-27 00:29:05 +00:00
Chris Lattner
4c88e814b8
teach memdep to do trivial PHI translation of GEPs. More to
...
come.
llvm-svn: 89979
2009-11-27 00:07:37 +00:00
Chris Lattner
9bd2136ca3
Teach memdep to phi translate bitcasts. This allows us to compile
...
the example in GCC PR16799 to:
LBB1_2: ## %bb1
movl %eax, %eax
subq %rax, %rdi
movq %rdi, (%rcx)
movl (%rdi), %eax
testl %eax, %eax
je LBB1_2
instead of:
LBB1_2: ## %bb1
movl (%rdi), %ecx
subq %rcx, %rdi
movq %rdi, (%rax)
cmpl $0, (%rdi)
je LBB1_2
llvm-svn: 89978
2009-11-26 23:41:07 +00:00
Chris Lattner
c49f5ac7d8
factor some code out into some helper functions.
...
llvm-svn: 89975
2009-11-26 23:18:49 +00:00
Chris Lattner
1bf7ff704a
Implement PR1143 (at -m64) by making basicaa look through extensions. We
...
previously already handled it at -m32 because there were no i32->i64
extensions for addressing.
llvm-svn: 89959
2009-11-26 18:53:33 +00:00
Chris Lattner
d7cabea8ca
fix two transposed lines duncan caught and add an explanatory comment.
...
llvm-svn: 89958
2009-11-26 18:35:46 +00:00
Chris Lattner
9aa846956e
this todo is resolved.
...
llvm-svn: 89957
2009-11-26 17:14:10 +00:00
Chris Lattner
29f82a1465
move DecomposeGEPExpression out into ValueTracking.cpp
...
llvm-svn: 89956
2009-11-26 17:12:50 +00:00
Chris Lattner
631c5b2cb9
teach GetLinearExpression to be a bit more aggressive.
...
llvm-svn: 89955
2009-11-26 17:00:01 +00:00
Chris Lattner
5c1cfc252c
resolve a fixme. I haven't figured out how to write a testcase
...
to exercise this though.
llvm-svn: 89954
2009-11-26 16:52:32 +00:00
Chris Lattner
29bc8a91d3
Teach basicaa that x|c == x+c when the c bits of x are clear. This
...
allows us to compile the example in readme.txt into:
LBB1_1: ## %bb
movl 4(%rdx,%rax), %ecx
movl %ecx, %esi
imull (%rdx,%rax), %esi
imull %esi, %ecx
movl %esi, 8(%rdx,%rax)
imull %ecx, %esi
movl %ecx, 12(%rdx,%rax)
movl %esi, 16(%rdx,%rax)
imull %ecx, %esi
movl %esi, 20(%rdx,%rax)
addq $16, %rax
cmpq $4000, %rax
jne LBB1_1
instead of:
LBB1_1:
movl (%rdx,%rax), %ecx
imull 4(%rdx,%rax), %ecx
movl %ecx, 8(%rdx,%rax)
imull 4(%rdx,%rax), %ecx
movl %ecx, 12(%rdx,%rax)
imull 8(%rdx,%rax), %ecx
movl %ecx, 16(%rdx,%rax)
imull 12(%rdx,%rax), %ecx
movl %ecx, 20(%rdx,%rax)
addq $16, %rax
cmpq $4000, %rax
jne LBB1_1
GCC (4.2) doesn't seem to be able to eliminate the loads in this
testcase either, it generates:
L2:
movl (%rdx), %eax
imull 4(%rdx), %eax
movl %eax, 8(%rdx)
imull 4(%rdx), %eax
movl %eax, 12(%rdx)
imull 8(%rdx), %eax
movl %eax, 16(%rdx)
imull 12(%rdx), %eax
movl %eax, 20(%rdx)
addl $4, %ecx
addq $16, %rdx
cmpl $1002, %ecx
jne L2
llvm-svn: 89952
2009-11-26 16:26:43 +00:00
Chris Lattner
12dacdd359
teach basicaa that A[i] != A[i+1].
...
llvm-svn: 89951
2009-11-26 16:18:10 +00:00
Chris Lattner
7a5b56aca9
Change the other half of aliasGEP (which handles GEP differencing) to use DecomposeGEPExpression. This dramatically simplifies and shrinks the code by eliminating the horrible CheckGEPInstructions method, fixes a miscompilation ( @test3 ) and makes the code more aggressive. In particular, we now handle the @test4 case, which is reduced from the SmallPtrSet constructor. Missing this caused us to emit a variable length memset instead of a fixed size one.
...
llvm-svn: 89922
2009-11-26 02:17:34 +00:00
Chris Lattner
5341c9679d
Generalize DecomposeGEPExpression to exactly handle what Value::getUnderlyingObject does (when TD is around). This allows us to avoid calling DecomposeGEPExpression unless the ultimate alias check we care about passes, speedup up BasicAA a bit.
...
llvm-svn: 89920
2009-11-26 02:14:59 +00:00
Chris Lattner
8928899413
Implement a new DecomposeGEPExpression method, which decomposes a GEP into a list of scaled offsets. Use this to eliminate some previous ad-hoc code which was subtly broken (it assumed all Constant*'s were non-zero, but strange constant express could be zero).
...
llvm-svn: 89915
2009-11-26 02:13:03 +00:00
Chris Lattner
a99edbedd1
Use GEPOperator more pervasively to simplify code.
...
llvm-svn: 89914
2009-11-26 02:11:08 +00:00
Chris Lattner
4f0b47d9e7
remove some redundant braces
...
llvm-svn: 89912
2009-11-26 01:50:12 +00:00
Devang Patel
2d9caf9fe5
Use StringRef (again) in DebugInfo interface.
...
llvm-svn: 89866
2009-11-25 17:36:49 +00:00
Devang Patel
04d2f2d192
Emit pubtypes.
...
llvm-svn: 89725
2009-11-24 01:14:22 +00:00
Jim Grosbach
bf2956a88b
enable iv-users simplification by default
...
llvm-svn: 89713
2009-11-23 23:25:54 +00:00
Devang Patel
75e6a40d6d
Add CreateLocation varinat that accepts MDNode (with a default value).
...
llvm-svn: 89689
2009-11-23 19:11:20 +00:00
Chris Lattner
214ef9a4ef
fix comment, thanks all :)
...
llvm-svn: 89666
2009-11-23 17:07:35 +00:00
Chris Lattner
1e7b37ebba
use the new isNoAlias method to simplify some code, only do an escaping check if
...
we have a non-constant pointer. Constant pointers can't be local.
llvm-svn: 89665
2009-11-23 16:46:41 +00:00
Chris Lattner
98e25326a0
whitespace cleanup, tidying
...
llvm-svn: 89664
2009-11-23 16:45:27 +00:00
Chris Lattner
84ed59abcf
speed up BasicAA a bit by implementing a long-standing TODO.
...
llvm-svn: 89663
2009-11-23 16:44:43 +00:00
Dan Gohman
580b80d6d9
Make ConstantFoldConstantExpression recursively visit the entire
...
ConstantExpr, not just the top-level operator. This allows it to
fold many more constants.
Also, make GlobalOpt call ConstantFoldConstantExpression on
GlobalVariable initializers.
llvm-svn: 89659
2009-11-23 16:22:21 +00:00
Nick Lewycky
39dbfd3c58
Remove unused LLVMContext.
...
llvm-svn: 89642
2009-11-23 03:29:18 +00:00
Nick Lewycky
4e3b3f3d92
Remove dead LLVMContext argument.
...
llvm-svn: 89641
2009-11-23 03:26:09 +00:00
Chris Lattner
a13c9d1a5e
add fixme for dubious code. Duncan, what do you think?
...
llvm-svn: 89602
2009-11-22 16:16:48 +00:00
Chris Lattner
db1e9f1290
remove a silly condition that doesn't make a lot of sense anymore.
...
llvm-svn: 89601
2009-11-22 16:15:59 +00:00
Chris Lattner
d6a49ad25a
reduce indentation, no functionality change.
...
llvm-svn: 89600
2009-11-22 16:05:05 +00:00
Chris Lattner
88874ec60a
Remove the AliasAnalysis::getMustAliases method, which is dead.
...
The hasNoModRefInfoForCalls isn't worth it as a filter because
basicaa provides m/r info and everything chains to it, so remove
it.
llvm-svn: 89599
2009-11-22 16:01:44 +00:00
Nick Lewycky
663e0a06b0
Remove dead code. While there, also turn a few 'T* ' into 'T *' to match the
...
rest of the file.
llvm-svn: 89577
2009-11-22 02:38:11 +00:00
Dan Gohman
ff20377740
Use stripPointerCasts(). Thanks Duncan!
...
llvm-svn: 89472
2009-11-20 19:33:16 +00:00
Dan Gohman
a8c144d534
Revert the rule that considers comparisons between two pointers in the
...
same object to be a non-capture; Duncan pointed out a way that such
a comparison could be a capture.
Make the rule that considers a comparison against null more specific,
and only consider noalias return values compared against null. This
still supports test/Transforms/GVN/nonescaping-malloc.ll, and is not
susceptible to the problem Duncan pointed out with noalias arguments.
llvm-svn: 89468
2009-11-20 17:50:21 +00:00
Dan Gohman
6d919f1613
Simplify this code; it's not necessary to check isIdentifiedObject here
...
because if the results from getUnderlyingObject match, the values must
be from the same underlying object, even if we don't know what that
object is.
llvm-svn: 89434
2009-11-20 01:34:03 +00:00
Dan Gohman
62167b9516
Teach getSmallConstantTripMultiple about Shl operators.
...
llvm-svn: 89426
2009-11-20 01:09:34 +00:00
Dan Gohman
91449224e8
Refine the capture tracking rules for comparisons to be more
...
careful about crazy methods of capturing pointers using comparisons.
Comparisons of identified objects with null in the default address
space are not captures. And, comparisons of two pointers within the
same identified object are not captures.
llvm-svn: 89421
2009-11-20 00:50:47 +00:00
Dan Gohman
01956f5a6b
Use isVoidTy().
...
llvm-svn: 89419
2009-11-20 00:43:11 +00:00
Dan Gohman
772f922acb
Refine this to only apply to null in the default address space.
...
llvm-svn: 89411
2009-11-19 23:53:49 +00:00
Dan Gohman
94e617627d
Extend CaptureTracking to indicate when a value is never stored, even
...
if it is not ultimately captured. Teach BasicAliasAnalysis that a
local object address which does not escape and is never stored does
not alias with a value resulting from a load.
llvm-svn: 89398
2009-11-19 21:57:48 +00:00
Dan Gohman
0a2ba1068e
Comparing a pointer with null is not a capture.
...
llvm-svn: 89389
2009-11-19 21:34:07 +00:00
Jim Grosbach
50d67e791b
Teach IVUsers to keep things simpler and track loop-invariant strides only
...
for uses inside the loop. This works better with LSR. Disabled behind
-simplify-iv-users while benchmarking.
llvm-svn: 89299
2009-11-19 02:05:44 +00:00
Dan Gohman
6a976bbcb7
Simplify ComputeMultiple so that it doesn't depend on TargetData.
...
llvm-svn: 89175
2009-11-18 00:58:27 +00:00
Devang Patel
ee07075010
Remove dead code.
...
llvm-svn: 89156
2009-11-17 22:39:08 +00:00
Chris Lattner
e58c05780e
typo spotted by duncan.
...
llvm-svn: 88884
2009-11-16 03:51:42 +00:00
Chris Lattner
7735878591
teach LVI to infer edge information from switch instructions.
...
This allows JT to eliminate a ton of infeasible edges when
handling code like the templates in PatternMatch.h
llvm-svn: 88869
2009-11-15 20:02:12 +00:00
Chris Lattner
b0c0a0df3e
fix a logic error that would cause LVI-JT to miscompile
...
some conditionals
llvm-svn: 88868
2009-11-15 20:01:24 +00:00
Chris Lattner
2c708562f5
implement the first stab at caching queries. This isn't correct
...
(because the invalidation logic is missing) but LVI isn't enabled
by default anyway.
llvm-svn: 88867
2009-11-15 20:00:52 +00:00
Chris Lattner
af025d3f6e
refactor a bunch of code forming the new LazyValueInfoCache
...
and LVIQuery classes, no functionality change.
llvm-svn: 88866
2009-11-15 19:59:49 +00:00
Nick Lewycky
c53e2ecf02
Teach BasicAA that a constant expression can't alias memory provably not
...
allocated until runtime (such as an alloca). Patch by Hans Wennborg!
llvm-svn: 88760
2009-11-14 06:15:14 +00:00
Devang Patel
76a06074eb
Revert r87059 for now. It is failing clang tests.
...
llvm-svn: 87070
2009-11-13 02:27:33 +00:00
Victor Hernandez
41e7648e09
Remove unnecessary llvm.dbg.declare bitcast
...
llvm-svn: 87059
2009-11-13 01:44:55 +00:00
Devang Patel
2904aa9f6e
"Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.
...
llvm-svn: 87014
2009-11-12 19:02:56 +00:00
Evan Cheng
85a9f430e9
- Teach LSR to avoid changing cmp iv stride if it will create an immediate that
...
cannot be folded into target cmp instruction.
- Avoid a phase ordering issue where early cmp optimization would prevent the
later count-to-zero optimization.
- Add missing checks which could cause LSR to reuse stride that does not have
users.
- Fix a bug in count-to-zero optimization code which failed to find the pre-inc
iv's phi node.
- Remove, tighten, loosen some incorrect checks disable valid transformations.
- Quite a bit of code clean up.
llvm-svn: 86969
2009-11-12 07:35:05 +00:00
Chris Lattner
22db4b5e0c
various fixes to the lattice transfer functions.
...
llvm-svn: 86952
2009-11-12 04:57:13 +00:00
Chris Lattner
565ee2f1bd
Add a new getPredicateOnEdge method which returns more rich information for
...
constant constraints. Improve the LVI lattice to include inequality
constraints.
llvm-svn: 86950
2009-11-12 04:36:58 +00:00
Chris Lattner
d5e25436a1
expose edge information and switch j-t to use it.
...
llvm-svn: 86920
2009-11-12 01:29:10 +00:00
Chris Lattner
b584d1e456
move some stuff into DEBUG's and turn on lazy-value-info for
...
the basic.ll testcase.
llvm-svn: 86918
2009-11-12 01:22:16 +00:00
Devang Patel
862ef782de
Do not use StringRef in DebugInfo interface.
...
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!
llvm-svn: 86914
2009-11-12 00:50:58 +00:00