================
@@ -4233,6 +4234,17 @@ Instruction
*InstCombinerImpl::visitBranchInst(BranchInst &BI) {
m_OneUse(m_LogicalAnd(m_Value(X), m_OneUse(m_Not(m_Value(Y))))))) {
Value *NotX = Builder.CreateNot(X, "not." + X->getName());
Value *Or = Builder.CreateLogicalOr(NotX, Y);
+ if (!ProfcheckDisableMetadataFixes) {
+ if (auto *OrInst = dyn_cast<Instruction>(Or)) {
+ if (auto *CondInst = dyn_cast<Instruction>(Cond)) {
+ SmallVector<uint32_t> Weights;
+ if (extractBranchWeights(*CondInst, Weights) && Weights.size() == 2)
{
----------------
mtrofin wrote:
`assert(Weights.size() == 2)`? (like why would it not be 2)
https://github.com/llvm/llvm-project/pull/175939
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits