ac/llvm: don't set "readnone" on non-memory intrinsics
It's illegal and LLVM always knows which intrinsics don't read memory. This started failing IR validation with LLVM 16. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20146>
This commit is contained in:
@@ -175,8 +175,7 @@ create_function(struct radv_shader_context *ctx, gl_shader_stage stage, bool has
|
||||
ctx->max_workgroup_size, ctx->options);
|
||||
|
||||
ctx->ring_offsets = ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.implicit.buffer.ptr",
|
||||
LLVMPointerType(ctx->ac.i8, AC_ADDR_SPACE_CONST), NULL, 0,
|
||||
AC_FUNC_ATTR_READNONE);
|
||||
LLVMPointerType(ctx->ac.i8, AC_ADDR_SPACE_CONST), NULL, 0, 0);
|
||||
ctx->ring_offsets = LLVMBuildBitCast(ctx->ac.builder, ctx->ring_offsets,
|
||||
ac_array_in_const_addr_space(ctx->ac.v4i32), "");
|
||||
|
||||
@@ -657,7 +656,7 @@ si_llvm_init_export_args(struct radv_shader_context *ctx, LLVMValueRef *values,
|
||||
LLVMValueRef class_args[2] = {values[i],
|
||||
LLVMConstInt(ctx->ac.i32, S_NAN | Q_NAN, false)};
|
||||
LLVMValueRef isnan = ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.class.f32", ctx->ac.i1,
|
||||
class_args, 2, AC_FUNC_ATTR_READNONE);
|
||||
class_args, 2, 0);
|
||||
values[i] = LLVMBuildSelect(ctx->ac.builder, isnan, ctx->ac.f32_0, values[i], "");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user