File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -2077,15 +2077,11 @@ Instruction *InstCombinerImpl::visitIntToPtr(IntToPtrInst &CI) {
20772077 Value *Base;
20782078 Value *Offset;
20792079 if (match (CI.getOperand (0 ),
2080- m_Add (m_PtrToInt (m_Value (Base)), m_Value (Offset))) &&
2080+ m_Add (m_PtrToIntSameSize (DL, m_Value (Base)), m_Value (Offset))) &&
2081+ CI.getType ()->getPointerAddressSpace () ==
2082+ Base->getType ()->getPointerAddressSpace () &&
20812083 all_of (CI.users (), IsaPred<ICmpInst>)) {
2082- Type *BasePtrTy = Base->getType ();
2083- if (CI.getType ()->getPointerAddressSpace () ==
2084- BasePtrTy->getPointerAddressSpace () &&
2085- DL.getTypeSizeInBits (BasePtrTy) ==
2086- DL.getTypeSizeInBits (CI.getSrcTy ())) {
2087- return GetElementPtrInst::Create (Builder.getInt8Ty (), Base, Offset);
2088- }
2084+ return GetElementPtrInst::Create (Builder.getInt8Ty (), Base, Offset);
20892085 }
20902086
20912087 if (Instruction *I = commonCastTransforms (CI))
You can’t perform that action at this time.
0 commit comments