[all-commits] [llvm/llvm-project] 0ffe83: [SelectionDAG] Not issue TRAP node if naked functi...

yonghong-song via All-commits all-commits at lists.llvm.org
Thu Mar 20 18:18:24 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ffe83feaca02cf1c7a25c559c72cc16813a2f86
      https://github.com/llvm/llvm-project/commit/0ffe83feaca02cf1c7a25c559c72cc16813a2f86
  Author: yonghong-song <yhs at fb.com>
  Date:   2025-03-20 (Thu, 20 Mar 2025)

  Changed paths:
    M llvm/include/llvm/IR/Instructions.h
    M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
    M llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/IR/Instructions.cpp
    M llvm/test/CodeGen/WebAssembly/naked-fn-with-frame-pointer.ll
    A llvm/test/CodeGen/X86/naked-fn-with-unreachable-trap.ll

  Log Message:
  -----------
  [SelectionDAG] Not issue TRAP node if naked function (#132147)

In [1], Nikita Popov suggested that during lowering 'unreachable' insn
should not generate extra code for naked functions, and this applies to
all architectures. Note that for naked functions, 'unreachable' insn is
necessary in IR since the basic block needs a terminator to end.

This patch checked whether a function is naked function or not. If it is
a naked function, 'unreachable' insn will not generate ISD::TRAP.

  [1] https://github.com/llvm/llvm-project/pull/131731

Co-authored-by: Yonghong Song <yonghong.song at linux.dev>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list