Malloc/Free have mod/ref effects. Do not allow CSE of function calls that

call malloc/free.  This fixes PR555.

llvm-svn: 21443
This commit is contained in:
Chris Lattner 2005-04-22 05:36:59 +00:00
parent 0d14436bc5
commit c638ca05a0

View File

@ -310,6 +310,8 @@ void GlobalsModRef::AnalyzeSCC(std::vector<CallGraphNode *> &SCC) {
FunctionEffect |= Ref;
else if (isa<StoreInst>(*II))
FunctionEffect |= Mod;
else if (isa<MallocInst>(*II) || isa<FreeInst>(*II))
FunctionEffect |= ModRef;
}
if ((FunctionEffect & Mod) == 0)