Commit Graph

1150 Commits

Author SHA1 Message Date
Dan Gohman
fc8deb971d Commit this change, to accompany r76232.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 21:03:54 +00:00
Owen Anderson
001dbfebcb Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 18:04:31 +00:00
Dan Gohman
9377386493 Add an isLoopSimplifyForm() predicate, following the example of
isLCSSAForm(), to test whether a loop is in the form guaranteed
by the LoopSimplify pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 16:16:23 +00:00
Dan Gohman
688ed8583e Tidy up #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 15:32:28 +00:00
Dan Gohman
206613b289 Fix a typo in a comment that Duncan noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 17:38:23 +00:00
Dan Gohman
bdc017edac Make makeLoopInvariant report whether it made any changes or not,
and use this to simplify more code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:25:43 +00:00
Torok Edwin
969f28dfb6 Introduce a pointertracking pass.
For now this only computes the allocated size of the memory pointed to by a
pointer, and offset a pointer from allocated pointer.
The actual checkLimits part will come later, after another round of review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75657 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 18:44:28 +00:00
Torok Edwin
c23197a26f llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 16:55:14 +00:00
Daniel Dunbar
858cb8a5e0 ProfileInfo interface tweaks.
- Add getExecutionCount(const Function).

 - Add helper Edge type.

 - constify.

 - No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 06:58:59 +00:00
Dan Gohman
a342026504 Introduce a new LoopInfo utility function makeLoopInvariant, which
works similar to isLoopInvariant, except that it will do trivial
hoisting to try to make the value loop invariant if it isn't already.
This makes it easier for transformation passes to clear trivial
instructions out of the way (the regular LICM pass doesn't run
until relatively late). This is code factored out of LoopSimplify
and other places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 01:06:29 +00:00
Dan Gohman
03ee68a145 Forward-declare Loop and LoopInfo instead of #including LoopInfo.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 22:19:41 +00:00
Dan Gohman
16a2c927e9 Move isLCSSAForm, isLoopInvariant, getCanonicalInductionVariable,
and related functions out of LoopBase and into Loop, since they
are specific to BasicBlock-based loops. This also allows the code
to be moved out-of-line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 22:02:44 +00:00
Dan Gohman
c8d76d5afb Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,
using the Curiously Recurring Template Pattern with LoopBase.

This will help further refactoring, and future functionality for
Loop. Also, Headers can now foward-declare Loop, instead of pulling
in LoopInfo.h or doing tricks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 21:51:15 +00:00
Dan Gohman
85b05a2e60 Reapply 75252, with a fix to avoid the infinite recursion case. The
check for avoiding re-analyzing a widening cast needed to happen
earlier, as getSCEV itself may result in a isLoopGuardedByCond query.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 21:35:55 +00:00
Dan Gohman
c050fd94c2 Convert SCEV from FoldingSetNode to FastFoldingSetNode. This eliminates
a bunch of redundent code in Profile methods, and prepares for upcoming
changes to do improved memoization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 20:50:19 +00:00
Daniel Dunbar
deb052a3dd Match declaration to definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 23:50:34 +00:00
Daniel Dunbar
460d16e126 Match declaration to definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 22:46:08 +00:00
Nick Lewycky
d0cca24150 Revert r75252 which was causing some crashes at compile time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 20:38:25 +00:00
Torok Edwin
c25e7581b9 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 20:10:48 +00:00
Dan Gohman
1afdc5f356 Remove ScalarEvolution::hasSCEV, which isn't being used, and which
breaks encapsulation. Also remove a dead prototype for setSCEV.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 20:25:29 +00:00
Dan Gohman
1b342583f6 Generalize ScalarEvolution's cast-folding code to support more kinds
of loops. Add several new functions to for working with ScalarEvolution's
add-hoc value-range analysis functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 16:42:52 +00:00
Owen Anderson
45524c58fd Finish pushing LLVMContext through the IRBuilder/ConstantFolder interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 00:49:53 +00:00
Andreas Bolka
7b9547089f Fix typo, trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 22:14:25 +00:00
Owen Anderson
d1fbd14294 Push LLVMContext _back_ through IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 20:50:47 +00:00
Dan Gohman
59ae6b9987 Make the code that updates ScalarEvolution's internal state in response
to a loop deletion more thorough. Don't prune the def-use tree search at
instructions that don't have SCEVs computed, because an instruction with
a user that has a computed SCEV may itself lack a computed SCEV.  Also,
remove loop-related values from the ValuesAtScopes and
ConstantEvolutionLoopExitValues maps as well.

This fixes a regression in 483.xalancbmk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 19:23:34 +00:00
Owen Anderson
9903527c14 Re-LLVMContext-ize DebugInfo, now with less breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 17:12:53 +00:00
Dan Gohman
0bba49cebc Change all SCEV* to SCEV *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 17:06:11 +00:00
Owen Anderson
07cf79ef53 "LLVMContext* " --> "LLVMContext *"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 23:00:19 +00:00
Owen Anderson
76f600b205 Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's through the ValueTracking API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 22:37:39 +00:00
Owen Anderson
508955156a Thread LLVMContext through the constant folding APIs, which touches a lot of files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 18:42:36 +00:00
Devang Patel
7e1e31f467 Simplify debug info intrisinc lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-02 22:43:26 +00:00
Devang Patel
dfc8536d7b Fix typo.
Thanks Duncan!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-02 17:17:03 +00:00
Devang Patel
9e529c3f78 Add debug info utility routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-02 01:15:24 +00:00
Dan Gohman
f530c92cd5 Fix a bunch of other places that used operator[] to test whether
a key is present in a std::map or DenseMap to use find instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-02 00:17:47 +00:00
Andreas Bolka
fecbc59be6 Use AA to check objects before LDA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 21:45:23 +00:00
Misha Brukman
b1d7a5d114 Use correct format for LLVM header #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 17:51:56 +00:00
Andreas Bolka
f67799501c Drop redundant print impl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 21:33:56 +00:00
Andreas Bolka
f35626d3cd Minimal LDA interface, maximally conservative tester.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-28 00:21:21 +00:00
Andreas Bolka
707207adae LDA analysis output scaffolding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-28 00:16:08 +00:00
Dan Gohman
9d59d9f849 Eliminate a layer of indirection in LoopInfo and MachineLoopInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-27 21:22:48 +00:00
Dan Gohman
1c34375f79 Convert ScalarEvolution to use BumpPtrAllocator and FoldingSet, instead
of a team of individual allocations and a team of std::maps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-27 21:21:31 +00:00
Dan Gohman
267a385342 Change SCEVExpander to use an IRBuilder to emit instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-27 21:18:18 +00:00
Dan Gohman
667d787c0a Incorporate the insertion point into the key of SCEVExpander's CSE map.
This helps it avoid reusing an instruction that doesn't dominate all
of the users, in cases where the original instruction was inserted
before all of the users were known.  This may result in redundant
expansions of sub-expressions that depend on loop-unpredictable values
in some cases, however this isn't very common, and it primarily impacts
IndVarSimplify, so GVN can be expected to clean these up.

This eliminates the need for IndVarSimplify's FixUsesBeforeDefs,
which fixes several bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-26 22:53:46 +00:00
Jeffrey Yasskin
d8ac1be686 Delete LoopPass::runOnFunctionBody. It was never used or implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-26 20:42:50 +00:00
Devang Patel
e2f9382c72 Remove unnecessary includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-26 02:25:46 +00:00
Devang Patel
13e16b65dd Remove debug info anchors - llvm.dbg.compile_units, llvm.dbg.subprograms
and llvm.dbg.global_variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-26 01:49:18 +00:00
Dan Gohman
a278f3f552 Add a getUniqueExitBlock utility function, similar to getExitBlock,
but for getUniqueExitBlocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-25 00:09:57 +00:00
Owen Anderson
09fc0fa0b1 Get rid of a static boolean.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-24 22:08:59 +00:00
Andreas Bolka
cb21010fa0 Scaffolding for LDA pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-24 21:29:13 +00:00
Dan Gohman
650919e8b0 Remove an obsolete comment and fix some 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-24 04:47:54 +00:00