HomePhabricator

[TwoAddressInstructionPass] Replace subregister uses when processing tied…

Authored by bjope on Oct 15 2018, 1:36 AM.

Description

[TwoAddressInstructionPass] Replace subregister uses when processing tied operands

Summary:
TwoAddressInstruction pass typically rewrites

%1:short = foo %0.sub_lo:long

as

%1:short = COPY %0.sub_lo:long
%1:short = foo %1:short

when having tied operands.

If there are extra un-tied operands that uses the same reg and
subreg, such as the second and third inputs to fie here:

%1:short = fie %0.sub_lo:long, %0.sub_hi:long, %0.sub_lo:long

then there was a bug which replaced the register %0 also for
the un-tied operand, but without changing the subregister indices.
So we used to get:

%1:short = COPY %0.sub_lo:long
%1:short = fie %1, %1.sub_hi:short, %1.sub_lo:short

With this fix we instead get:

%1:short = COPY %0.sub_lo:long
%1:short = fie %1, %0.sub_hi:long, %1

Reviewers: arsenm, JesperAntonsson, kparzysz, MatzeB

Reviewed By: MatzeB

Subscribers: bjope, kparzysz, wdng, llvm-commits

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

llvm-svn: 344492

Details

Committed
bjopeOct 15 2018, 1:36 AM
Reviewer
MatzeB
Differential Revision
D36224: [TwoAddressInstructionPass] Replace subregister uses when processing tied operands
Parents
rGb44b22c6fe19: [X86] Autogenerate checks. NFC
Branches
Unknown
Tags
Unknown