[PATCH] D148283: [ExecutionEngine] Support TargetExtType in Interpreter
Joshua Cranmer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 6 14:50:29 PDT 2023
jcranmer-intel added a comment.
In D148283#4398589 <https://reviews.llvm.org/D148283#4398589>, @wenju wrote:
> I don't have a test case of global variable with target extension type.
A simple `@global = target("spirv.Event") zeroinitializer` should suffice, combined with a load or store of that global. The point is to make sure that the interpreter can handle a global variable having a target extension type without crashing.
>>> poison value initializers
>
> doe this mean something like "store target("spirv.Event") poison, ptr %event, align 8"?
Yes.
> An alterative approach to this patch is to lower target extension type to its layout type before executing interpreter. I'm proposing this patch as I think it might worth adding natively support of target extension type to interpreter. I don't know if this support will be useful for someone else. There could be cases that target extension type exists in bitcode input of an interpreter.
That's another approach I considered, but I think this approach works a little better. Although you did remind me that there should be a comment somewhere justifying that it is safe to treat the target extension type as its layout type, since the only thing the interpreter is doing is zero-initializing or copying the bits around, and never otherwise inspecting or touching them.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148283/new/
https://reviews.llvm.org/D148283
More information about the llvm-commits
mailing list