Mesa (staging/20.1): Revert "ac,radeonsi: fix compilations issues with LLVM 11"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 19 20:24:36 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 4daa2371711b723351fd29e06002849460373b06
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4daa2371711b723351fd29e06002849460373b06

Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Mon May 18 13:53:30 2020 +0200

Revert "ac,radeonsi: fix compilations issues with LLVM 11"

This reverts commit 42b1696ef627a5bfee29911a780fa0a4dbf04610.

The corresponding LLVM changes were reverted.

Acked-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5087>
(cherry picked from commit 2a6811f0f981c8d67d0131a0b74549b641ea2247)

---

 .pick_status.json                             |  2 +-
 src/amd/llvm/ac_llvm_build.c                  | 16 ++++++++--------
 src/amd/llvm/ac_llvm_util.h                   |  4 ----
 src/amd/llvm/ac_nir_to_llvm.c                 | 10 +++++-----
 src/amd/vulkan/radv_nir_to_llvm.c             |  2 +-
 src/gallium/drivers/radeonsi/si_shader_llvm.c |  2 +-
 6 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 86841534aaf..eae43648856 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -868,7 +868,7 @@
         "description": "Revert \"ac,radeonsi: fix compilations issues with LLVM 11\"",
         "nominated": true,
         "nomination_type": 2,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "42b1696ef627a5bfee29911a780fa0a4dbf04610"
     },
diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c
index 0066a885c95..12067cd5eae 100644
--- a/src/amd/llvm/ac_llvm_build.c
+++ b/src/amd/llvm/ac_llvm_build.c
@@ -144,7 +144,7 @@ int
 ac_get_llvm_num_components(LLVMValueRef value)
 {
 	LLVMTypeRef type = LLVMTypeOf(value);
-	unsigned num_components = LLVMGetTypeKind(type) == LLVMFixedVectorTypeKind
+	unsigned num_components = LLVMGetTypeKind(type) == LLVMVectorTypeKind
 	                              ? LLVMGetVectorSize(type)
 	                              : 1;
 	return num_components;
@@ -155,7 +155,7 @@ ac_llvm_extract_elem(struct ac_llvm_context *ac,
 		     LLVMValueRef value,
 		     int index)
 {
-	if (LLVMGetTypeKind(LLVMTypeOf(value)) != LLVMFixedVectorTypeKind) {
+	if (LLVMGetTypeKind(LLVMTypeOf(value)) != LLVMVectorTypeKind) {
 		assert(index == 0);
 		return value;
 	}
@@ -167,7 +167,7 @@ ac_llvm_extract_elem(struct ac_llvm_context *ac,
 int
 ac_get_elem_bits(struct ac_llvm_context *ctx, LLVMTypeRef type)
 {
-	if (LLVMGetTypeKind(type) == LLVMFixedVectorTypeKind)
+	if (LLVMGetTypeKind(type) == LLVMVectorTypeKind)
 		type = LLVMGetElementType(type);
 
 	if (LLVMGetTypeKind(type) == LLVMIntegerTypeKind)
@@ -206,7 +206,7 @@ ac_get_type_size(LLVMTypeRef type)
 		if (LLVMGetPointerAddressSpace(type) == AC_ADDR_SPACE_CONST_32BIT)
 			return 4;
 		return 8;
-	case LLVMFixedVectorTypeKind:
+	case LLVMVectorTypeKind:
 		return LLVMGetVectorSize(type) *
 		       ac_get_type_size(LLVMGetElementType(type));
 	case LLVMArrayTypeKind:
@@ -235,7 +235,7 @@ static LLVMTypeRef to_integer_type_scalar(struct ac_llvm_context *ctx, LLVMTypeR
 LLVMTypeRef
 ac_to_integer_type(struct ac_llvm_context *ctx, LLVMTypeRef t)
 {
-	if (LLVMGetTypeKind(t) == LLVMFixedVectorTypeKind) {
+	if (LLVMGetTypeKind(t) == LLVMVectorTypeKind) {
 		LLVMTypeRef elem_type = LLVMGetElementType(t);
 		return LLVMVectorType(to_integer_type_scalar(ctx, elem_type),
 		                      LLVMGetVectorSize(t));
@@ -290,7 +290,7 @@ static LLVMTypeRef to_float_type_scalar(struct ac_llvm_context *ctx, LLVMTypeRef
 LLVMTypeRef
 ac_to_float_type(struct ac_llvm_context *ctx, LLVMTypeRef t)
 {
-	if (LLVMGetTypeKind(t) == LLVMFixedVectorTypeKind) {
+	if (LLVMGetTypeKind(t) == LLVMVectorTypeKind) {
 		LLVMTypeRef elem_type = LLVMGetElementType(t);
 		return LLVMVectorType(to_float_type_scalar(ctx, elem_type),
 		                      LLVMGetVectorSize(t));
@@ -352,7 +352,7 @@ void ac_build_type_name_for_intr(LLVMTypeRef type, char *buf, unsigned bufsize)
 
 	assert(bufsize >= 8);
 
-	if (LLVMGetTypeKind(type) == LLVMFixedVectorTypeKind) {
+	if (LLVMGetTypeKind(type) == LLVMVectorTypeKind) {
 		int ret = snprintf(buf, bufsize, "v%u",
 					LLVMGetVectorSize(type));
 		if (ret < 0) {
@@ -627,7 +627,7 @@ ac_build_expand(struct ac_llvm_context *ctx,
 	LLVMTypeRef elemtype;
 	LLVMValueRef chan[dst_channels];
 
-	if (LLVMGetTypeKind(LLVMTypeOf(value)) == LLVMFixedVectorTypeKind) {
+	if (LLVMGetTypeKind(LLVMTypeOf(value)) == LLVMVectorTypeKind) {
 		unsigned vec_size = LLVMGetVectorSize(LLVMTypeOf(value));
 
 		if (src_channels == dst_channels && vec_size == dst_channels)
diff --git a/src/amd/llvm/ac_llvm_util.h b/src/amd/llvm/ac_llvm_util.h
index db745f9a5d4..f9650bdf4f1 100644
--- a/src/amd/llvm/ac_llvm_util.h
+++ b/src/amd/llvm/ac_llvm_util.h
@@ -36,10 +36,6 @@
 extern "C" {
 #endif
 
-#if LLVM_VERSION_MAJOR < 11
-#define LLVMFixedVectorTypeKind LLVMVectorTypeKind
-#endif
-
 struct ac_compiler_passes;
 
 enum ac_func_attr {
diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c
index 2a495eb76e4..f2cd2b3a9ea 100644
--- a/src/amd/llvm/ac_nir_to_llvm.c
+++ b/src/amd/llvm/ac_nir_to_llvm.c
@@ -245,7 +245,7 @@ static LLVMValueRef emit_bcsel(struct ac_llvm_context *ctx,
 	LLVMTypeRef src1_type = LLVMTypeOf(src1);
 	LLVMTypeRef src2_type = LLVMTypeOf(src2);
 
-	assert(LLVMGetTypeKind(LLVMTypeOf(src0)) != LLVMFixedVectorTypeKind);
+	assert(LLVMGetTypeKind(LLVMTypeOf(src0)) != LLVMVectorTypeKind);
 
 	if (LLVMGetTypeKind(src1_type) == LLVMPointerTypeKind &&
 	    LLVMGetTypeKind(src2_type) != LLVMPointerTypeKind) {
@@ -2193,7 +2193,7 @@ static LLVMValueRef load_tess_varyings(struct ac_nir_context *ctx,
 	LLVMTypeRef dest_type = get_def_type(ctx, &instr->dest.ssa);
 
 	LLVMTypeRef src_component_type;
-	if (LLVMGetTypeKind(dest_type) == LLVMFixedVectorTypeKind)
+	if (LLVMGetTypeKind(dest_type) == LLVMVectorTypeKind)
 		src_component_type = LLVMGetElementType(dest_type);
 	else
 		src_component_type = dest_type;
@@ -2353,7 +2353,7 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx,
 		bool split_loads = ctx->ac.chip_class == GFX6 && elem_size_bytes < 4;
 
 		if (stride != natural_stride || split_loads) {
-			if (LLVMGetTypeKind(result_type) == LLVMFixedVectorTypeKind)
+			if (LLVMGetTypeKind(result_type) == LLVMVectorTypeKind)
 				result_type = LLVMGetElementType(result_type);
 
 			LLVMTypeRef ptr_type = LLVMPointerType(result_type,
@@ -2529,7 +2529,7 @@ visit_store_var(struct ac_nir_context *ctx,
 			LLVMBuildStore(ctx->ac.builder, val, address);
 		} else {
 			LLVMTypeRef val_type = LLVMTypeOf(val);
-			if (LLVMGetTypeKind(LLVMTypeOf(val)) == LLVMFixedVectorTypeKind)
+			if (LLVMGetTypeKind(LLVMTypeOf(val)) == LLVMVectorTypeKind)
 				val_type = LLVMGetElementType(val_type);
 
 			LLVMTypeRef ptr_type = LLVMPointerType(val_type,
@@ -4978,7 +4978,7 @@ static void visit_deref(struct ac_nir_context *ctx,
 		LLVMTypeRef type = LLVMPointerType(pointee_type, address_space);
 
 		if (LLVMTypeOf(result) != type) {
-			if (LLVMGetTypeKind(LLVMTypeOf(result)) == LLVMFixedVectorTypeKind) {
+			if (LLVMGetTypeKind(LLVMTypeOf(result)) == LLVMVectorTypeKind) {
 				result = LLVMBuildBitCast(ctx->ac.builder, result,
 				                          type, "");
 			} else {
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
index 3f214f79b92..51416262df1 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -1173,7 +1173,7 @@ radv_fixup_vertex_input_fetches(struct radv_shader_context *ctx,
 	LLVMValueRef one = is_float ? ctx->ac.f32_1 : ctx->ac.i32_1;
 	LLVMValueRef chan[4];
 
-	if (LLVMGetTypeKind(LLVMTypeOf(value)) == LLVMFixedVectorTypeKind) {
+	if (LLVMGetTypeKind(LLVMTypeOf(value)) == LLVMVectorTypeKind) {
 		unsigned vec_size = LLVMGetVectorSize(LLVMTypeOf(value));
 
 		if (num_channels == 4 && num_channels == vec_size)
diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm.c b/src/gallium/drivers/radeonsi/si_shader_llvm.c
index b510b637788..63c9c033ab4 100644
--- a/src/gallium/drivers/radeonsi/si_shader_llvm.c
+++ b/src/gallium/drivers/radeonsi/si_shader_llvm.c
@@ -526,7 +526,7 @@ void si_build_wrapper_function(struct si_shader_context *ctx, LLVMValueRef *part
       if (LLVMGetTypeKind(type) == LLVMPointerTypeKind) {
          type = LLVMGetElementType(type);
 
-         if (LLVMGetTypeKind(type) == LLVMFixedVectorTypeKind) {
+         if (LLVMGetTypeKind(type) == LLVMVectorTypeKind) {
             if (LLVMGetVectorSize(type) == 4)
                arg_type = AC_ARG_CONST_DESC_PTR;
             else if (LLVMGetVectorSize(type) == 8)



More information about the mesa-commit mailing list