[clang] [HLSL] Enable -fconvergent-functions by default (PR #86571)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 09:58:27 PDT 2024


llvm-beanz wrote:

Hi @aniplcc, thank you for the PR.

We do require test cases for bug fixes and new features (see the [Developer Policy](https://llvm.org/docs/DeveloperPolicy.html#test-cases).

Because this general feature is already tested for OpenCL, we can make a really simple test for this. Something like this should be fine:

```hlsl
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.4-library -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s

void fn() {
};

// CHECK: define void @"?fn@@YAXXZ"() local_unnamed_addr #[[Attr:[0-9]+]]
// CHECK: attributes #[[Attr]] = { {{[^}]*}}convergent{{[^}]*}} }
```

Put that into a file `clang/test/CodeGenHLSL/convergent-functions.hlsl` and build the `check-clang` target to verify that it works.

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


More information about the cfe-commits mailing list