Mesa (master): ac/llvm: create features list using snprintf.

Dave Airlie airlied at kemper.freedesktop.org
Thu Jul 6 22:08:01 UTC 2017


Module: Mesa
Branch: master
Commit: 01e958d63141b21fbb18f5e32fa4a7f76f59ba91
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=01e958d63141b21fbb18f5e32fa4a7f76f59ba91

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Jul  6 03:00:02 2017 +0100

ac/llvm: create features list using snprintf.

Just more moving code around before adding things to it.

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/common/ac_llvm_util.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c
index 088f01f7ad..4f32d4bb97 100644
--- a/src/amd/common/ac_llvm_util.c
+++ b/src/amd/common/ac_llvm_util.c
@@ -121,14 +121,17 @@ static const char *ac_get_llvm_processor_name(enum radeon_family family)
 LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options)
 {
 	assert(family >= CHIP_TAHITI);
-
+	char features[256];
 	const char *triple = (tm_options & AC_TM_SUPPORTS_SPILL) ? "amdgcn-mesa-mesa3d" : "amdgcn--";
 	LLVMTargetRef target = ac_get_llvm_target(triple);
+
+	snprintf(features, sizeof(features),
+		 "+DumpCode,+vgpr-spilling,-fp32-denormals,-xnack");
 	LLVMTargetMachineRef tm = LLVMCreateTargetMachine(
 	                             target,
 	                             triple,
 	                             ac_get_llvm_processor_name(family),
-	                             "+DumpCode,+vgpr-spilling,-fp32-denormals,-xnack",
+				     features,
 	                             LLVMCodeGenLevelDefault,
 	                             LLVMRelocDefault,
 	                             LLVMCodeModelDefault);




More information about the mesa-commit mailing list