From 0c61134d8d00b38f5f09233957317b23a408bd55 Mon Sep 17 00:00:00 2001 From: Micah Villmow Date: Thu, 11 Oct 2012 21:27:41 +0000 Subject: Revert 165732 for further review. llvm-svn: 165747 --- llvm/lib/Analysis/CodeMetrics.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Analysis/CodeMetrics.cpp') 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(CI) && TD && TD->isLegalInteger(Op->getType()->getScalarSizeInBits()) && - Op->getType()->getScalarSizeInBits() <= TD->getPointerSizeInBits( - cast(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(CI) && TD && TD->isLegalInteger(Op->getType()->getScalarSizeInBits()) && - Op->getType()->getScalarSizeInBits() >= TD->getPointerSizeInBits( - cast(CI)->getPointerAddressSpace())) + Op->getType()->getScalarSizeInBits() >= TD->getPointerSizeInBits()) return true; // trunc to a native type is free (assuming the target has compare and -- cgit v1.2.3