summaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-02-23 16:42:04 +1100
committerTimothy Arceri <[email protected]>2018-02-26 11:43:47 +1100
commit9873bd9dcdc85f37df512a1361967720b12593bb (patch)
tree8b84ae63dc53f6fe3cfe9ea42c3a7b0795f68b79 /src/amd/common
parent1a757c9c9780fdc3ac9b8ab7f486ca4cd31e20d8 (diff)
ac: make use of ac_get_llvm_num_components() helper
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index cccc687157c..2c5a6e6cf6d 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1207,11 +1207,7 @@ static LLVMValueRef get_alu_src(struct ac_nir_context *ctx,
bool need_swizzle = false;
assert(value);
- LLVMTypeRef type = LLVMTypeOf(value);
- unsigned src_components = LLVMGetTypeKind(type) == LLVMVectorTypeKind
- ? LLVMGetVectorSize(type)
- : 1;
-
+ unsigned src_components = ac_get_llvm_num_components(value);
for (unsigned i = 0; i < num_components; ++i) {
assert(src.swizzle[i] < src_components);
if (src.swizzle[i] != i)