ac: set +auto-waitcnt-before-barrier when needed
authorMarek Olšák <marek.olsak@amd.com>
Thu, 14 Jun 2018 05:27:10 +0000 (01:27 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 29 Jun 2018 02:27:25 +0000 (22:27 -0400)
This removes useless s_waitcnt before barriers.
Only radeonsi uses this function.

src/amd/common/ac_llvm_util.c

index be2d92b4c0891ccd67648c377e71631e402462ad..99cc677edce6037d0eefc172faa570fa8d2914d1 100644 (file)
@@ -133,13 +133,15 @@ LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family,
        char features[256];
        const char *triple = (tm_options & AC_TM_SUPPORTS_SPILL) ? "amdgcn-mesa-mesa3d" : "amdgcn--";
        LLVMTargetRef target = ac_get_llvm_target(triple);
+       bool barrier_does_waitcnt = true; /* TODO: not for Vega20 */
 
        snprintf(features, sizeof(features),
-                "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s%s",
+                "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s%s%s%s",
                 tm_options & AC_TM_SISCHED ? ",+si-scheduler" : "",
                 tm_options & AC_TM_FORCE_ENABLE_XNACK ? ",+xnack" : "",
                 tm_options & AC_TM_FORCE_DISABLE_XNACK ? ",-xnack" : "",
-                tm_options & AC_TM_PROMOTE_ALLOCA_TO_SCRATCH ? ",-promote-alloca" : "");
+                tm_options & AC_TM_PROMOTE_ALLOCA_TO_SCRATCH ? ",-promote-alloca" : "",
+                barrier_does_waitcnt ? ",+auto-waitcnt-before-barrier" : "");
        
        LLVMTargetMachineRef tm = LLVMCreateTargetMachine(
                                     target,