Prevent duplicate array type insertion into TypeMap.#3186
Prevent duplicate array type insertion into TypeMap.#3186vmaksimo merged 5 commits intoKhronosGroup:mainfrom
Conversation
|
@svenvh can you take a look too? |
|
As far as I understand, the point of the assertion is not to prevent duplication in the map itself, but to warn if duplication would have happened. This was added by @MrSidims in #1047 so it would be good to have his opinion too. That said, I think this might have been an issue with non-opaque pointers only, which is now past us, so maybe we indeed no longer need this check? |
@MrSidims is OOO for a few days now. If no strong opposition, I'd like to have this merged and follow up with him later, if he has any concerns. |
|
I'll try to remind myself why this commented assertion was added, but basically the current status is "the type mapping issue" (whatever it is) is not resolved. |
|
Btw, llvm-spirv pointer types map is currently bugged. And I'm the one who has introduced it in https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/2650/files#diff-8865333527b4a0615ba95940c2a69e7a9607b6dfc696408bb9501d38aa762569R1008 <- there is no SPIR-V spec restriction of not having 2 or more identical |
At least one of the issues we have recently observed triggers when calling |
|
Digging a little bit deeper, the error comes from The first array (Id 28 of the code of my previous comment) has the following LLVM Type: I think we can solve this by adding a check in this branch to see if the type already exists in the map before calling |
@maarquitos14 makes total sense to me, let's try this approach :) |
Check if an array type exists in TypeMap before inserting it to prevent duplications.