summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-30 21:06:18 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-30 21:06:18 +0000
commitf9dd19f49833e083f8d32ea015d6d5b57be5e4f4 (patch)
treed4c99bee9757bfd957f43603069a3c9a3105b50c /lib
parente5388399c795edd3687b08f33446a253d65247d6 (diff)
downloadllvm-f9dd19f49833e083f8d32ea015d6d5b57be5e4f4.tar.gz
llvm-f9dd19f49833e083f8d32ea015d6d5b57be5e4f4.tar.bz2
llvm-f9dd19f49833e083f8d32ea015d6d5b57be5e4f4.tar.xz
Constant fold ptrtoint + compare with address spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCompares.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 402f8c3302..f691350fed 100644
--- a/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -1782,7 +1782,7 @@ Instruction *InstCombiner::visitICmpInstWithCastAndCast(ICmpInst &ICI) {
// Turn icmp (ptrtoint x), (ptrtoint/c) into a compare of the input if the
// integer type is the same size as the pointer type.
if (TD && LHSCI->getOpcode() == Instruction::PtrToInt &&
- TD->getPointerSizeInBits() == DestTy->getIntegerBitWidth()) {
+ TD->getPointerTypeSizeInBits(SrcTy) == DestTy->getIntegerBitWidth()) {
Value *RHSOp = 0;
if (Constant *RHSC = dyn_cast<Constant>(ICI.getOperand(1))) {
RHSOp = ConstantExpr::getIntToPtr(RHSC, SrcTy);