[DebugInfo][LICM] Drop DebugLoc from IntrinsicInst when hoisting
authorJuan Manuel MARTINEZ CAAMAÑO <juamarti@amd.com>
Tue, 27 Sep 2022 12:15:36 +0000 (12:15 +0000)
committerJuan Manuel MARTINEZ CAAMAÑO <juamarti@amd.com>
Fri, 30 Sep 2022 09:12:35 +0000 (09:12 +0000)
commitdf7606a066b75ce55ae4a186c785f996e0985db1
tree37418a8f38c515e3ca7a2f6e41b8624014302572
parent853a1b72360f151e0a2e4d3e03036b7987d94cad
[DebugInfo][LICM] Drop DebugLoc from IntrinsicInst when hoisting

The DebugLoc is conserved when hoisting function calls, to ensure the
DIScope is preserved if inlining occurs.

This commit drops the DebugLoc in the case the call is an intrinsic
call that won't be lowered into a function call.

Differential Revision: https://reviews.llvm.org/D134429
llvm/lib/IR/DebugInfo.cpp
llvm/test/DebugInfo/Generic/licm-hoist-intrinsic-debug-loc.ll [new file with mode: 0644]