Currently sample loader pass turns off SampleFDO optimization silently when it sees error in reading the profile. This behavior will defeat the tests which could have caught those bad/incompatible profile problems and let the problem slip to release or production. This patch change the behavior and report an error when reading a bad profile.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
A build command has samplefdo flag in place, but it cannot perform the samplefdo optimization because the input profile cannot be read properly. That is an error case which can be fixed. So I think it should be an error. From my understanding, a warning should be used in the case that there is something concerning but likely there is nothing to be fixed, like profile mismatch in instrument FDO.
Just above the error reporting I added, there has already been another error handling dealing the case that a profile cannot be opened. I think these two cases are similar.
LGTM. Thanks for tightening this up. though I think warning does give others more flexibility in how/when to respond to this - in the end, this is not a build break, but a performance issue.