[PATCH] D20082: [ProfileData] Use SoftInstrProfErrors to count soft errors

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 11:48:34 PDT 2016


vsk added inline comments.

================
Comment at: lib/ProfileData/InstrProfWriter.cpp:169
@@ -168,3 +168,3 @@
 
-  instrprof_error Result = instrprof_error::success;
+  SoftInstrProfErrors SIPE;
   if (NewFunc) {
----------------
davidxl wrote:
> Do we really need to pass down the instance reference through all the interfaces? I suppose there should be one singleton instance of error, so some global error update APIs will do?
Good point. Wdyt of:

1. Adding a SoftInstrProfErrors member to InstrProfRecord, along with a getError() method (eventually takeError()).
2. Passing a SoftInstrProfErrors& to the InstrProfValueSiteRecord constructor.

That should un-clutter the interfaces.

A global SoftInstrProfErrors instance could see contention, and I'd like to avoid that. It would also make it awkward to enforce soft error handling once we move to Error/Expected: who would be responsible for handling errors which come out of a given record?


http://reviews.llvm.org/D20082





More information about the llvm-commits mailing list