mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Change memcpy/memset/memmove to have dest and source alignments.
Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those. This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed. There are a few places in the code for which the code needs to be checked by an expert as to whether using only src/dest alignment is safe. For those places, they currently take the minimum of src/dest alignments which matches the current behaviour. For example, code which used to read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false) will now read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false) For out of tree owners, I was able to strip alignment from calls using sed by replacing: (call.*llvm\.memset.*)i32\ [0-9]*\,\ i1 false\) with: $1i1 false) and similarly for memmove and memcpy. I then added back in alignment to test cases which needed it. A similar commit will be made to clang which actually has many differences in alignment as now IRBuilder can generate different source/dest alignments on calls. In IRBuilder itself, a new argument was added. Instead of calling: CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, /* isVolatile */ false) you now call CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, SrcAlign, /* isVolatile */ false) There is a temporary class (IntegerAlignment) which takes the source alignment and rejects implicit conversion from bool. This is to prevent isVolatile here from passing its default parameter to the source alignment. Note, changes in future can now be made to codegen. I didn't change anything here, but this change should enable better memcpy code sequences. Reviewed by Hal Finkel. llvm-svn: 253511
This commit is contained in:
parent
acb193e196
commit
aca4c5cdc6
@ -362,34 +362,56 @@ public:
|
|||||||
/// If the pointer isn't an i8*, it will be converted. If a TBAA tag is
|
/// If the pointer isn't an i8*, it will be converted. If a TBAA tag is
|
||||||
/// specified, it will be added to the instruction. Likewise with alias.scope
|
/// specified, it will be added to the instruction. Likewise with alias.scope
|
||||||
/// and noalias tags.
|
/// and noalias tags.
|
||||||
CallInst *CreateMemSet(Value *Ptr, Value *Val, uint64_t Size, unsigned Align,
|
CallInst *CreateMemSet(Value *Ptr, Value *Val, uint64_t Size,
|
||||||
|
unsigned DstAlign,
|
||||||
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
||||||
MDNode *ScopeTag = nullptr,
|
MDNode *ScopeTag = nullptr,
|
||||||
MDNode *NoAliasTag = nullptr) {
|
MDNode *NoAliasTag = nullptr) {
|
||||||
return CreateMemSet(Ptr, Val, getInt64(Size), Align, isVolatile,
|
return CreateMemSet(Ptr, Val, getInt64(Size), DstAlign, isVolatile,
|
||||||
TBAATag, ScopeTag, NoAliasTag);
|
TBAATag, ScopeTag, NoAliasTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInst *CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align,
|
CallInst *CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned DstAlign,
|
||||||
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
||||||
MDNode *ScopeTag = nullptr,
|
MDNode *ScopeTag = nullptr,
|
||||||
MDNode *NoAliasTag = nullptr);
|
MDNode *NoAliasTag = nullptr);
|
||||||
|
|
||||||
/// \brief Create and insert a memcpy between the specified pointers.
|
/// Create and insert a memcpy between the specified pointers.
|
||||||
///
|
///
|
||||||
/// If the pointers aren't i8*, they will be converted. If a TBAA tag is
|
/// If the pointers aren't i8*, they will be converted. If a TBAA tag is
|
||||||
/// specified, it will be added to the instruction. Likewise with alias.scope
|
/// specified, it will be added to the instruction. Likewise with alias.scope
|
||||||
/// and noalias tags.
|
/// and noalias tags.
|
||||||
CallInst *CreateMemCpy(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
|
///
|
||||||
|
/// Note! This is very temporary. It is only intended to catch calls to
|
||||||
|
/// CreateMemCpy in out of tree code which would otherwise silently pass the
|
||||||
|
/// volatile flag to source alignment.
|
||||||
|
class IntegerAlignment {
|
||||||
|
private:
|
||||||
|
uint64_t Align;
|
||||||
|
|
||||||
|
IntegerAlignment() = delete;
|
||||||
|
IntegerAlignment(bool) = delete;
|
||||||
|
public:
|
||||||
|
IntegerAlignment(int Align) : Align(Align) { }
|
||||||
|
IntegerAlignment(long long Align) : Align(Align) { }
|
||||||
|
IntegerAlignment(unsigned Align) : Align(Align) { }
|
||||||
|
IntegerAlignment(uint64_t Align) : Align(Align) { }
|
||||||
|
|
||||||
|
operator unsigned() { return Align; }
|
||||||
|
};
|
||||||
|
CallInst *CreateMemCpy(Value *Dst, Value *Src, uint64_t Size,
|
||||||
|
unsigned DstAlign, IntegerAlignment SrcAlign,
|
||||||
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
||||||
MDNode *TBAAStructTag = nullptr,
|
MDNode *TBAAStructTag = nullptr,
|
||||||
MDNode *ScopeTag = nullptr,
|
MDNode *ScopeTag = nullptr,
|
||||||
MDNode *NoAliasTag = nullptr) {
|
MDNode *NoAliasTag = nullptr) {
|
||||||
return CreateMemCpy(Dst, Src, getInt64(Size), Align, isVolatile, TBAATag,
|
return CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, SrcAlign,
|
||||||
|
isVolatile, TBAATag,
|
||||||
TBAAStructTag, ScopeTag, NoAliasTag);
|
TBAAStructTag, ScopeTag, NoAliasTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInst *CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
CallInst *CreateMemCpy(Value *Dst, Value *Src, Value *Size,
|
||||||
|
unsigned DstAlign, IntegerAlignment SrcAlign,
|
||||||
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
||||||
MDNode *TBAAStructTag = nullptr,
|
MDNode *TBAAStructTag = nullptr,
|
||||||
MDNode *ScopeTag = nullptr,
|
MDNode *ScopeTag = nullptr,
|
||||||
@ -401,15 +423,18 @@ public:
|
|||||||
/// If the pointers aren't i8*, they will be converted. If a TBAA tag is
|
/// If the pointers aren't i8*, they will be converted. If a TBAA tag is
|
||||||
/// specified, it will be added to the instruction. Likewise with alias.scope
|
/// specified, it will be added to the instruction. Likewise with alias.scope
|
||||||
/// and noalias tags.
|
/// and noalias tags.
|
||||||
CallInst *CreateMemMove(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
|
CallInst *CreateMemMove(Value *Dst, Value *Src, uint64_t Size,
|
||||||
|
unsigned DstAlign, IntegerAlignment SrcAlign,
|
||||||
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
||||||
MDNode *ScopeTag = nullptr,
|
MDNode *ScopeTag = nullptr,
|
||||||
MDNode *NoAliasTag = nullptr) {
|
MDNode *NoAliasTag = nullptr) {
|
||||||
return CreateMemMove(Dst, Src, getInt64(Size), Align, isVolatile,
|
return CreateMemMove(Dst, Src, getInt64(Size), DstAlign, SrcAlign,
|
||||||
|
isVolatile,
|
||||||
TBAATag, ScopeTag, NoAliasTag);
|
TBAATag, ScopeTag, NoAliasTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInst *CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
CallInst *CreateMemMove(Value *Dst, Value *Src, Value *Size,
|
||||||
|
unsigned DstAlign, IntegerAlignment SrcAlign,
|
||||||
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
bool isVolatile = false, MDNode *TBAATag = nullptr,
|
||||||
MDNode *ScopeTag = nullptr,
|
MDNode *ScopeTag = nullptr,
|
||||||
MDNode *NoAliasTag = nullptr);
|
MDNode *NoAliasTag = nullptr);
|
||||||
|
@ -1638,6 +1638,23 @@ public:
|
|||||||
return AttributeList.getParamAlignment(i);
|
return AttributeList.getParamAlignment(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set the alignment for a call or parameter (0=unknown).
|
||||||
|
void setParamAlignment(unsigned Index, unsigned Align) {
|
||||||
|
// Its not valid to change the parameter alignment. Instead we have to
|
||||||
|
// remove the old one if its there, and add a new one.
|
||||||
|
if (AttributeList.hasAttribute(Index, Attribute::Alignment))
|
||||||
|
AttributeList = AttributeList.removeAttribute(getContext(),
|
||||||
|
Index,
|
||||||
|
Attribute::Alignment);
|
||||||
|
|
||||||
|
// Now add the new alignment.
|
||||||
|
llvm::AttrBuilder B;
|
||||||
|
B.addAlignmentAttr(Align);
|
||||||
|
AttributeList = AttributeList.addAttributes(getContext(), Index,
|
||||||
|
AttributeSet::get(getContext(),
|
||||||
|
Index, B));
|
||||||
|
}
|
||||||
|
|
||||||
/// \brief Extract the number of dereferenceable bytes for a call or
|
/// \brief Extract the number of dereferenceable bytes for a call or
|
||||||
/// parameter (0=unknown).
|
/// parameter (0=unknown).
|
||||||
uint64_t getDereferenceableBytes(unsigned i) const {
|
uint64_t getDereferenceableBytes(unsigned i) const {
|
||||||
|
@ -150,16 +150,13 @@ namespace llvm {
|
|||||||
const Use &getLengthUse() const { return getArgOperandUse(2); }
|
const Use &getLengthUse() const { return getArgOperandUse(2); }
|
||||||
Use &getLengthUse() { return getArgOperandUse(2); }
|
Use &getLengthUse() { return getArgOperandUse(2); }
|
||||||
|
|
||||||
ConstantInt *getAlignmentCst() const {
|
unsigned getDestAlignment() const {
|
||||||
return cast<ConstantInt>(const_cast<Value*>(getArgOperand(3)));
|
// Note, param attributes start at 1, so offset dest index from 0 to 1.
|
||||||
}
|
return getParamAlignment(1);
|
||||||
|
|
||||||
unsigned getAlignment() const {
|
|
||||||
return getAlignmentCst()->getZExtValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstantInt *getVolatileCst() const {
|
ConstantInt *getVolatileCst() const {
|
||||||
return cast<ConstantInt>(const_cast<Value*>(getArgOperand(4)));
|
return cast<ConstantInt>(const_cast<Value*>(getArgOperand(3)));
|
||||||
}
|
}
|
||||||
bool isVolatile() const {
|
bool isVolatile() const {
|
||||||
return !getVolatileCst()->isZero();
|
return !getVolatileCst()->isZero();
|
||||||
@ -188,16 +185,13 @@ namespace llvm {
|
|||||||
setArgOperand(2, L);
|
setArgOperand(2, L);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setAlignment(Constant* A) {
|
void setDestAlignment(unsigned Align) {
|
||||||
setArgOperand(3, A);
|
// Note, param attributes start at 1, so offset dest index from 0 to 1.
|
||||||
|
setParamAlignment(1, Align);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setVolatile(Constant* V) {
|
void setVolatile(Constant* V) {
|
||||||
setArgOperand(4, V);
|
setArgOperand(3, V);
|
||||||
}
|
|
||||||
|
|
||||||
Type *getAlignmentType() const {
|
|
||||||
return getArgOperand(3)->getType();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
@ -259,12 +253,22 @@ namespace llvm {
|
|||||||
return cast<PointerType>(getRawSource()->getType())->getAddressSpace();
|
return cast<PointerType>(getRawSource()->getType())->getAddressSpace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned getSrcAlignment() const {
|
||||||
|
// Note, param attributes start at 1, so offset src index from 1 to 2.
|
||||||
|
return getParamAlignment(2);
|
||||||
|
}
|
||||||
|
|
||||||
void setSource(Value *Ptr) {
|
void setSource(Value *Ptr) {
|
||||||
assert(getRawSource()->getType() == Ptr->getType() &&
|
assert(getRawSource()->getType() == Ptr->getType() &&
|
||||||
"setSource called with pointer of wrong type!");
|
"setSource called with pointer of wrong type!");
|
||||||
setArgOperand(1, Ptr);
|
setArgOperand(1, Ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setSrcAlignment(unsigned Align) {
|
||||||
|
// Note, param attributes start at 1, so offset src index from 1 to 2.
|
||||||
|
setParamAlignment(2, Align);
|
||||||
|
}
|
||||||
|
|
||||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
static inline bool classof(const IntrinsicInst *I) {
|
static inline bool classof(const IntrinsicInst *I) {
|
||||||
return I->getIntrinsicID() == Intrinsic::memcpy ||
|
return I->getIntrinsicID() == Intrinsic::memcpy ||
|
||||||
|
@ -333,17 +333,17 @@ def int_instrprof_value_profile : Intrinsic<[],
|
|||||||
|
|
||||||
def int_memcpy : Intrinsic<[],
|
def int_memcpy : Intrinsic<[],
|
||||||
[llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty,
|
[llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty,
|
||||||
llvm_i32_ty, llvm_i1_ty],
|
llvm_i1_ty],
|
||||||
[IntrReadWriteArgMem, NoCapture<0>, NoCapture<1>,
|
[IntrReadWriteArgMem, NoCapture<0>, NoCapture<1>,
|
||||||
ReadOnly<1>]>;
|
ReadOnly<1>]>;
|
||||||
def int_memmove : Intrinsic<[],
|
def int_memmove : Intrinsic<[],
|
||||||
[llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty,
|
[llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty,
|
||||||
llvm_i32_ty, llvm_i1_ty],
|
llvm_i1_ty],
|
||||||
[IntrReadWriteArgMem, NoCapture<0>, NoCapture<1>,
|
[IntrReadWriteArgMem, NoCapture<0>, NoCapture<1>,
|
||||||
ReadOnly<1>]>;
|
ReadOnly<1>]>;
|
||||||
def int_memset : Intrinsic<[],
|
def int_memset : Intrinsic<[],
|
||||||
[llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty,
|
[llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty,
|
||||||
llvm_i32_ty, llvm_i1_ty],
|
llvm_i1_ty],
|
||||||
[IntrReadWriteArgMem, NoCapture<0>]>;
|
[IntrReadWriteArgMem, NoCapture<0>]>;
|
||||||
|
|
||||||
let Properties = [IntrNoMem] in {
|
let Properties = [IntrNoMem] in {
|
||||||
|
@ -284,9 +284,9 @@ void Lint::visitCallSite(CallSite CS) {
|
|||||||
MemCpyInst *MCI = cast<MemCpyInst>(&I);
|
MemCpyInst *MCI = cast<MemCpyInst>(&I);
|
||||||
// TODO: If the size is known, use it.
|
// TODO: If the size is known, use it.
|
||||||
visitMemoryReference(I, MCI->getDest(), MemoryLocation::UnknownSize,
|
visitMemoryReference(I, MCI->getDest(), MemoryLocation::UnknownSize,
|
||||||
MCI->getAlignment(), nullptr, MemRef::Write);
|
MCI->getDestAlignment(), nullptr, MemRef::Write);
|
||||||
visitMemoryReference(I, MCI->getSource(), MemoryLocation::UnknownSize,
|
visitMemoryReference(I, MCI->getSource(), MemoryLocation::UnknownSize,
|
||||||
MCI->getAlignment(), nullptr, MemRef::Read);
|
MCI->getSrcAlignment(), nullptr, MemRef::Read);
|
||||||
|
|
||||||
// Check that the memcpy arguments don't overlap. The AliasAnalysis API
|
// Check that the memcpy arguments don't overlap. The AliasAnalysis API
|
||||||
// isn't expressive enough for what we really want to do. Known partial
|
// isn't expressive enough for what we really want to do. Known partial
|
||||||
@ -306,16 +306,16 @@ void Lint::visitCallSite(CallSite CS) {
|
|||||||
MemMoveInst *MMI = cast<MemMoveInst>(&I);
|
MemMoveInst *MMI = cast<MemMoveInst>(&I);
|
||||||
// TODO: If the size is known, use it.
|
// TODO: If the size is known, use it.
|
||||||
visitMemoryReference(I, MMI->getDest(), MemoryLocation::UnknownSize,
|
visitMemoryReference(I, MMI->getDest(), MemoryLocation::UnknownSize,
|
||||||
MMI->getAlignment(), nullptr, MemRef::Write);
|
MMI->getDestAlignment(), nullptr, MemRef::Write);
|
||||||
visitMemoryReference(I, MMI->getSource(), MemoryLocation::UnknownSize,
|
visitMemoryReference(I, MMI->getSource(), MemoryLocation::UnknownSize,
|
||||||
MMI->getAlignment(), nullptr, MemRef::Read);
|
MMI->getSrcAlignment(), nullptr, MemRef::Read);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Intrinsic::memset: {
|
case Intrinsic::memset: {
|
||||||
MemSetInst *MSI = cast<MemSetInst>(&I);
|
MemSetInst *MSI = cast<MemSetInst>(&I);
|
||||||
// TODO: If the size is known, use it.
|
// TODO: If the size is known, use it.
|
||||||
visitMemoryReference(I, MSI->getDest(), MemoryLocation::UnknownSize,
|
visitMemoryReference(I, MSI->getDest(), MemoryLocation::UnknownSize,
|
||||||
MSI->getAlignment(), nullptr, MemRef::Write);
|
MSI->getDestAlignment(), nullptr, MemRef::Write);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1665,8 +1665,8 @@ bool CodeGenPrepare::optimizeCallInst(CallInst *CI, bool& ModifiedDT) {
|
|||||||
unsigned Align = getKnownAlignment(MI->getDest(), *DL);
|
unsigned Align = getKnownAlignment(MI->getDest(), *DL);
|
||||||
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI))
|
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI))
|
||||||
Align = std::min(Align, getKnownAlignment(MTI->getSource(), *DL));
|
Align = std::min(Align, getKnownAlignment(MTI->getSource(), *DL));
|
||||||
if (Align > MI->getAlignment())
|
if (Align > MI->getDestAlignment())
|
||||||
MI->setAlignment(ConstantInt::get(MI->getAlignmentType(), Align));
|
MI->setDestAlignment(Align);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4365,69 +4365,73 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
|
|||||||
case Intrinsic::longjmp:
|
case Intrinsic::longjmp:
|
||||||
return &"_longjmp"[!TLI.usesUnderscoreLongJmp()];
|
return &"_longjmp"[!TLI.usesUnderscoreLongJmp()];
|
||||||
case Intrinsic::memcpy: {
|
case Intrinsic::memcpy: {
|
||||||
|
const MemCpyInst &MemCpyI = cast<MemCpyInst>(I);
|
||||||
// FIXME: this definition of "user defined address space" is x86-specific
|
// FIXME: this definition of "user defined address space" is x86-specific
|
||||||
// Assert for address < 256 since we support only user defined address
|
// Assert for address < 256 since we support only user defined address
|
||||||
// spaces.
|
// spaces.
|
||||||
assert(cast<PointerType>(I.getArgOperand(0)->getType())->getAddressSpace()
|
assert(MemCpyI.getDestAddressSpace() < 256 &&
|
||||||
< 256 &&
|
MemCpyI.getSourceAddressSpace() < 256 &&
|
||||||
cast<PointerType>(I.getArgOperand(1)->getType())->getAddressSpace()
|
|
||||||
< 256 &&
|
|
||||||
"Unknown address space");
|
"Unknown address space");
|
||||||
SDValue Op1 = getValue(I.getArgOperand(0));
|
SDValue Op1 = getValue(MemCpyI.getDest());
|
||||||
SDValue Op2 = getValue(I.getArgOperand(1));
|
SDValue Op2 = getValue(MemCpyI.getSource());
|
||||||
SDValue Op3 = getValue(I.getArgOperand(2));
|
SDValue Op3 = getValue(MemCpyI.getLength());
|
||||||
unsigned Align = cast<ConstantInt>(I.getArgOperand(3))->getZExtValue();
|
// FIXME: Support passing different dest/src alignments to the memcpy
|
||||||
|
// DAG node.
|
||||||
|
unsigned Align = std::min(MemCpyI.getDestAlignment(),
|
||||||
|
MemCpyI.getSrcAlignment());
|
||||||
if (!Align)
|
if (!Align)
|
||||||
Align = 1; // @llvm.memcpy defines 0 and 1 to both mean no alignment.
|
Align = 1; // @llvm.memcpy defines 0 and 1 to both mean no alignment.
|
||||||
bool isVol = cast<ConstantInt>(I.getArgOperand(4))->getZExtValue();
|
bool isVol = MemCpyI.isVolatile();
|
||||||
bool isTC = I.isTailCall() && isInTailCallPosition(&I, DAG.getTarget());
|
bool isTC = I.isTailCall() && isInTailCallPosition(&I, DAG.getTarget());
|
||||||
SDValue MC = DAG.getMemcpy(getRoot(), sdl, Op1, Op2, Op3, Align, isVol,
|
SDValue MC = DAG.getMemcpy(getRoot(), sdl, Op1, Op2, Op3, Align, isVol,
|
||||||
false, isTC,
|
false, isTC,
|
||||||
MachinePointerInfo(I.getArgOperand(0)),
|
MachinePointerInfo(MemCpyI.getDest()),
|
||||||
MachinePointerInfo(I.getArgOperand(1)));
|
MachinePointerInfo(MemCpyI.getSource()));
|
||||||
updateDAGForMaybeTailCall(MC);
|
updateDAGForMaybeTailCall(MC);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
case Intrinsic::memset: {
|
case Intrinsic::memset: {
|
||||||
|
const MemSetInst &MemSetI = cast<MemSetInst>(I);
|
||||||
// FIXME: this definition of "user defined address space" is x86-specific
|
// FIXME: this definition of "user defined address space" is x86-specific
|
||||||
// Assert for address < 256 since we support only user defined address
|
// Assert for address < 256 since we support only user defined address
|
||||||
// spaces.
|
// spaces.
|
||||||
assert(cast<PointerType>(I.getArgOperand(0)->getType())->getAddressSpace()
|
assert(MemSetI.getDestAddressSpace() < 256 &&
|
||||||
< 256 &&
|
|
||||||
"Unknown address space");
|
"Unknown address space");
|
||||||
SDValue Op1 = getValue(I.getArgOperand(0));
|
SDValue Op1 = getValue(MemSetI.getDest());
|
||||||
SDValue Op2 = getValue(I.getArgOperand(1));
|
SDValue Op2 = getValue(MemSetI.getValue());
|
||||||
SDValue Op3 = getValue(I.getArgOperand(2));
|
SDValue Op3 = getValue(MemSetI.getLength());
|
||||||
unsigned Align = cast<ConstantInt>(I.getArgOperand(3))->getZExtValue();
|
unsigned Align = MemSetI.getDestAlignment();
|
||||||
if (!Align)
|
if (!Align)
|
||||||
Align = 1; // @llvm.memset defines 0 and 1 to both mean no alignment.
|
Align = 1; // @llvm.memset defines 0 and 1 to both mean no alignment.
|
||||||
bool isVol = cast<ConstantInt>(I.getArgOperand(4))->getZExtValue();
|
bool isVol = MemSetI.isVolatile();
|
||||||
bool isTC = I.isTailCall() && isInTailCallPosition(&I, DAG.getTarget());
|
bool isTC = I.isTailCall() && isInTailCallPosition(&I, DAG.getTarget());
|
||||||
SDValue MS = DAG.getMemset(getRoot(), sdl, Op1, Op2, Op3, Align, isVol,
|
SDValue MS = DAG.getMemset(getRoot(), sdl, Op1, Op2, Op3, Align, isVol,
|
||||||
isTC, MachinePointerInfo(I.getArgOperand(0)));
|
isTC, MachinePointerInfo(MemSetI.getDest()));
|
||||||
updateDAGForMaybeTailCall(MS);
|
updateDAGForMaybeTailCall(MS);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
case Intrinsic::memmove: {
|
case Intrinsic::memmove: {
|
||||||
|
const MemMoveInst &MemMoveI = cast<MemMoveInst>(I);
|
||||||
// FIXME: this definition of "user defined address space" is x86-specific
|
// FIXME: this definition of "user defined address space" is x86-specific
|
||||||
// Assert for address < 256 since we support only user defined address
|
// Assert for address < 256 since we support only user defined address
|
||||||
// spaces.
|
// spaces.
|
||||||
assert(cast<PointerType>(I.getArgOperand(0)->getType())->getAddressSpace()
|
assert(MemMoveI.getDestAddressSpace() < 256 &&
|
||||||
< 256 &&
|
MemMoveI.getSourceAddressSpace() < 256 &&
|
||||||
cast<PointerType>(I.getArgOperand(1)->getType())->getAddressSpace()
|
|
||||||
< 256 &&
|
|
||||||
"Unknown address space");
|
"Unknown address space");
|
||||||
SDValue Op1 = getValue(I.getArgOperand(0));
|
SDValue Op1 = getValue(MemMoveI.getDest());
|
||||||
SDValue Op2 = getValue(I.getArgOperand(1));
|
SDValue Op2 = getValue(MemMoveI.getSource());
|
||||||
SDValue Op3 = getValue(I.getArgOperand(2));
|
SDValue Op3 = getValue(MemMoveI.getLength());
|
||||||
unsigned Align = cast<ConstantInt>(I.getArgOperand(3))->getZExtValue();
|
// FIXME: Support passing different dest/src alignments to the memcpy
|
||||||
|
// DAG node.
|
||||||
|
unsigned Align = std::min(MemMoveI.getDestAlignment(),
|
||||||
|
MemMoveI.getSrcAlignment());
|
||||||
if (!Align)
|
if (!Align)
|
||||||
Align = 1; // @llvm.memmove defines 0 and 1 to both mean no alignment.
|
Align = 1; // @llvm.memmove defines 0 and 1 to both mean no alignment.
|
||||||
bool isVol = cast<ConstantInt>(I.getArgOperand(4))->getZExtValue();
|
bool isVol = MemMoveI.isVolatile();
|
||||||
bool isTC = I.isTailCall() && isInTailCallPosition(&I, DAG.getTarget());
|
bool isTC = I.isTailCall() && isInTailCallPosition(&I, DAG.getTarget());
|
||||||
SDValue MM = DAG.getMemmove(getRoot(), sdl, Op1, Op2, Op3, Align, isVol,
|
SDValue MM = DAG.getMemmove(getRoot(), sdl, Op1, Op2, Op3, Align, isVol,
|
||||||
isTC, MachinePointerInfo(I.getArgOperand(0)),
|
isTC, MachinePointerInfo(MemMoveI.getDest()),
|
||||||
MachinePointerInfo(I.getArgOperand(1)));
|
MachinePointerInfo(MemMoveI.getSource()));
|
||||||
updateDAGForMaybeTailCall(MM);
|
updateDAGForMaybeTailCall(MM);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -830,11 +830,6 @@ AttributeSet AttributeSet::removeAttributes(LLVMContext &C, unsigned Index,
|
|||||||
if (!pImpl) return AttributeSet();
|
if (!pImpl) return AttributeSet();
|
||||||
if (!Attrs.pImpl) return *this;
|
if (!Attrs.pImpl) return *this;
|
||||||
|
|
||||||
// FIXME it is not obvious how this should work for alignment.
|
|
||||||
// For now, say we can't pass in alignment, which no current use does.
|
|
||||||
assert(!Attrs.hasAttribute(Index, Attribute::Alignment) &&
|
|
||||||
"Attempt to change alignment!");
|
|
||||||
|
|
||||||
// Add the attribute slots before the one we're trying to add.
|
// Add the attribute slots before the one we're trying to add.
|
||||||
SmallVector<AttributeSet, 4> AttrSet;
|
SmallVector<AttributeSet, 4> AttrSet;
|
||||||
uint64_t NumAttrs = pImpl->getNumAttributes();
|
uint64_t NumAttrs = pImpl->getNumAttributes();
|
||||||
|
@ -144,6 +144,36 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'm': {
|
||||||
|
if (Name.startswith("memcpy.") && F->arg_size() == 5) {
|
||||||
|
F->setName(Name + ".old");
|
||||||
|
// Get the types of dest, src, and len.
|
||||||
|
ArrayRef<Type *> ParamTypes = F->getFunctionType()->params().slice(0, 3);
|
||||||
|
NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memcpy,
|
||||||
|
ParamTypes);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (Name.startswith("memmove.") && F->arg_size() == 5) {
|
||||||
|
F->setName(Name + ".old");
|
||||||
|
// Get the types of dest, src, and len.
|
||||||
|
ArrayRef<Type *> ParamTypes = F->getFunctionType()->params().slice(0, 3);
|
||||||
|
NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memmove,
|
||||||
|
ParamTypes);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (Name.startswith("memset.") && F->arg_size() == 5) {
|
||||||
|
F->setName(Name + ".old");
|
||||||
|
// Get the types of dest and len.
|
||||||
|
Type *ParamTypes[2] = {
|
||||||
|
F->getFunctionType()->getParamType(0),
|
||||||
|
F->getFunctionType()->getParamType(2)
|
||||||
|
};
|
||||||
|
NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memset,
|
||||||
|
ParamTypes);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'o':
|
case 'o':
|
||||||
// We only need to change the name to match the mangling including the
|
// We only need to change the name to match the mangling including the
|
||||||
@ -727,6 +757,31 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
|
|||||||
CI->eraseFromParent();
|
CI->eraseFromParent();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case Intrinsic::memcpy:
|
||||||
|
case Intrinsic::memmove:
|
||||||
|
case Intrinsic::memset: {
|
||||||
|
// Remove alignment argument (3), and add alignment attributes to the
|
||||||
|
// dest/src pointers.
|
||||||
|
Value *Args[4] = {
|
||||||
|
CI->getArgOperand(0),
|
||||||
|
CI->getArgOperand(1),
|
||||||
|
CI->getArgOperand(2),
|
||||||
|
CI->getArgOperand(4)
|
||||||
|
};
|
||||||
|
auto *MemCI = cast<MemIntrinsic>(Builder.CreateCall(NewFn, Args, Name));
|
||||||
|
|
||||||
|
// All mem intrinsics support dest alignment.
|
||||||
|
const ConstantInt *Align = cast<ConstantInt>(CI->getArgOperand(3));
|
||||||
|
MemCI->setDestAlignment(Align->getZExtValue());
|
||||||
|
|
||||||
|
// Memcpy/Memmove also support source alignment.
|
||||||
|
if (auto *MemTransferI = dyn_cast<MemTransferInst>(MemCI))
|
||||||
|
MemTransferI->setSrcAlignment(Align->getZExtValue());
|
||||||
|
CI->replaceAllUsesWith(MemCI);
|
||||||
|
CI->eraseFromParent();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
case Intrinsic::objectsize:
|
case Intrinsic::objectsize:
|
||||||
CI->replaceAllUsesWith(Builder.CreateCall(
|
CI->replaceAllUsesWith(Builder.CreateCall(
|
||||||
NewFn, {CI->getArgOperand(0), CI->getArgOperand(1)}, Name));
|
NewFn, {CI->getArgOperand(0), CI->getArgOperand(1)}, Name));
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "llvm/IR/Function.h"
|
#include "llvm/IR/Function.h"
|
||||||
#include "llvm/IR/GlobalVariable.h"
|
#include "llvm/IR/GlobalVariable.h"
|
||||||
#include "llvm/IR/IRBuilder.h"
|
#include "llvm/IR/IRBuilder.h"
|
||||||
|
#include "llvm/IR/IntrinsicInst.h"
|
||||||
#include "llvm/IR/Intrinsics.h"
|
#include "llvm/IR/Intrinsics.h"
|
||||||
#include "llvm/IR/LLVMContext.h"
|
#include "llvm/IR/LLVMContext.h"
|
||||||
#include "llvm/IR/Statepoint.h"
|
#include "llvm/IR/Statepoint.h"
|
||||||
@ -79,11 +80,11 @@ static InvokeInst *createInvokeHelper(Value *Invokee, BasicBlock *NormalDest,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CallInst *IRBuilderBase::
|
CallInst *IRBuilderBase::
|
||||||
CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align,
|
CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned DstAlign,
|
||||||
bool isVolatile, MDNode *TBAATag, MDNode *ScopeTag,
|
bool isVolatile, MDNode *TBAATag, MDNode *ScopeTag,
|
||||||
MDNode *NoAliasTag) {
|
MDNode *NoAliasTag) {
|
||||||
Ptr = getCastedInt8PtrValue(Ptr);
|
Ptr = getCastedInt8PtrValue(Ptr);
|
||||||
Value *Ops[] = { Ptr, Val, Size, getInt32(Align), getInt1(isVolatile) };
|
Value *Ops[] = { Ptr, Val, Size, getInt1(isVolatile) };
|
||||||
Type *Tys[] = { Ptr->getType(), Size->getType() };
|
Type *Tys[] = { Ptr->getType(), Size->getType() };
|
||||||
Module *M = BB->getParent()->getParent();
|
Module *M = BB->getParent()->getParent();
|
||||||
Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memset, Tys);
|
Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memset, Tys);
|
||||||
@ -99,18 +100,21 @@ CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align,
|
|||||||
|
|
||||||
if (NoAliasTag)
|
if (NoAliasTag)
|
||||||
CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);
|
CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);
|
||||||
|
|
||||||
|
cast<MemSetInst>(CI)->setDestAlignment(DstAlign);
|
||||||
|
|
||||||
return CI;
|
return CI;
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInst *IRBuilderBase::
|
CallInst *IRBuilderBase::
|
||||||
CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned DstAlign,
|
||||||
|
IntegerAlignment SrcAlign,
|
||||||
bool isVolatile, MDNode *TBAATag, MDNode *TBAAStructTag,
|
bool isVolatile, MDNode *TBAATag, MDNode *TBAAStructTag,
|
||||||
MDNode *ScopeTag, MDNode *NoAliasTag) {
|
MDNode *ScopeTag, MDNode *NoAliasTag) {
|
||||||
Dst = getCastedInt8PtrValue(Dst);
|
Dst = getCastedInt8PtrValue(Dst);
|
||||||
Src = getCastedInt8PtrValue(Src);
|
Src = getCastedInt8PtrValue(Src);
|
||||||
|
|
||||||
Value *Ops[] = { Dst, Src, Size, getInt32(Align), getInt1(isVolatile) };
|
Value *Ops[] = { Dst, Src, Size, getInt1(isVolatile) };
|
||||||
Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() };
|
Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() };
|
||||||
Module *M = BB->getParent()->getParent();
|
Module *M = BB->getParent()->getParent();
|
||||||
Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memcpy, Tys);
|
Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memcpy, Tys);
|
||||||
@ -130,18 +134,23 @@ CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
|||||||
|
|
||||||
if (NoAliasTag)
|
if (NoAliasTag)
|
||||||
CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);
|
CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);
|
||||||
|
|
||||||
|
auto *MCI = cast<MemCpyInst>(CI);
|
||||||
|
MCI->setDestAlignment(DstAlign);
|
||||||
|
MCI->setSrcAlignment(SrcAlign);
|
||||||
|
|
||||||
return CI;
|
return CI;
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInst *IRBuilderBase::
|
CallInst *IRBuilderBase::
|
||||||
CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned DstAlign,
|
||||||
|
IntegerAlignment SrcAlign,
|
||||||
bool isVolatile, MDNode *TBAATag, MDNode *ScopeTag,
|
bool isVolatile, MDNode *TBAATag, MDNode *ScopeTag,
|
||||||
MDNode *NoAliasTag) {
|
MDNode *NoAliasTag) {
|
||||||
Dst = getCastedInt8PtrValue(Dst);
|
Dst = getCastedInt8PtrValue(Dst);
|
||||||
Src = getCastedInt8PtrValue(Src);
|
Src = getCastedInt8PtrValue(Src);
|
||||||
|
|
||||||
Value *Ops[] = { Dst, Src, Size, getInt32(Align), getInt1(isVolatile) };
|
Value *Ops[] = { Dst, Src, Size, getInt1(isVolatile) };
|
||||||
Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() };
|
Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() };
|
||||||
Module *M = BB->getParent()->getParent();
|
Module *M = BB->getParent()->getParent();
|
||||||
Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memmove, Tys);
|
Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memmove, Tys);
|
||||||
@ -157,6 +166,10 @@ CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align,
|
|||||||
|
|
||||||
if (NoAliasTag)
|
if (NoAliasTag)
|
||||||
CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);
|
CI->setMetadata(LLVMContext::MD_noalias, NoAliasTag);
|
||||||
|
|
||||||
|
auto *MMI = cast<MemMoveInst>(CI);
|
||||||
|
MMI->setDestAlignment(DstAlign);
|
||||||
|
MMI->setSrcAlignment(SrcAlign);
|
||||||
|
|
||||||
return CI;
|
return CI;
|
||||||
}
|
}
|
||||||
|
@ -3511,7 +3511,7 @@ void Verifier::visitIntrinsicCallSite(Intrinsic::ID ID, CallSite CS) {
|
|||||||
const APInt &AlignVal = AlignCI->getValue();
|
const APInt &AlignVal = AlignCI->getValue();
|
||||||
Assert(AlignCI->isZero() || AlignVal.isPowerOf2(),
|
Assert(AlignCI->isZero() || AlignVal.isPowerOf2(),
|
||||||
"alignment argument of memory intrinsics must be a power of 2", CS);
|
"alignment argument of memory intrinsics must be a power of 2", CS);
|
||||||
Assert(isa<ConstantInt>(CS.getArgOperand(4)),
|
Assert(isa<ConstantInt>(CS.getArgOperand(3)),
|
||||||
"isvolatile argument of memory intrinsics must be a constant int",
|
"isvolatile argument of memory intrinsics must be a constant int",
|
||||||
CS);
|
CS);
|
||||||
break;
|
break;
|
||||||
|
@ -3379,7 +3379,8 @@ bool AArch64FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
|
|||||||
// Small memcpy's are common enough that we want to do them without a call
|
// Small memcpy's are common enough that we want to do them without a call
|
||||||
// if possible.
|
// if possible.
|
||||||
uint64_t Len = cast<ConstantInt>(MTI->getLength())->getZExtValue();
|
uint64_t Len = cast<ConstantInt>(MTI->getLength())->getZExtValue();
|
||||||
unsigned Alignment = MTI->getAlignment();
|
unsigned Alignment = std::min(MTI->getDestAlignment(),
|
||||||
|
MTI->getSrcAlignment());
|
||||||
if (isMemCpySmall(Len, Alignment)) {
|
if (isMemCpySmall(Len, Alignment)) {
|
||||||
Address Dest, Src;
|
Address Dest, Src;
|
||||||
if (!computeAddress(MTI->getRawDest(), Dest) ||
|
if (!computeAddress(MTI->getRawDest(), Dest) ||
|
||||||
@ -3399,7 +3400,7 @@ bool AArch64FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const char *IntrMemName = isa<MemCpyInst>(II) ? "memcpy" : "memmove";
|
const char *IntrMemName = isa<MemCpyInst>(II) ? "memcpy" : "memmove";
|
||||||
return lowerCallTo(II, IntrMemName, II->getNumArgOperands() - 2);
|
return lowerCallTo(II, IntrMemName, II->getNumArgOperands() - 1);
|
||||||
}
|
}
|
||||||
case Intrinsic::memset: {
|
case Intrinsic::memset: {
|
||||||
const MemSetInst *MSI = cast<MemSetInst>(II);
|
const MemSetInst *MSI = cast<MemSetInst>(II);
|
||||||
@ -3415,7 +3416,7 @@ bool AArch64FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
|
|||||||
// address spaces.
|
// address spaces.
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return lowerCallTo(II, "memset", II->getNumArgOperands() - 2);
|
return lowerCallTo(II, "memset", II->getNumArgOperands() - 1);
|
||||||
}
|
}
|
||||||
case Intrinsic::sin:
|
case Intrinsic::sin:
|
||||||
case Intrinsic::cos:
|
case Intrinsic::cos:
|
||||||
|
@ -400,15 +400,15 @@ void AMDGPUPromoteAlloca::visitAlloca(AllocaInst &I) {
|
|||||||
case Intrinsic::memcpy: {
|
case Intrinsic::memcpy: {
|
||||||
MemCpyInst *MemCpy = cast<MemCpyInst>(Intr);
|
MemCpyInst *MemCpy = cast<MemCpyInst>(Intr);
|
||||||
Builder.CreateMemCpy(MemCpy->getRawDest(), MemCpy->getRawSource(),
|
Builder.CreateMemCpy(MemCpy->getRawDest(), MemCpy->getRawSource(),
|
||||||
MemCpy->getLength(), MemCpy->getAlignment(),
|
MemCpy->getLength(), MemCpy->getDestAlignment(),
|
||||||
MemCpy->isVolatile());
|
MemCpy->getSrcAlignment(), MemCpy->isVolatile());
|
||||||
Intr->eraseFromParent();
|
Intr->eraseFromParent();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case Intrinsic::memset: {
|
case Intrinsic::memset: {
|
||||||
MemSetInst *MemSet = cast<MemSetInst>(Intr);
|
MemSetInst *MemSet = cast<MemSetInst>(Intr);
|
||||||
Builder.CreateMemSet(MemSet->getRawDest(), MemSet->getValue(),
|
Builder.CreateMemSet(MemSet->getRawDest(), MemSet->getValue(),
|
||||||
MemSet->getLength(), MemSet->getAlignment(),
|
MemSet->getLength(), MemSet->getDestAlignment(),
|
||||||
MemSet->isVolatile());
|
MemSet->isVolatile());
|
||||||
Intr->eraseFromParent();
|
Intr->eraseFromParent();
|
||||||
continue;
|
continue;
|
||||||
|
@ -2328,8 +2328,8 @@ bool ARMFastISel::SelectCall(const Instruction *I,
|
|||||||
for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
|
for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
|
||||||
i != e; ++i) {
|
i != e; ++i) {
|
||||||
// If we're lowering a memory intrinsic instead of a regular call, skip the
|
// If we're lowering a memory intrinsic instead of a regular call, skip the
|
||||||
// last two arguments, which shouldn't be passed to the underlying function.
|
// last argument, which shouldn't be passed to the underlying function.
|
||||||
if (IntrMemName && e-i <= 2)
|
if (IntrMemName && e-i <= 1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ISD::ArgFlagsTy Flags;
|
ISD::ArgFlagsTy Flags;
|
||||||
@ -2527,7 +2527,8 @@ bool ARMFastISel::SelectIntrinsicCall(const IntrinsicInst &I) {
|
|||||||
if (!ARMComputeAddress(MTI.getRawDest(), Dest) ||
|
if (!ARMComputeAddress(MTI.getRawDest(), Dest) ||
|
||||||
!ARMComputeAddress(MTI.getRawSource(), Src))
|
!ARMComputeAddress(MTI.getRawSource(), Src))
|
||||||
return false;
|
return false;
|
||||||
unsigned Alignment = MTI.getAlignment();
|
unsigned Alignment = std::min(MTI.getDestAlignment(),
|
||||||
|
MTI.getSrcAlignment());
|
||||||
if (ARMTryEmitSmallMemCpy(Dest, Src, Len, Alignment))
|
if (ARMTryEmitSmallMemCpy(Dest, Src, Len, Alignment))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1403,7 +1403,7 @@ bool MipsFastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
|
|||||||
if (!MTI->getLength()->getType()->isIntegerTy(32))
|
if (!MTI->getLength()->getType()->isIntegerTy(32))
|
||||||
return false;
|
return false;
|
||||||
const char *IntrMemName = isa<MemCpyInst>(II) ? "memcpy" : "memmove";
|
const char *IntrMemName = isa<MemCpyInst>(II) ? "memcpy" : "memmove";
|
||||||
return lowerCallTo(II, IntrMemName, II->getNumArgOperands() - 2);
|
return lowerCallTo(II, IntrMemName, II->getNumArgOperands() - 1);
|
||||||
}
|
}
|
||||||
case Intrinsic::memset: {
|
case Intrinsic::memset: {
|
||||||
const MemSetInst *MSI = cast<MemSetInst>(II);
|
const MemSetInst *MSI = cast<MemSetInst>(II);
|
||||||
@ -1412,7 +1412,7 @@ bool MipsFastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
|
|||||||
return false;
|
return false;
|
||||||
if (!MSI->getLength()->getType()->isIntegerTy(32))
|
if (!MSI->getLength()->getType()->isIntegerTy(32))
|
||||||
return false;
|
return false;
|
||||||
return lowerCallTo(II, "memset", II->getNumArgOperands() - 2);
|
return lowerCallTo(II, "memset", II->getNumArgOperands() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -2409,7 +2409,7 @@ bool X86FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
|
|||||||
if (MCI->getSourceAddressSpace() > 255 || MCI->getDestAddressSpace() > 255)
|
if (MCI->getSourceAddressSpace() > 255 || MCI->getDestAddressSpace() > 255)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return lowerCallTo(II, "memcpy", II->getNumArgOperands() - 2);
|
return lowerCallTo(II, "memcpy", II->getNumArgOperands() - 1);
|
||||||
}
|
}
|
||||||
case Intrinsic::memset: {
|
case Intrinsic::memset: {
|
||||||
const MemSetInst *MSI = cast<MemSetInst>(II);
|
const MemSetInst *MSI = cast<MemSetInst>(II);
|
||||||
@ -2424,7 +2424,7 @@ bool X86FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
|
|||||||
if (MSI->getDestAddressSpace() > 255)
|
if (MSI->getDestAddressSpace() > 255)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return lowerCallTo(II, "memset", II->getNumArgOperands() - 2);
|
return lowerCallTo(II, "memset", II->getNumArgOperands() - 1);
|
||||||
}
|
}
|
||||||
case Intrinsic::stackprotector: {
|
case Intrinsic::stackprotector: {
|
||||||
// Emit code to store the stack guard onto the stack.
|
// Emit code to store the stack guard onto the stack.
|
||||||
|
@ -60,14 +60,18 @@ static Type *reduceToSingleValueType(Type *T) {
|
|||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
|
|
||||||
Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
Instruction *InstCombiner::SimplifyMemTransfer(MemTransferInst *MI) {
|
||||||
unsigned DstAlign = getKnownAlignment(MI->getArgOperand(0), DL, MI, AC, DT);
|
unsigned DstAlign = getKnownAlignment(MI->getArgOperand(0), DL, MI, AC, DT);
|
||||||
unsigned SrcAlign = getKnownAlignment(MI->getArgOperand(1), DL, MI, AC, DT);
|
unsigned SrcAlign = getKnownAlignment(MI->getArgOperand(1), DL, MI, AC, DT);
|
||||||
unsigned MinAlign = std::min(DstAlign, SrcAlign);
|
unsigned CopyDestAlign = MI->getDestAlignment();
|
||||||
unsigned CopyAlign = MI->getAlignment();
|
unsigned CopySrcAlign = MI->getSrcAlignment();
|
||||||
|
|
||||||
if (CopyAlign < MinAlign) {
|
if (CopyDestAlign < DstAlign) {
|
||||||
MI->setAlignment(ConstantInt::get(MI->getAlignmentType(), MinAlign, false));
|
MI->setDestAlignment(DstAlign);
|
||||||
|
return MI;
|
||||||
|
}
|
||||||
|
if (CopySrcAlign < SrcAlign) {
|
||||||
|
MI->setSrcAlignment(SrcAlign);
|
||||||
return MI;
|
return MI;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,8 +139,8 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
|||||||
|
|
||||||
// If the memcpy/memmove provides better alignment info than we can
|
// If the memcpy/memmove provides better alignment info than we can
|
||||||
// infer, use it.
|
// infer, use it.
|
||||||
SrcAlign = std::max(SrcAlign, CopyAlign);
|
SrcAlign = std::max(SrcAlign, CopySrcAlign);
|
||||||
DstAlign = std::max(DstAlign, CopyAlign);
|
DstAlign = std::max(DstAlign, CopyDestAlign);
|
||||||
|
|
||||||
Value *Src = Builder->CreateBitCast(MI->getArgOperand(1), NewSrcPtrTy);
|
Value *Src = Builder->CreateBitCast(MI->getArgOperand(1), NewSrcPtrTy);
|
||||||
Value *Dest = Builder->CreateBitCast(MI->getArgOperand(0), NewDstPtrTy);
|
Value *Dest = Builder->CreateBitCast(MI->getArgOperand(0), NewDstPtrTy);
|
||||||
@ -156,9 +160,8 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
|||||||
|
|
||||||
Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
|
Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
|
||||||
unsigned Alignment = getKnownAlignment(MI->getDest(), DL, MI, AC, DT);
|
unsigned Alignment = getKnownAlignment(MI->getDest(), DL, MI, AC, DT);
|
||||||
if (MI->getAlignment() < Alignment) {
|
if (MI->getDestAlignment() < Alignment) {
|
||||||
MI->setAlignment(ConstantInt::get(MI->getAlignmentType(),
|
MI->setDestAlignment(Alignment);
|
||||||
Alignment, false));
|
|
||||||
return MI;
|
return MI;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +171,7 @@ Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
|
|||||||
if (!LenC || !FillC || !FillC->getType()->isIntegerTy(8))
|
if (!LenC || !FillC || !FillC->getType()->isIntegerTy(8))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
uint64_t Len = LenC->getLimitedValue();
|
uint64_t Len = LenC->getLimitedValue();
|
||||||
Alignment = MI->getAlignment();
|
Alignment = MI->getDestAlignment();
|
||||||
assert(Len && "0-sized memory setting should be removed already.");
|
assert(Len && "0-sized memory setting should be removed already.");
|
||||||
|
|
||||||
// memset(s,c,n) -> store s, c (for n=1,2,4,8)
|
// memset(s,c,n) -> store s, c (for n=1,2,4,8)
|
||||||
@ -743,8 +746,8 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
|||||||
|
|
||||||
// If we can determine a pointer alignment that is bigger than currently
|
// If we can determine a pointer alignment that is bigger than currently
|
||||||
// set, update the alignment.
|
// set, update the alignment.
|
||||||
if (isa<MemTransferInst>(MI)) {
|
if (auto *MTI = dyn_cast<MemTransferInst>(MI)) {
|
||||||
if (Instruction *I = SimplifyMemTransfer(MI))
|
if (Instruction *I = SimplifyMemTransfer(MTI))
|
||||||
return I;
|
return I;
|
||||||
} else if (MemSetInst *MSI = dyn_cast<MemSetInst>(MI)) {
|
} else if (MemSetInst *MSI = dyn_cast<MemSetInst>(MI)) {
|
||||||
if (Instruction *I = SimplifyMemSet(MSI))
|
if (Instruction *I = SimplifyMemSet(MSI))
|
||||||
|
@ -558,7 +558,7 @@ private:
|
|||||||
Instruction *PromoteCastOfAllocation(BitCastInst &CI, AllocaInst &AI);
|
Instruction *PromoteCastOfAllocation(BitCastInst &CI, AllocaInst &AI);
|
||||||
Instruction *MatchBSwap(BinaryOperator &I);
|
Instruction *MatchBSwap(BinaryOperator &I);
|
||||||
bool SimplifyStoreAtEndOfBlock(StoreInst &SI);
|
bool SimplifyStoreAtEndOfBlock(StoreInst &SI);
|
||||||
Instruction *SimplifyMemTransfer(MemIntrinsic *MI);
|
Instruction *SimplifyMemTransfer(MemTransferInst *MI);
|
||||||
Instruction *SimplifyMemSet(MemSetInst *MI);
|
Instruction *SimplifyMemSet(MemSetInst *MI);
|
||||||
|
|
||||||
Value *EvaluateInDifferentType(Value *V, Type *Ty, bool isSigned);
|
Value *EvaluateInDifferentType(Value *V, Type *Ty, bool isSigned);
|
||||||
|
@ -1356,20 +1356,21 @@ void DFSanVisitor::visitMemTransferInst(MemTransferInst &I) {
|
|||||||
Value *LenShadow = IRB.CreateMul(
|
Value *LenShadow = IRB.CreateMul(
|
||||||
I.getLength(),
|
I.getLength(),
|
||||||
ConstantInt::get(I.getLength()->getType(), DFSF.DFS.ShadowWidth / 8));
|
ConstantInt::get(I.getLength()->getType(), DFSF.DFS.ShadowWidth / 8));
|
||||||
Value *AlignShadow;
|
|
||||||
if (ClPreserveAlignment) {
|
|
||||||
AlignShadow = IRB.CreateMul(I.getAlignmentCst(),
|
|
||||||
ConstantInt::get(I.getAlignmentCst()->getType(),
|
|
||||||
DFSF.DFS.ShadowWidth / 8));
|
|
||||||
} else {
|
|
||||||
AlignShadow = ConstantInt::get(I.getAlignmentCst()->getType(),
|
|
||||||
DFSF.DFS.ShadowWidth / 8);
|
|
||||||
}
|
|
||||||
Type *Int8Ptr = Type::getInt8PtrTy(*DFSF.DFS.Ctx);
|
Type *Int8Ptr = Type::getInt8PtrTy(*DFSF.DFS.Ctx);
|
||||||
DestShadow = IRB.CreateBitCast(DestShadow, Int8Ptr);
|
DestShadow = IRB.CreateBitCast(DestShadow, Int8Ptr);
|
||||||
SrcShadow = IRB.CreateBitCast(SrcShadow, Int8Ptr);
|
SrcShadow = IRB.CreateBitCast(SrcShadow, Int8Ptr);
|
||||||
IRB.CreateCall(I.getCalledValue(), {DestShadow, SrcShadow, LenShadow,
|
auto *MTI = cast<MemTransferInst>(IRB.CreateCall(I.getCalledValue(),
|
||||||
AlignShadow, I.getVolatileCst()});
|
{ DestShadow, SrcShadow,
|
||||||
|
LenShadow,
|
||||||
|
I.getVolatileCst() }));
|
||||||
|
|
||||||
|
if (ClPreserveAlignment) {
|
||||||
|
MTI->setDestAlignment(I.getDestAlignment() * (DFSF.DFS.ShadowWidth / 8));
|
||||||
|
MTI->setSrcAlignment(I.getSrcAlignment() * (DFSF.DFS.ShadowWidth / 8));
|
||||||
|
} else {
|
||||||
|
MTI->setDestAlignment(DFSF.DFS.ShadowWidth / 8);
|
||||||
|
MTI->setSrcAlignment(DFSF.DFS.ShadowWidth / 8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DFSanVisitor::visitReturnInst(ReturnInst &RI) {
|
void DFSanVisitor::visitReturnInst(ReturnInst &RI) {
|
||||||
|
@ -1117,7 +1117,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
|||||||
unsigned CopyAlign = std::min(ArgAlign, kShadowTLSAlignment);
|
unsigned CopyAlign = std::min(ArgAlign, kShadowTLSAlignment);
|
||||||
Value *Cpy = EntryIRB.CreateMemCpy(
|
Value *Cpy = EntryIRB.CreateMemCpy(
|
||||||
getShadowPtr(V, EntryIRB.getInt8Ty(), EntryIRB), Base, Size,
|
getShadowPtr(V, EntryIRB.getInt8Ty(), EntryIRB), Base, Size,
|
||||||
CopyAlign);
|
CopyAlign, CopyAlign);
|
||||||
DEBUG(dbgs() << " ByValCpy: " << *Cpy << "\n");
|
DEBUG(dbgs() << " ByValCpy: " << *Cpy << "\n");
|
||||||
(void)Cpy;
|
(void)Cpy;
|
||||||
}
|
}
|
||||||
@ -2482,7 +2482,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
|||||||
unsigned Alignment = std::min(ParamAlignment, kShadowTLSAlignment);
|
unsigned Alignment = std::min(ParamAlignment, kShadowTLSAlignment);
|
||||||
Store = IRB.CreateMemCpy(ArgShadowBase,
|
Store = IRB.CreateMemCpy(ArgShadowBase,
|
||||||
getShadowPtr(A, Type::getInt8Ty(*MS.C), IRB),
|
getShadowPtr(A, Type::getInt8Ty(*MS.C), IRB),
|
||||||
Size, Alignment);
|
Size, Alignment, Alignment);
|
||||||
} else {
|
} else {
|
||||||
Size = DL.getTypeAllocSize(A->getType());
|
Size = DL.getTypeAllocSize(A->getType());
|
||||||
if (ArgOffset + Size > kParamTLSSize) break;
|
if (ArgOffset + Size > kParamTLSSize) break;
|
||||||
@ -2834,7 +2834,7 @@ struct VarArgAMD64Helper : public VarArgHelper {
|
|||||||
Value *Base = getShadowPtrForVAArgument(RealTy, IRB, OverflowOffset);
|
Value *Base = getShadowPtrForVAArgument(RealTy, IRB, OverflowOffset);
|
||||||
OverflowOffset += RoundUpToAlignment(ArgSize, 8);
|
OverflowOffset += RoundUpToAlignment(ArgSize, 8);
|
||||||
IRB.CreateMemCpy(Base, MSV.getShadowPtr(A, IRB.getInt8Ty(), IRB),
|
IRB.CreateMemCpy(Base, MSV.getShadowPtr(A, IRB.getInt8Ty(), IRB),
|
||||||
ArgSize, kShadowTLSAlignment);
|
ArgSize, kShadowTLSAlignment, kShadowTLSAlignment);
|
||||||
} else {
|
} else {
|
||||||
ArgKind AK = classifyArgument(A);
|
ArgKind AK = classifyArgument(A);
|
||||||
if (AK == AK_GeneralPurpose && GpOffset >= AMD64GpEndOffset)
|
if (AK == AK_GeneralPurpose && GpOffset >= AMD64GpEndOffset)
|
||||||
@ -2912,7 +2912,7 @@ struct VarArgAMD64Helper : public VarArgHelper {
|
|||||||
IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AMD64FpEndOffset),
|
IRB.CreateAdd(ConstantInt::get(MS.IntptrTy, AMD64FpEndOffset),
|
||||||
VAArgOverflowSize);
|
VAArgOverflowSize);
|
||||||
VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize);
|
VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize);
|
||||||
IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8);
|
IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instrument va_start.
|
// Instrument va_start.
|
||||||
@ -2931,7 +2931,7 @@ struct VarArgAMD64Helper : public VarArgHelper {
|
|||||||
Value *RegSaveAreaShadowPtr =
|
Value *RegSaveAreaShadowPtr =
|
||||||
MSV.getShadowPtr(RegSaveAreaPtr, IRB.getInt8Ty(), IRB);
|
MSV.getShadowPtr(RegSaveAreaPtr, IRB.getInt8Ty(), IRB);
|
||||||
IRB.CreateMemCpy(RegSaveAreaShadowPtr, VAArgTLSCopy,
|
IRB.CreateMemCpy(RegSaveAreaShadowPtr, VAArgTLSCopy,
|
||||||
AMD64FpEndOffset, 16);
|
AMD64FpEndOffset, 16, 16);
|
||||||
|
|
||||||
Value *OverflowArgAreaPtrPtr =
|
Value *OverflowArgAreaPtrPtr =
|
||||||
IRB.CreateIntToPtr(
|
IRB.CreateIntToPtr(
|
||||||
@ -2943,7 +2943,8 @@ struct VarArgAMD64Helper : public VarArgHelper {
|
|||||||
MSV.getShadowPtr(OverflowArgAreaPtr, IRB.getInt8Ty(), IRB);
|
MSV.getShadowPtr(OverflowArgAreaPtr, IRB.getInt8Ty(), IRB);
|
||||||
Value *SrcPtr = IRB.CreateConstGEP1_32(IRB.getInt8Ty(), VAArgTLSCopy,
|
Value *SrcPtr = IRB.CreateConstGEP1_32(IRB.getInt8Ty(), VAArgTLSCopy,
|
||||||
AMD64FpEndOffset);
|
AMD64FpEndOffset);
|
||||||
IRB.CreateMemCpy(OverflowArgAreaShadowPtr, SrcPtr, VAArgOverflowSize, 16);
|
IRB.CreateMemCpy(OverflowArgAreaShadowPtr, SrcPtr, VAArgOverflowSize,
|
||||||
|
16, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -3029,7 +3030,7 @@ struct VarArgMIPS64Helper : public VarArgHelper {
|
|||||||
// If there is a va_start in this function, make a backup copy of
|
// If there is a va_start in this function, make a backup copy of
|
||||||
// va_arg_tls somewhere in the function entry block.
|
// va_arg_tls somewhere in the function entry block.
|
||||||
VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize);
|
VAArgTLSCopy = IRB.CreateAlloca(Type::getInt8Ty(*MS.C), CopySize);
|
||||||
IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8);
|
IRB.CreateMemCpy(VAArgTLSCopy, MS.VAArgTLS, CopySize, 8, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instrument va_start.
|
// Instrument va_start.
|
||||||
@ -3044,7 +3045,7 @@ struct VarArgMIPS64Helper : public VarArgHelper {
|
|||||||
Value *RegSaveAreaPtr = IRB.CreateLoad(RegSaveAreaPtrPtr);
|
Value *RegSaveAreaPtr = IRB.CreateLoad(RegSaveAreaPtrPtr);
|
||||||
Value *RegSaveAreaShadowPtr =
|
Value *RegSaveAreaShadowPtr =
|
||||||
MSV.getShadowPtr(RegSaveAreaPtr, IRB.getInt8Ty(), IRB);
|
MSV.getShadowPtr(RegSaveAreaPtr, IRB.getInt8Ty(), IRB);
|
||||||
IRB.CreateMemCpy(RegSaveAreaShadowPtr, VAArgTLSCopy, CopySize, 8);
|
IRB.CreateMemCpy(RegSaveAreaShadowPtr, VAArgTLSCopy, CopySize, 8, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -347,6 +347,8 @@ bool AlignmentFromAssumptions::processAssumption(CallInst *ACall) {
|
|||||||
// instruction, but only for one operand, save it. If we reach the
|
// instruction, but only for one operand, save it. If we reach the
|
||||||
// other operand through another assumption later, then we may
|
// other operand through another assumption later, then we may
|
||||||
// change the alignment at that point.
|
// change the alignment at that point.
|
||||||
|
// FIXME: The above statement is no longer true. Fix the code below
|
||||||
|
// to be able to reason about different dest/src alignments.
|
||||||
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI)) {
|
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI)) {
|
||||||
unsigned NewSrcAlignment = getNewAlignment(AASCEV, AlignSCEV, OffSCEV,
|
unsigned NewSrcAlignment = getNewAlignment(AASCEV, AlignSCEV, OffSCEV,
|
||||||
MTI->getSource(), SE);
|
MTI->getSource(), SE);
|
||||||
@ -376,20 +378,23 @@ bool AlignmentFromAssumptions::processAssumption(CallInst *ACall) {
|
|||||||
if (AltSrcAlignment <= std::max(NewDestAlignment, AltDestAlignment))
|
if (AltSrcAlignment <= std::max(NewDestAlignment, AltDestAlignment))
|
||||||
NewAlignment = std::max(NewAlignment, AltSrcAlignment);
|
NewAlignment = std::max(NewAlignment, AltSrcAlignment);
|
||||||
|
|
||||||
if (NewAlignment > MI->getAlignment()) {
|
if (NewAlignment > MTI->getDestAlignment()) {
|
||||||
MI->setAlignment(ConstantInt::get(Type::getInt32Ty(
|
MTI->setDestAlignment(NewAlignment);
|
||||||
MI->getParent()->getContext()), NewAlignment));
|
++NumMemIntAlignChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NewAlignment > MTI->getSrcAlignment()) {
|
||||||
|
MTI->setSrcAlignment(NewAlignment);
|
||||||
++NumMemIntAlignChanged;
|
++NumMemIntAlignChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewDestAlignments.insert(std::make_pair(MTI, NewDestAlignment));
|
NewDestAlignments.insert(std::make_pair(MTI, NewDestAlignment));
|
||||||
NewSrcAlignments.insert(std::make_pair(MTI, NewSrcAlignment));
|
NewSrcAlignments.insert(std::make_pair(MTI, NewSrcAlignment));
|
||||||
} else if (NewDestAlignment > MI->getAlignment()) {
|
} else if (NewDestAlignment > MI->getDestAlignment()) {
|
||||||
assert((!isa<MemIntrinsic>(MI) || isa<MemSetInst>(MI)) &&
|
assert((!isa<MemIntrinsic>(MI) || isa<MemSetInst>(MI)) &&
|
||||||
"Unknown memory intrinsic");
|
"Unknown memory intrinsic");
|
||||||
|
|
||||||
MI->setAlignment(ConstantInt::get(Type::getInt32Ty(
|
MI->setDestAlignment(NewDestAlignment);
|
||||||
MI->getParent()->getContext()), NewDestAlignment));
|
|
||||||
++NumMemIntAlignChanged;
|
++NumMemIntAlignChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -611,7 +611,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
|
|||||||
// as any store/memset/memcpy is likely using vector instructions so
|
// as any store/memset/memcpy is likely using vector instructions so
|
||||||
// shortening it to not vector size is likely to be slower
|
// shortening it to not vector size is likely to be slower
|
||||||
MemIntrinsic* DepIntrinsic = cast<MemIntrinsic>(DepWrite);
|
MemIntrinsic* DepIntrinsic = cast<MemIntrinsic>(DepWrite);
|
||||||
unsigned DepWriteAlign = DepIntrinsic->getAlignment();
|
unsigned DepWriteAlign = DepIntrinsic->getDestAlignment();
|
||||||
if (llvm::isPowerOf2_64(InstWriteOffset) ||
|
if (llvm::isPowerOf2_64(InstWriteOffset) ||
|
||||||
((DepWriteAlign != 0) && InstWriteOffset % DepWriteAlign == 0)) {
|
((DepWriteAlign != 0) && InstWriteOffset % DepWriteAlign == 0)) {
|
||||||
|
|
||||||
|
@ -414,8 +414,8 @@ bool LoopIdiomRecognize::processLoopMemSet(MemSetInst *MSI,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
return processLoopStridedStore(Pointer, (unsigned)SizeInBytes,
|
return processLoopStridedStore(Pointer, (unsigned)SizeInBytes,
|
||||||
MSI->getAlignment(), MSI->getValue(), MSI, Ev,
|
MSI->getDestAlignment(), MSI->getValue(), MSI,
|
||||||
BECount, /*NegStride=*/false);
|
Ev, BECount, /*NegStride=*/false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// mayLoopAccessLocation - Return true if the specified loop might access the
|
/// mayLoopAccessLocation - Return true if the specified loop might access the
|
||||||
@ -700,7 +700,7 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad(
|
|||||||
|
|
||||||
CallInst *NewCall =
|
CallInst *NewCall =
|
||||||
Builder.CreateMemCpy(StoreBasePtr, LoadBasePtr, NumBytes,
|
Builder.CreateMemCpy(StoreBasePtr, LoadBasePtr, NumBytes,
|
||||||
std::min(SI->getAlignment(), LI->getAlignment()));
|
SI->getAlignment(), LI->getAlignment());
|
||||||
NewCall->setDebugLoc(SI->getDebugLoc());
|
NewCall->setDebugLoc(SI->getDebugLoc());
|
||||||
|
|
||||||
DEBUG(dbgs() << " Formed memcpy: " << *NewCall << "\n"
|
DEBUG(dbgs() << " Formed memcpy: " << *NewCall << "\n"
|
||||||
|
@ -229,7 +229,8 @@ public:
|
|||||||
|
|
||||||
void addMemSet(int64_t OffsetFromFirst, MemSetInst *MSI) {
|
void addMemSet(int64_t OffsetFromFirst, MemSetInst *MSI) {
|
||||||
int64_t Size = cast<ConstantInt>(MSI->getLength())->getZExtValue();
|
int64_t Size = cast<ConstantInt>(MSI->getLength())->getZExtValue();
|
||||||
addRange(OffsetFromFirst, Size, MSI->getDest(), MSI->getAlignment(), MSI);
|
addRange(OffsetFromFirst, Size, MSI->getDest(), MSI->getDestAlignment(),
|
||||||
|
MSI);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addRange(int64_t Start, int64_t Size, Value *Ptr,
|
void addRange(int64_t Start, int64_t Size, Value *Ptr,
|
||||||
@ -819,20 +820,17 @@ bool MemCpyOpt::processMemCpyMemCpyDependence(MemCpyInst *M, MemCpyInst *MDep) {
|
|||||||
|
|
||||||
// If all checks passed, then we can transform M.
|
// If all checks passed, then we can transform M.
|
||||||
|
|
||||||
// Make sure to use the lesser of the alignment of the source and the dest
|
|
||||||
// since we're changing where we're reading from, but don't want to increase
|
|
||||||
// the alignment past what can be read from or written to.
|
|
||||||
// TODO: Is this worth it if we're creating a less aligned memcpy? For
|
// TODO: Is this worth it if we're creating a less aligned memcpy? For
|
||||||
// example we could be moving from movaps -> movq on x86.
|
// example we could be moving from movaps -> movq on x86.
|
||||||
unsigned Align = std::min(MDep->getAlignment(), M->getAlignment());
|
|
||||||
|
|
||||||
IRBuilder<> Builder(M);
|
IRBuilder<> Builder(M);
|
||||||
if (UseMemMove)
|
if (UseMemMove)
|
||||||
Builder.CreateMemMove(M->getRawDest(), MDep->getRawSource(), M->getLength(),
|
Builder.CreateMemMove(M->getRawDest(), MDep->getRawSource(), M->getLength(),
|
||||||
Align, M->isVolatile());
|
M->getDestAlignment(), MDep->getSrcAlignment(),
|
||||||
|
M->isVolatile());
|
||||||
else
|
else
|
||||||
Builder.CreateMemCpy(M->getRawDest(), MDep->getRawSource(), M->getLength(),
|
Builder.CreateMemCpy(M->getRawDest(), MDep->getRawSource(), M->getLength(),
|
||||||
Align, M->isVolatile());
|
M->getDestAlignment(), MDep->getSrcAlignment(),
|
||||||
|
M->isVolatile());
|
||||||
|
|
||||||
// Remove the instruction we're replacing.
|
// Remove the instruction we're replacing.
|
||||||
MD->removeInstruction(M);
|
MD->removeInstruction(M);
|
||||||
@ -878,7 +876,7 @@ bool MemCpyOpt::processMemSetMemCpyDependence(MemCpyInst *MemCpy,
|
|||||||
// If Dest is aligned, and SrcSize is constant, use the minimum alignment
|
// If Dest is aligned, and SrcSize is constant, use the minimum alignment
|
||||||
// of the sum.
|
// of the sum.
|
||||||
const unsigned DestAlign =
|
const unsigned DestAlign =
|
||||||
std::max(MemSet->getAlignment(), MemCpy->getAlignment());
|
std::max(MemSet->getDestAlignment(), MemCpy->getDestAlignment());
|
||||||
if (DestAlign > 1)
|
if (DestAlign > 1)
|
||||||
if (ConstantInt *SrcSizeC = dyn_cast<ConstantInt>(SrcSize))
|
if (ConstantInt *SrcSizeC = dyn_cast<ConstantInt>(SrcSize))
|
||||||
Align = MinAlign(SrcSizeC->getZExtValue(), DestAlign);
|
Align = MinAlign(SrcSizeC->getZExtValue(), DestAlign);
|
||||||
@ -935,7 +933,7 @@ bool MemCpyOpt::performMemCpyToMemSetOptzn(MemCpyInst *MemCpy,
|
|||||||
|
|
||||||
IRBuilder<> Builder(MemCpy);
|
IRBuilder<> Builder(MemCpy);
|
||||||
Builder.CreateMemSet(MemCpy->getRawDest(), MemSet->getOperand(1),
|
Builder.CreateMemSet(MemCpy->getRawDest(), MemSet->getOperand(1),
|
||||||
CopySize, MemCpy->getAlignment());
|
CopySize, MemCpy->getDestAlignment());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -961,7 +959,7 @@ bool MemCpyOpt::processMemCpy(MemCpyInst *M) {
|
|||||||
if (Value *ByteVal = isBytewiseValue(GV->getInitializer())) {
|
if (Value *ByteVal = isBytewiseValue(GV->getInitializer())) {
|
||||||
IRBuilder<> Builder(M);
|
IRBuilder<> Builder(M);
|
||||||
Builder.CreateMemSet(M->getRawDest(), ByteVal, M->getLength(),
|
Builder.CreateMemSet(M->getRawDest(), ByteVal, M->getLength(),
|
||||||
M->getAlignment(), false);
|
M->getDestAlignment(), false);
|
||||||
MD->removeInstruction(M);
|
MD->removeInstruction(M);
|
||||||
M->eraseFromParent();
|
M->eraseFromParent();
|
||||||
++NumCpyToSet;
|
++NumCpyToSet;
|
||||||
@ -990,8 +988,11 @@ bool MemCpyOpt::processMemCpy(MemCpyInst *M) {
|
|||||||
// d) memcpy from a just-memset'd source can be turned into memset.
|
// d) memcpy from a just-memset'd source can be turned into memset.
|
||||||
if (DepInfo.isClobber()) {
|
if (DepInfo.isClobber()) {
|
||||||
if (CallInst *C = dyn_cast<CallInst>(DepInfo.getInst())) {
|
if (CallInst *C = dyn_cast<CallInst>(DepInfo.getInst())) {
|
||||||
|
// FIXME: Can we pass in either of dest/src alignment here instead of
|
||||||
|
// convervatively taking the minimum?
|
||||||
|
unsigned Align = std::min(M->getDestAlignment(), M->getSrcAlignment());
|
||||||
if (performCallSlotOptzn(M, M->getDest(), M->getSource(),
|
if (performCallSlotOptzn(M, M->getDest(), M->getSource(),
|
||||||
CopySize->getZExtValue(), M->getAlignment(),
|
CopySize->getZExtValue(), Align,
|
||||||
C)) {
|
C)) {
|
||||||
MD->removeInstruction(M);
|
MD->removeInstruction(M);
|
||||||
M->eraseFromParent();
|
M->eraseFromParent();
|
||||||
@ -1108,7 +1109,11 @@ bool MemCpyOpt::processByValArgument(CallSite CS, unsigned ArgNo) {
|
|||||||
getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
|
getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
|
||||||
*CS->getParent()->getParent());
|
*CS->getParent()->getParent());
|
||||||
DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
|
DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
|
||||||
if (MDep->getAlignment() < ByValAlign &&
|
// FIXME: Can we use either of dest/src alignment here instead of
|
||||||
|
// convervatively taking the minimum?
|
||||||
|
unsigned MinAlign = std::min(MDep->getDestAlignment(),
|
||||||
|
MDep->getSrcAlignment());
|
||||||
|
if (MinAlign < ByValAlign &&
|
||||||
getOrEnforceKnownAlignment(MDep->getSource(), ByValAlign, DL,
|
getOrEnforceKnownAlignment(MDep->getSource(), ByValAlign, DL,
|
||||||
CS.getInstruction(), &AC, &DT) < ByValAlign)
|
CS.getInstruction(), &AC, &DT) < ByValAlign)
|
||||||
return false;
|
return false;
|
||||||
|
@ -2618,8 +2618,7 @@ private:
|
|||||||
assert(!IsSplit);
|
assert(!IsSplit);
|
||||||
assert(NewBeginOffset == BeginOffset);
|
assert(NewBeginOffset == BeginOffset);
|
||||||
II.setDest(getNewAllocaSlicePtr(IRB, OldPtr->getType()));
|
II.setDest(getNewAllocaSlicePtr(IRB, OldPtr->getType()));
|
||||||
Type *CstTy = II.getAlignmentCst()->getType();
|
II.setDestAlignment(getSliceAlign());
|
||||||
II.setAlignment(ConstantInt::get(CstTy, getSliceAlign()));
|
|
||||||
|
|
||||||
deleteIfTriviallyDead(OldPtr);
|
deleteIfTriviallyDead(OldPtr);
|
||||||
return false;
|
return false;
|
||||||
@ -2735,15 +2734,16 @@ private:
|
|||||||
// update both source and dest of a single call.
|
// update both source and dest of a single call.
|
||||||
if (!IsSplittable) {
|
if (!IsSplittable) {
|
||||||
Value *AdjustedPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
|
Value *AdjustedPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
|
||||||
if (IsDest)
|
if (IsDest) {
|
||||||
II.setDest(AdjustedPtr);
|
II.setDest(AdjustedPtr);
|
||||||
else
|
|
||||||
|
if (II.getDestAlignment() > SliceAlign)
|
||||||
|
II.setDestAlignment(MinAlign(II.getDestAlignment(), SliceAlign));
|
||||||
|
} else {
|
||||||
II.setSource(AdjustedPtr);
|
II.setSource(AdjustedPtr);
|
||||||
|
|
||||||
if (II.getAlignment() > SliceAlign) {
|
if (II.getSrcAlignment() > SliceAlign)
|
||||||
Type *CstTy = II.getAlignmentCst()->getType();
|
II.setSrcAlignment(MinAlign(II.getSrcAlignment(), SliceAlign));
|
||||||
II.setAlignment(
|
|
||||||
ConstantInt::get(CstTy, MinAlign(II.getAlignment(), SliceAlign)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(dbgs() << " to: " << II << "\n");
|
DEBUG(dbgs() << " to: " << II << "\n");
|
||||||
@ -2796,8 +2796,10 @@ private:
|
|||||||
// Compute the relative offset for the other pointer within the transfer.
|
// Compute the relative offset for the other pointer within the transfer.
|
||||||
unsigned IntPtrWidth = DL.getPointerSizeInBits(OtherAS);
|
unsigned IntPtrWidth = DL.getPointerSizeInBits(OtherAS);
|
||||||
APInt OtherOffset(IntPtrWidth, NewBeginOffset - BeginOffset);
|
APInt OtherOffset(IntPtrWidth, NewBeginOffset - BeginOffset);
|
||||||
unsigned OtherAlign = MinAlign(II.getAlignment() ? II.getAlignment() : 1,
|
unsigned OtherDestAlign = MinAlign(II.getDestAlignment() ? II.getDestAlignment() : 1,
|
||||||
OtherOffset.zextOrTrunc(64).getZExtValue());
|
OtherOffset.zextOrTrunc(64).getZExtValue());
|
||||||
|
unsigned OtherSrcAlign = MinAlign(II.getSrcAlignment() ? II.getSrcAlignment() : 1,
|
||||||
|
OtherOffset.zextOrTrunc(64).getZExtValue());
|
||||||
|
|
||||||
if (EmitMemCpy) {
|
if (EmitMemCpy) {
|
||||||
// Compute the other pointer, folding as much as possible to produce
|
// Compute the other pointer, folding as much as possible to produce
|
||||||
@ -2809,9 +2811,11 @@ private:
|
|||||||
Type *SizeTy = II.getLength()->getType();
|
Type *SizeTy = II.getLength()->getType();
|
||||||
Constant *Size = ConstantInt::get(SizeTy, NewEndOffset - NewBeginOffset);
|
Constant *Size = ConstantInt::get(SizeTy, NewEndOffset - NewBeginOffset);
|
||||||
|
|
||||||
CallInst *New = IRB.CreateMemCpy(
|
CallInst *New = IRB.CreateMemCpy(IsDest ? OurPtr : OtherPtr,
|
||||||
IsDest ? OurPtr : OtherPtr, IsDest ? OtherPtr : OurPtr, Size,
|
IsDest ? OtherPtr : OurPtr, Size,
|
||||||
MinAlign(SliceAlign, OtherAlign), II.isVolatile());
|
MinAlign(SliceAlign, OtherDestAlign),
|
||||||
|
MinAlign(SliceAlign, OtherSrcAlign),
|
||||||
|
II.isVolatile());
|
||||||
(void)New;
|
(void)New;
|
||||||
DEBUG(dbgs() << " to: " << *New << "\n");
|
DEBUG(dbgs() << " to: " << *New << "\n");
|
||||||
return false;
|
return false;
|
||||||
@ -2843,7 +2847,7 @@ private:
|
|||||||
|
|
||||||
Value *SrcPtr = getAdjustedPtr(IRB, DL, OtherPtr, OtherOffset, OtherPtrTy,
|
Value *SrcPtr = getAdjustedPtr(IRB, DL, OtherPtr, OtherOffset, OtherPtrTy,
|
||||||
OtherPtr->getName() + ".");
|
OtherPtr->getName() + ".");
|
||||||
unsigned SrcAlign = OtherAlign;
|
unsigned SrcAlign = OtherSrcAlign;
|
||||||
Value *DstPtr = &NewAI;
|
Value *DstPtr = &NewAI;
|
||||||
unsigned DstAlign = SliceAlign;
|
unsigned DstAlign = SliceAlign;
|
||||||
if (!IsDest) {
|
if (!IsDest) {
|
||||||
|
@ -716,7 +716,7 @@ void ConvertToScalarInfo::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI,
|
|||||||
SrcPtr = Builder.CreateBitCast(SrcPtr, AIPTy);
|
SrcPtr = Builder.CreateBitCast(SrcPtr, AIPTy);
|
||||||
|
|
||||||
LoadInst *SrcVal = Builder.CreateLoad(SrcPtr, "srcval");
|
LoadInst *SrcVal = Builder.CreateLoad(SrcPtr, "srcval");
|
||||||
SrcVal->setAlignment(MTI->getAlignment());
|
SrcVal->setAlignment(MTI->getSrcAlignment());
|
||||||
Builder.CreateStore(SrcVal, NewAI);
|
Builder.CreateStore(SrcVal, NewAI);
|
||||||
} else if (GetUnderlyingObject(MTI->getDest(), DL, 0) != OrigAI) {
|
} else if (GetUnderlyingObject(MTI->getDest(), DL, 0) != OrigAI) {
|
||||||
// Src must be OrigAI, change this to be a load from NewAI then a store
|
// Src must be OrigAI, change this to be a load from NewAI then a store
|
||||||
@ -733,7 +733,7 @@ void ConvertToScalarInfo::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI,
|
|||||||
Value *DstPtr = Builder.CreateBitCast(MTI->getDest(), AIPTy);
|
Value *DstPtr = Builder.CreateBitCast(MTI->getDest(), AIPTy);
|
||||||
|
|
||||||
StoreInst *NewStore = Builder.CreateStore(SrcVal, DstPtr);
|
StoreInst *NewStore = Builder.CreateStore(SrcVal, DstPtr);
|
||||||
NewStore->setAlignment(MTI->getAlignment());
|
NewStore->setAlignment(MTI->getDestAlignment());
|
||||||
} else {
|
} else {
|
||||||
// Noop transfer. Src == Dst
|
// Noop transfer. Src == Dst
|
||||||
}
|
}
|
||||||
@ -2182,7 +2182,8 @@ SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst,
|
|||||||
// that doesn't have anything to do with the alloca that we are promoting. For
|
// that doesn't have anything to do with the alloca that we are promoting. For
|
||||||
// memset, this Value* stays null.
|
// memset, this Value* stays null.
|
||||||
Value *OtherPtr = nullptr;
|
Value *OtherPtr = nullptr;
|
||||||
unsigned MemAlignment = MI->getAlignment();
|
unsigned DestMemAlignment = MI->getDestAlignment();
|
||||||
|
unsigned SrcMemAlignment = 0;
|
||||||
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI)) { // memmove/memcopy
|
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI)) { // memmove/memcopy
|
||||||
if (Inst == MTI->getRawDest())
|
if (Inst == MTI->getRawDest())
|
||||||
OtherPtr = MTI->getRawSource();
|
OtherPtr = MTI->getRawSource();
|
||||||
@ -2190,6 +2191,7 @@ SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst,
|
|||||||
assert(Inst == MTI->getRawSource());
|
assert(Inst == MTI->getRawSource());
|
||||||
OtherPtr = MTI->getRawDest();
|
OtherPtr = MTI->getRawDest();
|
||||||
}
|
}
|
||||||
|
SrcMemAlignment = MTI->getSrcAlignment();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is an other pointer, we want to convert it to the same pointer
|
// If there is an other pointer, we want to convert it to the same pointer
|
||||||
@ -2235,7 +2237,8 @@ SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst,
|
|||||||
for (unsigned i = 0, e = NewElts.size(); i != e; ++i) {
|
for (unsigned i = 0, e = NewElts.size(); i != e; ++i) {
|
||||||
// If this is a memcpy/memmove, emit a GEP of the other element address.
|
// If this is a memcpy/memmove, emit a GEP of the other element address.
|
||||||
Value *OtherElt = nullptr;
|
Value *OtherElt = nullptr;
|
||||||
unsigned OtherEltAlign = MemAlignment;
|
unsigned OtherDestEltAlign = DestMemAlignment;
|
||||||
|
unsigned OtherSrcEltAlign = SrcMemAlignment;
|
||||||
|
|
||||||
if (OtherPtr) {
|
if (OtherPtr) {
|
||||||
Value *Idx[2] = { Zero,
|
Value *Idx[2] = { Zero,
|
||||||
@ -2258,7 +2261,8 @@ SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst,
|
|||||||
// mem intrinsic and the alignment of the element. If the alignment of
|
// mem intrinsic and the alignment of the element. If the alignment of
|
||||||
// the memcpy (f.e.) is 32 but the element is at a 4-byte offset, then the
|
// the memcpy (f.e.) is 32 but the element is at a 4-byte offset, then the
|
||||||
// known alignment is just 4 bytes.
|
// known alignment is just 4 bytes.
|
||||||
OtherEltAlign = (unsigned)MinAlign(OtherEltAlign, EltOffset);
|
OtherDestEltAlign = (unsigned)MinAlign(OtherDestEltAlign, EltOffset);
|
||||||
|
OtherSrcEltAlign = (unsigned)MinAlign(OtherSrcEltAlign, EltOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
Value *EltPtr = NewElts[i];
|
Value *EltPtr = NewElts[i];
|
||||||
@ -2269,12 +2273,13 @@ SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst,
|
|||||||
if (isa<MemTransferInst>(MI)) {
|
if (isa<MemTransferInst>(MI)) {
|
||||||
if (SROADest) {
|
if (SROADest) {
|
||||||
// From Other to Alloca.
|
// From Other to Alloca.
|
||||||
Value *Elt = new LoadInst(OtherElt, "tmp", false, OtherEltAlign, MI);
|
Value *Elt = new LoadInst(OtherElt, "tmp", false,
|
||||||
|
OtherSrcEltAlign, MI);
|
||||||
new StoreInst(Elt, EltPtr, MI);
|
new StoreInst(Elt, EltPtr, MI);
|
||||||
} else {
|
} else {
|
||||||
// From Alloca to Other.
|
// From Alloca to Other.
|
||||||
Value *Elt = new LoadInst(EltPtr, "tmp", MI);
|
Value *Elt = new LoadInst(EltPtr, "tmp", MI);
|
||||||
new StoreInst(Elt, OtherElt, false, OtherEltAlign, MI);
|
new StoreInst(Elt, OtherElt, false, OtherDestEltAlign, MI);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -2337,9 +2342,11 @@ SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *Inst,
|
|||||||
Value *Src = SROADest ? OtherElt : EltPtr; // Src ptr
|
Value *Src = SROADest ? OtherElt : EltPtr; // Src ptr
|
||||||
|
|
||||||
if (isa<MemCpyInst>(MI))
|
if (isa<MemCpyInst>(MI))
|
||||||
Builder.CreateMemCpy(Dst, Src, EltSize, OtherEltAlign,MI->isVolatile());
|
Builder.CreateMemCpy(Dst, Src, EltSize, OtherDestEltAlign,
|
||||||
|
OtherSrcEltAlign, MI->isVolatile());
|
||||||
else
|
else
|
||||||
Builder.CreateMemMove(Dst, Src, EltSize,OtherEltAlign,MI->isVolatile());
|
Builder.CreateMemMove(Dst, Src, EltSize, OtherDestEltAlign,
|
||||||
|
OtherSrcEltAlign, MI->isVolatile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DeadInsts.push_back(MI);
|
DeadInsts.push_back(MI);
|
||||||
|
@ -851,7 +851,7 @@ static void HandleByValArgumentInit(Value *Dst, Value *Src, Module *M,
|
|||||||
// Always generate a memcpy of alignment 1 here because we don't know
|
// Always generate a memcpy of alignment 1 here because we don't know
|
||||||
// the alignment of the src pointer. Other optimizations can infer
|
// the alignment of the src pointer. Other optimizations can infer
|
||||||
// better alignment.
|
// better alignment.
|
||||||
Builder.CreateMemCpy(Dst, Src, Size, /*Align=*/1);
|
Builder.CreateMemCpy(Dst, Src, Size, /*DestAlign=*/1, /*SrcAlign=*/1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// When inlining a call site that has a byval argument,
|
/// When inlining a call site that has a byval argument,
|
||||||
|
@ -238,7 +238,7 @@ Value *LibCallSimplifier::emitStrLenMemCpy(Value *Src, Value *Dst, uint64_t Len,
|
|||||||
// concatenation for us. Make a memcpy to copy the nul byte with align = 1.
|
// concatenation for us. Make a memcpy to copy the nul byte with align = 1.
|
||||||
B.CreateMemCpy(CpyDst, Src,
|
B.CreateMemCpy(CpyDst, Src,
|
||||||
ConstantInt::get(DL.getIntPtrType(Src->getContext()), Len + 1),
|
ConstantInt::get(DL.getIntPtrType(Src->getContext()), Len + 1),
|
||||||
1);
|
1, 1);
|
||||||
return Dst;
|
return Dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,7 +471,8 @@ Value *LibCallSimplifier::optimizeStrCpy(CallInst *CI, IRBuilder<> &B) {
|
|||||||
// We have enough information to now generate the memcpy call to do the
|
// We have enough information to now generate the memcpy call to do the
|
||||||
// copy for us. Make a memcpy to copy the nul byte with align = 1.
|
// copy for us. Make a memcpy to copy the nul byte with align = 1.
|
||||||
B.CreateMemCpy(Dst, Src,
|
B.CreateMemCpy(Dst, Src,
|
||||||
ConstantInt::get(DL.getIntPtrType(CI->getContext()), Len), 1);
|
ConstantInt::get(DL.getIntPtrType(CI->getContext()), Len), 1,
|
||||||
|
1);
|
||||||
return Dst;
|
return Dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,7 +499,7 @@ Value *LibCallSimplifier::optimizeStpCpy(CallInst *CI, IRBuilder<> &B) {
|
|||||||
|
|
||||||
// We have enough information to now generate the memcpy call to do the
|
// We have enough information to now generate the memcpy call to do the
|
||||||
// copy for us. Make a memcpy to copy the nul byte with align = 1.
|
// copy for us. Make a memcpy to copy the nul byte with align = 1.
|
||||||
B.CreateMemCpy(Dst, Src, LenV, 1);
|
B.CreateMemCpy(Dst, Src, LenV, 1, 1);
|
||||||
return DstEnd;
|
return DstEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -538,7 +539,7 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
|
|||||||
|
|
||||||
Type *PT = Callee->getFunctionType()->getParamType(0);
|
Type *PT = Callee->getFunctionType()->getParamType(0);
|
||||||
// strncpy(x, s, c) -> memcpy(x, s, c, 1) [s and c are constant]
|
// strncpy(x, s, c) -> memcpy(x, s, c, 1) [s and c are constant]
|
||||||
B.CreateMemCpy(Dst, Src, ConstantInt::get(DL.getIntPtrType(PT), Len), 1);
|
B.CreateMemCpy(Dst, Src, ConstantInt::get(DL.getIntPtrType(PT), Len), 1, 1);
|
||||||
|
|
||||||
return Dst;
|
return Dst;
|
||||||
}
|
}
|
||||||
@ -917,7 +918,7 @@ Value *LibCallSimplifier::optimizeMemCpy(CallInst *CI, IRBuilder<> &B) {
|
|||||||
|
|
||||||
// memcpy(x, y, n) -> llvm.memcpy(x, y, n, 1)
|
// memcpy(x, y, n) -> llvm.memcpy(x, y, n, 1)
|
||||||
B.CreateMemCpy(CI->getArgOperand(0), CI->getArgOperand(1),
|
B.CreateMemCpy(CI->getArgOperand(0), CI->getArgOperand(1),
|
||||||
CI->getArgOperand(2), 1);
|
CI->getArgOperand(2), 1, 1);
|
||||||
return CI->getArgOperand(0);
|
return CI->getArgOperand(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,7 +930,7 @@ Value *LibCallSimplifier::optimizeMemMove(CallInst *CI, IRBuilder<> &B) {
|
|||||||
|
|
||||||
// memmove(x, y, n) -> llvm.memmove(x, y, n, 1)
|
// memmove(x, y, n) -> llvm.memmove(x, y, n, 1)
|
||||||
B.CreateMemMove(CI->getArgOperand(0), CI->getArgOperand(1),
|
B.CreateMemMove(CI->getArgOperand(0), CI->getArgOperand(1),
|
||||||
CI->getArgOperand(2), 1);
|
CI->getArgOperand(2), 1, 1);
|
||||||
return CI->getArgOperand(0);
|
return CI->getArgOperand(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1758,7 +1759,7 @@ Value *LibCallSimplifier::optimizeSPrintFString(CallInst *CI, IRBuilder<> &B) {
|
|||||||
B.CreateMemCpy(CI->getArgOperand(0), CI->getArgOperand(1),
|
B.CreateMemCpy(CI->getArgOperand(0), CI->getArgOperand(1),
|
||||||
ConstantInt::get(DL.getIntPtrType(CI->getContext()),
|
ConstantInt::get(DL.getIntPtrType(CI->getContext()),
|
||||||
FormatStr.size() + 1),
|
FormatStr.size() + 1),
|
||||||
1); // Copy the null byte.
|
1, 1); // Copy the null byte.
|
||||||
return ConstantInt::get(CI->getType(), FormatStr.size());
|
return ConstantInt::get(CI->getType(), FormatStr.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1792,7 +1793,7 @@ Value *LibCallSimplifier::optimizeSPrintFString(CallInst *CI, IRBuilder<> &B) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
Value *IncLen =
|
Value *IncLen =
|
||||||
B.CreateAdd(Len, ConstantInt::get(Len->getType(), 1), "leninc");
|
B.CreateAdd(Len, ConstantInt::get(Len->getType(), 1), "leninc");
|
||||||
B.CreateMemCpy(CI->getArgOperand(0), CI->getArgOperand(2), IncLen, 1);
|
B.CreateMemCpy(CI->getArgOperand(0), CI->getArgOperand(2), IncLen, 1, 1);
|
||||||
|
|
||||||
// The sprintf result is the unincremented number of bytes in the string.
|
// The sprintf result is the unincremented number of bytes in the string.
|
||||||
return B.CreateIntCast(Len, CI->getType(), false);
|
return B.CreateIntCast(Len, CI->getType(), false);
|
||||||
@ -2329,7 +2330,7 @@ Value *FortifiedLibCallSimplifier::optimizeMemCpyChk(CallInst *CI, IRBuilder<> &
|
|||||||
|
|
||||||
if (isFortifiedCallFoldable(CI, 3, 2, false)) {
|
if (isFortifiedCallFoldable(CI, 3, 2, false)) {
|
||||||
B.CreateMemCpy(CI->getArgOperand(0), CI->getArgOperand(1),
|
B.CreateMemCpy(CI->getArgOperand(0), CI->getArgOperand(1),
|
||||||
CI->getArgOperand(2), 1);
|
CI->getArgOperand(2), 1, 1);
|
||||||
return CI->getArgOperand(0);
|
return CI->getArgOperand(0);
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -2343,7 +2344,7 @@ Value *FortifiedLibCallSimplifier::optimizeMemMoveChk(CallInst *CI, IRBuilder<>
|
|||||||
|
|
||||||
if (isFortifiedCallFoldable(CI, 3, 2, false)) {
|
if (isFortifiedCallFoldable(CI, 3, 2, false)) {
|
||||||
B.CreateMemMove(CI->getArgOperand(0), CI->getArgOperand(1),
|
B.CreateMemMove(CI->getArgOperand(0), CI->getArgOperand(1),
|
||||||
CI->getArgOperand(2), 1);
|
CI->getArgOperand(2), 1, 1);
|
||||||
return CI->getArgOperand(0);
|
return CI->getArgOperand(0);
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
|
; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
|
||||||
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
|
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) #0
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) #0
|
||||||
declare void @llvm.assume(i1) #0
|
declare void @llvm.assume(i1) #0
|
||||||
|
|
||||||
define void @test1(i8* %P, i8* %Q) nounwind ssp {
|
define void @test1(i8* %P, i8* %Q) nounwind ssp {
|
||||||
tail call void @llvm.assume(i1 true)
|
tail call void @llvm.assume(i1 true)
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test1:
|
; CHECK-LABEL: Function: test1:
|
||||||
@ -14,10 +14,10 @@ define void @test1(i8* %P, i8* %Q) nounwind ssp {
|
|||||||
; CHECK: MayAlias: i8* %P, i8* %Q
|
; CHECK: MayAlias: i8* %P, i8* %Q
|
||||||
; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.assume(i1 true)
|
; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.assume(i1 true)
|
||||||
; CHECK: NoModRef: Ptr: i8* %Q <-> tail call void @llvm.assume(i1 true)
|
; CHECK: NoModRef: Ptr: i8* %Q <-> tail call void @llvm.assume(i1 true)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: tail call void @llvm.assume(i1 true) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: tail call void @llvm.assume(i1 true) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.assume(i1 true)
|
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.assume(i1 true)
|
||||||
}
|
}
|
||||||
|
|
||||||
attributes #0 = { nounwind }
|
attributes #0 = { nounwind }
|
||||||
|
@ -5,8 +5,8 @@ target triple = "arm-apple-ios"
|
|||||||
declare <8 x i16> @llvm.arm.neon.vld1.v8i16.p0i8(i8*, i32) nounwind readonly
|
declare <8 x i16> @llvm.arm.neon.vld1.v8i16.p0i8(i8*, i32) nounwind readonly
|
||||||
declare void @llvm.arm.neon.vst1.p0i8.v8i16(i8*, <8 x i16>, i32) nounwind
|
declare void @llvm.arm.neon.vst1.p0i8.v8i16(i8*, <8 x i16>, i32) nounwind
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
|
||||||
declare void @a_readonly_func(i8 *) noinline nounwind readonly
|
declare void @a_readonly_func(i8 *) noinline nounwind readonly
|
||||||
|
|
||||||
@ -37,41 +37,41 @@ entry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
define void @test2(i8* %P, i8* %Q) nounwind ssp {
|
define void @test2(i8* %P, i8* %Q) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test2:
|
; CHECK-LABEL: Function: test2:
|
||||||
|
|
||||||
; CHECK: MayAlias: i8* %P, i8* %Q
|
; CHECK: MayAlias: i8* %P, i8* %Q
|
||||||
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test2a(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
define void @test2a(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test2a:
|
; CHECK-LABEL: Function: test2a:
|
||||||
|
|
||||||
; CHECK: NoAlias: i8* %P, i8* %Q
|
; CHECK: NoAlias: i8* %P, i8* %Q
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test2b(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
define void @test2b(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
%R = getelementptr i8, i8* %P, i64 12
|
%R = getelementptr i8, i8* %P, i64 12
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test2b:
|
; CHECK-LABEL: Function: test2b:
|
||||||
@ -79,20 +79,20 @@ define void @test2b(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
|||||||
; CHECK: NoAlias: i8* %P, i8* %Q
|
; CHECK: NoAlias: i8* %P, i8* %Q
|
||||||
; CHECK: NoAlias: i8* %P, i8* %R
|
; CHECK: NoAlias: i8* %P, i8* %R
|
||||||
; CHECK: NoAlias: i8* %Q, i8* %R
|
; CHECK: NoAlias: i8* %Q, i8* %R
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test2c(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
define void @test2c(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
%R = getelementptr i8, i8* %P, i64 11
|
%R = getelementptr i8, i8* %P, i64 11
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test2c:
|
; CHECK-LABEL: Function: test2c:
|
||||||
@ -100,20 +100,20 @@ define void @test2c(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
|||||||
; CHECK: NoAlias: i8* %P, i8* %Q
|
; CHECK: NoAlias: i8* %P, i8* %Q
|
||||||
; CHECK: NoAlias: i8* %P, i8* %R
|
; CHECK: NoAlias: i8* %P, i8* %R
|
||||||
; CHECK: NoAlias: i8* %Q, i8* %R
|
; CHECK: NoAlias: i8* %Q, i8* %R
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test2d(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
define void @test2d(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
%R = getelementptr i8, i8* %P, i64 -12
|
%R = getelementptr i8, i8* %P, i64 -12
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test2d:
|
; CHECK-LABEL: Function: test2d:
|
||||||
@ -121,20 +121,20 @@ define void @test2d(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
|||||||
; CHECK: NoAlias: i8* %P, i8* %Q
|
; CHECK: NoAlias: i8* %P, i8* %Q
|
||||||
; CHECK: NoAlias: i8* %P, i8* %R
|
; CHECK: NoAlias: i8* %P, i8* %R
|
||||||
; CHECK: NoAlias: i8* %Q, i8* %R
|
; CHECK: NoAlias: i8* %Q, i8* %R
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test2e(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
define void @test2e(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
%R = getelementptr i8, i8* %P, i64 -11
|
%R = getelementptr i8, i8* %P, i64 -11
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test2e:
|
; CHECK-LABEL: Function: test2e:
|
||||||
@ -142,67 +142,67 @@ define void @test2e(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
|||||||
; CHECK: NoAlias: i8* %P, i8* %Q
|
; CHECK: NoAlias: i8* %P, i8* %Q
|
||||||
; CHECK: NoAlias: i8* %P, i8* %R
|
; CHECK: NoAlias: i8* %P, i8* %R
|
||||||
; CHECK: NoAlias: i8* %Q, i8* %R
|
; CHECK: NoAlias: i8* %Q, i8* %R
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: NoModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %R, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test3(i8* %P, i8* %Q) nounwind ssp {
|
define void @test3(i8* %P, i8* %Q) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test3:
|
; CHECK-LABEL: Function: test3:
|
||||||
|
|
||||||
; CHECK: MayAlias: i8* %P, i8* %Q
|
; CHECK: MayAlias: i8* %P, i8* %Q
|
||||||
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false)
|
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test3a(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
define void @test3a(i8* noalias %P, i8* noalias %Q) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test3a:
|
; CHECK-LABEL: Function: test3a:
|
||||||
|
|
||||||
; CHECK: NoAlias: i8* %P, i8* %Q
|
; CHECK: NoAlias: i8* %P, i8* %Q
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test4(i8* %P, i8* noalias %Q) nounwind ssp {
|
define void @test4(i8* %P, i8* noalias %Q) nounwind ssp {
|
||||||
tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i1 false)
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test4:
|
; CHECK-LABEL: Function: test4:
|
||||||
|
|
||||||
; CHECK: NoAlias: i8* %P, i8* %Q
|
; CHECK: NoAlias: i8* %P, i8* %Q
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i1 false)
|
||||||
; CHECK: NoModRef: Ptr: i8* %Q <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false)
|
; CHECK: NoModRef: Ptr: i8* %Q <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i1 false)
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Ref: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i32 1, i1 false)
|
; CHECK: Just Mod: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test5(i8* %P, i8* %Q, i8* %R) nounwind ssp {
|
define void @test5(i8* %P, i8* %Q, i8* %R) nounwind ssp {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test5:
|
; CHECK-LABEL: Function: test5:
|
||||||
@ -210,27 +210,27 @@ define void @test5(i8* %P, i8* %Q, i8* %R) nounwind ssp {
|
|||||||
; CHECK: MayAlias: i8* %P, i8* %Q
|
; CHECK: MayAlias: i8* %P, i8* %Q
|
||||||
; CHECK: MayAlias: i8* %P, i8* %R
|
; CHECK: MayAlias: i8* %P, i8* %R
|
||||||
; CHECK: MayAlias: i8* %Q, i8* %R
|
; CHECK: MayAlias: i8* %Q, i8* %R
|
||||||
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %P <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %Q <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: Ptr: i8* %R <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false)
|
||||||
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i32 1, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i32 1, i1 false)
|
; CHECK: Both ModRef: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false) <-> tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
define void @test6(i8* %P) nounwind ssp {
|
define void @test6(i8* %P) nounwind ssp {
|
||||||
call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i32 8, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i1 false)
|
||||||
call void @a_readonly_func(i8* %P)
|
call void @a_readonly_func(i8* %P)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
; CHECK-LABEL: Function: test6:
|
; CHECK-LABEL: Function: test6:
|
||||||
|
|
||||||
; CHECK: Just Mod: Ptr: i8* %P <-> call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i32 8, i1 false)
|
; CHECK: Just Mod: Ptr: i8* %P <-> call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i1 false)
|
||||||
; CHECK: Just Ref: Ptr: i8* %P <-> call void @a_readonly_func(i8* %P)
|
; CHECK: Just Ref: Ptr: i8* %P <-> call void @a_readonly_func(i8* %P)
|
||||||
; CHECK: Just Mod: call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i32 8, i1 false) <-> call void @a_readonly_func(i8* %P)
|
; CHECK: Just Mod: call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i1 false) <-> call void @a_readonly_func(i8* %P)
|
||||||
; CHECK: Just Ref: call void @a_readonly_func(i8* %P) <-> call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i32 8, i1 false)
|
; CHECK: Just Ref: call void @a_readonly_func(i8* %P) <-> call void @llvm.memset.p0i8.i64(i8* %P, i8 -51, i64 32, i1 false)
|
||||||
}
|
}
|
||||||
|
|
||||||
attributes #0 = { nounwind readonly argmemonly }
|
attributes #0 = { nounwind readonly argmemonly }
|
||||||
|
@ -12,15 +12,15 @@ define void @test0() {
|
|||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; CHECK: NoModRef: call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i32 1, i1 false) <-> call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i32 1, i1 false)
|
; CHECK: NoModRef: call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i1 false) <-> call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i1 false)
|
||||||
; CHECK: NoModRef: call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i32 1, i1 false) <-> call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i32 1, i1 false)
|
; CHECK: NoModRef: call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i1 false) <-> call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i1 false)
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
|
||||||
|
|
||||||
@A = external global i8
|
@A = external global i8
|
||||||
@B = external global i8
|
@B = external global i8
|
||||||
define void @test1() {
|
define void @test1() {
|
||||||
call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i1 false)
|
||||||
call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ define i32 @test0(i8* %P) {
|
|||||||
|
|
||||||
store i32 0, i32* %A
|
store i32 0, i32* %A
|
||||||
|
|
||||||
call void @llvm.memset.p0i8.i32(i8* %P, i8 0, i32 42, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %P, i8 0, i32 42, i1 false)
|
||||||
|
|
||||||
%B = load i32, i32* %A
|
%B = load i32, i32* %A
|
||||||
ret i32 %B
|
ret i32 %B
|
||||||
@ -27,7 +27,7 @@ define i8 @test1() {
|
|||||||
|
|
||||||
store i8 2, i8* %B ;; Not written to by memcpy
|
store i8 2, i8* %B ;; Not written to by memcpy
|
||||||
|
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i8(i8* %A, i8* %B, i8 -1, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i8(i8* %A, i8* %B, i8 -1, i1 false)
|
||||||
|
|
||||||
%C = load i8, i8* %B
|
%C = load i8, i8* %B
|
||||||
ret i8 %C
|
ret i8 %C
|
||||||
@ -38,7 +38,7 @@ define i8 @test2(i8* %P) {
|
|||||||
; CHECK-LABEL: @test2
|
; CHECK-LABEL: @test2
|
||||||
%P2 = getelementptr i8, i8* %P, i32 127
|
%P2 = getelementptr i8, i8* %P, i32 127
|
||||||
store i8 1, i8* %P2 ;; Not dead across memset
|
store i8 1, i8* %P2 ;; Not dead across memset
|
||||||
call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i1 false)
|
||||||
%A = load i8, i8* %P2
|
%A = load i8, i8* %P2
|
||||||
ret i8 %A
|
ret i8 %A
|
||||||
; CHECK: ret i8 1
|
; CHECK: ret i8 1
|
||||||
@ -51,7 +51,7 @@ define i8 @test2a(i8* %P) {
|
|||||||
;; FIXME: DSE isn't zapping this dead store.
|
;; FIXME: DSE isn't zapping this dead store.
|
||||||
store i8 1, i8* %P2 ;; Dead, clobbered by memset.
|
store i8 1, i8* %P2 ;; Dead, clobbered by memset.
|
||||||
|
|
||||||
call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i1 false)
|
||||||
%A = load i8, i8* %P2
|
%A = load i8, i8* %P2
|
||||||
ret i8 %A
|
ret i8 %A
|
||||||
; CHECK-NOT: load
|
; CHECK-NOT: load
|
||||||
@ -91,7 +91,7 @@ define void @test3a(i8* %P, i8 %X) {
|
|||||||
|
|
||||||
define i32 @test4(i8* %P) {
|
define i32 @test4(i8* %P) {
|
||||||
%tmp = load i32, i32* @G1
|
%tmp = load i32, i32* @G1
|
||||||
call void @llvm.memset.p0i8.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8 0, i32 4000, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8 0, i32 4000, i1 false)
|
||||||
%tmp2 = load i32, i32* @G1
|
%tmp2 = load i32, i32* @G1
|
||||||
%sub = sub i32 %tmp2, %tmp
|
%sub = sub i32 %tmp2, %tmp
|
||||||
ret i32 %sub
|
ret i32 %sub
|
||||||
@ -106,7 +106,7 @@ define i32 @test4(i8* %P) {
|
|||||||
; write to G1.
|
; write to G1.
|
||||||
define i32 @test5(i8* %P, i32 %Len) {
|
define i32 @test5(i8* %P, i32 %Len) {
|
||||||
%tmp = load i32, i32* @G1
|
%tmp = load i32, i32* @G1
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8* bitcast (i32* @G1 to i8*), i32 %Len, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8* bitcast (i32* @G1 to i8*), i32 %Len, i1 false)
|
||||||
%tmp2 = load i32, i32* @G1
|
%tmp2 = load i32, i32* @G1
|
||||||
%sub = sub i32 %tmp2, %tmp
|
%sub = sub i32 %tmp2, %tmp
|
||||||
ret i32 %sub
|
ret i32 %sub
|
||||||
@ -227,7 +227,7 @@ define i32 @test13(i32* %P, i32* %P2) {
|
|||||||
; CHECK: ret i32 0
|
; CHECK: ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
declare void @llvm.memset.p0i8.i8(i8* nocapture, i8, i8, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i8(i8* nocapture, i8, i8, i1) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i8(i8* nocapture, i8* nocapture, i8, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i8(i8* nocapture, i8* nocapture, i8, i1) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
; Check that intrinsics aren't added to the call graph
|
; Check that intrinsics aren't added to the call graph
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1)
|
||||||
|
|
||||||
define void @f(i8* %out, i8* %in) {
|
define void @f(i8* %out, i8* %in) {
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %out, i8* %in, i32 100, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %out, i8* %in, i32 100, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,4 +696,4 @@ while.end: ; preds = %while.end.loopexit,
|
|||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
; RUN: opt < %s -basicaa -globals-aa -gvn -S | FileCheck %s
|
; RUN: opt < %s -basicaa -globals-aa -gvn -S | FileCheck %s
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1)
|
||||||
define void @foo(i8* %x, i8* %y) {
|
define void @foo(i8* %x, i8* %y) {
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x, i8* %y, i32 1, i32 1, i1 false);
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x, i8* %y, i32 1, i1 false);
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ target triple = "x86_64-apple-macosx10.8.0"
|
|||||||
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
|
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
|
||||||
|
|
||||||
declare i32 @printf(i8* nocapture, ...) nounwind
|
declare i32 @printf(i8* nocapture, ...) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
|
||||||
|
|
||||||
; Make sure that the initial memcpy call does not go away
|
; Make sure that the initial memcpy call does not go away
|
||||||
@ -21,10 +21,10 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32,
|
|||||||
|
|
||||||
define i32 @main() nounwind uwtable ssp {
|
define i32 @main() nounwind uwtable ssp {
|
||||||
main_entry:
|
main_entry:
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i32 4, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i1 false)
|
||||||
%0 = load volatile i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @b, i64 0, i32 0), align 4
|
%0 = load volatile i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @b, i64 0, i32 0), align 4
|
||||||
store i32 %0, i32* @c, align 4
|
store i32 %0, i32* @c, align 4
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i32 4, i1 false) nounwind
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i1 false) nounwind
|
||||||
%call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0) nounwind
|
%call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0) nounwind
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ bb23: ; preds = %bb24, %bb.nph
|
|||||||
%55 = mul i32 %y.21, %w ; <i32> [#uses=1]
|
%55 = mul i32 %y.21, %w ; <i32> [#uses=1]
|
||||||
%.sum5 = add i32 %55, %.sum3 ; <i32> [#uses=1]
|
%.sum5 = add i32 %55, %.sum3 ; <i32> [#uses=1]
|
||||||
%56 = getelementptr i8, i8* %j, i32 %.sum5 ; <i8*> [#uses=1]
|
%56 = getelementptr i8, i8* %j, i32 %.sum5 ; <i8*> [#uses=1]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %56, i8* %54, i32 %w, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %56, i8* %54, i32 %w, i1 false)
|
||||||
%57 = add i32 %y.21, 1 ; <i32> [#uses=2]
|
%57 = add i32 %y.21, 1 ; <i32> [#uses=2]
|
||||||
br label %bb24
|
br label %bb24
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ bb26: ; preds = %bb24.bb26_crit_edge, %bb22
|
|||||||
%60 = getelementptr i8, i8* %j, i32 %.sum4 ; <i8*> [#uses=1]
|
%60 = getelementptr i8, i8* %j, i32 %.sum4 ; <i8*> [#uses=1]
|
||||||
%61 = mul i32 %x, %w ; <i32> [#uses=1]
|
%61 = mul i32 %x, %w ; <i32> [#uses=1]
|
||||||
%62 = sdiv i32 %61, 2 ; <i32> [#uses=1]
|
%62 = sdiv i32 %61, 2 ; <i32> [#uses=1]
|
||||||
tail call void @llvm.memset.p0i8.i32(i8* %60, i8 -128, i32 %62, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i32(i8* %60, i8 -128, i32 %62, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
bb29: ; preds = %bb20, %entry
|
bb29: ; preds = %bb20, %entry
|
||||||
@ -207,7 +207,7 @@ bb30: ; preds = %bb31, %bb.nph11
|
|||||||
%67 = getelementptr i8, i8* %r, i32 %66 ; <i8*> [#uses=1]
|
%67 = getelementptr i8, i8* %r, i32 %66 ; <i8*> [#uses=1]
|
||||||
%68 = mul i32 %y.310, %w ; <i32> [#uses=1]
|
%68 = mul i32 %y.310, %w ; <i32> [#uses=1]
|
||||||
%69 = getelementptr i8, i8* %j, i32 %68 ; <i8*> [#uses=1]
|
%69 = getelementptr i8, i8* %j, i32 %68 ; <i8*> [#uses=1]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %69, i8* %67, i32 %w, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %69, i8* %67, i32 %w, i1 false)
|
||||||
%70 = add i32 %y.310, 1 ; <i32> [#uses=2]
|
%70 = add i32 %y.310, 1 ; <i32> [#uses=2]
|
||||||
br label %bb31
|
br label %bb31
|
||||||
|
|
||||||
@ -223,12 +223,12 @@ bb33: ; preds = %bb31.bb33_crit_edge, %bb29
|
|||||||
%73 = getelementptr i8, i8* %j, i32 %72 ; <i8*> [#uses=1]
|
%73 = getelementptr i8, i8* %j, i32 %72 ; <i8*> [#uses=1]
|
||||||
%74 = mul i32 %x, %w ; <i32> [#uses=1]
|
%74 = mul i32 %x, %w ; <i32> [#uses=1]
|
||||||
%75 = sdiv i32 %74, 2 ; <i32> [#uses=1]
|
%75 = sdiv i32 %74, 2 ; <i32> [#uses=1]
|
||||||
tail call void @llvm.memset.p0i8.i32(i8* %73, i8 -128, i32 %75, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i32(i8* %73, i8 -128, i32 %75, i1 false)
|
||||||
ret void
|
ret void
|
||||||
|
|
||||||
return: ; preds = %bb20
|
return: ; preds = %bb20
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
|
@ -41,7 +41,7 @@ define i32 @test2() {
|
|||||||
entry:
|
entry:
|
||||||
%bins = alloca [16 x i64], align 16
|
%bins = alloca [16 x i64], align 16
|
||||||
%0 = bitcast [16 x i64]* %bins to i8*
|
%0 = bitcast [16 x i64]* %bins to i8*
|
||||||
call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 128, i32 16, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 128, i1 false)
|
||||||
br label %preheader
|
br label %preheader
|
||||||
|
|
||||||
preheader: ; preds = %for.inc.1, %entry
|
preheader: ; preds = %for.inc.1, %entry
|
||||||
@ -88,4 +88,4 @@ for.inc.1: ; preds = %for.body.1, %for.in
|
|||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #0
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) #0
|
||||||
|
@ -50,7 +50,7 @@ sha_update.exit.exitStub: ; preds = %bb3.i
|
|||||||
bb2.i: ; preds = %bb3.i
|
bb2.i: ; preds = %bb3.i
|
||||||
%1 = getelementptr %struct.SHA_INFO, %struct.SHA_INFO* %sha_info, i64 0, i32 3
|
%1 = getelementptr %struct.SHA_INFO, %struct.SHA_INFO* %sha_info, i64 0, i32 3
|
||||||
%2 = bitcast [16 x i32]* %1 to i8*
|
%2 = bitcast [16 x i32]* %1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %buffer_addr.0.i, i64 64, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %buffer_addr.0.i, i64 64, i1 false)
|
||||||
%3 = getelementptr %struct.SHA_INFO, %struct.SHA_INFO* %sha_info, i64 0, i32 3, i64 0
|
%3 = getelementptr %struct.SHA_INFO, %struct.SHA_INFO* %sha_info, i64 0, i32 3, i64 0
|
||||||
%4 = bitcast i32* %3 to i8*
|
%4 = bitcast i32* %3 to i8*
|
||||||
br label %codeRepl
|
br label %codeRepl
|
||||||
@ -74,7 +74,7 @@ bb3.i: ; preds = %byte_reverse.exit.i
|
|||||||
|
|
||||||
declare void @sha_stream_bb3_2E_i_bb1_2E_i_2E_i(i8*) nounwind
|
declare void @sha_stream_bb3_2E_i_bb1_2E_i_2E_i(i8*) nounwind
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
|
||||||
|
@ -45,13 +45,13 @@ define void @test1_no(i32* %p) nounwind {
|
|||||||
|
|
||||||
; CHECK: define void @test2_yes(i8* nocapture %p, i8* nocapture %q, i64 %n) #0 {
|
; CHECK: define void @test2_yes(i8* nocapture %p, i8* nocapture %q, i64 %n) #0 {
|
||||||
define void @test2_yes(i8* %p, i8* %q, i64 %n) nounwind {
|
define void @test2_yes(i8* %p, i8* %q, i64 %n) nounwind {
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q, i64 %n, i32 1, i1 false), !tbaa !1
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q, i64 %n, i1 false), !tbaa !1
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; CHECK: define void @test2_no(i8* nocapture %p, i8* nocapture readonly %q, i64 %n) #1 {
|
; CHECK: define void @test2_no(i8* nocapture %p, i8* nocapture readonly %q, i64 %n) #1 {
|
||||||
define void @test2_no(i8* %p, i8* %q, i64 %n) nounwind {
|
define void @test2_no(i8* %p, i8* %q, i64 %n) nounwind {
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q, i64 %n, i32 1, i1 false), !tbaa !2
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q, i64 %n, i1 false), !tbaa !2
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ define i32 @test3_no(i8* %p) nounwind {
|
|||||||
}
|
}
|
||||||
|
|
||||||
declare void @callee(i32* %p) nounwind
|
declare void @callee(i32* %p) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1) nounwind
|
||||||
|
|
||||||
; CHECK: attributes #0 = { norecurse nounwind readnone }
|
; CHECK: attributes #0 = { norecurse nounwind readnone }
|
||||||
; CHECK: attributes #1 = { norecurse nounwind }
|
; CHECK: attributes #1 = { norecurse nounwind }
|
||||||
|
@ -6,17 +6,17 @@ target datalayout = "e-p:64:64:64"
|
|||||||
; it has a TBAA tag which declares that it is unrelated.
|
; it has a TBAA tag which declares that it is unrelated.
|
||||||
|
|
||||||
; CHECK: @foo
|
; CHECK: @foo
|
||||||
; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q, i64 16, i32 1, i1 false), !tbaa !0
|
; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %p, i8* align 1 %q, i64 16, i1 false), !tbaa !0
|
||||||
; CHECK-NEXT: store i8 2, i8* %s, align 1, !tbaa [[TAGA:!.*]]
|
; CHECK-NEXT: store i8 2, i8* %s, align 1, !tbaa [[TAGA:!.*]]
|
||||||
; CHECK-NEXT: ret void
|
; CHECK-NEXT: ret void
|
||||||
define void @foo(i8* nocapture %p, i8* nocapture %q, i8* nocapture %s) nounwind {
|
define void @foo(i8* nocapture %p, i8* nocapture %q, i8* nocapture %s) nounwind {
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q, i64 16, i32 1, i1 false), !tbaa !2
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %p, i8* %q, i64 16, i1 false), !tbaa !2
|
||||||
store i8 2, i8* %s, align 1, !tbaa !1
|
store i8 2, i8* %s, align 1, !tbaa !1
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %q, i8* %p, i64 16, i32 1, i1 false), !tbaa !2
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %q, i8* %p, i64 16, i1 false), !tbaa !2
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
|
||||||
; CHECK: [[TAGA]] = !{[[TYPEA:!.*]], [[TYPEA]], i64 0}
|
; CHECK: [[TAGA]] = !{[[TYPEA:!.*]], [[TYPEA]], i64 0}
|
||||||
; CHECK: [[TYPEA]] = !{!"A", !{{.*}}}
|
; CHECK: [[TYPEA]] = !{!"A", !{{.*}}}
|
||||||
|
33
test/Bitcode/memintrinsics.3.7.ll
Normal file
33
test/Bitcode/memintrinsics.3.7.ll
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
; RUN: llvm-dis < %s.bc| FileCheck %s
|
||||||
|
|
||||||
|
; memintrinsics.3.7.ll.bc was generated by passing this file to llvm-as-3.7.
|
||||||
|
; The test checks that LLVM does not misread memcpy/memmove/memset intrinsic functions
|
||||||
|
; of older bitcode files.
|
||||||
|
|
||||||
|
define void @memcpyintrinsic(i8* %dest, i8* %src, i32 %len) {
|
||||||
|
entry:
|
||||||
|
|
||||||
|
; CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 %len, i1 true)
|
||||||
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i32 4, i1 true)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
define void @memmoveintrinsic(i8* %dest, i8* %src, i32 %len) {
|
||||||
|
entry:
|
||||||
|
|
||||||
|
; CHECK: call void @llvm.memmove.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 %len, i1 true)
|
||||||
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i32 8, i1 true)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
define void @memsetintrinsic(i8* %dest, i8* %src, i32 %len) {
|
||||||
|
entry:
|
||||||
|
|
||||||
|
; CHECK: call void @llvm.memset.p0i8.i32(i8* align 16 %dest, i8 0, i32 %len, i1 true)
|
||||||
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 %len, i32 16, i1 true)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i32 %align, i1 %isvolatile)
|
||||||
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i32 %align, i1 %isvolatile)
|
||||||
|
declare void @llvm.memset.p0i8.i32(i8* %dest, i8 %src, i32 %len, i32 %align, i1 %isvolatile)
|
BIN
test/Bitcode/memintrinsics.3.7.ll.bc
Normal file
BIN
test/Bitcode/memintrinsics.3.7.ll.bc
Normal file
Binary file not shown.
@ -7,10 +7,9 @@
|
|||||||
define void @memcpyintrinsic(i8* %dest, i8* %src, i32 %len) {
|
define void @memcpyintrinsic(i8* %dest, i8* %src, i32 %len) {
|
||||||
entry:
|
entry:
|
||||||
|
|
||||||
; CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i32 1, i1 true)
|
; CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %dest, i8* align 1 %src, i32 %len, i1 true)
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i32 1, i1 true)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 true)
|
||||||
|
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i32 %align, i1 %isvolatile)
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 %isvolatile)
|
@ -22,7 +22,7 @@ entry:
|
|||||||
%z.i60 = getelementptr inbounds %rs, %rs* %r, i64 0, i32 9, i32 2
|
%z.i60 = getelementptr inbounds %rs, %rs* %r, i64 0, i32 9, i32 2
|
||||||
%na = getelementptr inbounds %rs, %rs* %r, i64 0, i32 0
|
%na = getelementptr inbounds %rs, %rs* %r, i64 0, i32 0
|
||||||
%0 = bitcast double* %x.i to i8*
|
%0 = bitcast double* %x.i to i8*
|
||||||
call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 72, i32 8, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 72, i1 false)
|
||||||
%1 = load i32, i32* %na, align 4
|
%1 = load i32, i32* %na, align 4
|
||||||
%cmp70 = icmp sgt i32 %1, 0
|
%cmp70 = icmp sgt i32 %1, 0
|
||||||
br i1 %cmp70, label %for.body.lr.ph, label %for.end
|
br i1 %cmp70, label %for.body.lr.ph, label %for.end
|
||||||
@ -87,5 +87,5 @@ for.end: ; preds = %for.end.loopexit, %
|
|||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1)
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ declare i32 @fprintf(%struct.__sFILE* nocapture, i8* nocapture readonly, ...)
|
|||||||
|
|
||||||
declare void @bar(i32)
|
declare void @bar(i32)
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1)
|
||||||
|
|
||||||
define i32 @foo(%struct.DState* %s) {
|
define i32 @foo(%struct.DState* %s) {
|
||||||
entry:
|
entry:
|
||||||
@ -71,7 +71,7 @@ if.end.thread: ; preds = %entry
|
|||||||
%save_zvec = getelementptr inbounds %struct.DState, %struct.DState* %s, i64 0, i32 57
|
%save_zvec = getelementptr inbounds %struct.DState, %struct.DState* %s, i64 0, i32 57
|
||||||
%save_zj = getelementptr inbounds %struct.DState, %struct.DState* %s, i64 0, i32 58
|
%save_zj = getelementptr inbounds %struct.DState, %struct.DState* %s, i64 0, i32 58
|
||||||
%tmp1 = bitcast i32* %save_i to i8*
|
%tmp1 = bitcast i32* %save_i to i8*
|
||||||
call void @llvm.memset.p0i8.i64(i8* %tmp1, i8 0, i64 108, i32 4, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* %tmp1, i8 0, i64 108, i1 false)
|
||||||
br label %sw.default
|
br label %sw.default
|
||||||
|
|
||||||
if.end: ; preds = %entry
|
if.end: ; preds = %entry
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
; CHECK-NEXT: str [[VAL2]], [x0]
|
; CHECK-NEXT: str [[VAL2]], [x0]
|
||||||
|
|
||||||
define void @foo(i8* %a) {
|
define void @foo(i8* %a) {
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast ([3 x i32]* @b to i8*), i64 12, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast ([3 x i32]* @b to i8*), i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
@ -168,10 +168,10 @@ entry:
|
|||||||
%4 = bitcast i8* %ap.align to %struct.s41*
|
%4 = bitcast i8* %ap.align to %struct.s41*
|
||||||
%5 = bitcast %struct.s41* %vs to i8*
|
%5 = bitcast %struct.s41* %vs to i8*
|
||||||
%6 = bitcast %struct.s41* %4 to i8*
|
%6 = bitcast %struct.s41* %4 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %5, i8* %6, i64 16, i32 16, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %5, i8* %6, i64 16, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
|
||||||
define void @bar2(i32 %x, i128 %s41.coerce) nounwind {
|
define void @bar2(i32 %x, i128 %s41.coerce) nounwind {
|
||||||
entry:
|
entry:
|
||||||
|
@ -301,14 +301,14 @@ entry:
|
|||||||
%tmp = alloca %struct.s42, align 4
|
%tmp = alloca %struct.s42, align 4
|
||||||
%tmp1 = alloca %struct.s42, align 4
|
%tmp1 = alloca %struct.s42, align 4
|
||||||
%0 = bitcast %struct.s42* %tmp to i8*
|
%0 = bitcast %struct.s42* %tmp to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s42* @g42 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %0, i8* align 4 bitcast (%struct.s42* @g42 to i8*), i64 24, i1 false), !tbaa.struct !4
|
||||||
%1 = bitcast %struct.s42* %tmp1 to i8*
|
%1 = bitcast %struct.s42* %tmp1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s42* @g42_2 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%struct.s42* @g42_2 to i8*), i64 24, i1 false), !tbaa.struct !4
|
||||||
%call = call i32 @f42(i32 3, %struct.s42* %tmp, %struct.s42* %tmp1) #5
|
%call = call i32 @f42(i32 3, %struct.s42* %tmp, %struct.s42* %tmp1) #5
|
||||||
ret i32 %call
|
ret i32 %call
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) #4
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) #4
|
||||||
|
|
||||||
declare i32 @f42_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
|
declare i32 @f42_stack(i32 %i, i32 %i2, i32 %i3, i32 %i4, i32 %i5, i32 %i6,
|
||||||
i32 %i7, i32 %i8, i32 %i9, %struct.s42* nocapture %s1,
|
i32 %i7, i32 %i8, i32 %i9, %struct.s42* nocapture %s1,
|
||||||
@ -347,9 +347,9 @@ entry:
|
|||||||
%tmp = alloca %struct.s42, align 4
|
%tmp = alloca %struct.s42, align 4
|
||||||
%tmp1 = alloca %struct.s42, align 4
|
%tmp1 = alloca %struct.s42, align 4
|
||||||
%0 = bitcast %struct.s42* %tmp to i8*
|
%0 = bitcast %struct.s42* %tmp to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s42* @g42 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %0, i8* align 4 bitcast (%struct.s42* @g42 to i8*), i64 24, i1 false), !tbaa.struct !4
|
||||||
%1 = bitcast %struct.s42* %tmp1 to i8*
|
%1 = bitcast %struct.s42* %tmp1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s42* @g42_2 to i8*), i64 24, i32 4, i1 false), !tbaa.struct !4
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%struct.s42* @g42_2 to i8*), i64 24, i1 false), !tbaa.struct !4
|
||||||
%call = call i32 @f42_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7,
|
%call = call i32 @f42_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7,
|
||||||
i32 8, i32 9, %struct.s42* %tmp, %struct.s42* %tmp1) #5
|
i32 8, i32 9, %struct.s42* %tmp, %struct.s42* %tmp1) #5
|
||||||
ret i32 %call
|
ret i32 %call
|
||||||
@ -415,9 +415,9 @@ entry:
|
|||||||
%tmp = alloca %struct.s43, align 16
|
%tmp = alloca %struct.s43, align 16
|
||||||
%tmp1 = alloca %struct.s43, align 16
|
%tmp1 = alloca %struct.s43, align 16
|
||||||
%0 = bitcast %struct.s43* %tmp to i8*
|
%0 = bitcast %struct.s43* %tmp to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s43* @g43 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.s43* @g43 to i8*), i64 32, i1 false), !tbaa.struct !4
|
||||||
%1 = bitcast %struct.s43* %tmp1 to i8*
|
%1 = bitcast %struct.s43* %tmp1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s43* @g43_2 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %1, i8* align 16 bitcast (%struct.s43* @g43_2 to i8*), i64 32, i1 false), !tbaa.struct !4
|
||||||
%call = call i32 @f43(i32 3, %struct.s43* %tmp, %struct.s43* %tmp1) #5
|
%call = call i32 @f43(i32 3, %struct.s43* %tmp, %struct.s43* %tmp1) #5
|
||||||
ret i32 %call
|
ret i32 %call
|
||||||
}
|
}
|
||||||
@ -466,9 +466,9 @@ entry:
|
|||||||
%tmp = alloca %struct.s43, align 16
|
%tmp = alloca %struct.s43, align 16
|
||||||
%tmp1 = alloca %struct.s43, align 16
|
%tmp1 = alloca %struct.s43, align 16
|
||||||
%0 = bitcast %struct.s43* %tmp to i8*
|
%0 = bitcast %struct.s43* %tmp to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.s43* @g43 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %0, i8* align 16 bitcast (%struct.s43* @g43 to i8*), i64 32, i1 false), !tbaa.struct !4
|
||||||
%1 = bitcast %struct.s43* %tmp1 to i8*
|
%1 = bitcast %struct.s43* %tmp1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.s43* @g43_2 to i8*), i64 32, i32 16, i1 false), !tbaa.struct !4
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 %1, i8* align 16 bitcast (%struct.s43* @g43_2 to i8*), i64 32, i1 false), !tbaa.struct !4
|
||||||
%call = call i32 @f43_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7,
|
%call = call i32 @f43_stack(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7,
|
||||||
i32 8, i32 9, %struct.s43* %tmp, %struct.s43* %tmp1) #5
|
i32 8, i32 9, %struct.s43* %tmp, %struct.s43* %tmp1) #5
|
||||||
ret i32 %call
|
ret i32 %call
|
||||||
|
@ -11,11 +11,11 @@ define void @t1() {
|
|||||||
; ARM64: movz x2, #0x50
|
; ARM64: movz x2, #0x50
|
||||||
; ARM64: uxtb w1, w9
|
; ARM64: uxtb w1, w9
|
||||||
; ARM64: bl _memset
|
; ARM64: bl _memset
|
||||||
call void @llvm.memset.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i8 0, i64 80, i32 16, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i8 0, i64 80, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1)
|
||||||
|
|
||||||
define void @t2() {
|
define void @t2() {
|
||||||
; ARM64-LABEL: t2
|
; ARM64-LABEL: t2
|
||||||
@ -25,11 +25,11 @@ define void @t2() {
|
|||||||
; ARM64: add x1, x8, _message@PAGEOFF
|
; ARM64: add x1, x8, _message@PAGEOFF
|
||||||
; ARM64: movz x2, #0x50
|
; ARM64: movz x2, #0x50
|
||||||
; ARM64: bl _memcpy
|
; ARM64: bl _memcpy
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 80, i32 16, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 80, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
|
||||||
|
|
||||||
define void @t3() {
|
define void @t3() {
|
||||||
; ARM64-LABEL: t3
|
; ARM64-LABEL: t3
|
||||||
@ -39,11 +39,11 @@ define void @t3() {
|
|||||||
; ARM64: add x1, x8, _message@PAGEOFF
|
; ARM64: add x1, x8, _message@PAGEOFF
|
||||||
; ARM64: movz x2, #0x14
|
; ARM64: movz x2, #0x14
|
||||||
; ARM64: bl _memmove
|
; ARM64: bl _memmove
|
||||||
call void @llvm.memmove.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 20, i32 16, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 20, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1)
|
declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
|
||||||
|
|
||||||
define void @t4() {
|
define void @t4() {
|
||||||
; ARM64-LABEL: t4
|
; ARM64-LABEL: t4
|
||||||
@ -58,7 +58,7 @@ define void @t4() {
|
|||||||
; ARM64: ldrb w11, [x9, #16]
|
; ARM64: ldrb w11, [x9, #16]
|
||||||
; ARM64: strb w11, [x8, #16]
|
; ARM64: strb w11, [x8, #16]
|
||||||
; ARM64: ret
|
; ARM64: ret
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 17, i32 16, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 17, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ define void @t5() {
|
|||||||
; ARM64: ldrb w11, [x9, #16]
|
; ARM64: ldrb w11, [x9, #16]
|
||||||
; ARM64: strb w11, [x8, #16]
|
; ARM64: strb w11, [x8, #16]
|
||||||
; ARM64: ret
|
; ARM64: ret
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 17, i32 8, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 17, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ define void @t6() {
|
|||||||
; ARM64: ldrb w10, [x9, #8]
|
; ARM64: ldrb w10, [x9, #8]
|
||||||
; ARM64: strb w10, [x8, #8]
|
; ARM64: strb w10, [x8, #8]
|
||||||
; ARM64: ret
|
; ARM64: ret
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 9, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* align 4 getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 9, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ define void @t7() {
|
|||||||
; ARM64: ldrb w10, [x9, #6]
|
; ARM64: ldrb w10, [x9, #6]
|
||||||
; ARM64: strb w10, [x8, #6]
|
; ARM64: strb w10, [x8, #6]
|
||||||
; ARM64: ret
|
; ARM64: ret
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 7, i32 2, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 2 getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* align 2 getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 7, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ define void @t8() {
|
|||||||
; ARM64: ldrb w10, [x9, #3]
|
; ARM64: ldrb w10, [x9, #3]
|
||||||
; ARM64: strb w10, [x8, #3]
|
; ARM64: strb w10, [x8, #3]
|
||||||
; ARM64: ret
|
; ARM64: ret
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 4, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 getelementptr inbounds ([80 x i8], [80 x i8]* @temp, i32 0, i32 0), i8* align 1 getelementptr inbounds ([80 x i8], [80 x i8]* @message, i32 0, i32 0), i64 4, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,6 +143,6 @@ define void @test_distant_memcpy(i8* %dst) {
|
|||||||
; ARM64: strb [[BYTE]], [x0]
|
; ARM64: strb [[BYTE]], [x0]
|
||||||
%array = alloca i8, i32 8192
|
%array = alloca i8, i32 8192
|
||||||
%elem = getelementptr i8, i8* %array, i32 8000
|
%elem = getelementptr i8, i8* %array, i32 8000
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %elem, i64 1, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %elem, i64 1, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ entry:
|
|||||||
; CHECK: strh [[REG1]], [x[[BASEREG2]], #8]
|
; CHECK: strh [[REG1]], [x[[BASEREG2]], #8]
|
||||||
; CHECK: ldr [[REG2:x[0-9]+]],
|
; CHECK: ldr [[REG2:x[0-9]+]],
|
||||||
; CHECK: str [[REG2]],
|
; CHECK: str [[REG2]],
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds (%struct.x, %struct.x* @dst, i32 0, i32 0), i8* getelementptr inbounds (%struct.x, %struct.x* @src, i32 0, i32 0), i32 11, i32 8, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds (%struct.x, %struct.x* @dst, i32 0, i32 0), i8* getelementptr inbounds (%struct.x, %struct.x* @src, i32 0, i32 0), i32 11, i1 false)
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ entry:
|
|||||||
; CHECK: stur [[DEST]], [x0, #15]
|
; CHECK: stur [[DEST]], [x0, #15]
|
||||||
; CHECK: ldr [[DEST:q[0-9]+]], [x[[BASEREG]]]
|
; CHECK: ldr [[DEST:q[0-9]+]], [x[[BASEREG]]]
|
||||||
; CHECK: str [[DEST]], [x0]
|
; CHECK: str [[DEST]], [x0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str1, i64 0, i64 0), i64 31, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str1, i64 0, i64 0), i64 31, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ entry:
|
|||||||
; CHECK: str [[REG3]], [x0, #32]
|
; CHECK: str [[REG3]], [x0, #32]
|
||||||
; CHECK: ldp [[DEST1:q[0-9]+]], [[DEST2:q[0-9]+]], [x{{[0-9]+}}]
|
; CHECK: ldp [[DEST1:q[0-9]+]], [[DEST2:q[0-9]+]], [x{{[0-9]+}}]
|
||||||
; CHECK: stp [[DEST1]], [[DEST2]], [x0]
|
; CHECK: stp [[DEST1]], [[DEST2]], [x0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str2, i64 0, i64 0), i64 36, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str2, i64 0, i64 0), i64 36, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ entry:
|
|||||||
; CHECK: str [[REG4]], [x0, #16]
|
; CHECK: str [[REG4]], [x0, #16]
|
||||||
; CHECK: ldr [[DEST:q[0-9]+]], [x[[BASEREG]]]
|
; CHECK: ldr [[DEST:q[0-9]+]], [x[[BASEREG]]]
|
||||||
; CHECK: str [[DEST]], [x0]
|
; CHECK: str [[DEST]], [x0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str3, i64 0, i64 0), i64 24, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str3, i64 0, i64 0), i64 24, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ entry:
|
|||||||
; CHECK: strh [[REG5]], [x0, #16]
|
; CHECK: strh [[REG5]], [x0, #16]
|
||||||
; CHECK: ldr [[REG6:q[0-9]+]], [x{{[0-9]+}}]
|
; CHECK: ldr [[REG6:q[0-9]+]], [x{{[0-9]+}}]
|
||||||
; CHECK: str [[REG6]], [x0]
|
; CHECK: str [[REG6]], [x0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str4, i64 0, i64 0), i64 18, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str4, i64 0, i64 0), i64 18, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ entry:
|
|||||||
; CHECK: movz [[REG8:w[0-9]+]],
|
; CHECK: movz [[REG8:w[0-9]+]],
|
||||||
; CHECK: movk [[REG8]],
|
; CHECK: movk [[REG8]],
|
||||||
; CHECK: str [[REG8]], [x0]
|
; CHECK: str [[REG8]], [x0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str5, i64 0, i64 0), i64 7, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str5, i64 0, i64 0), i64 7, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ entry:
|
|||||||
; CHECK: stur [[REG9]], [x{{[0-9]+}}, #6]
|
; CHECK: stur [[REG9]], [x{{[0-9]+}}, #6]
|
||||||
; CHECK: ldr
|
; CHECK: ldr
|
||||||
; CHECK: str
|
; CHECK: str
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @spool.splbuf, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str6, i64 0, i64 0), i64 14, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @spool.splbuf, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str6, i64 0, i64 0), i64 14, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,9 +104,9 @@ entry:
|
|||||||
; CHECK: str [[REG10]], [x0]
|
; CHECK: str [[REG10]], [x0]
|
||||||
%0 = bitcast %struct.Foo* %a to i8*
|
%0 = bitcast %struct.Foo* %a to i8*
|
||||||
%1 = bitcast %struct.Foo* %b to i8*
|
%1 = bitcast %struct.Foo* %b to i8*
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %1, i32 16, i32 4, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %1, i32 16, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
@ -5,7 +5,7 @@ entry:
|
|||||||
; CHECK-LABEL: t1:
|
; CHECK-LABEL: t1:
|
||||||
; CHECK: str wzr, [x0, #8]
|
; CHECK: str wzr, [x0, #8]
|
||||||
; CHECK: str xzr, [x0]
|
; CHECK: str xzr, [x0]
|
||||||
call void @llvm.memset.p0i8.i64(i8* %c, i8 0, i64 12, i32 8, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* %c, i8 0, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,11 +17,11 @@ entry:
|
|||||||
; CHECK: str xzr, [sp, #8]
|
; CHECK: str xzr, [sp, #8]
|
||||||
%buf = alloca [26 x i8], align 1
|
%buf = alloca [26 x i8], align 1
|
||||||
%0 = getelementptr inbounds [26 x i8], [26 x i8]* %buf, i32 0, i32 0
|
%0 = getelementptr inbounds [26 x i8], [26 x i8]* %buf, i32 0, i32 0
|
||||||
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 26, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 26, i1 false)
|
||||||
call void @something(i8* %0) nounwind
|
call void @something(i8* %0) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @something(i8*) nounwind
|
declare void @something(i8*) nounwind
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
; CHECK: memset
|
; CHECK: memset
|
||||||
define void @fct1(i8* nocapture %ptr) {
|
define void @fct1(i8* nocapture %ptr) {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 256, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 256, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1)
|
||||||
|
|
||||||
; CHECK: @fct2
|
; CHECK: @fct2
|
||||||
; When the size is bigger than 256, change into bzero.
|
; When the size is bigger than 256, change into bzero.
|
||||||
@ -21,7 +21,7 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
|
|||||||
; CHECK-LINUX: memset
|
; CHECK-LINUX: memset
|
||||||
define void @fct2(i8* nocapture %ptr) {
|
define void @fct2(i8* nocapture %ptr) {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 257, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 257, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ entry:
|
|||||||
define void @fct3(i8* nocapture %ptr, i32 %unknown) {
|
define void @fct3(i8* nocapture %ptr, i32 %unknown) {
|
||||||
entry:
|
entry:
|
||||||
%conv = sext i32 %unknown to i64
|
%conv = sext i32 %unknown to i64
|
||||||
tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 %conv, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 %conv, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ define void @t0(i8* %out, i8* %in) {
|
|||||||
; CHECK: orr w2, wzr, #0x10
|
; CHECK: orr w2, wzr, #0x10
|
||||||
; CHECK-NEXT: bl _memcpy
|
; CHECK-NEXT: bl _memcpy
|
||||||
entry:
|
entry:
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %out, i8* %in, i64 16, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %out, i8* %in, i64 16, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1)
|
||||||
|
@ -25,9 +25,9 @@ entry:
|
|||||||
%yy = alloca i32, align 4
|
%yy = alloca i32, align 4
|
||||||
store i32 0, i32* %retval
|
store i32 0, i32* %retval
|
||||||
%0 = bitcast [8 x i32]* %x to i8*
|
%0 = bitcast [8 x i32]* %x to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ([8 x i32]* @main.x to i8*), i64 32, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ([8 x i32]* @main.x to i8*), i64 32, i1 false)
|
||||||
%1 = bitcast [8 x i32]* %y to i8*
|
%1 = bitcast [8 x i32]* %y to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast ([8 x i32]* @main.y to i8*), i64 32, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast ([8 x i32]* @main.y to i8*), i64 32, i1 false)
|
||||||
store i32 0, i32* %xx, align 4
|
store i32 0, i32* %xx, align 4
|
||||||
store i32 0, i32* %yy, align 4
|
store i32 0, i32* %yy, align 4
|
||||||
store i32 0, i32* %i, align 4
|
store i32 0, i32* %i, align 4
|
||||||
@ -104,7 +104,7 @@ define <4 x float> @neon4xfloat(<4 x float> %A, <4 x float> %B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
|
||||||
|
|
||||||
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
||||||
attributes #1 = { nounwind }
|
attributes #1 = { nounwind }
|
||||||
|
@ -32,9 +32,9 @@ entry:
|
|||||||
%yy = alloca i32, align 4
|
%yy = alloca i32, align 4
|
||||||
store i32 0, i32* %retval
|
store i32 0, i32* %retval
|
||||||
%0 = bitcast [8 x i32]* %x to i8*
|
%0 = bitcast [8 x i32]* %x to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ([8 x i32]* @main.x to i8*), i64 32, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ([8 x i32]* @main.x to i8*), i64 32, i1 false)
|
||||||
%1 = bitcast [8 x i32]* %y to i8*
|
%1 = bitcast [8 x i32]* %y to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast ([8 x i32]* @main.y to i8*), i64 32, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast ([8 x i32]* @main.y to i8*), i64 32, i1 false)
|
||||||
store i32 0, i32* %xx, align 4
|
store i32 0, i32* %xx, align 4
|
||||||
store i32 0, i32* %yy, align 4
|
store i32 0, i32* %yy, align 4
|
||||||
store i32 0, i32* %i, align 4
|
store i32 0, i32* %i, align 4
|
||||||
@ -106,7 +106,7 @@ for.end: ; preds = %for.cond
|
|||||||
|
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
|
||||||
|
|
||||||
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
||||||
attributes #1 = { nounwind }
|
attributes #1 = { nounwind }
|
||||||
|
@ -55,11 +55,11 @@ define void @foo(%struct.X* nocapture %p) nounwind optsize ssp {
|
|||||||
; CHECK-NEXT: ret
|
; CHECK-NEXT: ret
|
||||||
%B = getelementptr inbounds %struct.X, %struct.X* %p, i64 0, i32 1
|
%B = getelementptr inbounds %struct.X, %struct.X* %p, i64 0, i32 1
|
||||||
%val = bitcast i64* %B to i8*
|
%val = bitcast i64* %B to i8*
|
||||||
call void @llvm.memset.p0i8.i64(i8* %val, i8 0, i64 16, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* %val, i8 0, i64 16, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
|
||||||
|
|
||||||
; Unaligned 16b stores are split into 8b stores for performance.
|
; Unaligned 16b stores are split into 8b stores for performance.
|
||||||
; radar://15424193
|
; radar://15424193
|
||||||
|
@ -43,9 +43,9 @@ entry:
|
|||||||
%tmp14 = bitcast double* %arraydecay5.3.1 to i8*
|
%tmp14 = bitcast double* %arraydecay5.3.1 to i8*
|
||||||
%arraydecay11.3.1 = getelementptr inbounds %struct.Bicubic_Patch_Struct, %struct.Bicubic_Patch_Struct* %Shape, i64 0, i32 12, i64 1, i64 3, i64 0
|
%arraydecay11.3.1 = getelementptr inbounds %struct.Bicubic_Patch_Struct, %struct.Bicubic_Patch_Struct* %Shape, i64 0, i32 12, i64 1, i64 3, i64 0
|
||||||
%tmp15 = bitcast double* %arraydecay11.3.1 to i8*
|
%tmp15 = bitcast double* %arraydecay11.3.1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp14, i8* %tmp15, i64 24, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp14, i8* %tmp15, i64 24, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
define void @test(i64 %a, i8* %b) {
|
define void @test(i64 %a, i8* %b) {
|
||||||
%1 = and i64 %a, 9223372036854775807
|
%1 = and i64 %a, 9223372036854775807
|
||||||
%2 = inttoptr i64 %1 to i8*
|
%2 = inttoptr i64 %1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %b, i64 8, i32 8, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %b, i64 8, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1)
|
||||||
|
@ -186,11 +186,11 @@ define void @check_i128_stackalign(i32 %val0, i32 %val1, i32 %val2, i32 %val3,
|
|||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1)
|
||||||
|
|
||||||
define i32 @test_extern() {
|
define i32 @test_extern() {
|
||||||
; CHECK-LABEL: test_extern:
|
; CHECK-LABEL: test_extern:
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* undef, i32 undef, i32 4, i1 0)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* undef, i32 undef, i1 0)
|
||||||
; CHECK: bl memcpy
|
; CHECK: bl memcpy
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ define void @test1() {
|
|||||||
; CHECK: str q0
|
; CHECK: str q0
|
||||||
; CHECK: ret
|
; CHECK: ret
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* bitcast (%structA* @stubA to i8*), i64 48, i32 8, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* bitcast (%structA* @stubA to i8*), i64 48, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
; CHECK: b memcpy
|
; CHECK: b memcpy
|
||||||
define void @tail_memcpy(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 {
|
define void @tail_memcpy(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ entry:
|
|||||||
; CHECK: b memmove
|
; CHECK: b memmove
|
||||||
define void @tail_memmove(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 {
|
define void @tail_memmove(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i32 1, i1 false)
|
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,12 +20,12 @@ entry:
|
|||||||
; CHECK: b memset
|
; CHECK: b memset
|
||||||
define void @tail_memset(i8* nocapture %p, i8 %c, i32 %n) #0 {
|
define void @tail_memset(i8* nocapture %p, i8 %c, i32 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memset.p0i8.i32(i8* %p, i8 %c, i32 %n, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i32(i8* %p, i8 %c, i32 %n, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #0
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #0
|
||||||
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #0
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #0
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) #0
|
||||||
|
|
||||||
attributes #0 = { nounwind }
|
attributes #0 = { nounwind }
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
||||||
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
||||||
|
|
||||||
declare void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* nocapture, i8 addrspace(3)* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* nocapture, i8 addrspace(3)* nocapture, i32, i1) nounwind
|
||||||
declare void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* nocapture, i8 addrspace(1)* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* nocapture, i8 addrspace(1)* nocapture, i64, i1) nounwind
|
||||||
|
|
||||||
|
|
||||||
; FUNC-LABEL: {{^}}test_small_memcpy_i64_lds_to_lds_align1:
|
; FUNC-LABEL: {{^}}test_small_memcpy_i64_lds_to_lds_align1:
|
||||||
@ -82,7 +82,7 @@ declare void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* nocapture, i8 addrspace
|
|||||||
define void @test_small_memcpy_i64_lds_to_lds_align1(i64 addrspace(3)* noalias %out, i64 addrspace(3)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_lds_to_lds_align1(i64 addrspace(3)* noalias %out, i64 addrspace(3)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(3)* %in to i8 addrspace(3)*
|
%bcin = bitcast i64 addrspace(3)* %in to i8 addrspace(3)*
|
||||||
%bcout = bitcast i64 addrspace(3)* %out to i8 addrspace(3)*
|
%bcout = bitcast i64 addrspace(3)* %out to i8 addrspace(3)*
|
||||||
call void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* %bcout, i8 addrspace(3)* %bcin, i32 32, i32 1, i1 false) nounwind
|
call void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* align 1 %bcout, i8 addrspace(3)* align 1 %bcin, i32 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ define void @test_small_memcpy_i64_lds_to_lds_align1(i64 addrspace(3)* noalias %
|
|||||||
define void @test_small_memcpy_i64_lds_to_lds_align2(i64 addrspace(3)* noalias %out, i64 addrspace(3)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_lds_to_lds_align2(i64 addrspace(3)* noalias %out, i64 addrspace(3)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(3)* %in to i8 addrspace(3)*
|
%bcin = bitcast i64 addrspace(3)* %in to i8 addrspace(3)*
|
||||||
%bcout = bitcast i64 addrspace(3)* %out to i8 addrspace(3)*
|
%bcout = bitcast i64 addrspace(3)* %out to i8 addrspace(3)*
|
||||||
call void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* %bcout, i8 addrspace(3)* %bcin, i32 32, i32 2, i1 false) nounwind
|
call void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* align 2 %bcout, i8 addrspace(3)* align 2 %bcin, i32 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ define void @test_small_memcpy_i64_lds_to_lds_align2(i64 addrspace(3)* noalias %
|
|||||||
define void @test_small_memcpy_i64_lds_to_lds_align4(i64 addrspace(3)* noalias %out, i64 addrspace(3)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_lds_to_lds_align4(i64 addrspace(3)* noalias %out, i64 addrspace(3)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(3)* %in to i8 addrspace(3)*
|
%bcin = bitcast i64 addrspace(3)* %in to i8 addrspace(3)*
|
||||||
%bcout = bitcast i64 addrspace(3)* %out to i8 addrspace(3)*
|
%bcout = bitcast i64 addrspace(3)* %out to i8 addrspace(3)*
|
||||||
call void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* %bcout, i8 addrspace(3)* %bcin, i32 32, i32 4, i1 false) nounwind
|
call void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* align 4 %bcout, i8 addrspace(3)* align 4 %bcin, i32 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ define void @test_small_memcpy_i64_lds_to_lds_align4(i64 addrspace(3)* noalias %
|
|||||||
define void @test_small_memcpy_i64_lds_to_lds_align8(i64 addrspace(3)* noalias %out, i64 addrspace(3)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_lds_to_lds_align8(i64 addrspace(3)* noalias %out, i64 addrspace(3)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(3)* %in to i8 addrspace(3)*
|
%bcin = bitcast i64 addrspace(3)* %in to i8 addrspace(3)*
|
||||||
%bcout = bitcast i64 addrspace(3)* %out to i8 addrspace(3)*
|
%bcout = bitcast i64 addrspace(3)* %out to i8 addrspace(3)*
|
||||||
call void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* %bcout, i8 addrspace(3)* %bcin, i32 32, i32 8, i1 false) nounwind
|
call void @llvm.memcpy.p3i8.p3i8.i32(i8 addrspace(3)* align 8 %bcout, i8 addrspace(3)* align 8 %bcin, i32 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ define void @test_small_memcpy_i64_lds_to_lds_align8(i64 addrspace(3)* noalias %
|
|||||||
define void @test_small_memcpy_i64_global_to_global_align1(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_global_to_global_align1(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
||||||
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
||||||
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* %bcout, i8 addrspace(1)* %bcin, i64 32, i32 1, i1 false) nounwind
|
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* align 1 %bcout, i8 addrspace(1)* align 1 %bcin, i64 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ define void @test_small_memcpy_i64_global_to_global_align1(i64 addrspace(1)* noa
|
|||||||
define void @test_small_memcpy_i64_global_to_global_align2(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_global_to_global_align2(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
||||||
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
||||||
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* %bcout, i8 addrspace(1)* %bcin, i64 32, i32 2, i1 false) nounwind
|
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* align 2 %bcout, i8 addrspace(1)* align 2 %bcin, i64 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ define void @test_small_memcpy_i64_global_to_global_align2(i64 addrspace(1)* noa
|
|||||||
define void @test_small_memcpy_i64_global_to_global_align4(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_global_to_global_align4(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
||||||
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
||||||
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* %bcout, i8 addrspace(1)* %bcin, i64 32, i32 4, i1 false) nounwind
|
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* align 4 %bcout, i8 addrspace(1)* align 4 %bcin, i64 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ define void @test_small_memcpy_i64_global_to_global_align4(i64 addrspace(1)* noa
|
|||||||
define void @test_small_memcpy_i64_global_to_global_align8(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_global_to_global_align8(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
||||||
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
||||||
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* %bcout, i8 addrspace(1)* %bcin, i64 32, i32 8, i1 false) nounwind
|
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* align 8 %bcout, i8 addrspace(1)* align 8 %bcin, i64 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,6 +360,6 @@ define void @test_small_memcpy_i64_global_to_global_align8(i64 addrspace(1)* noa
|
|||||||
define void @test_small_memcpy_i64_global_to_global_align16(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
define void @test_small_memcpy_i64_global_to_global_align16(i64 addrspace(1)* noalias %out, i64 addrspace(1)* noalias %in) nounwind {
|
||||||
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
%bcin = bitcast i64 addrspace(1)* %in to i8 addrspace(1)*
|
||||||
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
%bcout = bitcast i64 addrspace(1)* %out to i8 addrspace(1)*
|
||||||
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* %bcout, i8 addrspace(1)* %bcin, i64 32, i32 16, i1 false) nounwind
|
call void @llvm.memcpy.p1i8.p1i8.i64(i8 addrspace(1)* align 16 %bcout, i8 addrspace(1)* align 16 %bcin, i64 32, i1 false) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ bb3: ; preds = %entry
|
|||||||
%34 = fadd double %31, 0.000000e+00
|
%34 = fadd double %31, 0.000000e+00
|
||||||
%35 = fadd double %32, 0.000000e+00
|
%35 = fadd double %32, 0.000000e+00
|
||||||
%36 = bitcast %struct.ggPoint3* %x to i8*
|
%36 = bitcast %struct.ggPoint3* %x to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* null, i8* %36, i32 24, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* null, i8* %36, i32 24, i1 false)
|
||||||
store double %33, double* null, align 8
|
store double %33, double* null, align 8
|
||||||
br i1 false, label %_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit, label %bb5.i.i.i
|
br i1 false, label %_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit, label %bb5.i.i.i
|
||||||
|
|
||||||
@ -76,4 +76,4 @@ bb7: ; preds = %entry
|
|||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
@ -16,7 +16,7 @@ bb: ; preds = %entry
|
|||||||
|
|
||||||
bb1: ; preds = %entry
|
bb1: ; preds = %entry
|
||||||
%0 = call %struct.ui* @vn_pp_to_ui(i32* undef) nounwind
|
%0 = call %struct.ui* @vn_pp_to_ui(i32* undef) nounwind
|
||||||
call void @llvm.memset.p0i8.i32(i8* undef, i8 0, i32 40, i32 4, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* undef, i8 0, i32 40, i1 false)
|
||||||
%1 = getelementptr inbounds %struct.ui, %struct.ui* %0, i32 0, i32 0
|
%1 = getelementptr inbounds %struct.ui, %struct.ui* %0, i32 0, i32 0
|
||||||
store %struct.mo* undef, %struct.mo** %1, align 4
|
store %struct.mo* undef, %struct.mo** %1, align 4
|
||||||
%2 = getelementptr inbounds %struct.ui, %struct.ui* %0, i32 0, i32 5
|
%2 = getelementptr inbounds %struct.ui, %struct.ui* %0, i32 0, i32 5
|
||||||
@ -40,7 +40,7 @@ bb6: ; preds = %bb3
|
|||||||
|
|
||||||
declare %struct.ui* @vn_pp_to_ui(i32*)
|
declare %struct.ui* @vn_pp_to_ui(i32*)
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
|
|
||||||
declare i32 @mo_create_nnm(%struct.mo*, i64, i32**)
|
declare i32 @mo_create_nnm(%struct.mo*, i64, i32**)
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ target triple = "thumbv7-apple-ios5.0.0"
|
|||||||
; CHECK-UNALIGNED: str
|
; CHECK-UNALIGNED: str
|
||||||
define void @foo(i8* nocapture %c) nounwind optsize {
|
define void @foo(i8* nocapture %c) nounwind optsize {
|
||||||
entry:
|
entry:
|
||||||
call void @llvm.memset.p0i8.i64(i8* %c, i8 -1, i64 5, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* %c, i8 -1, i64 5, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
; CHECK: vst1.64
|
; CHECK: vst1.64
|
||||||
define void @f_0_40(i8* nocapture %c) nounwind optsize {
|
define void @f_0_40(i8* nocapture %c) nounwind optsize {
|
||||||
entry:
|
entry:
|
||||||
call void @llvm.memset.p0i8.i64(i8* %c, i8 0, i64 40, i32 16, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* align 16 %c, i8 0, i64 40, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
|
||||||
|
@ -19,7 +19,7 @@ declare i32 @llvm.eh.typeid.for(i8*) nounwind readnone
|
|||||||
|
|
||||||
declare i8* @__cxa_begin_catch(i8*)
|
declare i8* @__cxa_begin_catch(i8*)
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
|
||||||
declare void @__cxa_end_catch()
|
declare void @__cxa_end_catch()
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
@source = common global [512 x i8] zeroinitializer, align 4
|
@source = common global [512 x i8] zeroinitializer, align 4
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
|
|
||||||
define void @function() {
|
define void @function() {
|
||||||
entry:
|
entry:
|
||||||
call void @llvm.memset.p0i8.i32(i8* bitcast ([512 x i8]* @source to i8*), i8 0, i32 512, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* bitcast ([512 x i8]* @source to i8*), i8 0, i32 512, i1 false)
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
; RUN: llc -mtriple=thumbv7-windows-itanium -mcpu=cortex-a9 -o - %s | FileCheck %s
|
; RUN: llc -mtriple=thumbv7-windows-itanium -mcpu=cortex-a9 -o - %s | FileCheck %s
|
||||||
|
|
||||||
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
|
||||||
@source = common global [512 x i8] zeroinitializer, align 4
|
@source = common global [512 x i8] zeroinitializer, align 4
|
||||||
@target = common global [512 x i8] zeroinitializer, align 4
|
@target = common global [512 x i8] zeroinitializer, align 4
|
||||||
|
|
||||||
define void @move() nounwind {
|
define void @move() nounwind {
|
||||||
entry:
|
entry:
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* bitcast ([512 x i8]* @target to i8*), i8* bitcast ([512 x i8]* @source to i8*), i32 512, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* bitcast ([512 x i8]* @target to i8*), i8* bitcast ([512 x i8]* @source to i8*), i32 512, i1 false)
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ entry:
|
|||||||
|
|
||||||
define void @copy() nounwind {
|
define void @copy() nounwind {
|
||||||
entry:
|
entry:
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([512 x i8]* @target to i8*), i8* bitcast ([512 x i8]* @source to i8*), i32 512, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([512 x i8]* @target to i8*), i8* bitcast ([512 x i8]* @source to i8*), i32 512, i1 false)
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ entry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
@.str523 = private constant [256 x i8] c"<Unknown>\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 4 ; <[256 x i8]*> [#uses=1]
|
@.str523 = private constant [256 x i8] c"<Unknown>\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 4 ; <[256 x i8]*> [#uses=1]
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
|
||||||
; This function uses the scavenger for an ADDri instruction.
|
; This function uses the scavenger for an ADDri instruction.
|
||||||
; ARMBaseRegisterInfo::estimateRSStackSizeLimit must return a 255 limit.
|
; ARMBaseRegisterInfo::estimateRSStackSizeLimit must return a 255 limit.
|
||||||
@ -21,8 +21,8 @@ entry:
|
|||||||
%letter = alloca i8 ; <i8*> [#uses=0]
|
%letter = alloca i8 ; <i8*> [#uses=0]
|
||||||
%prodvers = alloca [256 x i8] ; <[256 x i8]*> [#uses=1]
|
%prodvers = alloca [256 x i8] ; <[256 x i8]*> [#uses=1]
|
||||||
%buildver = alloca [256 x i8] ; <[256 x i8]*> [#uses=0]
|
%buildver = alloca [256 x i8] ; <[256 x i8]*> [#uses=0]
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @.str523, i32 0, i32 0), i32 256, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @.str523, i32 0, i32 0), i32 256, i1 false)
|
||||||
%prodvers2 = bitcast [256 x i8]* %prodvers to i8* ; <i8*> [#uses=1]
|
%prodvers2 = bitcast [256 x i8]* %prodvers to i8* ; <i8*> [#uses=1]
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %prodvers2, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @.str523, i32 0, i32 0), i32 256, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %prodvers2, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @.str523, i32 0, i32 0), i32 256, i1 false)
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ declare i8* @objc_msgSend(i8*, i8*, ...)
|
|||||||
|
|
||||||
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
|
||||||
define hidden void @foobar_func_block_invoke_0(i8* %.block_descriptor, %0* %loadedMydata, [4 x i32] %bounds.coerce0, [4 x i32] %data.coerce0) ssp !dbg !23 {
|
define hidden void @foobar_func_block_invoke_0(i8* %.block_descriptor, %0* %loadedMydata, [4 x i32] %bounds.coerce0, [4 x i32] %data.coerce0) ssp !dbg !23 {
|
||||||
%1 = alloca %0*, align 4
|
%1 = alloca %0*, align 4
|
||||||
@ -67,7 +67,7 @@ define hidden void @foobar_func_block_invoke_0(i8* %.block_descriptor, %0* %load
|
|||||||
%24 = bitcast i8* %23 to %struct.CR*, !dbg !143
|
%24 = bitcast i8* %23 to %struct.CR*, !dbg !143
|
||||||
%25 = bitcast %struct.CR* %24 to i8*, !dbg !143
|
%25 = bitcast %struct.CR* %24 to i8*, !dbg !143
|
||||||
%26 = bitcast %struct.CR* %data to i8*, !dbg !143
|
%26 = bitcast %struct.CR* %data to i8*, !dbg !143
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %25, i8* %26, i32 16, i32 4, i1 false), !dbg !143
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %25, i8* %26, i32 16, i1 false), !dbg !143
|
||||||
%27 = getelementptr inbounds %2, %2* %6, i32 0, i32 6, !dbg !144
|
%27 = getelementptr inbounds %2, %2* %6, i32 0, i32 6, !dbg !144
|
||||||
%28 = load %3*, %3** %27, align 4, !dbg !144
|
%28 = load %3*, %3** %27, align 4, !dbg !144
|
||||||
%29 = load i32, i32* @"OBJC_IVAR_$_MyWork._bounds", !dbg !144
|
%29 = load i32, i32* @"OBJC_IVAR_$_MyWork._bounds", !dbg !144
|
||||||
@ -76,7 +76,7 @@ define hidden void @foobar_func_block_invoke_0(i8* %.block_descriptor, %0* %load
|
|||||||
%32 = bitcast i8* %31 to %struct.CR*, !dbg !144
|
%32 = bitcast i8* %31 to %struct.CR*, !dbg !144
|
||||||
%33 = bitcast %struct.CR* %32 to i8*, !dbg !144
|
%33 = bitcast %struct.CR* %32 to i8*, !dbg !144
|
||||||
%34 = bitcast %struct.CR* %bounds to i8*, !dbg !144
|
%34 = bitcast %struct.CR* %bounds to i8*, !dbg !144
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %33, i8* %34, i32 16, i32 4, i1 false), !dbg !144
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %33, i8* %34, i32 16, i1 false), !dbg !144
|
||||||
%35 = getelementptr inbounds %2, %2* %6, i32 0, i32 6, !dbg !145
|
%35 = getelementptr inbounds %2, %2* %6, i32 0, i32 6, !dbg !145
|
||||||
%36 = load %3*, %3** %35, align 4, !dbg !145
|
%36 = load %3*, %3** %35, align 4, !dbg !145
|
||||||
%37 = getelementptr inbounds %2, %2* %6, i32 0, i32 5, !dbg !145
|
%37 = getelementptr inbounds %2, %2* %6, i32 0, i32 5, !dbg !145
|
||||||
|
@ -51,7 +51,7 @@ define void @t2(%struct.comment* %vc, i8* %tag, i8* %contents) {
|
|||||||
%tmp9 = call i8* @strcpy(i8* %tmp6, i8* %tag)
|
%tmp9 = call i8* @strcpy(i8* %tmp6, i8* %tag)
|
||||||
%tmp6.len = call i32 @strlen(i8* %tmp6)
|
%tmp6.len = call i32 @strlen(i8* %tmp6)
|
||||||
%tmp6.indexed = getelementptr i8, i8* %tmp6, i32 %tmp6.len
|
%tmp6.indexed = getelementptr i8, i8* %tmp6, i32 %tmp6.len
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp6.indexed, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str215, i32 0, i32 0), i32 2, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp6.indexed, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str215, i32 0, i32 0), i32 2, i1 false)
|
||||||
%tmp15 = call i8* @strcat(i8* %tmp6, i8* %contents)
|
%tmp15 = call i8* @strcat(i8* %tmp6, i8* %contents)
|
||||||
call fastcc void @comment_add(%struct.comment* %vc, i8* %tmp6)
|
call fastcc void @comment_add(%struct.comment* %vc, i8* %tmp6)
|
||||||
ret void
|
ret void
|
||||||
@ -65,4 +65,4 @@ declare fastcc void @comment_add(%struct.comment*, i8*)
|
|||||||
|
|
||||||
declare i8* @strcpy(i8*, i8*)
|
declare i8* @strcpy(i8*, i8*)
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
@ -39,11 +39,11 @@ define void @t1() nounwind ssp {
|
|||||||
; THUMB-LONG: movt r3, :upper16:L_memset$non_lazy_ptr
|
; THUMB-LONG: movt r3, :upper16:L_memset$non_lazy_ptr
|
||||||
; THUMB-LONG: ldr r3, [r3]
|
; THUMB-LONG: ldr r3, [r3]
|
||||||
; THUMB-LONG: blx r3
|
; THUMB-LONG: blx r3
|
||||||
call void @llvm.memset.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @message1, i32 0, i32 5), i8 64, i32 10, i32 4, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* align 4 getelementptr inbounds ([60 x i8], [60 x i8]* @message1, i32 0, i32 5), i8 64, i32 10, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
|
|
||||||
define void @t2() nounwind ssp {
|
define void @t2() nounwind ssp {
|
||||||
; ARM-LABEL: t2:
|
; ARM-LABEL: t2:
|
||||||
@ -78,11 +78,11 @@ define void @t2() nounwind ssp {
|
|||||||
; THUMB-LONG: movt r3, :upper16:L_memcpy$non_lazy_ptr
|
; THUMB-LONG: movt r3, :upper16:L_memcpy$non_lazy_ptr
|
||||||
; THUMB-LONG: ldr r3, [r3]
|
; THUMB-LONG: ldr r3, [r3]
|
||||||
; THUMB-LONG: blx r3
|
; THUMB-LONG: blx r3
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 17, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* align 4 getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 17, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
|
||||||
define void @t3() nounwind ssp {
|
define void @t3() nounwind ssp {
|
||||||
; ARM-LABEL: t3:
|
; ARM-LABEL: t3:
|
||||||
@ -115,7 +115,7 @@ define void @t3() nounwind ssp {
|
|||||||
; THUMB-LONG: movt r3, :upper16:L_memmove$non_lazy_ptr
|
; THUMB-LONG: movt r3, :upper16:L_memmove$non_lazy_ptr
|
||||||
; THUMB-LONG: ldr r3, [r3]
|
; THUMB-LONG: ldr r3, [r3]
|
||||||
; THUMB-LONG: blx r3
|
; THUMB-LONG: blx r3
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 10, i32 1, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 10, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,11 +142,11 @@ define void @t4() nounwind ssp {
|
|||||||
; THUMB: ldrh r1, [r0, #24]
|
; THUMB: ldrh r1, [r0, #24]
|
||||||
; THUMB: strh r1, [r0, #12]
|
; THUMB: strh r1, [r0, #12]
|
||||||
; THUMB: bx lr
|
; THUMB: bx lr
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 10, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 10, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
|
||||||
define void @t5() nounwind ssp {
|
define void @t5() nounwind ssp {
|
||||||
; ARM-LABEL: t5:
|
; ARM-LABEL: t5:
|
||||||
@ -179,7 +179,7 @@ define void @t5() nounwind ssp {
|
|||||||
; THUMB: ldrh r1, [r0, #24]
|
; THUMB: ldrh r1, [r0, #24]
|
||||||
; THUMB: strh r1, [r0, #12]
|
; THUMB: strh r1, [r0, #12]
|
||||||
; THUMB: bx lr
|
; THUMB: bx lr
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 10, i32 2, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* align 2 getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 10, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,14 +234,14 @@ define void @t6() nounwind ssp {
|
|||||||
; THUMB: ldrb r1, [r0, #25]
|
; THUMB: ldrb r1, [r0, #25]
|
||||||
; THUMB: strb r1, [r0, #13]
|
; THUMB: strb r1, [r0, #13]
|
||||||
; THUMB: bx lr
|
; THUMB: bx lr
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 10, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* align 1 getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 10, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; rdar://13202135
|
; rdar://13202135
|
||||||
define void @t7() nounwind ssp {
|
define void @t7() nounwind ssp {
|
||||||
; Just make sure this doesn't assert when we have an odd length and an alignment of 2.
|
; Just make sure this doesn't assert when we have an odd length and an alignment of 2.
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 3, i32 2, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @temp, i32 0, i32 16), i32 3, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,14 +37,14 @@ entry:
|
|||||||
for.body.lr.ph: ; preds = %entry
|
for.body.lr.ph: ; preds = %entry
|
||||||
%1 = icmp sgt i32 %0, 1
|
%1 = icmp sgt i32 %0, 1
|
||||||
%smax = select i1 %1, i32 %0, i32 1
|
%smax = select i1 %1, i32 %0, i32 1
|
||||||
call void @llvm.memset.p0i8.i32(i8* getelementptr inbounds ([250 x i8], [250 x i8]* @bar, i32 0, i32 0), i8 0, i32 %smax, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* getelementptr inbounds ([250 x i8], [250 x i8]* @bar, i32 0, i32 0), i8 0, i32 %smax, i1 false)
|
||||||
unreachable
|
unreachable
|
||||||
|
|
||||||
for.cond1.preheader: ; preds = %entry
|
for.cond1.preheader: ; preds = %entry
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
|
|
||||||
; rdar://12462006
|
; rdar://12462006
|
||||||
define i8* @f3(i8* %base, i32* nocapture %offset, i32 %size) nounwind {
|
define i8* @f3(i8* %base, i32* nocapture %offset, i32 %size) nounwind {
|
||||||
|
@ -23,7 +23,7 @@ entry:
|
|||||||
; CHECK-T1: strb [[TREG1]],
|
; CHECK-T1: strb [[TREG1]],
|
||||||
; CHECK-T1: ldrh [[TREG2:r[0-9]]],
|
; CHECK-T1: ldrh [[TREG2:r[0-9]]],
|
||||||
; CHECK-T1: strh [[TREG2]]
|
; CHECK-T1: strh [[TREG2]]
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds (%struct.x, %struct.x* @dst, i32 0, i32 0), i8* getelementptr inbounds (%struct.x, %struct.x* @src, i32 0, i32 0), i32 11, i32 8, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 getelementptr inbounds (%struct.x, %struct.x* @dst, i32 0, i32 0), i8* align 8 getelementptr inbounds (%struct.x, %struct.x* @src, i32 0, i32 0), i32 11, i1 false)
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ entry:
|
|||||||
; CHECK: adds r1, #15
|
; CHECK: adds r1, #15
|
||||||
; CHECK: vld1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r1]
|
; CHECK: vld1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r1]
|
||||||
; CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]
|
; CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str1, i64 0, i64 0), i64 31, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str1, i64 0, i64 0), i64 31, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ entry:
|
|||||||
; CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]!
|
; CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]!
|
||||||
; CHECK: vld1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r1]
|
; CHECK: vld1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r1]
|
||||||
; CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]
|
; CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str2, i64 0, i64 0), i64 36, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str2, i64 0, i64 0), i64 36, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ entry:
|
|||||||
; CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]!
|
; CHECK: vst1.8 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]!
|
||||||
; CHECK: vldr d{{[0-9]+}}, [r1]
|
; CHECK: vldr d{{[0-9]+}}, [r1]
|
||||||
; CHECK: vst1.8 {d{{[0-9]+}}}, [r0]
|
; CHECK: vst1.8 {d{{[0-9]+}}}, [r0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str3, i64 0, i64 0), i64 24, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str3, i64 0, i64 0), i64 24, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ entry:
|
|||||||
; CHECK: vld1.64 {[[REG3:d[0-9]+]], [[REG4:d[0-9]+]]}, [r1]
|
; CHECK: vld1.64 {[[REG3:d[0-9]+]], [[REG4:d[0-9]+]]}, [r1]
|
||||||
; CHECK: vst1.8 {[[REG3]], [[REG4]]}, [r0]!
|
; CHECK: vst1.8 {[[REG3]], [[REG4]]}, [r0]!
|
||||||
; CHECK: strh [[REG5:r[0-9]+]], [r0]
|
; CHECK: strh [[REG5:r[0-9]+]], [r0]
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str4, i64 0, i64 0), i64 18, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str4, i64 0, i64 0), i64 18, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ entry:
|
|||||||
; CHECK-T1: strb [[TREG3]],
|
; CHECK-T1: strb [[TREG3]],
|
||||||
; CHECK-T1: movs [[TREG4:r[0-9]]],
|
; CHECK-T1: movs [[TREG4:r[0-9]]],
|
||||||
; CHECK-T1: strb [[TREG4]],
|
; CHECK-T1: strb [[TREG4]],
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str5, i64 0, i64 0), i64 7, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %C, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str5, i64 0, i64 0), i64 7, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ entry:
|
|||||||
; CHECK-T1: strh [[TREG5]],
|
; CHECK-T1: strh [[TREG5]],
|
||||||
; CHECK-T1: ldr [[TREG6:r[0-9]]],
|
; CHECK-T1: ldr [[TREG6:r[0-9]]],
|
||||||
; CHECK-T1: str [[TREG6]]
|
; CHECK-T1: str [[TREG6]]
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @spool.splbuf, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str6, i64 0, i64 0), i64 14, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @spool.splbuf, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str6, i64 0, i64 0), i64 14, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,9 +124,9 @@ entry:
|
|||||||
; CHECK-T1: str
|
; CHECK-T1: str
|
||||||
%0 = bitcast %struct.Foo* %a to i8*
|
%0 = bitcast %struct.Foo* %a to i8*
|
||||||
%1 = bitcast %struct.Foo* %b to i8*
|
%1 = bitcast %struct.Foo* %b to i8*
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %1, i32 16, i32 4, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %0, i8* align 4 %1, i32 16, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
@ -14,13 +14,13 @@ entry:
|
|||||||
; CHECK-DARWIN: bl _memmove
|
; CHECK-DARWIN: bl _memmove
|
||||||
; CHECK-EABI: bl __aeabi_memmove
|
; CHECK-EABI: bl __aeabi_memmove
|
||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
; CHECK-DARWIN: bl _memcpy
|
; CHECK-DARWIN: bl _memcpy
|
||||||
; CHECK-EABI: bl __aeabi_memcpy
|
; CHECK-EABI: bl __aeabi_memcpy
|
||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i1 false)
|
||||||
|
|
||||||
; EABI memset swaps arguments
|
; EABI memset swaps arguments
|
||||||
; CHECK-IOS: mov r1, #1
|
; CHECK-IOS: mov r1, #1
|
||||||
@ -31,7 +31,7 @@ entry:
|
|||||||
; CHECK-EABI: bl __aeabi_memset
|
; CHECK-EABI: bl __aeabi_memset
|
||||||
; CHECK-GNUEABI: mov r1, #1
|
; CHECK-GNUEABI: mov r1, #1
|
||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i1 false)
|
||||||
|
|
||||||
; EABI uses memclr if value set to 0
|
; EABI uses memclr if value set to 0
|
||||||
; CHECK-IOS: mov r1, #0
|
; CHECK-IOS: mov r1, #0
|
||||||
@ -40,7 +40,7 @@ entry:
|
|||||||
; CHECK-DARWIN: bl _memset
|
; CHECK-DARWIN: bl _memset
|
||||||
; CHECK-EABI: bl __aeabi_memclr
|
; CHECK-EABI: bl __aeabi_memclr
|
||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i1 false)
|
||||||
|
|
||||||
; EABI uses aligned function variants if possible
|
; EABI uses aligned function variants if possible
|
||||||
|
|
||||||
@ -48,49 +48,49 @@ entry:
|
|||||||
; CHECK-DARWIN: bl _memmove
|
; CHECK-DARWIN: bl _memmove
|
||||||
; CHECK-EABI: bl __aeabi_memmove4
|
; CHECK-EABI: bl __aeabi_memmove4
|
||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 4, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 500, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
; CHECK-DARWIN: bl _memcpy
|
; CHECK-DARWIN: bl _memcpy
|
||||||
; CHECK-EABI: bl __aeabi_memcpy4
|
; CHECK-EABI: bl __aeabi_memcpy4
|
||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 4, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 500, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: bl _memset
|
; CHECK-IOS: bl _memset
|
||||||
; CHECK-DARWIN: bl _memset
|
; CHECK-DARWIN: bl _memset
|
||||||
; CHECK-EABI: bl __aeabi_memset4
|
; CHECK-EABI: bl __aeabi_memset4
|
||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 4, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* align 4 %dest, i8 1, i32 500, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: bl _memset
|
; CHECK-IOS: bl _memset
|
||||||
; CHECK-DARWIN: bl _memset
|
; CHECK-DARWIN: bl _memset
|
||||||
; CHECK-EABI: bl __aeabi_memclr4
|
; CHECK-EABI: bl __aeabi_memclr4
|
||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 4, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* align 4 %dest, i8 0, i32 500, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: bl _memmove
|
; CHECK-IOS: bl _memmove
|
||||||
; CHECK-DARWIN: bl _memmove
|
; CHECK-DARWIN: bl _memmove
|
||||||
; CHECK-EABI: bl __aeabi_memmove8
|
; CHECK-EABI: bl __aeabi_memmove8
|
||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
; CHECK-DARWIN: bl _memcpy
|
; CHECK-DARWIN: bl _memcpy
|
||||||
; CHECK-EABI: bl __aeabi_memcpy8
|
; CHECK-EABI: bl __aeabi_memcpy8
|
||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: bl _memset
|
; CHECK-IOS: bl _memset
|
||||||
; CHECK-DARWIN: bl _memset
|
; CHECK-DARWIN: bl _memset
|
||||||
; CHECK-EABI: bl __aeabi_memset8
|
; CHECK-EABI: bl __aeabi_memset8
|
||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 8, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* align 8 %dest, i8 1, i32 500, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: bl _memset
|
; CHECK-IOS: bl _memset
|
||||||
; CHECK-DARWIN: bl _memset
|
; CHECK-DARWIN: bl _memset
|
||||||
; CHECK-EABI: bl __aeabi_memclr8
|
; CHECK-EABI: bl __aeabi_memclr8
|
||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 8, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* align 8 %dest, i8 0, i32 500, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
%arr0 = alloca [9 x i8], align 1
|
%arr0 = alloca [9 x i8], align 1
|
||||||
%0 = bitcast [9 x i8]* %arr0 to i8*
|
%0 = bitcast [9 x i8]* %arr0 to i8*
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: add r1, sp, #16
|
; CHECK: add r1, sp, #16
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
@ -120,7 +120,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
%arr1 = alloca [9 x i8], align 1
|
%arr1 = alloca [9 x i8], align 1
|
||||||
%1 = bitcast [9 x i8]* %arr1 to i8*
|
%1 = bitcast [9 x i8]* %arr1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK-IOS: mov r0, sp
|
; CHECK-IOS: mov r0, sp
|
||||||
; CHECK-IOS: mov r1, #1
|
; CHECK-IOS: mov r1, #1
|
||||||
@ -136,7 +136,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
%arr2 = alloca [9 x i8], align 1
|
%arr2 = alloca [9 x i8], align 1
|
||||||
%2 = bitcast [9 x i8]* %arr2 to i8*
|
%2 = bitcast [9 x i8]* %arr2 to i8*
|
||||||
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
%arr0 = alloca [7 x i8], align 1
|
%arr0 = alloca [7 x i8], align 1
|
||||||
%0 = bitcast [7 x i8]* %arr0 to i8*
|
%0 = bitcast [7 x i8]* %arr0 to i8*
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r1, sp, #10}}
|
; CHECK: {{add(.w)? r1, sp, #10}}
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
@ -162,7 +162,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
%arr1 = alloca [7 x i8], align 1
|
%arr1 = alloca [7 x i8], align 1
|
||||||
%1 = bitcast [7 x i8]* %arr1 to i8*
|
%1 = bitcast [7 x i8]* %arr1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r0, sp, #3}}
|
; CHECK: {{add(.w)? r0, sp, #3}}
|
||||||
; CHECK-IOS: mov r1, #1
|
; CHECK-IOS: mov r1, #1
|
||||||
@ -175,7 +175,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
%arr2 = alloca [7 x i8], align 1
|
%arr2 = alloca [7 x i8], align 1
|
||||||
%2 = bitcast [7 x i8]* %arr2 to i8*
|
%2 = bitcast [7 x i8]* %arr2 to i8*
|
||||||
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
%arr0 = alloca [9 x i8], align 1
|
%arr0 = alloca [9 x i8], align 1
|
||||||
%0 = getelementptr inbounds [9 x i8], [9 x i8]* %arr0, i32 0, i32 4
|
%0 = getelementptr inbounds [9 x i8], [9 x i8]* %arr0, i32 0, i32 4
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
@ -201,7 +201,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
%arr1 = alloca [9 x i8], align 1
|
%arr1 = alloca [9 x i8], align 1
|
||||||
%1 = getelementptr inbounds [9 x i8], [9 x i8]* %arr1, i32 0, i32 4
|
%1 = getelementptr inbounds [9 x i8], [9 x i8]* %arr1, i32 0, i32 4
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
||||||
; CHECK-IOS: mov r1, #1
|
; CHECK-IOS: mov r1, #1
|
||||||
@ -214,7 +214,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
%arr2 = alloca [9 x i8], align 1
|
%arr2 = alloca [9 x i8], align 1
|
||||||
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %arr2, i32 0, i32 4
|
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %arr2, i32 0, i32 4
|
||||||
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
%arr0 = alloca [13 x i8], align 1
|
%arr0 = alloca [13 x i8], align 1
|
||||||
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 1
|
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 1
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
@ -240,7 +240,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
%arr1 = alloca [13 x i8], align 1
|
%arr1 = alloca [13 x i8], align 1
|
||||||
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 1
|
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 1
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
||||||
; CHECK-IOS: mov r1, #1
|
; CHECK-IOS: mov r1, #1
|
||||||
@ -253,7 +253,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
%arr2 = alloca [13 x i8], align 1
|
%arr2 = alloca [13 x i8], align 1
|
||||||
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 1
|
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 1
|
||||||
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -270,7 +270,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
%arr0 = alloca [13 x i8], align 1
|
%arr0 = alloca [13 x i8], align 1
|
||||||
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 %i
|
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 %i
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
@ -279,7 +279,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
%arr1 = alloca [13 x i8], align 1
|
%arr1 = alloca [13 x i8], align 1
|
||||||
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 %i
|
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 %i
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
||||||
; CHECK-IOS: mov r1, #1
|
; CHECK-IOS: mov r1, #1
|
||||||
@ -292,7 +292,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
%arr2 = alloca [13 x i8], align 1
|
%arr2 = alloca [13 x i8], align 1
|
||||||
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 %i
|
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 %i
|
||||||
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -309,7 +309,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
%arr0 = alloca [13 x i8], align 1
|
%arr0 = alloca [13 x i8], align 1
|
||||||
%0 = getelementptr [13 x i8], [13 x i8]* %arr0, i32 0, i32 4
|
%0 = getelementptr [13 x i8], [13 x i8]* %arr0, i32 0, i32 4
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
@ -318,7 +318,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
%arr1 = alloca [13 x i8], align 1
|
%arr1 = alloca [13 x i8], align 1
|
||||||
%1 = getelementptr [13 x i8], [13 x i8]* %arr1, i32 0, i32 4
|
%1 = getelementptr [13 x i8], [13 x i8]* %arr1, i32 0, i32 4
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
||||||
; CHECK-IOS: mov r1, #1
|
; CHECK-IOS: mov r1, #1
|
||||||
@ -331,7 +331,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
%arr2 = alloca [13 x i8], align 1
|
%arr2 = alloca [13 x i8], align 1
|
||||||
%2 = getelementptr [13 x i8], [13 x i8]* %arr2, i32 0, i32 4
|
%2 = getelementptr [13 x i8], [13 x i8]* %arr2, i32 0, i32 4
|
||||||
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -348,7 +348,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memmove
|
; CHECK-GNUEABI: bl memmove
|
||||||
%arr0 = alloca [13 x i8], align 1
|
%arr0 = alloca [13 x i8], align 1
|
||||||
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 16
|
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 16
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
; CHECK: {{add(.w)? r., sp, #(10|14)}}
|
||||||
; CHECK-IOS: bl _memcpy
|
; CHECK-IOS: bl _memcpy
|
||||||
@ -357,7 +357,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memcpy
|
; CHECK-GNUEABI: bl memcpy
|
||||||
%arr1 = alloca [13 x i8], align 1
|
%arr1 = alloca [13 x i8], align 1
|
||||||
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 16
|
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 16
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i1 false)
|
||||||
|
|
||||||
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
; CHECK: {{add(.w)? r., sp, #(1|5)}}
|
||||||
; CHECK-IOS: mov r1, #1
|
; CHECK-IOS: mov r1, #1
|
||||||
@ -370,7 +370,7 @@ entry:
|
|||||||
; CHECK-GNUEABI: bl memset
|
; CHECK-GNUEABI: bl memset
|
||||||
%arr2 = alloca [13 x i8], align 1
|
%arr2 = alloca [13 x i8], align 1
|
||||||
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 16
|
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 16
|
||||||
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -386,13 +386,13 @@ entry:
|
|||||||
@arr7 = external global [7 x i8], align 1
|
@arr7 = external global [7 x i8], align 1
|
||||||
define void @f9(i8* %dest, i32 %n) {
|
define void @f9(i8* %dest, i32 %n) {
|
||||||
entry:
|
entry:
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr1, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr1, i32 0, i32 0), i32 %n, i1 false)
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @arr2, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @arr2, i32 0, i32 0), i32 %n, i1 false)
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr3, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr3, i32 0, i32 0), i32 %n, i1 false)
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @arr4, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @arr4, i32 0, i32 0), i32 %n, i1 false)
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr5, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr5, i32 0, i32 0), i32 %n, i1 false)
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr6, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr6, i32 0, i32 0), i32 %n, i1 false)
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr7, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr7, i32 0, i32 0), i32 %n, i1 false)
|
||||||
|
|
||||||
unreachable
|
unreachable
|
||||||
}
|
}
|
||||||
@ -417,6 +417,6 @@ entry:
|
|||||||
; CHECK: arr6:
|
; CHECK: arr6:
|
||||||
; CHECK-NOT: arr7:
|
; CHECK-NOT: arr7:
|
||||||
|
|
||||||
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
|
@ -6,7 +6,7 @@ entry:
|
|||||||
; CHECK: movs r1, #0
|
; CHECK: movs r1, #0
|
||||||
; CHECK: strd r1, r1, [r0]
|
; CHECK: strd r1, r1, [r0]
|
||||||
; CHECK: str r1, [r0, #8]
|
; CHECK: str r1, [r0, #8]
|
||||||
call void @llvm.memset.p0i8.i64(i8* %c, i8 0, i64 12, i32 8, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* align 8 %c, i8 0, i64 12, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,11 +19,11 @@ entry:
|
|||||||
; CHECK: vst1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]
|
; CHECK: vst1.64 {d{{[0-9]+}}, d{{[0-9]+}}}, [r0]
|
||||||
%buf = alloca [26 x i8], align 1
|
%buf = alloca [26 x i8], align 1
|
||||||
%0 = getelementptr inbounds [26 x i8], [26 x i8]* %buf, i32 0, i32 0
|
%0 = getelementptr inbounds [26 x i8], [26 x i8]* %buf, i32 0, i32 0
|
||||||
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 26, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* align 1 %0, i8 0, i32 26, i1 false)
|
||||||
call void @something(i8* %0) nounwind
|
call void @something(i8* %0) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @something(i8*) nounwind
|
declare void @something(i8*) nounwind
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind
|
||||||
|
@ -15,13 +15,13 @@ define i32 @main() #0 {
|
|||||||
entry:
|
entry:
|
||||||
%title = alloca [15 x i8], align 1
|
%title = alloca [15 x i8], align 1
|
||||||
%0 = getelementptr inbounds [15 x i8], [15 x i8]* %title, i32 0, i32 0
|
%0 = getelementptr inbounds [15 x i8], [15 x i8]* %title, i32 0, i32 0
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @main.title, i32 0, i32 0), i32 15, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @main.title, i32 0, i32 0), i32 15, i1 false)
|
||||||
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* %0) #3
|
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* %0) #3
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #1
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #1
|
||||||
|
|
||||||
; Function Attrs: nounwind optsize
|
; Function Attrs: nounwind optsize
|
||||||
declare i32 @printf(i8* nocapture readonly, ...) #2
|
declare i32 @printf(i8* nocapture readonly, ...) #2
|
||||||
|
@ -61,10 +61,10 @@ target triple = "armv7l-unknown-linux-gnueabihf"
|
|||||||
@brefframe = external global [4 x [4 x i8]], align 1
|
@brefframe = external global [4 x [4 x i8]], align 1
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) #0
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) #0
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) #0
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @SetMotionVectorsMB(%structK* nocapture, i32) #1
|
declare void @SetMotionVectorsMB(%structK* nocapture, i32) #1
|
||||||
@ -123,10 +123,10 @@ for.cond210.preheader: ; preds = %if.then169
|
|||||||
unreachable
|
unreachable
|
||||||
|
|
||||||
if.end230: ; preds = %if.end164
|
if.end230: ; preds = %if.end164
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* bitcast ([4 x i32]* @b8mode to i8*), i32 16, i32 4, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* bitcast ([4 x i32]* @b8mode to i8*), i32 16, i1 false)
|
||||||
%b8pdir = getelementptr inbounds %structK, %structK* %2, i32 %1, i32 15
|
%b8pdir = getelementptr inbounds %structK, %structK* %2, i32 %1, i32 15
|
||||||
%3 = bitcast [4 x i32]* %b8pdir to i8*
|
%3 = bitcast [4 x i32]* %b8pdir to i8*
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %3, i8* bitcast ([4 x i32]* @b8pdir to i8*), i32 16, i32 4, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %3, i8* bitcast ([4 x i32]* @b8pdir to i8*), i32 16, i1 false)
|
||||||
br i1 undef, label %if.end236, label %if.then233
|
br i1 undef, label %if.end236, label %if.then233
|
||||||
|
|
||||||
if.then233: ; preds = %if.end230
|
if.then233: ; preds = %if.end230
|
||||||
|
@ -16,7 +16,7 @@ entry:
|
|||||||
store i32 3, i32* %arrayinit.element2, align 8
|
store i32 3, i32* %arrayinit.element2, align 8
|
||||||
%arrayinit.start = getelementptr inbounds %struct.S, %struct.S* %.compoundliteral, i64 0, i32 0, i64 3
|
%arrayinit.start = getelementptr inbounds %struct.S, %struct.S* %.compoundliteral, i64 0, i32 0, i64 3
|
||||||
%scevgep4 = bitcast i32* %arrayinit.start to i8*
|
%scevgep4 = bitcast i32* %arrayinit.start to i8*
|
||||||
call void @llvm.memset.p0i8.i64(i8* %scevgep4, i8 0, i64 28, i32 4, i1 false)
|
call void @llvm.memset.p0i8.i64(i8* %scevgep4, i8 0, i64 28, i1 false)
|
||||||
call void @foo(i32 %a, %struct.S* byval align 8 %.compoundliteral) #3
|
call void @foo(i32 %a, %struct.S* byval align 8 %.compoundliteral) #3
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
@ -24,4 +24,4 @@ entry:
|
|||||||
declare void @foo(i32, %struct.S* byval align 8) #1
|
declare void @foo(i32, %struct.S* byval align 8) #1
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #3
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) #3
|
||||||
|
@ -12,7 +12,7 @@ define i32 @bpf_prog1(%struct.bpf_context* nocapture %ctx) #0 section "events/ne
|
|||||||
%devname = alloca [3 x i8], align 1
|
%devname = alloca [3 x i8], align 1
|
||||||
%fmt = alloca [15 x i8], align 1
|
%fmt = alloca [15 x i8], align 1
|
||||||
%1 = getelementptr inbounds [3 x i8], [3 x i8]* %devname, i64 0, i64 0
|
%1 = getelementptr inbounds [3 x i8], [3 x i8]* %devname, i64 0, i64 0
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @bpf_prog1.devname, i64 0, i64 0), i64 3, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @bpf_prog1.devname, i64 0, i64 0), i64 3, i1 false)
|
||||||
%2 = getelementptr inbounds %struct.bpf_context, %struct.bpf_context* %ctx, i64 0, i32 0
|
%2 = getelementptr inbounds %struct.bpf_context, %struct.bpf_context* %ctx, i64 0, i32 0
|
||||||
%3 = load i64, i64* %2, align 8
|
%3 = load i64, i64* %2, align 8
|
||||||
%4 = inttoptr i64 %3 to %struct.sk_buff*
|
%4 = inttoptr i64 %3 to %struct.sk_buff*
|
||||||
@ -25,7 +25,7 @@ define i32 @bpf_prog1(%struct.bpf_context* nocapture %ctx) #0 section "events/ne
|
|||||||
|
|
||||||
; <label>:10 ; preds = %0
|
; <label>:10 ; preds = %0
|
||||||
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %fmt, i64 0, i64 0
|
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %fmt, i64 0, i64 0
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @bpf_prog1.fmt, i64 0, i64 0), i64 15, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @bpf_prog1.fmt, i64 0, i64 0), i64 15, i1 false)
|
||||||
%12 = call i32 (i8*, i32, ...) inttoptr (i64 11 to i32 (i8*, i32, ...)*)(i8* %11, i32 15, %struct.sk_buff* %4, i8* %7) #1
|
%12 = call i32 (i8*, i32, ...) inttoptr (i64 11 to i32 (i8*, i32, ...)*)(i8* %11, i32 15, %struct.sk_buff* %4, i8* %7) #1
|
||||||
; CHECK-LABEL: bpf_prog1:
|
; CHECK-LABEL: bpf_prog1:
|
||||||
; CHECK: call 4
|
; CHECK: call 4
|
||||||
@ -43,4 +43,4 @@ define i32 @bpf_prog1(%struct.bpf_context* nocapture %ctx) #0 section "events/ne
|
|||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) #1
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) #1
|
||||||
|
@ -103,7 +103,7 @@ declare i32 @manyarg(i32, i32, i32, i32, i32) #2
|
|||||||
define void @foo_printf() #1 {
|
define void @foo_printf() #1 {
|
||||||
%fmt = alloca [9 x i8], align 1
|
%fmt = alloca [9 x i8], align 1
|
||||||
%1 = getelementptr inbounds [9 x i8], [9 x i8]* %fmt, i64 0, i64 0
|
%1 = getelementptr inbounds [9 x i8], [9 x i8]* %fmt, i64 0, i64 0
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @foo_printf.fmt, i64 0, i64 0), i64 9, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @foo_printf.fmt, i64 0, i64 0), i64 9, i1 false)
|
||||||
; CHECK-LABEL: foo_printf:
|
; CHECK-LABEL: foo_printf:
|
||||||
; CHECK: ld_64 r1, 729618802566522216
|
; CHECK: ld_64 r1, 729618802566522216
|
||||||
%2 = call i32 (i8*, ...) @printf(i8* %1) #3
|
%2 = call i32 (i8*, ...) @printf(i8* %1) #3
|
||||||
@ -111,7 +111,7 @@ define void @foo_printf() #1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) #3
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) #3
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare i32 @printf(i8* nocapture, ...) #4
|
declare i32 @printf(i8* nocapture, ...) #4
|
||||||
|
@ -18,10 +18,10 @@ entry:
|
|||||||
|
|
||||||
if.then:
|
if.then:
|
||||||
%0 = alloca i8, i32 %i
|
%0 = alloca i8, i32 %i
|
||||||
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 %i, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 %i, i1 false)
|
||||||
%call = call i32 @f(i8* %0)
|
%call = call i32 @f(i8* %0)
|
||||||
%conv = sext i32 %call to i64
|
%conv = sext i32 %call to i64
|
||||||
ret i64 %conv
|
ret i64 %conv
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i1) nounwind
|
||||||
|
@ -10,8 +10,8 @@ define void @Bork() {
|
|||||||
entry:
|
entry:
|
||||||
%Qux = alloca [33 x i8]
|
%Qux = alloca [33 x i8]
|
||||||
%Qux1 = bitcast [33 x i8]* %Qux to i8*
|
%Qux1 = bitcast [33 x i8]* %Qux to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %Qux1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @C.0.1173, i32 0, i32 0), i64 33, i32 8, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %Qux1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @C.0.1173, i32 0, i32 0), i64 33, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
@ -13,14 +13,14 @@ define void @foo() #0 {
|
|||||||
entry:
|
entry:
|
||||||
%t = alloca [4 x [2 x i32]], align 8
|
%t = alloca [4 x [2 x i32]], align 8
|
||||||
%0 = bitcast [4 x [2 x i32]]* %t to i8*
|
%0 = bitcast [4 x [2 x i32]]* %t to i8*
|
||||||
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 32, i32 8, i1 false)
|
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 32, i1 false)
|
||||||
%arraydecay = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %t, i32 0, i32 0
|
%arraydecay = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %t, i32 0, i32 0
|
||||||
call void @bar([2 x i32]* %arraydecay) #1
|
call void @bar([2 x i32]* %arraydecay) #1
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #1
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) #1
|
||||||
|
|
||||||
declare void @bar([2 x i32]*) #2
|
declare void @bar([2 x i32]*) #2
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
; CHECK: jump memcpy
|
; CHECK: jump memcpy
|
||||||
define void @tail_memcpy(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 {
|
define void @tail_memcpy(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ entry:
|
|||||||
; CHECK: jump memmove
|
; CHECK: jump memmove
|
||||||
define void @tail_memmove(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 {
|
define void @tail_memmove(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i32 1, i1 false)
|
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,12 +20,12 @@ entry:
|
|||||||
; CHECK: jump memset
|
; CHECK: jump memset
|
||||||
define void @tail_memset(i8* nocapture %p, i8 %c, i32 %n) #0 {
|
define void @tail_memset(i8* nocapture %p, i8 %c, i32 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memset.p0i8.i32(i8* %p, i8 %c, i32 %n, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i32(i8* %p, i8 %c, i32 %n, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #0
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #0
|
||||||
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #0
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #0
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1) #0
|
||||||
|
|
||||||
attributes #0 = { nounwind }
|
attributes #0 = { nounwind }
|
||||||
|
@ -13,10 +13,10 @@ entry:
|
|||||||
; CHECK-NEXT: mov.w #5, r14
|
; CHECK-NEXT: mov.w #5, r14
|
||||||
; CHECK-NEXT: mov.w #128, r13
|
; CHECK-NEXT: mov.w #128, r13
|
||||||
; CHECK-NEXT: call #memset
|
; CHECK-NEXT: call #memset
|
||||||
call void @llvm.memset.p0i8.i16(i8* %0, i8 5, i16 128, i32 1, i1 false)
|
call void @llvm.memset.p0i8.i16(i8* %0, i8 5, i16 128, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
; Function Attrs: nounwind
|
; Function Attrs: nounwind
|
||||||
declare void @llvm.memset.p0i8.i16(i8* nocapture, i8, i16, i32, i1) nounwind
|
declare void @llvm.memset.p0i8.i16(i8* nocapture, i8, i16, i1) nounwind
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
define void @t(i8* %ptr) {
|
define void @t(i8* %ptr) {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %ptr, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 7, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %ptr, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 7, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
@i = global i32 12, align 4
|
@i = global i32 12, align 4
|
||||||
@dest = common global [50 x i8] zeroinitializer, align 1
|
@dest = common global [50 x i8] zeroinitializer, align 1
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1)
|
||||||
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1)
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1)
|
||||||
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1)
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1)
|
||||||
|
|
||||||
define void @cpy(i8* %src, i32 %i) {
|
define void @cpy(i8* %src, i32 %i) {
|
||||||
; ALL-LABEL: cpy:
|
; ALL-LABEL: cpy:
|
||||||
@ -29,7 +29,7 @@ define void @cpy(i8* %src, i32 %i) {
|
|||||||
; ALL-NEXT: nop
|
; ALL-NEXT: nop
|
||||||
; ALL-NOT: {{.*}}$2{{.*}}
|
; ALL-NOT: {{.*}}$2{{.*}}
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @dest, i32 0, i32 0),
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @dest, i32 0, i32 0),
|
||||||
i8* %src, i32 %i, i32 1, i1 false)
|
i8* %src, i32 %i, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ define void @mov(i8* %src, i32 %i) {
|
|||||||
; ALL-NEXT: nop
|
; ALL-NEXT: nop
|
||||||
; ALL-NOT: {{.*}}$2{{.*}}
|
; ALL-NOT: {{.*}}$2{{.*}}
|
||||||
call void @llvm.memmove.p0i8.p0i8.i32(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @dest, i32 0, i32 0),
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @dest, i32 0, i32 0),
|
||||||
i8* %src, i32 %i, i32 1, i1 false)
|
i8* %src, i32 %i, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,6 +69,6 @@ define void @clear(i32 %i) {
|
|||||||
; ALL-NEXT: nop
|
; ALL-NEXT: nop
|
||||||
; ALL-NOT: {{.*}}$2{{.*}}
|
; ALL-NOT: {{.*}}$2{{.*}}
|
||||||
call void @llvm.memset.p0i8.i32(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @dest, i32 0, i32 0),
|
call void @llvm.memset.p0i8.i32(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @dest, i32 0, i32 0),
|
||||||
i8 42, i32 %i, i32 1, i1 false)
|
i8 42, i32 %i, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,8 @@ entry:
|
|||||||
|
|
||||||
%0 = bitcast i32* %d to i8*
|
%0 = bitcast i32* %d to i8*
|
||||||
%1 = bitcast i32* %s to i8*
|
%1 = bitcast i32* %s to i8*
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %1, i32 %n, i32 4, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %1, i32 %n, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
declare void @fS1(i48 inreg) #1
|
declare void @fS1(i48 inreg) #1
|
||||||
declare void @fS2(i40 inreg) #1
|
declare void @fS2(i40 inreg) #1
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #2
|
||||||
|
|
||||||
define void @f1() #0 {
|
define void @f1() #0 {
|
||||||
entry:
|
entry:
|
||||||
@ -51,7 +51,7 @@ entry:
|
|||||||
%s1_1.coerce = alloca { i48 }
|
%s1_1.coerce = alloca { i48 }
|
||||||
%0 = bitcast { i48 }* %s1_1.coerce to i8*
|
%0 = bitcast { i48 }* %s1_1.coerce to i8*
|
||||||
%1 = bitcast %struct.S1* %s1_1 to i8*
|
%1 = bitcast %struct.S1* %s1_1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 6, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 6, i1 false)
|
||||||
%2 = getelementptr { i48 }, { i48 }* %s1_1.coerce, i32 0, i32 0
|
%2 = getelementptr { i48 }, { i48 }* %s1_1.coerce, i32 0, i32 0
|
||||||
%3 = load i48, i48* %2, align 1
|
%3 = load i48, i48* %2, align 1
|
||||||
call void @fS1(i48 inreg %3)
|
call void @fS1(i48 inreg %3)
|
||||||
@ -68,7 +68,7 @@ entry:
|
|||||||
%s2_1.coerce = alloca { i40 }
|
%s2_1.coerce = alloca { i40 }
|
||||||
%0 = bitcast { i40 }* %s2_1.coerce to i8*
|
%0 = bitcast { i40 }* %s2_1.coerce to i8*
|
||||||
%1 = bitcast %struct.S2* %s2_1 to i8*
|
%1 = bitcast %struct.S2* %s2_1 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 5, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 5, i1 false)
|
||||||
%2 = getelementptr { i40 }, { i40 }* %s2_1.coerce, i32 0, i32 0
|
%2 = getelementptr { i40 }, { i40 }* %s2_1.coerce, i32 0, i32 0
|
||||||
%3 = load i40, i40* %2, align 1
|
%3 = load i40, i40* %2, align 1
|
||||||
call void @fS2(i40 inreg %3)
|
call void @fS2(i40 inreg %3)
|
||||||
|
@ -172,7 +172,7 @@ entry:
|
|||||||
%0 = load %struct.SmallStruct_3b*, %struct.SmallStruct_3b** %ss.addr, align 8
|
%0 = load %struct.SmallStruct_3b*, %struct.SmallStruct_3b** %ss.addr, align 8
|
||||||
%1 = bitcast { i24 }* %.coerce to i8*
|
%1 = bitcast { i24 }* %.coerce to i8*
|
||||||
%2 = bitcast %struct.SmallStruct_3b* %0 to i8*
|
%2 = bitcast %struct.SmallStruct_3b* %0 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 3, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 3, i1 false)
|
||||||
%3 = getelementptr { i24 }, { i24 }* %.coerce, i32 0, i32 0
|
%3 = getelementptr { i24 }, { i24 }* %.coerce, i32 0, i32 0
|
||||||
%4 = load i24, i24* %3, align 1
|
%4 = load i24, i24* %3, align 1
|
||||||
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i24 inreg %4)
|
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i24 inreg %4)
|
||||||
@ -181,7 +181,7 @@ entry:
|
|||||||
; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 40
|
; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 40
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
|
||||||
|
|
||||||
define void @smallStruct_4b(%struct.SmallStruct_4b* %ss) #0 {
|
define void @smallStruct_4b(%struct.SmallStruct_4b* %ss) #0 {
|
||||||
entry:
|
entry:
|
||||||
@ -205,7 +205,7 @@ entry:
|
|||||||
%0 = load %struct.SmallStruct_5b*, %struct.SmallStruct_5b** %ss.addr, align 8
|
%0 = load %struct.SmallStruct_5b*, %struct.SmallStruct_5b** %ss.addr, align 8
|
||||||
%1 = bitcast { i40 }* %.coerce to i8*
|
%1 = bitcast { i40 }* %.coerce to i8*
|
||||||
%2 = bitcast %struct.SmallStruct_5b* %0 to i8*
|
%2 = bitcast %struct.SmallStruct_5b* %0 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 5, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 5, i1 false)
|
||||||
%3 = getelementptr { i40 }, { i40 }* %.coerce, i32 0, i32 0
|
%3 = getelementptr { i40 }, { i40 }* %.coerce, i32 0, i32 0
|
||||||
%4 = load i40, i40* %3, align 1
|
%4 = load i40, i40* %3, align 1
|
||||||
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i40 inreg %4)
|
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i40 inreg %4)
|
||||||
@ -222,7 +222,7 @@ entry:
|
|||||||
%0 = load %struct.SmallStruct_6b*, %struct.SmallStruct_6b** %ss.addr, align 8
|
%0 = load %struct.SmallStruct_6b*, %struct.SmallStruct_6b** %ss.addr, align 8
|
||||||
%1 = bitcast { i48 }* %.coerce to i8*
|
%1 = bitcast { i48 }* %.coerce to i8*
|
||||||
%2 = bitcast %struct.SmallStruct_6b* %0 to i8*
|
%2 = bitcast %struct.SmallStruct_6b* %0 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 6, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 6, i1 false)
|
||||||
%3 = getelementptr { i48 }, { i48 }* %.coerce, i32 0, i32 0
|
%3 = getelementptr { i48 }, { i48 }* %.coerce, i32 0, i32 0
|
||||||
%4 = load i48, i48* %3, align 1
|
%4 = load i48, i48* %3, align 1
|
||||||
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i48 inreg %4)
|
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i48 inreg %4)
|
||||||
@ -239,7 +239,7 @@ entry:
|
|||||||
%0 = load %struct.SmallStruct_7b*, %struct.SmallStruct_7b** %ss.addr, align 8
|
%0 = load %struct.SmallStruct_7b*, %struct.SmallStruct_7b** %ss.addr, align 8
|
||||||
%1 = bitcast { i56 }* %.coerce to i8*
|
%1 = bitcast { i56 }* %.coerce to i8*
|
||||||
%2 = bitcast %struct.SmallStruct_7b* %0 to i8*
|
%2 = bitcast %struct.SmallStruct_7b* %0 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 7, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 7, i1 false)
|
||||||
%3 = getelementptr { i56 }, { i56 }* %.coerce, i32 0, i32 0
|
%3 = getelementptr { i56 }, { i56 }* %.coerce, i32 0, i32 0
|
||||||
%4 = load i56, i56* %3, align 1
|
%4 = load i56, i56* %3, align 1
|
||||||
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i56 inreg %4)
|
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i56 inreg %4)
|
||||||
@ -270,7 +270,7 @@ entry:
|
|||||||
%0 = load %struct.SmallStruct_9b*, %struct.SmallStruct_9b** %ss.addr, align 8
|
%0 = load %struct.SmallStruct_9b*, %struct.SmallStruct_9b** %ss.addr, align 8
|
||||||
%1 = bitcast { i64, i8 }* %.coerce to i8*
|
%1 = bitcast { i64, i8 }* %.coerce to i8*
|
||||||
%2 = bitcast %struct.SmallStruct_9b* %0 to i8*
|
%2 = bitcast %struct.SmallStruct_9b* %0 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 9, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 9, i1 false)
|
||||||
%3 = getelementptr { i64, i8 }, { i64, i8 }* %.coerce, i32 0, i32 0
|
%3 = getelementptr { i64, i8 }, { i64, i8 }* %.coerce, i32 0, i32 0
|
||||||
%4 = load i64, i64* %3, align 1
|
%4 = load i64, i64* %3, align 1
|
||||||
%5 = getelementptr { i64, i8 }, { i64, i8 }* %.coerce, i32 0, i32 1
|
%5 = getelementptr { i64, i8 }, { i64, i8 }* %.coerce, i32 0, i32 1
|
||||||
|
@ -106,7 +106,7 @@ entry:
|
|||||||
%0 = load %struct.SmallStruct_1b1s1b*, %struct.SmallStruct_1b1s1b** %ss.addr, align 8
|
%0 = load %struct.SmallStruct_1b1s1b*, %struct.SmallStruct_1b1s1b** %ss.addr, align 8
|
||||||
%1 = bitcast { i48 }* %.coerce to i8*
|
%1 = bitcast { i48 }* %.coerce to i8*
|
||||||
%2 = bitcast %struct.SmallStruct_1b1s1b* %0 to i8*
|
%2 = bitcast %struct.SmallStruct_1b1s1b* %0 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 6, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 6, i1 false)
|
||||||
%3 = getelementptr { i48 }, { i48 }* %.coerce, i32 0, i32 0
|
%3 = getelementptr { i48 }, { i48 }* %.coerce, i32 0, i32 0
|
||||||
%4 = load i48, i48* %3, align 1
|
%4 = load i48, i48* %3, align 1
|
||||||
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i48 inreg %4)
|
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i48 inreg %4)
|
||||||
@ -115,7 +115,7 @@ entry:
|
|||||||
; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 16
|
; CHECK: dsll $[[R1:[0-9]+]], $[[R2:[0-9]+]], 16
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
|
||||||
|
|
||||||
define void @smallStruct_1s1i(%struct.SmallStruct_1s1i* %ss) #0 {
|
define void @smallStruct_1s1i(%struct.SmallStruct_1s1i* %ss) #0 {
|
||||||
entry:
|
entry:
|
||||||
@ -139,7 +139,7 @@ entry:
|
|||||||
%0 = load %struct.SmallStruct_3b1s*, %struct.SmallStruct_3b1s** %ss.addr, align 8
|
%0 = load %struct.SmallStruct_3b1s*, %struct.SmallStruct_3b1s** %ss.addr, align 8
|
||||||
%1 = bitcast { i48 }* %.coerce to i8*
|
%1 = bitcast { i48 }* %.coerce to i8*
|
||||||
%2 = bitcast %struct.SmallStruct_3b1s* %0 to i8*
|
%2 = bitcast %struct.SmallStruct_3b1s* %0 to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 6, i32 0, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 6, i1 false)
|
||||||
%3 = getelementptr { i48 }, { i48 }* %.coerce, i32 0, i32 0
|
%3 = getelementptr { i48 }, { i48 }* %.coerce, i32 0, i32 0
|
||||||
%4 = load i48, i48* %3, align 1
|
%4 = load i48, i48* %3, align 1
|
||||||
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i48 inreg %4)
|
call void (i8*, ...) @varArgF_SmallStruct(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i48 inreg %4)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
@struct_6xi32 = global {[6 x i32]} zeroinitializer
|
@struct_6xi32 = global {[6 x i32]} zeroinitializer
|
||||||
@struct_128xi16 = global {[128 x i16]} zeroinitializer
|
@struct_128xi16 = global {[128 x i16]} zeroinitializer
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1)
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1)
|
||||||
|
|
||||||
define inreg {i8} @ret_struct_i8() nounwind {
|
define inreg {i8} @ret_struct_i8() nounwind {
|
||||||
entry:
|
entry:
|
||||||
@ -52,7 +52,7 @@ define inreg {i16} @ret_struct_i16() nounwind {
|
|||||||
entry:
|
entry:
|
||||||
%retval = alloca {i8,i8}, align 1
|
%retval = alloca {i8,i8}, align 1
|
||||||
%0 = bitcast {i8,i8}* %retval to i8*
|
%0 = bitcast {i8,i8}* %retval to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* getelementptr inbounds ({i8,i8}, {i8,i8}* @struct_2byte, i32 0, i32 0), i64 2, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* getelementptr inbounds ({i8,i8}, {i8,i8}* @struct_2byte, i32 0, i32 0), i64 2, i1 false)
|
||||||
%1 = bitcast {i8,i8}* %retval to {i16}*
|
%1 = bitcast {i8,i8}* %retval to {i16}*
|
||||||
%2 = load volatile {i16}, {i16}* %1
|
%2 = load volatile {i16}, {i16}* %1
|
||||||
ret {i16} %2
|
ret {i16} %2
|
||||||
@ -144,7 +144,7 @@ entry:
|
|||||||
define void @ret_struct_128xi16({[128 x i16]}* sret %returnval) {
|
define void @ret_struct_128xi16({[128 x i16]}* sret %returnval) {
|
||||||
entry:
|
entry:
|
||||||
%0 = bitcast {[128 x i16]}* %returnval to i8*
|
%0 = bitcast {[128 x i16]}* %returnval to i8*
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ({[128 x i16]}* @struct_128xi16 to i8*), i64 256, i32 2, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast ({[128 x i16]}* @struct_128xi16 to i8*), i64 256, i1 false)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ entry:
|
|||||||
|
|
||||||
%agg.tmp = alloca %struct.S1, align 1
|
%agg.tmp = alloca %struct.S1, align 1
|
||||||
%tmp = getelementptr inbounds %struct.S1, %struct.S1* %agg.tmp, i32 0, i32 0, i32 0
|
%tmp = getelementptr inbounds %struct.S1, %struct.S1* %agg.tmp, i32 0, i32 0, i32 0
|
||||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* getelementptr inbounds (%struct.S1, %struct.S1* @s1, i32 0, i32 0, i32 0), i32 65536, i32 1, i1 false)
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* getelementptr inbounds (%struct.S1, %struct.S1* @s1, i32 0, i32 0, i32 0), i32 65536, i1 false)
|
||||||
call void @f2(%struct.S1* byval %agg.tmp) nounwind
|
call void @f2(%struct.S1* byval %agg.tmp) nounwind
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @f2(%struct.S1* byval)
|
declare void @f2(%struct.S1* byval)
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
@ -9,11 +9,11 @@ entry:
|
|||||||
; CHECK-NOT: call16(memcpy
|
; CHECK-NOT: call16(memcpy
|
||||||
|
|
||||||
%arraydecay = getelementptr inbounds %struct.S1, %struct.S1* %s1, i32 0, i32 1, i32 0
|
%arraydecay = getelementptr inbounds %struct.S1, %struct.S1* %s1, i32 0, i32 1, i32 0
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %arraydecay, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i32 0, i32 0), i32 31, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %arraydecay, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i32 0, i32 0), i32 31, i1 false)
|
||||||
%arrayidx = getelementptr inbounds %struct.S1, %struct.S1* %s1, i32 0, i32 1, i32 40
|
%arrayidx = getelementptr inbounds %struct.S1, %struct.S1* %s1, i32 0, i32 1, i32 40
|
||||||
store i8 %n, i8* %arrayidx, align 1
|
store i8 %n, i8* %arrayidx, align 1
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ entry:
|
|||||||
|
|
||||||
declare i32 @callee12()
|
declare i32 @callee12()
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
|
||||||
|
|
||||||
define i32 @caller12(%struct.S* nocapture byval %a0) nounwind {
|
define i32 @caller12(%struct.S* nocapture byval %a0) nounwind {
|
||||||
entry:
|
entry:
|
||||||
@ -221,7 +221,7 @@ entry:
|
|||||||
; PIC16: jalrc
|
; PIC16: jalrc
|
||||||
|
|
||||||
%0 = bitcast %struct.S* %a0 to i8*
|
%0 = bitcast %struct.S* %a0 to i8*
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct.S* @gs1 to i8*), i8* %0, i32 8, i32 4, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast (%struct.S* @gs1 to i8*), i8* %0, i32 8, i1 false)
|
||||||
%call = tail call i32 @callee12() nounwind
|
%call = tail call i32 @callee12() nounwind
|
||||||
ret i32 %call
|
ret i32 %call
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||||
target triple = "nvptx64-unknown-unknown"
|
target triple = "nvptx64-unknown-unknown"
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
|
||||||
declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1
|
declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1) #1
|
||||||
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #1
|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) #1
|
||||||
|
|
||||||
define i8* @memcpy_caller(i8* %dst, i8* %src, i64 %n) #0 {
|
define i8* @memcpy_caller(i8* %dst, i8* %src, i64 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i1 false)
|
||||||
ret i8* %dst
|
ret i8* %dst
|
||||||
|
|
||||||
; IR-LABEL: @memcpy_caller
|
; IR-LABEL: @memcpy_caller
|
||||||
@ -34,7 +34,7 @@ entry:
|
|||||||
|
|
||||||
define i8* @memcpy_volatile_caller(i8* %dst, i8* %src, i64 %n) #0 {
|
define i8* @memcpy_volatile_caller(i8* %dst, i8* %src, i64 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i32 1, i1 true)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i1 true)
|
||||||
ret i8* %dst
|
ret i8* %dst
|
||||||
|
|
||||||
; IR-LABEL: @memcpy_volatile_caller
|
; IR-LABEL: @memcpy_volatile_caller
|
||||||
@ -54,7 +54,7 @@ define i8* @memcpy_casting_caller(i32* %dst, i32* %src, i64 %n) #0 {
|
|||||||
entry:
|
entry:
|
||||||
%0 = bitcast i32* %dst to i8*
|
%0 = bitcast i32* %dst to i8*
|
||||||
%1 = bitcast i32* %src to i8*
|
%1 = bitcast i32* %src to i8*
|
||||||
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 %n, i32 1, i1 false)
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 %n, i1 false)
|
||||||
ret i8* %0
|
ret i8* %0
|
||||||
|
|
||||||
; Check that casts in calls to memcpy are handled properly
|
; Check that casts in calls to memcpy are handled properly
|
||||||
@ -68,7 +68,7 @@ entry:
|
|||||||
define i8* @memset_caller(i8* %dst, i32 %c, i64 %n) #0 {
|
define i8* @memset_caller(i8* %dst, i32 %c, i64 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
%0 = trunc i32 %c to i8
|
%0 = trunc i32 %c to i8
|
||||||
tail call void @llvm.memset.p0i8.i64(i8* %dst, i8 %0, i64 %n, i32 1, i1 false)
|
tail call void @llvm.memset.p0i8.i64(i8* %dst, i8 %0, i64 %n, i1 false)
|
||||||
ret i8* %dst
|
ret i8* %dst
|
||||||
|
|
||||||
; IR-LABEL: @memset_caller
|
; IR-LABEL: @memset_caller
|
||||||
@ -88,7 +88,7 @@ entry:
|
|||||||
|
|
||||||
define i8* @memmove_caller(i8* %dst, i8* %src, i64 %n) #0 {
|
define i8* @memmove_caller(i8* %dst, i8* %src, i64 %n) #0 {
|
||||||
entry:
|
entry:
|
||||||
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i32 1, i1 false)
|
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i1 false)
|
||||||
ret i8* %dst
|
ret i8* %dst
|
||||||
|
|
||||||
; IR-LABEL: @memmove_caller
|
; IR-LABEL: @memmove_caller
|
||||||
|
@ -179,7 +179,7 @@ for.end.7: ; preds = %entry, %for.end.7
|
|||||||
br i1 %exitcond.7, label %for.end12, label %for.end.7
|
br i1 %exitcond.7, label %for.end12, label %for.end.7
|
||||||
}
|
}
|
||||||
|
|
||||||
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
|
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
|
||||||
|
|
||||||
declare i32 @puts(i8* nocapture) nounwind
|
declare i32 @puts(i8* nocapture) nounwind
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user