Devang Patel
6c1b802673
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
...
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 15:01:38 +00:00
Devang Patel
72715ef163
Add getFile() to get DIFile of a DIType.
...
llvm-svn: 118247
2010-11-04 14:56:34 +00:00
Devang Patel
43516e02b6
Simplify.
...
- DIFile F = getFieldAs<DIFile>(6);
- return F.getDirectory();
+ return getFieldAs<DIFile>(6).getDirectory();
llvm-svn: 117662
2010-10-29 16:42:37 +00:00
Devang Patel
c40ecb9302
Fix indentation.
...
llvm-svn: 117601
2010-10-28 20:41:11 +00:00
Devang Patel
504232300c
Backward compatibility. Gracefully handle older versions of debug info.
...
llvm-svn: 117595
2010-10-28 20:08:13 +00:00
Devang Patel
a496603faf
Do not work too hard to find type's file info. There is a special field to record file info.
...
llvm-svn: 117588
2010-10-28 19:50:08 +00:00
Devang Patel
552a3a845c
Fix indentation.
...
llvm-svn: 117586
2010-10-28 19:40:13 +00:00
Devang Patel
dcabf6f76a
Do not rely on context to find file info. It is already provided as a separate field.
...
llvm-svn: 117577
2010-10-28 19:14:28 +00:00
Devang Patel
6c3a77ab58
Give a name to nameless argument.
...
llvm-svn: 117468
2010-10-27 18:08:31 +00:00
Benjamin Kramer
86b0370b66
SmallVectorize.
...
llvm-svn: 117213
2010-10-23 17:10:24 +00:00
Tobias Grosser
88ce93b0eb
Add RegionPass support.
...
A RegionPass is executed like a LoopPass but on the regions detected by the
RegionInfo pass instead of the loops detected by the LoopInfo pass.
llvm-svn: 116905
2010-10-20 01:54:44 +00:00
Dan Gohman
399ef0b44a
Move NoAA out of BasicAliasAnalysis.cpp into its own file, now that
...
it doesn't have a special relationship with BasicAliasAnalysis
anymore.
llvm-svn: 116876
2010-10-19 23:09:08 +00:00
Dan Gohman
befe1767ff
Reapply r116831 and r116839, converting AliasAnalysis to use
...
uint64_t, plus fixes for places I missed before.
llvm-svn: 116875
2010-10-19 22:54:46 +00:00
Dan Gohman
de3c49438f
Revert r116831 and r116839, which are breaking selfhost builds.
...
llvm-svn: 116858
2010-10-19 21:06:16 +00:00
Dan Gohman
37a9b813f5
Oops, check in all the files for converting AliasAnalysis to
...
use uint64_t.
llvm-svn: 116839
2010-10-19 18:08:27 +00:00
Owen Anderson
46990c17f7
Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
...
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.
Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.
I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.
llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Dan Gohman
8b332ffb8c
Make the representation of AliasSets explicitly differentiate
...
between "not known yet" and "known no tbaa info" so that it
can merge them properly.
llvm-svn: 116767
2010-10-18 23:31:47 +00:00
Dan Gohman
6efd04961b
Don't pass the raw invalid pointer used to represent conflicting
...
TBAA information to AliasAnalysis.
llvm-svn: 116751
2010-10-18 21:28:00 +00:00
Dan Gohman
64affb7be2
Make AliasSetTracker TBAA-aware, enabling TBAA-enabled LICM.
...
llvm-svn: 116743
2010-10-18 20:44:50 +00:00
Benjamin Kramer
3d87b36b64
Remove noisy semicolon.
...
llvm-svn: 116407
2010-10-13 15:55:12 +00:00
Tobias Grosser
70507511ae
Add Region::isTopLevelRegion().
...
llvm-svn: 116402
2010-10-13 11:02:44 +00:00
Tobias Grosser
85dce73ab5
RegionInfo: Update RegionInfo after a BB was split.
...
llvm-svn: 116398
2010-10-13 05:54:13 +00:00
Tobias Grosser
6aac855519
RegioInfo: Add getExpandedRegion().
...
getExpandedRegion() enables us to create non canonical regions. Those regions
can be used to define the largerst region, that fullfills a certain property.
llvm-svn: 116397
2010-10-13 05:54:11 +00:00
Tobias Grosser
ecfaf92c1a
RegionInfo: Allow to update exit and entry of a region.
...
llvm-svn: 116396
2010-10-13 05:54:10 +00:00
Tobias Grosser
84dd4b54fc
RegionInfo: Enhance addSubregion.
...
llvm-svn: 116395
2010-10-13 05:54:09 +00:00
Tobias Grosser
a2b5df5a6d
RegionInfo: Allow to set the parent region of a basic block.
...
llvm-svn: 116394
2010-10-13 05:54:07 +00:00
Kenneth Uildriks
e9771f15f7
Now using a variant of the existing inlining heuristics to decide whether to create a given specialization of a function in PartialSpecialization. If the total performance bonus across all callsites passing the same constant exceeds the specialization cost, we create the specialization.
...
llvm-svn: 116158
2010-10-09 22:06:36 +00:00
Kenneth Uildriks
0545afa8fd
Start separating out code metrics into code size metrics and code performance metrics. Partial Specialization will apply the former to function specializations, and the latter to all callsites that can use a specialization, in order to decide whether to create a specialization
...
llvm-svn: 116057
2010-10-08 13:57:31 +00:00
Devang Patel
ee23e6ea23
Provie a clearner interface so that FE can decide whether a function has prototype or not.
...
llvm-svn: 115988
2010-10-07 22:03:01 +00:00
Devang Patel
eeb0b64560
Add support for DW_TAG_unspecified_parameters.
...
llvm-svn: 115833
2010-10-06 20:50:40 +00:00
Dan Gohman
52980b97f9
Constify isReachableFromEntry.
...
llvm-svn: 115788
2010-10-06 15:49:14 +00:00
Devang Patel
f612c0b23e
Add support to let FE mark explict methods as explict in debug info.
...
llvm-svn: 115378
2010-10-01 23:31:40 +00:00
Devang Patel
41e2a94595
Let FE mark a variable as artificial variable.
...
llvm-svn: 115102
2010-09-29 23:07:21 +00:00
Devang Patel
f600d9f0ed
Add support to let FE encode method access specifier.
...
llvm-svn: 115089
2010-09-29 21:44:16 +00:00
Devang Patel
bbd003ab48
Generalize DISubprogram element to encode various flags instead of just one boolean for isArtificial.
...
This is a backword compatible change.
llvm-svn: 115084
2010-09-29 21:04:46 +00:00
Chris Lattner
b7bfd3de07
remove PointerTracking from mainline, Edwin is going to move it out to ClamAV
...
for LLVM 2.9
llvm-svn: 115062
2010-09-29 18:43:27 +00:00
Devang Patel
e1f502ee26
Provide an interface to let FEs anchor debug info for types.
...
llvm-svn: 114969
2010-09-28 18:08:20 +00:00
Dan Gohman
3c72647fd5
Constify properlyDominates in the same manner as dominates.
...
Add constified overloads for findNearestCommonDominator.
llvm-svn: 114834
2010-09-27 16:33:31 +00:00
Dan Gohman
e024d78aab
Remove WriteGraph's Name argument, which it didn't use, and
...
rename writeHeader's Name argument to Title, to be consistent
with WriteGraph.
llvm-svn: 114829
2010-09-27 15:34:19 +00:00
Oscar Fuentes
2291919711
Avoid warnings about implicit conversions to `bool' in MSVC. This time
...
for real.
Patch by Nathan Jeffords!
llvm-svn: 114796
2010-09-25 20:27:36 +00:00
Dan Gohman
3ae6b70330
Fix uninitialized TBAAFlag field values.
...
llvm-svn: 114591
2010-09-22 22:18:07 +00:00
Dan Gohman
d69790d841
Teach memdep about TBAA tags.
...
llvm-svn: 114588
2010-09-22 21:41:02 +00:00
Dan Gohman
879cf5573e
Constify.
...
llvm-svn: 114574
2010-09-22 20:11:43 +00:00
Dan Gohman
008676d2ee
Add some utility routines.
...
llvm-svn: 114483
2010-09-21 21:20:13 +00:00
Benjamin Kramer
a81f2ba27e
Make CreateComplexVariable independent of SmallVector.
...
llvm-svn: 114439
2010-09-21 16:00:03 +00:00
Dan Gohman
836ce09592
Add a pass which prints out all the memdep dependencies.
...
llvm-svn: 114121
2010-09-16 22:08:32 +00:00
Owen Anderson
3d4644bad9
Revert r114097, adding back in the assertion against replacing an Instruction by itself. Now that CorrelatedValuePropagation is
...
more careful not to call SimplifyInstructionsInBlock() on an unreachable block, the issue has been fixed at a higher level. Add
a big warning to SimplifyInstructionsInBlock() to hopefully prevent this in the future.
llvm-svn: 114117
2010-09-16 20:51:41 +00:00
Dan Gohman
ebbc4df924
Remove the experimental AliasAnalysis::getDependency interface, which
...
isn't a good level of abstraction for memdep. Instead, generalize
AliasAnalysis::alias and related interfaces with a new Location
class for describing a memory location. For now, this is the same
Pointer and Size as before, plus an additional field for a TBAA tag.
Also, introduce a fixed MD_tbaa metadata tag kind.
llvm-svn: 113858
2010-09-14 21:25:10 +00:00
Gabor Greif
dfe6dea95f
typoes
...
llvm-svn: 113647
2010-09-10 22:25:58 +00:00
Owen Anderson
f7276d42d3
What the loop unroller cares about, rather than just not unrolling loops with calls, is
...
not unrolling loops that contain calls that would be better off getting inlined. This mostly
comes up when an interleaved devirtualization pass has devirtualized a call which the inliner
will inline on a future pass. Thus, rather than blocking all loops containing calls, add
a metric for "inline candidate calls" and block loops containing those instead.
llvm-svn: 113535
2010-09-09 20:32:23 +00:00
Dan Gohman
7fbaed00bf
Extend the getDependence query with support for PHI translation.
...
llvm-svn: 113521
2010-09-09 18:37:31 +00:00
Dan Gohman
e1fb5b5738
Fix this comment.
...
llvm-svn: 113511
2010-09-09 18:04:22 +00:00
Owen Anderson
9a194c80c4
Refactor code-size reduction estimation methods out of InlineCostAnalyzer and into CodeMetrics. They
...
don't use any InlineCostAnalyzer state, and are useful for other clients who don't necessarily want to use
all of InlineCostAnalyzer's logic, some of which is fairly inlining-specific.
No intended functionality change.
llvm-svn: 113499
2010-09-09 16:56:42 +00:00
Dan Gohman
de56ae353b
Add a new experimental generalized dependence query interface to
...
AliasAnalysis, and some code for implementing the new query on top of
existing implementations by making standard alias and getModRefInfo
queries.
llvm-svn: 113329
2010-09-08 01:32:20 +00:00
Dan Gohman
6d4356d31f
Tidy up the getModRefInfo declarations.
...
llvm-svn: 113275
2010-09-07 20:37:47 +00:00
Chris Lattner
818045f208
pull a simple method out of LICM into a new
...
Loop::hasLoopInvariantOperands method. Remove
a useless and confusing Loop::isLoopInvariant(Instruction)
method, which didn't do what you thought it did.
No functionality change.
llvm-svn: 113133
2010-09-06 01:05:37 +00:00
Dan Gohman
ad593f9d93
Revert 112442 and 112440 until the compile time problems introduced
...
by 112440 are resolved.
llvm-svn: 112692
2010-09-01 01:45:53 +00:00
Dan Gohman
d261381db5
Update the descriptions of NoModRef and ModRef to be consistent
...
with the descriptions of Mod and Ref.
llvm-svn: 112557
2010-08-30 23:47:24 +00:00
Chris Lattner
9e35d96cea
two changes: 1) make AliasSet hold the list of call sites with an
...
assertingvh so we get a violent explosion if the pointer dangles.
2) Fix AliasSetTracker::deleteValue to remove call sites with
by-pointer comparisons instead of by-alias queries. Using
findAliasSetForCallSite can cause alias sets to get merged
when they shouldn't, and can also miss alias sets when the
call is readonly.
#2 fixes PR6889, which only repros with a .c file :(
llvm-svn: 112452
2010-08-29 18:42:23 +00:00
Dan Gohman
9ea315c5ca
Make IVUsers iterative instead of recursive.
...
This has the side effect of reversing the order of most of
IVUser's results.
llvm-svn: 112442
2010-08-29 16:40:03 +00:00
Dan Gohman
636c57c5de
Switch ScalarEvolution's main Value*->SCEV* map from std::map
...
to DenseMap.
llvm-svn: 112281
2010-08-27 18:55:03 +00:00
Eric Christopher
6263463ccb
Fix header define to reflect the name of the file.
...
Patch by Adam Treat!
llvm-svn: 112077
2010-08-25 19:28:39 +00:00
Devang Patel
cf6c6b4038
Handle qualified constants that are directly folded by FE.
...
PR 7920.
llvm-svn: 111820
2010-08-23 18:25:56 +00:00
Dan Gohman
31ab7e6b8c
CreateTemporaryType doesn't needs its Context argument.
...
llvm-svn: 111687
2010-08-20 22:39:47 +00:00
Dan Gohman
072e7bdcd4
Introduce a new temporary MDNode concept. Temporary MDNodes are
...
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.
llvm-svn: 111681
2010-08-20 22:02:26 +00:00
Chris Lattner
bd80bd5d69
move gep decomposition out of ValueTracking into BasicAA. The form of
...
decomposition that it is doing is very basicaa specific and is only used
by basicaa.
Now with less tree breakingness.
llvm-svn: 111433
2010-08-18 22:07:29 +00:00
Daniel Dunbar
3d68ce9eeb
Revert r111375, "move gep decomposition out of ValueTracking into BasicAA. The
...
form of", it doesn't pass tests.
llvm-svn: 111385
2010-08-18 18:43:08 +00:00
Owen Anderson
65795241db
Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues.
...
llvm-svn: 111382
2010-08-18 18:39:01 +00:00
Chris Lattner
2d584f0b0e
move gep decomposition out of ValueTracking into BasicAA. The form of
...
decomposition that it is doing is very basicaa specific and is only used
by basicaa.
llvm-svn: 111375
2010-08-18 18:22:17 +00:00
Dan Gohman
cc19893826
Revert r111031. The way LLVM defines loop invariance, the property of an
...
expression being loop invariant is not equivalent to the property of
properly dominating the loop header.
Other optimizations have also made this optimization less important.
llvm-svn: 111160
2010-08-16 17:34:25 +00:00
Dan Gohman
928cf9d77b
Placate overzealous compiler warnings.
...
llvm-svn: 111152
2010-08-16 17:01:55 +00:00
Dan Gohman
6d808db278
Move SCEVNAryExpr's virtual member functions out of line, and convert
...
them to iterators.
llvm-svn: 111140
2010-08-16 16:21:27 +00:00
Dan Gohman
3921a903bb
Specialize FoldingSetTrait<SCEV>, providing implementations of node
...
comparison and hash computation which don't require constructing
temporary ID values.
llvm-svn: 111131
2010-08-16 15:31:45 +00:00
Dan Gohman
c58d128eb8
Implement hasComputableLoopEvolution for Add, Mul, and Trunc operators,
...
since they can support trivial implementations. This avoids potentially
expensive traversals of the operands.
llvm-svn: 111031
2010-08-13 20:03:15 +00:00
Dan Gohman
2d7bf8c073
Make LoopPass::getContainedPass return a LoopPass* instead of a Pass*
...
and remove casts from all its callers.
llvm-svn: 110848
2010-08-11 20:34:43 +00:00
Dan Gohman
7e49302e9a
Rename and reorder the arguments to isImpliedCond, for consistency and clarity.
...
llvm-svn: 110750
2010-08-10 23:46:30 +00:00
Devang Patel
17606414a4
Add missing argument. CreateCompositeTypeEx() users, please verify.
...
llvm-svn: 110717
2010-08-10 20:22:49 +00:00
Devang Patel
8d0c79694e
Refactor.
...
llvm-svn: 110607
2010-08-09 21:39:24 +00:00
Dan Gohman
0c6a626902
Remove assignPassManager's default arguments. It's really
...
confusing to have different arguments for the same virtual
function at different levels of the class hierarchy.
llvm-svn: 110500
2010-08-07 01:25:32 +00:00
Dan Gohman
a581d6d202
Tidy up PMStack. Add a bunch of consts, use std::vector instead of
...
std::deque, since this is a stack and only supports push/pop on
one end, and remove an unimplemented declaration.
llvm-svn: 110495
2010-08-07 00:53:01 +00:00
Owen Anderson
f2fea95f2f
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Dan Gohman
da3f592fb3
Implement a proper getModRefInfo for va_arg.
...
llvm-svn: 110458
2010-08-06 18:24:38 +00:00
Dan Gohman
66b637e4da
Add a comment.
...
llvm-svn: 110426
2010-08-06 02:04:07 +00:00
Owen Anderson
aadd8a89ca
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Dan Gohman
ecf79cf569
Make AA private, since subclasses shouldn't (aren't don't) access it directly.
...
llvm-svn: 110398
2010-08-05 23:44:45 +00:00
Owen Anderson
b9762c07cb
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Dan Gohman
9ded12adcb
Delete obsolete comments.
...
llvm-svn: 110277
2010-08-04 23:08:15 +00:00
Torok Edwin
967fc5164f
Add a missing function.
...
llvm-svn: 110195
2010-08-04 11:42:45 +00:00
Dan Gohman
aac19e4ffe
Remove PointerAccessInfo, which nothing was using.
...
llvm-svn: 110167
2010-08-03 23:08:10 +00:00
Dan Gohman
a087b90950
Thread const correctness through a bunch of AliasAnalysis interfaces and
...
eliminate several const_casts.
Make CallSite implicitly convertible to ImmutableCallSite.
Rename the getModRefBehavior for intrinsic IDs to
getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite,
which happens to be implicitly convertible to bool.
llvm-svn: 110155
2010-08-03 21:48:53 +00:00
Dan Gohman
aabb615d52
Update some comments.
...
llvm-svn: 110092
2010-08-03 01:07:32 +00:00
Dan Gohman
6604a72154
Introduce a symbolic constant for ~0u for use with AliasAnalysis.
...
llvm-svn: 110091
2010-08-03 01:03:11 +00:00
Dan Gohman
e0489ffe8e
Add a convenient form of AliasAnalysis::alias for the case where the sizes
...
are unknown.
llvm-svn: 110090
2010-08-03 00:56:30 +00:00
Dan Gohman
68ac0492a4
Make SCEVUnknown a CallbackVH, so that it can be notified directly
...
of Value deletions and RAUWs, instead of relying on ScalarEvolution's
Scalars map being notified, as that's complicated at best, and
insufficient in general.
This means SCEVUnknown needs a non-trivial destructor, so introduce
a mechanism to allow ScalarEvolution to locate all the SCEVUnknowns.
llvm-svn: 110086
2010-08-02 23:49:30 +00:00
Dan Gohman
9d80b87a4d
Sketch up a preliminary Type-Based Alias Analysis implementation.
...
llvm-svn: 110077
2010-08-02 23:11:01 +00:00
Devang Patel
f18faa5945
Add explicit constructors. Patch by Renato Golin.
...
llvm-svn: 110072
2010-08-02 22:51:46 +00:00
Nick Lewycky
460d1a457b
LibCallAliasAnalysis uses multiple inheritance, so it needs to implement
...
getAdjustedAnalysisPointer. Part of a fix to PR7760.
llvm-svn: 109883
2010-07-30 20:19:09 +00:00
Eric Christopher
6a1da7b4a5
Speculatively revert r109705 since it seems to be causing some build bot
...
angst.
llvm-svn: 109718
2010-07-29 01:25:38 +00:00
Dan Gohman
ea1486b53c
Factor out some of the code for updating old SCEVUnknown values, and
...
extend it to handle the case where multiple RAUWs affect a single
SCEVUnknown.
Add a ScalarEvolution unittest to test for this situation.
llvm-svn: 109705
2010-07-29 00:17:55 +00:00
Dan Gohman
b4699b3002
Add some extra friend declarations to fix a gcc-4.0 compile error.
...
This is a temporary fix, until more elaborate changes are ready.
llvm-svn: 109593
2010-07-28 17:09:24 +00:00