1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
llvm-mirror/test/Verifier
Daniel Neilson f59acc15ad Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Summary:
 This is a resurrection of work first proposed and discussed in Aug 2015:
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
and initially landed (but then backed out) in Nov 2015:
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

 The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.

 This change is the first in a series that allows source and dest to each
have their own alignments by using the alignment attribute on their arguments.

 In this change we:
1) Remove the alignment argument.
2) Add alignment attributes to the source & dest arguments. We, temporarily,
   require that the alignments for source & dest be equal.

 For example, code which used to read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)

 Downstream users may have to update their lit tests that check for
@llvm.memcpy/memmove/memset call/declaration patterns. The following extended sed script
may help with updating the majority of your tests, but it does not catch all possible
patterns so some manual checking and updating will be required.

s~declare void @llvm\.mem(set|cpy|move)\.p([^(]*)\((.*), i32, i1\)~declare void @llvm.mem\1.p\2(\3, i1)~g
s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* \3, i8 \4, i8 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* \3, i8 \4, i16 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* \3, i8 \4, i32 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* \3, i8 \4, i64 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* \3, i8 \4, i128 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* align \6 \3, i8 \4, i8 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* align \6 \3, i8 \4, i16 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* align \6 \3, i8 \4, i32 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* align \6 \3, i8 \4, i64 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* align \6 \3, i8 \4, i128 \5, i1 \7)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* \4, i8\5* \6, i8 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* \4, i8\5* \6, i16 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* \4, i8\5* \6, i32 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* \4, i8\5* \6, i64 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* \4, i8\5* \6, i128 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* align \8 \4, i8\5* align \8 \6, i8 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* align \8 \4, i8\5* align \8 \6, i16 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* align \8 \4, i8\5* align \8 \6, i32 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* align \8 \4, i8\5* align \8 \6, i64 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* align \8 \4, i8\5* align \8 \6, i128 \7, i1 \9)~g

 The remaining changes in the series will:
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
   source and dest alignments.
Step 3) Update Clang to use the new IRBuilder API.
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
        and those that use use MemIntrinsicInst::[get|set]Alignment() to use
        getDestAlignment() and getSourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
        MemIntrinsicInst::[get|set]Alignment() methods.

Reviewers: pete, hfinkel, lhames, reames, bollu

Reviewed By: reames

Subscribers: niosHD, reames, jholewinski, qcolombet, jfb, sanjoy, arsenm, dschuff, dylanmckay, mehdi_amini, sdardis, nemanjai, david2050, nhaehnle, javed.absar, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, sabuasal, llvm-commits

Differential Revision: https://reviews.llvm.org/D41675

llvm-svn: 322965
2018-01-19 17:13:12 +00:00
..
2002-04-13-RetTypes.ll
2002-11-05-GetelementptrPointers.ll
2004-05-21-SwitchConstantMismatch.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
2006-07-11-StoreStruct.ll
2006-10-15-AddrLabel.ll
2006-12-12-IntrinsicDefine.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
2007-12-21-InvokeParamAttrs.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
2008-01-11-VarargAttrs.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
2008-03-01-AllocaSized.ll
2008-11-15-RetVoid.ll
2009-05-29-InvokeResult1.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
2009-05-29-InvokeResult2.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
2009-05-29-InvokeResult3.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
2010-08-07-PointerIntrinsic.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
alias.ll
align-md.ll
alloc-size-failedparse.ll
allocsize.ll
AmbiguousPhi.ll
amdgpu-cc.ll Verifier: Check some amdgpu calling convention restrictions 2017-04-04 18:43:11 +00:00
atomics.ll
bitcast-address-space-nested-global-cycle.ll
bitcast-address-space-nested-global.ll
bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
bitcast-address-space-through-constant-inttoptr.ll
bitcast-address-space-through-gep-2.ll
bitcast-address-space-through-gep.ll
bitcast-address-space-through-inttoptr.ll
bitcast-address-spaces.ll
bitcast-alias-address-space.ll
bitcast-vector-pointer-as.ll
byval-1.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
byval-4.ll
callsite-dbgloc.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
cc-flags.ll Debug Info: Support DW_AT_calling_convention on composite types. 2018-01-05 01:13:37 +00:00
comdat2.ll
comdat3.ll
comdat-decl1.ll
comdat-decl2.ll
comdat.ll
cttz-undef-arg.ll
dbg-difile-crash.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
dbg-invalid-compileunit.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
dbg-invalid-named-metadata.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
dbg-invalid-retaintypes.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
dbg-line-without-file.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
dbg-null-retained-type.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
dbg-orphaned-compileunit.ll
dbg-typerefs.ll
dbg.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
deoptimize-intrinsic.ll
dereferenceable-md.ll
diderivedtype-address-space-atomic-type.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-const-type.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-friend.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-inheritance.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-member.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-ptr-to-member-type.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-restrict-type.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-rvalue-reference-type.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-typedef.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diderivedtype-address-space-volatile-type.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
diexpression-swap.ll
DIFile.ll Tighten up DIFile verifier for checksums 2018-01-11 22:03:43 +00:00
diglobalvariable.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
DILocation-parents.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
DISubprogram.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
dominates.ll
element-wise-atomic-memory-intrinsics.ll Add element atomic memset intrinsic 2017-07-12 21:57:23 +00:00
fnarg-debuginfo.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
fnarg-nodebug.ll
fp-intrinsics.ll Add constrained intrinsics for some libm-equivalent operations 2017-05-25 21:31:00 +00:00
fpmath.ll
fragment.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
frameescape.ll
func-dbg.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
function-metadata-bad.ll
function-metadata-good.ll
gc_relocate_addrspace.ll
gc_relocate_operand.ll
gc_relocate_return.ll
gcread-ptrptr.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
gcroot-alloca.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
gcroot-meta.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
gcroot-ptrptr.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
gcwrite-ptrptr.ll Make shell redirection construct portable 2017-07-12 13:24:46 +00:00
global-ctors.ll
guard-intrinsic.ll
ident-meta1.ll
ident-meta2.ll
ident-meta3.ll
ident-meta4.ll
inalloca1.ll
inalloca2.ll
inalloca3.ll
inalloca-vararg.ll
invalid-eh.ll Mark Verifier/invalid-eh.ll as unsupported on windows 2017-08-17 15:07:03 +00:00
invalid-statepoint2.ll
invalid-statepoint.ll
invoke.ll
jumptable.ll
llvm.compiler_used-invalid-type.ll
llvm.dbg.declare-address.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
llvm.dbg.declare-expression.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
llvm.dbg.declare-variable.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
llvm.dbg.intrinsic-dbg-attachment.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
llvm.dbg.value-expression.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
llvm.dbg.value-value.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
llvm.dbg.value-variable.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
llvm.used-invalid-init2.ll
llvm.used-invalid-init.ll
llvm.used-invalid-type2.ll
llvm.used-invalid-type.ll
llvm.used-ptr-type.ll
mdcompositetype-templateparams-tuple.ll
mdcompositetype-templateparams.ll
memcpy.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
metadata-function-dbg.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
metadata-function-prof.ll
module-flags-1.ll Support for taking the max of module flags when linking, use for PIE/PIC 2017-05-23 00:08:00 +00:00
module-flags-2.ll
module-flags-3.ll
musttail-invalid.ll
musttail-valid.ll
non-integer-gep-index.ll [Verifier] Check that GEP indexes has correct types 2017-12-14 09:33:58 +00:00
non-integer-gep-index.ll.bc [Verifier] Check that GEP indexes has correct types 2017-12-14 09:33:58 +00:00
non-integral-pointers.ll
operand-bundles.ll
PhiGrouping.ll
pr34325.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
range-1.ll
range-2.ll
README.txt
recursive-struct-param.ll
recursive-type-1.ll
recursive-type-2.ll
recursive-type-3.ll
resume.ll
scatter_gather.ll Support arbitrary address space pointers in masked gather/scatter intrinsics. 2017-05-03 12:28:54 +00:00
SelfReferential.ll
speculatable-callsite-invalid.ll Add speculatable function attribute 2017-04-28 20:25:27 +00:00
speculatable-callsite.ll Add speculatable function attribute 2017-04-28 20:25:27 +00:00
sret.ll
statepoint.ll
swifterror2.ll
swifterror3.ll
swifterror.ll
swiftself.ll
tbaa-allowed.ll
tbaa.ll Move the stripping of invalid debug info from the Verifier to AutoUpgrade. 2017-10-02 18:31:29 +00:00
test_g_phi.mir Fix Verifier test - add REQUIRES aarch64-registered-target 2017-08-23 21:55:36 +00:00
token1.ll
token2.ll
token3.ll
token4.ll
token5.ll
token6.ll
token7.ll
unsized-types.ll
varargs-intrinsic.ll
writeonly.ll

This directory contains testcases that the verifier is supposed to detect as
malformed LLVM code.  Testcases for situations that the verifier incorrectly
identifies as malformed should go in the test/Assembler directory.