From 94105f5c8a20973e49579064e7ae3ac2013117e8 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Mon, 9 Oct 2017 21:47:08 +0200 Subject: Add targetm.insn_cost hook This adds a new hook that the insn_cost function uses if a target has implemented it (it uses the old pattern_cost nee insn_rtx_cost if not). * target.def (insn_cost): New hook. * doc/tm.texi.in (TARGET_INSN_COST): New hook. * doc/tm.texi: Regenerate. * rtlanal.c (insn_cost): Use the new hook. From-SVN: r253562 --- gcc/rtlanal.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/rtlanal.c') diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index f01eab5..eadf691 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -5329,6 +5329,9 @@ pattern_cost (rtx pat, bool speed) int insn_cost (rtx_insn *insn, bool speed) { + if (targetm.insn_cost) + return targetm.insn_cost (insn, speed); + return pattern_cost (PATTERN (insn), speed); } -- cgit v1.1