[all-commits] [llvm/llvm-project] 9dcb00: [funcattrs] check reachability to improve noreturn

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Mon Feb 14 14:02:24 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9dcb0061657e9b7f321fa6c295960c8f829ed6f1
      https://github.com/llvm/llvm-project/commit/9dcb0061657e9b7f321fa6c295960c8f829ed6f1
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2022-02-14 (Mon, 14 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/test/Transforms/FunctionAttrs/noreturn.ll

  Log Message:
  -----------
  [funcattrs] check reachability to improve noreturn

There was a fixme in the code pertaining to attributing functions as
noreturn.  By using reachability, if none of the blocks that are
reachable from the entry return, then the function is noreturn.

Previously, the code only checked if any blocks returned. If they're
unreachable, then they don't matter.

This improves codegen for the Linux kernel.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1563

Reviewed By: nikic

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




More information about the All-commits mailing list