ac: rework ac_llvm_extract_elem()
Simplifies the logic a little and asserts index is 0. Suggested-by: Nicolai Hähnle <nhaehnle@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -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), "");
|
||||
|
||||
Reference in New Issue
Block a user