[LLVMdev] [llvm-commits] [PATCH] MachineRegisterInfo: Don't emit the same livein copy more than once

Stellard, Thomas
2012-02-14T03:03:35Z

This patch seems to have been lost on the llvm-commits mailing list.  Would
someone be able to review it?

Thanks,
Tom
________________________________________
From: llvm-commits-bounces at cs.uiuc.edu [llvm-commits-bounces at cs.uiuc.edu]
on behalf of Tom Stellard [thomas.stellard at amd.com]
Sent: Friday, February 03, 2012 1:55 PM
To: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] [PATCH] MachineRegisterInfo: Don't emit the same
livein copy more than once

On Fri, Jan 27, 2012 at 02:56:03PM -0500, Tom Stellard
wrote:
> ---
>
> Is MachineRegisterInfo::EmitLiveInCopies() only meant to be called once
> per compile?  If I call it more than once, it emits duplicate copies
> which causes the live interval analysis to fail.
>
>  lib/CodeGen/MachineRegisterInfo.cpp |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/lib/CodeGen/MachineRegisterInfo.cpp
b/lib/CodeGen/MachineRegisterInfo.cpp
> index 266ebf6..fc787f2 100644
> --- a/lib/CodeGen/MachineRegisterInfo.cpp
> +++ b/lib/CodeGen/MachineRegisterInfo.cpp
> @@ -227,7 +227,9 @@ MachineRegisterInfo::EmitLiveInCopies(MachineBasicBlock
*EntryMBB,
>          // complicated by the debug info code for arguments.
>          LiveIns.erase(LiveIns.begin() + i);
>          --i; --e;
> -      } else {
> +        //Make sure we don't emit the same livein copies twice, in
case this
> +        //function is called more than once.
> +      } else if (def_empty(LiveIns[i].second)) {
>          // Emit a copy.
>          BuildMI(*EntryMBB, EntryMBB->begin(), DebugLoc(),
>                  TII.get(TargetOpcode::COPY), LiveIns[i].second)
> --
> 1.7.6.4
>
>

Reposting this as a diff that can be applied via patch -P0 for SVN
users.

-Tom