Implement null and undef values for FastISel.

llvm-svn: 55500
This commit is contained in:
Dan Gohman 2008-08-28 21:19:07 +00:00
parent 1e137300bd
commit c45733f194
1 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,8 @@ unsigned FastISel::getRegForValue(Value *V, DenseMap<const Value*, unsigned> &Va
if (CI->getValue().getActiveBits() > 64)
return 0;
Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue());
} else if (isa<ConstantPointerNull>(V)) {
Reg = FastEmit_i(VT, VT, ISD::Constant, 0);
} else if (ConstantFP *CF = dyn_cast<ConstantFP>(V)) {
Reg = FastEmit_f(VT, VT, ISD::ConstantFP, CF);
@ -53,6 +55,9 @@ unsigned FastISel::getRegForValue(Value *V, DenseMap<const Value*, unsigned> &Va
if (Reg == 0)
return 0;
}
} else if (isa<UndefValue>(V)) {
Reg = createResultReg(TLI.getRegClassFor(VT));
BuildMI(MBB, TII.get(TargetInstrInfo::IMPLICIT_DEF), Reg);
}
return Reg;