enum class TargetTransformInfo::CastContextHint

Description

Represents a hint about the context in which a cast is used. For zext/sext, the context of the cast is the operand, which must be a load of some kind. For trunc, the context is of the cast is the single user of the instruction, which must be a store of some kind. This enum allows the vectorizer to give getCastInstrCost an idea of the type of cast it's dealing with, as not every cast is equal. For instance, the zext of a load may be free, but the zext of an interleaving load can / be (very) expensive! See \c getCastContextHint to compute a CastContextHint from a cast Instruction*. Callers can use it if they don't need to override the context and just want it to be calculated from the instruction. FIXME: This handles the types of load/store that the vectorizer can produce, which are the cases where the context instruction is most likely to be incorrect. There are other situations where that can happen too, which might be handled here but in the long run a more general solution of costing multiple instructions at the same times may be better.

Declared at: llvm/include/llvm/Analysis/TargetTransformInfo.h:1113

Enumerators

NameValueComment
None0The cast is not used with a load/store of any kind.
Normal1The cast is used with a normal load/store.
Masked2The cast is used with a masked load/store.
GatherScatter3The cast is used with a gather/scatter.
Interleave4The cast is used with an interleaved load/store.
Reversed5The cast is used with a reversed load/store.