1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/test
Heejin Ahn 229207ad85 [WebAssembly] Fix SSA rebuilding in SjLj transformation
Summary:
Previously we skipped uses within the same BB as a def when rebuilding
SSA after SjLj transformation. For example, before transformation,
```
for.cond:
  %0 = phi i32 [ %var, %for.inc ] ...
  %var = ...
  br label %for.inc

for.inc:                               ; preds = %for.cond
  call i32 @setjmp(...)
  br %for.cond
```

In this BB, %var should be defined in all paths from %for.inc to make %0
valid. In the input it was true; %for.inc's only predecessor was
%for.cond. But after SjLj transformation, it is possible that %for.inc
has other predecessors that are reachable without reaching %for.cond.
```
entry.split:
  ...
  br i1 %a, label %bb.1, label %for.inc

for.cond:
  %0 = phi i32 [ %var, %for.inc ] ...  ; Not valid!
  %var = ...
  br label %for.inc

for.inc:                               ; preds = %for.cond, %entry.split
  call i32 @setjmp(...)
  ...
  br %for.cond
```

In this case, we can't use %var in the `phi` instruction in %for.cond,
because %var is not defined in all paths through %for.inc (If the
control flow is %entry -> %entry.split -> %for.inc -> %for.cond, %var
has not been defined until we reach the `phi`). But the previous code
excluded users within the same BB, skipping instructions within the same
BB so they are not rewritten properly. User instructions within the same
BB also should be candidates for rewriting if they are _before_ the
original definition.

Fixes PR43097.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 369978
2019-08-26 21:51:35 +00:00
..
Analysis Recommit [PowerPC] Update P9 vector costs for insert/extract 2019-08-26 19:26:08 +00:00
Assembler Debug Info: Support for DW_AT_export_symbols for anonymous structs 2019-08-23 17:19:21 +00:00
Bindings
Bitcode
BugPoint
CodeGen [WebAssembly] Fix SSA rebuilding in SjLj transformation 2019-08-26 21:51:35 +00:00
DebugInfo Debug Info: Support for DW_AT_export_symbols for anonymous structs 2019-08-26 20:59:44 +00:00
Demangle
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation
Integer
JitListener
Linker
LTO Revert r369233. 2019-08-23 18:01:13 +00:00
MachineVerifier Remove unnecessary REQUIRES from a test. 2019-08-24 02:39:51 +00:00
MC [AMDGPU] Check for immediate SrcC in mfma in AsmParser 2019-08-23 22:22:49 +00:00
Object
ObjectYAML
Other
Reduce
SafepointIRVerifier
Support
SymbolRewriter
TableGen [GlobalISel] Import patterns containing INSERT_SUBREG 2019-08-26 21:38:57 +00:00
ThinLTO/X86 [ThinLTO] Fix handling of weak interposable symbols 2019-08-23 15:18:58 +00:00
tools [SampleFDO] Add ExtBinary format to support extension of binary profile. 2019-08-23 19:05:30 +00:00
Transforms Preland test cases for D66688 to make diffs clear. 2019-08-26 20:37:06 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg.py
lit.site.cfg.py.in
TestRunner.sh