================
@@ -1066,6 +1066,12 @@ InstructionCost GCNTTIImpl::getCastInstrCost(unsigned 
Opcode, Type *Dst,
         Elts && Src->isIntegerTy(*Elts))
       return InstructionCost(MaskUnpackCostPerElt) * *Elts *
              getFullRateInstrCost();
+    // Integer and floating-point values share the same registers.
+    if (Src->getPrimitiveSizeInBits() == Dst->getPrimitiveSizeInBits() &&
----------------
michaelselehov wrote:

It is free while the value stays packed: a store of the `<8 x i8>` needs no 
extra instructions. The cost appears when the lanes are used separately. `<8 x 
i8>` is not a legal type, so it gets split into elements, and returning it from 
a function takes 6 shifts and 4 moves on gfx950. The cost of 8 on main models 
that split, and this patch keeps it.


https://github.com/llvm/llvm-project/pull/238412
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to