diff options
author | Alon Zakai <azakai@google.com> | 2021-09-10 10:03:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 10:03:16 -0700 |
commit | ea74b4f8649dfa6c8775fcef829d115083e5acc9 (patch) | |
tree | cd7385b6a2a68c4ef400ec687240ec1d9de610dd | |
parent | 96f7acf09aae1ec6e8bc573dfa8f309c4f892a40 (diff) | |
download | binaryen-ea74b4f8649dfa6c8775fcef829d115083e5acc9.tar.gz binaryen-ea74b4f8649dfa6c8775fcef829d115083e5acc9.tar.bz2 binaryen-ea74b4f8649dfa6c8775fcef829d115083e5acc9.zip |
[NFC] Add a comment in MergeBlocks about subtyping (#4142)
Followup to #4137
-rw-r--r-- | src/passes/MergeBlocks.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/passes/MergeBlocks.cpp b/src/passes/MergeBlocks.cpp index 4c58883f0..9d797ae0a 100644 --- a/src/passes/MergeBlocks.cpp +++ b/src/passes/MergeBlocks.cpp @@ -467,8 +467,14 @@ struct MergeBlocks // fancy here return outer; } - // we are going to replace the block with the final element, so they - // should be identically typed + // We are going to replace the block with the final element, so they + // should be identically typed. Note that we could check for subtyping + // here, but it would not help in the general case: we know that this + // block has no breaks (as confirmed above), and so the local-subtyping + // pass will turn its type into that of its final element, if the final + // element has a more specialized type. (If we did want to handle that, + // we'd need to then run a ReFinalize after everything, which would add + // more complexity here.) if (block->type != back->type) { return outer; } |