Skip to content

Commit 42ce628

Browse files
committed
[ValueTracking] Handle incompatible types instead of asserting in isKnownNonEqual; NFC
Downstream hit this assert, since it doesn't really make any difference, just change code to return false.
1 parent 5fcd059 commit 42ce628

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,9 @@ bool llvm::isKnownNonEqual(const Value *V1, const Value *V2,
310310
const DataLayout &DL, AssumptionCache *AC,
311311
const Instruction *CxtI, const DominatorTree *DT,
312312
bool UseInstrInfo) {
313-
assert(V1->getType() == V2->getType() &&
314-
"Testing equality of non-equal types!");
313+
// We don't support looking through casts.
314+
if (V1 == V2 || V1->getType() != V2->getType())
315+
return false;
315316
auto *FVTy = dyn_cast<FixedVectorType>(V1->getType());
316317
APInt DemandedElts =
317318
FVTy ? APInt::getAllOnes(FVTy->getNumElements()) : APInt(1, 1);

0 commit comments

Comments
 (0)