1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/Transforms/TailCallElim
Robert Lougher a83e090ac2 [TailCallElim] Enable marking of calls with byval as tails
In r339636 the alias analysis rules were changed with regards to tail calls
and byval arguments. Previously, tail calls were assumed not to alias
allocas from the current frame. This has been updated, to not assume this
for arguments with the byval attribute.

This patch aligns TailCallElim with the new rule. Tail marking can now be
more aggressive and mark more calls as tails, e.g.:

define void @test() {
  %f = alloca %struct.foo
  call void @bar(%struct.foo* byval %f)
  ret void
}

define void @test2(%struct.foo* byval %f) {
  call void @bar(%struct.foo* byval %f)
  ret void
}

define void @test3(%struct.foo* byval %f) {
  %agg.tmp = alloca %struct.foo
  %0 = bitcast %struct.foo* %agg.tmp to i8*
  %1 = bitcast %struct.foo* %f to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 40, i1 false)
  call void @bar(%struct.foo* byval %agg.tmp)
  ret void
}

The problematic case where a byval parameter is captured by a call is still
handled correctly, and will not be marked as a tail (see PR7272).

llvm-svn: 343986
2018-10-08 18:03:40 +00:00
..
2010-06-26-MultipleReturnValues.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
accum_recursion.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
ackermann.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
basic.ll [TailCallElim] Enable marking of calls with byval as tails 2018-10-08 18:03:40 +00:00
debugloc.ll
deopt-bundle.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
dont_reorder_load.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
dup_tail.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
EraseBB.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
inf-recursion.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
notail.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
opt-remarks-recursion.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
reorder_load.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00
setjmp.ll [TailCallElim] Preserve DT and PDT 2018-08-04 08:13:47 +00:00