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] support immediate values in st.param instructions #91523

Merged
merged 5 commits into from
May 18, 2024

Conversation

AlexMaclean
Copy link
Member

Add support for generating st.param instructions with direct use of immediates. This eliminates the need for a mov instruction prior to the st.param resulting in more concise emitted PTX.

@AlexMaclean AlexMaclean requested a review from Artem-B May 8, 2024 19:25
@AlexMaclean AlexMaclean self-assigned this May 8, 2024
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.

Just curious -- do we expect to see any benefits from this in SASS?
ptxas usally deals with mov const->register; op(register) just fine and with parameters living mostly in registers, the notion of vectorized loads/stores in parameter space is largely a fiction.

What does this change buy us, other than a few less register moves on PTX level?

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Outdated Show resolved Hide resolved
llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Outdated Show resolved Hide resolved
llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Outdated Show resolved Hide resolved
llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Show resolved Hide resolved
llvm/lib/Target/NVPTX/NVPTXInstrInfo.td Outdated Show resolved Hide resolved
llvm/test/CodeGen/NVPTX/st-param-imm.ll Show resolved Hide resolved
llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Show resolved Hide resolved
llvm/lib/Target/NVPTX/NVPTXInstrInfo.td Outdated Show resolved Hide resolved
llvm/test/CodeGen/NVPTX/st-param-imm.ll Outdated Show resolved Hide resolved
!strconcat("st.param.v2", opstr,
" \t[param$a+$b], {{$val, $val2}};"),
[]>;
multiclass StoreParamInst<NVPTXRegClass regclass, Operand IMMType, string opstr, bit support_imm = true> {
Copy link
Member

Choose a reason for hiding this comment

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

Nice. I like it even better.

@AlexMaclean AlexMaclean merged commit c5b11a7 into llvm:main May 18, 2024
3 of 4 checks passed
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

2 participants