bool AliasSetTracker::add(FreeInst *FI) {
bool NewPtr;
- AliasSet &AS = addPointer(FI->getOperand(0), ~0,
- AliasSet::Mods, NewPtr);
+ addPointer(FI->getOperand(0), ~0, AliasSet::Mods, NewPtr);
+ return NewPtr;
+}
- // Free operations are volatile ops (cannot be moved).
- AS.setVolatile();
+bool AliasSetTracker::add(VAArgInst *VAAI) {
+ bool NewPtr;
+ addPointer(VAAI->getOperand(0), ~0, AliasSet::ModRef, NewPtr);
return NewPtr;
}
return add(II);
else if (FreeInst *FI = dyn_cast<FreeInst>(I))
return add(FI);
+ else if (VAArgInst *VAAI = dyn_cast<VAArgInst>(I))
+ return add(VAAI);
return true;
}
return true;
}
+bool AliasSetTracker::remove(VAArgInst *VAAI) {
+ AliasSet *AS = findAliasSetForPointer(VAAI->getOperand(0), ~0);
+ if (!AS) return false;
+ remove(*AS);
+ return true;
+}
+
bool AliasSetTracker::remove(CallSite CS) {
if (AA.doesNotAccessMemory(CS))
return false; // doesn't alias anything
return remove(CI);
else if (FreeInst *FI = dyn_cast<FreeInst>(I))
return remove(FI);
+ else if (VAArgInst *VAAI = dyn_cast<VAArgInst>(I))
+ return remove(VAAI);
return true;
}
void AliasSet::print(std::ostream &OS) const {
OS << " AliasSet[" << (void*)this << "," << RefCount << "] ";
- OS << (AliasTy == MustAlias ? "must" : "may ") << " alias, ";
+ OS << (AliasTy == MustAlias ? "must" : "may") << " alias, ";
switch (AccessTy) {
case NoModRef: OS << "No access "; break;
case Refs : OS << "Ref "; break;
return false;
}
};
- char AliasSetPrinter::ID = 0;
- RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer", true, true);
}
+
+char AliasSetPrinter::ID = 0;
+static RegisterPass<AliasSetPrinter>
+X("print-alias-sets", "Alias Set Printer", false, true);