As far as I understand getLoopID needs to look at the intersection of
- BasicBlocks in the loop and
- Predecessors of the loop header
and check each of those terminators for a !loop metadata node. However,
what getLoopID is currently doing is iterate through the basic blocks
and require that every one of them have an edge back to the loop header
with the appropriate metadata. This seems incorrect and causes situations
in which a LoopID set with setLoopID cannot be subsequently retrieved with
getLoopID.
Please reflow this comment