[IROutliner] Make sure that loop debug info is stripped.
authorAndrew Litteken <andrew.litteken@gmail.com>
Mon, 14 Mar 2022 04:45:29 +0000 (23:45 -0500)
committerAndrew Litteken <andrew.litteken@gmail.com>
Thu, 17 Mar 2022 20:41:53 +0000 (14:41 -0600)
commitf7d90ad57bef473e72119c0251e12e1915121b45
tree7bc1c895bca559f1827d7c847aae1f679017e13e
parent518a837e93e48325991e525d4c2c72321b428334
[IROutliner] Make sure that loop debug info is stripped.

As pointed out in https://github.com/llvm/llvm-project/issues/54155#issuecomment-1057465479, there was a crash when loop info was being outlined. It was not being properly stripped and adjusted, so would point to the wrong location. This uses similar logic found in the CodeExtractor to adjust the loop debug info.

Reviewer: fhahn, paquette

Differential Revision: https://reviews.llvm.org/D120869
llvm/lib/Transforms/IPO/IROutliner.cpp
llvm/test/Transforms/IROutliner/outlining-strip-loop-info.ll [new file with mode: 0644]