blob: 850e65a64f38a4aa72264f2707592488ba9151f7 [file] [log] [blame]
Chris Lattnerd80e9732002-04-28 00:47:11 +00001//===-- GCSE.cpp - SSA based Global Common Subexpr Elimination ------------===//
2//
3// This pass is designed to be a very quick global transformation that
4// eliminates global common subexpressions from a function. It does this by
5// examining the SSA value graph of the function, instead of doing slow, dense,
6// bit-vector computations.
7//
8// This pass works best if it is proceeded with a simple constant propogation
9// pass and an instruction combination pass because this pass does not do any
10// value numbering (in order to be speedy).
11//
12// This pass does not attempt to CSE load instructions, because it does not use
13// pointer analysis to determine when it is safe.
14//
15//===----------------------------------------------------------------------===//
16
Chris Lattner022103b2002-05-07 20:03:00 +000017#include "llvm/Transforms/Scalar.h"
Chris Lattnerd80e9732002-04-28 00:47:11 +000018#include "llvm/InstrTypes.h"
19#include "llvm/iMemory.h"
20#include "llvm/Analysis/Dominators.h"
21#include "llvm/Support/InstVisitor.h"
22#include "llvm/Support/InstIterator.h"
Chris Lattner18fb2a62002-05-14 05:02:40 +000023#include "llvm/Support/CFG.h"
Chris Lattner3dec1f22002-05-10 15:38:35 +000024#include "Support/StatisticReporter.h"
Chris Lattnerd80e9732002-04-28 00:47:11 +000025#include <algorithm>
Chris Lattnerd80e9732002-04-28 00:47:11 +000026
Chris Lattner3dec1f22002-05-10 15:38:35 +000027static Statistic<> NumInstRemoved("gcse\t\t- Number of instructions removed");
Chris Lattner18fb2a62002-05-14 05:02:40 +000028static Statistic<> NumLoadRemoved("gcse\t\t- Number of loads removed");
Chris Lattner3dec1f22002-05-10 15:38:35 +000029
Chris Lattnerd80e9732002-04-28 00:47:11 +000030namespace {
31 class GCSE : public FunctionPass, public InstVisitor<GCSE, bool> {
Chris Lattner18fb2a62002-05-14 05:02:40 +000032 set<Instruction*> WorkList;
33 DominatorSet *DomSetInfo;
34 ImmediateDominators *ImmDominator;
35
36 // BBContainsStore - Contains a value that indicates whether a basic block
37 // has a store or call instruction in it. This map is demand populated, so
38 // not having an entry means that the basic block has not been scanned yet.
39 //
40 map<BasicBlock*, bool> BBContainsStore;
Chris Lattnerd80e9732002-04-28 00:47:11 +000041 public:
Chris Lattner96c466b2002-04-29 14:57:45 +000042 const char *getPassName() const {
43 return "Global Common Subexpression Elimination";
44 }
45
Chris Lattner7e708292002-06-25 16:13:24 +000046 virtual bool runOnFunction(Function &F);
Chris Lattnerd80e9732002-04-28 00:47:11 +000047
48 // Visitation methods, these are invoked depending on the type of
49 // instruction being checked. They should return true if a common
50 // subexpression was folded.
51 //
Chris Lattner7e708292002-06-25 16:13:24 +000052 bool visitUnaryOperator(Instruction &I);
53 bool visitBinaryOperator(Instruction &I);
54 bool visitGetElementPtrInst(GetElementPtrInst &I);
55 bool visitCastInst(CastInst &I){return visitUnaryOperator((Instruction&)I);}
56 bool visitShiftInst(ShiftInst &I) {
57 return visitBinaryOperator((Instruction&)I);
Chris Lattnerd80e9732002-04-28 00:47:11 +000058 }
Chris Lattner7e708292002-06-25 16:13:24 +000059 bool visitLoadInst(LoadInst &LI);
60 bool visitInstruction(Instruction &) { return false; }
Chris Lattnerd80e9732002-04-28 00:47:11 +000061
62 private:
63 void ReplaceInstWithInst(Instruction *First, BasicBlock::iterator SI);
64 void CommonSubExpressionFound(Instruction *I, Instruction *Other);
65
Chris Lattner18fb2a62002-05-14 05:02:40 +000066 // TryToRemoveALoad - Try to remove one of L1 or L2. The problem with
67 // removing loads is that intervening stores might make otherwise identical
68 // load's yield different values. To ensure that this is not the case, we
69 // check that there are no intervening stores or calls between the
70 // instructions.
71 //
72 bool TryToRemoveALoad(LoadInst *L1, LoadInst *L2);
73
74 // CheckForInvalidatingInst - Return true if BB or any of the predecessors
75 // of BB (until DestBB) contain a store (or other invalidating) instruction.
76 //
77 bool CheckForInvalidatingInst(BasicBlock *BB, BasicBlock *DestBB,
78 set<BasicBlock*> &VisitedSet);
79
Chris Lattnerd80e9732002-04-28 00:47:11 +000080 // This transformation requires dominator and immediate dominator info
81 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
Chris Lattner97e52e42002-04-28 21:27:06 +000082 AU.preservesCFG();
Chris Lattnerd80e9732002-04-28 00:47:11 +000083 AU.addRequired(DominatorSet::ID);
84 AU.addRequired(ImmediateDominators::ID);
85 }
86 };
87}
88
89// createGCSEPass - The public interface to this file...
90Pass *createGCSEPass() { return new GCSE(); }
91
92
93// GCSE::runOnFunction - This is the main transformation entry point for a
94// function.
95//
Chris Lattner7e708292002-06-25 16:13:24 +000096bool GCSE::runOnFunction(Function &F) {
Chris Lattnerd80e9732002-04-28 00:47:11 +000097 bool Changed = false;
98
99 DomSetInfo = &getAnalysis<DominatorSet>();
100 ImmDominator = &getAnalysis<ImmediateDominators>();
101
102 // Step #1: Add all instructions in the function to the worklist for
103 // processing. All of the instructions are considered to be our
104 // subexpressions to eliminate if possible.
105 //
106 WorkList.insert(inst_begin(F), inst_end(F));
107
108 // Step #2: WorkList processing. Iterate through all of the instructions,
109 // checking to see if there are any additionally defined subexpressions in the
110 // program. If so, eliminate them!
111 //
112 while (!WorkList.empty()) {
Chris Lattner7e708292002-06-25 16:13:24 +0000113 Instruction &I = **WorkList.begin(); // Get an instruction from the worklist
Chris Lattnerd80e9732002-04-28 00:47:11 +0000114 WorkList.erase(WorkList.begin());
115
116 // Visit the instruction, dispatching to the correct visit function based on
117 // the instruction type. This does the checking.
118 //
119 Changed |= visit(I);
120 }
Chris Lattner18fb2a62002-05-14 05:02:40 +0000121
122 // Clear out data structure so that next function starts fresh
123 BBContainsStore.clear();
Chris Lattnerd80e9732002-04-28 00:47:11 +0000124
125 // When the worklist is empty, return whether or not we changed anything...
126 return Changed;
127}
128
129
130// ReplaceInstWithInst - Destroy the instruction pointed to by SI, making all
131// uses of the instruction use First now instead.
132//
133void GCSE::ReplaceInstWithInst(Instruction *First, BasicBlock::iterator SI) {
Chris Lattner7e708292002-06-25 16:13:24 +0000134 Instruction &Second = *SI;
Chris Lattner8b054c02002-04-29 16:20:25 +0000135
136 //cerr << "DEL " << (void*)Second << Second;
Chris Lattnerd80e9732002-04-28 00:47:11 +0000137
138 // Add the first instruction back to the worklist
139 WorkList.insert(First);
140
141 // Add all uses of the second instruction to the worklist
Chris Lattner7e708292002-06-25 16:13:24 +0000142 for (Value::use_iterator UI = Second.use_begin(), UE = Second.use_end();
Chris Lattnerd80e9732002-04-28 00:47:11 +0000143 UI != UE; ++UI)
144 WorkList.insert(cast<Instruction>(*UI));
145
146 // Make all users of 'Second' now use 'First'
Chris Lattner7e708292002-06-25 16:13:24 +0000147 Second.replaceAllUsesWith(First);
Chris Lattnerd80e9732002-04-28 00:47:11 +0000148
149 // Erase the second instruction from the program
Chris Lattner7e708292002-06-25 16:13:24 +0000150 Second.getParent()->getInstList().erase(SI);
Chris Lattnerd80e9732002-04-28 00:47:11 +0000151}
152
153// CommonSubExpressionFound - The two instruction I & Other have been found to
154// be common subexpressions. This function is responsible for eliminating one
155// of them, and for fixing the worklist to be correct.
156//
157void GCSE::CommonSubExpressionFound(Instruction *I, Instruction *Other) {
Chris Lattner18fb2a62002-05-14 05:02:40 +0000158 assert(I != Other);
Chris Lattner8b054c02002-04-29 16:20:25 +0000159
Chris Lattner18fb2a62002-05-14 05:02:40 +0000160 WorkList.erase(I);
Chris Lattner8b054c02002-04-29 16:20:25 +0000161 WorkList.erase(Other); // Other may not actually be on the worklist anymore...
Chris Lattnerd80e9732002-04-28 00:47:11 +0000162
Chris Lattner3dec1f22002-05-10 15:38:35 +0000163 ++NumInstRemoved; // Keep track of number of instructions eliminated
164
Chris Lattnerd80e9732002-04-28 00:47:11 +0000165 // Handle the easy case, where both instructions are in the same basic block
166 BasicBlock *BB1 = I->getParent(), *BB2 = Other->getParent();
167 if (BB1 == BB2) {
168 // Eliminate the second occuring instruction. Add all uses of the second
169 // instruction to the worklist.
170 //
171 // Scan the basic block looking for the "first" instruction
172 BasicBlock::iterator BI = BB1->begin();
Chris Lattner7e708292002-06-25 16:13:24 +0000173 while (&*BI != I && &*BI != Other) {
Chris Lattnerd80e9732002-04-28 00:47:11 +0000174 ++BI;
175 assert(BI != BB1->end() && "Instructions not found in parent BB!");
176 }
177
178 // Keep track of which instructions occurred first & second
Chris Lattner7e708292002-06-25 16:13:24 +0000179 Instruction *First = BI;
Chris Lattnerd80e9732002-04-28 00:47:11 +0000180 Instruction *Second = I != First ? I : Other; // Get iterator to second inst
Chris Lattner7e708292002-06-25 16:13:24 +0000181 BI = Second;
Chris Lattnerd80e9732002-04-28 00:47:11 +0000182
183 // Destroy Second, using First instead.
184 ReplaceInstWithInst(First, BI);
185
186 // Otherwise, the two instructions are in different basic blocks. If one
187 // dominates the other instruction, we can simply use it
188 //
189 } else if (DomSetInfo->dominates(BB1, BB2)) { // I dom Other?
Chris Lattner7e708292002-06-25 16:13:24 +0000190 ReplaceInstWithInst(I, Other);
Chris Lattnerd80e9732002-04-28 00:47:11 +0000191 } else if (DomSetInfo->dominates(BB2, BB1)) { // Other dom I?
Chris Lattner7e708292002-06-25 16:13:24 +0000192 ReplaceInstWithInst(Other, I);
Chris Lattnerd80e9732002-04-28 00:47:11 +0000193 } else {
194 // Handle the most general case now. In this case, neither I dom Other nor
195 // Other dom I. Because we are in SSA form, we are guaranteed that the
196 // operands of the two instructions both dominate the uses, so we _know_
197 // that there must exist a block that dominates both instructions (if the
198 // operands of the instructions are globals or constants, worst case we
199 // would get the entry node of the function). Search for this block now.
200 //
201
202 // Search up the immediate dominator chain of BB1 for the shared dominator
203 BasicBlock *SharedDom = (*ImmDominator)[BB1];
204 while (!DomSetInfo->dominates(SharedDom, BB2))
205 SharedDom = (*ImmDominator)[SharedDom];
206
207 // At this point, shared dom must dominate BOTH BB1 and BB2...
208 assert(SharedDom && DomSetInfo->dominates(SharedDom, BB1) &&
209 DomSetInfo->dominates(SharedDom, BB2) && "Dominators broken!");
210
211 // Rip 'I' out of BB1, and move it to the end of SharedDom.
212 BB1->getInstList().remove(I);
Chris Lattner7e708292002-06-25 16:13:24 +0000213 SharedDom->getInstList().insert(--SharedDom->end(), I);
Chris Lattnerd80e9732002-04-28 00:47:11 +0000214
215 // Eliminate 'Other' now.
Chris Lattner7e708292002-06-25 16:13:24 +0000216 ReplaceInstWithInst(I, Other);
Chris Lattnerd80e9732002-04-28 00:47:11 +0000217 }
218}
219
220//===----------------------------------------------------------------------===//
221//
222// Visitation methods, these are invoked depending on the type of instruction
223// being checked. They should return true if a common subexpression was folded.
224//
225//===----------------------------------------------------------------------===//
226
Chris Lattner7e708292002-06-25 16:13:24 +0000227bool GCSE::visitUnaryOperator(Instruction &I) {
228 Value *Op = I.getOperand(0);
229 Function *F = I.getParent()->getParent();
Chris Lattnerd80e9732002-04-28 00:47:11 +0000230
231 for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
232 UI != UE; ++UI)
233 if (Instruction *Other = dyn_cast<Instruction>(*UI))
234 // Check to see if this new binary operator is not I, but same operand...
Chris Lattner7e708292002-06-25 16:13:24 +0000235 if (Other != &I && Other->getOpcode() == I.getOpcode() &&
Chris Lattnerd80e9732002-04-28 00:47:11 +0000236 Other->getOperand(0) == Op && // Is the operand the same?
237 // Is it embeded in the same function? (This could be false if LHS
238 // is a constant or global!)
239 Other->getParent()->getParent() == F &&
240
241 // Check that the types are the same, since this code handles casts...
Chris Lattner7e708292002-06-25 16:13:24 +0000242 Other->getType() == I.getType()) {
Chris Lattnerd80e9732002-04-28 00:47:11 +0000243
244 // These instructions are identical. Handle the situation.
Chris Lattner7e708292002-06-25 16:13:24 +0000245 CommonSubExpressionFound(&I, Other);
Chris Lattnerd80e9732002-04-28 00:47:11 +0000246 return true; // One instruction eliminated!
247 }
248
249 return false;
250}
251
Chris Lattner0f9fd5b2002-05-14 19:57:25 +0000252// isIdenticalBinaryInst - Return true if the two binary instructions are
253// identical.
254//
Chris Lattner7e708292002-06-25 16:13:24 +0000255static inline bool isIdenticalBinaryInst(const Instruction &I1,
Chris Lattner0f9fd5b2002-05-14 19:57:25 +0000256 const Instruction *I2) {
257 // Is it embeded in the same function? (This could be false if LHS
258 // is a constant or global!)
Chris Lattner7e708292002-06-25 16:13:24 +0000259 if (I1.getOpcode() != I2->getOpcode() ||
260 I1.getParent()->getParent() != I2->getParent()->getParent())
Chris Lattner0f9fd5b2002-05-14 19:57:25 +0000261 return false;
262
263 // They are identical if both operands are the same!
Chris Lattner7e708292002-06-25 16:13:24 +0000264 if (I1.getOperand(0) == I2->getOperand(0) &&
265 I1.getOperand(1) == I2->getOperand(1))
Chris Lattner0f9fd5b2002-05-14 19:57:25 +0000266 return true;
267
268 // If the instruction is commutative and associative, the instruction can
269 // match if the operands are swapped!
270 //
Chris Lattner7e708292002-06-25 16:13:24 +0000271 if ((I1.getOperand(0) == I2->getOperand(1) &&
272 I1.getOperand(1) == I2->getOperand(0)) &&
273 (I1.getOpcode() == Instruction::Add ||
274 I1.getOpcode() == Instruction::Mul ||
275 I1.getOpcode() == Instruction::And ||
276 I1.getOpcode() == Instruction::Or ||
277 I1.getOpcode() == Instruction::Xor))
Chris Lattner0f9fd5b2002-05-14 19:57:25 +0000278 return true;
279
280 return false;
281}
282
Chris Lattner7e708292002-06-25 16:13:24 +0000283bool GCSE::visitBinaryOperator(Instruction &I) {
284 Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);
285 Function *F = I.getParent()->getParent();
Chris Lattnerd80e9732002-04-28 00:47:11 +0000286
287 for (Value::use_iterator UI = LHS->use_begin(), UE = LHS->use_end();
288 UI != UE; ++UI)
289 if (Instruction *Other = dyn_cast<Instruction>(*UI))
290 // Check to see if this new binary operator is not I, but same operand...
Chris Lattner7e708292002-06-25 16:13:24 +0000291 if (Other != &I && isIdenticalBinaryInst(I, Other)) {
Chris Lattnerd80e9732002-04-28 00:47:11 +0000292 // These instructions are identical. Handle the situation.
Chris Lattner7e708292002-06-25 16:13:24 +0000293 CommonSubExpressionFound(&I, Other);
Chris Lattnerd80e9732002-04-28 00:47:11 +0000294 return true; // One instruction eliminated!
295 }
296
297 return false;
298}
299
Chris Lattner18fb2a62002-05-14 05:02:40 +0000300// IdenticalComplexInst - Return true if the two instructions are the same, by
301// using a brute force comparison.
302//
303static bool IdenticalComplexInst(const Instruction *I1, const Instruction *I2) {
304 assert(I1->getOpcode() == I2->getOpcode());
305 // Equal if they are in the same function...
306 return I1->getParent()->getParent() == I2->getParent()->getParent() &&
307 // And return the same type...
308 I1->getType() == I2->getType() &&
309 // And have the same number of operands...
310 I1->getNumOperands() == I2->getNumOperands() &&
311 // And all of the operands are equal.
312 std::equal(I1->op_begin(), I1->op_end(), I2->op_begin());
313}
314
Chris Lattner7e708292002-06-25 16:13:24 +0000315bool GCSE::visitGetElementPtrInst(GetElementPtrInst &I) {
316 Value *Op = I.getOperand(0);
317 Function *F = I.getParent()->getParent();
Chris Lattnerd80e9732002-04-28 00:47:11 +0000318
319 for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
320 UI != UE; ++UI)
321 if (GetElementPtrInst *Other = dyn_cast<GetElementPtrInst>(*UI))
Chris Lattner18fb2a62002-05-14 05:02:40 +0000322 // Check to see if this new getelementptr is not I, but same operand...
Chris Lattner7e708292002-06-25 16:13:24 +0000323 if (Other != &I && IdenticalComplexInst(&I, Other)) {
Chris Lattner18fb2a62002-05-14 05:02:40 +0000324 // These instructions are identical. Handle the situation.
Chris Lattner7e708292002-06-25 16:13:24 +0000325 CommonSubExpressionFound(&I, Other);
Chris Lattner18fb2a62002-05-14 05:02:40 +0000326 return true; // One instruction eliminated!
Chris Lattnerd80e9732002-04-28 00:47:11 +0000327 }
328
329 return false;
330}
Chris Lattner18fb2a62002-05-14 05:02:40 +0000331
Chris Lattner7e708292002-06-25 16:13:24 +0000332bool GCSE::visitLoadInst(LoadInst &LI) {
333 Value *Op = LI.getOperand(0);
334 Function *F = LI.getParent()->getParent();
Chris Lattner18fb2a62002-05-14 05:02:40 +0000335
336 for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
337 UI != UE; ++UI)
338 if (LoadInst *Other = dyn_cast<LoadInst>(*UI))
339 // Check to see if this new load is not LI, but has the same operands...
Chris Lattner7e708292002-06-25 16:13:24 +0000340 if (Other != &LI && IdenticalComplexInst(&LI, Other) &&
341 TryToRemoveALoad(&LI, Other))
Chris Lattner18fb2a62002-05-14 05:02:40 +0000342 return true; // An instruction was eliminated!
343
344 return false;
345}
346
Chris Lattner7e708292002-06-25 16:13:24 +0000347static inline bool isInvalidatingInst(const Instruction &I) {
348 return I.getOpcode() == Instruction::Store ||
349 I.getOpcode() == Instruction::Call ||
350 I.getOpcode() == Instruction::Invoke;
Chris Lattner18fb2a62002-05-14 05:02:40 +0000351}
352
353// TryToRemoveALoad - Try to remove one of L1 or L2. The problem with removing
354// loads is that intervening stores might make otherwise identical load's yield
355// different values. To ensure that this is not the case, we check that there
356// are no intervening stores or calls between the instructions.
357//
358bool GCSE::TryToRemoveALoad(LoadInst *L1, LoadInst *L2) {
359 // Figure out which load dominates the other one. If neither dominates the
360 // other we cannot eliminate one...
361 //
362 if (DomSetInfo->dominates(L2, L1))
363 std::swap(L1, L2); // Make L1 dominate L2
364 else if (!DomSetInfo->dominates(L1, L2))
365 return false; // Neither instruction dominates the other one...
366
367 BasicBlock *BB1 = L1->getParent(), *BB2 = L2->getParent();
368
Chris Lattner7e708292002-06-25 16:13:24 +0000369 BasicBlock::iterator L1I = L1;
Chris Lattner18fb2a62002-05-14 05:02:40 +0000370
371 // L1 now dominates L2. Check to see if the intervening instructions between
372 // the two loads include a store or call...
373 //
374 if (BB1 == BB2) { // In same basic block?
375 // In this degenerate case, no checking of global basic blocks has to occur
376 // just check the instructions BETWEEN L1 & L2...
377 //
Chris Lattner7e708292002-06-25 16:13:24 +0000378 for (++L1I; &*L1I != L2; ++L1I)
Chris Lattner18fb2a62002-05-14 05:02:40 +0000379 if (isInvalidatingInst(*L1I))
380 return false; // Cannot eliminate load
381
382 ++NumLoadRemoved;
383 CommonSubExpressionFound(L1, L2);
384 return true;
385 } else {
386 // Make sure that there are no store instructions between L1 and the end of
387 // it's basic block...
388 //
389 for (++L1I; L1I != BB1->end(); ++L1I)
390 if (isInvalidatingInst(*L1I)) {
391 BBContainsStore[BB1] = true;
392 return false; // Cannot eliminate load
393 }
394
395 // Make sure that there are no store instructions between the start of BB2
396 // and the second load instruction...
397 //
Chris Lattner7e708292002-06-25 16:13:24 +0000398 for (BasicBlock::iterator II = BB2->begin(); &*II != L2; ++II)
Chris Lattner18fb2a62002-05-14 05:02:40 +0000399 if (isInvalidatingInst(*II)) {
400 BBContainsStore[BB2] = true;
401 return false; // Cannot eliminate load
402 }
403
404 // Do a depth first traversal of the inverse CFG starting at L2's block,
405 // looking for L1's block. The inverse CFG is made up of the predecessor
406 // nodes of a block... so all of the edges in the graph are "backward".
407 //
408 set<BasicBlock*> VisitedSet;
409 for (pred_iterator PI = pred_begin(BB2), PE = pred_end(BB2); PI != PE; ++PI)
410 if (CheckForInvalidatingInst(*PI, BB1, VisitedSet))
411 return false;
412
413 ++NumLoadRemoved;
414 CommonSubExpressionFound(L1, L2);
415 return true;
416 }
417 return false;
418}
419
420// CheckForInvalidatingInst - Return true if BB or any of the predecessors of BB
421// (until DestBB) contain a store (or other invalidating) instruction.
422//
423bool GCSE::CheckForInvalidatingInst(BasicBlock *BB, BasicBlock *DestBB,
424 set<BasicBlock*> &VisitedSet) {
425 // Found the termination point!
426 if (BB == DestBB || VisitedSet.count(BB)) return false;
427
428 // Avoid infinite recursion!
429 VisitedSet.insert(BB);
430
431 // Have we already checked this block?
432 map<BasicBlock*, bool>::iterator MI = BBContainsStore.find(BB);
433
434 if (MI != BBContainsStore.end()) {
435 // If this block is known to contain a store, exit the recursion early...
436 if (MI->second) return true;
437 // Otherwise continue checking predecessors...
438 } else {
439 // We don't know if this basic block contains an invalidating instruction.
440 // Check now:
441 bool HasStore = std::find_if(BB->begin(), BB->end(),
442 isInvalidatingInst) != BB->end();
443 if ((BBContainsStore[BB] = HasStore)) // Update map
444 return true; // Exit recursion early...
445 }
446
447 // Check all of our predecessor blocks...
448 for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI)
449 if (CheckForInvalidatingInst(*PI, DestBB, VisitedSet))
450 return true;
451
452 // None of our predecessor blocks contain a store, and we don't either!
453 return false;
454}