From: Yevgeny Rouban Date: Wed, 7 Aug 2019 07:17:45 +0000 (+0000) Subject: Force check prof branch_weights consistency in SwitchInstProfUpdateWrapper X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=608c99e6ad313214667861c8820e96308a248a62;p=llvm Force check prof branch_weights consistency in SwitchInstProfUpdateWrapper This patch turns on the prof branch_weights metadata consistency check in SwitchInstProfUpdateWrapper. If this patch causes a failure then please before reverting do report the IR that hits the assertion and try identifying the pass that introduces the inconsistency. We have to fix all such passes. See also the upcoming change https://reviews.llvm.org/D61179 in the Verifier. Reviewers: davidx, nikic, eraman, reames, chandlerc Reviewed By: davidx Differential Revision: https://reviews.llvm.org/D64061 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368129 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp index 2e7cad103c1..eb2f8827b11 100644 --- a/lib/IR/Instructions.cpp +++ b/lib/IR/Instructions.cpp @@ -49,7 +49,7 @@ static cl::opt SwitchInstProfUpdateWrapperStrict( "switch-inst-prof-update-wrapper-strict", cl::Hidden, cl::desc("Assert that prof branch_weights metadata is valid when creating " "an instance of SwitchInstProfUpdateWrapper"), - cl::init(false)); + cl::init(true)); //===----------------------------------------------------------------------===// // AllocaInst Class