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 | a137f870513d59ba4759ef5e6069a075f4934898 (patch) | |
tree | e7bab84527b97e764ebff5d76d0515d14bc57c30 /include | |
parent | e3ad3575b0ab0852f3a52f5a5f0cba3d45f05b43 (diff) | |
download | llvm-a137f870513d59ba4759ef5e6069a075f4934898.tar.gz llvm-a137f870513d59ba4759ef5e6069a075f4934898.tar.bz2 llvm-a137f870513d59ba4759ef5e6069a075f4934898.tar.xz |
Add multiply as a supported constant propogation operation
Include the LevelChange.h header in AllOpts.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ConstantHandling.h | 7 | ||||
-rw-r--r-- | include/llvm/Optimizations/AllOpts.h | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/ConstantHandling.h b/include/llvm/ConstantHandling.h index 79dd21c2c6..de79ab3600 100644 --- a/include/llvm/ConstantHandling.h +++ b/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/include/llvm/Optimizations/AllOpts.h b/include/llvm/Optimizations/AllOpts.h index bbe9af6d31..4add713765 100644 --- a/include/llvm/Optimizations/AllOpts.h +++ b/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 |