[PATCH] D31182: [InstCombine] fadd double (sitofp x), y check that the promotion is valid

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 13:07:00 PDT 2017


andrew.w.kaylor added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineAddSub.cpp:1414
+        if (LHSConv->hasOneUse() &&
+            ConstantExpr::getSIToFP(CI, I.getType()) == CFP &&
+            WillNotOverflowSignedAdd(LHSIntVal, CI, I)) {
----------------
It looks like getFPToSI and getSIToFP will end up using the APFloat class.  Wouldn't it be better to just use APFloat here and call APFloat::isInteger()?


https://reviews.llvm.org/D31182





More information about the llvm-commits mailing list