Skip to content

Commit

Permalink
[ConstantFold] Remove handling for comparison of bitcasted global (NFCI)
Browse files Browse the repository at this point in the history
The bitcast will be folded away in this case, no need to handle it
explicitly.
  • Loading branch information
nikic committed Nov 3, 2023
1 parent c1a9eab commit fe20657
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions llvm/lib/IR/ConstantFold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fe20657

Please sign in to comment.