blob: 7da7271e642ccee011e492b49bbf658bf645674d [file] [log] [blame]
Dan Gohman45b31972008-05-14 00:24:14 +00001//===-- UnrollLoop.cpp - Loop unrolling utilities -------------------------===//
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 file implements some loop unrolling utilities. It does not define any
11// actual pass or policy, but provides a single function to perform loop
12// unrolling.
13//
14// It works best when loops have been canonicalized by the -indvars pass,
15// allowing it to determine the trip counts of loops easily.
16//
17// The process of unrolling can produce extraneous basic blocks linked with
18// unconditional branches. This will be corrected in the future.
Chris Lattnerb298db72011-01-11 08:00:40 +000019//
Dan Gohman45b31972008-05-14 00:24:14 +000020//===----------------------------------------------------------------------===//
21
22#define DEBUG_TYPE "loop-unroll"
23#include "llvm/Transforms/Utils/UnrollLoop.h"
24#include "llvm/BasicBlock.h"
25#include "llvm/ADT/Statistic.h"
Duncan Sandsb6133d12010-11-23 20:26:33 +000026#include "llvm/Analysis/InstructionSimplify.h"
Dan Gohman45b31972008-05-14 00:24:14 +000027#include "llvm/Analysis/LoopPass.h"
Dan Gohman572365e2010-07-26 18:02:06 +000028#include "llvm/Analysis/ScalarEvolution.h"
Dan Gohman45b31972008-05-14 00:24:14 +000029#include "llvm/Support/Debug.h"
Daniel Dunbarce63ffb2009-07-25 00:23:56 +000030#include "llvm/Support/raw_ostream.h"
Chris Lattner29874e02008-12-03 19:44:02 +000031#include "llvm/Transforms/Utils/BasicBlockUtils.h"
Dan Gohman45b31972008-05-14 00:24:14 +000032#include "llvm/Transforms/Utils/Cloning.h"
33#include "llvm/Transforms/Utils/Local.h"
Dan Gohman45b31972008-05-14 00:24:14 +000034using namespace llvm;
35
Chris Lattner29874e02008-12-03 19:44:02 +000036// TODO: Should these be here or in LoopUnroll?
Dan Gohman45b31972008-05-14 00:24:14 +000037STATISTIC(NumCompletelyUnrolled, "Number of loops completely unrolled");
Chris Lattnerb298db72011-01-11 08:00:40 +000038STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)");
Dan Gohman45b31972008-05-14 00:24:14 +000039
40/// RemapInstruction - Convert the instruction operands from referencing the
Devang Patel29d3dd82010-06-23 23:55:51 +000041/// current values into those specified by VMap.
Dan Gohman45b31972008-05-14 00:24:14 +000042static inline void RemapInstruction(Instruction *I,
Rafael Espindola1ed219a2010-10-13 01:36:30 +000043 ValueToValueMapTy &VMap) {
Dan Gohman45b31972008-05-14 00:24:14 +000044 for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
45 Value *Op = I->getOperand(op);
Rafael Espindola1ed219a2010-10-13 01:36:30 +000046 ValueToValueMapTy::iterator It = VMap.find(Op);
Devang Patel29d3dd82010-06-23 23:55:51 +000047 if (It != VMap.end())
Dan Gohmanb56c9662009-10-31 14:46:50 +000048 I->setOperand(op, It->second);
Dan Gohman45b31972008-05-14 00:24:14 +000049 }
50}
51
Dan Gohman438b5832009-10-31 17:33:01 +000052/// FoldBlockIntoPredecessor - Folds a basic block into its predecessor if it
53/// only has one predecessor, and that predecessor only has one successor.
54/// The LoopInfo Analysis that is passed will be kept consistent.
55/// Returns the new combined block.
56static BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB, LoopInfo* LI) {
57 // Merge basic blocks into their predecessor if there is only one distinct
58 // pred, and if there is only one distinct successor of the predecessor, and
59 // if there are no PHI nodes.
60 BasicBlock *OnlyPred = BB->getSinglePredecessor();
61 if (!OnlyPred) return 0;
62
63 if (OnlyPred->getTerminator()->getNumSuccessors() != 1)
64 return 0;
65
David Greenea9ad9c22010-01-05 01:26:41 +000066 DEBUG(dbgs() << "Merging: " << *BB << "into: " << *OnlyPred);
Dan Gohman438b5832009-10-31 17:33:01 +000067
68 // Resolve any PHI nodes at the start of the block. They are all
69 // guaranteed to have exactly one entry if they exist, unless there are
70 // multiple duplicate (but guaranteed to be equal) entries for the
71 // incoming edges. This occurs when there are multiple edges from
72 // OnlyPred to OnlySucc.
73 FoldSingleEntryPHINodes(BB);
74
75 // Delete the unconditional branch from the predecessor...
76 OnlyPred->getInstList().pop_back();
77
78 // Move all definitions in the successor to the predecessor...
79 OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList());
80
81 // Make all PHI nodes that referred to BB now refer to Pred as their
82 // source...
83 BB->replaceAllUsesWith(OnlyPred);
84
85 std::string OldName = BB->getName();
86
87 // Erase basic block from the function...
88 LI->removeBlock(BB);
89 BB->eraseFromParent();
90
91 // Inherit predecessor's name if it exists...
92 if (!OldName.empty() && !OnlyPred->hasName())
93 OnlyPred->setName(OldName);
94
95 return OnlyPred;
96}
97
Dan Gohman45b31972008-05-14 00:24:14 +000098/// Unroll the given loop by Count. The loop must be in LCSSA form. Returns true
Chris Lattnerf5ebfb02011-02-18 04:25:21 +000099/// if unrolling was successful, or false if the loop was unmodified. Unrolling
Dan Gohman45b31972008-05-14 00:24:14 +0000100/// can only fail when the loop's latch block is not terminated by a conditional
101/// branch instruction. However, if the trip count (and multiple) are not known,
102/// loop unrolling will mostly produce more code that is no faster.
103///
104/// The LoopInfo Analysis that is passed will be kept consistent.
105///
106/// If a LoopPassManager is passed in, and the loop is fully removed, it will be
107/// removed from the LoopPassManager as well. LPM can also be NULL.
Chris Lattnerf5ebfb02011-02-18 04:25:21 +0000108bool llvm::UnrollLoop(Loop *L, unsigned Count,
109 LoopInfo *LI, LPPassManager *LPM) {
Dan Gohman692ad8d2009-11-05 19:44:06 +0000110 BasicBlock *Preheader = L->getLoopPreheader();
111 if (!Preheader) {
David Greenea9ad9c22010-01-05 01:26:41 +0000112 DEBUG(dbgs() << " Can't unroll; loop preheader-insertion failed.\n");
Dan Gohman692ad8d2009-11-05 19:44:06 +0000113 return false;
114 }
115
Dan Gohman45b31972008-05-14 00:24:14 +0000116 BasicBlock *LatchBlock = L->getLoopLatch();
Dan Gohman692ad8d2009-11-05 19:44:06 +0000117 if (!LatchBlock) {
David Greenea9ad9c22010-01-05 01:26:41 +0000118 DEBUG(dbgs() << " Can't unroll; loop exit-block-insertion failed.\n");
Dan Gohman692ad8d2009-11-05 19:44:06 +0000119 return false;
120 }
121
122 BasicBlock *Header = L->getHeader();
Dan Gohman45b31972008-05-14 00:24:14 +0000123 BranchInst *BI = dyn_cast<BranchInst>(LatchBlock->getTerminator());
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000124
Dan Gohman45b31972008-05-14 00:24:14 +0000125 if (!BI || BI->isUnconditional()) {
126 // The loop-rotate pass can be helpful to avoid this in many cases.
David Greenea9ad9c22010-01-05 01:26:41 +0000127 DEBUG(dbgs() <<
Chris Lattnerbdff5482009-08-23 04:37:46 +0000128 " Can't unroll; loop not terminated by a conditional branch.\n");
Dan Gohman45b31972008-05-14 00:24:14 +0000129 return false;
130 }
Chris Lattnerf5ebfb02011-02-18 04:25:21 +0000131
132 if (Header->hasAddressTaken()) {
133 // The loop-rotate pass can be helpful to avoid this in many cases.
134 DEBUG(dbgs() <<
135 " Won't unroll loop: address of header block is taken.\n");
136 return false;
137 }
Dan Gohman45b31972008-05-14 00:24:14 +0000138
Dan Gohman572365e2010-07-26 18:02:06 +0000139 // Notify ScalarEvolution that the loop will be substantially changed,
140 // if not outright eliminated.
141 if (ScalarEvolution *SE = LPM->getAnalysisIfAvailable<ScalarEvolution>())
142 SE->forgetLoop(L);
143
Dan Gohman45b31972008-05-14 00:24:14 +0000144 // Find trip count
145 unsigned TripCount = L->getSmallConstantTripCount();
146 // Find trip multiple if count is not available
147 unsigned TripMultiple = 1;
148 if (TripCount == 0)
149 TripMultiple = L->getSmallConstantTripMultiple();
150
151 if (TripCount != 0)
David Greenea9ad9c22010-01-05 01:26:41 +0000152 DEBUG(dbgs() << " Trip Count = " << TripCount << "\n");
Dan Gohman45b31972008-05-14 00:24:14 +0000153 if (TripMultiple != 1)
David Greenea9ad9c22010-01-05 01:26:41 +0000154 DEBUG(dbgs() << " Trip Multiple = " << TripMultiple << "\n");
Dan Gohman45b31972008-05-14 00:24:14 +0000155
156 // Effectively "DCE" unrolled iterations that are beyond the tripcount
157 // and will never be executed.
158 if (TripCount != 0 && Count > TripCount)
159 Count = TripCount;
160
161 assert(Count > 0);
162 assert(TripMultiple > 0);
163 assert(TripCount == 0 || TripCount % TripMultiple == 0);
164
165 // Are we eliminating the loop control altogether?
166 bool CompletelyUnroll = Count == TripCount;
167
168 // If we know the trip count, we know the multiple...
169 unsigned BreakoutTrip = 0;
170 if (TripCount != 0) {
171 BreakoutTrip = TripCount % Count;
172 TripMultiple = 0;
173 } else {
174 // Figure out what multiple to use.
175 BreakoutTrip = TripMultiple =
176 (unsigned)GreatestCommonDivisor64(Count, TripMultiple);
177 }
178
179 if (CompletelyUnroll) {
David Greenea9ad9c22010-01-05 01:26:41 +0000180 DEBUG(dbgs() << "COMPLETELY UNROLLING loop %" << Header->getName()
Daniel Dunbarce63ffb2009-07-25 00:23:56 +0000181 << " with trip count " << TripCount << "!\n");
Dan Gohman45b31972008-05-14 00:24:14 +0000182 } else {
David Greenea9ad9c22010-01-05 01:26:41 +0000183 DEBUG(dbgs() << "UNROLLING loop %" << Header->getName()
Daniel Dunbarce63ffb2009-07-25 00:23:56 +0000184 << " by " << Count);
Dan Gohman45b31972008-05-14 00:24:14 +0000185 if (TripMultiple == 0 || BreakoutTrip != TripMultiple) {
David Greenea9ad9c22010-01-05 01:26:41 +0000186 DEBUG(dbgs() << " with a breakout at trip " << BreakoutTrip);
Dan Gohman45b31972008-05-14 00:24:14 +0000187 } else if (TripMultiple != 1) {
David Greenea9ad9c22010-01-05 01:26:41 +0000188 DEBUG(dbgs() << " with " << TripMultiple << " trips per branch");
Dan Gohman45b31972008-05-14 00:24:14 +0000189 }
David Greenea9ad9c22010-01-05 01:26:41 +0000190 DEBUG(dbgs() << "!\n");
Dan Gohman45b31972008-05-14 00:24:14 +0000191 }
192
193 std::vector<BasicBlock*> LoopBlocks = L->getBlocks();
194
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000195 bool ContinueOnTrue = L->contains(BI->getSuccessor(0));
Dan Gohman45b31972008-05-14 00:24:14 +0000196 BasicBlock *LoopExit = BI->getSuccessor(ContinueOnTrue);
197
198 // For the first iteration of the loop, we should use the precloned values for
199 // PHI nodes. Insert associations now.
Devang Patel39430842010-04-20 22:24:18 +0000200 ValueToValueMapTy LastValueMap;
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000201 std::vector<PHINode*> OrigPHINode;
Dan Gohman45b31972008-05-14 00:24:14 +0000202 for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
203 PHINode *PN = cast<PHINode>(I);
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000204 OrigPHINode.push_back(PN);
Dan Gohman45b31972008-05-14 00:24:14 +0000205 if (Instruction *I =
206 dyn_cast<Instruction>(PN->getIncomingValueForBlock(LatchBlock)))
Dan Gohman92329c72009-12-18 01:24:09 +0000207 if (L->contains(I))
Dan Gohman45b31972008-05-14 00:24:14 +0000208 LastValueMap[I] = I;
209 }
210
211 std::vector<BasicBlock*> Headers;
212 std::vector<BasicBlock*> Latches;
213 Headers.push_back(Header);
214 Latches.push_back(LatchBlock);
215
216 for (unsigned It = 1; It != Count; ++It) {
Dan Gohman45b31972008-05-14 00:24:14 +0000217 std::vector<BasicBlock*> NewBlocks;
218
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000219 for (std::vector<BasicBlock*>::iterator BB = LoopBlocks.begin(),
220 E = LoopBlocks.end(); BB != E; ++BB) {
Devang Patel29d3dd82010-06-23 23:55:51 +0000221 ValueToValueMapTy VMap;
222 BasicBlock *New = CloneBasicBlock(*BB, VMap, "." + Twine(It));
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000223 Header->getParent()->getBasicBlockList().push_back(New);
Dan Gohman45b31972008-05-14 00:24:14 +0000224
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000225 // Loop over all of the PHI nodes in the block, changing them to use the
226 // incoming values from the previous block.
227 if (*BB == Header)
228 for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) {
Devang Patel29d3dd82010-06-23 23:55:51 +0000229 PHINode *NewPHI = cast<PHINode>(VMap[OrigPHINode[i]]);
Dan Gohman45b31972008-05-14 00:24:14 +0000230 Value *InVal = NewPHI->getIncomingValueForBlock(LatchBlock);
231 if (Instruction *InValI = dyn_cast<Instruction>(InVal))
Dan Gohman92329c72009-12-18 01:24:09 +0000232 if (It > 1 && L->contains(InValI))
Dan Gohman45b31972008-05-14 00:24:14 +0000233 InVal = LastValueMap[InValI];
Devang Patel29d3dd82010-06-23 23:55:51 +0000234 VMap[OrigPHINode[i]] = InVal;
Dan Gohman45b31972008-05-14 00:24:14 +0000235 New->getInstList().erase(NewPHI);
236 }
237
238 // Update our running map of newest clones
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000239 LastValueMap[*BB] = New;
Devang Patel29d3dd82010-06-23 23:55:51 +0000240 for (ValueToValueMapTy::iterator VI = VMap.begin(), VE = VMap.end();
Dan Gohman45b31972008-05-14 00:24:14 +0000241 VI != VE; ++VI)
242 LastValueMap[VI->first] = VI->second;
243
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000244 L->addBasicBlockToLoop(New, LI->getBase());
245
246 // Add phi entries for newly created values to all exit blocks except
247 // the successor of the latch block. The successor of the exit block will
248 // be updated specially after unrolling all the way.
249 if (*BB != LatchBlock)
250 for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end();
251 UI != UE;) {
252 Instruction *UseInst = cast<Instruction>(*UI);
253 ++UI;
Dan Gohman92329c72009-12-18 01:24:09 +0000254 if (isa<PHINode>(UseInst) && !L->contains(UseInst)) {
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000255 PHINode *phi = cast<PHINode>(UseInst);
256 Value *Incoming = phi->getIncomingValueForBlock(*BB);
257 phi->addIncoming(Incoming, New);
258 }
Dan Gohman45b31972008-05-14 00:24:14 +0000259 }
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000260
261 // Keep track of new headers and latches as we create them, so that
262 // we can insert the proper branches later.
263 if (*BB == Header)
264 Headers.push_back(New);
265 if (*BB == LatchBlock) {
266 Latches.push_back(New);
267
268 // Also, clear out the new latch's back edge so that it doesn't look
269 // like a new loop, so that it's amenable to being merged with adjacent
270 // blocks later on.
271 TerminatorInst *Term = New->getTerminator();
272 assert(L->contains(Term->getSuccessor(!ContinueOnTrue)));
273 assert(Term->getSuccessor(ContinueOnTrue) == LoopExit);
274 Term->setSuccessor(!ContinueOnTrue, NULL);
Dan Gohman45b31972008-05-14 00:24:14 +0000275 }
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000276
277 NewBlocks.push_back(New);
Dan Gohman45b31972008-05-14 00:24:14 +0000278 }
279
280 // Remap all instructions in the most recent iteration
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000281 for (unsigned i = 0; i < NewBlocks.size(); ++i)
Dan Gohman45b31972008-05-14 00:24:14 +0000282 for (BasicBlock::iterator I = NewBlocks[i]->begin(),
283 E = NewBlocks[i]->end(); I != E; ++I)
Rafael Espindola1ed219a2010-10-13 01:36:30 +0000284 ::RemapInstruction(I, LastValueMap);
Dan Gohman45b31972008-05-14 00:24:14 +0000285 }
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000286
287 // The latch block exits the loop. If there are any PHI nodes in the
288 // successor blocks, update them to use the appropriate values computed as the
289 // last iteration of the loop.
290 if (Count != 1) {
291 SmallPtrSet<PHINode*, 8> Users;
292 for (Value::use_iterator UI = LatchBlock->use_begin(),
293 UE = LatchBlock->use_end(); UI != UE; ++UI)
294 if (PHINode *phi = dyn_cast<PHINode>(*UI))
295 Users.insert(phi);
296
297 BasicBlock *LastIterationBB = cast<BasicBlock>(LastValueMap[LatchBlock]);
298 for (SmallPtrSet<PHINode*,8>::iterator SI = Users.begin(), SE = Users.end();
299 SI != SE; ++SI) {
300 PHINode *PN = *SI;
301 Value *InVal = PN->removeIncomingValue(LatchBlock, false);
302 // If this value was defined in the loop, take the value defined by the
303 // last iteration of the loop.
304 if (Instruction *InValI = dyn_cast<Instruction>(InVal)) {
Dan Gohman92329c72009-12-18 01:24:09 +0000305 if (L->contains(InValI))
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000306 InVal = LastValueMap[InVal];
307 }
308 PN->addIncoming(InVal, LastIterationBB);
309 }
310 }
311
312 // Now, if we're doing complete unrolling, loop over the PHI nodes in the
313 // original block, setting them to their incoming values.
314 if (CompletelyUnroll) {
315 BasicBlock *Preheader = L->getLoopPreheader();
316 for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) {
317 PHINode *PN = OrigPHINode[i];
318 PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader));
319 Header->getInstList().erase(PN);
320 }
321 }
Dan Gohman45b31972008-05-14 00:24:14 +0000322
323 // Now that all the basic blocks for the unrolled iterations are in place,
324 // set up the branches to connect them.
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000325 for (unsigned i = 0, e = Latches.size(); i != e; ++i) {
Dan Gohman45b31972008-05-14 00:24:14 +0000326 // The original branch was replicated in each unrolled iteration.
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000327 BranchInst *Term = cast<BranchInst>(Latches[i]->getTerminator());
Dan Gohman45b31972008-05-14 00:24:14 +0000328
329 // The branch destination.
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000330 unsigned j = (i + 1) % e;
331 BasicBlock *Dest = Headers[j];
Dan Gohman45b31972008-05-14 00:24:14 +0000332 bool NeedConditional = true;
333
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000334 // For a complete unroll, make the last iteration end with a branch
335 // to the exit block.
336 if (CompletelyUnroll && j == 0) {
Dan Gohman45b31972008-05-14 00:24:14 +0000337 Dest = LoopExit;
338 NeedConditional = false;
339 }
340
341 // If we know the trip count or a multiple of it, we can safely use an
342 // unconditional branch for some iterations.
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000343 if (j != BreakoutTrip && (TripMultiple == 0 || j % TripMultiple != 0)) {
Dan Gohman45b31972008-05-14 00:24:14 +0000344 NeedConditional = false;
345 }
346
347 if (NeedConditional) {
348 // Update the conditional branch's successor for the following
349 // iteration.
350 Term->setSuccessor(!ContinueOnTrue, Dest);
351 } else {
Jay Foad8f9ffbd2011-01-07 20:25:56 +0000352 // Replace the conditional branch with an unconditional one.
353 BranchInst::Create(Dest, Term);
354 Term->eraseFromParent();
Dan Gohman45b31972008-05-14 00:24:14 +0000355 // Merge adjacent basic blocks, if possible.
Dan Gohman438b5832009-10-31 17:33:01 +0000356 if (BasicBlock *Fold = FoldBlockIntoPredecessor(Dest, LI)) {
Dan Gohman45b31972008-05-14 00:24:14 +0000357 std::replace(Latches.begin(), Latches.end(), Dest, Fold);
358 std::replace(Headers.begin(), Headers.end(), Dest, Fold);
359 }
360 }
361 }
362
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000363 // At this point, the code is well formed. We now do a quick sweep over the
364 // inserted code, doing constant propagation and dead code elimination as we
365 // go.
366 const std::vector<BasicBlock*> &NewLoopBlocks = L->getBlocks();
367 for (std::vector<BasicBlock*>::const_iterator BB = NewLoopBlocks.begin(),
368 BBE = NewLoopBlocks.end(); BB != BBE; ++BB)
369 for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ) {
Dan Gohman45b31972008-05-14 00:24:14 +0000370 Instruction *Inst = I++;
371
372 if (isInstructionTriviallyDead(Inst))
Dan Gohman8dbe7f82008-06-24 20:44:42 +0000373 (*BB)->getInstList().erase(Inst);
Duncan Sandsb6133d12010-11-23 20:26:33 +0000374 else if (Value *V = SimplifyInstruction(Inst))
375 if (LI->replacementPreservesLCSSAForm(Inst, V)) {
376 Inst->replaceAllUsesWith(V);
377 (*BB)->getInstList().erase(Inst);
378 }
Dan Gohman45b31972008-05-14 00:24:14 +0000379 }
Dan Gohman45b31972008-05-14 00:24:14 +0000380
381 NumCompletelyUnrolled += CompletelyUnroll;
382 ++NumUnrolled;
383 // Remove the loop from the LoopPassManager if it's completely removed.
384 if (CompletelyUnroll && LPM != NULL)
385 LPM->deleteLoopFromQueue(L);
386
Dan Gohman45b31972008-05-14 00:24:14 +0000387 return true;
388}