Re: [Mesa-dev] [PATCH] ac: make use of ac_get_llvm_num_components() helper

2018-02-23 Thread Samuel Pitoiset

Reviewed-by: Samuel Pitoiset 

On 02/23/2018 06:42 AM, Timothy Arceri wrote:

---
  src/amd/common/ac_nir_to_llvm.c | 6 +-
  1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 50f3a4f69e..444107d14e 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1198,11 +1198,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)


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] ac: make use of ac_get_llvm_num_components() helper

2018-02-22 Thread Timothy Arceri
---
 src/amd/common/ac_nir_to_llvm.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 50f3a4f69e..444107d14e 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1198,11 +1198,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)
-- 
2.14.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev