mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Revert 165732 for further review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user