[all-commits] [llvm/llvm-project] 81ba00: [X86] nocf_check: disable tail call

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Mar 16 16:18:36 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 81ba006296680c9d62aba12c5e3f083e2f7c595d
      https://github.com/llvm/llvm-project/commit/81ba006296680c9d62aba12c5e3f083e2f7c595d
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-03-16 (Sun, 16 Mar 2025)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLoweringCall.cpp
    M llvm/test/CodeGen/X86/nocf_check.ll

  Log Message:
  -----------
  [X86] nocf_check: disable tail call

When a function pointer is annotated with
`void (*fptr)(void) __attribute__((nocf_check));`, calling it should use
the NOTRACK prefix, as the callee may not contain an ENDBR.

https://reviews.llvm.org/D41879 implemented NOTRACK variants for
X86ISD::CALL and ISD::BRIND but not for TCRETURN. Given that there are
so many tail call variants (e.g. conditional tailcall
https://reviews.llvm.org/D29856), let's just disable tailcall.
While nocf_check has some uses within the Linux kernel, it isn't a
popular attribute.

Fix #91228

Pull Request: https://github.com/llvm/llvm-project/pull/131487



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