mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02:00
Revert "gallium/gallivm: fix compilation issues with llvm 11"
This reverts commite2a7436dd1. The corresponding LLVM changes were reverted. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2983 Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5087> (cherry picked from commit667126cc82)
This commit is contained in:
parent
b195f77730
commit
b5a7d4b68b
9 changed files with 14 additions and 21 deletions
|
|
@ -1408,7 +1408,7 @@
|
|||
"description": "Revert \"gallium/gallivm: fix compilation issues with llvm 11\"",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "e2a7436dd10df70ba14d18ab7cf8ad538f80e653"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ lp_build_half_to_float(struct gallivm_state *gallivm,
|
|||
{
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMTypeRef src_type = LLVMTypeOf(src);
|
||||
unsigned src_length = LLVMGetTypeKind(src_type) == LLVMFixedVectorTypeKind ?
|
||||
unsigned src_length = LLVMGetTypeKind(src_type) == LLVMVectorTypeKind ?
|
||||
LLVMGetVectorSize(src_type) : 1;
|
||||
|
||||
struct lp_type f32_type = lp_type_float_vec(32, 32 * src_length);
|
||||
|
|
@ -138,7 +138,7 @@ lp_build_float_to_half(struct gallivm_state *gallivm,
|
|||
{
|
||||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMTypeRef f32_vec_type = LLVMTypeOf(src);
|
||||
unsigned length = LLVMGetTypeKind(f32_vec_type) == LLVMFixedVectorTypeKind
|
||||
unsigned length = LLVMGetTypeKind(f32_vec_type) == LLVMVectorTypeKind
|
||||
? LLVMGetVectorSize(f32_vec_type) : 1;
|
||||
struct lp_type i32_type = lp_type_int_vec(32, 32 * length);
|
||||
struct lp_type i16_type = lp_type_int_vec(16, 16 * length);
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ lp_build_float_to_r11g11b10(struct gallivm_state *gallivm,
|
|||
LLVMValueRef dst, rcomp, bcomp, gcomp;
|
||||
struct lp_build_context i32_bld;
|
||||
LLVMTypeRef src_type = LLVMTypeOf(*src);
|
||||
unsigned src_length = LLVMGetTypeKind(src_type) == LLVMFixedVectorTypeKind ?
|
||||
unsigned src_length = LLVMGetTypeKind(src_type) == LLVMVectorTypeKind ?
|
||||
LLVMGetVectorSize(src_type) : 1;
|
||||
struct lp_type i32_type = lp_type_int_vec(32, 32 * src_length);
|
||||
|
||||
|
|
@ -406,7 +406,7 @@ lp_build_r11g11b10_to_float(struct gallivm_state *gallivm,
|
|||
LLVMValueRef *dst)
|
||||
{
|
||||
LLVMTypeRef src_type = LLVMTypeOf(src);
|
||||
unsigned src_length = LLVMGetTypeKind(src_type) == LLVMFixedVectorTypeKind ?
|
||||
unsigned src_length = LLVMGetTypeKind(src_type) == LLVMVectorTypeKind ?
|
||||
LLVMGetVectorSize(src_type) : 1;
|
||||
struct lp_type f32_type = lp_type_float_vec(32, 32 * src_length);
|
||||
|
||||
|
|
@ -464,7 +464,7 @@ lp_build_rgb9e5_to_float(struct gallivm_state *gallivm,
|
|||
LLVMBuilderRef builder = gallivm->builder;
|
||||
LLVMTypeRef src_type = LLVMTypeOf(src);
|
||||
LLVMValueRef shift, scale, bias, exp;
|
||||
unsigned src_length = LLVMGetTypeKind(src_type) == LLVMFixedVectorTypeKind ?
|
||||
unsigned src_length = LLVMGetTypeKind(src_type) == LLVMVectorTypeKind ?
|
||||
LLVMGetVectorSize(src_type) : 1;
|
||||
struct lp_type i32_type = lp_type_int_vec(32, 32 * src_length);
|
||||
struct lp_type u32_type = lp_type_uint_vec(32, 32 * src_length);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ lp_format_intrinsic(char *name,
|
|||
char c;
|
||||
|
||||
LLVMTypeKind kind = LLVMGetTypeKind(type);
|
||||
if (kind == LLVMFixedVectorTypeKind) {
|
||||
if (kind == LLVMVectorTypeKind) {
|
||||
length = LLVMGetVectorSize(type);
|
||||
type = LLVMGetElementType(type);
|
||||
kind = LLVMGetTypeKind(type);
|
||||
|
|
|
|||
|
|
@ -1035,7 +1035,7 @@ lp_build_pad_vector(struct gallivm_state *gallivm,
|
|||
|
||||
type = LLVMTypeOf(src);
|
||||
|
||||
if (LLVMGetTypeKind(type) != LLVMFixedVectorTypeKind) {
|
||||
if (LLVMGetTypeKind(type) != LLVMVectorTypeKind) {
|
||||
/* Can't use ShuffleVector on non-vector type */
|
||||
undef = LLVMGetUndef(LLVMVectorType(type, dst_length));
|
||||
return LLVMBuildInsertElement(gallivm->builder, undef, src, lp_build_const_int32(gallivm, 0), "");
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ lp_build_print_value(struct gallivm_state *gallivm,
|
|||
type_ref = LLVMTypeOf(value);
|
||||
type_kind = LLVMGetTypeKind(type_ref);
|
||||
|
||||
if (type_kind == LLVMFixedVectorTypeKind) {
|
||||
if (type_kind == LLVMVectorTypeKind) {
|
||||
length = LLVMGetVectorSize(type_ref);
|
||||
|
||||
type_ref = LLVMGetElementType(type_ref);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ lp_build_broadcast(struct gallivm_state *gallivm,
|
|||
{
|
||||
LLVMValueRef res;
|
||||
|
||||
if (LLVMGetTypeKind(vec_type) != LLVMFixedVectorTypeKind) {
|
||||
if (LLVMGetTypeKind(vec_type) != LLVMVectorTypeKind) {
|
||||
/* scalar */
|
||||
assert(vec_type == LLVMTypeOf(scalar));
|
||||
res = scalar;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ lp_check_vec_type(struct lp_type type, LLVMTypeRef vec_type)
|
|||
if (type.length == 1)
|
||||
return lp_check_elem_type(type, vec_type);
|
||||
|
||||
if(LLVMGetTypeKind(vec_type) != LLVMFixedVectorTypeKind)
|
||||
if(LLVMGetTypeKind(vec_type) != LLVMVectorTypeKind)
|
||||
return FALSE;
|
||||
|
||||
if(LLVMGetVectorSize(vec_type) != type.length)
|
||||
|
|
@ -259,7 +259,7 @@ lp_sizeof_llvm_type(LLVMTypeRef t)
|
|||
return 8 * sizeof(float);
|
||||
case LLVMDoubleTypeKind:
|
||||
return 8 * sizeof(double);
|
||||
case LLVMFixedVectorTypeKind:
|
||||
case LLVMVectorTypeKind:
|
||||
{
|
||||
LLVMTypeRef elem = LLVMGetElementType(t);
|
||||
unsigned len = LLVMGetVectorSize(t);
|
||||
|
|
@ -311,12 +311,8 @@ lp_typekind_name(LLVMTypeKind t)
|
|||
return "LLVMArrayTypeKind";
|
||||
case LLVMPointerTypeKind:
|
||||
return "LLVMPointerTypeKind";
|
||||
case LLVMFixedVectorTypeKind:
|
||||
#if LLVM_VERSION_MAJOR >= 11
|
||||
return "LLVMFixedVectorTypeKind";
|
||||
#else
|
||||
case LLVMVectorTypeKind:
|
||||
return "LLVMVectorTypeKind";
|
||||
#endif
|
||||
case LLVMMetadataTypeKind:
|
||||
return "LLVMMetadataTypeKind";
|
||||
default:
|
||||
|
|
@ -333,7 +329,7 @@ lp_dump_llvmtype(LLVMTypeRef t)
|
|||
{
|
||||
LLVMTypeKind k = LLVMGetTypeKind(t);
|
||||
|
||||
if (k == LLVMFixedVectorTypeKind) {
|
||||
if (k == LLVMVectorTypeKind) {
|
||||
LLVMTypeRef te = LLVMGetElementType(t);
|
||||
LLVMTypeKind ke = LLVMGetTypeKind(te);
|
||||
unsigned len = LLVMGetVectorSize(t);
|
||||
|
|
|
|||
|
|
@ -36,9 +36,6 @@
|
|||
#ifndef LP_BLD_TYPE_H
|
||||
#define LP_BLD_TYPE_H
|
||||
|
||||
#if LLVM_VERSION_MAJOR < 11
|
||||
#define LLVMFixedVectorTypeKind LLVMVectorTypeKind
|
||||
#endif
|
||||
|
||||
#include "util/format/u_format.h"
|
||||
#include "pipe/p_compiler.h"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue