[all-commits] [llvm/llvm-project] c889f5: TwoAddressInstructions: Fix subranges straddling t...
Matt Arsenault via All-commits
all-commits at lists.llvm.org
Tue Sep 29 13:40:51 PDT 2026
Branch: refs/heads/users/arsenm/codegen/twoaddr-insert-subreg-refine-subranges
Home: https://github.com/llvm/llvm-project
Commit: c889f5335c5ebb9e782bd845e338ba8758bcb8be
https://github.com/llvm/llvm-project/commit/c889f5335c5ebb9e782bd845e338ba8758bcb8be
Author: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: 2026-09-29 (Tue, 29 Sep 2026)
Changed paths:
M llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
A llvm/test/CodeGen/AMDGPU/twoaddr-insert-subreg-subrange.mir
M llvm/test/CodeGen/PowerPC/dmr-enable.ll
A llvm/test/CodeGen/RISCV/twoaddr-insert-subreg-subrange.mir
M llvm/test/CodeGen/Thumb2/mve-vst2.ll
M llvm/test/CodeGen/Thumb2/mve-vst3.ll
Log Message:
-----------
TwoAddressInstructions: Fix subranges straddling the INSERT_SUBREG subreg index
Rewriting INSERT_SUBREG into a subregister COPY narrows the def from the
whole register down to one subreg index. The live interval fixup for that
only handled subranges entirely disjoint from the inserted lane mask, so a
partially overlapping subrange keeps a value whose def no longer writes all
of its lanes.
The stale value makes the lanes outside the inserted subregister look
defined by the COPY, so the copy that actually provides them ends up dead
and its value is lost. Refine the subranges against the subreg index before
narrowing the def, leaving each one either fully redefined by the COPY or
untouched by it.
Fixes a miscompile reported on RISC-V and restores the pre-6286f77214be
output of Thumb2/mve-vst2.ll, Thumb2/mve-vst3.ll and PowerPC/dmr-enable.ll.
Co-Authored-By: Claude Opus 5 <noreply at anthropic.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