Hi!

I'm in favor of outlining all of these.

> +  if (!simple_sets_p)
>+    return false;

>+      if (entry->require_same_dest
>+         && !sched1
>+         && prev_dest_regno != curr_dest_regno)
>+       continue;
I would be careful with trying to handle common conditions this way.
It won't scale if new fusible pairs are added that deviate from those.
E.g. We will add a fusion case with a branch instruction and `is_simple_sets_p` 
will not be true for that case. 
And we will need to another field in the table for all fusible pairs.

IMO it is cleaner to move all the condition checking inside the checker 
function. Then you will retain maximum flexibility.
You can create util functions for these checks 

>+                    unsigned int prev_dest_regno ATTRIBUTE_UNUSED,
>+                    unsigned int curr_dest_regno ATTRIBUTE_UNUSED)
You don't have to pass those in for every checker, they are cheap to compute.
You can add a utility function to compute those when needed.

Worst case, you can add a struct/class param to the checkers to pass in 
state/utils.

Thanks,
Michiel

Reply via email to