Index: llvm/include/llvm/IR/IntrinsicInst.h =================================================================== --- llvm/include/llvm/IR/IntrinsicInst.h +++ llvm/include/llvm/IR/IntrinsicInst.h @@ -678,7 +678,8 @@ public: // Methods for support type inquiry through isa, cast, and dyn_cast: static bool classof(const IntrinsicInst *I) { - return I->getIntrinsicID() == Intrinsic::memcpy; + auto IID = I->getIntrinsicID(); + return IID == Intrinsic::memcpy || IID == Intrinsic::memcpy_inline; } static bool classof(const Value *V) { return isa(V) && classof(cast(V)); @@ -697,21 +698,6 @@ } }; -/// This class wraps the llvm.memcpy.inline intrinsic. -class MemCpyInlineInst : public MemTransferInst { -public: - ConstantInt *getLength() const { - return cast(MemTransferInst::getLength()); - } - // Methods for support type inquiry through isa, cast, and dyn_cast: - static bool classof(const IntrinsicInst *I) { - return I->getIntrinsicID() == Intrinsic::memcpy_inline; - } - static bool classof(const Value *V) { - return isa(V) && classof(cast(V)); - } -}; - // The common base class for any memset/memmove/memcpy intrinsics; // whether they be atomic or non-atomic. // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove Index: llvm/lib/Analysis/Lint.cpp =================================================================== --- llvm/lib/Analysis/Lint.cpp +++ llvm/lib/Analysis/Lint.cpp @@ -316,9 +316,9 @@ // TODO: Check more intrinsics - case Intrinsic::memcpy: { + case Intrinsic::memcpy: + case Intrinsic::memcpy_inline: { MemCpyInst *MCI = cast(&I); - // TODO: If the size is known, use it. visitMemoryReference(I, MCI->getDest(), MemoryLocation::UnknownSize, MCI->getDestAlign(), nullptr, MemRef::Write); visitMemoryReference(I, MCI->getSource(), MemoryLocation::UnknownSize, @@ -338,22 +338,6 @@ "Undefined behavior: memcpy source and destination overlap", &I); break; } - case Intrinsic::memcpy_inline: { - MemCpyInlineInst *MCII = cast(&I); - const uint64_t Size = MCII->getLength()->getValue().getLimitedValue(); - visitMemoryReference(I, MCII->getDest(), Size, MCII->getDestAlign(), - nullptr, MemRef::Write); - visitMemoryReference(I, MCII->getSource(), Size, MCII->getSourceAlign(), - nullptr, MemRef::Read); - - // Check that the memcpy arguments don't overlap. The AliasAnalysis API - // isn't expressive enough for what we really want to do. Known partial - // overlap is not distinguished from the case where nothing is known. - const LocationSize LS = LocationSize::precise(Size); - Assert(AA->alias(MCII->getSource(), LS, MCII->getDest(), LS) != MustAlias, - "Undefined behavior: memcpy source and destination overlap", &I); - break; - } case Intrinsic::memmove: { MemMoveInst *MMI = cast(&I); // TODO: If the size is known, use it. Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -5716,7 +5716,7 @@ return; } case Intrinsic::memcpy_inline: { - const auto &MCI = cast(I); + const auto &MCI = cast(I); SDValue Dst = getValue(I.getArgOperand(0)); SDValue Src = getValue(I.getArgOperand(1)); SDValue Size = getValue(I.getArgOperand(2)); Index: llvm/lib/IR/IRBuilder.cpp =================================================================== --- llvm/lib/IR/IRBuilder.cpp +++ llvm/lib/IR/IRBuilder.cpp @@ -188,7 +188,7 @@ CallInst *CI = createCallHelper(TheFn, Ops, this); - auto *MCI = cast(CI); + auto *MCI = cast(CI); if (DstAlign) MCI->setDestAlignment(*DstAlign); if (SrcAlign)