[llvm-branch-commits] [DXIL][Analysis] Replace #include with forward declaration. NFC (PR #100622)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/100622 None ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Make the DXILResource binding optional. NFC (PR #100623)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/100623 This makes the binding structure in a DXILResource default to empty and need a separate call to set up, and also moves the unique ID into it since bindings are the only place where those are actually used. This w

[llvm-branch-commits] [DXIL][Analysis] Replace #include with forward declaration. NFC (PR #100622)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100622 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Replace #include with forward declaration. NFC (PR #100622)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100622 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Make the DXILResource binding optional. NFC (PR #100623)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100623 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Make the DXILResource binding optional. NFC (PR #100623)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100623 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Make alignment on StructuredBuffer optional (PR #100697)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/100697 HLSL allows StructuredBuffer<> to be defined with scalar or up-to-4-element vectors as well as with structs, but when doing so `dxc` doesn't set the alignment. Emulate this behaviour. __

[llvm-branch-commits] [DirectX] Remove new-pm versions of DXILResource passes. NFC (PR #100698)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/100698 This is a bit of a hack, but these aren't actually used at the moment and they'll cause naming conflicts with DXIL resource passes that I'm adding to llvm/Analysis for replacing all of this with the target extensi

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/100699 This implements the DXILResourceAnalysis pass for `dx.TypedBuffer` and `dx.RawBuffer` types. This should be sufficient to lower `dx.handle.fromBinding` for this set of types, but it leaves a number of TODOs around

[llvm-branch-commits] [DXIL][Analysis] Boilerplate for DXILResourceAnalysis pass (PR #100700)

2024-07-25 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/100700 Broke this out into its own commit to make the next one easier to review. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.o

[llvm-branch-commits] [DXIL][Analysis] Make alignment on StructuredBuffer optional (PR #100697)

2024-07-27 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100697 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Make alignment on StructuredBuffer optional (PR #100697)

2024-07-27 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100697 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Make alignment on StructuredBuffer optional (PR #100697)

2024-07-27 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/100697 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Make alignment on StructuredBuffer optional (PR #100697)

2024-07-29 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100697 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Make alignment on StructuredBuffer optional (PR #100697)

2024-07-29 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100697 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-29 Thread Justin Bogner via llvm-branch-commits
@@ -331,6 +336,249 @@ std::pair ResourceInfo::getAnnotateProps() const { return {Word0, Word1}; } +void ResourceInfo::print(raw_ostream &OS) const { + OS << " Symbol: "; + Symbol->printAsOperand(OS); + OS << "\n"; + + OS << " Name: \"" << Name << "\"\n" + << " Bi

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-29 Thread Justin Bogner via llvm-branch-commits
@@ -331,6 +336,249 @@ std::pair ResourceInfo::getAnnotateProps() const { return {Word0, Word1}; } +void ResourceInfo::print(raw_ostream &OS) const { + OS << " Symbol: "; + Symbol->printAsOperand(OS); + OS << "\n"; + + OS << " Name: \"" << Name << "\"\n" + << " Bi

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-29 Thread Justin Bogner via llvm-branch-commits
@@ -331,6 +336,249 @@ std::pair ResourceInfo::getAnnotateProps() const { return {Word0, Word1}; } +void ResourceInfo::print(raw_ostream &OS) const { + OS << " Symbol: "; + Symbol->printAsOperand(OS); + OS << "\n"; + + OS << " Name: \"" << Name << "\"\n" + << " Bi

[llvm-branch-commits] [DirectX] Simplify tablegen'd OpCode and OpClass enums (PR #101249)

2024-07-30 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/101249 None ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Make DXILOpBuilder's API more useable (PR #101250)

2024-07-30 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/101250 This adjusts the DXILOpBuilder API in a couple of ways: 1. Remove the need to call `getOverloadTy` before creating Ops 2. Introduce `tryCreateOp` to parallel `createOp` but propagate errors 3. Introduce specialize

[llvm-branch-commits] [llvm] [DirectX] Make DXILOpBuilder's API more useable (PR #101250)

2024-07-30 Thread Justin Bogner via llvm-branch-commits
@@ -151,7 +151,11 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) { assert(knownType && "Specification of multiple differing overload " "parameter types not yet supported"); } else { -OverloadParamIndices.push_back(i);

[llvm-branch-commits] [llvm] [DirectX] Make DXILOpBuilder's API more useable (PR #101250)

2024-07-30 Thread Justin Bogner via llvm-branch-commits
@@ -151,7 +151,11 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) { assert(knownType && "Specification of multiple differing overload " "parameter types not yet supported"); } else { -OverloadParamIndices.push_back(i);

[llvm-branch-commits] [llvm] [DirectX] Make DXILOpBuilder's API more useable (PR #101250)

2024-07-30 Thread Justin Bogner via llvm-branch-commits
@@ -151,7 +151,11 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) { assert(knownType && "Specification of multiple differing overload " "parameter types not yet supported"); } else { -OverloadParamIndices.push_back(i);

[llvm-branch-commits] [llvm] [DirectX] Make DXILOpBuilder's API more useable (PR #101250)

2024-07-30 Thread Justin Bogner via llvm-branch-commits
@@ -289,24 +289,25 @@ static ShaderKind getShaderKindEnum(Triple::EnvironmentType EnvType) { /// its specification in DXIL.td. /// \param OverloadTy Return type to be used to construct DXIL function type. bogner wrote: Removed the parameters from

[llvm-branch-commits] [DirectX] Simplify tablegen'd OpCode and OpClass enums (PR #101249)

2024-07-30 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/101249 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Simplify tablegen'd OpCode and OpClass enums (PR #101249)

2024-07-30 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/101249 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Make DXILOpBuilder's API more useable (PR #101250)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
bogner wrote: > I do not see the invocation of any of the newly created functions in `class > DXILOpbuilder` specific to DXIL Ops `create##Name##Op(...)` or > `tryCreate##Name##Op(...)` (for example `createSinSin13()` or > `tryCreateSin13()` when lowering `llvm.sin.*`). Are these in preparatio

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
@@ -331,6 +336,249 @@ std::pair ResourceInfo::getAnnotateProps() const { return {Word0, Word1}; } +void ResourceInfo::print(raw_ostream &OS) const { + OS << " Symbol: "; + Symbol->printAsOperand(OS); + OS << "\n"; + + OS << " Name: \"" << Name << "\"\n" + << " Bi

[llvm-branch-commits] [DXIL][Analysis] Boilerplate for DXILResourceAnalysis pass (PR #100700)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100700 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Boilerplate for DXILResourceAnalysis pass (PR #100700)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100700 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Remove new-pm versions of DXILResource passes. NFC (PR #100698)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/100698 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Remove new-pm versions of DXILResource passes. NFC (PR #100698)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
bogner wrote: Turns out I was wrong and this *does not* effectively avoid the naming collisions. Tried again here: #101393 https://github.com/llvm/llvm-project/pull/100698 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https:/

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
@@ -331,6 +336,249 @@ std::pair ResourceInfo::getAnnotateProps() const { return {Word0, Word1}; } +void ResourceInfo::print(raw_ostream &OS) const { + OS << " Symbol: "; + Symbol->printAsOperand(OS); + OS << "\n"; + + OS << " Name: \"" << Name << "\"\n" + << " Bi

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-31 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-01 Thread Justin Bogner via llvm-branch-commits
@@ -331,6 +336,249 @@ std::pair ResourceInfo::getAnnotateProps() const { return {Word0, Word1}; } +void ResourceInfo::print(raw_ostream &OS) const { + OS << " Symbol: "; + Symbol->printAsOperand(OS); + OS << "\n"; + + OS << " Name: \"" << Name << "\"\n" + << " Bi

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-01 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-02 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-02 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Boilerplate for DXILResourceAnalysis pass (PR #100700)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100700 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Boilerplate for DXILResourceAnalysis pass (PR #100700)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100700 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Revert specialized createOp methods part of #101250 (PR #104245)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104245 In 8cf85653b6f5 "[DirectX] Make DXILOpBuilder's API more useable" we introduced specialized createOp methods for each DirectX op for convenience, but the API is buggy and untested. It also isn't actually as useful

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104247 LLVMType is both too broad and too narrow for defining DXIL operations, in different ways. It's too broad in the sense that we don't need the full set of MVTs - the set of types DXIL operations work on is much sma

[llvm-branch-commits] [DirectX] Differentiate between 0/1 overloads in the OpBuilder. NFC (PR #104246)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104246 DXIL operations that only have one signature behave one of two ways - either they are always suffixed with a type like `dx.op.ThreadId.i32` and hence have exactly one overload, or they're never suffixed like `dx.o

[llvm-branch-commits] [DirectX] Encapsulate DXILOpLowering's state into a class. NFC (PR #104248)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104248 This introduces an anonymous class "OpLowerer" to help with lowering DXIL ops, and moves the DXILOpBuilder there instead of creating a new one for every operation. DXILOpBuilder is also changed to own its IRBuilde

[llvm-branch-commits] [DirectX] Use a more consistent pass name for DXILTranslateMetadata (PR #104249)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104249 This updates the "dxil-metadata-emit" pass flag to be spelled "dxil-translate-metadata" to better match the pass name. ___ llvm-branch-commits mailing list llvm-branc

[llvm-branch-commits] [DirectX] Register a few DXIL passes with the new PM (PR #104250)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104250 This wires up dxil-op-lower, dxil-intrinsic-expansion, dxil-translate-metadata, and dxil-pretty-printer to the new pass manager, both as a matter of future proofing the backend and so that they can be used more fl

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104251 The `@llvm.dx.handle.fromBinding` intrinsic is lowered either to the `CreateHandle` op or a pair of `CreateHandleFromBinding` and `AnnotateHandle` ops, depending on the DXIL version. Regardless of the DXIL version

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104252 The `@llvm.dx.typedBufferLoad` intrinsic is lowered to `@dx.op.bufferLoad`. There's some complexity here due to translating from a vector return type to a named struct and trying to avoid excessive IR coming out o

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104253 The `@llvm.dx.typedBufferStore` intrinsic is lowered to `@dx.op.bufferStore`. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.ll

[llvm-branch-commits] [DirectX] Register a few DXIL passes with the new PM (PR #104250)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
bogner wrote: Depends on #104248 https://github.com/llvm/llvm-project/pull/104250 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
bogner wrote: Depends on #104246, #104247, and #104248 https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
bogner wrote: Depends on #104251 https://github.com/llvm/llvm-project/pull/104252 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
bogner wrote: Depends on #104252 https://github.com/llvm/llvm-project/pull/104253 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104247 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104252 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104253 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Register a few DXIL passes with the new PM (PR #104250)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
@@ -23,7 +23,10 @@ MODULE_ANALYSIS("dxil-resource-md", DXILResourceMDAnalysis()) #ifndef MODULE_PASS #define MODULE_PASS(NAME, CREATE_PASS) #endif +MODULE_PASS("dxil-intrinsic-expansion", DXILIntrinsicExpansion()) +MODULE_PASS("dxil-op-lower", DXILOpLowering()) +MODULE_PASS("dx

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
@@ -0,0 +1,63 @@ +; RUN: opt -S -dxil-op-lower %s | FileCheck %s + +target triple = "dxil-pc-shadermodel6.6-compute" + +define void @test_bindings() { + ; RWBuffer Buf : register(u5, space3) + %typed0 = call target("dx.TypedBuffer", <4 x float>, 1, 0, 0) + @llvm.dx.

[llvm-branch-commits] [llvm] [DirectX] Register a few DXIL passes with the new PM (PR #104250)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
@@ -23,7 +23,10 @@ MODULE_ANALYSIS("dxil-resource-md", DXILResourceMDAnalysis()) #ifndef MODULE_PASS #define MODULE_PASS(NAME, CREATE_PASS) #endif +MODULE_PASS("dxil-intrinsic-expansion", DXILIntrinsicExpansion()) +MODULE_PASS("dxil-op-lower", DXILOpLowering()) +MODULE_PASS("dx

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
@@ -289,6 +289,43 @@ class OpLowerer { }); } + void lowerTypedBufferStore(Function &F) { +IRBuilder<> &IRB = OpBuilder.getIRB(); +Type *Int8Ty = IRB.getInt8Ty(); +Type *Int32Ty = IRB.getInt32Ty(); + +replaceFunction(F, [&](CallInst *CI) -> Error { --

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104247 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104247 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104247 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-14 Thread Justin Bogner via llvm-branch-commits
bogner wrote: > Your description and the bug you are adressing make sense. One point of > confusion I see now is our mapping of intrinsics to DXIL Ops. The intrinsics > still all use `LLVMType`. Is that going to be problem? I don't see why it would. LLVMType is perfectly reasonable for describ

[llvm-branch-commits] [DirectX] Use a more consistent pass name for DXILTranslateMetadata (PR #104249)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104249 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Use a more consistent pass name for DXILTranslateMetadata (PR #104249)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104249 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
@@ -0,0 +1,63 @@ +; RUN: opt -S -dxil-op-lower %s | FileCheck %s + +target triple = "dxil-pc-shadermodel6.6-compute" + +define void @test_bindings() { + ; RWBuffer Buf : register(u5, space3) + %typed0 = call target("dx.TypedBuffer", <4 x float>, 1, 0, 0) + @llvm.dx.

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104253 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104253 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104253 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
@@ -289,6 +289,43 @@ class OpLowerer { }); } + void lowerTypedBufferStore(Function &F) { +IRBuilder<> &IRB = OpBuilder.getIRB(); +Type *Int8Ty = IRB.getInt8Ty(); +Type *Int32Ty = IRB.getInt32Ty(); + +replaceFunction(F, [&](CallInst *CI) -> Error { +

[llvm-branch-commits] [DirectX] Implement metadata lowering for resources (PR #104447)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104447 Generate metadata from target extension type based resources. Part of #91366 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.ll

[llvm-branch-commits] [DirectX] Move resource logic into PrettyPrinter and TranslateMetadata (PR #104446)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104446 Move the module level logic for resources into the pretty printer and translate metadata passes rather than embedding them in the DXILResource helper. This will make it easier to migrate towards the target extensi

[llvm-branch-commits] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/104448 Handle target extension type resources when printing resources to textual IR. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.ll

[llvm-branch-commits] [DirectX] Move resource logic into PrettyPrinter and TranslateMetadata. NFC (PR #104446)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/104446 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Implement metadata lowering for resources (PR #104447)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
bogner wrote: Depends on #104446 https://github.com/llvm/llvm-project/pull/104447 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)

2024-08-15 Thread Justin Bogner via llvm-branch-commits
bogner wrote: Depends on #104446 https://github.com/llvm/llvm-project/pull/104448 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Implement metadata lowering for resources (PR #104447)

2024-08-16 Thread Justin Bogner via llvm-branch-commits
@@ -13,27 +13,52 @@ #include "DXILShaderFlags.h" #include "DirectX.h" #include "llvm/ADT/StringSet.h" +#include "llvm/Analysis/DXILResource.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Metadata.h" #include "llvm/IR/Module.h" +#include "llvm/InitializePasses.h" #inclu

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-19 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104247 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-19 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104247 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Encapsulate DXILOpLowering's state into a class. NFC (PR #104248)

2024-08-20 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104248 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Encapsulate DXILOpLowering's state into a class. NFC (PR #104248)

2024-08-20 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104248 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-20 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-20 Thread Justin Bogner via llvm-branch-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-20 Thread Justin Bogner via llvm-branch-commits
@@ -119,6 +123,119 @@ class OpLowerer { }); } + Value *createTmpHandleCast(Value *V, Type *Ty) { +Function *CastFn = Intrinsic::getDeclaration(&M, Intrinsic::dx_cast_handle, + {Ty, V->getType()}); +CallInst *Cast =

[llvm-branch-commits] [llvm] [DirectX] Register a few DXIL passes with the new PM (PR #104250)

2024-08-20 Thread Justin Bogner via llvm-branch-commits
@@ -46,14 +46,14 @@ define void @test_typedbuffer() { ; Buffer Buf[24] : register(t3, space5) %typed2 = call target("dx.TypedBuffer", <4 x i32>, 0, 0, 0) @llvm.dx.handle.fromBinding.tdx.TypedBuffer_i32_0_0t( - i32 2, i32 7, i32 24, i32 0, i1 false) +

[llvm-branch-commits] [clang] cab6bcd - [𝘀𝗽𝗿] initial version

2023-11-03 Thread Justin Bogner via llvm-branch-commits
Author: Justin Bogner Date: 2023-11-03T18:59:49-07:00 New Revision: cab6bcd73081fcbe9807adbf60b345f8d9e654e4 URL: https://github.com/llvm/llvm-project/commit/cab6bcd73081fcbe9807adbf60b345f8d9e654e4 DIFF: https://github.com/llvm/llvm-project/commit/cab6bcd73081fcbe9807adbf60b345f8d9e654e4.diff

  1   2   3   >