This patch fixes the problem reported in https://reviews.llvm.org/D107219.
Could you please describe the issue and fix in the pat h description? Is there anything we can do to proactively check for similar issues in the LICM code? Originally there were very few places which required special handling for the loop-nest mode, but now it seems more widespread changes might be necessary.
it would be good to check for something other than just the return code in this test. Also, can you clean up the basic block names and maybe get rid of the unreachable?