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

[DirectX][Docs] Add DXILIntrinsicExpansion Pass to DXILArchitecture.rst #86198

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

farzonl
Copy link
Member

@farzonl farzonl commented Mar 21, 2024

Completes #84839

@farzonl farzonl self-assigned this Mar 21, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 21, 2024

@llvm/pr-subscribers-backend-directx

Author: Farzon Lotfi (farzonl)

Changes

for instruction expansion
Completes #84839


Full diff: https://github.com/llvm/llvm-project/pull/86198.diff

1 Files Affected:

  • (modified) llvm/docs/DirectX/DXILArchitecture.rst (+13)
diff --git a/llvm/docs/DirectX/DXILArchitecture.rst b/llvm/docs/DirectX/DXILArchitecture.rst
index d6712bea4f7712..b3d29cba0a3c95 100644
--- a/llvm/docs/DirectX/DXILArchitecture.rst
+++ b/llvm/docs/DirectX/DXILArchitecture.rst
@@ -61,6 +61,19 @@ on the utilities described in "Common Code" above in order to share
 logic with both the DirectX backend and with Clang's codegen of HLSL
 support as much as possible.
 
+The DirectX Intrinsic Expansion Pass
+===================
+There are intrinsics that don't map directly to DXIL Ops. In some cases
+an intrinsic needs to be expanded to a set of LLVM IR instructions. In
+other cases an intrinsic needs modifications to the arguments or return
+values of a DXIL Op. This pass (`DXILIntrinsicExpansion.cpp`) handles all 
+the cases where our intrinsics don't have a one to one mapping. You should 
+also consider using this pass when the expansion is specific to DXIL so 
+as to keep implementation details out of CodeGen. Finally, there is an 
+expectation that we maintain vectors through this pass. Therefore, best 
+practice would be to avoid scalarization in this pass.
+
+
 The DirectX Backend
 ===================
 

@farzonl farzonl force-pushed the dxil-docs-instruction-expansion branch from 78392ba to be275a0 Compare March 21, 2024 21:16
@damyanp
Copy link
Contributor

damyanp commented Mar 21, 2024

Is there anything we can do with the PR title so that the key bit of information (ie that it is about instruction expansion) doesn't fall off the title?

@farzonl farzonl linked an issue Mar 21, 2024 that may be closed by this pull request
@farzonl farzonl changed the title [DirectX][Docs] Update DXILArchitecture documentation [DirectX][Docs] Add DXILIntrinsicExpansion to DXILArchitecture documentation Mar 21, 2024
@farzonl farzonl changed the title [DirectX][Docs] Add DXILIntrinsicExpansion to DXILArchitecture documentation [DirectX][Docs] Add DXILIntrinsicExpansion Pass to DXILArchitecture documentation Mar 21, 2024
@farzonl farzonl changed the title [DirectX][Docs] Add DXILIntrinsicExpansion Pass to DXILArchitecture documentation [DirectX][Docs] Add DXILIntrinsicExpansion Pass to DXILArchitecture.rst Mar 21, 2024
llvm/docs/DirectX/DXILArchitecture.rst Outdated Show resolved Hide resolved
llvm/docs/DirectX/DXILArchitecture.rst Outdated Show resolved Hide resolved
llvm/docs/DirectX/DXILArchitecture.rst Outdated Show resolved Hide resolved
@farzonl farzonl merged commit d51f1c4 into llvm:main Mar 22, 2024
4 of 5 checks passed
@farzonl farzonl deleted the dxil-docs-instruction-expansion branch March 22, 2024 12:14
chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
…st (llvm#86198)

Completes llvm#84839

---------

Co-authored-by: Farzon Lotfi <farzon@farzon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[HLSL] Add documentation for new instruction expansion pass
4 participants