diff options
author | Chris Lattner <sabre@nondot.org> | 2005-04-22 05:36:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-04-22 05:36:59 +0000 |
commit | 3fe4d3cb5bd5ea7948faeed8451b61380d928808 (patch) | |
tree | 78de15c19a295b9867ac13a65602c42e00d4cfbf /lib/Analysis/IPA/GlobalsModRef.cpp | |
parent | 53f72b3bab0e8b474f6ded9ee46957fd89d01cda (diff) |
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
Diffstat (limited to 'lib/Analysis/IPA/GlobalsModRef.cpp')
-rw-r--r-- | lib/Analysis/IPA/GlobalsModRef.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index 20422bf318..5b3c953bcd 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -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) |