Skip to content

Commit ba26823

Browse files
author
segher
committed
rs6000: Improve comparison rtx_cost (PR81288)
The current rs6000 rtx_cost for comparisons against 0 is very high if TARGET_ISEL && !TARGET_MFCRF, much higher than for reg-reg comparisons, much higher than a load of 0 and such a reg-reg-comparison. This leads to infinite recursion in CSE (see PR81288). This patch removes the too-high cost, also simplifying this code. PR 81288/target * config/rs6000/rs6000.c (rs6000_rtx_costs): Do not handle TARGET_ISEL && !TARGET_MFCRF differently. Simplify code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255188 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent b1023d0 commit ba26823

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

gcc/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2017-11-28 Segher Boessenkool <[email protected]>
2+
3+
PR 81288/target
4+
* config/rs6000/rs6000.c (rs6000_rtx_costs): Do not handle
5+
TARGET_ISEL && !TARGET_MFCRF differently. Simplify code.
6+
17
2017-11-27 Segher Boessenkool <[email protected]>
28

39
* config/rs6000/rs6000.md (<code><GPR:mode><GPR2:mode>2_isel): Change

gcc/config/rs6000/rs6000.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34889,14 +34889,16 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code,
3488934889
*total = COSTS_N_INSNS (1);
3489034890
return true;
3489134891
}
34892+
/* FALLTHRU */
34893+
34894+
case GT:
34895+
case LT:
34896+
case UNORDERED:
3489234897
if (outer_code == SET)
3489334898
{
3489434899
if (XEXP (x, 1) == const0_rtx)
3489534900
{
34896-
if (TARGET_ISEL && !TARGET_MFCRF)
34897-
*total = COSTS_N_INSNS (8);
34898-
else
34899-
*total = COSTS_N_INSNS (2);
34901+
*total = COSTS_N_INSNS (2);
3490034902
return true;
3490134903
}
3490234904
else
@@ -34905,19 +34907,6 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code,
3490534907
return false;
3490634908
}
3490734909
}
34908-
/* FALLTHRU */
34909-
34910-
case GT:
34911-
case LT:
34912-
case UNORDERED:
34913-
if (outer_code == SET && (XEXP (x, 1) == const0_rtx))
34914-
{
34915-
if (TARGET_ISEL && !TARGET_MFCRF)
34916-
*total = COSTS_N_INSNS (8);
34917-
else
34918-
*total = COSTS_N_INSNS (2);
34919-
return true;
34920-
}
3492134910
/* CC COMPARE. */
3492234911
if (outer_code == COMPARE)
3492334912
{

0 commit comments

Comments
 (0)