[PATCH] D68390: [Mips] Emit proper ABI for _mcount calls

Mirko Brkusanin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 06:41:49 PDT 2019


mbrkusanin added a comment.

Simple use case if someone is unfamiliar with gpof and -pg options:

  clang++ test.cpp -pg  ... # compile with _mcount calls
  ./a.out                   # generates gmon.out
  gprof a.out               # shows report

For simple test.cpp:

  int main() {
    return 0;
  }

We now get proper results:

  ...
  index % time    self  children    called     name
                  0.00    0.00       1/1           __libc_start_main [620]
  [1]      0.0    0.00    0.00       1         main [1]
  ...

Tested with following configurations:

  mips -fpic -fast-isel=false         (used for _mcount: Mips::JALRPseudo)
  mips -fpic                          (used for _mcount: Mips::JALR)
  mips  -fast-isel=false              (used for _mcount: Mips::JAL)
  mips                                (used for _mcount: Mips::JAL)
  mips64 -fpic -fast-isel=false       (used for _mcount: Mips::JALR64Pseudo)
  mips64 -fpic                        (used for _mcount: Mips::JALR64Pseudo)
  mips64 -fast-isel=false             (used for _mcount: Mips::JALR64Pseudo)
  mips64                              (used for _mcount: Mips::JALR64Pseudo)
  micromips -fpic -fast-isel=false    (used for _mcount: Mips::JALR16_MM)
  micromips -fpic                     (used for _mcount: Mips::JALR16_MM)
  micromips -fast-isel=false          (used for _mcount: Mips::JAL_MM)
  micromips                           (used for _mcount: Mips::JAL_MM)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68390/new/

https://reviews.llvm.org/D68390





More information about the llvm-commits mailing list