llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.83k stars 11.46k forks source link

Regression in Clang code generation for coroutines, for Windows/armv7 #100101

Closed mstorsjo closed 1 month ago

mstorsjo commented 1 month ago

f78688134026686288a8d310b493d9327753a022 (#79712) broke Clang code generation for coroutines, when targeting Windows/armv7 (specifically, armv7-mingw32).

With an earlier compiler version, all of libcxx's tests pass. After this change, the following tests in libcxx fail:

Failed Tests (6):
  llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
  llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/expected.pass.cpp
  llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/generator.pass.cpp
  llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/go.pass.cpp
  llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp
  llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp
llvmbot commented 1 month ago

@llvm/issue-subscribers-clang-codegen

Author: Martin Storsjö (mstorsjo)

f78688134026686288a8d310b493d9327753a022 (#79712) broke Clang code generation for coroutines, when targeting Windows/armv7 (specifically, armv7-mingw32). With an earlier compiler version, all of libcxx's tests pass. After this change, the following tests in libcxx fail: ``` Failed Tests (6): llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/expected.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/generator.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/go.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp ```
llvmbot commented 1 month ago

@llvm/issue-subscribers-coroutines

Author: Martin Storsjö (mstorsjo)

f78688134026686288a8d310b493d9327753a022 (#79712) broke Clang code generation for coroutines, when targeting Windows/armv7 (specifically, armv7-mingw32). With an earlier compiler version, all of libcxx's tests pass. After this change, the following tests in libcxx fail: ``` Failed Tests (6): llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/expected.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/generator.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/go.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp llvm-libc++-mingw.cfg.in :: std/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp ```
mstorsjo commented 1 month ago

I managed to figure out what's going on here. It's not a coroutine codegen bug after all, but a linkage issue for the new functions generated by this change; we generated relocations that the linker didn't support, for calls to functions with IR level "private" linkage (which don't seem to be used much elsewhere). See https://github.com/llvm/llvm-project/pull/101828 for a fix, and 1e7f592a890aad860605cf5220530b3744e107ba and https://reviews.llvm.org/D155732 for more context on the same issue as it was originally fixed for AArch64.