aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantFold.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-11-03 12:20:07 +0100
committerNikita Popov <npopov@redhat.com>2023-11-03 12:20:07 +0100
commitfe206578f2e9b864ec6a703974a0e2a9001bb11b (patch)
tree3a310825434a1caca3737fddb7eb405adc966706 /llvm/lib/IR/ConstantFold.cpp
parentc1a9eabf56db21392587f76b4abaa30a01f3643a (diff)
downloadllvm-fe206578f2e9b864ec6a703974a0e2a9001bb11b.zip
llvm-fe206578f2e9b864ec6a703974a0e2a9001bb11b.tar.gz
llvm-fe206578f2e9b864ec6a703974a0e2a9001bb11b.tar.bz2
[ConstantFold] Remove handling for comparison of bitcasted global (NFCI)
The bitcast will be folded away in this case, no need to handle it explicitly.
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 1d77857..a10796e 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -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;