[all-commits] [llvm/llvm-project] f42482: [DebugInfo][RemoveDIs] Don't convert debug-intrins...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Mon Nov 20 12:53:55 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f42482def236999b0f7896c09cd714b708861c8b
      https://github.com/llvm/llvm-project/commit/f42482def236999b0f7896c09cd714b708861c8b
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2023-11-20 (Mon, 20 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/IPO/SCCP.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/test/Transforms/InstCombine/assume.ll
    M llvm/test/Transforms/InstCombine/unreachable-dbg-info-modified.ll
    M llvm/test/Transforms/SCCP/ipsccp-branch-unresolved-undef.ll
    M llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll
    M llvm/test/Transforms/SimplifyCFG/branch-fold-dbg.ll
    M llvm/test/Transforms/SimplifyCFG/dbginfo.ll

  Log Message:
  -----------
  [DebugInfo][RemoveDIs] Don't convert debug-intrinsics to Unreachable (#72380)

It might seem obvious, but it's not a good idea to convert a
debug-intrinsic instruction into an UnreachableInst, as this means
things operate differently with and without the -g option. However this
can happen due to the "mutate the next instruction" API calls we make.
With RemoveDIs eliminating debug intrinsics, this behaviour is at risk
of changing, hence this patch ensures we only ever mutate the next _non_
debuginfo instruction into an Unreachable.

The tests instrumented with the --try... flag all exercise this, I've
added some metadata to a SCCP test to ensure it's exercised.




More information about the All-commits mailing list