diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-03-28 23:04:47 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-03-28 23:04:47 +0000 |
commit | dbac025d848dedd82096eb7b15c9c7b7292f3e16 (patch) | |
tree | 7447d16bc6c434eedf9bc00b7917c3a427e80e3d /llvm/lib | |
parent | e1d85d55e6e2e54f11f0c1ec5cdd3b4c0989093d (diff) | |
download | bcm5719-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
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 2 |
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, |