Skip to content

Commit f3d3cec

Browse files
committed
[InstCombine] Avoid a call to deprecated version of CreateCall.
Passing a Value * to CreateCall has to call getPointerElementType to find the type of the pointer. In this case we can rely on the fact that Intrinsic::getDeclaration returns a Function * and use that version of CreateCall.
1 parent 0985554 commit f3d3cec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,8 +2324,8 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
23242324
if (match(II->getArgOperand(0), m_OneUse(m_FPExt(m_Value(ExtSrc0)))) &&
23252325
match(II->getArgOperand(1), m_OneUse(m_FPExt(m_Value(ExtSrc1)))) &&
23262326
ExtSrc0->getType() == ExtSrc1->getType()) {
2327-
Value *F = Intrinsic::getDeclaration(II->getModule(), II->getIntrinsicID(),
2328-
{ ExtSrc0->getType() });
2327+
Function *F = Intrinsic::getDeclaration(
2328+
II->getModule(), II->getIntrinsicID(), {ExtSrc0->getType()});
23292329
CallInst *NewCall = Builder.CreateCall(F, { ExtSrc0, ExtSrc1 });
23302330
NewCall->copyFastMathFlags(II);
23312331
NewCall->takeName(II);

0 commit comments

Comments
 (0)