Determine access types in ipa-icf-gimple.c
authorJan Hubicka <jh@suse.cz>
Fri, 13 Nov 2020 10:41:13 +0000 (11:41 +0100)
committerJan Hubicka <jh@suse.cz>
Fri, 13 Nov 2020 15:04:48 +0000 (16:04 +0100)
commita1fdc16da341187846dd0577e96ee00df5f28608
tree78db15ad478a4d755ad7282e1f824d1c32f9e95f
parent156edf21fab7dd5891c72db7ec58b38ef7d52bfa
Determine access types in ipa-icf-gimple.c

This patch adds logic to determine access type (normal or memory) for every
operand.  This makes it possible to compare memory accesses more carefully
which will be implemented in a followup patch.

* ipa-icf-gimple.c: Include gimple-walk.h.
(func_checker::compare_ssa_name): Update call of compare_operand.
(func_checker::hash_operand): Fix comment and add variant taking
operand_access_type parameter.
(func_checker::compare_operand): Add operand_access_type parameter.
(func_checker::compare_asm_inputs_outputs): Add
operand_access_type_map parameter; update use of
func_checker::compare_operand.
(func_checker::compare_gimple_call): Update use of
func_checker::compare_operand.
(func_checker::compare_gimple_assign): Likewise.
(func_checker::compare_gimple_cond): Likewise.
(func_checker::compare_gimple_switch): Likewise.
(func_checker::compare_gimple_return): Likewise.
(func_checker::compare_gimple_goto): Likewise.
(func_checker::compare_gimple_asm): Likewise.
(visit_load_store): New static functio.
(func_checker::classify_operands): New member function.
(func_checker::get_operand_access_type): New member function.
* ipa-icf-gimple.h (func_checker::operand_access_type): New enum
(func_checker::operand_access_type_map): New typedef.
(func_checker::compare_operand): Update prototype.
(func_checker::compare_asm_inputs_outputs): Likewise.
(func_checker::cleassify_operands): Declare.
(func_checker::get_operand_access_type): Declare.
(func_checker::hash_operand): New variant with operand_access_type.
* ipa-icf.c (sem_function::hash_stmt): Update uses of hash_operand.
(sem_function::compare_phi_node): Update use of compare_operand.
gcc/ipa-icf-gimple.c
gcc/ipa-icf-gimple.h
gcc/ipa-icf.c