Eliminate use of ConstantHandling itf

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-01-12 18:08:18 +00:00
parent e9028638bf
commit d4d4ab58ef

View File

@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/Constants.h"
#include "llvm/ConstantHandling.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
@ -56,7 +55,7 @@ static inline void Add3OperandInstr(unsigned Opcode, InstructionNode* Node,
// Check for a constant 0.
inline bool
static inline bool
IsZero(Value* idx)
{
return (idx == ConstantSInt::getNullValue(idx->getType()));
@ -896,9 +895,9 @@ CreateCheapestMulConstInstruction(const TargetMachine &target,
Value* constOp;
if (isa<Constant>(lval) && isa<Constant>(rval)) {
// both operands are constant: evaluate and "set" in dest
Constant* P = ConstantFoldBinaryInstruction(Instruction::Mul,
cast<Constant>(lval),
cast<Constant>(rval));
Constant* P = ConstantExpr::get(Instruction::Mul,
cast<Constant>(lval),
cast<Constant>(rval));
target.getInstrInfo().CreateCodeToLoadConst(target,F,P,destVal,mvec,mcfi);
}
else if (isa<Constant>(rval)) // rval is constant, but not lval