Skip to content

Commit 2f573e1

Browse files
committed
Add assertion to check if type is legal
1 parent 612026d commit 2f573e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,9 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
10521052
DstLT.second.getSizeInBits()))
10531053
return BaseT::getCastInstrCost(Opcode, Dst, Src, CCH, CostKind, I);
10541054

1055+
// The split cost is handled by the base getCastInstrCost
1056+
assert((SrcLT.first == 1) && (DstLT.first == 1) && "Illegal type");
1057+
10551058
int ISD = TLI->InstructionOpcodeToISD(Opcode);
10561059
assert(ISD && "Invalid opcode");
10571060

0 commit comments

Comments
 (0)