1 /* Interprocedural Identical Code Folding pass
2 Copyright (C) 2014-2019 Free Software Foundation, Inc.
4 Contributed by Jan Hubicka <hubicka@ucw.cz> and Martin Liska <mliska@suse.cz>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
24 #include "coretypes.h"
29 #include "tree-pass.h"
32 #include "data-streamer.h"
33 #include "gimple-pretty-print.h"
34 #include "fold-const.h"
35 #include "gimple-iterator.h"
36 #include "ipa-utils.h"
41 #include "ipa-icf-gimple.h"
43 namespace ipa_icf_gimple
{
45 /* Initialize internal structures for a given SOURCE_FUNC_DECL and
46 TARGET_FUNC_DECL. Strict polymorphic comparison is processed if
47 an option COMPARE_POLYMORPHIC is true. For special cases, one can
48 set IGNORE_LABELS to skip label comparison.
49 Similarly, IGNORE_SOURCE_DECLS and IGNORE_TARGET_DECLS are sets
50 of declarations that can be skipped. */
52 func_checker::func_checker (tree source_func_decl
, tree target_func_decl
,
54 hash_set
<symtab_node
*> *ignored_source_nodes
,
55 hash_set
<symtab_node
*> *ignored_target_nodes
)
56 : m_source_func_decl (source_func_decl
), m_target_func_decl (target_func_decl
),
57 m_ignored_source_nodes (ignored_source_nodes
),
58 m_ignored_target_nodes (ignored_target_nodes
),
59 m_ignore_labels (ignore_labels
)
61 function
*source_func
= DECL_STRUCT_FUNCTION (source_func_decl
);
62 function
*target_func
= DECL_STRUCT_FUNCTION (target_func_decl
);
64 unsigned ssa_source
= SSANAMES (source_func
)->length ();
65 unsigned ssa_target
= SSANAMES (target_func
)->length ();
67 m_source_ssa_names
.create (ssa_source
);
68 m_target_ssa_names
.create (ssa_target
);
70 for (unsigned i
= 0; i
< ssa_source
; i
++)
71 m_source_ssa_names
.safe_push (-1);
73 for (unsigned i
= 0; i
< ssa_target
; i
++)
74 m_target_ssa_names
.safe_push (-1);
77 /* Memory release routine. */
79 func_checker::~func_checker ()
81 m_source_ssa_names
.release();
82 m_target_ssa_names
.release();
85 /* Verifies that trees T1 and T2 are equivalent from perspective of ICF. */
88 func_checker::compare_ssa_name (const_tree t1
, const_tree t2
)
90 gcc_assert (TREE_CODE (t1
) == SSA_NAME
);
91 gcc_assert (TREE_CODE (t2
) == SSA_NAME
);
93 unsigned i1
= SSA_NAME_VERSION (t1
);
94 unsigned i2
= SSA_NAME_VERSION (t2
);
96 if (m_source_ssa_names
[i1
] == -1)
97 m_source_ssa_names
[i1
] = i2
;
98 else if (m_source_ssa_names
[i1
] != (int) i2
)
101 if(m_target_ssa_names
[i2
] == -1)
102 m_target_ssa_names
[i2
] = i1
;
103 else if (m_target_ssa_names
[i2
] != (int) i1
)
106 if (SSA_NAME_IS_DEFAULT_DEF (t1
))
108 tree b1
= SSA_NAME_VAR (t1
);
109 tree b2
= SSA_NAME_VAR (t2
);
111 return compare_operand (b1
, b2
);
117 /* Verification function for edges E1 and E2. */
120 func_checker::compare_edge (edge e1
, edge e2
)
122 if (e1
->flags
!= e2
->flags
)
127 edge
&slot
= m_edge_map
.get_or_insert (e1
, &existed_p
);
129 return return_with_debug (slot
== e2
);
133 /* TODO: filter edge probabilities for profile feedback match. */
138 /* Verification function for declaration trees T1 and T2 that
139 come from functions FUNC1 and FUNC2. */
142 func_checker::compare_decl (const_tree t1
, const_tree t2
)
144 if (!auto_var_in_fn_p (t1
, m_source_func_decl
)
145 || !auto_var_in_fn_p (t2
, m_target_func_decl
))
146 return return_with_debug (t1
== t2
);
148 tree_code t
= TREE_CODE (t1
);
149 if ((t
== VAR_DECL
|| t
== PARM_DECL
|| t
== RESULT_DECL
)
150 && DECL_BY_REFERENCE (t1
) != DECL_BY_REFERENCE (t2
))
151 return return_false_with_msg ("DECL_BY_REFERENCE flags are different");
153 if (!compatible_types_p (TREE_TYPE (t1
), TREE_TYPE (t2
)))
154 return return_false ();
157 const_tree
&slot
= m_decl_map
.get_or_insert (t1
, &existed_p
);
159 return return_with_debug (slot
== t2
);
166 /* Return true if T1 and T2 are same for purposes of ipa-polymorphic-call
167 analysis. COMPARE_PTR indicates if types of pointers needs to be
171 func_checker::compatible_polymorphic_types_p (tree t1
, tree t2
,
174 gcc_assert (TREE_CODE (t1
) != FUNCTION_TYPE
&& TREE_CODE (t1
) != METHOD_TYPE
);
176 /* Pointer types generally give no information. */
177 if (POINTER_TYPE_P (t1
))
181 return func_checker::compatible_polymorphic_types_p (TREE_TYPE (t1
),
186 /* If types contain a polymorphic types, match them. */
187 bool c1
= contains_polymorphic_type_p (t1
);
188 bool c2
= contains_polymorphic_type_p (t2
);
192 return return_false_with_msg ("one type is not polymorphic");
193 if (!types_must_be_same_for_odr (t1
, t2
))
194 return return_false_with_msg ("types are not same for ODR");
198 /* Return true if types are compatible from perspective of ICF. */
200 func_checker::compatible_types_p (tree t1
, tree t2
)
202 if (TREE_CODE (t1
) != TREE_CODE (t2
))
203 return return_false_with_msg ("different tree types");
205 if (TYPE_RESTRICT (t1
) != TYPE_RESTRICT (t2
))
206 return return_false_with_msg ("restrict flags are different");
208 if (!types_compatible_p (t1
, t2
))
209 return return_false_with_msg ("types are not compatible");
214 /* Function compare for equality given trees T1 and T2 which
215 can be either a constant or a declaration type. */
218 func_checker::hash_operand (const_tree arg
, inchash::hash
&hstate
,
221 if (arg
== NULL_TREE
)
223 hstate
.merge_hash (0);
227 switch (TREE_CODE (arg
))
238 inchash::add_expr (DECL_FIELD_OFFSET (arg
), hstate
, flags
);
239 inchash::add_expr (DECL_FIELD_BIT_OFFSET (arg
), hstate
, flags
);
245 return operand_compare::hash_operand (arg
, hstate
, flags
);
249 func_checker::operand_equal_p (const_tree t1
, const_tree t2
,
253 if (verify_hash_value (t1
, t2
, flags
, &r
))
261 if (TREE_CODE (t1
) != TREE_CODE (t2
))
262 return return_false ();
264 switch (TREE_CODE (t1
))
267 /* All function decls are in the symbol table and known to match
268 before we start comparing bodies. */
271 return return_with_debug (compare_variable_decl (t1
, t2
));
274 int *bb1
= m_label_bb_map
.get (t1
);
275 int *bb2
= m_label_bb_map
.get (t2
);
276 /* Labels can point to another function (non-local GOTOs). */
277 return return_with_debug (bb1
!= NULL
&& bb2
!= NULL
&& *bb1
== *bb2
);
283 return compare_decl (t1
, t2
);
285 return compare_ssa_name (t1
, t2
);
290 return operand_compare::operand_equal_p (t1
, t2
, flags
);
293 /* Function responsible for comparison of various operands T1 and T2.
294 If these components, from functions FUNC1 and FUNC2, are equal, true
298 func_checker::compare_operand (tree t1
, tree t2
)
304 if (operand_equal_p (t1
, t2
, OEP_MATCH_SIDE_EFFECTS
))
306 return return_false_with_msg ("operand_equal_p failed");
310 func_checker::compare_asm_inputs_outputs (tree t1
, tree t2
)
312 gcc_assert (TREE_CODE (t1
) == TREE_LIST
);
313 gcc_assert (TREE_CODE (t2
) == TREE_LIST
);
315 for (; t1
; t1
= TREE_CHAIN (t1
))
320 if (!compare_operand (TREE_VALUE (t1
), TREE_VALUE (t2
)))
321 return return_false ();
323 tree p1
= TREE_PURPOSE (t1
);
324 tree p2
= TREE_PURPOSE (t2
);
326 gcc_assert (TREE_CODE (p1
) == TREE_LIST
);
327 gcc_assert (TREE_CODE (p2
) == TREE_LIST
);
329 if (strcmp (TREE_STRING_POINTER (TREE_VALUE (p1
)),
330 TREE_STRING_POINTER (TREE_VALUE (p2
))) != 0)
331 return return_false ();
333 t2
= TREE_CHAIN (t2
);
337 return return_false ();
342 /* Verifies that trees T1 and T2 do correspond. */
345 func_checker::compare_variable_decl (const_tree t1
, const_tree t2
)
352 if (DECL_ALIGN (t1
) != DECL_ALIGN (t2
))
353 return return_false_with_msg ("alignments are different");
355 if (DECL_HARD_REGISTER (t1
) != DECL_HARD_REGISTER (t2
))
356 return return_false_with_msg ("DECL_HARD_REGISTER are different");
358 if (DECL_HARD_REGISTER (t1
)
359 && DECL_ASSEMBLER_NAME_RAW (t1
) != DECL_ASSEMBLER_NAME_RAW (t2
))
360 return return_false_with_msg ("HARD REGISTERS are different");
362 /* Symbol table variables are known to match before we start comparing
364 if (decl_in_symtab_p (t1
))
365 return decl_in_symtab_p (t2
);
366 ret
= compare_decl (t1
, t2
);
368 return return_with_debug (ret
);
371 /* Compare loop information for basic blocks BB1 and BB2. */
374 func_checker::compare_loops (basic_block bb1
, basic_block bb2
)
376 if ((bb1
->loop_father
== NULL
) != (bb2
->loop_father
== NULL
))
377 return return_false ();
379 class loop
*l1
= bb1
->loop_father
;
380 class loop
*l2
= bb2
->loop_father
;
384 if ((bb1
== l1
->header
) != (bb2
== l2
->header
))
385 return return_false_with_msg ("header");
386 if ((bb1
== l1
->latch
) != (bb2
== l2
->latch
))
387 return return_false_with_msg ("latch");
388 if (l1
->simdlen
!= l2
->simdlen
)
389 return return_false_with_msg ("simdlen");
390 if (l1
->safelen
!= l2
->safelen
)
391 return return_false_with_msg ("safelen");
392 if (l1
->can_be_parallel
!= l2
->can_be_parallel
)
393 return return_false_with_msg ("can_be_parallel");
394 if (l1
->dont_vectorize
!= l2
->dont_vectorize
)
395 return return_false_with_msg ("dont_vectorize");
396 if (l1
->force_vectorize
!= l2
->force_vectorize
)
397 return return_false_with_msg ("force_vectorize");
398 if (l1
->unroll
!= l2
->unroll
)
399 return return_false_with_msg ("unroll");
400 if (!compare_variable_decl (l1
->simduid
, l2
->simduid
))
401 return return_false_with_msg ("simduid");
406 /* Function visits all gimple labels and creates corresponding
407 mapping between basic blocks and labels. */
410 func_checker::parse_labels (sem_bb
*bb
)
412 for (gimple_stmt_iterator gsi
= gsi_start_bb (bb
->bb
); !gsi_end_p (gsi
);
415 gimple
*stmt
= gsi_stmt (gsi
);
417 if (glabel
*label_stmt
= dyn_cast
<glabel
*> (stmt
))
419 const_tree t
= gimple_label_label (label_stmt
);
420 gcc_assert (TREE_CODE (t
) == LABEL_DECL
);
422 m_label_bb_map
.put (t
, bb
->bb
->index
);
427 /* Basic block equivalence comparison function that returns true if
428 basic blocks BB1 and BB2 (from functions FUNC1 and FUNC2) correspond.
430 In general, a collection of equivalence dictionaries is built for types
431 like SSA names, declarations (VAR_DECL, PARM_DECL, ..). This infrastructure
432 is utilized by every statement-by-statement comparison function. */
435 func_checker::compare_bb (sem_bb
*bb1
, sem_bb
*bb2
)
437 gimple_stmt_iterator gsi1
, gsi2
;
440 gsi1
= gsi_start_nondebug_bb (bb1
->bb
);
441 gsi2
= gsi_start_nondebug_bb (bb2
->bb
);
443 while (!gsi_end_p (gsi1
))
445 if (gsi_end_p (gsi2
))
446 return return_false ();
448 s1
= gsi_stmt (gsi1
);
449 s2
= gsi_stmt (gsi2
);
451 int eh1
= lookup_stmt_eh_lp_fn
452 (DECL_STRUCT_FUNCTION (m_source_func_decl
), s1
);
453 int eh2
= lookup_stmt_eh_lp_fn
454 (DECL_STRUCT_FUNCTION (m_target_func_decl
), s2
);
457 return return_false_with_msg ("EH regions are different");
459 if (gimple_code (s1
) != gimple_code (s2
))
460 return return_false_with_msg ("gimple codes are different");
462 switch (gimple_code (s1
))
465 if (!compare_gimple_call (as_a
<gcall
*> (s1
),
466 as_a
<gcall
*> (s2
)))
467 return return_different_stmts (s1
, s2
, "GIMPLE_CALL");
470 if (!compare_gimple_assign (s1
, s2
))
471 return return_different_stmts (s1
, s2
, "GIMPLE_ASSIGN");
474 if (!compare_gimple_cond (s1
, s2
))
475 return return_different_stmts (s1
, s2
, "GIMPLE_COND");
478 if (!compare_gimple_switch (as_a
<gswitch
*> (s1
),
479 as_a
<gswitch
*> (s2
)))
480 return return_different_stmts (s1
, s2
, "GIMPLE_SWITCH");
484 case GIMPLE_EH_DISPATCH
:
485 if (gimple_eh_dispatch_region (as_a
<geh_dispatch
*> (s1
))
486 != gimple_eh_dispatch_region (as_a
<geh_dispatch
*> (s2
)))
487 return return_different_stmts (s1
, s2
, "GIMPLE_EH_DISPATCH");
490 if (!compare_gimple_resx (as_a
<gresx
*> (s1
),
491 as_a
<gresx
*> (s2
)))
492 return return_different_stmts (s1
, s2
, "GIMPLE_RESX");
495 if (!compare_gimple_label (as_a
<glabel
*> (s1
),
496 as_a
<glabel
*> (s2
)))
497 return return_different_stmts (s1
, s2
, "GIMPLE_LABEL");
500 if (!compare_gimple_return (as_a
<greturn
*> (s1
),
501 as_a
<greturn
*> (s2
)))
502 return return_different_stmts (s1
, s2
, "GIMPLE_RETURN");
505 if (!compare_gimple_goto (s1
, s2
))
506 return return_different_stmts (s1
, s2
, "GIMPLE_GOTO");
509 if (!compare_gimple_asm (as_a
<gasm
*> (s1
),
511 return return_different_stmts (s1
, s2
, "GIMPLE_ASM");
517 return return_false_with_msg ("Unknown GIMPLE code reached");
520 gsi_next_nondebug (&gsi1
);
521 gsi_next_nondebug (&gsi2
);
524 if (!gsi_end_p (gsi2
))
525 return return_false ();
527 if (!compare_loops (bb1
->bb
, bb2
->bb
))
528 return return_false ();
533 /* Verifies for given GIMPLEs S1 and S2 that
534 call statements are semantically equivalent. */
537 func_checker::compare_gimple_call (gcall
*s1
, gcall
*s2
)
542 if (gimple_call_num_args (s1
) != gimple_call_num_args (s2
))
545 t1
= gimple_call_fn (s1
);
546 t2
= gimple_call_fn (s2
);
547 if (!compare_operand (t1
, t2
))
548 return return_false ();
551 if (gimple_call_internal_p (s1
) != gimple_call_internal_p (s2
)
552 || gimple_call_ctrl_altering_p (s1
) != gimple_call_ctrl_altering_p (s2
)
553 || gimple_call_tail_p (s1
) != gimple_call_tail_p (s2
)
554 || gimple_call_return_slot_opt_p (s1
) != gimple_call_return_slot_opt_p (s2
)
555 || gimple_call_from_thunk_p (s1
) != gimple_call_from_thunk_p (s2
)
556 || gimple_call_va_arg_pack_p (s1
) != gimple_call_va_arg_pack_p (s2
)
557 || gimple_call_alloca_for_var_p (s1
) != gimple_call_alloca_for_var_p (s2
))
560 if (gimple_call_internal_p (s1
)
561 && gimple_call_internal_fn (s1
) != gimple_call_internal_fn (s2
))
564 tree fntype1
= gimple_call_fntype (s1
);
565 tree fntype2
= gimple_call_fntype (s2
);
566 if ((fntype1
&& !fntype2
)
567 || (!fntype1
&& fntype2
)
568 || (fntype1
&& !types_compatible_p (fntype1
, fntype2
)))
569 return return_false_with_msg ("call function types are not compatible");
571 tree chain1
= gimple_call_chain (s1
);
572 tree chain2
= gimple_call_chain (s2
);
573 if ((chain1
&& !chain2
)
574 || (!chain1
&& chain2
)
575 || !compare_operand (chain1
, chain2
))
576 return return_false_with_msg ("static call chains are different");
578 /* Checking of argument. */
579 for (i
= 0; i
< gimple_call_num_args (s1
); ++i
)
581 t1
= gimple_call_arg (s1
, i
);
582 t2
= gimple_call_arg (s2
, i
);
584 if (!compare_operand (t1
, t2
))
585 return return_false_with_msg ("GIMPLE call operands are different");
588 /* Return value checking. */
589 t1
= gimple_get_lhs (s1
);
590 t2
= gimple_get_lhs (s2
);
592 return compare_operand (t1
, t2
);
596 /* Verifies for given GIMPLEs S1 and S2 that
597 assignment statements are semantically equivalent. */
600 func_checker::compare_gimple_assign (gimple
*s1
, gimple
*s2
)
603 tree_code code1
, code2
;
606 code1
= gimple_expr_code (s1
);
607 code2
= gimple_expr_code (s2
);
612 code1
= gimple_assign_rhs_code (s1
);
613 code2
= gimple_assign_rhs_code (s2
);
618 for (i
= 0; i
< gimple_num_ops (s1
); i
++)
620 arg1
= gimple_op (s1
, i
);
621 arg2
= gimple_op (s2
, i
);
623 if (!compare_operand (arg1
, arg2
))
624 return return_false_with_msg ("GIMPLE assignment operands "
632 /* Verifies for given GIMPLEs S1 and S2 that
633 condition statements are semantically equivalent. */
636 func_checker::compare_gimple_cond (gimple
*s1
, gimple
*s2
)
639 tree_code code1
, code2
;
641 code1
= gimple_expr_code (s1
);
642 code2
= gimple_expr_code (s2
);
647 t1
= gimple_cond_lhs (s1
);
648 t2
= gimple_cond_lhs (s2
);
650 if (!compare_operand (t1
, t2
))
653 t1
= gimple_cond_rhs (s1
);
654 t2
= gimple_cond_rhs (s2
);
656 return compare_operand (t1
, t2
);
659 /* Verifies for given GIMPLE_LABEL stmts S1 and S2 that
660 label statements are semantically equivalent. */
663 func_checker::compare_gimple_label (const glabel
*g1
, const glabel
*g2
)
668 tree t1
= gimple_label_label (g1
);
669 tree t2
= gimple_label_label (g2
);
671 if (FORCED_LABEL (t1
) || FORCED_LABEL (t2
))
672 return return_false_with_msg ("FORCED_LABEL");
674 /* As the pass build BB to label mapping, no further check is needed. */
678 /* Verifies for given GIMPLE_SWITCH stmts S1 and S2 that
679 switch statements are semantically equivalent. */
682 func_checker::compare_gimple_switch (const gswitch
*g1
, const gswitch
*g2
)
684 unsigned lsize1
, lsize2
, i
;
686 lsize1
= gimple_switch_num_labels (g1
);
687 lsize2
= gimple_switch_num_labels (g2
);
689 if (lsize1
!= lsize2
)
692 tree t1
= gimple_switch_index (g1
);
693 tree t2
= gimple_switch_index (g2
);
695 if (!compare_operand (t1
, t2
))
698 for (i
= 0; i
< lsize1
; i
++)
700 tree label1
= gimple_switch_label (g1
, i
);
701 tree label2
= gimple_switch_label (g2
, i
);
703 /* Label LOW and HIGH comparison. */
704 tree low1
= CASE_LOW (label1
);
705 tree low2
= CASE_LOW (label2
);
707 if (!tree_int_cst_equal (low1
, low2
))
708 return return_false_with_msg ("case low values are different");
710 tree high1
= CASE_HIGH (label1
);
711 tree high2
= CASE_HIGH (label2
);
713 if (!tree_int_cst_equal (high1
, high2
))
714 return return_false_with_msg ("case high values are different");
716 if (TREE_CODE (label1
) == CASE_LABEL_EXPR
717 && TREE_CODE (label2
) == CASE_LABEL_EXPR
)
719 label1
= CASE_LABEL (label1
);
720 label2
= CASE_LABEL (label2
);
722 if (!compare_operand (label1
, label2
))
723 return return_false_with_msg ("switch label_exprs are different");
725 else if (!tree_int_cst_equal (label1
, label2
))
726 return return_false_with_msg ("switch labels are different");
732 /* Verifies for given GIMPLE_RETURN stmts S1 and S2 that
733 return statements are semantically equivalent. */
736 func_checker::compare_gimple_return (const greturn
*g1
, const greturn
*g2
)
740 t1
= gimple_return_retval (g1
);
741 t2
= gimple_return_retval (g2
);
743 /* Void return type. */
744 if (t1
== NULL
&& t2
== NULL
)
747 return compare_operand (t1
, t2
);
750 /* Verifies for given GIMPLEs S1 and S2 that
751 goto statements are semantically equivalent. */
754 func_checker::compare_gimple_goto (gimple
*g1
, gimple
*g2
)
758 dest1
= gimple_goto_dest (g1
);
759 dest2
= gimple_goto_dest (g2
);
761 if (TREE_CODE (dest1
) != TREE_CODE (dest2
) || TREE_CODE (dest1
) != SSA_NAME
)
764 return compare_operand (dest1
, dest2
);
767 /* Verifies for given GIMPLE_RESX stmts S1 and S2 that
768 resx statements are semantically equivalent. */
771 func_checker::compare_gimple_resx (const gresx
*g1
, const gresx
*g2
)
773 return gimple_resx_region (g1
) == gimple_resx_region (g2
);
776 /* Verifies for given GIMPLEs S1 and S2 that ASM statements are equivalent.
777 For the beginning, the pass only supports equality for
778 '__asm__ __volatile__ ("", "", "", "memory")'. */
781 func_checker::compare_gimple_asm (const gasm
*g1
, const gasm
*g2
)
783 if (gimple_asm_volatile_p (g1
) != gimple_asm_volatile_p (g2
))
786 if (gimple_asm_input_p (g1
) != gimple_asm_input_p (g2
))
789 if (gimple_asm_inline_p (g1
) != gimple_asm_inline_p (g2
))
792 if (gimple_asm_ninputs (g1
) != gimple_asm_ninputs (g2
))
795 if (gimple_asm_noutputs (g1
) != gimple_asm_noutputs (g2
))
798 /* We do not suppport goto ASM statement comparison. */
799 if (gimple_asm_nlabels (g1
) || gimple_asm_nlabels (g2
))
802 if (gimple_asm_nclobbers (g1
) != gimple_asm_nclobbers (g2
))
805 if (strcmp (gimple_asm_string (g1
), gimple_asm_string (g2
)) != 0)
806 return return_false_with_msg ("ASM strings are different");
808 for (unsigned i
= 0; i
< gimple_asm_ninputs (g1
); i
++)
810 tree input1
= gimple_asm_input_op (g1
, i
);
811 tree input2
= gimple_asm_input_op (g2
, i
);
813 if (!compare_asm_inputs_outputs (input1
, input2
))
814 return return_false_with_msg ("ASM input is different");
817 for (unsigned i
= 0; i
< gimple_asm_noutputs (g1
); i
++)
819 tree output1
= gimple_asm_output_op (g1
, i
);
820 tree output2
= gimple_asm_output_op (g2
, i
);
822 if (!compare_asm_inputs_outputs (output1
, output2
))
823 return return_false_with_msg ("ASM output is different");
826 for (unsigned i
= 0; i
< gimple_asm_nclobbers (g1
); i
++)
828 tree clobber1
= gimple_asm_clobber_op (g1
, i
);
829 tree clobber2
= gimple_asm_clobber_op (g2
, i
);
831 if (!operand_equal_p (TREE_VALUE (clobber1
), TREE_VALUE (clobber2
),
833 return return_false_with_msg ("ASM clobber is different");
839 } // ipa_icf_gimple namespace