2014-05-16  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (visit_use): Also constant-fold calls.

	* gcc.dg/tree-ssa/ssa-fre-41.c: New testcase.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210491 138bc75d-0d04-0410-961f-82ee72b054a4
2014-05-16  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c: Include tree-cfg.h and domwalk.h.
	(set_ssa_val_to): Handle unexpected sets to VN_TOP.
	(visit_phi): Ignore edges marked as not executable.
	(class cond_dom_walker): New.
	(cond_dom_walker::before_dom_children): Value-number
	control statements and mark successor edges as not
	executable if possible.
	(run_scc_vn): First walk all control statements in
	dominator order, marking edges as not executable.
	* tree-inline.c (copy_edges_for_bb): Be not confused
	about random edge flags.

	* gcc.dg/tree-ssa/ssa-fre-39.c: New testcase.
	* gcc.dg/tree-ssa/ssa-fre-40.c: Likewise.
	* gcc.dg/tree-ssa/ssa-pre-8.c: One more elimination.
	* gcc.dg/tree-ssa/struct-aliasing-2.c: Scan cddce1 dump.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210492 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 1/18] Refactor aarch64_address_costs.

gcc/

	* config/aarch64/aarch64-protos.h (scale_addr_mode_cost): New.
	(cpu_addrcost_table): Use it.
	* config/aarch64/aarch64.c (generic_addrcost_table): Initialize it.
	(aarch64_address_cost): Rewrite using aarch64_classify_address,
	move it.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210493 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 2/18] Add cost tables for Cortex-A57

gcc/

	* config/aarch64/aarch64.c (cortexa57_addrcost_table): New.
	(cortexa57_vector_cost): Likewise.
	(cortexa57_tunings): Use them.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210494 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 3/18] Wrap aarch64_rtx_costs to dump verbose output

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs_wrapper): New.
	(TARGET_RTX_COSTS): Call it.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210495 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 4/18] Better estimate cost of building a constant

gcc/

	* config/aarch64/aarch64.c (aarch64_build_constant): Conditionally
	emit instructions, return number of instructions which would
	be emitted.
	(aarch64_add_constant): Update call to aarch64_build_constant.
	(aarch64_output_mi_thunk): Likewise.
	(aarch64_rtx_costs): Estimate cost of a CONST_INT, cost
	a CONST_DOUBLE.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210496 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 5/18] Factor out common MULT cases

gcc/

	* config/aarch64/aarch64.c (aarch64_strip_shift_or_extend): Rename
	to...
	(aarch64_strip_extend): ...this, don't strip shifts, check RTX is
	well formed.
	(aarch64_rtx_mult_cost): New.
	(aarch64_rtx_costs): Use it, refactor as appropriate.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210497 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 6/18] Set default costs and handle vector modes.

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Set default costs.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210498 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 7/18] Improve SET cost.

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Improve costing
	for SET RTX.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210499 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 8/18] Cost memory accesses using address costs 

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Use address
	costs when costing loads and stores to memory.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210500 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 9/18] Better cost logical operations

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Improve cost for
	logical operations.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210501 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 10/18] Improve costs for sign/zero extend operations

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Cost
	ZERO_EXTEND and SIGN_EXTEND better.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210502 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 11/18] Improve costs for rotate and shift operations.

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Improve costs for
	rotates and shifts.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210503 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 12/18] Improve costs for sign/zero extracts

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Improve costs for
	SIGN/ZERO_EXTRACT.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210504 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 13/18] Improve costs for div/mod

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Improve costs for
	DIV/MOD.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210505 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 14/18] Cost comparisons, flag setting operators and IF_THEN_ELSE

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Cost comparison
	operators.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210506 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 15/18] Cost more Floating point RTX.

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Cost FMA,
	FLOAT_EXTEND, FLOAT_TRUNCATE, ABS, SMAX, and SMIN.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210507 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 16/18] Cost TRUNCATE

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Cost TRUNCATE.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210508 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 17/18] Cost for SYMBOL_REF, HIGH and LO_SUM

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Cost SYMBOL_REF,
	HIGH, LO_SUM.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210509 138bc75d-0d04-0410-961f-82ee72b054a4
[AArch64 costs 18/18] Dump a message if we are unable to cost an insn.

gcc/

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Handle the case
	where we were unable to cost an RTX.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210510 138bc75d-0d04-0410-961f-82ee72b054a4