Previously LCSSA was getting broken by placing instructions into the
(newly) inner *header* instead of the *pre*header.
Fixes PR43474
 Differential  D75943  
[LoopInterchange] Fix interchanging contents of preheader BBs Authored by alexey.zhikhar on Mar 10 2020, 10:12 AM. 
Details Previously LCSSA was getting broken by placing instructions into the Fixes PR43474 
Diff Detail 
 Event TimelineComment Actions Thanks for the patch! It mostly looks good, just a few small comments inline. 
 
 Comment Actions LGTM, with the remaining comments, thanks! 
 Comment Actions I think it would be good to update the title to highlight the details of the patch, something like: [LoopInterchange] Fix interchanging contents of preheader BBs.  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The assertions here might be a bit over-conservative. I think isLCSSAForm can potentially be expensive, so I would be slightly in favor of dropping them.