pre_expr translated;
translated = phi_translate (expr, set, NULL, pred, phiblock);
- /* Don't add constants or empty translations to the cache, since
- we won't look them up that way, or use the result, anyway. */
- if (translated && !value_id_constant_p (get_expr_value_id (translated)))
+ /* Don't add empty translations to the cache */
+ if (translated)
phi_trans_add (expr, translated, pred);
if (translated != NULL)
VN_INFO (forcedname)->value_id = get_next_value_id ();
nameexpr = get_or_alloc_expr_for_name (forcedname);
add_to_value (VN_INFO (forcedname)->value_id, nameexpr);
- bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
+ if (!in_fre)
+ bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
bitmap_value_replace_in_set (AVAIL_OUT (block), nameexpr);
}
mark_symbols_for_renaming (stmt);
should give us back a constant with the right type.
*/
tree constant = PRE_EXPR_CONSTANT (eprime);
- if (TREE_TYPE (constant) != type)
+ if (!useless_type_conversion_p (type, TREE_TYPE (constant)))
{
tree builtexpr = fold_convert (type, constant);
- if (is_gimple_min_invariant (builtexpr))
- {
- PRE_EXPR_CONSTANT (eprime) = builtexpr;
- }
- else
+ if (!is_gimple_min_invariant (builtexpr))
{
tree forcedexpr = force_gimple_operand (builtexpr,
&stmts, true,
NULL);
- if (is_gimple_min_invariant (forcedexpr))
- {
- PRE_EXPR_CONSTANT (eprime) = forcedexpr;
- }
- else
+ if (!is_gimple_min_invariant (forcedexpr))
{
if (forcedexpr != builtexpr)
{