Skip to content

Commit 3a39346

Browse files
committed
[InstCombine] Remove unnecessary typed pointer handling (NFC)
1 parent 7df92fb commit 3a39346

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5689,13 +5689,8 @@ Instruction *InstCombinerImpl::foldICmpWithCastOp(ICmpInst &ICmp) {
56895689
Value *NewOp1 = nullptr;
56905690
if (auto *PtrToIntOp1 = dyn_cast<PtrToIntOperator>(ICmp.getOperand(1))) {
56915691
Value *PtrSrc = PtrToIntOp1->getOperand(0);
5692-
if (PtrSrc->getType()->getPointerAddressSpace() ==
5693-
Op0Src->getType()->getPointerAddressSpace()) {
5692+
if (PtrSrc->getType() == Op0Src->getType())
56945693
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-
}
56995694
} else if (auto *RHSC = dyn_cast<Constant>(ICmp.getOperand(1))) {
57005695
NewOp1 = ConstantExpr::getIntToPtr(RHSC, SrcTy);
57015696
}

0 commit comments

Comments
 (0)