Skip to content

Commit 7117fbb

Browse files
committed
add assert
1 parent dd6eff5 commit 7117fbb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,8 @@ Value *InstCombinerImpl::foldEqOfParts(Value *Cmp0, Value *Cmp1, bool IsAnd) {
11921192
CmpInst::Predicate Pred = IsAnd ? CmpInst::ICMP_EQ : CmpInst::ICMP_NE;
11931193
auto GetMatchPart = [&](Value *CmpV,
11941194
unsigned OpNo) -> std::optional<IntPart> {
1195+
assert(CmpV->getType()->isIntOrIntVectorTy(1) && "Must be bool");
1196+
11951197
Value *X, *Y;
11961198
// icmp ne (and x, 1), (and y, 1) <=> trunc (xor x, y) to i1
11971199
// icmp eq (and x, 1), (and y, 1) <=> not (trunc (xor x, y) to i1)

0 commit comments

Comments
 (0)