[llvm][misexpect] Re-enable MisExpect for SampleProfiling
authorPaul Kirth <paulkirth@google.com>
Fri, 26 Aug 2022 18:14:39 +0000 (18:14 +0000)
committerPaul Kirth <paulkirth@google.com>
Fri, 26 Aug 2022 20:24:10 +0000 (20:24 +0000)
commit3155e3070c49b31b8d189f5f6caf376fcb82fcfb
treefc9b130e8f98751408a9753faddae06e852bc331
parenta8166d8801258fe793c81dd5d6c5f11e67fea280
[llvm][misexpect] Re-enable MisExpect for SampleProfiling

MisExpect was occasionally crashing under SampleProfiling, due to a division by zero.
We worked around that in D124302 by changing the assert to an early return.
This patch is intended to add a test case for the crashing scenario and
re-enable MisExpect for SampleProfiling.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D124481
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/lib/Transforms/Utils/MisExpect.cpp
llvm/test/Transforms/SampleProfile/Inputs/misexpect.prof [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/misexpect-zero.ll [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/misexpect.ll [new file with mode: 0644]