[PATCH] D15306: [llvm-profdata] Add support for weighted merge of profile data (2nd try)

Nathan Slingerland via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 17:27:38 PST 2015


slingn added a comment.

OK, so it's not a bug in sys::fs::exists(). It's a bug in the test script text-format-errors.text:

  1- Detect invalid count
  RUN: not llvm-profdata show %p/Inputs/invalid-count-later.proftext 2>&1 | FileCheck %s --check-prefix=INVALID-COUNT-LATER
  RUN: not llvm-profdata merge %p/Inputs/invalid-count-later.proftext %p/Inputs/invalid-count-later.profdata -o %t.out 2>&1 | FileCheck %s --check-prefix=INVALID-COUNT-LATER
  INVALID-COUNT-LATER: error: {{.*}}invalid-count-later.proftext: Malformed instrumentation profile data

I stepped through with a debugger:

"C:/Users/Nathan/Sandbox/llvm/build/Debug/bin\llvm-profdata.EXE" "merge" "C:\Users\Nathan\Sandbox\llvm\test\tools\llvm-profdata/Inputs/invalid-count-later.proftext" "C:\Users\Nathan\Sandbox\llvm\test\tools\llvm-profdata/Inputs/invalid-count-later.profdata" "-o" "C:\Users\Nathan\Sandbox\llvm\build\test\tools\llvm-profdata\Output\text-format-errors.test.tmp.out"

  Input 1: C:\Users\Nathan\Sandbox\llvm\test\tools\llvm-profdata/Inputs/invalid-count-later.proftext
  Input 2: C:\Users\Nathan\Sandbox\llvm\test\tools\llvm-profdata/Inputs/invalid-count-later.profdata
                                                                                            ^^^^^^^^

And what do you know, the first mixed path exists and the check works just fine. The problem is that the second path really doesn't exist - so sys::fs::exists() rightly points this out:

  bad-hash.proftext   compat.profdata.v2   foo3bar3-1.proftext           sample-profile.proftext      weight-sample-foo.proftext
  bar3-1.proftext     empty.proftext       gcc-sample-profile.gcov       text-format-errors.text.bin
  basic.proftext      extra-word.proftext  inline-samples.afdo           weight-instr-bar.profdata
  c-general.profraw   foo3-1.proftext      invalid-count-later.proftext  weight-instr-foo.profdata
  compat.profdata.v1  foo3-2.proftext      no-counts.proftext            weight-sample-bar.proftext


http://reviews.llvm.org/D15306





More information about the llvm-commits mailing list