File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -5689,13 +5689,8 @@ Instruction *InstCombinerImpl::foldICmpWithCastOp(ICmpInst &ICmp) {
5689
5689
Value *NewOp1 = nullptr ;
5690
5690
if (auto *PtrToIntOp1 = dyn_cast<PtrToIntOperator>(ICmp.getOperand (1 ))) {
5691
5691
Value *PtrSrc = PtrToIntOp1->getOperand (0 );
5692
- if (PtrSrc->getType ()->getPointerAddressSpace () ==
5693
- Op0Src->getType ()->getPointerAddressSpace ()) {
5692
+ if (PtrSrc->getType () == Op0Src->getType ())
5694
5693
NewOp1 = PtrToIntOp1->getOperand (0 );
5695
- // If the pointer types don't match, insert a bitcast.
5696
- if (Op0Src->getType () != NewOp1->getType ())
5697
- NewOp1 = Builder.CreateBitCast (NewOp1, Op0Src->getType ());
5698
- }
5699
5694
} else if (auto *RHSC = dyn_cast<Constant>(ICmp.getOperand (1 ))) {
5700
5695
NewOp1 = ConstantExpr::getIntToPtr (RHSC, SrcTy);
5701
5696
}
You can’t perform that action at this time.
0 commit comments