mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-19 14:44:39 +00:00
Add multiply as a supported constant propogation operation
Include the LevelChange.h header in AllOpts.h llvm-svn: 211
This commit is contained in:
parent
64a234bc26
commit
e3d4a4fa44
@ -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!");
|
||||
|
@ -39,4 +39,9 @@
|
||||
|
||||
#include "llvm/Optimizations/InductionVars.h"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// LevelChange - Code lowering and raising
|
||||
//
|
||||
#include "llvm/Optimizations/LevelChange.h"
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user