gallivm: add lp_create_builder with an unsafe_fpmath option
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
171e349782
commit
41d20d4920
|
@ -733,3 +733,17 @@ lp_is_function(LLVMValueRef v)
|
|||
return llvm::isa<llvm::Function>(llvm::unwrap(v));
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" LLVMBuilderRef
|
||||
lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath)
|
||||
{
|
||||
LLVMBuilderRef builder = LLVMCreateBuilderInContext(ctx);
|
||||
|
||||
if (unsafe_fpmath) {
|
||||
llvm::FastMathFlags flags;
|
||||
flags.setUnsafeAlgebra();
|
||||
llvm::unwrap(builder)->setFastMathFlags(flags);
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
|
|
@ -82,6 +82,9 @@ lp_get_called_value(LLVMValueRef call);
|
|||
extern bool
|
||||
lp_is_function(LLVMValueRef v);
|
||||
|
||||
extern LLVMBuilderRef
|
||||
lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue