PATCH: implement printf call lowering in the NVPTX backend

Yuan Lin yulin at nvidia.com
Fri Mar 28 15:56:24 PDT 2014


Eli,

I am sure you are aware this is a very specific pass for translating calls to printf functions for the NVPTX backend with current existing CUDA driver implementation.

With your patch, the NVPTX backend won’t be able to handle the input IR that contains a user defined ‘printf’ function. It will also cause trouble for implementation that implements ‘printf’ as an external llibrary call.

Instead of adding this pass to the NVPTX backend, it would be better to do the translation in the compiler module (e.g. clang or other front-ends) that generates the LLVM IR for the NVPTX backend.

Thanks.

Yuan


From: Eli Bendersky [mailto:eliben at google.com]
Sent: Wednesday, March 26, 2014 9:51 AM
To: llvm-commits at cs.uiuc.edu; Justin Holewinski; Justin Holewinski
Cc: Yuan Lin; Jingyue Wu
Subject: PATCH: implement printf call lowering in the NVPTX backend

Hello,

This patch implements lowering of the printf call to the vprintf syscall in the NVPTX backend. It is implemented as a target-specific IR pass that runs before codegen. The pass builds the required data structure from the varargs to pass to the vprintf calls.

Tests (IR to IR, and IR to PTX) included.

PTAL,
Eli


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140328/68358993/attachment.html>


More information about the llvm-commits mailing list