Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you explain why this is needed? In usecases I have seen, the entire IR typically transitions from signed to signless types but I have not seen the need for a mixed form, yet.
gpu.memset operations expects both arguments to have the same type:
%0 = arith.constant 0 : ui32 %1 = memef:alloca: memref<ui32> gpu.memset %1, %0 : memref<ui32>, ui32
But there are no constant operations in "standard" dialects that can define unsigned constant, as a work around this memset can be defined with i32 types if we can cast the memref argument.
This seems very undesirable.
memref.reinterpret_cast could be a better place to have this type of behavior as you can also change the sizes, strides etc and would allow richer elemental type changes.
Would it also be possible to turn the target of the memset into a signless int? Is the fact that the memref is unsigned load bearing here or just an artifact?
I agree on cast being the wrong place, as it is concerned with shapes. I wonder why arith.bitcast rules out signed types. That seems the natural home for this, somehow.