Use type checking predicates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@543 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp b/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
index 8b5a280..492a52f 100644
--- a/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
+++ b/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
@@ -468,7 +468,7 @@
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,
@@ -476,13 +476,11 @@
//
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;
}
@@ -521,7 +519,7 @@
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,
@@ -628,7 +626,7 @@
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)
@@ -752,7 +750,7 @@
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)
@@ -1099,7 +1097,7 @@
Value* opValue = mop.getVRegValue();
- if (opValue->getValueType() == Value::ConstantVal)
+ if (opValue->isConstant())
{
unsigned int machineRegNum;
int64_t immedValue;
@@ -1170,7 +1168,7 @@
TmpInstruction*& tmpReg,
MachineInstr*& getMinstr2)
{
- assert(val->getValueType() == Value::ConstantVal);
+ assert(val->isConstant());
MachineInstr* minstr;
@@ -1700,7 +1698,7 @@
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;