Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NVPTX] Remove NOP definition #65967

Closed
wants to merge 0 commits into from
Closed

[NVPTX] Remove NOP definition #65967

wants to merge 0 commits into from

Conversation

ldrumm
Copy link
Contributor

@ldrumm ldrumm commented Sep 11, 2023

PTX has no NOP instruction, and it's unused anywhere in the compiler. This looks like it might have been added for machine scheduling, but it looks unused.

If we eventually need it, we can add it back.

Copy link
Contributor

@pasaulais pasaulais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link
Member

@Artem-B Artem-B left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@walter-erquinigo
Copy link
Member

Hey! I hope you guys (@ldrumm , @Artem-B , @pasaulais ) can shed some light for me:
My team is working on improving debug info for the Mojo language when compiling for NVIDIA GPUs, and having a nop instruction would be a very nice way to force create some line table entries that would help debuggability of inlined function callsites.
So, are nops available in the HW, in which case we could revert this PR? Or are nops just gone and we need to figure out a workaround?
cc: @zyx-billy

@ldrumm
Copy link
Contributor Author

ldrumm commented May 3, 2024

PTX is a virtual ISA, and this document does not specify a NOP instruction. There might be a NOP instruction on a per-GPU hardware ISA basis, but we only target the publicly documented PTX. Once that goes through the PTX compiler, ptxas, it's out of llvm's hands.

You could probably emulate a nop via a register mov to self, or an (| 0) construction, but seeing as the PTX compiler runs fairly aggressive optimizations, my guess is this won't work.

@ldrumm
Copy link
Contributor Author

ldrumm commented May 3, 2024

To be clear, if the PTX ISA specified a nop instruction, I'd happily revert this patch, but it doesn't - which is why it made sense in the first place

@walter-erquinigo
Copy link
Member

Thank you for the clarification. This is very useful information to us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants