Changes

Summary

  1. Revert "[Coroutines] Move CoroEarly pass to before AlwaysInliner" (details)
  2. [Coroutines] Set presplit attribute in Clang instead of CoroEarly pass (details)
  3. [TableGen] Pass SmallVector to union_modes instead of returning a std::vector. (details)
Commit c0211e8d7d0b797fd11543c3d3f9fecf3b2069cf by lxfind
Revert "[Coroutines] Move CoroEarly pass to before AlwaysInliner"

This reverts commit 2b50f5a4343f8fb06acaa5c36355bcf58092c9cd.
Forgot to update the description of the commit to sync with phabricator. Going to redo the commit.
The file was modifiedclang/lib/CodeGen/CGCoroutine.cpp
The file was removedclang/test/CodeGenCoroutines/coro-always-inline-resume.cpp
The file was modifiedllvm/test/Transforms/Coroutines/restart-trigger.ll
The file was modifiedclang/test/CodeGenCoroutines/coro-always-inline.cpp
The file was modifiedllvm/test/Transforms/Coroutines/ex4.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-debug-O2.ll
The file was modifiedllvm/test/Transforms/Coroutines/ex1.ll
The file was modifiedllvm/test/Transforms/Coroutines/ex2.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-split-01.ll
The file was modifiedllvm/test/Transforms/Coroutines/ex3.ll
The file was modifiedllvm/test/Transforms/Coroutines/ex0.ll
The file was modifiedllvm/test/Transforms/Coroutines/ex5.ll
The file was modifiedllvm/lib/Transforms/Coroutines/CoroEarly.cpp
The file was modifiedllvm/test/Transforms/Coroutines/coro-split-recursive.ll
The file was modifiedllvm/test/Transforms/Coroutines/phi-coro-end.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-debug-frame-variable.ll
Commit fa6b54c44ab1d5f579304eadb7ac8bd7e72d0e77 by lxfind
[Coroutines] Set presplit attribute in Clang instead of CoroEarly pass

Presplit coroutines cannot be inlined. During AlwaysInliner we check if a function is a presplit coroutine, if so we skip inlining.
The presplit coroutine attributes are set in CoroEarly pass.
However in O0 pipeline, AlwaysInliner runs before CoroEarly, so the attribute isn't set yet and will still inline the coroutine.
This causes Clang to crash: https://bugs.llvm.org/show_bug.cgi?id=49920

To fix this, we set the attributes in the Clang front-end instead of in CoroEarly pass.

Reviewed By: rjmccall, ChuanqiXu

Differential Revision: https://reviews.llvm.org/D100282
The file was modifiedllvm/test/Transforms/Coroutines/ex5.ll
The file was modifiedllvm/test/Transforms/Coroutines/phi-coro-end.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-split-01.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-split-recursive.ll
The file was modifiedllvm/test/Transforms/Coroutines/ex2.ll
The file was modifiedllvm/lib/Transforms/Coroutines/CoroEarly.cpp
The file was modifiedllvm/test/Transforms/Coroutines/coro-debug-O2.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-debug-frame-variable.ll
The file was modifiedllvm/test/Transforms/Coroutines/ex1.ll
The file was modifiedclang/test/CodeGenCoroutines/coro-always-inline.cpp
The file was modifiedllvm/test/Transforms/Coroutines/ex3.ll
The file was addedclang/test/CodeGenCoroutines/coro-always-inline-resume.cpp
The file was modifiedllvm/test/Transforms/Coroutines/ex4.ll
The file was modifiedllvm/test/Transforms/Coroutines/restart-trigger.ll
The file was modifiedclang/lib/CodeGen/CGCoroutine.cpp
The file was modifiedllvm/test/Transforms/Coroutines/ex0.ll
Commit b7ddd45081a0bfebb32ab46a7a05ebaf7bc88942 by craig.topper
[TableGen] Pass SmallVector to union_modes instead of returning a std::vector.

The number of modes is small so this should avoid a heap allocation.

Also replace std::set with SmallSet.
The file was modifiedllvm/utils/TableGen/CodeGenDAGPatterns.cpp
The file was modifiedllvm/utils/TableGen/InfoByHwMode.h