truncstore fails in PTX backend

From what I can tell, the truncstore paths all fail instruction selection in the current PTX backend. This is easy to work around for int types >= 16 bits by setting the truncstore action to expand in PTXISelLowering.cpp, but this cannot handle i8 values, since the PTX backend has no register representation for i8s. As a result of all this, it is not possible to store to i8 pointers at all.

PTX does support truncating stores, including to i8s. (ld/st and cvt are the only ops which work with i8 types.)

Is this a known issue?

I'm far from a master of the SelectionDAG infrastructure, though this seems like it should not be a terribly hard addition.

From what I can tell, the truncstore paths all fail instruction selection in the current PTX backend. This is easy to work around for int types >= 16 bits by setting the truncstore action to expand in PTXISelLowering.cpp, but this cannot handle i8 values, since the PTX backend has no register representation for i8s. As a result of all this, it is not possible to store to i8 pointers at all.

PTX does support truncating stores, including to i8s. (ld/st and cvt are the only ops which work with i8 types.)

Is this a known issue?

Yes, this is known. I’ve been too swamped with (mostly) unrelated work the last month or so. It’s on my to-do list, but patches are always welcome. :slight_smile: