[Analysis] Remove an unreachable check. NFC. (#152874)

Binops never produce pointer values.
This commit is contained in:
Yingwei Zheng 2025-08-10 14:43:40 +08:00 committed by GitHub
parent 052c38be82
commit 2242e28671
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -276,8 +276,7 @@ static bool AreEquivalentAddressValues(const Value *A, const Value *B) {
// this function is only used when one address use dominates the // this function is only used when one address use dominates the
// other, which means that they'll always either have the same // other, which means that they'll always either have the same
// value or one of them will have an undefined value. // value or one of them will have an undefined value.
if (isa<BinaryOperator>(A) || isa<CastInst>(A) || isa<PHINode>(A) || if (isa<CastInst>(A) || isa<PHINode>(A) || isa<GetElementPtrInst>(A))
isa<GetElementPtrInst>(A))
if (const Instruction *BI = dyn_cast<Instruction>(B)) if (const Instruction *BI = dyn_cast<Instruction>(B))
if (cast<Instruction>(A)->isIdenticalToWhenDefined(BI)) if (cast<Instruction>(A)->isIdenticalToWhenDefined(BI))
return true; return true;