1. Introduce a new BB bit flag and set it for the header BB of a loop that
has no data dependencies. This approach already works, but only if the old
loop optimizer (pass_loop_optimize) is disabled (otherwise the bit doesn't
survive).
Which will happen in 4.2.
One potential problem is that the loop header BB may change
between the tree-level and SMS as result of some optimization pass (can
that really happen?)
I don't know, but I'd not answer with a definite no.
I'm not an expert, but ISTR that SMSable loops are all do-while loops,
and composed of a single basic block If this is true, why not mark the
loop *body* instead of the header?
3. Use insn_notes - introduce a new note "NOTE_INSN_NO_DEPS_IN_LOOP" to be
inserted after the "NOTE_INSN_LOOP_BEG" for relevant loops.
This is a no-no. pass_loop_optimize will disappear in 4.2, and loop
notes will disappear together with it (and with much joy).
Paolo