Skip to content

Commit 52d9c46

Browse files
committed
assert that LHS and RHS profile are the same
1 parent d2979b4 commit 52d9c46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,9 @@ Value *InstCombinerImpl::SimplifySelectsFeedingBinaryOp(BinaryOperator &I,
14061406
// Profile weights for both LHS and RHS should be the same because they have
14071407
// the same idempotent conditional.
14081408
ProfileData = cast<SelectInst>(LHS)->getMetadata(LLVMContext::MD_prof);
1409+
assert(ProfileData ==
1410+
cast<SelectInst>(RHS)->getMetadata(LLVMContext::MD_prof) &&
1411+
"LHS and RHS select statements have different metadata!");
14091412

14101413
if (LHS->hasOneUse() && RHS->hasOneUse()) {
14111414
if (False && !True)

0 commit comments

Comments
 (0)