[PATCH] D19178: Broaden FoldItoFPtoI to try and establish whether the integer value fits into the float type

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 30 17:42:59 PDT 2016


eli.friedman added a comment.

Overall, this is looking much better; simple is good. :)


================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1483
@@ +1482,3 @@
+    // If the number is of unknown sign, the highest possibly set bit is the
+    // higher of the lowest known zero and the highest not known zero.
+
----------------
Leftover comment?

================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1507
@@ +1506,3 @@
+    int BitRange = MostSignificantPossiblySetBit -
+                LeastSignificantPossiblySetBit + 1;
+
----------------
Doesn't the + 1 here cancel out the -1 in the setting of MostSignificantPossiblySetBit?  That would make the math a bit more straightforward.

================
Comment at: test/Transforms/InstCombine/sitofp.ll:272
@@ +271,2 @@
+ ret i32 %D
+}
----------------
Did you find any interesting new cases worth having a separate regression test?


https://reviews.llvm.org/D19178





More information about the llvm-commits mailing list