DST_TYPE on value range in SRC_VR and store it to DST_VR. Return true if
the result is a range that is not VARYING nor UNDEFINED. */
-static bool
+bool
ipa_vr_operation_and_type_effects (vrange &dst_vr,
const vrange &src_vr,
enum tree_code operation,
/* Same as above, but the SRC_VR argument is an IPA_VR which must
first be extracted onto a vrange. */
-static bool
+bool
ipa_vr_operation_and_type_effects (vrange &dst_vr,
const ipa_vr &src_vr,
enum tree_code operation,
return irange::supports_p (type) || prange::supports_p (type);
}
+class ipa_vr;
+
+bool ipa_vr_operation_and_type_effects (vrange &dst_vr,
+ const vrange &src_vr,
+ enum tree_code operation,
+ tree dst_type, tree src_type);
+bool ipa_vr_operation_and_type_effects (vrange &dst_vr,
+ const ipa_vr &src_vr,
+ enum tree_code operation,
+ tree dst_type, tree src_type);
+
+
+
#endif /* IPA_CP_H */
gcc_unreachable ();
}
+ if (src->m_vr && src->m_vr->known_p ())
+ {
+ value_range svr (src->m_vr->type ());
+ if (!dst->m_vr || !dst->m_vr->known_p ())
+ ipa_set_jfunc_vr (dst, *src->m_vr);
+ else if (ipa_vr_operation_and_type_effects (svr, *src->m_vr,
+ NOP_EXPR,
+ dst->m_vr->type (),
+ src->m_vr->type ()))
+ {
+ value_range dvr;
+ dst->m_vr->get_vrange (dvr);
+ dvr.intersect (svr);
+ if (!dvr.undefined_p ())
+ ipa_set_jfunc_vr (dst, dvr);
+ }
+ }
+
if (src->agg.items
&& (dst_agg_p || !src->agg.by_ref))
{