================ @@ -1846,6 +1846,16 @@ class TargetInfo : public TransferrableTargetInfo, return std::make_pair(64, 64); } + /// Returns the optimal vector type elements based on the provided vector + /// type. For example, on some targets, a vector with 3 elements may be + /// treated as one with 4 elements to enhance performance. + virtual llvm::FixedVectorType * + getOptimalVectorType(llvm::FixedVectorType *T, const LangOptions &Opt) const { + if (!Opt.HLSL && T->getNumElements() == 3) + return llvm::FixedVectorType::get(T->getElementType(), 4); ---------------- arsenm wrote:
I think it would be better to keep this in a LangOptions field, regardless of whether we keep the flag or not. https://github.com/llvm/llvm-project/pull/104661 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits