On 10/24/2016 01:28 AM, Richard Biener wrote:
[ big snip ]
+
+ /* Update all statements in stmts.
+ if stmt is lhs = op1 TRUNC_DIV_EXPR op2, change to lhs =
REALPART_EXPR<divmod_tmp>
+ if stmt is lhs = op1 TRUNC_MOD_EXPR op2, change to lhs =
IMAGPART_EXPR<divmod_tmp>. */
I'd just emit a copy from RES to the appropriate lhs operand just after
the
divmod and delete the now unnecessary TRUNC_DIV_EXPR and TRUNC_MOD_EXPR
statements.
That sounds like a good idea.
Um sorry, not sure if I understood this part.
For eg:
t1 = x / y;
t2 = x % y;
do we want to transform it to:
complex_tmp = DIVMOD (x, y);
div_tmp = REALPART_EXPR<complex_tmp>
mod_tmp = IMAGPART_EXPR<complex_tmp>
complex_tmp = DIVMOD (x, y)
t1 = REALPART_EXPR (complex_tmp)
t2 = IMAGPART_EXPR (compex_tmp)
Then remove the
t1 = x/y
t2 = x%y
statements
OTOH implementation-wise that's more complicated.
If so, then I wouldn't bother. I only mention it because I've found
that model is sometimes easier on the implementation side. I don't
consider it a big deal.
jeff