[PGO][CHR] Guard against 0-to-0 branch weight and avoid division by zero crash.
authorHiroshi Yamauchi <yamauchi@google.com>
Mon, 13 Jan 2020 22:19:45 +0000 (14:19 -0800)
committerHiroshi Yamauchi <yamauchi@google.com>
Mon, 13 Jan 2020 22:38:58 +0000 (14:38 -0800)
commit7b9f8e17d15d7516b186c0a85de71133b780f939
tree30bf5c3c8409f69d23da171579cfb1572d94cb13
parenta506f7f9105eec4baac296d21c922457d6f4b52a
[PGO][CHR] Guard against 0-to-0 branch weight and avoid division by zero crash.

Summary: This fixes a crash in internal builds under SamplePGO.

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72653
llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
llvm/test/Transforms/PGOProfile/chr.ll