diff mbox

[i386] : Ignore the cost of embedded comparison (PR 65871)

Message ID CAFULd4ZFkqLxs7yQWTns-fag5nE7Xrf4tvA-T_0CqZJ9M7mksg@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak June 22, 2015, 8:58 a.m. UTC
Hello!

As shown in the PR [1], RTX costs can reject combination of the
operation and its embedded comparison. Attached patch fixes this by
ignoring the cost of embedded comparison.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65871#c10

2015-06-22  Uros Bizjak  <ubizjak@gmail.com>

    PR target/65871
    * config/i386/i386.c (ix86_rtx_costs) <case COMPARE>: Ignore the
    cost of embedded comparison.

Bootstrapped on x86_64-linux-gnu, regtest in progress.

Uros.
diff mbox

Patch

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 224718)
+++ config/i386/i386.c	(working copy)
@@ -42531,6 +42531,12 @@  ix86_rtx_costs (rtx x, int code_i, int outer_code_
 		    + rtx_cost (const1_rtx, outer_code, opno, speed));
 	  return true;
 	}
+
+      /* The embedded comparison operand is completely free.  */
+      if (!general_operand (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
+	  && XEXP (x, 1) == const0_rtx)
+	*total = 0;
+
       return false;
 
     case FLOAT_EXTEND: