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
..
2019-07-09 01:21:04 +00:00
2020-11-20 17:58:26 -05:00
2020-12-04 18:11:35 -08:00
2020-06-17 16:25:50 -07:00
2019-08-28 23:13:43 +00:00
2020-11-13 12:04:48 -08:00
2019-02-28 18:39:08 +00:00
2020-12-08 18:41:32 -08:00
2019-02-28 18:39:08 +00:00
2020-07-06 12:49:50 -07:00
2019-09-18 23:18:16 +00:00
2020-11-20 14:00:46 -05:00
2021-03-24 09:10:11 +01:00
2020-02-18 15:55:20 -08:00
2020-10-29 13:37:55 -07:00
2019-03-30 09:29:57 +00:00
2019-03-29 19:36:51 +00:00
2021-03-04 15:05:13 -08:00
2021-04-22 15:32:00 -07:00
2020-06-03 14:04:59 -07:00
2018-08-27 15:45:51 +00:00
2020-02-13 10:16:06 -08:00
2021-04-06 08:55:27 +01:00
2021-04-06 08:55:27 +01:00
2019-01-14 22:03:43 +00:00
2019-01-14 22:03:43 +00:00
2019-10-15 01:11:51 +00:00
2021-04-16 12:11:20 -07:00
2019-01-08 06:25:55 +00:00
2020-06-15 08:31:56 -07:00
2019-01-18 02:47:48 +00:00
2021-01-07 10:31:38 -08:00
2018-11-19 17:10:36 +00:00
2020-04-16 16:32:17 -07:00
2020-06-04 13:25:10 -07:00
2018-08-27 15:45:51 +00:00
2021-03-04 14:26:35 -08:00
2021-03-04 14:26:35 -08:00
2021-03-01 10:07:05 -08:00
2019-10-09 21:42:08 +00:00
2019-12-11 11:54:57 -08:00
2020-02-18 15:55:20 -08:00
2020-02-18 15:55:20 -08:00
2020-02-18 15:55:20 -08:00
2018-08-27 15:45:51 +00:00
2021-01-28 10:05:29 -08:00
2019-01-08 06:25:55 +00:00
2018-11-19 17:10:36 +00:00
2019-02-23 00:07:39 +00:00
2020-08-08 15:23:11 -07:00
2019-01-08 06:25:55 +00:00
2020-02-18 15:55:20 -08:00
2020-08-26 09:20:46 +01:00
2018-11-19 17:10:36 +00:00
2019-02-23 00:07:39 +00:00
2020-10-07 09:42:49 -07:00
2021-04-22 15:31:09 -07:00
2021-03-24 09:10:11 +01:00
2019-03-01 00:12:13 +00:00
2020-02-18 15:55:20 -08:00
2018-05-10 17:49:11 +00:00
2019-01-09 14:20:20 +00:00
2019-01-08 06:25:55 +00:00
2019-01-09 14:20:20 +00:00
2019-01-08 06:25:55 +00:00
2018-11-19 17:10:36 +00:00
2019-02-23 00:07:39 +00:00
2018-08-27 15:45:51 +00:00
2021-02-04 18:05:06 -08:00
2021-04-19 12:43:59 -07:00
2019-02-01 22:27:34 +00:00
2020-11-20 17:58:26 -05:00
2020-06-11 15:11:45 -07:00
2018-08-27 15:45:51 +00:00
2019-01-08 06:25:55 +00:00
2020-11-18 17:05:58 -08:00
2019-04-26 18:45:04 +00:00
2019-03-19 05:10:39 +00:00
2019-03-30 01:31:11 +00:00
2019-03-30 01:31:11 +00:00
2019-01-08 06:25:55 +00:00
2020-02-18 15:55:20 -08:00
2020-02-18 15:55:20 -08:00
2020-10-29 13:37:55 -07:00
2020-10-29 13:37:55 -07:00
2020-10-29 13:37:55 -07:00
2021-04-08 12:07:38 -07:00
2020-12-04 23:22:47 -08:00
2020-06-15 08:31:56 -07:00
2020-10-07 09:42:49 -07:00
2020-10-07 09:42:49 -07:00
2020-06-20 00:06:39 -07:00
2020-01-23 18:13:52 -08:00
2020-09-25 11:45:16 -07:00
2019-09-03 22:26:49 +00:00
2020-04-09 18:44:50 -07:00
2020-10-07 09:42:49 -07:00
2020-10-08 11:37:19 -07:00
2020-03-26 16:19:02 -07:00
2019-02-23 00:07:39 +00:00
2019-02-23 00:07:39 +00:00
2019-01-29 10:53:42 +00:00
2019-01-29 10:53:42 +00:00
2020-02-18 15:55:20 -08:00
2019-01-14 18:25:29 +00:00
2020-07-06 12:49:50 -07:00
2019-02-23 00:07:39 +00:00
2020-01-17 17:23:56 -08:00
2020-02-18 14:56:09 -08:00
2020-02-18 14:56:09 -08:00
2021-03-03 08:51:21 +01:00
2019-03-29 22:00:18 +00:00
2019-12-24 16:27:51 -08:00
2018-11-18 11:58:47 +00:00
2020-12-08 18:41:32 -08:00
2019-01-08 06:25:55 +00:00
2020-12-30 15:47:16 -08:00
2020-05-04 14:44:39 +01:00
2019-04-23 21:17:03 +00:00
2020-09-06 15:42:21 -07:00
2019-01-14 22:03:43 +00:00
2019-01-31 00:35:37 +00:00
2019-03-21 11:18:54 +00:00
2019-05-13 19:40:18 +00:00
2020-01-24 14:26:27 -08:00
2021-01-09 02:02:54 -08:00
2021-01-09 02:02:54 -08:00
2020-07-15 07:34:22 +00:00
2020-02-18 15:55:20 -08:00
2019-05-23 01:24:01 +00:00
2019-01-08 06:25:55 +00:00
2018-11-19 17:10:36 +00:00
2020-02-18 15:55:20 -08:00
2019-11-15 16:22:01 -08:00
2020-02-18 15:55:20 -08:00
2019-01-08 06:25:55 +00:00
2019-02-23 00:07:39 +00:00
2021-03-18 10:23:12 -07:00
2020-02-04 18:36:32 -08:00
2020-02-04 18:36:32 -08:00
2021-04-09 11:21:49 -07:00
2021-03-31 10:46:17 -07:00
2021-04-09 11:21:49 -07:00
2021-04-20 12:37:13 -07:00
2020-02-04 18:36:32 -08:00
2021-04-14 13:43:09 -07:00
2019-05-23 18:09:26 +00:00
2021-04-16 12:11:20 -07:00
2020-10-15 19:32:34 +00:00
2021-03-18 10:23:12 -07:00
2021-03-18 10:23:12 -07:00
2020-08-03 13:54:00 -07:00
2020-12-22 14:29:06 -08:00
2020-06-03 15:36:44 -07:00
2021-04-19 12:43:59 -07:00
2021-04-11 11:13:16 -07:00
2020-02-04 18:36:32 -08:00
2021-03-31 10:46:17 -07:00
2021-03-18 10:23:12 -07:00
2021-03-18 10:28:29 +00:00
2020-12-22 14:29:06 -08:00
2021-04-14 09:19:27 -07:00
2021-03-18 10:23:12 -07:00
2021-02-04 18:05:06 -08:00
2020-06-25 15:52:44 -07:00
2020-06-03 14:04:59 -07:00
2020-07-08 01:02:05 -07:00
2020-05-14 13:14:45 -07:00
2020-10-29 13:37:55 -07:00
2020-10-29 13:37:55 -07:00
2020-06-15 08:31:56 -07:00
2020-03-19 17:39:52 -07:00
2020-06-11 15:11:45 -07:00
2020-12-23 22:47:36 +07:00
2020-07-30 10:52:16 -07:00
2020-11-20 14:00:46 -05:00
2020-05-08 13:52:39 -07:00
2020-01-24 14:27:35 -08:00
2020-11-13 07:59:29 -08:00
2020-11-13 07:59:29 -08:00
2019-02-23 00:07:39 +00:00
2019-02-23 00:07:39 +00:00
2019-02-23 00:07:39 +00:00
2020-02-18 15:55:20 -08:00
2020-02-18 15:55:20 -08:00
2020-11-03 14:56:25 -08:00
2019-02-26 05:20:19 +00:00
2018-07-02 16:03:49 +00:00
2019-02-28 18:39:08 +00:00
2021-03-04 14:26:35 -08:00
2020-11-19 16:57:00 -08:00