[llvm-branch-commits] [llvm] [DirectX] Fix printing of DXIL cbuffer info (PR #128698)

2025-02-25 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/128698 ___ 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] Support the CBufferLoadLegacy operation (PR #128699)

2025-02-25 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. LGTM. comments are questions only. No changes needed. https://github.com/llvm/llvm-project/pull/128699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org

[llvm-branch-commits] [llvm] [DirectX] Support the CBufferLoadLegacy operation (PR #128699)

2025-02-25 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/128699 ___ 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] Support the CBufferLoadLegacy operation (PR #128699)

2025-02-25 Thread Farzon Lotfi via llvm-branch-commits
@@ -46,6 +46,12 @@ def ResRetDoubleTy : DXILOpParamType; def ResRetInt16Ty : DXILOpParamType; def ResRetInt32Ty : DXILOpParamType; def ResRetInt64Ty : DXILOpParamType; +def CBufRetHalfTy : DXILOpParamType; farzonl wrote: why `def CBufRetHalfTy : DXILOpParamTyp

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/123985 ___ 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] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
farzonl wrote: Really appreciate your judicious use of comments. Helped me understand why you were doing certain things. Most of what I found seemed minor so LGTM. https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.cpp--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/124886 ___ 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] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,49 @@ +; ModuleID = 'C:\llvm-project\clang\test\CodeGenHLSL\cbuffer_and_namespaces.hlsl' farzonl wrote: delete? https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-bra

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,49 @@ +; ModuleID = 'C:\llvm-project\clang\test\CodeGenHLSL\cbuffer_and_namespaces.hlsl' +source_filename = "C:\\llvm-project\\clang\\test\\CodeGenHLSL\\cbuffer_and_namespaces.hlsl" farzonl wrote: delete? https://github.com/llvm/llvm-project/pull/12

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,39 @@ +//===- HLSLTargetInfo.h ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.cpp--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/124886 ___ 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] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.cpp--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/124886 ___ 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] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -56,9 +75,18 @@ llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(CodeGenModule &CGM, return llvm::TargetExtType::get(Ctx, TypeName, {ElemType}, Ints); } - case llvm::dxil::ResourceClass::CBuffer: -llvm_unreachable("dx.CBuffer handles are not implemented yet");

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-12 Thread Farzon Lotfi via llvm-branch-commits
@@ -647,6 +648,40 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr *RHS, << NewFnName << FixItHint::CreateReplacement(FullRange, OS.str()); } +void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) { + if (AL.getNumArgs() != 1) +return; + +

[llvm-branch-commits] [llvm] [x86][Windows] Fix chromium build break (PR #111218)

2024-10-05 Thread Farzon Lotfi via llvm-branch-commits
farzonl wrote: @efriedma-quic I don't have permissions to merge to the 19.x branch. If you think its ready please merge at your discression. https://github.com/llvm/llvm-project/pull/111218 ___ llvm-branch-commits mailing list llvm-branch-commits@lis

[llvm-branch-commits] [llvm] [x86][Windows] Fix chromium build break (PR #111218)

2024-10-04 Thread Farzon Lotfi via llvm-branch-commits
@@ -177,6 +177,107 @@ define float @tan(float %x) #0 { ret float %result } +define float @acos(float %x) #0 { farzonl wrote: @efriedma-quic I'm looking at the commit history of this file: https://github.com/llvm/llvm-project/commits/release/19.x/llvm/test/C

[llvm-branch-commits] [llvm] [x86][Windows] Fix chromium build break (PR #111218)

2024-10-04 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl created https://github.com/llvm/llvm-project/pull/111218 Windows does not support float C89 math functions like: - acosf - asinf - atanf - coshf - sinhf - tanhf These 6 libfuncs need to be type promoted. This PR fixes the bug introduced by https://github.com/llvm/llv

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

2024-09-09 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl 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-09-09 Thread Farzon Lotfi 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] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-09-09 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. 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-09-09 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl 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-09-09 Thread Farzon Lotfi 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] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-09-09 Thread Farzon Lotfi via llvm-branch-commits
@@ -94,6 +95,7 @@ class OpLowerer { DiagnosticInfoUnsupported Diag(*CI->getFunction(), Message, CI->getDebugLoc()); M.getContext().diagnose(Diag); +HasErrors = true; farzonl wrote: `HasErrors ` upd

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

2024-09-09 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl 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-09-09 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl 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-09-09 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl 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-09-09 Thread Farzon Lotfi via llvm-branch-commits
@@ -361,11 +361,60 @@ Examples: - ``i32`` - Index into the buffer +Texture and Typed Buffer Stores +--- + +*relevant types: Textures and TypedBuffer* + +The `TextureStore`_ and `BufferStore`_ DXIL operations can only be used to +write all

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

2024-09-09 Thread Farzon Lotfi via llvm-branch-commits
@@ -361,11 +361,60 @@ Examples: - ``i32`` - Index into the buffer +Texture and Typed Buffer Stores +--- + +*relevant types: Textures and TypedBuffer* + +The `TextureStore`_ and `BufferStore`_ DXIL operations can only be used to +write all

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

2024-09-09 Thread Farzon Lotfi via llvm-branch-commits
@@ -361,11 +361,60 @@ Examples: - ``i32`` - Index into the buffer +Texture and Typed Buffer Stores +--- + +*relevant types: Textures and TypedBuffer* + +The `TextureStore`_ and `BufferStore`_ DXIL operations can only be used to +write all

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

2024-09-09 Thread Farzon Lotfi via llvm-branch-commits
@@ -361,11 +361,60 @@ Examples: - ``i32`` - Index into the buffer +Texture and Typed Buffer Stores +--- + +*relevant types: Textures and TypedBuffer* + +The `TextureStore`_ and `BufferStore`_ DXIL operations can only be used to ---

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

2024-08-21 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. LGTM 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] Add resource handling to the DXIL pretty printer (PR #104448)

2024-08-21 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl edited 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] Add resource handling to the DXIL pretty printer (PR #104448)

2024-08-21 Thread Farzon Lotfi via llvm-branch-commits
@@ -10,23 +10,235 @@ #include "DXILResourceAnalysis.h" #include "DirectX.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Analysis/DXILResource.h" #include "llvm/IR/PassManager.h" +#include "llvm/InitializePasses.h" #include "llvm/Pass.h" +#include "llvm/Support/FormatAdapt

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

2024-08-15 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. 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] Encapsulate DXILOpLowering's state into a class. NFC (PR #104248)

2024-08-15 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. 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] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-14 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. 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 Farzon Lotfi via llvm-branch-commits
farzonl 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

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

2024-08-14 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. 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] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

2024-08-14 Thread Farzon Lotfi via llvm-branch-commits
farzonl 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 ba problem? https://github.com/llvm/llvm-project/pull/104247 __

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

2024-08-14 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/104246 ___ 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 Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/104245 ___ 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 Farzon Lotfi 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] Remove new-pm versions of DXILResource passes. NFC (PR #100698)

2024-07-26 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. 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] [DXIL][Analysis] Make alignment on StructuredBuffer optional (PR #100697)

2024-07-26 Thread Farzon Lotfi via llvm-branch-commits
https://github.com/farzonl approved this pull request. 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-26 Thread Farzon Lotfi via llvm-branch-commits
farzonl wrote: > 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. *behavior https://github.com/llvm/llvm-project/pull/100697 _

[llvm-branch-commits] [clang] 0b32d5f - Revert "[clang] Add tanf16 builtin and support for tan constrained intrinsic (#93314)"

2024-05-29 Thread Farzon Lotfi via llvm-branch-commits
Author: Farzon Lotfi Date: 2024-05-29T15:14:21-04:00 New Revision: 0b32d5fc9e9719a742e24e1a470bd0db7e53b8f7 URL: https://github.com/llvm/llvm-project/commit/0b32d5fc9e9719a742e24e1a470bd0db7e53b8f7 DIFF: https://github.com/llvm/llvm-project/commit/0b32d5fc9e9719a742e24e1a470bd0db7e53b8f7.diff