[llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h
Chris Lattner
lattner at cs.uiuc.edu
Sun Mar 14 20:00:01 PST 2004
Changes in directory llvm/include/llvm/Analysis:
AliasAnalysis.h updated: 1.11 -> 1.12
---
Log message:
Add two new methods which can be used to enable a bunch of transformations
in common cases.
---
Diffs of the changes: (+22 -0)
Index: llvm/include/llvm/Analysis/AliasAnalysis.h
diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.11 llvm/include/llvm/Analysis/AliasAnalysis.h:1.12
--- llvm/include/llvm/Analysis/AliasAnalysis.h:1.11 Thu Mar 11 17:08:20 2004
+++ llvm/include/llvm/Analysis/AliasAnalysis.h Sun Mar 14 19:58:54 2004
@@ -100,6 +100,28 @@
///
virtual bool pointsToConstantMemory(const Value *P) { return false; }
+ /// doesNotAccessMemory - If the specified function is known to never read or
+ /// write memory, return true.
+ ///
+ /// Many optimizations (such as CSE and LICM) can be performed on calls to it,
+ /// without worrying about aliasing properties, and many functions have this
+ /// property (e.g. 'sin' and 'cos').
+ ///
+ /// This property corresponds to the GCC 'const' attribute.
+ ///
+ virtual bool doesNotAccessMemory(Function *F) { return false; }
+
+ /// onlyReadsMemory - If the specified function is known to only read from
+ /// non-volatile memory (or not access memory at all), return true.
+ ///
+ /// This property allows many common optimizations to be performed in the
+ /// absence of interfering store instructions, such as CSE of strlen calls.
+ ///
+ /// This property corresponds to the GCC 'pure' attribute.
+ ///
+ virtual bool onlyReadsMemory(Function *F) { return doesNotAccessMemory(F); }
+
+
//===--------------------------------------------------------------------===//
/// Simple mod/ref information...
///
More information about the llvm-commits
mailing list