Open bashbaug opened 1 week ago
Thanks for the detailed report @bashbaug!
I've gone with a minimal fix for the first issue in https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/2770 ; more thorough validation should be spirv-val
's job.
For the second issue, I expect that we can treat OpCopyMemory
pretty much like OpCopyMemorySized
indeed.
Reverse translation (from SPIR-V to LLVM) does not appear to be working propery for
OpCopyMemory
. Note thatOpCopyMemorySized
is working correctly, and there do not appear to be any tests forOpCopyMemory
.I am encountering two problems with the following tester (note: this is an except of a test for the SPIR-V 1.4 feature where
OpCopyMemor
y can accept two optional memory operands):The asserts are incorrect in
SPIRV::SPIRVCopyMemory::validate
, because they are checkingId
, but this instruction does not set anId
. This one is pretty easy to fix - something like:There is no special handling for
OpCopyMemory
(there is forOpCopyMemorySized
), so translatingOpCopyMemory
falls into the defaulttransSPIRVBuiltinFromInst
, which does not work properly. I suspect thatOpCopyMemory
should be lowered into a call tollvm.memcpy
, similar toOpCopyMemorySized
, but the size will be dependent on the pointed-to types vs. provided explicitly.Once these problems are fixed we should add some tests for
OpCopyMemory
also.