Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Coroutines] Verify normalization was not missed (llvm#108096)
* Add asserts to verify normalization of the coroutine happened. * This will be important when normalization becomes part of an ABI object. --- From a previous discussion here llvm#108076 Normalization performs these important steps: split around each suspend, this adds BBs before/after each suspend so each suspend now exists in its own block. split around coro.end (similar to above) break critical edges and add single-edge phis in the new blocks (also removing other single-edge phis). Each of these things can individually be tested A) Check that each suspend is the only inst in its BB B) Check that coro.end is the only inst in its BB C) Check that each edge of a multi-edge phis is preceded by single-edge phi in an immediate pred For 1) and 2) I believe the purpose of the transform is in part for suspend crossing info's analysis so it can specifically 'mark' the suspend blocks and identify the end of the coroutine. There are some existing places within suspend crossing info that visit the CoroSuspends and CoroEnds so we could check A) and B) there. For 3) I believe the purpose of this transform is for insertSpills to work properly. Infact there is already a check for the result of this transform! assert(PN->getNumIncomingValues() == 1 && "unexpected number of incoming " "values in the PHINode"); I think to verify the result of normalization we just need to add checks A) and B) to suspend crossing info.
- Loading branch information