mustartt wrote:
Thanks! Not a problem, there were another earlier scyl related failure so the
bots didn't pick this one up.
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
joaosaffran wrote:
Sorry about that @mustartt, will fix it and send a PR in a few minutes
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
mustartt wrote:
Hi @joaosaffran I believe this patch is causing an build error in
`clang-ppc64le-rhel` build bot.
https://lab.llvm.org/buildbot/#/builders/145/builds/4252
```
FAILED:
tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/CodeGenFunction.cpp.o
ccache /home/docker/llvm-extern
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/joaosaffran closed
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1229,8 +1248,15 @@ FunctionPass *llvm::createSPIRVStructurizerPass() {
PreservedAnalyses SPIRVStructurizerWrapper::run(Function &F,
FunctionAnalysisManager &AF) {
- FunctionPass *StructurizerPass = createSPIRVStructurizerPas
@@ -1229,8 +1248,15 @@ FunctionPass *llvm::createSPIRVStructurizerPass() {
PreservedAnalyses SPIRVStructurizerWrapper::run(Function &F,
FunctionAnalysisManager &AF) {
- FunctionPass *StructurizerPass = createSPIRVStructurizerPas
@@ -1229,8 +1248,15 @@ FunctionPass *llvm::createSPIRVStructurizerPass() {
PreservedAnalyses SPIRVStructurizerWrapper::run(Function &F,
FunctionAnalysisManager &AF) {
- FunctionPass *StructurizerPass = createSPIRVStructurizerPas
@@ -0,0 +1,48 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple
dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -o - |
FileCheck %s
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple
spirv-vulkan-library %s -fnative-half-type -emit-llvm -
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -ast-dump %s |
FileCheck %s
+
+// CHECK: FunctionDecl 0x{{[0-9A-Fa-f]+}} <{{.*}}> {{.*}} used branch 'int
(int)'
+// CHECK: AttributedStmt 0x{{[0-9A-Fa-f]+}} <
+// CHECK-NEXT: -HLSLControlFlowHintAttr 0x
@@ -295,6 +296,39 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2776,19 +2788,23 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
@@ -2081,7 +2081,26 @@ void CodeGenFunction::EmitBranchOnBoolExpr(
Weights = createProfileWeights(TrueCount, CurrentCount - TrueCount);
}
- Builder.CreateCondBr(CondV, TrueBlock, FalseBlock, Weights, Unpredictable);
+ auto *BrInst = Builder.CreateCondBr(CondV, TrueBloc
https://github.com/llvm-beanz requested changes to this pull request.
Mostly minor nits, but the stuff in `SPIRVStructurizerWrapper::run` has to
change before we land this.
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From ae719102cdafe101b3d718a144ed2f3488ecd44f Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/18] adding comments
---
clang/include/clang/Basic/Attr.td
@@ -2076,7 +2076,28 @@ void CodeGenFunction::EmitBranchOnBoolExpr(
Weights = createProfileWeights(TrueCount, CurrentCount - TrueCount);
}
- Builder.CreateCondBr(CondV, TrueBlock, FalseBlock, Weights, Unpredictable);
+ auto *BrInst = Builder.CreateCondBr(CondV, TrueBloc
https://github.com/Keenuts approved this pull request.
LGTM on the SPIR-V side. Just a superfluous loop thing.
For the structurizer, seems like this is OK, worst case we might end-up with a
new condition which has no Flatten/Dontflatten attachment but should be fine.
https://github.com/llvm/llv
@@ -2776,19 +2776,35 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
https://github.com/Keenuts edited
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From ae719102cdafe101b3d718a144ed2f3488ecd44f Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/17] adding comments
---
clang/include/clang/Basic/Attr.td
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From ae719102cdafe101b3d718a144ed2f3488ecd44f Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/16] adding comments
---
clang/include/clang/Basic/Attr.td
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From ae719102cdafe101b3d718a144ed2f3488ecd44f Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/15] adding comments
---
clang/include/clang/Basic/Attr.td
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From ae719102cdafe101b3d718a144ed2f3488ecd44f Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/14] adding comments
---
clang/include/clang/Basic/Attr.td
@@ -2694,19 +2694,49 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From dc6af046781abafcd14f36a835fd1557479ffdc0 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/13] adding comments
---
clang/include/clang/Basic/Attr.td
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From 3c792216f88e87b69b3ea7415c2fd74b7f5d7469 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/12] adding comments
---
clang/include/clang/Basic/Attr.td
https://github.com/Keenuts edited
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2694,19 +2694,49 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
https://github.com/Keenuts commented:
Thanks, answered the question for the intrinsic.
As Chris said, this would definitely needs to have some tests in the spir-v
backend.
Especially given that the structurizer assumes the selection control mask was
always `None`.
When splitting edges, or movin
@@ -2694,19 +2694,49 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
@@ -2694,19 +2694,49 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
@@ -1206,6 +1202,21 @@ class SPIRVStructurizer : public FunctionPass {
AU.addPreserved();
FunctionPass::getAnalysisUsage(AU);
}
+
+ void createOpSelectMerge(IRBuilder<> *Builder, BlockAddress *MergeAddress) {
+Instruction *BBTerminatorInst = Builder->GetInsertBlo
@@ -300,6 +301,36 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
@@ -300,6 +301,36 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
@@ -300,6 +301,36 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
@@ -2694,19 +2694,49 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
@@ -300,6 +301,36 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
@@ -2076,7 +2076,28 @@ void CodeGenFunction::EmitBranchOnBoolExpr(
Weights = createProfileWeights(TrueCount, CurrentCount - TrueCount);
}
- Builder.CreateCondBr(CondV, TrueBlock, FalseBlock, Weights, Unpredictable);
+ auto *BrInst = Builder.CreateCondBr(CondV, TrueBloc
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From 3c792216f88e87b69b3ea7415c2fd74b7f5d7469 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/11] adding comments
---
clang/include/clang/Basic/Attr.td
@@ -1206,6 +1202,20 @@ class SPIRVStructurizer : public FunctionPass {
AU.addPreserved();
FunctionPass::getAnalysisUsage(AU);
}
+
+ void createOpSelectMerge(IRBuilder<> *Builder, BlockAddress *MergeAddress) {
+Instruction *BBTerminatorInst = Builder->GetInsertBlo
@@ -2694,19 +2694,41 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
}
return MIB.constrainAllUses(TII, TRI, RBI);
}
- case Intrinsic::spv_loop_merge:
- case Intrinsic::spv_selection_merge: {
-const auto Opcode = IID == Intrinsic::spv_select
@@ -300,6 +301,36 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode
*RMD,
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
}
+// TODO: We might need to refactor this to be more generic,
+// in case we need more metadata to be replaced.
+stat
https://github.com/ilovepi commented:
LGTM from me, and thanks for cleaning this up so promptly. Also, for the
record, if you want to put things in MD_prof, please do add support to
ProfDataUtils. We're happy to support all the various usecases, so if your
stuff belongs there, please add it.
https://github.com/joaosaffran ready_for_review
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From 3c792216f88e87b69b3ea7415c2fd74b7f5d7469 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 01/10] adding comments
---
clang/include/clang/Basic/Attr.td
s-perron wrote:
Is there a difference between this test and
`llvm/test/CodeGen/SPIRV/HLSLControlFlowHint.ll`? If not, you probably only
need one.
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mail
@@ -53,3 +53,6 @@ LLVM_FIXED_MD_KIND(MD_DIAssignID, "DIAssignID", 38)
LLVM_FIXED_MD_KIND(MD_coro_outside_frame, "coro.outside.frame", 39)
LLVM_FIXED_MD_KIND(MD_mmra, "mmra", 40)
LLVM_FIXED_MD_KIND(MD_noalias_addrspace, "noalias.addrspace", 41)
+// TODO: this will likelly be pla
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From 3c792216f88e87b69b3ea7415c2fd74b7f5d7469 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 1/9] adding comments
---
clang/include/clang/Basic/Attr.td
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From 3c792216f88e87b69b3ea7415c2fd74b7f5d7469 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 1/8] adding comments
---
clang/include/clang/Basic/Attr.td
@@ -48,6 +48,13 @@ bool hasValidBranchWeightMD(const Instruction &I);
/// Nullptr otherwise.
MDNode *getBranchWeightMDNode(const Instruction &I);
+/// Get the branching metadata information
+///
+/// \param I The Instruction to get the weights from.
+/// \returns A pointer to
https://github.com/joaosaffran converted_to_draft
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz commented:
I think we need to think a bit about the IR metadata in the middle of the
compiler and how it will be used in various scenarios.
DXIL and SPIR-V both have branch hints that indicate to the GPU backends if a
branch should be profitable to flatten or pres
@@ -53,3 +53,6 @@ LLVM_FIXED_MD_KIND(MD_DIAssignID, "DIAssignID", 38)
LLVM_FIXED_MD_KIND(MD_coro_outside_frame, "coro.outside.frame", 39)
LLVM_FIXED_MD_KIND(MD_mmra, "mmra", 40)
LLVM_FIXED_MD_KIND(MD_noalias_addrspace, "noalias.addrspace", 41)
+// TODO: this will likelly be pla
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -53,3 +53,6 @@ LLVM_FIXED_MD_KIND(MD_DIAssignID, "DIAssignID", 38)
LLVM_FIXED_MD_KIND(MD_coro_outside_frame, "coro.outside.frame", 39)
LLVM_FIXED_MD_KIND(MD_mmra, "mmra", 40)
LLVM_FIXED_MD_KIND(MD_noalias_addrspace, "noalias.addrspace", 41)
+// TODO: this will likelly be pla
@@ -53,3 +53,6 @@ LLVM_FIXED_MD_KIND(MD_DIAssignID, "DIAssignID", 38)
LLVM_FIXED_MD_KIND(MD_coro_outside_frame, "coro.outside.frame", 39)
LLVM_FIXED_MD_KIND(MD_mmra, "mmra", 40)
LLVM_FIXED_MD_KIND(MD_noalias_addrspace, "noalias.addrspace", 41)
+// TODO: this will likelly be pla
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From 3c792216f88e87b69b3ea7415c2fd74b7f5d7469 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 1/5] adding comments
---
clang/include/clang/Basic/Attr.td
llvmbot wrote:
@llvm/pr-subscribers-backend-spir-v
@llvm/pr-subscribers-clang-codegen
Author: None (joaosaffran)
Changes
- adding Flatten and Branch to if stmt.
- adding dxil control flow hint metadata generation
- modifing spirv OpSelectMerge to account for the specific attributes.
Close
https://github.com/joaosaffran ready_for_review
https://github.com/llvm/llvm-project/pull/116331
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From 3c792216f88e87b69b3ea7415c2fd74b7f5d7469 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 1/7] adding comments
---
clang/include/clang/Basic/Attr.td
https://github.com/joaosaffran updated
https://github.com/llvm/llvm-project/pull/116331
>From 3c792216f88e87b69b3ea7415c2fd74b7f5d7469 Mon Sep 17 00:00:00 2001
From: Joao Saffran
Date: Fri, 25 Oct 2024 17:48:41 +
Subject: [PATCH 1/6] adding comments
---
clang/include/clang/Basic/Attr.td
https://github.com/joaosaffran created
https://github.com/llvm/llvm-project/pull/116331
- adding Flatten and Branch to if stmt.
- adding dxil control flow hint metadata generation
- modifing spirv OpSelectMerge to account for the specific attributes.
Closes #70112
>From 3c792216f88e87b69b3ea74
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 95b680e4c353d479fbfb96adb39696042c005e99
9beb5f17bfefcea148c1954b1b7bd458c4372389 --e
64 matches
Mail list logo