Commit 700c4980 by Jan Hubicka Committed by Jan Hubicka

* stmt.c (lshift_cheap_p): Support properly optimize_insn_for_speed_p.

From-SVN: r166983
parent 1f980c25
2010-11-20 Jan Hubicka <jh@suse.cz>
* stmt.c (lshift_cheap_p): Support properly optimize_insn_for_speed_p.
2010-11-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 2010-11-20 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR other/46202 PR other/46202
...@@ -2122,19 +2122,21 @@ struct case_bit_test ...@@ -2122,19 +2122,21 @@ struct case_bit_test
static static
bool lshift_cheap_p (void) bool lshift_cheap_p (void)
{ {
static bool init = false; static bool init[2] = {false, false};
static bool cheap = true; static bool cheap[2] = {true, true};
if (!init) bool speed_p = optimize_insn_for_speed_p ();
if (!init[speed_p])
{ {
rtx reg = gen_rtx_REG (word_mode, 10000); rtx reg = gen_rtx_REG (word_mode, 10000);
int cost = rtx_cost (gen_rtx_ASHIFT (word_mode, const1_rtx, reg), SET, int cost = rtx_cost (gen_rtx_ASHIFT (word_mode, const1_rtx, reg), SET,
optimize_insn_for_speed_p ()); speed_p);
cheap = cost < COSTS_N_INSNS (3); cheap[speed_p] = cost < COSTS_N_INSNS (3);
init = true; init[speed_p] = true;
} }
return cheap; return cheap[speed_p];
} }
/* Comparison function for qsort to order bit tests by decreasing /* Comparison function for qsort to order bit tests by decreasing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment