mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Eliminate the explicit opcode field in ConstantExpr, using the SubclassData
field to hold it instead. This shrinks memory usage for 176.gcc from 57628728 to 57598144 bytes, a small reduction of about 30K. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20047 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
88fe29a1da
commit
eecfea4da6
@ -510,26 +510,22 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
/// ConstantExpr - a constant value that is initialized with an expression using
|
/// ConstantExpr - a constant value that is initialized with an expression using
|
||||||
/// other constant values. This is only used to represent values that cannot be
|
/// other constant values.
|
||||||
/// evaluated at compile-time (e.g., something derived from an address) because
|
|
||||||
/// it does not have a mechanism to store the actual value. Use the appropriate
|
|
||||||
/// Constant subclass above for known constants.
|
|
||||||
///
|
///
|
||||||
|
/// This class uses the standard Instruction opcodes to define the various
|
||||||
|
/// constant expressions. The Opcode field for the ConstantExpr class is
|
||||||
|
/// maintained in the Value::SubclassData field.
|
||||||
class ConstantExpr : public Constant {
|
class ConstantExpr : public Constant {
|
||||||
unsigned iType; // Operation type (an Instruction opcode)
|
|
||||||
friend struct ConstantCreator<ConstantExpr,Type,
|
friend struct ConstantCreator<ConstantExpr,Type,
|
||||||
std::pair<unsigned, std::vector<Constant*> > >;
|
std::pair<unsigned, std::vector<Constant*> > >;
|
||||||
friend struct ConvertConstantType<ConstantExpr, Type>;
|
friend struct ConvertConstantType<ConstantExpr, Type>;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ConstantExpr(const Type *Ty, unsigned Opcode, Use *Ops, unsigned NumOps)
|
ConstantExpr(const Type *Ty, unsigned Opcode, Use *Ops, unsigned NumOps)
|
||||||
: Constant(Ty, ConstantExprVal, Ops, NumOps), iType(Opcode) {}
|
: Constant(Ty, ConstantExprVal, Ops, NumOps) {
|
||||||
|
// Operation type (an Instruction opcode) is stored as the SubclassData.
|
||||||
// Select instruction creation ctor
|
SubclassData = Opcode;
|
||||||
ConstantExpr(Constant *C, Constant *V1, Constant *V2);
|
}
|
||||||
// GEP instruction creation ctor
|
|
||||||
ConstantExpr(Constant *C, const std::vector<Constant*> &IdxList,
|
|
||||||
const Type *DestTy);
|
|
||||||
|
|
||||||
// These private methods are used by the type resolution code to create
|
// These private methods are used by the type resolution code to create
|
||||||
// ConstantExprs in intermediate forms.
|
// ConstantExprs in intermediate forms.
|
||||||
@ -609,7 +605,7 @@ public:
|
|||||||
virtual bool isNullValue() const { return false; }
|
virtual bool isNullValue() const { return false; }
|
||||||
|
|
||||||
/// getOpcode - Return the opcode at the root of this constant expression
|
/// getOpcode - Return the opcode at the root of this constant expression
|
||||||
unsigned getOpcode() const { return iType; }
|
unsigned getOpcode() const { return SubclassData; }
|
||||||
|
|
||||||
/// getOpcodeName - Return a string representation for an opcode.
|
/// getOpcodeName - Return a string representation for an opcode.
|
||||||
const char *getOpcodeName() const;
|
const char *getOpcodeName() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user