mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-11 23:05:31 +00:00
Scalar Bitcasts and Truncs are usually free
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167323 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fb60a4e823
commit
2b0c96f71f
@ -213,6 +213,11 @@ 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)
|
||||
return 0;
|
||||
|
||||
// Just check the op cost. If the operation is legal then assume it costs 1.
|
||||
if (!TLI->isOperationExpand(ISD, DstLT.second))
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user