Loading llvm/lib/Target/TargetTransformImpl.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -214,8 +214,16 @@ unsigned VectorTargetTransformImpl::getCastInstrCost(unsigned Opcode, Type *Dst, // Handle scalar conversions. if (!Src->isVectorTy() && !Dst->isVectorTy()) { // Scalar bitcasts and truncs are usually free. if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc) // Scalar bitcasts are usually free. if (Opcode == Instruction::BitCast) return 0; if (Opcode == Instruction::Trunc && TLI->isTruncateFree(SrcLT.second, DstLT.second)) return 0; if (Opcode == Instruction::ZExt && TLI->isZExtFree(SrcLT.second, DstLT.second)) return 0; // Just check the op cost. If the operation is legal then assume it costs 1. Loading Loading
llvm/lib/Target/TargetTransformImpl.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -214,8 +214,16 @@ unsigned VectorTargetTransformImpl::getCastInstrCost(unsigned Opcode, Type *Dst, // Handle scalar conversions. if (!Src->isVectorTy() && !Dst->isVectorTy()) { // Scalar bitcasts and truncs are usually free. if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc) // Scalar bitcasts are usually free. if (Opcode == Instruction::BitCast) return 0; if (Opcode == Instruction::Trunc && TLI->isTruncateFree(SrcLT.second, DstLT.second)) return 0; if (Opcode == Instruction::ZExt && TLI->isZExtFree(SrcLT.second, DstLT.second)) return 0; // Just check the op cost. If the operation is legal then assume it costs 1. Loading