brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.6 KiB · 8dee842 Raw
169 lines · plain
1; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s2 3target triple = "dxil-pc-shadermodel6.7-library"4 5; CHECK: ; Combined Shader Flags for Module6; CHECK-NEXT: ; Shader Flags Value: 0x001000447; CHECK-NEXT: ;8; CHECK-NEXT: ; Note: shader requires additional functionality:9; CHECK-NEXT: ;       Double-precision floating point10; CHECK-NEXT: ;       Double-precision extensions for 11.111; CHECK-NEXT: ;       64-Bit integer12; CHECK-NEXT: ; Note: extra DXIL module flags:13; CHECK-NEXT: ;14; CHECK-NEXT: ; Shader Flags for Module Functions15 16; Call Graph of test source17; main        -> [get_fptoui_flag, get_sitofp_fdiv_flag]18; get_fptoui_flag  -> [get_sitofp_uitofp_flag, call_get_uitofp_flag]19; get_sitofp_uitofp_flag  -> [call_get_fptoui_flag, call_get_sitofp_flag]20; call_get_fptoui_flag  -> [get_fptoui_flag]21; get_sitofp_fdiv_flag -> [get_no_flags, get_all_doubles_flags]22; get_all_doubles_flags -> [call_get_sitofp_fdiv_flag]23; call_get_sitofp_fdiv_flag  -> [get_sitofp_fdiv_flag]24; call_get_sitofp_flag  -> [get_sitofp_flag]25; call_get_uitofp_flag  -> [get_uitofp_flag]26; get_sitofp_flag  -> []27; get_uitofp_flag  -> []28; get_no_flags  -> []29;30; Strongly Connected Component in the CG31;  [get_fptoui_flag, get_sitofp_uitofp_flag, call_get_fptoui_flag]32;  [get_sitofp_fdiv_flag, get_all_doubles_flags, call_get_sitofp_fdiv_flag]33 34;35; CHECK: ; Function get_sitofp_flag  : 0x0000004436define double @get_sitofp_flag(i32 noundef %0) local_unnamed_addr #0 {37  %2 = sitofp i32 %0 to double38  ret double %239}40 41; CHECK: ; Function call_get_sitofp_flag : 0x0000004442define double @call_get_sitofp_flag(i32 noundef %0) local_unnamed_addr #0 {43  %2 = tail call double @get_sitofp_flag(i32 noundef %0)44  ret double %245}46 47; CHECK: ; Function get_uitofp_flag : 0x0000004448define double @get_uitofp_flag(i32 noundef %0) local_unnamed_addr #0 {49  %2 = uitofp i32 %0 to double50  ret double %251}52 53; CHECK: ; Function call_get_uitofp_flag : 0x0000004454define double @call_get_uitofp_flag(i32 noundef %0) local_unnamed_addr #0 {55  %2 = tail call double @get_uitofp_flag(i32 noundef %0)56  ret double %257}58 59; CHECK: ; Function call_get_fptoui_flag : 0x0010004460define double @call_get_fptoui_flag(double noundef %0) local_unnamed_addr #0 {61  %2 = tail call double @get_fptoui_flag(double noundef %0)62  ret double %263}64 65; CHECK: ; Function get_fptoui_flag : 0x0010004466define double @get_fptoui_flag(double noundef %0) local_unnamed_addr #0 {67  %2 = fcmp ugt double %0, 5.000000e+0068  br i1 %2, label %6, label %369 703:                                                ; preds = %171  %4 = fptoui double %0 to i6472  %5 = tail call double @get_sitofp_uitofp_flag(i64 noundef %4)73  br label %974 756:                                                ; preds = %176  %7 = fptoui double %0 to i3277  %8 = tail call double @call_get_uitofp_flag(i32 noundef %7)78  br label %979 809:                                                ; preds = %6, %381  %10 = phi double [ %5, %3 ], [ %8, %6 ]82  ret double %1083}84 85; CHECK: ; Function get_sitofp_uitofp_flag : 0x0010004486define double @get_sitofp_uitofp_flag(i64 noundef %0) local_unnamed_addr #0 {87  %2 = icmp ult i64 %0, 688  br i1 %2, label %3, label %789 903:                                                ; preds = %191  %4 = add nuw nsw i64 %0, 192  %5 = uitofp i64 %4 to double93  %6 = tail call double @call_get_fptoui_flag(double noundef %5)94  br label %1095 967:                                                ; preds = %197  %8 = trunc i64 %0 to i3298  %9 = tail call double @call_get_sitofp_flag(i32 noundef %8)99  br label %10100 10110:                                               ; preds = %7, %3102  %11 = phi double [ %6, %3 ], [ %9, %7 ]103  ret double %11104}105 106; CHECK: ; Function get_no_flags : 0x00000000107define i32 @get_no_flags(i32 noundef %0) local_unnamed_addr #0 {108  %2 = mul nsw i32 %0, %0109  ret i32 %2110}111 112; CHECK: ; Function call_get_sitofp_fdiv_flag : 0x00000044113define i32 @call_get_sitofp_fdiv_flag(i32 noundef %0) local_unnamed_addr #0 {114  %2 = icmp eq i32 %0, 0115  br i1 %2, label %5, label %3116 1173:                                                ; preds = %1118  %4 = mul nsw i32 %0, %0119  br label %7120 1215:                                                ; preds = %1122  %6 = tail call double @get_sitofp_fdiv_flag(i32 noundef 0)123  br label %7124 1257:                                                ; preds = %5, %3126  %8 = phi i32 [ %4, %3 ], [ 0, %5 ]127  ret i32 %8128}129 130; CHECK: ; Function get_sitofp_fdiv_flag : 0x00000044131define double @get_sitofp_fdiv_flag(i32 noundef %0) local_unnamed_addr #0 {132  %2 = icmp sgt i32 %0, 5133  br i1 %2, label %3, label %6134 1353:                                                ; preds = %1136  %4 = tail call i32 @get_no_flags(i32 noundef %0)137  %5 = sitofp i32 %4 to double138  br label %9139 1406:                                                ; preds = %1141  %7 = tail call double @get_all_doubles_flags(i32 noundef %0)142  %8 = fdiv double %7, 3.000000e+00143  br label %9144 1459:                                                ; preds = %6, %3146  %10 = phi double [ %5, %3 ], [ %8, %6 ]147  ret double %10148}149 150; CHECK: ; Function get_all_doubles_flags : 0x00000044151define double @get_all_doubles_flags(i32 noundef %0) local_unnamed_addr #0 {152  %2 = tail call i32 @call_get_sitofp_fdiv_flag(i32 noundef %0)153  %3 = icmp eq i32 %2, 0154  %4 = select i1 %3, double 1.000000e+01, double 1.000000e+02155  ret double %4156}157 158; CHECK: ; Function main : 0x00100044159define i32 @main() local_unnamed_addr #0 {160  %1 = tail call double @get_fptoui_flag(double noundef 1.000000e+00)161  %2 = tail call double @get_sitofp_fdiv_flag(i32 noundef 4)162  %3 = fadd double %1, %2163  %4 = fcmp ogt double %3, 0.000000e+00164  %5 = zext i1 %4 to i32165  ret i32 %5166}167 168attributes #0 = { convergent norecurse nounwind "hlsl.export"}169