On 01/06/2018 12:12 PM, Marek Olšák wrote:
From: Marek Olšák <marek.ol...@amd.com>
---
src/amd/common/ac_llvm_build.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 164f310..ed00d20 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -775,25 +775,28 @@ ac_build_indexed_store(struct ac_llvm_context *ctx,
* dynamically uniform (i.e. load to an SGPR)
* \param invariant Whether the load is invariant (no other opcodes affect it)
*/
static LLVMValueRef
ac_build_load_custom(struct ac_llvm_context *ctx, LLVMValueRef base_ptr,
LLVMValueRef index, bool uniform, bool invariant)
{
LLVMValueRef pointer, result;
pointer = ac_build_gep0(ctx, base_ptr, index);
- if (uniform)
+ /* This will be removed by InstCombine if index == 0. */
+ if (HAVE_LLVM < 0x0600 && uniform)
IMHO, it would be better to add more explanations here.
Also, I would like to test 11, so for now 12-14 are:
Reviewed-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
LLVMSetMetadata(pointer, ctx->uniform_md_kind, ctx->empty_md);
result = LLVMBuildLoad(ctx->builder, pointer, "");
if (invariant)
LLVMSetMetadata(result, ctx->invariant_load_md_kind,
ctx->empty_md);
+ if (HAVE_LLVM >= 0x0600 && uniform)
+ LLVMSetMetadata(result, ctx->uniform_md_kind, ctx->empty_md);
return result;
}
LLVMValueRef ac_build_load(struct ac_llvm_context *ctx, LLVMValueRef base_ptr,
LLVMValueRef index)
{
return ac_build_load_custom(ctx, base_ptr, index, false, false);
}
LLVMValueRef ac_build_load_invariant(struct ac_llvm_context *ctx,
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev