================ @@ -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); ---------------- shiltian wrote:
The logic here might look weird, but it preserves the current behavior prior to this PR. 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