Hi, This patch clears up the cost model for noce_try_cmove_arith. We lose the "??? FIXME: Magic number 5" comment, and gain a more realistic cost model for if-converting memory accesses. This is the patch that has the chance to cause the largest behavioural changes for most targets - the current heuristic does not take in to consideration the cost of a conditional move - once we add that the cost of the converted sequence often looks higher than we allowed before. I think that missing the cost of the conditional move from these sequences is not a good idea, and that the cost model should rely on the target giving back good information. A target that finds tests failing after this patch should consider either reducing the cost of a conditional move sequence, or increasing TARGET_MAX_NOCE_IFCVT_SEQ_COST. As this ups the cost of if-convert dramatically, I've used the new parameters to ensure that the tests in the testsuite continue to pass on all targets. Bootstrapped in series on aarch64 and x86-64. OK? Thanks, James --- gcc/ 2016-06-21 James Greenhalgh * ifcvt.c (noce_try_cmove_arith): Check costs after constructing new sequence. gcc/testsuite/ 2016-06-21 James Greenhalgh * gcc.dg/ifcvt-2.c: Use parameter to guide if-conversion heuristics. * gcc.dg/ifcvt-3.c: Use parameter to guide if-conversion heuristics. * gcc.dg/pr68435.c: Use parameter to guide if-conversion heuristics.