https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93084
--- Comment #8 from fxue at gcc dot gnu.org ---
I checked llvm source code, the recursive call lies in Constant
*llvm::ConstantFoldInsertValueInstruction(), but in dump, I noticed that call
edge is
_ZN4llvm34ConstantFoldInsertValueInstructionEPNS_8ConstantES1_NS_8ArrayRefIjEE/1977266
->
_ZN4llvm34ConstantFoldInsertValueInstructionEPNS_8ConstantES1_NS_8ArrayRefIjEE.localalias/13443902,
which means caller and callee are different graph nodes?
If so, self_recursively_generated_p () will return false, and cause infinite
propagation, please refer to the code:
if (!src->val || CS->CALLER != CS->CALLEE->FUNCTION_SYMBOL() ()
|| src->val == val)
return false;
Another question is that this call edge is in scc, but becomes non-self
recursive due to some transformations. And in
propagate_vals_across_arith_jfunc(), we check a self-recursive call by
comparing source ipcp_lattice with target ipcp_lattice, with the assumption
that caller and callee of a self recursive call should have identical
ipcp_lattices.
if (SRC_LAT != DEST_LAT || param_ipa_cp_max_recursive_depth < 1)
return dest_lat->set_contains_variable ();
Then is there a case that a ipcp_lattice be shared by different cgraph nodes?