Added a additional rule for MADs. When we try to avoid spilling, we do not
authorBenjamin Segovia <benjamin.segovia@intel.com>
Wed, 7 Nov 2012 01:47:26 +0000 (17:47 -0800)
committerBenjamin Segovia <benjamin.segovia@intel.com>
Wed, 7 Nov 2012 01:47:26 +0000 (17:47 -0800)
generate MADs

backend/src/backend/gen_insn_selection.cpp

index 343ff0d..36db1a3 100644 (file)
@@ -1110,6 +1110,13 @@ namespace gbe
     virtual bool emit(Selection::Opaque  &sel, SelectionDAG &dag) const
     {
       using namespace ir;
+
+      // MAD tend to increase liveness of the sources (since there are three of
+      // them)
+      if (sel.ctx.limitRegisterPressure)
+        return false;
+
+      // We are good to try. We need a MUL for one of the two sources
       const ir::BinaryInstruction &insn = cast<ir::BinaryInstruction>(dag.insn);
       if (insn.getType() != TYPE_FLOAT)
         return false;