mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
[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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user