[llvm-commits] CVS: llvm/lib/Analysis/IPA/GlobalsModRef.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Apr 21 22:37:16 PDT 2005
Changes in directory llvm/lib/Analysis/IPA:
GlobalsModRef.cpp updated: 1.17 -> 1.18
---
Log message:
Malloc/Free have mod/ref effects. Do not allow CSE of function calls that
call malloc/free. This fixes PR555: http://llvm.cs.uiuc.edu/PR555 .
---
Diffs of the changes: (+2 -0)
GlobalsModRef.cpp | 2 ++
1 files changed, 2 insertions(+)
Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp
diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.17 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.18
--- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.17 Thu Apr 21 22:54:59 2005
+++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Fri Apr 22 00:36:59 2005
@@ -310,6 +310,8 @@
FunctionEffect |= Ref;
else if (isa<StoreInst>(*II))
FunctionEffect |= Mod;
+ else if (isa<MallocInst>(*II) || isa<FreeInst>(*II))
+ FunctionEffect |= ModRef;
}
if ((FunctionEffect & Mod) == 0)
More information about the llvm-commits
mailing list