mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 02:33:53 +00:00
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
This commit is contained in:
parent
e3ad3575b0
commit
a137f87051
@ -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
|
||||
|
@ -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!");
|
||||
|
@ -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!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user