Commits

Michael Gottesman committed 4f69bfc77f9
[arc] Always visit terminators bottom up so we can handle try_apply correctly. Previously, we relied on a quirk in the ARC optimizer so that we only need to visit terminators top down. This simplified the dataflow. Sadly, try_apply changes this since it is a terminator that provides a call with the value, causing this assumption to break program correctness. Now during the bottom up traversal, while performing the dataflow for a block B, we (after visiting all instructions), visit B's predecessors to see if any of them have a terminator that is a use or decrement. We then take the most conservative result among all of the terminators and advance the sequence accordingly. I do not think that we can have multiple such predecessors today since all interesting terminators can not have any critical edges to successors. Thus if our block is a successor of any such block, it can not have any other predecessors. This is mainly for future proofing if we decide that this is able to be done in the future. rdar://23853221 SR-102