brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.0 KiB · 850c821 Raw
129 lines · plain
1; The strictfp version of test/CodeGen/PowerPC/cse-despit-rounding-mode.ll2; With strictfp, the MachineIR optimizations need to assume that a call3; can change the rounding mode and must not move/eliminate the repeated4; multiply/convert instructions in this test.5; RUN: llc -verify-machineinstrs --mtriple powerpc64le-unknown-linux-gnu \6; RUN:   -mcpu=pwr8 -ppc-asm-full-reg-names < %s | grep 'xvrdpic' | count 47; RUN: llc -verify-machineinstrs --mtriple powerpc-unknown-linux-gnu \8; RUN:   -mcpu=pwr9 -ppc-asm-full-reg-names < %s | grep 'xvrdpic' | count 49; RUN: llc -verify-machineinstrs --mtriple powerpc64le-unknown-linux-gnu \10; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names < %s | grep 'xvrdpic' | count 411 12; RUN: llc -verify-machineinstrs --mtriple powerpc64le-unknown-linux-gnu \13; RUN:   -mcpu=pwr8 -ppc-asm-full-reg-names < %s | grep 'xvmuldp' | count 414; RUN: llc -verify-machineinstrs --mtriple powerpc-unknown-linux-gnu \15; RUN:   -mcpu=pwr9 -ppc-asm-full-reg-names < %s | grep 'xvmuldp' | count 416; RUN: llc -verify-machineinstrs --mtriple powerpc64le-unknown-linux-gnu \17; RUN:   -mcpu=pwr10 -ppc-asm-full-reg-names < %s | grep 'xvmuldp' | count 418@IndirectCallPtr = dso_local local_unnamed_addr global ptr null, align 819 20define dso_local signext i32 @func1() local_unnamed_addr #0 {21entry:22  tail call void @directCall() #023  %0 = tail call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> <double -9.990000e+01, double 9.990000e+01>, metadata !"round.dynamic", metadata !"fpexcept.ignore") #024  %vecext = extractelement <2 x double> %0, i32 025  %sub = tail call double @llvm.experimental.constrained.fsub.f64(double %vecext, double -9.900000e+01, metadata !"round.dynamic", metadata !"fpexcept.ignore") #026  %conv = tail call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %sub, metadata !"fpexcept.ignore") #027  tail call void @directCall() #028  %1 = tail call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> <double -9.990000e+01, double 9.990000e+01>, metadata !"round.dynamic", metadata !"fpexcept.ignore") #029  %vecext3 = extractelement <2 x double> %1, i32 130  %cmp = tail call i1 @llvm.experimental.constrained.fcmp.f64(double %vecext3, double 9.900000e+01, metadata !"une", metadata !"fpexcept.ignore") #031  br i1 %cmp, label %if.then, label %if.end32 33if.then:                                          ; preds = %entry34  tail call void @exit(i32 signext 2) #035  unreachable36 37if.end:                                           ; preds = %entry38  ret i32 %conv39}40 41declare void @directCall(...) local_unnamed_addr42 43declare double @llvm.experimental.constrained.fsub.f64(double, double, metadata, metadata)44 45declare i32 @llvm.experimental.constrained.fptosi.i32.f64(double, metadata)46 47declare i1 @llvm.experimental.constrained.fcmp.f64(double, double, metadata, metadata)48 49declare void @exit(i32 signext) local_unnamed_addr50 51define dso_local signext i32 @func2() local_unnamed_addr #0 {52entry:53  %call = tail call <2 x double> @getvector1() #054  %call1 = tail call <2 x double> @getvector2() #055  tail call void @directCall() #056  %mul = tail call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %call, <2 x double> %call1, metadata !"round.dynamic", metadata !"fpexcept.ignore") #057  %vecext = extractelement <2 x double> %mul, i32 058  %cmp = tail call i1 @llvm.experimental.constrained.fcmp.f64(double %vecext, double 4.000000e+00, metadata !"oeq", metadata !"fpexcept.ignore") #059  br i1 %cmp, label %cleanup, label %if.end60 61if.end:                                           ; preds = %entry62  tail call void @directCall() #063  %mul10 = tail call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %call, <2 x double> %call1, metadata !"round.dynamic", metadata !"fpexcept.ignore") #064  %0 = tail call i32 @llvm.ppc.vsx.xvcmpeqdp.p(i32 2, <2 x double> %mul, <2 x double> %mul10) #065  br label %cleanup66 67cleanup:                                          ; preds = %entry, %if.end68  %retval.0 = phi i32 [ %0, %if.end ], [ 11, %entry ]69  ret i32 %retval.070}71 72declare <2 x double> @getvector1(...) local_unnamed_addr73 74declare <2 x double> @getvector2(...) local_unnamed_addr75 76declare <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double>, <2 x double>, metadata, metadata)77 78declare i32 @llvm.ppc.vsx.xvcmpeqdp.p(i32, <2 x double>, <2 x double>)79 80define dso_local signext i32 @func3() local_unnamed_addr #0 {81entry:82  %0 = load ptr, ptr @IndirectCallPtr, align 883  tail call void %0() #084  %1 = tail call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> <double -9.990000e+01, double 9.990000e+01>, metadata !"round.dynamic", metadata !"fpexcept.ignore") #085  %vecext = extractelement <2 x double> %1, i32 086  %sub = tail call double @llvm.experimental.constrained.fsub.f64(double %vecext, double -9.900000e+01, metadata !"round.dynamic", metadata !"fpexcept.ignore") #087  %conv = tail call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %sub, metadata !"fpexcept.ignore") #088  %2 = load ptr, ptr @IndirectCallPtr, align 889  tail call void %2() #090  %3 = tail call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> <double -9.990000e+01, double 9.990000e+01>, metadata !"round.dynamic", metadata !"fpexcept.ignore") #091  %vecext4 = extractelement <2 x double> %3, i32 192  %cmp = tail call i1 @llvm.experimental.constrained.fcmp.f64(double %vecext4, double 9.900000e+01, metadata !"une", metadata !"fpexcept.ignore") #093  br i1 %cmp, label %if.then, label %if.end94 95if.then:                                          ; preds = %entry96  tail call void @exit(i32 signext 2) #097  unreachable98 99if.end:                                           ; preds = %entry100  ret i32 %conv101}102 103define dso_local signext i32 @func4() local_unnamed_addr #0 {104entry:105  %call = tail call <2 x double> @getvector1() #0106  %call1 = tail call <2 x double> @getvector2() #0107  %0 = load ptr, ptr @IndirectCallPtr, align 8108  tail call void %0() #0109  %mul = tail call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %call, <2 x double> %call1, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0110  %vecext = extractelement <2 x double> %mul, i32 0111  %cmp = tail call i1 @llvm.experimental.constrained.fcmp.f64(double %vecext, double 4.000000e+00, metadata !"oeq", metadata !"fpexcept.ignore") #0112  br i1 %cmp, label %cleanup, label %if.end113 114if.end:                                           ; preds = %entry115  %1 = load ptr, ptr @IndirectCallPtr, align 8116  tail call void %1() #0117  %mul11 = tail call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %call, <2 x double> %call1, metadata !"round.dynamic", metadata !"fpexcept.ignore") #0118  %2 = tail call i32 @llvm.ppc.vsx.xvcmpeqdp.p(i32 2, <2 x double> %mul, <2 x double> %mul11) #0119  br label %cleanup120 121cleanup:                                          ; preds = %entry, %if.end122  %retval.0 = phi i32 [ %2, %if.end ], [ 11, %entry ]123  ret i32 %retval.0124}125 126declare <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double>, metadata, metadata)127 128attributes #0 = { nounwind strictfp }129