1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/test/Transforms/NewGVN
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
..
2007-07-25-DominatedLoop.ll
2007-07-25-InfiniteLoop.ll
2007-07-25-Loop.ll
2007-07-25-NestedLoop.ll
2007-07-25-SinglePredecessor.ll
2007-07-26-InterlockingLoops.ll
2007-07-26-NonRedundant.ll
2007-07-26-PhiErasure.ll
2007-07-30-PredIDom.ll
2007-07-31-NoDomInherit.ll
2007-07-31-RedundantPhi.ll
2008-02-12-UndefLoad.ll
2008-02-13-NewPHI.ll
2008-07-02-Unreachable.ll
2008-12-09-SelfRemove.ll
2008-12-12-RLE-Crash.ll
2008-12-14-rle-reanalyze.ll
2008-12-15-CacheVisited.ll
2009-01-21-SortInvalidation.ll
2009-01-22-SortInvalidation.ll
2009-03-10-PREOnVoid.ll
2009-07-13-MemDepSortFail.ll
2009-11-12-MemDepMallocBitCast.ll
2010-03-31-RedundantPHIs.ll
2010-05-08-OneBit.ll
2010-11-13-Simplify.ll
2011-04-27-phioperands.ll
2011-07-07-MatchIntrinsicExtract.ll
2011-09-07-TypeIdFor.ll
2012-05-22-PreCrash.ll
2016-08-30-MaskedScatterGather.ll
assume-equal.ll
basic-cyclic-opt.ll
basic-undef-test.ll
basic.ll NewGVN: We weren't properly simplifying selects with equal arguments due to a thinko. 2017-08-24 02:43:17 +00:00
big-endian.ll
bitcast-of-call.ll
br-identical.ll
calloc-load-removal.ll
calls-nonlocal.ll
calls-readonly.ll
commute.ll
completeness.ll NewGVN: Fix PR 34473, by not using ExactlyEqualsExpression for finding 2017-09-30 23:51:55 +00:00
cond_br2.ll
cond_br.ll
condprop-xfail.ll
condprop.ll
crash-no-aa.ll
crash.ll
cyclic-phi-handling.ll
dbg-redundant-load.ll
deadstore.ll
debugloc.ll
edge.ll
equivalent-phi.ll
fence.ll
flags.ll
fold-const-expr.ll [NewGVN] Now that load coercion is enable, we pass this test. 2017-08-02 19:47:37 +00:00
fpmath.ll
funclet.ll
int_sideeffect.ll Add an @llvm.sideeffect intrinsic 2017-11-08 21:59:51 +00:00
invariant.group.ll
invariant.start.ll
lifetime-simple.ll
load-constant-mem.ll
load-from-unreachable-predecessor.ll
loadforward.ll [InstSimplify] Constant fold the new GEP in SimplifyGEPInst. 2017-06-06 10:17:14 +00:00
malloc-load-removal.ll
MemdepMiscompile.ll
memory-handling.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
no_speculative_loads_with_asan.ll Hardware-assisted AddressSanitizer (llvm part). 2017-12-09 00:21:41 +00:00
noalias.ll
non-integral-pointers.ll
non-local-offset.ll
nonescaping-malloc.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
null-aliases-nothing.ll
opt-remarks.ll Keep Optimization Remark Yaml in NewPM 2017-08-20 01:30:45 +00:00
phi-edge-handling.ll
phi-translate-partial-alias.ll
pr10820.ll
pr12979.ll
pr14166.ll
pr17732.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
pr17852.ll
pr24397.ll
pr24426.ll
pr25440.ll
pr28562.ll
pr31472.ll
pr31483.ll
pr31491.ll
pr31501.ll
pr31573.ll
pr31594.ll
pr31613.ll
pr31682.ll
pr31758.ll
pr32403.ll NewGVN: Fix PR/33187. This is a bug caused by two things: 2017-06-06 17:15:28 +00:00
pr32607.ll
pr32836.ll [NewGVN] Update additionalUsers when we simplify to a value. 2017-05-24 02:30:24 +00:00
pr32838.ll NewGVN: Fix PR32838. 2017-05-19 20:22:20 +00:00
pr32845.ll [NewGVN] Actually check the NewGVN output. 2017-05-21 20:55:53 +00:00
pr32852.ll
pr32897.ll NewGVN: Fix PR/33187. This is a bug caused by two things: 2017-06-06 17:15:28 +00:00
pr32934.ll [NewGVN] Re-enable test now that the nondeterminism has been fixed. 2017-05-16 22:27:06 +00:00
pr32945.ll [NewGVN] Replace predicate info leftovers. 2017-05-18 21:43:23 +00:00
pr32952.ll
pr33014.ll [NewGVN] Break infinite recursion in singleReachablePHIPath(). 2017-05-18 23:22:44 +00:00
pr33086.ll [NewGVN] Delete the old store when we find congruent to a load. 2017-05-19 04:06:10 +00:00
pr33116.ll NewGVN: Fix PR 33116, the memoryphi version of bug 32838. 2017-05-21 23:41:58 +00:00
pr33185.ll Fix PR/33305. caused by trying to simplify expressions in phi of ops that should have no leaders. 2017-09-02 02:18:44 +00:00
pr33187.ll NewGVN: Fix PR/33187. This is a bug caused by two things: 2017-06-06 17:15:28 +00:00
pr33196.ll [NewGVN] Fix the case where we have a phi-of-ops which goes away. 2017-08-03 21:17:49 +00:00
pr33204.ll NewGVN: Fix PR33204 - We need to add memory users when we bypass memorydefs for loads, not just when we do it for stores. 2017-08-26 07:37:11 +00:00
pr33305.ll Fix PR/33305. caused by trying to simplify expressions in phi of ops that should have no leaders. 2017-09-02 02:18:44 +00:00
pr33367.ll NewGVN: Fix PR/33367, which was causing us to delete non-copy intrinsics accidentally in some rare cases 2018-01-09 20:12:42 +00:00
pr33432.ll Fix PR/33305. caused by trying to simplify expressions in phi of ops that should have no leaders. 2017-09-02 02:18:44 +00:00
pr33461.ll NewGVN: Evaluate phi of ops expressions before creating phi node 2017-09-30 23:51:54 +00:00
pr33720.ll [NewGVN] Check for congruency of memory accesses. 2017-07-11 19:49:12 +00:00
pr34135.ll NewGVN: Make sure we don't incorrectly use PredicateInfo when doing PHI of ops 2017-09-01 19:20:18 +00:00
pr34430.ll NewGVN: Fix PR 34430 - we need to look through predicateinfo copies to detect self-cycles of phi nodes. We also need to not ignore certain types of arguments when testing whether the phi has a backedge or was originally constant. 2017-09-05 02:17:43 +00:00
pr34452.ll NewGVN: Fix PR 34452 by passing instruction all the way down when we do aggregate value simplification 2017-09-05 02:17:42 +00:00
pr35125.ll [NewGVN] Stop assuming PHI args ordering when looking at phi-of-ops. 2017-10-30 20:20:16 +00:00
pre-compare.ll
pre-new-inst.ll
predicates.ll
propagate-ir-flags.ll
range.ll
readattrs.ll
refine-stores.ll
rle-must-alias.ll
rle-no-phi-translate.ll
rle-nonlocal.ll
rle.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
stale-loop-info.ll
storeoverstore.ll NewGVN: Evaluate phi of ops expressions before creating phi node 2017-09-30 23:51:54 +00:00
tbaa.ll [Analysis] Generate more precise TBAA tags when one access encloses the other 2017-12-18 20:05:20 +00:00
unreachable_block_infinite_loop.ll
verify-memoryphi.ll [NewGVN] Fix verification of MemoryPhis in verifyMemoryCongruency(). 2017-05-15 18:50:53 +00:00
volatile-nonvolatile.ll