diff options
author | Marek Olšák <[email protected]> | 2017-02-24 17:16:28 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-03-03 15:29:30 +0100 |
commit | e729dc7c46bc903f40c933d40ce507d6cd23bf83 (patch) | |
tree | d617f3a7a63bde1829733e8c50e843f4eaf7659e /src/amd/common/ac_llvm_build.c | |
parent | 25c7969a5a09db6c6afcdde348f92ea698393e32 (diff) |
radeonsi: set readnone on reads from read-only memory
Diffstat (limited to 'src/amd/common/ac_llvm_build.c')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 42965b6a544..f0ab9cb1367 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -619,7 +619,8 @@ ac_build_buffer_load(struct ac_llvm_context *ctx, LLVMValueRef soffset, unsigned inst_offset, unsigned glc, - unsigned slc) + unsigned slc, + bool readonly_memory) { unsigned func = CLAMP(num_channels, 1, 3) - 1; @@ -651,7 +652,13 @@ ac_build_buffer_load(struct ac_llvm_context *ctx, type_names[func]); return ac_emit_llvm_intrinsic(ctx, name, types[func], args, - ARRAY_SIZE(args), AC_FUNC_ATTR_READONLY); + ARRAY_SIZE(args), + /* READNONE means writes can't + * affect it, while READONLY means + * that writes can affect it. */ + readonly_memory ? + AC_FUNC_ATTR_READNONE : + AC_FUNC_ATTR_READONLY); } else { LLVMValueRef args[] = { LLVMBuildBitCast(ctx->builder, rsrc, ctx->v16i8, ""), |