[PATCH] D45990: GlobalISel/InstructionSelector: Implement GIR_CopyFConstantAsFPImm

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 1 11:51:17 PDT 2018


dsanders added a comment.

In https://reviews.llvm.org/D45990#1084328, @tstellar wrote:

> In https://reviews.llvm.org/D45990#1084322, @dsanders wrote:
>
> > In https://reviews.llvm.org/D45990#1084299, @tstellar wrote:
> >
> > > I actually don't have a test case of this.  I really just need the enum defined so AMDGPUGenGlobalIsel.inc will build.  I can drop the implementation and just add the enum value if you prefer.
> >
> >
> > Could you send me the comment that's shortly before the GIR_CopyFConstantAsFPImm in AMDGPUGenGlobalIsel.inc? It should look similar to a tablegen pattern and we can probably derive a test case from that. I'm not sure which rule has been imported but I'm hoping it will be something like (set $rd:GPR, $imm:fpimm) in which case the test would be similar to test/CodeGen/AArch64/GlobalISel/select-constant.mir.
>
>
> Here is the comment. Note that the reason I don't have a test case is because this pattern is only for the R600 sub-target and I'm not implementing global-isel for that sub-target:
>
>   // MIs[0] Operand 1
>   // No operand predicates
>   // (fpimm:{ *:[f32] }):$val  =>  (MOV_IMM_F32:{ *:[f32] } (fpimm:{ *:[f32] }):$val)
>   GIR_BuildMI, /*InsnID*/0, /*Opcode*/AMDGPU::MOV_IMM_F32,
>   GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
>   GIR_CopyFConstantAsFPImm, /*NewInsnID*/0, /*OldInsnID*/0, // va


Thanks, something similar select-constant.mir would do the trick for that one but seeing as it's for a target that you aren't implementing it makes sense to go ahead without it. I think we might as well keep the implementation seeing as we have it but could you add a TODO indicating that it needs a test case as soon as one is possible?


Repository:
  rL LLVM

https://reviews.llvm.org/D45990





More information about the llvm-commits mailing list