summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/CodeMetrics.cpp
diff options
context:
space:
mode:
authorMicah Villmow <villmow@gmail.com>2012-10-11 21:27:41 +0000
committerMicah Villmow <villmow@gmail.com>2012-10-11 21:27:41 +0000
commit0c61134d8d00b38f5f09233957317b23a408bd55 (patch)
treeee822ef49633f0d80ce4ce8f4b8d99485c4f2dc1 /llvm/lib/Analysis/CodeMetrics.cpp
parent5968b1b71f880582dd9cc57e8f3669ba100ee9f9 (diff)
downloadbcm5719-llvm-0c61134d8d00b38f5f09233957317b23a408bd55.tar.gz
bcm5719-llvm-0c61134d8d00b38f5f09233957317b23a408bd55.zip
Revert 165732 for further review.
llvm-svn: 165747
Diffstat (limited to 'llvm/lib/Analysis/CodeMetrics.cpp')
-rw-r--r--llvm/lib/Analysis/CodeMetrics.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/CodeMetrics.cpp b/llvm/lib/Analysis/CodeMetrics.cpp
index d6692684960..651a54be1b9 100644
--- a/llvm/lib/Analysis/CodeMetrics.cpp
+++ b/llvm/lib/Analysis/CodeMetrics.cpp
@@ -91,16 +91,14 @@ bool llvm::isInstructionFree(const Instruction *I, const DataLayout *TD) {
// which doesn't contain values outside the range of a pointer.
if (isa<IntToPtrInst>(CI) && TD &&
TD->isLegalInteger(Op->getType()->getScalarSizeInBits()) &&
- Op->getType()->getScalarSizeInBits() <= TD->getPointerSizeInBits(
- cast<IntToPtrInst>(CI)->getAddressSpace()))
+ Op->getType()->getScalarSizeInBits() <= TD->getPointerSizeInBits())
return true;
// A ptrtoint cast is free so long as the result is large enough to store
// the pointer, and a legal integer type.
if (isa<PtrToIntInst>(CI) && TD &&
TD->isLegalInteger(Op->getType()->getScalarSizeInBits()) &&
- Op->getType()->getScalarSizeInBits() >= TD->getPointerSizeInBits(
- cast<PtrToIntInst>(CI)->getPointerAddressSpace()))
+ Op->getType()->getScalarSizeInBits() >= TD->getPointerSizeInBits())
return true;
// trunc to a native type is free (assuming the target has compare and
OpenPOWER on IntegriCloud