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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 07:08:40 PDT 2017


spatel added a comment.

See inline for some nits.



================
Comment at: lib/Transforms/InstCombine/InstCombineAddSub.cpp:1402-1403
+      // integer addition?
+      unsigned MaxRepresentableBits
+        = APFloat::semanticsPrecision(FTy->getFltSemantics());
+      return ITy->getIntegerBitWidth() <= MaxRepresentableBits;
----------------
Is that clang-formatted?

Please upload the version with the TODO/FIXME comments.


================
Comment at: test/Transforms/InstCombine/add-sitofp.ll:17
+
+  ; Drop two highes bits to guarantee that %a + 1 doesn't overflow
+  %a_and = and i32 %a, 1073741823
----------------
"highes" -> "highest"; same typo is repeated below.

Also, I appreciate changing this test file to use FileCheck, but could you run utils/update_test_checks.py instead of hand-editing the CHECK lines? That makes the assertions stronger and easier to update (we're pretty sure we'll want to update these one way or another).


https://reviews.llvm.org/D31182





More information about the llvm-commits mailing list