1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/test
Alexey Lapshin 28ca22b845 [TRE] Reland: allow TRE for non-capturing calls.
The D82085 "allow TRE for non-capturing calls" caused failure during bootstrap.
This patch does the same as D82085 plus fixes bootstrap error.

The problem with D82085 is that it does not create copies for byval
operands, while replacing function call with a branch.

Consider following example:

```
    int zoo ( S p1 );

    int foo ( int count, S p1 ) {
      if ( count > 10 )
        return zoo(p1);

      // temporarily variable created for passing byvalue parameter
      // p1 could be used when zoo(p1) is called(after TRE is done).
      // lifetime.start p1.byvalue.temp
      return foo(count+1, p1);
      // lifetime.end p1.byvalue.temp
    }
```

After recursive call to foo is replaced with a jump into
start of the function, its parameters could be passed to
zoo function. i.e. temporarily variable created for byvalue
parameter "p1" could be passed to zoo. Finally zoo receives
broken operand:

```
    int foo ( int count, S p1 ) {
    :tailrecurse
      p1_tr = phi p1, p1.byvalue.temp
      if ( count > 10 )
        return zoo(p1_tr);

      // temporarily variable created for passing byvalue parameter
      // p1 could be used when zoo(p1) is called(after TRE is done).
      lifetime.start p1.byvalue.temp
      memcpy (p1.byvalue.temp, p1_tr)
      count = count + 1
      lifetime.end p1.byvalue.temp
      br tailrecurse
    }
```

To prevent using p1.byvalue.temp after its scope finished by
lifetime.end marker this patch copies value from p1.byvalue.temp
into another temporarily variable and then copies this variable
into the input parameter for next iteration.

This patch passes bootstrap build and bootstrap build with AddressSanitizer.

Differential Revision: https://reviews.llvm.org/D85614
2021-05-25 11:35:48 +03:00
..
Analysis Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
Assembler [Verifier] Move some atomicrmw/cmpxchg checks to instruction creation 2021-05-21 13:41:17 -07:00
Bindings
Bitcode Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
BugPoint
CodeGen [RISCV] Optimize xor/or with immediate in the zbs extension 2021-05-25 14:14:09 +08:00
DebugInfo [WebAssembly] Add NullifyDebugValueLists pass 2021-05-24 11:36:01 -07:00
Demangle [Demangle][Rust] Parse function signatures 2021-05-22 11:49:08 +02:00
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
Integer
JitListener Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
Linker Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
LTO Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
MachineVerifier
MC Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
Object
ObjectYAML
Other Making Instrumentation aware of LoopNest Pass 2021-05-24 20:25:52 -07:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen
ThinLTO/X86
tools [CSSPGO][llvm-profgen] Report samples for untrackable frames. 2021-05-24 12:39:12 -07:00
Transforms [TRE] Reland: allow TRE for non-capturing calls. 2021-05-25 11:35:48 +03:00
Unit
Verifier [OpaquePtr] Make atomicrmw work with opaque pointers 2021-05-19 12:49:28 -07:00
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg.py
lit.site.cfg.py.in
TestRunner.sh