Skip to content

Commit bb0a078

Browse files
authored
AMDGPU: Use less surprising form of ConstantFP::get (llvm#139248)
1 parent 40ac25e commit bb0a078

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,8 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
906906
if (const ConstantFP *C2 = dyn_cast<ConstantFP>(Src2)) {
907907
APFloat Result = fmed3AMDGCN(C0->getValueAPF(), C1->getValueAPF(),
908908
C2->getValueAPF());
909-
return IC.replaceInstUsesWith(
910-
II, ConstantFP::get(IC.Builder.getContext(), Result));
909+
return IC.replaceInstUsesWith(II,
910+
ConstantFP::get(II.getType(), Result));
911911
}
912912
}
913913
}

0 commit comments

Comments
 (0)