[all-commits] [llvm/llvm-project] 18ef19: [TwoAddressInstruction] Drop physreg ranges after ...

Vitaly Buka via All-commits all-commits at lists.llvm.org
Wed Sep 30 00:10:34 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 18ef19fb83d9d3fa369481bb0537be4fdf5552fb
      https://github.com/llvm/llvm-project/commit/18ef19fb83d9d3fa369481bb0537be4fdf5552fb
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    M llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
    A llvm/test/CodeGen/X86/twoaddr-unfold-load-eflags-liveintervals.mir

  Log Message:
  -----------
  [TwoAddressInstruction] Drop physreg ranges after unfolding a load (#227538)

Since #225174 LiveIntervals is computed before TwoAddressInstructions.
When tryInstructionTransform() unfolds a load, e.g. OR64rm into
MOV64rm + OR64rr, it calls repairIntervalsInRange(). That function
only repairs virtual registers. If the regunit range of a physreg def
of the original instruction ($eflags here) was already cached, it
keeps a value defined at the slot of the erased instruction.

The machine verifier then reports "No instruction at VNInfo def index"
and later passes hit `LR.verify()` in LiveIntervals::HMEditor. This
broke the MSan bootstrap build of clang/lib/Sema/SemaAPINotes.cpp.

Drop the cached regunit ranges for the physregs of the unfolded
instruction so they are recomputed on demand. MachineBasicBlock.cpp
already does the same after repairIntervalsInRange().

Assisted-by: Gemini



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