Xiaochu Liu
2015-Jul-03 00:56 UTC
[LLVMdev] Declare multiple data type for a register class in tblegen
Hi everyone, I tried to declare multiple data type [i64, i32, v2i32] for a 64 bit register class GPR. It works OK but I have one problem that is hard to find. When I tried to map a load instruction of a v2i32 type (LOAD v2i32:$dst) to load GPR, it always generate two LOAD i32 instead of one LOAD v2i32. Any folds understand how this works? Xiaochu -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150703/bbe463bd/attachment.html>
Matt Arsenault
2015-Jul-03 01:12 UTC
[LLVMdev] Declare multiple data type for a register class in tblegen
On 07/02/2015 05:56 PM, Xiaochu Liu wrote:> Hi everyone, > > I tried to declare multiple data type [i64, i32, v2i32] for a 64 bit > register class GPR. It works OK but I have one problem that is hard to > find. > > When I tried to map a load instruction of a v2i32 type (LOAD > v2i32:$dst) to load GPR, it always generate two LOAD i32 instead of > one LOAD v2i32. Any folds understand how this works? > > Xiaochu >You probably haven't called addRegisterClass in the TargetLowering constructor for the vector type. Without it added there, the type legalizer will split the vector load into components -Matt
Xiaochu Liu
2015-Jul-03 01:41 UTC
[LLVMdev] Declare multiple data type for a register class in tblegen
Hi Matt, I did call addRegisterClass in TargetLowering for all the possible types in the register. And for typecasting instructions (i32 to i64), it works. Any other possiblilities? On Thu, Jul 2, 2015 at 6:12 PM Matt Arsenault <Matthew.Arsenault at amd.com> wrote:> On 07/02/2015 05:56 PM, Xiaochu Liu wrote: > > Hi everyone, > > > > I tried to declare multiple data type [i64, i32, v2i32] for a 64 bit > > register class GPR. It works OK but I have one problem that is hard to > > find. > > > > When I tried to map a load instruction of a v2i32 type (LOAD > > v2i32:$dst) to load GPR, it always generate two LOAD i32 instead of > > one LOAD v2i32. Any folds understand how this works? > > > > Xiaochu > > > You probably haven't called addRegisterClass in the TargetLowering > constructor for the vector type. Without it added there, the type > legalizer will split the vector load into components > > -Matt >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150703/45bb46a2/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Declare multiple data type for a register class in tblegen
- [LLVMdev] Declare multiple data type for a register class in tblegen
- [LLVMdev] Declare multiple data type for a register class in tblegen
- extract_vector_elt type mismatch?
- [LLVMdev] vector shuffle emulation/expand in backend?