llvm-6502/test
Michael Gottesman 0556900b26 [objc-arc] Do not mismatch up retains inside a for loop with releases outside said for loop in the presense of differing provenance caused by escaping blocks.
This occurs due to an alloca representing a separate ownership from the
original pointer. Thus consider the following pseudo-IR:

  objc_retain(%a)
  for (...) {
    objc_retain(%a)
    %block <- %a
    F(%block)
    objc_release(%block)
  }
  objc_release(%a)

From the perspective of the optimizer, the %block is a separate
provenance from the original %a. Thus the optimizer pairs up the inner
retain for %a and the outer release from %a, resulting in segfaults.

This is fixed by noting that the signature of a mismatch of
retain/releases inside the for loop is a Use/CanRelease top down with an
None bottom up (since bottom up the Retain-CanRelease-Use-Release
sequence is completed by the inner objc_retain, but top down due to the
differing provenance from the objc_release said sequence is not
completed). In said case in CheckForCFGHazards, we now clear the state
of %a implying that no pairing will occur.

Additionally a test case is included.

rdar://12969722

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179747 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18 05:39:45 +00:00
..
Analysis X86 cost model: Exit before calling getSimpleVT on non-simple VTs 2013-04-17 20:04:53 +00:00
Archive
Assembler
Bindings/Ocaml
Bitcode
BugPoint
CodeGen This patch teaches x86 fast-isel to generate the native div/idiv instructions 2013-04-17 20:10:13 +00:00
DebugInfo PR15149/r174304 improvement - print hex for unknown dwarf language codes & add a test case 2013-04-17 03:41:36 +00:00
ExecutionEngine Revert r179409 because it caused some warnings and some of the build bots fail. 2013-04-12 22:02:26 +00:00
Feature
FileCheck
Instrumentation Add missing colons to check lines. 2013-04-11 12:41:41 +00:00
Integer Rewrite test/Integer tests to use FileCheck instead of grep 2013-04-08 20:18:15 +00:00
JitListener
Linker Rewrite test/Linker tests to use FileCheck instead of grep. 2013-04-09 16:51:13 +00:00
MC [mips] DSP-ASE move from HI/LO register instructions. 2013-04-18 00:52:44 +00:00
Object llvm-objdump: Don't print contents of BSS sections: it makes no sense and crashes llvm-objdump on relocated objects with large bss 2013-04-16 10:53:11 +00:00
Other
TableGen Allow TableGen DAG arguments to be just a name. 2013-03-24 19:36:51 +00:00
tools Finish templating MachObjectFile over endianness. 2013-04-13 01:45:40 +00:00
Transforms [objc-arc] Do not mismatch up retains inside a for loop with releases outside said for loop in the presense of differing provenance caused by escaping blocks. 2013-04-18 05:39:45 +00:00
Unit Propagate path to ASan/MSan symbolizer into test environment to produce useful reports on errors. 2013-04-04 07:41:00 +00:00
Verifier Rewrite test/Verifier tests to use FileCheck instead of grep 2013-04-08 18:33:51 +00:00
YAMLParser
CMakeLists.txt Add obj2yaml to test dependencies 2013-04-05 07:26:37 +00:00
lit.cfg Remove obsolete object file dumpers 2013-04-12 04:07:13 +00:00
lit.site.cfg.in Add asan/msan to the list of available features in LIT test runner 2013-03-26 08:27:39 +00:00
Makefile This appears to be no longer necessary for the testsuite. 2013-04-17 06:37:30 +00:00
Makefile.tests Remove obsolete object file dumpers 2013-04-12 04:07:13 +00:00
TestRunner.sh