@@ -1461,7 +1461,7 @@ class IRBuilder : public IRBuilderBase, public Inserter {
1461
1461
if (Value *V = foldConstant (Opc, LHS, RHS, Name)) return V;
1462
1462
Instruction *BinOp = BinaryOperator::Create (Opc, LHS, RHS);
1463
1463
if (isa<FPMathOperator>(BinOp))
1464
- BinOp = setFPAttrs (BinOp, FPMathTag, FMF);
1464
+ setFPAttrs (BinOp, FPMathTag, FMF);
1465
1465
return Insert (BinOp, Name);
1466
1466
}
1467
1467
@@ -1479,7 +1479,8 @@ class IRBuilder : public IRBuilderBase, public Inserter {
1479
1479
1480
1480
CallInst *C = CreateIntrinsic (ID, {L->getType ()},
1481
1481
{L, R, RoundingV, ExceptV}, nullptr , Name);
1482
- return cast<CallInst>(setFPAttrs (C, FPMathTag, UseFMF));
1482
+ setFPAttrs (C, FPMathTag, UseFMF);
1483
+ return C;
1483
1484
}
1484
1485
1485
1486
Value *CreateNeg (Value *V, const Twine &Name = " " ,
@@ -1532,7 +1533,7 @@ class IRBuilder : public IRBuilderBase, public Inserter {
1532
1533
return Insert (Folder.CreateUnOp (Opc, VC), Name);
1533
1534
Instruction *UnOp = UnaryOperator::Create (Opc, V);
1534
1535
if (isa<FPMathOperator>(UnOp))
1535
- UnOp = setFPAttrs (UnOp, FPMathTag, FMF);
1536
+ setFPAttrs (UnOp, FPMathTag, FMF);
1536
1537
return Insert (UnOp, Name);
1537
1538
}
1538
1539
@@ -2084,7 +2085,7 @@ class IRBuilder : public IRBuilderBase, public Inserter {
2084
2085
break ;
2085
2086
}
2086
2087
if (isa<FPMathOperator>(C))
2087
- C = cast<CallInst>( setFPAttrs (C, FPMathTag, UseFMF) );
2088
+ setFPAttrs (C, FPMathTag, UseFMF);
2088
2089
return C;
2089
2090
}
2090
2091
@@ -2231,7 +2232,7 @@ class IRBuilder : public IRBuilderBase, public Inserter {
2231
2232
const Twine &Name = " " ) {
2232
2233
PHINode *Phi = PHINode::Create (Ty, NumReservedValues);
2233
2234
if (isa<FPMathOperator>(Phi))
2234
- Phi = cast<PHINode>( setFPAttrs (Phi, nullptr /* MDNode* */ , FMF) );
2235
+ setFPAttrs (Phi, nullptr /* MDNode* */ , FMF);
2235
2236
return Insert (Phi, Name);
2236
2237
}
2237
2238
@@ -2240,7 +2241,7 @@ class IRBuilder : public IRBuilderBase, public Inserter {
2240
2241
MDNode *FPMathTag = nullptr ) {
2241
2242
CallInst *CI = CallInst::Create (FTy, Callee, Args, DefaultOperandBundles);
2242
2243
if (isa<FPMathOperator>(CI))
2243
- CI = cast<CallInst>( setFPAttrs (CI, FPMathTag, FMF) );
2244
+ setFPAttrs (CI, FPMathTag, FMF);
2244
2245
return Insert (CI, Name);
2245
2246
}
2246
2247
@@ -2249,7 +2250,7 @@ class IRBuilder : public IRBuilderBase, public Inserter {
2249
2250
const Twine &Name = " " , MDNode *FPMathTag = nullptr ) {
2250
2251
CallInst *CI = CallInst::Create (FTy, Callee, Args, OpBundles);
2251
2252
if (isa<FPMathOperator>(CI))
2252
- CI = cast<CallInst>( setFPAttrs (CI, FPMathTag, FMF) );
2253
+ setFPAttrs (CI, FPMathTag, FMF);
2253
2254
return Insert (CI, Name);
2254
2255
}
2255
2256
@@ -2297,7 +2298,7 @@ class IRBuilder : public IRBuilderBase, public Inserter {
2297
2298
Sel = addBranchMetadata (Sel, Prof, Unpred);
2298
2299
}
2299
2300
if (isa<FPMathOperator>(Sel))
2300
- Sel = cast<SelectInst>( setFPAttrs (Sel, nullptr /* MDNode* */ , FMF) );
2301
+ setFPAttrs (Sel, nullptr /* MDNode* */ , FMF);
2301
2302
return Insert (Sel, Name);
2302
2303
}
2303
2304
0 commit comments