[all-commits] [llvm/llvm-project] c167c0: [BuildLibCalls] infer inreg param attrs from NumRe...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Tue May 10 16:36:25 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c167c0a4dcdb998affb2756ce76903a12f7d8ca5
      https://github.com/llvm/llvm-project/commit/c167c0a4dcdb998affb2756ce76903a12f7d8ca5
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2022-05-10 (Tue, 10 May 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/BuildLibCalls.cpp
    A llvm/test/Transforms/InstCombine/simplify-libcalls-inreg.ll

  Log Message:
  -----------
  [BuildLibCalls] infer inreg param attrs from NumRegisterParameters

We're having a hard time booting the ARCH=i386 Linux kernel with clang
after removing -ffreestanding because instcombine was dropping inreg
from callers during libcall simplification, but not the callees defined
in different translation units. This led the callers and callees to have
wildly different calling conventions, which (predictably) blew up at
runtime.

Infer the inreg param attrs on function declarations from the module
metadata "NumRegisterParameters." This allows us to boot the ARCH=i386
Linux kernel (w/ -ffreestanding removed).

Fixes: https://github.com/llvm/llvm-project/issues/53645

Reviewed By: efriedma

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




More information about the All-commits mailing list