[PATCH] "float2int": Add a new pass to demote from float to int where possible.

Philip Reames listmail at philipreames.com
Wed Feb 25 11:22:10 PST 2015


I'm going to deref to Hal on the code for the moment.  It sounds like things are still in progress.  Once you've got the approach nailed down, I'll try to take another look for nits.

At a high level, why are you restricting yourself to entire sequences?  It seems like this would be profitable even if all you did was push the float to int conversion back a bit or the int to float forward a bit.  This might even simplify the code.

Is the concern here that the backends might not make appropriate use of the floating point unit for integer ops?


REPOSITORY
  rL LLVM

================
Comment at: lib/Transforms/Scalar/Float2Int.cpp:440
@@ +439,3 @@
+void Float2Int::cleanup() {
+  for (auto I = ConvertedInsts.rbegin(), E = ConvertedInsts.rend();
+       I != E; ++I) {
----------------
Can this be a range loop?  Can you use a utility to delete things which are recursively trivially dead?

http://reviews.llvm.org/D7790

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list