[llvm] [Attributor][FIX] Replace AANoFPClass MBEC propagation (PR #91030)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 04:49:21 PDT 2024


================
@@ -0,0 +1,357 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes
+; RUN: opt -passes=attributor -S < %s | FileCheck %s --check-prefixes=CHECK
+
+; Verify we do not derive 'nofpclass(inf zero sub norm)' for the argument __x.
+; See https://github.com/llvm/llvm-project/issues/78507
+
+source_filename = "llvm-link"
+target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
+target triple = "amdgcn-amd-amdhsa"
+
+; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
+declare double @llvm.ldexp.f64.i32(double, i32) #0
+
+; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
+declare double @llvm.amdgcn.fract.f64(double) #0
+
+; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
+declare double @llvm.fma.f64(double, double, double) #0
+
+; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
+declare double @llvm.fabs.f64(double) #0
+
+; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
+declare double @llvm.rint.f64(double) #0
+
+; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
+declare double @llvm.amdgcn.trig.preop.f64(double, i32) #0
+
+; Function Attrs: alwaysinline mustprogress nofree norecurse nosync nounwind willreturn memory(none)
+define hidden double @sin(double noundef %__x) local_unnamed_addr #1 {
+; CHECK: Function Attrs: alwaysinline mustprogress nofree norecurse nosync nounwind willreturn memory(none)
+; CHECK-LABEL: define {{[^@]+}}@sin
+; CHECK-SAME: (double noundef [[__X:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TMP0:%.*]] = tail call double @llvm.fabs.f64(double noundef [[__X]])
+; CHECK-NEXT:    [[TMP1:%.*]] = fcmp olt double [[TMP0]], 0x41D0000000000000
+; CHECK-NEXT:    br i1 [[TMP1]], label [[TMP2:%.*]], label [[TMP21:%.*]]
+; CHECK:       2:
+; CHECK-NEXT:    [[TMP3:%.*]] = fmul double [[TMP0]], 0x3FE45F306DC9C883
+; CHECK-NEXT:    [[TMP4:%.*]] = tail call double @llvm.rint.f64(double noundef [[TMP3]])
+; CHECK-NEXT:    [[TMP5:%.*]] = tail call double @llvm.fma.f64(double noundef [[TMP4]], double noundef 0xBFF921FB54442D18, double noundef [[TMP0]])
+; CHECK-NEXT:    [[TMP6:%.*]] = tail call double @llvm.fma.f64(double noundef [[TMP4]], double noundef 0xBC91A62633145C00, double noundef [[TMP5]])
+; CHECK-NEXT:    [[TMP7:%.*]] = fmul double [[TMP4]], 0x3C91A62633145C00
+; CHECK-NEXT:    [[TMP8:%.*]] = fneg double [[TMP7]]
+; CHECK-NEXT:    [[TMP9:%.*]] = tail call double @llvm.fma.f64(double noundef [[TMP4]], double noundef 0x3C91A62633145C00, double noundef [[TMP8]])
+; CHECK-NEXT:    [[TMP10:%.*]] = fsub double [[TMP5]], [[TMP7]]
+; CHECK-NEXT:    [[TMP11:%.*]] = fsub double [[TMP5]], [[TMP10]]
+; CHECK-NEXT:    [[TMP12:%.*]] = fsub double [[TMP11]], [[TMP7]]
+; CHECK-NEXT:    [[TMP13:%.*]] = fsub double [[TMP10]], [[TMP6]]
+; CHECK-NEXT:    [[TMP14:%.*]] = fadd double [[TMP13]], [[TMP12]]
+; CHECK-NEXT:    [[TMP15:%.*]] = fsub double [[TMP14]], [[TMP9]]
+; CHECK-NEXT:    [[TMP16:%.*]] = tail call double @llvm.fma.f64(double noundef [[TMP4]], double noundef 0xB97B839A252049C0, double [[TMP15]])
+; CHECK-NEXT:    [[TMP17:%.*]] = fadd double [[TMP6]], [[TMP16]]
+; CHECK-NEXT:    [[TMP18:%.*]] = fsub double [[TMP17]], [[TMP6]]
+; CHECK-NEXT:    [[TMP19:%.*]] = fsub double [[TMP16]], [[TMP18]]
+; CHECK-NEXT:    [[TMP20:%.*]] = fptosi double [[TMP4]] to i32
+; CHECK-NEXT:    br label [[__OCML_SIN_F64_EXIT:%.*]]
+; CHECK:       21:
+; CHECK-NEXT:    [[TMP22:%.*]] = tail call double @llvm.amdgcn.trig.preop.f64(double noundef [[TMP0]], i32 noundef 0)
+; CHECK-NEXT:    [[TMP23:%.*]] = tail call double @llvm.amdgcn.trig.preop.f64(double noundef [[TMP0]], i32 noundef 1)
+; CHECK-NEXT:    [[TMP24:%.*]] = tail call double @llvm.amdgcn.trig.preop.f64(double noundef [[TMP0]], i32 noundef 2)
+; CHECK-NEXT:    [[TMP25:%.*]] = fcmp oge double [[TMP0]], 0x7B00000000000000
+; CHECK-NEXT:    [[TMP26:%.*]] = tail call double @llvm.ldexp.f64.i32(double noundef [[TMP0]], i32 noundef -128)
+; CHECK-NEXT:    [[TMP27:%.*]] = select i1 [[TMP25]], double [[TMP26]], double [[TMP0]]
+; CHECK-NEXT:    [[TMP28:%.*]] = fmul double [[TMP24]], [[TMP27]]
+; CHECK-NEXT:    [[TMP29:%.*]] = fneg double [[TMP28]]
+; CHECK-NEXT:    [[TMP30:%.*]] = tail call double @llvm.fma.f64(double [[TMP24]], double noundef [[TMP27]], double [[TMP29]])
+; CHECK-NEXT:    [[TMP31:%.*]] = fmul double [[TMP23]], [[TMP27]]
+; CHECK-NEXT:    [[TMP32:%.*]] = fneg double [[TMP31]]
+; CHECK-NEXT:    [[TMP33:%.*]] = tail call double @llvm.fma.f64(double [[TMP23]], double noundef [[TMP27]], double [[TMP32]])
+; CHECK-NEXT:    [[TMP34:%.*]] = fmul double [[TMP22]], [[TMP27]]
+; CHECK-NEXT:    [[TMP35:%.*]] = fneg double [[TMP34]]
+; CHECK-NEXT:    [[TMP36:%.*]] = tail call double @llvm.fma.f64(double [[TMP22]], double noundef [[TMP27]], double [[TMP35]])
+; CHECK-NEXT:    [[TMP37:%.*]] = fadd double [[TMP31]], [[TMP36]]
+; CHECK-NEXT:    [[TMP38:%.*]] = fsub double [[TMP37]], [[TMP31]]
+; CHECK-NEXT:    [[TMP39:%.*]] = fsub double [[TMP37]], [[TMP38]]
+; CHECK-NEXT:    [[TMP40:%.*]] = fsub double [[TMP36]], [[TMP38]]
+; CHECK-NEXT:    [[TMP41:%.*]] = fsub double [[TMP31]], [[TMP39]]
+; CHECK-NEXT:    [[TMP42:%.*]] = fadd double [[TMP40]], [[TMP41]]
+; CHECK-NEXT:    [[TMP43:%.*]] = fadd double [[TMP28]], [[TMP33]]
+; CHECK-NEXT:    [[TMP44:%.*]] = fsub double [[TMP43]], [[TMP28]]
+; CHECK-NEXT:    [[TMP45:%.*]] = fsub double [[TMP43]], [[TMP44]]
+; CHECK-NEXT:    [[TMP46:%.*]] = fsub double [[TMP33]], [[TMP44]]
+; CHECK-NEXT:    [[TMP47:%.*]] = fsub double [[TMP28]], [[TMP45]]
+; CHECK-NEXT:    [[TMP48:%.*]] = fadd double [[TMP46]], [[TMP47]]
+; CHECK-NEXT:    [[TMP49:%.*]] = fadd double [[TMP43]], [[TMP42]]
+; CHECK-NEXT:    [[TMP50:%.*]] = fsub double [[TMP49]], [[TMP43]]
+; CHECK-NEXT:    [[TMP51:%.*]] = fsub double [[TMP49]], [[TMP50]]
+; CHECK-NEXT:    [[TMP52:%.*]] = fsub double [[TMP42]], [[TMP50]]
+; CHECK-NEXT:    [[TMP53:%.*]] = fsub double [[TMP43]], [[TMP51]]
+; CHECK-NEXT:    [[TMP54:%.*]] = fadd double [[TMP52]], [[TMP53]]
+; CHECK-NEXT:    [[TMP55:%.*]] = fadd double [[TMP48]], [[TMP54]]
+; CHECK-NEXT:    [[TMP56:%.*]] = fadd double [[TMP30]], [[TMP55]]
+; CHECK-NEXT:    [[TMP57:%.*]] = fadd double [[TMP34]], [[TMP37]]
+; CHECK-NEXT:    [[TMP58:%.*]] = fsub double [[TMP57]], [[TMP34]]
+; CHECK-NEXT:    [[TMP59:%.*]] = fsub double [[TMP37]], [[TMP58]]
+; CHECK-NEXT:    [[TMP60:%.*]] = fadd double [[TMP59]], [[TMP49]]
+; CHECK-NEXT:    [[TMP61:%.*]] = fsub double [[TMP60]], [[TMP59]]
+; CHECK-NEXT:    [[TMP62:%.*]] = fsub double [[TMP49]], [[TMP61]]
+; CHECK-NEXT:    [[TMP63:%.*]] = fadd double [[TMP62]], [[TMP56]]
+; CHECK-NEXT:    [[TMP64:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[TMP57]], i32 noundef -2)
+; CHECK-NEXT:    [[TMP65:%.*]] = tail call double @llvm.amdgcn.fract.f64(double [[TMP64]])
+; CHECK-NEXT:    [[TMP66:%.*]] = tail call double @llvm.fabs.f64(double [[TMP64]]) #[[ATTR2:[0-9]+]]
+; CHECK-NEXT:    [[TMP67:%.*]] = fcmp oeq double [[TMP66]], 0x7FF0000000000000
+; CHECK-NEXT:    [[TMP68:%.*]] = select i1 [[TMP67]], double 0.000000e+00, double [[TMP65]]
+; CHECK-NEXT:    [[TMP69:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[TMP68]], i32 noundef 2)
+; CHECK-NEXT:    [[TMP70:%.*]] = fadd double [[TMP69]], [[TMP60]]
+; CHECK-NEXT:    [[TMP71:%.*]] = fcmp olt double [[TMP70]], 0.000000e+00
+; CHECK-NEXT:    [[TMP72:%.*]] = select i1 [[TMP71]], double 4.000000e+00, double 0.000000e+00
+; CHECK-NEXT:    [[TMP73:%.*]] = fadd double [[TMP69]], [[TMP72]]
+; CHECK-NEXT:    [[TMP74:%.*]] = fadd double [[TMP60]], [[TMP73]]
+; CHECK-NEXT:    [[TMP75:%.*]] = fptosi double [[TMP74]] to i32
+; CHECK-NEXT:    [[TMP76:%.*]] = sitofp i32 [[TMP75]] to double
+; CHECK-NEXT:    [[TMP77:%.*]] = fsub double [[TMP73]], [[TMP76]]
+; CHECK-NEXT:    [[TMP78:%.*]] = fadd double [[TMP60]], [[TMP77]]
+; CHECK-NEXT:    [[TMP79:%.*]] = fsub double [[TMP78]], [[TMP77]]
+; CHECK-NEXT:    [[TMP80:%.*]] = fsub double [[TMP60]], [[TMP79]]
+; CHECK-NEXT:    [[TMP81:%.*]] = fadd double [[TMP63]], [[TMP80]]
+; CHECK-NEXT:    [[TMP82:%.*]] = fcmp oge double [[TMP78]], 5.000000e-01
+; CHECK-NEXT:    [[TMP83:%.*]] = zext i1 [[TMP82]] to i32
+; CHECK-NEXT:    [[TMP84:%.*]] = add nsw i32 [[TMP83]], [[TMP75]]
+; CHECK-NEXT:    [[TMP85:%.*]] = select i1 [[TMP82]], double 1.000000e+00, double 0.000000e+00
+; CHECK-NEXT:    [[TMP86:%.*]] = fsub double [[TMP78]], [[TMP85]]
+; CHECK-NEXT:    [[TMP87:%.*]] = fadd double [[TMP86]], [[TMP81]]
+; CHECK-NEXT:    [[TMP88:%.*]] = fsub double [[TMP87]], [[TMP86]]
+; CHECK-NEXT:    [[TMP89:%.*]] = fsub double [[TMP81]], [[TMP88]]
+; CHECK-NEXT:    [[TMP90:%.*]] = fmul double [[TMP87]], 0x3FF921FB54442D18
+; CHECK-NEXT:    [[TMP91:%.*]] = fneg double [[TMP90]]
+; CHECK-NEXT:    [[TMP92:%.*]] = tail call double @llvm.fma.f64(double [[TMP87]], double noundef 0x3FF921FB54442D18, double [[TMP91]])
+; CHECK-NEXT:    [[TMP93:%.*]] = tail call double @llvm.fma.f64(double [[TMP87]], double noundef 0x3C91A62633145C07, double [[TMP92]])
+; CHECK-NEXT:    [[TMP94:%.*]] = tail call double @llvm.fma.f64(double [[TMP89]], double noundef 0x3FF921FB54442D18, double [[TMP93]])
+; CHECK-NEXT:    [[TMP95:%.*]] = fadd double [[TMP90]], [[TMP94]]
+; CHECK-NEXT:    [[TMP96:%.*]] = fsub double [[TMP95]], [[TMP90]]
+; CHECK-NEXT:    [[TMP97:%.*]] = fsub double [[TMP94]], [[TMP96]]
+; CHECK-NEXT:    br label [[__OCML_SIN_F64_EXIT]]
+; CHECK:       __ocml_sin_f64.exit:
+; CHECK-NEXT:    [[DOTPN5_I_I:%.*]] = phi double [ [[TMP19]], [[TMP2]] ], [ [[TMP97]], [[TMP21]] ]
+; CHECK-NEXT:    [[DOTPN3_I_I:%.*]] = phi double [ [[TMP17]], [[TMP2]] ], [ [[TMP95]], [[TMP21]] ]
+; CHECK-NEXT:    [[DOTPN1_IN_I_I:%.*]] = phi i32 [ [[TMP20]], [[TMP2]] ], [ [[TMP84]], [[TMP21]] ]
+; CHECK-NEXT:    [[TMP98:%.*]] = fmul double [[DOTPN3_I_I]], [[DOTPN3_I_I]]
+; CHECK-NEXT:    [[TMP99:%.*]] = fmul double [[TMP98]], 5.000000e-01
+; CHECK-NEXT:    [[TMP100:%.*]] = fsub double 1.000000e+00, [[TMP99]]
+; CHECK-NEXT:    [[TMP101:%.*]] = fsub double 1.000000e+00, [[TMP100]]
+; CHECK-NEXT:    [[TMP102:%.*]] = fsub double [[TMP101]], [[TMP99]]
+; CHECK-NEXT:    [[TMP103:%.*]] = fmul double [[TMP98]], [[TMP98]]
+; CHECK-NEXT:    [[TMP104:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double noundef 0xBDA907DB46CC5E42, double noundef 0x3E21EEB69037AB78)
+; CHECK-NEXT:    [[TMP105:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double [[TMP104]], double noundef 0xBE927E4FA17F65F6)
+; CHECK-NEXT:    [[TMP106:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double [[TMP105]], double noundef 0x3EFA01A019F4EC90)
+; CHECK-NEXT:    [[TMP107:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double [[TMP106]], double noundef 0xBF56C16C16C16967)
+; CHECK-NEXT:    [[TMP108:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double [[TMP107]], double noundef 0x3FA5555555555555)
+; CHECK-NEXT:    [[TMP109:%.*]] = fneg double [[DOTPN5_I_I]]
+; CHECK-NEXT:    [[TMP110:%.*]] = tail call double @llvm.fma.f64(double [[DOTPN3_I_I]], double [[TMP109]], double [[TMP102]])
+; CHECK-NEXT:    [[TMP111:%.*]] = tail call double @llvm.fma.f64(double [[TMP103]], double [[TMP108]], double [[TMP110]])
+; CHECK-NEXT:    [[TMP112:%.*]] = fadd double [[TMP100]], [[TMP111]]
+; CHECK-NEXT:    [[TMP113:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double noundef 0x3DE5E0B2F9A43BB8, double noundef 0xBE5AE600B42FDFA7)
+; CHECK-NEXT:    [[TMP114:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double [[TMP113]], double noundef 0x3EC71DE3796CDE01)
+; CHECK-NEXT:    [[TMP115:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double [[TMP114]], double noundef 0xBF2A01A019E83E5C)
+; CHECK-NEXT:    [[TMP116:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double [[TMP115]], double noundef 0x3F81111111110BB3)
+; CHECK-NEXT:    [[TMP117:%.*]] = fneg double [[TMP98]]
+; CHECK-NEXT:    [[TMP118:%.*]] = fmul double [[DOTPN3_I_I]], [[TMP117]]
+; CHECK-NEXT:    [[TMP119:%.*]] = fmul double [[DOTPN5_I_I]], 5.000000e-01
+; CHECK-NEXT:    [[TMP120:%.*]] = tail call double @llvm.fma.f64(double [[TMP118]], double [[TMP116]], double [[TMP119]])
+; CHECK-NEXT:    [[TMP121:%.*]] = tail call double @llvm.fma.f64(double [[TMP98]], double [[TMP120]], double [[TMP109]])
+; CHECK-NEXT:    [[TMP122:%.*]] = tail call double @llvm.fma.f64(double [[TMP118]], double noundef 0xBFC5555555555555, double [[TMP121]])
+; CHECK-NEXT:    [[TMP123:%.*]] = fsub double [[DOTPN3_I_I]], [[TMP122]]
+; CHECK-NEXT:    [[TMP124:%.*]] = and i32 [[DOTPN1_IN_I_I]], 1
+; CHECK-NEXT:    [[TMP125:%.*]] = icmp eq i32 [[TMP124]], 0
+; CHECK-NEXT:    [[TMP126:%.*]] = select i1 [[TMP125]], double [[TMP123]], double [[TMP112]]
+; CHECK-NEXT:    [[TMP127:%.*]] = bitcast double [[TMP126]] to <2 x i32>
+; CHECK-NEXT:    [[DOTPN1_I_I:%.*]] = shl i32 [[DOTPN1_IN_I_I]], 30
+; CHECK-NEXT:    [[TMP128:%.*]] = bitcast double [[__X]] to <2 x i32>
+; CHECK-NEXT:    [[TMP129:%.*]] = extractelement <2 x i32> [[TMP128]], i64 1
+; CHECK-NEXT:    [[TMP130:%.*]] = xor i32 [[DOTPN1_I_I]], [[TMP129]]
+; CHECK-NEXT:    [[TMP131:%.*]] = and i32 [[TMP130]], -2147483648
+; CHECK-NEXT:    [[TMP132:%.*]] = extractelement <2 x i32> [[TMP127]], i64 1
+; CHECK-NEXT:    [[TMP133:%.*]] = xor i32 [[TMP132]], [[TMP131]]
+; CHECK-NEXT:    [[TMP134:%.*]] = insertelement <2 x i32> [[TMP127]], i32 [[TMP133]], i64 1
+; CHECK-NEXT:    [[TMP135:%.*]] = fcmp one double [[TMP0]], 0x7FF0000000000000
+; CHECK-NEXT:    [[TMP136:%.*]] = select i1 [[TMP135]], <2 x i32> [[TMP134]], <2 x i32> <i32 0, i32 2146959360>
+; CHECK-NEXT:    [[TMP137:%.*]] = bitcast <2 x i32> [[TMP136]] to double
+; CHECK-NEXT:    ret double [[TMP137]]
+;
+entry:
+  %0 = tail call double @llvm.fabs.f64(double %__x)
+  %1 = fcmp olt double %0, 0x41D0000000000000
+  br i1 %1, label %2, label %21
+
+2:                                                ; preds = %entry
+  %3 = fmul double %0, 0x3FE45F306DC9C883
+  %4 = tail call double @llvm.rint.f64(double %3)
+  %5 = tail call double @llvm.fma.f64(double %4, double 0xBFF921FB54442D18, double %0)
+  %6 = tail call double @llvm.fma.f64(double %4, double 0xBC91A62633145C00, double %5)
+  %7 = fmul double %4, 0x3C91A62633145C00
+  %8 = fneg double %7
+  %9 = tail call double @llvm.fma.f64(double %4, double 0x3C91A62633145C00, double %8)
+  %10 = fsub double %5, %7
+  %11 = fsub double %5, %10
+  %12 = fsub double %11, %7
+  %13 = fsub double %10, %6
+  %14 = fadd double %13, %12
+  %15 = fsub double %14, %9
+  %16 = tail call double @llvm.fma.f64(double %4, double 0xB97B839A252049C0, double %15)
+  %17 = fadd double %6, %16
+  %18 = fsub double %17, %6
+  %19 = fsub double %16, %18
+  %20 = fptosi double %4 to i32
+  br label %__ocml_sin_f64.exit
+
+21:                                               ; preds = %entry
+  %22 = tail call double @llvm.amdgcn.trig.preop.f64(double %0, i32 0)
+  %23 = tail call double @llvm.amdgcn.trig.preop.f64(double %0, i32 1)
+  %24 = tail call double @llvm.amdgcn.trig.preop.f64(double %0, i32 2)
+  %25 = fcmp oge double %0, 0x7B00000000000000
+  %26 = tail call double @llvm.ldexp.f64.i32(double %0, i32 -128)
+  %27 = select i1 %25, double %26, double %0
+  %28 = fmul double %24, %27
+  %29 = fneg double %28
+  %30 = tail call double @llvm.fma.f64(double %24, double %27, double %29)
+  %31 = fmul double %23, %27
+  %32 = fneg double %31
+  %33 = tail call double @llvm.fma.f64(double %23, double %27, double %32)
+  %34 = fmul double %22, %27
+  %35 = fneg double %34
+  %36 = tail call double @llvm.fma.f64(double %22, double %27, double %35)
+  %37 = fadd double %31, %36
+  %38 = fsub double %37, %31
+  %39 = fsub double %37, %38
+  %40 = fsub double %36, %38
+  %41 = fsub double %31, %39
+  %42 = fadd double %40, %41
+  %43 = fadd double %28, %33
+  %44 = fsub double %43, %28
+  %45 = fsub double %43, %44
+  %46 = fsub double %33, %44
+  %47 = fsub double %28, %45
+  %48 = fadd double %46, %47
+  %49 = fadd double %43, %42
+  %50 = fsub double %49, %43
+  %51 = fsub double %49, %50
+  %52 = fsub double %42, %50
+  %53 = fsub double %43, %51
+  %54 = fadd double %52, %53
+  %55 = fadd double %48, %54
+  %56 = fadd double %30, %55
+  %57 = fadd double %34, %37
+  %58 = fsub double %57, %34
+  %59 = fsub double %37, %58
+  %60 = fadd double %59, %49
+  %61 = fsub double %60, %59
+  %62 = fsub double %49, %61
+  %63 = fadd double %62, %56
+  %64 = tail call double @llvm.ldexp.f64.i32(double %57, i32 -2)
+  %65 = tail call double @llvm.amdgcn.fract.f64(double %64)
+  %66 = tail call double @llvm.fabs.f64(double %64) #2
+  %67 = fcmp oeq double %66, 0x7FF0000000000000
+  %68 = select i1 %67, double 0.000000e+00, double %65
+  %69 = tail call double @llvm.ldexp.f64.i32(double %68, i32 2)
+  %70 = fadd double %69, %60
+  %71 = fcmp olt double %70, 0.000000e+00
+  %72 = select i1 %71, double 4.000000e+00, double 0.000000e+00
+  %73 = fadd double %69, %72
+  %74 = fadd double %60, %73
+  %75 = fptosi double %74 to i32
+  %76 = sitofp i32 %75 to double
+  %77 = fsub double %73, %76
+  %78 = fadd double %60, %77
+  %79 = fsub double %78, %77
+  %80 = fsub double %60, %79
+  %81 = fadd double %63, %80
+  %82 = fcmp oge double %78, 5.000000e-01
+  %83 = zext i1 %82 to i32
+  %84 = add nsw i32 %83, %75
+  %85 = select i1 %82, double 1.000000e+00, double 0.000000e+00
+  %86 = fsub double %78, %85
+  %87 = fadd double %86, %81
+  %88 = fsub double %87, %86
+  %89 = fsub double %81, %88
+  %90 = fmul double %87, 0x3FF921FB54442D18
+  %91 = fneg double %90
+  %92 = tail call double @llvm.fma.f64(double %87, double 0x3FF921FB54442D18, double %91)
+  %93 = tail call double @llvm.fma.f64(double %87, double 0x3C91A62633145C07, double %92)
+  %94 = tail call double @llvm.fma.f64(double %89, double 0x3FF921FB54442D18, double %93)
+  %95 = fadd double %90, %94
+  %96 = fsub double %95, %90
+  %97 = fsub double %94, %96
+  br label %__ocml_sin_f64.exit
+
+__ocml_sin_f64.exit:                              ; preds = %21, %2
+  %.pn5.i.i = phi double [ %19, %2 ], [ %97, %21 ]
+  %.pn3.i.i = phi double [ %17, %2 ], [ %95, %21 ]
+  %.pn1.in.i.i = phi i32 [ %20, %2 ], [ %84, %21 ]
+  %98 = fmul double %.pn3.i.i, %.pn3.i.i
+  %99 = fmul double %98, 5.000000e-01
+  %100 = fsub double 1.000000e+00, %99
+  %101 = fsub double 1.000000e+00, %100
+  %102 = fsub double %101, %99
+  %103 = fmul double %98, %98
+  %104 = tail call double @llvm.fma.f64(double %98, double 0xBDA907DB46CC5E42, double 0x3E21EEB69037AB78)
+  %105 = tail call double @llvm.fma.f64(double %98, double %104, double 0xBE927E4FA17F65F6)
+  %106 = tail call double @llvm.fma.f64(double %98, double %105, double 0x3EFA01A019F4EC90)
+  %107 = tail call double @llvm.fma.f64(double %98, double %106, double 0xBF56C16C16C16967)
+  %108 = tail call double @llvm.fma.f64(double %98, double %107, double 0x3FA5555555555555)
+  %109 = fneg double %.pn5.i.i
+  %110 = tail call double @llvm.fma.f64(double %.pn3.i.i, double %109, double %102)
+  %111 = tail call double @llvm.fma.f64(double %103, double %108, double %110)
+  %112 = fadd double %100, %111
+  %113 = tail call double @llvm.fma.f64(double %98, double 0x3DE5E0B2F9A43BB8, double 0xBE5AE600B42FDFA7)
+  %114 = tail call double @llvm.fma.f64(double %98, double %113, double 0x3EC71DE3796CDE01)
+  %115 = tail call double @llvm.fma.f64(double %98, double %114, double 0xBF2A01A019E83E5C)
+  %116 = tail call double @llvm.fma.f64(double %98, double %115, double 0x3F81111111110BB3)
+  %117 = fneg double %98
+  %118 = fmul double %.pn3.i.i, %117
+  %119 = fmul double %.pn5.i.i, 5.000000e-01
+  %120 = tail call double @llvm.fma.f64(double %118, double %116, double %119)
+  %121 = tail call double @llvm.fma.f64(double %98, double %120, double %109)
+  %122 = tail call double @llvm.fma.f64(double %118, double 0xBFC5555555555555, double %121)
+  %123 = fsub double %.pn3.i.i, %122
+  %124 = and i32 %.pn1.in.i.i, 1
+  %125 = icmp eq i32 %124, 0
+  %126 = select i1 %125, double %123, double %112
+  %127 = bitcast double %126 to <2 x i32>
+  %.pn1.i.i = shl i32 %.pn1.in.i.i, 30
+  %128 = bitcast double %__x to <2 x i32>
+  %129 = extractelement <2 x i32> %128, i64 1
+  %130 = xor i32 %.pn1.i.i, %129
+  %131 = and i32 %130, -2147483648
+  %132 = extractelement <2 x i32> %127, i64 1
+  %133 = xor i32 %132, %131
+  %134 = insertelement <2 x i32> %127, i32 %133, i64 1
+  %135 = fcmp one double %0, 0x7FF0000000000000
+  %136 = select i1 %135, <2 x i32> %134, <2 x i32> <i32 0, i32 2146959360>
+  %137 = bitcast <2 x i32> %136 to double
+  ret double %137
+}
+
+attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+attributes #1 = { alwaysinline mustprogress nofree norecurse nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="gfx1030" "target-features"="+16-bit-insts,+ci-insts,+dl-insts,+dot1-insts,+dot10-insts,+dot2-insts,+dot5-insts,+dot6-insts,+dot7-insts,+dpp,+gfx10-3-insts,+gfx10-insts,+gfx8-insts,+gfx9-insts,+s-memrealtime,+s-memtime-inst,+wavefrontsize32" }
+attributes #2 = { memory(none) }
+
+!opencl.ocl.version = !{!0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0, !0}
+!llvm.ident = !{!1, !2, !1, !2, !1, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2, !1, !2}
+!llvm.module.flags = !{!3, !4, !5, !6, !7, !8, !9}
+!omp_offload.info = !{!10, !11, !12}
----------------
arsenm wrote:

Drop all the metadata? 

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


More information about the llvm-commits mailing list