[all-commits] [llvm/llvm-project] def864: [Coroutines] Do not add alloca to the frame if the...

Xun Li via All-commits all-commits at lists.llvm.org
Tue May 4 12:56:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: def86413d4c7bd088c3dbf445480a3eb2074da66
      https://github.com/llvm/llvm-project/commit/def86413d4c7bd088c3dbf445480a3eb2074da66
  Author: Xun Li <lxfind at gmail.com>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    A llvm/test/Transforms/Coroutines/coro-zero-alloca.ll

  Log Message:
  -----------
  [Coroutines] Do not add alloca to the frame if the size is 0

This patch is to address https://bugs.llvm.org/show_bug.cgi?id=49916.
When the size of an alloca is 0, it will trigger an assertion in OptimizedStructLayout when being added to the frame.
Fix it by not adding it at all. We return index 0 (beginning of the frame) for all 0-sized allocas.

Differential Revision: https://reviews.llvm.org/D101841




More information about the All-commits mailing list