MachineInstr* minstr = NULL;
Value* constOp = ((InstrTreeNode*) instrNode->rightChild())->getValue();
- assert(constOp->getValueType() == Value::ConstantVal);
+ assert(constOp->isConstant());
// Cases worth optimizing are:
// (1) Add with 0 for float or double: use an FMOV of appropriate type,
//
const Type* resultType = instrNode->getInstruction()->getType();
- if (resultType == Type::FloatTy ||
- resultType == Type::DoubleTy)
- {
- double dval = ((ConstPoolFP*) constOp)->getValue();
- if (dval == 0.0)
- minstr = CreateMovFloatInstruction(instrNode, resultType);
- }
+ if (resultType == Type::FloatTy || resultType == Type::DoubleTy) {
+ double dval = ((ConstPoolFP*) constOp)->getValue();
+ if (dval == 0.0)
+ minstr = CreateMovFloatInstruction(instrNode, resultType);
+ }
return minstr;
}
MachineInstr* minstr = NULL;
Value* constOp = ((InstrTreeNode*) instrNode->rightChild())->getValue();
- assert(constOp->getValueType() == Value::ConstantVal);
+ assert(constOp->isConstant());
// Cases worth optimizing are:
// (1) Sub with 0 for float or double: use an FMOV of appropriate type,
bool needNeg = false;
Value* constOp = ((InstrTreeNode*) instrNode->rightChild())->getValue();
- assert(constOp->getValueType() == Value::ConstantVal);
+ assert(constOp->isConstant());
// Cases worth optimizing are:
// (1) Multiply by 0 or 1 for any type: replace with copy (ADD or FMOV)
getMinstr2 = NULL;
Value* constOp = ((InstrTreeNode*) instrNode->rightChild())->getValue();
- assert(constOp->getValueType() == Value::ConstantVal);
+ assert(constOp->isConstant());
// Cases worth optimizing are:
// (1) Divide by 1 for any type: replace with copy (ADD or FMOV)
Value* opValue = mop.getVRegValue();
- if (opValue->getValueType() == Value::ConstantVal)
+ if (opValue->isConstant())
{
unsigned int machineRegNum;
int64_t immedValue;
TmpInstruction*& tmpReg,
MachineInstr*& getMinstr2)
{
- assert(val->getValueType() == Value::ConstantVal);
+ assert(val->isConstant());
MachineInstr* minstr;
Value* firstUse = (Value*) * result->use_begin();
bool discardResult =
(result->use_size() == 1
- && firstUse->getValueType() == Value::InstructionVal
+ && firstUse->isInstruction()
&& ((Instruction*) firstUse)->getOpcode() == Instruction::Br);
bool mustClearReg;