diff options
| author | Micah Villmow <villmow@gmail.com> | 2012-10-11 21:27:41 +0000 |
|---|---|---|
| committer | Micah Villmow <villmow@gmail.com> | 2012-10-11 21:27:41 +0000 |
| commit | 0c61134d8d00b38f5f09233957317b23a408bd55 (patch) | |
| tree | ee822ef49633f0d80ce4ce8f4b8d99485c4f2dc1 /llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | |
| parent | 5968b1b71f880582dd9cc57e8f3669ba100ee9f9 (diff) | |
| download | bcm5719-llvm-0c61134d8d00b38f5f09233957317b23a408bd55.tar.gz bcm5719-llvm-0c61134d8d00b38f5f09233957317b23a408bd55.zip | |
Revert 165732 for further review.
llvm-svn: 165747
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp index f3f3f8f585d..b59210a9df1 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -1293,16 +1293,15 @@ Instruction *InstCombiner::visitIntToPtr(IntToPtrInst &CI) { // If the source integer type is not the intptr_t type for this target, do a // trunc or zext to the intptr_t type, then inttoptr of it. This allows the // cast to be exposed to other transforms. - unsigned AS = CI.getAddressSpace(); if (TD) { if (CI.getOperand(0)->getType()->getScalarSizeInBits() > - TD->getPointerSizeInBits(AS)) { + TD->getPointerSizeInBits()) { Value *P = Builder->CreateTrunc(CI.getOperand(0), TD->getIntPtrType(CI.getContext())); return new IntToPtrInst(P, CI.getType()); } if (CI.getOperand(0)->getType()->getScalarSizeInBits() < - TD->getPointerSizeInBits(AS)) { + TD->getPointerSizeInBits()) { Value *P = Builder->CreateZExt(CI.getOperand(0), TD->getIntPtrType(CI.getContext())); return new IntToPtrInst(P, CI.getType()); @@ -1369,14 +1368,13 @@ Instruction *InstCombiner::visitPtrToInt(PtrToIntInst &CI) { // If the destination integer type is not the intptr_t type for this target, // do a ptrtoint to intptr_t then do a trunc or zext. This allows the cast // to be exposed to other transforms. - unsigned AS = CI.getPointerAddressSpace(); if (TD) { - if (CI.getType()->getScalarSizeInBits() < TD->getPointerSizeInBits(AS)) { + if (CI.getType()->getScalarSizeInBits() < TD->getPointerSizeInBits()) { Value *P = Builder->CreatePtrToInt(CI.getOperand(0), TD->getIntPtrType(CI.getContext())); return new TruncInst(P, CI.getType()); } - if (CI.getType()->getScalarSizeInBits() > TD->getPointerSizeInBits(AS)) { + if (CI.getType()->getScalarSizeInBits() > TD->getPointerSizeInBits()) { Value *P = Builder->CreatePtrToInt(CI.getOperand(0), TD->getIntPtrType(CI.getContext())); return new ZExtInst(P, CI.getType()); |

