LibFunc::Func Func;
Function *F = OpC->getCalledFunction();
- StringRef FuncName = F->getName();
- if ((TLI->getLibFunc(FuncName, Func) && TLI->has(Func) &&
- Func == LibFunc::pow) || F->getIntrinsicID() == Intrinsic::pow)
+ if (F && ((TLI->getLibFunc(F->getName(), Func) && TLI->has(Func) &&
+ Func == LibFunc::pow) || F->getIntrinsicID() == Intrinsic::pow))
return B.CreateFMul(OpC->getArgOperand(1),
EmitUnaryFloatFnCall(OpC->getOperand(0), Callee->getName(), B,
Callee->getAttributes()), "mul");
; CHECK: ret double %mul
; CHECK: }
+define double @test2(double ()* %fptr, double %p1) #0 {
+ %call1 = call double %fptr()
+ %pow = call double @log(double %call1)
+ ret double %pow
+}
+
+; CHECK-LABEL: @test2
+; CHECK: log
+
declare double @log(double) #0
declare double @llvm.pow.f64(double, double)