Force check prof branch_weights consistency in SwitchInstProfUpdateWrapper
authorYevgeny Rouban <yevgeny.rouban@azul.com>
Wed, 7 Aug 2019 07:17:45 +0000 (07:17 +0000)
committerYevgeny Rouban <yevgeny.rouban@azul.com>
Wed, 7 Aug 2019 07:17:45 +0000 (07:17 +0000)
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

llvm-svn: 368129

llvm/lib/IR/Instructions.cpp

index 2e7cad103c12c499f585c9c97f504fa01e2ffb66..eb2f8827b1161ba98782a2feb7f226e69df73375 100644 (file)
@@ -49,7 +49,7 @@ static cl::opt<bool> 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