[SampleFDO] Report error when reading a bad/incompatible profile instead of
authorWei Mi <wmi@google.com>
Fri, 22 Jan 2021 23:09:21 +0000 (15:09 -0800)
committerWei Mi <wmi@google.com>
Mon, 25 Jan 2021 18:28:23 +0000 (10:28 -0800)
commitc9cd9a006632419ce7346e50564e6347a93181cc
tree21381a88539d730c7d219c74115f285e2934f3d3
parent299b0e5ee9ee30093ccc9fe78b7797c16887150d
[SampleFDO] Report error when reading a bad/incompatible profile instead of
turning off SampleFDO silently.

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. This patch
change the behavior to report error.

Differential Revision: https://reviews.llvm.org/D95269
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/Inputs/bad.extbinary.afdo [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/profile-format.ll