summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantsContext.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-06 00:11:24 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-06 00:11:24 +0000
commit10ea8bb8e0934be27ea8894967bf48a8c90cc2bb (patch)
tree845f3759203a7d799922e202b019f5973025fe92 /llvm/lib/VMCore/ConstantsContext.h
parentdb5d4521f56d453d3b91d2446ddac58f8d6f5031 (diff)
downloadbcm5719-llvm-10ea8bb8e0934be27ea8894967bf48a8c90cc2bb.tar.gz
bcm5719-llvm-10ea8bb8e0934be27ea8894967bf48a8c90cc2bb.zip
Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64. llvm-svn: 81098
Diffstat (limited to 'llvm/lib/VMCore/ConstantsContext.h')
-rw-r--r--llvm/lib/VMCore/ConstantsContext.h49
1 files changed, 18 insertions, 31 deletions
diff --git a/llvm/lib/VMCore/ConstantsContext.h b/llvm/lib/VMCore/ConstantsContext.h
index 16975b3611e..718470aff42 100644
--- a/llvm/lib/VMCore/ConstantsContext.h
+++ b/llvm/lib/VMCore/ConstantsContext.h
@@ -53,12 +53,10 @@ public:
void *operator new(size_t s) {
return User::operator new(s, 2);
}
- BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2,
- unsigned Flags)
+ BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2)
: ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) {
Op<0>() = C1;
Op<1>() = C2;
- SubclassOptionalData = Flags;
}
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -208,12 +206,9 @@ class GetElementPtrConstantExpr : public ConstantExpr {
public:
static GetElementPtrConstantExpr *Create(Constant *C,
const std::vector<Constant*>&IdxList,
- const Type *DestTy,
- unsigned Flags) {
- GetElementPtrConstantExpr *Result =
+ const Type *DestTy) {
+ return
new(IdxList.size() + 1) GetElementPtrConstantExpr(C, IdxList, DestTy);
- Result->SubclassOptionalData = Flags;
- return Result;
}
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -296,32 +291,26 @@ struct ExprMapKeyType {
ExprMapKeyType(unsigned opc,
const std::vector<Constant*> &ops,
- unsigned short flags = 0,
- unsigned short optionalflags = 0,
+ unsigned short pred = 0,
const IndexList &inds = IndexList())
- : opcode(opc), subclassoptionaldata(optionalflags), subclassdata(flags),
- operands(ops), indices(inds) {}
- uint8_t opcode;
- uint8_t subclassoptionaldata;
- uint16_t subclassdata;
+ : opcode(opc), predicate(pred), operands(ops), indices(inds) {}
+ uint16_t opcode;
+ uint16_t predicate;
std::vector<Constant*> operands;
IndexList indices;
bool operator==(const ExprMapKeyType& that) const {
return this->opcode == that.opcode &&
- this->subclassdata == that.subclassdata &&
- this->subclassoptionaldata == that.subclassoptionaldata &&
+ this->predicate == that.predicate &&
this->operands == that.operands &&
this->indices == that.indices;
}
bool operator<(const ExprMapKeyType & that) const {
- if (this->opcode != that.opcode) return this->opcode < that.opcode;
- if (this->operands != that.operands) return this->operands < that.operands;
- if (this->subclassdata != that.subclassdata)
- return this->subclassdata < that.subclassdata;
- if (this->subclassoptionaldata != that.subclassoptionaldata)
- return this->subclassoptionaldata < that.subclassoptionaldata;
- if (this->indices != that.indices) return this->indices < that.indices;
- return false;
+ return this->opcode < that.opcode ||
+ (this->opcode == that.opcode && this->predicate < that.predicate) ||
+ (this->opcode == that.opcode && this->predicate == that.predicate &&
+ this->operands < that.operands) ||
+ (this->opcode == that.opcode && this->predicate == that.predicate &&
+ this->operands == that.operands && this->indices < that.indices);
}
bool operator!=(const ExprMapKeyType& that) const {
@@ -365,8 +354,7 @@ struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
return new UnaryConstantExpr(V.opcode, V.operands[0], Ty);
if ((V.opcode >= Instruction::BinaryOpsBegin &&
V.opcode < Instruction::BinaryOpsEnd))
- return new BinaryConstantExpr(V.opcode, V.operands[0], V.operands[1],
- V.subclassoptionaldata);
+ return new BinaryConstantExpr(V.opcode, V.operands[0], V.operands[1]);
if (V.opcode == Instruction::Select)
return new SelectConstantExpr(V.operands[0], V.operands[1],
V.operands[2]);
@@ -385,18 +373,17 @@ struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
return new ExtractValueConstantExpr(V.operands[0], V.indices, Ty);
if (V.opcode == Instruction::GetElementPtr) {
std::vector<Constant*> IdxList(V.operands.begin()+1, V.operands.end());
- return GetElementPtrConstantExpr::Create(V.operands[0], IdxList, Ty,
- V.subclassoptionaldata);
+ return GetElementPtrConstantExpr::Create(V.operands[0], IdxList, Ty);
}
// The compare instructions are weird. We have to encode the predicate
// value and it is combined with the instruction opcode by multiplying
// the opcode by one hundred. We must decode this to get the predicate.
if (V.opcode == Instruction::ICmp)
- return new CompareConstantExpr(Ty, Instruction::ICmp, V.subclassdata,
+ return new CompareConstantExpr(Ty, Instruction::ICmp, V.predicate,
V.operands[0], V.operands[1]);
if (V.opcode == Instruction::FCmp)
- return new CompareConstantExpr(Ty, Instruction::FCmp, V.subclassdata,
+ return new CompareConstantExpr(Ty, Instruction::FCmp, V.predicate,
V.operands[0], V.operands[1]);
llvm_unreachable("Invalid ConstantExpr!");
return 0;
OpenPOWER on IntegriCloud