From: Chris Lattner Date: Fri, 22 Apr 2005 05:36:59 +0000 (+0000) Subject: Malloc/Free have mod/ref effects. Do not allow CSE of function calls that X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3fe4d3cb5bd5ea7948faeed8451b61380d928808;p=oota-llvm.git Malloc/Free have mod/ref effects. Do not allow CSE of function calls that call malloc/free. This fixes PR555. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21443 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index 20422bf3189..5b3c953bcdf 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -310,6 +310,8 @@ void GlobalsModRef::AnalyzeSCC(std::vector &SCC) { FunctionEffect |= Ref; else if (isa(*II)) FunctionEffect |= Mod; + else if (isa(*II) || isa(*II)) + FunctionEffect |= ModRef; } if ((FunctionEffect & Mod) == 0)