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 | fb384d61c78b60787ed65475d8403aee65023962 (patch) | |
tree | 7bf869f21ac85ae4ddbeea3069784c88381bd07e /lib/Analysis/CodeMetrics.cpp | |
parent | d9a3bad4487dee0b9ed1a0f5555dffe605826158 (diff) |
Revert 165732 for further review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CodeMetrics.cpp')
-rw-r--r-- | lib/Analysis/CodeMetrics.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Analysis/CodeMetrics.cpp b/lib/Analysis/CodeMetrics.cpp index d669268496..651a54be1b 100644 --- a/lib/Analysis/CodeMetrics.cpp +++ b/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 |