Hi all, When I approach the class CodeGenC
in src/target/source/codegen_c.h
I notice it could not generate native C code as noted.
CodeGenC does not aim at generating C codes consumed by MSVC or GCC, Rather, it’s providing infrastructural abstraction for C variants like CUDA and OpenCL-C. You might find some odd variant features, e.g., type
int3
for a vector of 3int
s. For native C code generator, seeCodeGenLLVM
.
I’ve already read the class CodeGenLLVM
and LLVMModuleNode
but failed to find any information relevant.
Question “Possible to convert a LLVM IR back to C code?” from @joyalbin got some answers. Does it mean native C code could only be generated by a LLVM backend which has been moved? But @comaniac suggests to directly generate C code from TVM IR. Does it mean CodeGenC
or another way in CodeGenLLVM
?
Thanks.