[clang] [llvm] [HLSL] Implement the `degrees` intrinsic (PR #111209)

Greg Roth via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 12:22:53 PDT 2024


================
@@ -0,0 +1,54 @@
+; RUN: opt -S -dxil-intrinsic-expansion -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+
+; Make sure dxil op function calls for degrees are expanded and lowered as fmul for float and half.
+
+define noundef half @degrees_half(half noundef %a) {
+; CHECK-LABEL: define noundef half @degrees_half(
+; CHECK-SAME: half noundef [[A:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
----------------
pow2clk wrote:

I see a similar issue with the existing tests that this may have used as a template, but this check and the corresponding checks below do nothing except accept a line that can really only be `entry:`. It accepts anything ending in `:` and saves it to a variable that is never used. I wonder if perhaps it was the result of an overzealous search and replace at one point. 
```suggestion
; CHECK-NEXT:  entry:
```

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


More information about the cfe-commits mailing list