[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

Jun Wang via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 16:45:55 PST 2024


================
@@ -167,6 +167,10 @@ def FeatureCuMode : SubtargetFeature<"cumode",
   "Enable CU wavefront execution mode"
 >;
 
+def FeaturePreciseMemory
----------------
jwanggit86 wrote:

A possible fix is to check `hasFlag` after calling `handleTargetFeaturesGroup`, and if the check is true, replace the string `"+amdgpu-precise-memory-op"` in the `Features` vector with `"+precise-memory"`, as follows:
```
  handleTargetFeaturesGroup(D, Triple, Args, Features,
                            options::OPT_m_amdgpu_Features_Group);

  if (Args.hasFlag(options::OPT_mamdgpu_precise_memory_op,
                   options::OPT_mno_amdgpu_precise_memory_op, false)) {
    for (auto It = Features.begin(); It != Features.end(); ++It) {
      if (*It == "+amdgpu-precise-memory-op")
        *It = StringRef("+precise-memory");
    }
```
@Pierre-vh Your thoughts?

https://github.com/llvm/llvm-project/pull/79236


More information about the cfe-commits mailing list