[all-commits] [llvm/llvm-project] 8fa680: [win][aarch64] Called globals must match for instr...

Daniel Paoliello via All-commits all-commits at lists.llvm.org
Tue Jan 13 15:34:31 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fa680b9d94ad3f3f04d9c0e60485ed546463c94
      https://github.com/llvm/llvm-project/commit/8fa680b9d94ad3f3f04d9c0e60485ed546463c94
  Author: Daniel Paoliello <danpao at microsoft.com>
  Date:   2026-01-13 (Tue, 13 Jan 2026)

  Changed paths:
    M llvm/include/llvm/CodeGen/MachineFunction.h
    M llvm/lib/CodeGen/MachineInstr.cpp
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/test/CodeGen/AArch64/win-import-call-optimization.ll

  Log Message:
  -----------
  [win][aarch64] Called globals must match for instructions to be considered identical (#175798)

When trying to enable AArch64 Import Call Optimization for Windows, we
noticed an issue where a call to an incorrect function was happening
after the loader replaced a branch instruction. The root cause of this
was that LLVM had decided to fold two branch instructions into one as
they were both branches to the same register, however the value of the
register would be different in either path as they were branches for
different imported functions.

This change updates `MachineInstr::isIdenticalTo` to also consider any
"called global" that is attached to the instruction, and will consider
two instructions as "not the same" if the globals differ.

Also fixed a possible source of non-determinism: switched from using a
`DenseMap` to using a `vector` for mapping sections to lists of called
globals (we don't expect many sections, so no need to use a map) and
sort the map by section name before emitting.



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