1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/lib
Heejin Ahn 5217fbac0b [WebAssembly] Fix fixEndsAtEndOfFunction for delegate
Background:
CFGStackify's [[ 398f253400/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp (L1481-L1540) | fixEndsAtEndOfFunction ]] fixes block/loop/try's return
type when the end of function is unreachable and the function return
type is not void. So if a function returns i32 and `block`-`end` wraps the
whole function, i.e., the `block`'s `end` is the last instruction of the
function, the `block`'s return type should be i32 too:
```
block i32
  ...
end
end_function
```

If there are consecutive `end`s, this signature has to be propagate to
those blocks too, like:
```
block i32
  ...
  block i32
    ...
  end
end
end_function
```

This applies to `try`-`end` too:
```
try i32
  ...
catch
  ...
end
end_function
```

In case of `try`, we not only follow consecutive `end`s but also follow
`catch`, because for the type of the whole `try` to be i32, both `try`
and `catch` parts have to be i32:
```
try i32
  ...
  block i32
    ...
  end
catch
  ...
  block i32
    ...
  end
end
end_function
```

---

Previously we only handled consecutive `end`s or `end` before a `catch`.
But now we have `delegate`, which serves like `end` for
`try`-`delegate`. So we have to follow `delegate` too and mark its
corresponding `try` as i32 (the function's return type):
```
try i32
  ...
catch
  ...
  try i32    ;; Here
    ...
  delegate N
end
end_function
```

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D101036
2021-04-22 15:32:00 -07:00
..
Analysis [SCEV] Compute ranges for lshr recurrences 2021-04-22 11:06:31 -07:00
AsmParser [LLParser] Print mismatched types in error message 2021-04-21 13:10:37 -07:00
BinaryFormat [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
Bitcode [Bitcode] Ensure DIArgList in bitcode has no null or forward metadata refs 2021-04-22 12:03:33 +01:00
Bitstream
CodeGen [RISCV] Fix crash with fptosi.sat/fptoui.sat intrinsics on RV64. Add test cases. 2021-04-22 15:18:15 -07:00
DebugInfo Fix bug in .eh_frame/.debug_frame PC offset calculation for DW_EH_PE_pcrel 2021-04-15 15:06:20 +04:00
Demangle Fix memory leak in MicrosoftDemangleNodes's Node::toString 2021-04-22 18:44:30 +02:00
DWARFLinker [dsymutil] Stop emulating dsymutil-classic CIE caching behavior 2021-04-06 20:15:41 -07:00
ExecutionEngine Revert "Allow invokable sub-classes of IntrinsicInst" 2021-04-20 15:38:38 -07:00
Extensions
FileCheck Fix PR46880: Fail CHECK-NOT with undefined variable 2021-04-20 14:42:46 +01:00
Frontend [OpenMP IRBuilder, MLIR] Add support for OpenMP do schedule dynamic 2021-04-16 16:09:49 +01:00
Fuzzer
FuzzMutate [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
InterfaceStub [elfabi] Fix a bug when .dynsym contains no non-local symbol 2021-02-19 11:36:53 -08:00
IR [LoopVectorize] Don't create unnecessary vscale intrinsic calls 2021-04-22 09:01:52 +01:00
IRReader [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
LineEditor
Linker Reapply "OpaquePtr: Turn inalloca into a type attribute" 2021-03-29 08:55:30 -04:00
LTO [Support] Don't include VirtualFileSystem.h in CommandLine.h 2021-04-21 10:19:01 -04:00
MC [AsmParser][ms][X86] Fix possible misbehaviour in parsing of special tokens at start of string. 2021-04-21 10:21:09 -04:00
MCA [MCA][LSUnit] Fix a potential use after free in the logic that updates memory groups. 2021-04-20 13:30:45 +01:00
Object [TextAPI] move source code files out of subdirectory, NFC 2021-04-05 10:24:42 -07:00
ObjectYAML [yaml2obj/obj2yaml/llvm-readobj] Support printing and parsing AVR-specific e_flags 2021-04-15 15:54:28 +02:00
Option [clang][cli] NFC: Remove ArgList infrastructure for recording queries 2021-02-25 13:53:24 +01:00
Passes [NewPM] Mark some more wrapper passes as ignored 2021-04-21 23:55:02 -07:00
ProfileData [CSSPGO][llvm-profdata] Support trimming cold context when merging profiles 2021-04-22 00:42:37 -07:00
Remarks [Support] Don't include VirtualFileSystem.h in CommandLine.h 2021-04-21 10:19:01 -04:00
Support Temporarily revert the code part of D100981 "Delete le32/le64 targets" 2021-04-22 10:18:44 -07:00
TableGen [TableGen] Add support for the 'assert' statement in multiclasses 2021-04-19 09:01:42 -04:00
Target [WebAssembly] Fix fixEndsAtEndOfFunction for delegate 2021-04-22 15:32:00 -07:00
Testing [SystemZ][z/OS] Add IsText Argument to GetFile and GetFileOrSTDIN 2021-04-16 10:08:36 -04:00
TextAPI [TextAPI] move source code files out of subdirectory, NFC 2021-04-05 10:24:42 -07:00
ToolDrivers [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
Transforms [dfsan] Fix Len argument type in call to __dfsan_mem_transfer_callback 2021-04-22 21:12:20 +00:00
WindowsManifest
XRay
CMakeLists.txt