[01/11] ac: fix glc parameter use for new LLVM 8 typed buffer intrinsics

Submitted by Samuel Pitoiset on March 12, 2019, 4:19 p.m.

Details

Message ID 20190312161947.24880-2-samuel.pitoiset@gmail.com
State New
Headers show
Series "ac: use LLVM 8 buffer intrinsics everywhere" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset March 12, 2019, 4:19 p.m.
ac_build_llvm8_tbuffer_load() expects a boolean for glc.

Fixes: 2cf5433b99f ("ac: use new LLVM 8 intrinsic when loading 16-bit values")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/common/ac_llvm_build.c  | 4 ++--
 src/amd/common/ac_llvm_build.h  | 2 +-
 src/amd/common/ac_nir_to_llvm.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index bc64f0bb7e3..88ea289a121 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -1376,7 +1376,7 @@  ac_build_tbuffer_load_short(struct ac_llvm_context *ctx,
 			    LLVMValueRef voffset,
 				LLVMValueRef soffset,
 				LLVMValueRef immoffset,
-				LLVMValueRef glc)
+				bool glc)
 {
 	unsigned dfmt = V_008F0C_BUF_DATA_FORMAT_16;
 	unsigned nfmt = V_008F0C_BUF_NUM_FORMAT_UINT;
@@ -1399,7 +1399,7 @@  ac_build_tbuffer_load_short(struct ac_llvm_context *ctx,
 					immoffset,
 					LLVMConstInt(ctx->i32, dfmt, false),
 					LLVMConstInt(ctx->i32, nfmt, false),
-					glc,
+					LLVMConstInt(ctx->i32, glc, false),
 					ctx->i1false,
 		};
 		res = ac_build_intrinsic(ctx, name, type, params, 9, 0);
diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h
index fd5c4295abf..0fb3eb52f05 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -304,7 +304,7 @@  ac_build_tbuffer_load_short(struct ac_llvm_context *ctx,
 			    LLVMValueRef voffset,
 				LLVMValueRef soffset,
 				LLVMValueRef immoffset,
-				LLVMValueRef glc);
+				bool glc);
 
 LLVMValueRef
 ac_build_llvm8_tbuffer_load(struct ac_llvm_context *ctx,
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 5fb5c8da609..a7b3fdf64aa 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1716,7 +1716,7 @@  static LLVMValueRef visit_load_buffer(struct ac_nir_context *ctx,
 							  offset,
 							  ctx->ac.i32_0,
 							  immoffset,
-							  glc);
+							  cache_policy & ac_glc);
 		} else {
 			const char *load_name;
 			LLVMTypeRef data_type;
@@ -1787,7 +1787,7 @@  static LLVMValueRef visit_load_ubo_buffer(struct ac_nir_context *ctx,
 								 offset,
 								 ctx->ac.i32_0,
 								 LLVMConstInt(ctx->ac.i32, 2 * i, 0),
-								 ctx->ac.i1false);
+								 false);
 		}
 		ret = ac_build_gather_values(&ctx->ac, results, num_components);
 	} else {