if (Value *V = foldConstant(Opc, LHS, RHS, Name)) return V;
Instruction *BinOp = BinaryOperator::Create(Opc, LHS, RHS);
if (isa<FPMathOperator>(BinOp))
- BinOp = setFPAttrs(BinOp, FPMathTag, FMF);
+ setFPAttrs(BinOp, FPMathTag, FMF);
return Insert(BinOp, Name);
}
CallInst *C = CreateIntrinsic(ID, {L->getType()},
{L, R, RoundingV, ExceptV}, nullptr, Name);
- return cast<CallInst>(setFPAttrs(C, FPMathTag, UseFMF));
+ setFPAttrs(C, FPMathTag, UseFMF);
+ return C;
}
Value *CreateNeg(Value *V, const Twine &Name = "",
return Insert(Folder.CreateUnOp(Opc, VC), Name);
Instruction *UnOp = UnaryOperator::Create(Opc, V);
if (isa<FPMathOperator>(UnOp))
- UnOp = setFPAttrs(UnOp, FPMathTag, FMF);
+ setFPAttrs(UnOp, FPMathTag, FMF);
return Insert(UnOp, Name);
}
break;
}
if (isa<FPMathOperator>(C))
- C = cast<CallInst>(setFPAttrs(C, FPMathTag, UseFMF));
+ setFPAttrs(C, FPMathTag, UseFMF);
return C;
}
const Twine &Name = "") {
PHINode *Phi = PHINode::Create(Ty, NumReservedValues);
if (isa<FPMathOperator>(Phi))
- Phi = cast<PHINode>(setFPAttrs(Phi, nullptr /* MDNode* */, FMF));
+ setFPAttrs(Phi, nullptr /* MDNode* */, FMF);
return Insert(Phi, Name);
}
MDNode *FPMathTag = nullptr) {
CallInst *CI = CallInst::Create(FTy, Callee, Args, DefaultOperandBundles);
if (isa<FPMathOperator>(CI))
- CI = cast<CallInst>(setFPAttrs(CI, FPMathTag, FMF));
+ setFPAttrs(CI, FPMathTag, FMF);
return Insert(CI, Name);
}
const Twine &Name = "", MDNode *FPMathTag = nullptr) {
CallInst *CI = CallInst::Create(FTy, Callee, Args, OpBundles);
if (isa<FPMathOperator>(CI))
- CI = cast<CallInst>(setFPAttrs(CI, FPMathTag, FMF));
+ setFPAttrs(CI, FPMathTag, FMF);
return Insert(CI, Name);
}
Sel = addBranchMetadata(Sel, Prof, Unpred);
}
if (isa<FPMathOperator>(Sel))
- Sel = cast<SelectInst>(setFPAttrs(Sel, nullptr /* MDNode* */, FMF));
+ setFPAttrs(Sel, nullptr /* MDNode* */, FMF);
return Insert(Sel, Name);
}