[ConstantFold] Remove handling for comparison of bitcasted global (NFCI)

The bitcast will be folded away in this case, no need to handle it
explicitly.
This commit is contained in:
Nikita Popov 2023-11-03 12:20:07 +01:00
parent c1a9eabf56
commit fe206578f2

View File

@ -1244,12 +1244,6 @@ static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2,
switch (CE1->getOpcode()) {
case Instruction::BitCast:
// If this is a global value cast, check to see if the RHS is also a
// GlobalValue.
if (const GlobalValue *GV = dyn_cast<GlobalValue>(CE1Op0))
if (const GlobalValue *GV2 = dyn_cast<GlobalValue>(V2))
return areGlobalsPotentiallyEqual(GV, GV2);
// We can't evaluate floating point casts or truncations.
if (CE1Op0->getType()->isFPOrFPVectorTy())
break;