diff --git a/llvm/include/llvm/CodeGenTypes/LowLevelType.h b/llvm/include/llvm/CodeGenTypes/LowLevelType.h index 62ee28cfac99c..c66b98dceae5f 100644 --- a/llvm/include/llvm/CodeGenTypes/LowLevelType.h +++ b/llvm/include/llvm/CodeGenTypes/LowLevelType.h @@ -68,7 +68,7 @@ class LLT { } /// Get a low-level vector of some number of elements and element type. - static constexpr LLT vector(ElementCount EC, LLT ScalarTy) { + static constexpr LLT vector(ElementCount EC, const LLT &ScalarTy) { assert(!EC.isScalar() && "invalid number of vector elements"); assert(!ScalarTy.isVector() && "invalid vector element type"); return LLT{ScalarTy.isPointer(), @@ -121,7 +121,7 @@ class LLT { return vector(ElementCount::getScalable(MinNumElements), ScalarTy); } - static constexpr LLT scalarOrVector(ElementCount EC, LLT ScalarTy) { + static constexpr LLT scalarOrVector(ElementCount EC, const LLT &ScalarTy) { return EC.isScalar() ? ScalarTy : LLT::vector(EC, ScalarTy); }