[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-10-12 Thread Xiang Li via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. python3kgae marked an inline comment as done. Closed by commit rGebe9c7f3e2da: [HLSL] CodeGen hlsl cbuffer/tbuffer. (authored by python3kgae). Repository: rG LLVM Gi

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-10-12 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision. efriedma added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:112 +// Replace. +GV->replaceAllUsesWith(GEP); +// Erase GV. python3kgae wrote: > efriedm

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-10-12 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked an inline comment as done. python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:131 case Decl::RequiresExprBody: + case Decl::HLSLBuffer: // None of these decls require codegen support. efriedma wrote: > I'm a li

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-10-12 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 467318. python3kgae marked an inline comment as done. python3kgae added a comment. Go llvm_unreachable is hit HLSLBuffer inside function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130131/new/ https://re

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-10-12 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:131 case Decl::RequiresExprBody: + case Decl::HLSLBuffer: // None of these decls require codegen support. I'm a little confused by this. If it's possible to declare an HLSLBuffer

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-10-12 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added a comment. gentle ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130131/new/ https://reviews.llvm.org/D130131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-10-04 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a reviewer: asl. beanz added a subscriber: asl. beanz added a comment. +@asl for codegen owner perspective. This LGTM too. The changes here are well isolated to HLSL, so they should have no adverse impact on other language support. @efriedma, @asl & @rjmccall any feedback? Reposit

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: rjmccall, efriedma. aaron.ballman added a comment. No additional comments from me, but I don't feel comfortable signing off on the codegen bits; adding some codegen code owners. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-22 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 462289. python3kgae marked 2 inline comments as done. python3kgae edited the summary of this revision. python3kgae added a comment. Create issue for FIXME. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D13013

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-22 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. This is looking great. Thank you for all your work iterating on this. Please update the description to reflect the changes in implementation. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:120 + +void addResourceBinding(GlobalVariable *GV, CGHLSLRuntime

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-22 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 462280. python3kgae marked 8 inline comments as done. python3kgae added a comment. Code cleanup to match comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130131/new/ https://reviews.llvm.org/D130131

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:81-83 +auto *GV = Const.first; +Const.second = EltTys.size(); +auto *Ty = GV->getValueType(); Please spell out these types. Comment at: clang/lib/C

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-21 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 462085. python3kgae added a comment. Remove nested HLSLBuffer and namespace inside HLSLBuffer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130131/new/ https://reviews.llvm.org/D130131 Files: clang/lib/

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-21 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked an inline comment as done. python3kgae added a comment. In D130131#3720552 , @beanz wrote: > Now that I'm seeing the code in D131370 , I > don't know that this is the right way to do things. > > I thin

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-09-21 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 462084. python3kgae added a comment. Remove address space and manual align. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130131/new/ https://reviews.llvm.org/D130131 Files: clang/lib/CodeGen/CGDecl.cpp

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-08-12 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added a comment. In D130131#3720552 , @beanz wrote: > Now that I'm seeing the code in D131370 , I > don't know that this is the right way to do things. > > I think using address spaces like this is odd. Addre

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-08-12 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. Now that I'm seeing the code in D131370 , I don't know that this is the right way to do things. I think using address spaces like this is odd. Address spaces aren't really intended for use differentiating high level access types, but rath

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-08-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:96 + } + Buf.LayoutStruct = llvm::StructType::get(EltTys[0]->getContext(), EltTys); +} Why are you manually inserting padding? IR level accesses don't require explicit layout, and we

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-08-08 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked 3 inline comments as done. python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:61 + +GlobalVariable *replaceCBuffer(CGHLSLRuntime::CBuffer &CB) { + const unsigned CBufferAddressSpace = 4; Anastasia wrote: > pytho

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-08-08 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 450978. python3kgae added a comment. Add more test and comment. Also use getTargetAddressSpace. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130131/new/ https://reviews.llvm.org/D130131 Files: clang/inc

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:61 + +GlobalVariable *replaceCBuffer(CGHLSLRuntime::CBuffer &CB) { + const unsigned CBufferAddressSpace = 4; python3kgae wrote: > Anastasia wrote: > > I don't think I understand the

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 448435. python3kgae marked 2 inline comments as done. python3kgae added a comment. Remove useless comment. Use llvm::Optional. Use real type instead of auto. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 448414. python3kgae marked an inline comment as done. python3kgae added a comment. Add test for nested cbuffer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130131/new/ https://reviews.llvm.org/D130131 Fi

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/Basic/Targets/SPIR.h:46 +0, // ptr64 +// HLSL address space values for this map are dummy and they can't be used +0, // hlsl_cbuffer I don’t think you need this comment. Most of those adds space value

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked an inline comment as done. python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:142 + if (!Inner) { +DiagnosticsEngine &Diags = CGM.getDiags(); +unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:142 + if (!Inner) { +DiagnosticsEngine &Diags = CGM.getDiags(); +unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error, python3kgae wrote: > python3kgae w

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked an inline comment as done. python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:142 + if (!Inner) { +DiagnosticsEngine &Diags = CGM.getDiags(); +unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 448407. python3kgae added a comment. Add more comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130131/new/ https://reviews.llvm.org/D130131 Files: clang/include/clang/Basic/AddressSpaces.h clang

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 448403. python3kgae added a comment. Herald added subscribers: kosarev, mattd, gchakrabarti, asavonic, kerbowa, jvesely, jholewinski. Take care alignment when layout CBuffer. Add hlsl_cbuffer/tbuffer to clang::LangAS. Change CGHLSLRuntime::CBuffer to CGHL

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-28 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:61 + +GlobalVariable *replaceCBuffer(CGHLSLRuntime::CBuffer &CB) { + const unsigned CBufferAddressSpace = 4; Anastasia wrote: > I don't think I understand the intent of this funct

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:61 + +GlobalVariable *replaceCBuffer(CGHLSLRuntime::CBuffer &CB) { + const unsigned CBufferAddressSpace = 4; I don't think I understand the intent of this function along with `CGHL

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-19 Thread Xiang Li via Phabricator via cfe-commits
python3kgae created this revision. python3kgae added reviewers: aaron.ballman, Anastasia, kuhar, bogner, beanz, pow2clk. Herald added a project: All. python3kgae requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. cbuffer A { float a; flo