ΒΆllvm::LLT getGCDType(llvm::LLT OrigTy,
llvm::LLT TargetTy)
llvm::LLT getGCDType(llvm::LLT OrigTy,
llvm::LLT TargetTy)
Description
Return a type where the total size is the greatest common divisor of \p OrigTy and \p TargetTy. This will try to either change the number of vector elements, or bitwidth of scalars. The intent is the result type can be used as the result of a G_UNMERGE_VALUES from \p OrigTy, and then some combination of G_MERGE_VALUES, G_BUILD_VECTOR and G_CONCAT_VECTORS (possibly with intermediate casts) can re-form \p TargetTy. If these are vectors with different element types, this will try to produce a vector with a compatible total size, but the element type of \p OrigTy. If this can't be satisfied, this will produce a scalar smaller than the original vector elements. In the worst case, this returns LLT::scalar(1)
Declared at: llvm/include/llvm/CodeGen/GlobalISel/Utils.h:344