[all-commits] [llvm/llvm-project] 786ba3: [LLVM][AutoUpgrade] Support default args on undecl...

Dharuni R Acharya via All-commits all-commits at lists.llvm.org
Tue Sep 8 21:18:28 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 786ba30e072e92648840ddbb5bc3f76e0af35b07
      https://github.com/llvm/llvm-project/commit/786ba30e072e92648840ddbb5bc3f76e0af35b07
  Author: Dharuni R Acharya <125176188+DharuniRAcharya at users.noreply.github.com>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M llvm/include/llvm/IR/Intrinsics.td
    M llvm/lib/IR/AutoUpgrade.cpp
    M llvm/utils/TableGen/Basic/CodeGenIntrinsics.cpp
    M llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp

  Log Message:
  -----------
  [LLVM][AutoUpgrade] Support default args on undeclared multi-call upgrades (#216246)

When an `.ll` file contains multiple calls to an intrinsic without an explicit
declaration, only the first call is upgraded successfully, and the remaining
subsequent calls fail.

`LLParser` builds one temporary Function per call, so after the first
upgrade occupies the canonical name the later functions are uniquified
(eg. `llvm.foo.1`). The intrinsic ID was previously looked up using `F->getName()`,
which requires an exact name match. So, the uniquified names resolved to `not_intrinsic`, 
causing the upgrade to return and the default arguments were not applied.

This patch fixes this issue by using the cached `F->getIntrinsicID()`,
which is set when the temporary function is created from the original name. 
It also `rename(F)` before inserting the full declaration, so the temporary
function no longer occupies the canonical name.

---------

Signed-off-by: DharuniRAcharya <dharunira at nvidia.com>



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