[all-commits] [llvm/llvm-project] c9465e: [DebugInfo][RemoveDIs] Assert if we mix PHIs and d...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Mon Mar 11 01:59:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9465e4771c93adfbc99ffca5963a48a5334d98d
      https://github.com/llvm/llvm-project/commit/c9465e4771c93adfbc99ffca5963a48a5334d98d
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2024-03-11 (Mon, 11 Mar 2024)

  Changed paths:
    M llvm/lib/IR/Instruction.cpp

  Log Message:
  -----------
  [DebugInfo][RemoveDIs] Assert if we mix PHIs and debug-info (#84054)

A potentially erroneous code construction with the work we've done to
remove debug intrinsics, is inserting PHIs into blocks when the position
hasn't been "sourced correctly". Specifically, if you have:

    %foo = PHI
    #dbg_value
    %bar = add i32...

And plan on inserting a new PHI, you have to use the iterator form of
`getFirstNonPHI` or getFirstInsertionPt (or begin()) to acquire an
iterator that tells the debug-info maintenance code "this is supposed to
be at the start of the block, put it in front of #dbg_value". We can
detect call-sites that aren't doing this at runtime, and should do with
this assertion. It might invalidate code that's doing something very
unexpected, like walking backwards to find a PHI, then going forwards,
then inserting: however that's just an inefficient way of calling
`getFirstNonPHI`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list