summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-12-13 18:46:56 +1100
committerTimothy Arceri <[email protected]>2018-01-05 12:20:38 +1100
commit4a0c24f2dd97c670259a7ab0ced701dbf9bb5dd7 (patch)
tree4e9029569c8aed6a90a7e2ada5f19bac49a59ab7
parent71f82dc9a3d9823f91e4cf9d5ab9d54047ba8ce4 (diff)
ac: rework ac_llvm_extract_elem()
Simplifies the logic a little and asserts index is 0. Suggested-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/amd/common/ac_llvm_build.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 0ea5e7f4caa..8a3a2abf17b 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -114,10 +114,10 @@ ac_llvm_extract_elem(struct ac_llvm_context *ac,
LLVMValueRef value,
int index)
{
- int count = ac_get_llvm_num_components(value);
-
- if (count == 1)
+ if (LLVMGetTypeKind(LLVMTypeOf(value)) != LLVMVectorTypeKind) {
+ assert(index == 0);
return value;
+ }
return LLVMBuildExtractElement(ac->builder, value,
LLVMConstInt(ac->i32, index, false), "");