summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-03-28 23:04:47 +0000
committerChad Rosier <mcrosier@apple.com>2013-03-28 23:04:47 +0000
commitdbac025d848dedd82096eb7b15c9c7b7292f3e16 (patch)
tree7447d16bc6c434eedf9bc00b7917c3a427e80e3d
parente1d85d55e6e2e54f11f0c1ec5cdd3b4c0989093d (diff)
downloadbcm5719-llvm-dbac025d848dedd82096eb7b15c9c7b7292f3e16.tar.gz
bcm5719-llvm-dbac025d848dedd82096eb7b15c9c7b7292f3e16.zip
[fast-isel] Add a preemptive fix for the case where we fail to materialize an
immediate in a register. I don't believe this should ever fail, but I see no harm in trying to make this code bullet proof. I've added an assert to ensure my assumtion is correct. If the assertion fires something is wrong and we should fix it, rather then just silently fall back to SelectionDAG isel. llvm-svn: 178305
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 10e2dc61499..9ac738e5072 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -1183,6 +1183,8 @@ unsigned FastISel::FastEmit_ri_(MVT VT, unsigned Opcode,
IntegerType *ITy = IntegerType::get(FuncInfo.Fn->getContext(),
VT.getSizeInBits());
MaterialReg = getRegForValue(ConstantInt::get(ITy, Imm));
+ assert (MaterialReg != 0 && "Unable to materialize imm.");
+ if (MaterialReg == 0) return 0;
}
return FastEmit_rr(VT, VT, Opcode,
Op0, Op0IsKill,
OpenPOWER on IntegriCloud