[llvm] [DirectX] Infrastructure to collect shader flags for each function (PR #112967)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 13:44:28 PST 2024


================
@@ -1,27 +1,49 @@
 ; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s
-; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC
 
 target triple = "dxil-pc-shadermodel6.7-library"
 
-; CHECK: ; Shader Flags Value: 0x00000044
-; CHECK: ; Note: shader requires additional functionality:
+; CHECK: ; Combined Shader Flags for Module
+; CHECK-NEXT: ; Shader Flags Value: 0x00000044
+; CHECK-NEXT: ;
+; CHECK-NEXT: ; Note: shader requires additional functionality:
 ; CHECK-NEXT: ;       Double-precision floating point
 ; CHECK-NEXT: ;       Double-precision extensions for 11.1
 ; CHECK-NEXT: ; Note: extra DXIL module flags:
-; CHECK-NEXT: {{^;$}}
-define double @div(double %a, double %b) #0 {
+; CHECK-NEXT: ;
+; CHECK-NEXT: ; Shader Flags for Module Functions
+; CHECK-NEXT: ; Function test_fdiv_double : 0x00000044
+; CHECK-NEXT: ;
+; CHECK-NEXT: ; Function test_uitofp_i64 : 0x00000044
+; CHECK-NEXT: ;
+; CHECK-NEXT: ; Function test_sitofp_i64 : 0x00000044
+; CHECK-NEXT: ;
+; CHECK-NEXT: ; Function test_fptoui_i32 : 0x00000044
+; CHECK-NEXT: ;
+; CHECK-NEXT: ; Function test_fptosi_i64 : 0x00000044
----------------
bogner wrote:

Might be easier to read/update this test if the checks for each function were by the function definition. I also think we can probably dispense of the `CHECK-NEXT` in that case and not bother checking the empty lines - if the checks are all by the function definitions it's obvious if we missed one.

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


More information about the llvm-commits mailing list