Return the expected cost of a cast instruction.
Declared in <llvm/CodeGen/BasicTTIImpl.h>
InstructionCost
getCastInstrCost(
unsigned int Opcode,
Type* Dst,
Type* Src,
TTI::CastContextHint CCH,
TTI::TargetCostKind CostKind,
Instruction const* I = nullptr) const override;
Covers bitcast, trunc, zext, and similar casts. If an existing instruction holds Opcode, it may be passed as I.
The expected cost of a cast instruction.
| Name | Description |
|---|---|
| Opcode | Cast opcode. |
| Dst | Destination type. |
| Src | Source type. |
| CCH | Hint about the cast context. |
| CostKind | Kind of cost to compute. |
| I | Optional context instruction. |