aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-28 21:19:07 +0000
committerDan Gohman <gohman@apple.com>2008-08-28 21:19:07 +0000
commit205d92589bc8c59d4bba9ddf89e0eb3c4d548cda (patch)
tree83a220ab2fa8be4fd6ad4df426670c830f847821 /lib
parent5ad0bf658aa1e3df4b15b64647a6f91e0641c294 (diff)
downloadexternal_llvm-205d92589bc8c59d4bba9ddf89e0eb3c4d548cda.zip
external_llvm-205d92589bc8c59d4bba9ddf89e0eb3c4d548cda.tar.gz
external_llvm-205d92589bc8c59d4bba9ddf89e0eb3c4d548cda.tar.bz2
Implement null and undef values for FastISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 9fa37b1..33da2b0 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -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;