[all-commits] [llvm/llvm-project] d3d49b: [InstrProfiling] Don't attempt to create duplicate...

Alan Phipps via All-commits all-commits at lists.llvm.org
Sat Nov 11 16:34:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d3d49bca3ed968226ab9dc22f27d779eeb973c22
      https://github.com/llvm/llvm-project/commit/d3d49bca3ed968226ab9dc22f27d779eeb973c22
  Author: Alan Phipps <a-phipps at ti.com>
  Date:   2023-11-11 (Sat, 11 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
    A llvm/test/Instrumentation/InstrProfiling/inline-data-var.ll

  Log Message:
  -----------
  [InstrProfiling] Don't attempt to create duplicate data variables. (#71998)

Fixes a bug introduced by
commit f95b2f1acf11 ("Reland [InstrProf][compiler-rt] Enable MC/DC
Support in LLVM Source-based Code Coverage (1/3)")

createDataVariable() needs to check that a data variable wasn't already
created before creating it. Previously, this was done inadvertantly in
getOrCreateRegionCounters(), which checked that the RegionCounters was
not created multiple times before creating the counter section and the
data variable. When the creation of the data variable was abstracted
into its own function (createDataVariable()), there was no corresponding
check. This was failing on a case in which an instrumented function was
being inlined into multiple functions and a duplicate data variable was
created, which led to a segfault in emitNameData(). Test case added
based on the repro that also ensures a single data variable was created
in this case.




More information about the All-commits mailing list