On 05/22/2013 02:54 AM, Kyrylo Tkachov wrote: > From what I understand, using define_subst would mean creating a > define_subst for every pattern that can be "predicable"? There are at least > 600 predicable patterns in the arm backend, so that would be infeasible.
No, define_subst works across patterns, keyed by attributes. Exactly like cond_exec, really. But what you ought to be able to do right now is (define_subst "ds_predicable" [(match_operand 0)] "" [(cond_exec (blah) (match_dup 0))]) (define_subst_attr "ds_predicable_enabled" "ds_predicable" "no" "yes"0 (define_insn "blah" [(blah)] "" "@ blah blah" [(set_attr "ds_predicable" "yes") (set_attr "ds_predicated" "<ds_predicable_enabled>")]) At which point you can define "enabled" in terms of ds_predicated plus whatever. With a small bit of work we ought to be able to move that ds_predicated attribute to the define_subst itself, so that you don't have to replicate that set_attr line N times. I think that's more or less what you were suggesting with your cond_exec extension, yes? r~