blob: 463269d9d984c4f4662f863fa74bd1eb72ac7a05 [file] [log] [blame]
Andreas Bolkacb210102009-06-24 21:29:13 +00001//===- LoopDependenceAnalysis.cpp - LDA Implementation ----------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This is the (beginning) of an implementation of a loop dependence analysis
11// framework, which is used to detect dependences in memory accesses in loops.
12//
13// Please note that this is work in progress and the interface is subject to
14// change.
15//
16// TODO: adapt as implementation progresses.
17//
Andreas Bolka15f72db2009-07-29 05:35:53 +000018// TODO: document lingo (pair, subscript, index)
19//
Andreas Bolkacb210102009-06-24 21:29:13 +000020//===----------------------------------------------------------------------===//
21
22#define DEBUG_TYPE "lda"
Andreas Bolka699db992009-08-07 18:23:41 +000023#include "llvm/ADT/DenseSet.h"
Andreas Bolka328fb3d2009-07-28 19:49:49 +000024#include "llvm/ADT/Statistic.h"
Andreas Bolkafecbc592009-07-01 21:45:23 +000025#include "llvm/Analysis/AliasAnalysis.h"
Andreas Bolkacb210102009-06-24 21:29:13 +000026#include "llvm/Analysis/LoopDependenceAnalysis.h"
27#include "llvm/Analysis/LoopPass.h"
28#include "llvm/Analysis/ScalarEvolution.h"
Andreas Bolka5eca4522009-08-03 01:03:48 +000029#include "llvm/Analysis/ScalarEvolutionExpressions.h"
Dan Gohman5034dd32010-12-15 20:02:24 +000030#include "llvm/Analysis/ValueTracking.h"
Chris Lattner9fc5cdf2011-01-02 22:09:33 +000031#include "llvm/Assembly/Writer.h"
Andreas Bolkaf35626d2009-06-28 00:21:21 +000032#include "llvm/Instructions.h"
Andreas Bolka15f72db2009-07-29 05:35:53 +000033#include "llvm/Operator.h"
Andreas Bolka0baa25d2009-07-24 23:19:28 +000034#include "llvm/Support/Allocator.h"
Andreas Bolkae9722fc2009-06-30 02:12:10 +000035#include "llvm/Support/Debug.h"
Torok Edwinc25e7582009-07-11 20:10:48 +000036#include "llvm/Support/ErrorHandling.h"
Andreas Bolka0baa25d2009-07-24 23:19:28 +000037#include "llvm/Support/raw_ostream.h"
Andreas Bolkafecbc592009-07-01 21:45:23 +000038#include "llvm/Target/TargetData.h"
Andreas Bolkacb210102009-06-24 21:29:13 +000039using namespace llvm;
40
Andreas Bolka328fb3d2009-07-28 19:49:49 +000041STATISTIC(NumAnswered, "Number of dependence queries answered");
42STATISTIC(NumAnalysed, "Number of distinct dependence pairs analysed");
43STATISTIC(NumDependent, "Number of pairs with dependent accesses");
44STATISTIC(NumIndependent, "Number of pairs with independent accesses");
45STATISTIC(NumUnknown, "Number of pairs with unknown accesses");
46
Andreas Bolkacb210102009-06-24 21:29:13 +000047LoopPass *llvm::createLoopDependenceAnalysisPass() {
48 return new LoopDependenceAnalysis();
49}
50
Owen Anderson2ab36d32010-10-12 19:48:12 +000051INITIALIZE_PASS_BEGIN(LoopDependenceAnalysis, "lda",
52 "Loop Dependence Analysis", false, true)
53INITIALIZE_PASS_DEPENDENCY(ScalarEvolution)
54INITIALIZE_AG_DEPENDENCY(AliasAnalysis)
55INITIALIZE_PASS_END(LoopDependenceAnalysis, "lda",
Owen Andersonce665bd2010-10-07 22:25:06 +000056 "Loop Dependence Analysis", false, true)
Andreas Bolkacb210102009-06-24 21:29:13 +000057char LoopDependenceAnalysis::ID = 0;
58
59//===----------------------------------------------------------------------===//
Andreas Bolkaf35626d2009-06-28 00:21:21 +000060// Utility Functions
61//===----------------------------------------------------------------------===//
62
Andreas Bolka2fbb7702009-06-29 18:51:11 +000063static inline bool IsMemRefInstr(const Value *V) {
64 const Instruction *I = dyn_cast<const Instruction>(V);
65 return I && (I->mayReadFromMemory() || I->mayWriteToMemory());
Andreas Bolkaf35626d2009-06-28 00:21:21 +000066}
67
Andreas Bolka3b59dd82009-07-23 01:57:06 +000068static void GetMemRefInstrs(const Loop *L,
69 SmallVectorImpl<Instruction*> &Memrefs) {
Andreas Bolkac6a30302009-06-28 00:35:22 +000070 for (Loop::block_iterator b = L->block_begin(), be = L->block_end();
Andreas Bolka34ce6872009-07-28 19:49:25 +000071 b != be; ++b)
Andreas Bolkac6a30302009-06-28 00:35:22 +000072 for (BasicBlock::iterator i = (*b)->begin(), ie = (*b)->end();
Andreas Bolka34ce6872009-07-28 19:49:25 +000073 i != ie; ++i)
Andreas Bolkaacd6f8d2009-06-29 00:50:26 +000074 if (IsMemRefInstr(i))
Andreas Bolka3b59dd82009-07-23 01:57:06 +000075 Memrefs.push_back(i);
Andreas Bolkac6a30302009-06-28 00:35:22 +000076}
77
Andreas Bolkae9722fc2009-06-30 02:12:10 +000078static bool IsLoadOrStoreInst(Value *I) {
Eli Friedman667ccf22011-08-15 20:54:19 +000079 // Returns true if the load or store can be analyzed. Atomic and volatile
80 // operations have properties which this analysis does not understand.
81 if (LoadInst *LI = dyn_cast<LoadInst>(I))
82 return LI->isUnordered();
83 else if (StoreInst *SI = dyn_cast<StoreInst>(I))
84 return SI->isUnordered();
85 return false;
Andreas Bolkae9722fc2009-06-30 02:12:10 +000086}
87
88static Value *GetPointerOperand(Value *I) {
89 if (LoadInst *i = dyn_cast<LoadInst>(I))
90 return i->getPointerOperand();
91 if (StoreInst *i = dyn_cast<StoreInst>(I))
92 return i->getPointerOperand();
Torok Edwinc23197a2009-07-14 16:55:14 +000093 llvm_unreachable("Value is no load or store instruction!");
Andreas Bolkae9722fc2009-06-30 02:12:10 +000094}
95
Andreas Bolka34ce6872009-07-28 19:49:25 +000096static AliasAnalysis::AliasResult UnderlyingObjectsAlias(AliasAnalysis *AA,
97 const Value *A,
98 const Value *B) {
Dan Gohman5034dd32010-12-15 20:02:24 +000099 const Value *aObj = GetUnderlyingObject(A);
100 const Value *bObj = GetUnderlyingObject(B);
Andreas Bolka34ce6872009-07-28 19:49:25 +0000101 return AA->alias(aObj, AA->getTypeStoreSize(aObj->getType()),
102 bObj, AA->getTypeStoreSize(bObj->getType()));
103}
104
Andreas Bolka15f72db2009-07-29 05:35:53 +0000105static inline const SCEV *GetZeroSCEV(ScalarEvolution *SE) {
Owen Anderson1d0be152009-08-13 21:58:54 +0000106 return SE->getConstant(Type::getInt32Ty(SE->getContext()), 0L);
Andreas Bolka15f72db2009-07-29 05:35:53 +0000107}
108
Andreas Bolkaf35626d2009-06-28 00:21:21 +0000109//===----------------------------------------------------------------------===//
110// Dependence Testing
111//===----------------------------------------------------------------------===//
112
Andreas Bolka3b59dd82009-07-23 01:57:06 +0000113bool LoopDependenceAnalysis::isDependencePair(const Value *A,
114 const Value *B) const {
115 return IsMemRefInstr(A) &&
116 IsMemRefInstr(B) &&
117 (cast<const Instruction>(A)->mayWriteToMemory() ||
118 cast<const Instruction>(B)->mayWriteToMemory());
Andreas Bolkaf35626d2009-06-28 00:21:21 +0000119}
120
Andreas Bolka34ce6872009-07-28 19:49:25 +0000121bool LoopDependenceAnalysis::findOrInsertDependencePair(Value *A,
122 Value *B,
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000123 DependencePair *&P) {
124 void *insertPos = 0;
125 FoldingSetNodeID id;
Andreas Bolka34ce6872009-07-28 19:49:25 +0000126 id.AddPointer(A);
127 id.AddPointer(B);
Andreas Bolkae9722fc2009-06-30 02:12:10 +0000128
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000129 P = Pairs.FindNodeOrInsertPos(id, insertPos);
130 if (P) return true;
Andreas Bolkae9722fc2009-06-30 02:12:10 +0000131
Dan Gohman95531882010-03-18 18:49:47 +0000132 P = new (PairAllocator) DependencePair(id, A, B);
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000133 Pairs.InsertNode(P, insertPos);
134 return false;
135}
136
Andreas Bolka699db992009-08-07 18:23:41 +0000137void LoopDependenceAnalysis::getLoops(const SCEV *S,
138 DenseSet<const Loop*>* Loops) const {
139 // Refactor this into an SCEVVisitor, if efficiency becomes a concern.
Andreas Bolka5eca4522009-08-03 01:03:48 +0000140 for (const Loop *L = this->L; L != 0; L = L->getParentLoop())
Dan Gohman17ead4f2010-11-17 21:23:15 +0000141 if (!SE->isLoopInvariant(S, L))
Andreas Bolka699db992009-08-07 18:23:41 +0000142 Loops->insert(L);
143}
144
145bool LoopDependenceAnalysis::isLoopInvariant(const SCEV *S) const {
146 DenseSet<const Loop*> loops;
147 getLoops(S, &loops);
148 return loops.empty();
Andreas Bolka5eca4522009-08-03 01:03:48 +0000149}
150
151bool LoopDependenceAnalysis::isAffine(const SCEV *S) const {
152 const SCEVAddRecExpr *rec = dyn_cast<SCEVAddRecExpr>(S);
153 return isLoopInvariant(S) || (rec && rec->isAffine());
154}
155
Andreas Bolka831f6f62009-08-05 04:26:05 +0000156bool LoopDependenceAnalysis::isZIVPair(const SCEV *A, const SCEV *B) const {
157 return isLoopInvariant(A) && isLoopInvariant(B);
158}
159
Andreas Bolka699db992009-08-07 18:23:41 +0000160bool LoopDependenceAnalysis::isSIVPair(const SCEV *A, const SCEV *B) const {
161 DenseSet<const Loop*> loops;
162 getLoops(A, &loops);
163 getLoops(B, &loops);
164 return loops.size() == 1;
165}
166
Andreas Bolka831f6f62009-08-05 04:26:05 +0000167LoopDependenceAnalysis::DependenceResult
168LoopDependenceAnalysis::analyseZIV(const SCEV *A,
169 const SCEV *B,
170 Subscript *S) const {
Andreas Bolka6151f672009-08-06 03:10:33 +0000171 assert(isZIVPair(A, B) && "Attempted to ZIV-test non-ZIV SCEVs!");
172 return A == B ? Dependent : Independent;
Andreas Bolka831f6f62009-08-05 04:26:05 +0000173}
174
Andreas Bolkac3cc45a2009-07-28 19:50:13 +0000175LoopDependenceAnalysis::DependenceResult
Andreas Bolka699db992009-08-07 18:23:41 +0000176LoopDependenceAnalysis::analyseSIV(const SCEV *A,
177 const SCEV *B,
178 Subscript *S) const {
179 return Unknown; // TODO: Implement.
180}
181
182LoopDependenceAnalysis::DependenceResult
183LoopDependenceAnalysis::analyseMIV(const SCEV *A,
184 const SCEV *B,
185 Subscript *S) const {
186 return Unknown; // TODO: Implement.
187}
188
189LoopDependenceAnalysis::DependenceResult
Andreas Bolka15f72db2009-07-29 05:35:53 +0000190LoopDependenceAnalysis::analyseSubscript(const SCEV *A,
191 const SCEV *B,
192 Subscript *S) const {
David Greened387b2b2009-12-23 20:52:41 +0000193 DEBUG(dbgs() << " Testing subscript: " << *A << ", " << *B << "\n");
Andreas Bolka71339592009-07-30 02:26:01 +0000194
195 if (A == B) {
David Greened387b2b2009-12-23 20:52:41 +0000196 DEBUG(dbgs() << " -> [D] same SCEV\n");
Andreas Bolka71339592009-07-30 02:26:01 +0000197 return Dependent;
198 }
199
Andreas Bolka5eca4522009-08-03 01:03:48 +0000200 if (!isAffine(A) || !isAffine(B)) {
David Greened387b2b2009-12-23 20:52:41 +0000201 DEBUG(dbgs() << " -> [?] not affine\n");
Andreas Bolka5eca4522009-08-03 01:03:48 +0000202 return Unknown;
203 }
204
Andreas Bolka831f6f62009-08-05 04:26:05 +0000205 if (isZIVPair(A, B))
206 return analyseZIV(A, B, S);
207
Andreas Bolka699db992009-08-07 18:23:41 +0000208 if (isSIVPair(A, B))
209 return analyseSIV(A, B, S);
Andreas Bolka71339592009-07-30 02:26:01 +0000210
Andreas Bolka699db992009-08-07 18:23:41 +0000211 return analyseMIV(A, B, S);
Andreas Bolka15f72db2009-07-29 05:35:53 +0000212}
213
214LoopDependenceAnalysis::DependenceResult
Andreas Bolkac3cc45a2009-07-28 19:50:13 +0000215LoopDependenceAnalysis::analysePair(DependencePair *P) const {
David Greened387b2b2009-12-23 20:52:41 +0000216 DEBUG(dbgs() << "Analysing:\n" << *P->A << "\n" << *P->B << "\n");
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000217
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000218 // We only analyse loads and stores but no possible memory accesses by e.g.
219 // free, call, or invoke instructions.
220 if (!IsLoadOrStoreInst(P->A) || !IsLoadOrStoreInst(P->B)) {
David Greened387b2b2009-12-23 20:52:41 +0000221 DEBUG(dbgs() << "--> [?] no load/store\n");
Andreas Bolkac3cc45a2009-07-28 19:50:13 +0000222 return Unknown;
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000223 }
224
Andreas Bolka34ce6872009-07-28 19:49:25 +0000225 Value *aPtr = GetPointerOperand(P->A);
226 Value *bPtr = GetPointerOperand(P->B);
Andreas Bolkae9722fc2009-06-30 02:12:10 +0000227
Andreas Bolka34ce6872009-07-28 19:49:25 +0000228 switch (UnderlyingObjectsAlias(AA, aPtr, bPtr)) {
229 case AliasAnalysis::MayAlias:
Dan Gohmand891acd2010-12-10 20:14:49 +0000230 case AliasAnalysis::PartialAlias:
Andreas Bolka34ce6872009-07-28 19:49:25 +0000231 // We can not analyse objects if we do not know about their aliasing.
David Greened387b2b2009-12-23 20:52:41 +0000232 DEBUG(dbgs() << "---> [?] may alias\n");
Andreas Bolkac3cc45a2009-07-28 19:50:13 +0000233 return Unknown;
Andreas Bolkae9722fc2009-06-30 02:12:10 +0000234
Andreas Bolka34ce6872009-07-28 19:49:25 +0000235 case AliasAnalysis::NoAlias:
236 // If the objects noalias, they are distinct, accesses are independent.
David Greened387b2b2009-12-23 20:52:41 +0000237 DEBUG(dbgs() << "---> [I] no alias\n");
Andreas Bolkac3cc45a2009-07-28 19:50:13 +0000238 return Independent;
Andreas Bolkae9722fc2009-06-30 02:12:10 +0000239
Andreas Bolka34ce6872009-07-28 19:49:25 +0000240 case AliasAnalysis::MustAlias:
241 break; // The underlying objects alias, test accesses for dependence.
242 }
Andreas Bolkafecbc592009-07-01 21:45:23 +0000243
Andreas Bolka15f72db2009-07-29 05:35:53 +0000244 const GEPOperator *aGEP = dyn_cast<GEPOperator>(aPtr);
245 const GEPOperator *bGEP = dyn_cast<GEPOperator>(bPtr);
246
247 if (!aGEP || !bGEP)
248 return Unknown;
249
250 // FIXME: Is filtering coupled subscripts necessary?
251
Andreas Bolkaa1b78d12009-08-05 04:13:41 +0000252 // Collect GEP operand pairs (FIXME: use GetGEPOperands from BasicAA), adding
Andreas Bolka15f72db2009-07-29 05:35:53 +0000253 // trailing zeroes to the smaller GEP, if needed.
Andreas Bolkaa1b78d12009-08-05 04:13:41 +0000254 typedef SmallVector<std::pair<const SCEV*, const SCEV*>, 4> GEPOpdPairsTy;
255 GEPOpdPairsTy opds;
256 for(GEPOperator::const_op_iterator aIdx = aGEP->idx_begin(),
257 aEnd = aGEP->idx_end(),
258 bIdx = bGEP->idx_begin(),
259 bEnd = bGEP->idx_end();
260 aIdx != aEnd && bIdx != bEnd;
261 aIdx += (aIdx != aEnd), bIdx += (bIdx != bEnd)) {
Andreas Bolka15f72db2009-07-29 05:35:53 +0000262 const SCEV* aSCEV = (aIdx != aEnd) ? SE->getSCEV(*aIdx) : GetZeroSCEV(SE);
263 const SCEV* bSCEV = (bIdx != bEnd) ? SE->getSCEV(*bIdx) : GetZeroSCEV(SE);
Andreas Bolkaa1b78d12009-08-05 04:13:41 +0000264 opds.push_back(std::make_pair(aSCEV, bSCEV));
265 }
266
267 if (!opds.empty() && opds[0].first != opds[0].second) {
268 // We cannot (yet) handle arbitrary GEP pointer offsets. By limiting
269 //
270 // TODO: this could be relaxed by adding the size of the underlying object
271 // to the first subscript. If we have e.g. (GEP x,0,i; GEP x,2,-i) and we
272 // know that x is a [100 x i8]*, we could modify the first subscript to be
273 // (i, 200-i) instead of (i, -i).
274 return Unknown;
275 }
276
277 // Now analyse the collected operand pairs (skipping the GEP ptr offsets).
278 for (GEPOpdPairsTy::const_iterator i = opds.begin() + 1, end = opds.end();
279 i != end; ++i) {
Andreas Bolka15f72db2009-07-29 05:35:53 +0000280 Subscript subscript;
Andreas Bolkaa1b78d12009-08-05 04:13:41 +0000281 DependenceResult result = analyseSubscript(i->first, i->second, &subscript);
Andreas Bolka15f72db2009-07-29 05:35:53 +0000282 if (result != Dependent) {
283 // We either proved independence or failed to analyse this subscript.
284 // Further subscripts will not improve the situation, so abort early.
285 return result;
286 }
287 P->Subscripts.push_back(subscript);
Andreas Bolka15f72db2009-07-29 05:35:53 +0000288 }
Andreas Bolkaa1b78d12009-08-05 04:13:41 +0000289 // We successfully analysed all subscripts but failed to prove independence.
Andreas Bolka15f72db2009-07-29 05:35:53 +0000290 return Dependent;
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000291}
292
293bool LoopDependenceAnalysis::depends(Value *A, Value *B) {
294 assert(isDependencePair(A, B) && "Values form no dependence pair!");
Andreas Bolka328fb3d2009-07-28 19:49:49 +0000295 ++NumAnswered;
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000296
297 DependencePair *p;
298 if (!findOrInsertDependencePair(A, B, p)) {
299 // The pair is not cached, so analyse it.
Andreas Bolka328fb3d2009-07-28 19:49:49 +0000300 ++NumAnalysed;
Andreas Bolkac3cc45a2009-07-28 19:50:13 +0000301 switch (p->Result = analysePair(p)) {
Andreas Bolka328fb3d2009-07-28 19:49:49 +0000302 case Dependent: ++NumDependent; break;
303 case Independent: ++NumIndependent; break;
304 case Unknown: ++NumUnknown; break;
305 }
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000306 }
307 return p->Result != Independent;
Andreas Bolkaf35626d2009-06-28 00:21:21 +0000308}
309
310//===----------------------------------------------------------------------===//
Andreas Bolkacb210102009-06-24 21:29:13 +0000311// LoopDependenceAnalysis Implementation
312//===----------------------------------------------------------------------===//
313
314bool LoopDependenceAnalysis::runOnLoop(Loop *L, LPPassManager &) {
315 this->L = L;
Andreas Bolkafecbc592009-07-01 21:45:23 +0000316 AA = &getAnalysis<AliasAnalysis>();
Andreas Bolkacb210102009-06-24 21:29:13 +0000317 SE = &getAnalysis<ScalarEvolution>();
318 return false;
319}
320
Andreas Bolkab4c28e92009-07-23 14:32:46 +0000321void LoopDependenceAnalysis::releaseMemory() {
322 Pairs.clear();
323 PairAllocator.Reset();
324}
325
Andreas Bolkacb210102009-06-24 21:29:13 +0000326void LoopDependenceAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
327 AU.setPreservesAll();
Andreas Bolkafecbc592009-07-01 21:45:23 +0000328 AU.addRequiredTransitive<AliasAnalysis>();
Andreas Bolka707207a2009-06-28 00:16:08 +0000329 AU.addRequiredTransitive<ScalarEvolution>();
330}
331
Andreas Bolka3b59dd82009-07-23 01:57:06 +0000332static void PrintLoopInfo(raw_ostream &OS,
333 LoopDependenceAnalysis *LDA, const Loop *L) {
Andreas Bolka707207a2009-06-28 00:16:08 +0000334 if (!L->empty()) return; // ignore non-innermost loops
335
Andreas Bolka292aef32009-07-03 01:42:52 +0000336 SmallVector<Instruction*, 8> memrefs;
337 GetMemRefInstrs(L, memrefs);
338
Andreas Bolka707207a2009-06-28 00:16:08 +0000339 OS << "Loop at depth " << L->getLoopDepth() << ", header block: ";
340 WriteAsOperand(OS, L->getHeader(), false);
341 OS << "\n";
Andreas Bolkac6a30302009-06-28 00:35:22 +0000342
Andreas Bolkac6a30302009-06-28 00:35:22 +0000343 OS << " Load/store instructions: " << memrefs.size() << "\n";
Andreas Bolka292aef32009-07-03 01:42:52 +0000344 for (SmallVector<Instruction*, 8>::const_iterator x = memrefs.begin(),
Andreas Bolka34ce6872009-07-28 19:49:25 +0000345 end = memrefs.end(); x != end; ++x)
Andreas Bolka3b59dd82009-07-23 01:57:06 +0000346 OS << "\t" << (x - memrefs.begin()) << ": " << **x << "\n";
Andreas Bolka292aef32009-07-03 01:42:52 +0000347
Andreas Bolkac6a30302009-06-28 00:35:22 +0000348 OS << " Pairwise dependence results:\n";
349 for (SmallVector<Instruction*, 8>::const_iterator x = memrefs.begin(),
Andreas Bolka34ce6872009-07-28 19:49:25 +0000350 end = memrefs.end(); x != end; ++x)
Andreas Bolkac6a30302009-06-28 00:35:22 +0000351 for (SmallVector<Instruction*, 8>::const_iterator y = x + 1;
Andreas Bolka34ce6872009-07-28 19:49:25 +0000352 y != end; ++y)
Andreas Bolkac6a30302009-06-28 00:35:22 +0000353 if (LDA->isDependencePair(*x, *y))
354 OS << "\t" << (x - memrefs.begin()) << "," << (y - memrefs.begin())
355 << ": " << (LDA->depends(*x, *y) ? "dependent" : "independent")
356 << "\n";
Andreas Bolka707207a2009-06-28 00:16:08 +0000357}
358
359void LoopDependenceAnalysis::print(raw_ostream &OS, const Module*) const {
Andreas Bolkac6a30302009-06-28 00:35:22 +0000360 // TODO: doc why const_cast is safe
361 PrintLoopInfo(OS, const_cast<LoopDependenceAnalysis*>(this), this->L);
Andreas Bolka707207a2009-06-28 00:16:08 +0000362}