diff options
| author | Chris Lattner <sabre@nondot.org> | 2001-07-20 19:14:41 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2001-07-20 19:14:41 +0000 |
| commit | e3d4a4fa44f5041572ebe74da87c6f5d7e5c7efe (patch) | |
| tree | d5c2f8ac2b1e0baa234940ad8e16dd3217f0a93d | |
| parent | 64a234bc26e8e9f240757134d17f2111bfe2ec80 (diff) | |
| download | bcm5719-llvm-e3d4a4fa44f5041572ebe74da87c6f5d7e5c7efe.tar.gz bcm5719-llvm-e3d4a4fa44f5041572ebe74da87c6f5d7e5c7efe.zip | |
Add multiply as a supported constant propogation operation
Include the LevelChange.h header in AllOpts.h
llvm-svn: 211
| -rw-r--r-- | llvm/include/llvm/ConstantHandling.h | 7 | ||||
| -rw-r--r-- | llvm/include/llvm/Optimizations/AllOpts.h | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/ConstantHandling.h b/llvm/include/llvm/ConstantHandling.h index 79dd21c2c67..de79ab36003 100644 --- a/llvm/include/llvm/ConstantHandling.h +++ b/llvm/include/llvm/ConstantHandling.h @@ -67,6 +67,8 @@ public: const ConstPoolVal *V2) const = 0; virtual ConstPoolVal *sub(const ConstPoolVal *V1, const ConstPoolVal *V2) const = 0; + virtual ConstPoolVal *mul(const ConstPoolVal *V1, + const ConstPoolVal *V2) const = 0; virtual ConstPoolBool *lessthan(const ConstPoolVal *V1, const ConstPoolVal *V2) const = 0; @@ -103,6 +105,11 @@ inline ConstPoolVal *operator-(const ConstPoolVal &V1, const ConstPoolVal &V2) { return ConstRules::get(V1)->sub(&V1, &V2); } +inline ConstPoolVal *operator*(const ConstPoolVal &V1, const ConstPoolVal &V2) { + assert(V1.getType() == V2.getType() && "Constant types must be identical!"); + return ConstRules::get(V1)->mul(&V1, &V2); +} + inline ConstPoolBool *operator<(const ConstPoolVal &V1, const ConstPoolVal &V2) { assert(V1.getType() == V2.getType() && "Constant types must be identical!"); diff --git a/llvm/include/llvm/Optimizations/AllOpts.h b/llvm/include/llvm/Optimizations/AllOpts.h index bbe9af6d31d..4add7137654 100644 --- a/llvm/include/llvm/Optimizations/AllOpts.h +++ b/llvm/include/llvm/Optimizations/AllOpts.h @@ -39,4 +39,9 @@ #include "llvm/Optimizations/InductionVars.h" +//===----------------------------------------------------------------------===// +// LevelChange - Code lowering and raising +// +#include "llvm/Optimizations/LevelChange.h" + #endif |

