[Coroutines] Enhance symmetric transfer for constant CmpInst
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 12 Jan 2022 02:14:37 +0000 (10:14 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 12 Jan 2022 02:14:37 +0000 (10:14 +0800)
commit403772ff1ce5618c8d02316531386b415312274a
treed22bb199d65478f828a4aa105420de91d953bc20
parent345223a7be3c3c93a10f8453d96287a3a03b6754
[Coroutines] Enhance symmetric transfer for constant CmpInst

This fixes bug52896.

Simply, some symmetric transfer optimization chances get invalided due
to we delete some inlined optimization passes in 822b92a. This would
cause stack-overflow in some situations which should be avoided by the
design of coroutine. This patch tries to fix this by transforming the
constant CmpInst instruction which was done in the deleted passes.

Reviewed By: rjmccall, junparser

Differential Revision: https://reviews.llvm.org/D116327
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
llvm/test/Transforms/Coroutines/coro-split-musttail4.ll