[Mesa-dev] [PATCH 05/12] radeon/llvm: fix live-in handling for inputs

Tom Stellard thomas.stellard at amd.com
Mon May 7 12:22:26 PDT 2012


On Mon, May 07, 2012 at 09:08:47PM +0400, Vadim Girlin wrote:
> Set the input registers as live-in for entry basic block.
> 
> Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>
> ---
>  src/gallium/drivers/radeon/AMDGPULowerShaderInstructions.cpp |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/gallium/drivers/radeon/AMDGPULowerShaderInstructions.cpp b/src/gallium/drivers/radeon/AMDGPULowerShaderInstructions.cpp
> index d33055c..89e18f0 100644
> --- a/src/gallium/drivers/radeon/AMDGPULowerShaderInstructions.cpp
> +++ b/src/gallium/drivers/radeon/AMDGPULowerShaderInstructions.cpp
> @@ -26,6 +26,9 @@ void AMDGPULowerShaderInstructionsPass::preloadRegister(MachineFunction * MF,
>    if (!MRI->isLiveIn(physReg)) {
>      MRI->addLiveIn(physReg, virtReg);
>      MachineBasicBlock &EntryMBB = MF->front();
> +
> +    // XXX use EmitLiveInCopies instead?

EmitLiveInCopies() isn't meant to be used by the backends, it is only
supposed to be called by the LLVM Instruction Selection passes.

> +    EntryMBB.addLiveIn(physReg);

The preloadRegister() function is duplicated in AMDGPUUtil.cpp as
utilAddLiveIn().  I think this change should go in that function and
then all callers of preloadRegister() should use utilAddLiveIn()
instead.

>      BuildMI(MF->front(), EntryMBB.begin(), DebugLoc(), TII->get(TargetOpcode::COPY),
>              virtReg)
>              .addReg(physReg);


-Tom



> -- 
> 1.7.10.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



More information about the mesa-dev mailing list