[llvm] [SimplifyCFG] Refine metadata handling during instruction hoisting (PR #158448)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 12:24:38 PDT 2025


================
@@ -3387,12 +3387,14 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI,
   // Metadata can be dependent on the condition we are hoisting above.
   // Strip all UB-implying metadata on the instruction. Drop the debug loc
   // to avoid making it appear as if the condition is a constant, which would
-  // be misleading while debugging.
+  // be misleading while debugging. However, make sure to keep debug info
+  // for calls as inlinable function calls in a function with debug info must
+  // have a !dbg location.
----------------
nikic wrote:

I'd drop the comment change now that this is no longer handled in here. (dropLocation has it's own comments on this.)

https://github.com/llvm/llvm-project/pull/158448


More information about the llvm-commits mailing list