PATCH] ARM NEON Lowering: Merge extractelt, bitcast, sitofp sequence

Arnold Schwaighofer aschwaighofer at apple.com
Fri Feb 15 11:16:35 PST 2013


On Feb 15, 2013, at 11:41 AM, Jakob Stoklund Olesen <jolesen at apple.com> wrote:

> 
> On Feb 15, 2013, at 5:06 AM, Arnold <aschwaighofer at apple.com> wrote:
> 
>> No, those are not generic copies ie COPY, INSERT_SUBREG, etc (but opaque machineinstrs by the time they get to coalescing/ allocation) that is why the coalescer/allocator can not reason about them.
>> 
>> What I am doing in this patch is to use instructions that the coalescer/allocator can understand.
> 
> Right, the coalescer only understands the generic copies.
> 
> EXTRACT_SUBREG, INSERT_SUBREG, COPY_TO_REGCLASS, and REG_SEQUENCE are all converted into COPY instructions before they reach the coalescer which can handle SUBREG_TO_REG and COPY instructions.
> 
> In most cases, COPY_TO_REGCLASS shouldn't be required any longer. InstrEmitter knows how to restrict to a subclass that supports ssub0 sub-registers, for example.
> 

Okay. 

> Did you try matching just the (f32 (bitconvert (extractelt ...))) sub-pattern? That could catch other cases where isel wants to copy i32s to the integer registers.
> 


I think I am minimal now. I don't think I can get rid of the last remaining COPY_TO_REGCLASS. I think it needs to be there to assure the table gen type checker that we are all good copying from a (2xi32 DPRS:%src) to a (2f32 DPR:$src). But maybe there is a way. I am not sure what other instruction I could use that does not result in a real assembly instruction being generated (like a bitcast would).

def : Pat<(f32 (bitconvert (i32 (extractelt (v2i32 DPR:$src), imm:$lane)))),
          (f32 (EXTRACT_SUBREG
                (v2f32 (COPY_TO_REGCLASS (v2i32 DPR:$src), DPR)),    // <<< HERE
                (SSubReg_f32_reg imm:$lane)))>;


Thanks,
Arnold

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ARM-NEON-Merge-a-f32-bitcast-of-a-v2i32-extractelt.patch
Type: application/octet-stream
Size: 2745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130215/b2ca7382/attachment.obj>


More information about the llvm-commits mailing list