[InstCombine] Apply the fix from r322284 for sin / cos -> tan too
llvm-svn: 322285
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index aa333fd..899c4dd 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1480,8 +1480,9 @@
IRBuilder<> B(&I);
IRBuilder<>::FastMathFlagGuard Guard(B);
B.setFastMathFlags(I.getFastMathFlags());
- Value *Tan = emitUnaryFloatFnCall(A, TLI.getName(LibFunc_tan),
- B, I.getFunction()->getAttributes());
+ Value *Tan = emitUnaryFloatFnCall(
+ A, TLI.getName(LibFunc_tan), B,
+ CallSite(Op0).getCalledFunction()->getAttributes());
return replaceInstUsesWith(I, Tan);
}
}