diff options
author | Marek Olšák <[email protected]> | 2016-06-10 22:43:29 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-06-21 13:52:05 +0200 |
commit | b16d21270f9ea0173ebe059a3e82a4b451a80596 (patch) | |
tree | 45f9a2b34c48851bf194f42ca8d7b3b98007fb02 /src/gallium/drivers/radeonsi/si_shader.c | |
parent | 70a25478fec653673569f5fb81170207d68f5112 (diff) |
radeonsi: add a debug flag for unsafe math LLVM optimizations
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 6dc4985f94f..bba6a55df95 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -5255,6 +5255,22 @@ static void si_create_function(struct si_shader_context *ctx, else LLVMAddAttribute(P, LLVMInRegAttribute); } + + if (ctx->screen->b.debug_flags & DBG_UNSAFE_MATH) { + /* These were copied from some LLVM test. */ + LLVMAddTargetDependentFunctionAttr(ctx->radeon_bld.main_fn, + "less-precise-fpmad", + "true"); + LLVMAddTargetDependentFunctionAttr(ctx->radeon_bld.main_fn, + "no-infs-fp-math", + "true"); + LLVMAddTargetDependentFunctionAttr(ctx->radeon_bld.main_fn, + "no-nans-fp-math", + "true"); + LLVMAddTargetDependentFunctionAttr(ctx->radeon_bld.main_fn, + "unsafe-fp-math", + "true"); + } } static void create_meta_data(struct si_shader_context *ctx) |