cache result of operator*

llvm-svn: 108144
This commit is contained in:
Gabor Greif 2010-07-12 14:13:15 +00:00
parent 15445db11b
commit a75ed761a9
1 changed files with 6 additions and 4 deletions

View File

@ -1603,9 +1603,11 @@ static bool TryToShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) {
// Walk the use list of the global seeing if all the uses are load or store.
// If there is anything else, bail out.
for (Value::use_iterator I = GV->use_begin(), E = GV->use_end(); I != E; ++I)
if (!isa<LoadInst>(I) && !isa<StoreInst>(I))
for (Value::use_iterator I = GV->use_begin(), E = GV->use_end(); I != E; ++I){
User *U = *I;
if (!isa<LoadInst>(U) && !isa<StoreInst>(U))
return false;
}
DEBUG(dbgs() << " *** SHRINKING TO BOOL: " << *GV);