[clang] [HLSL][SPIRV] Add convergence tokens to entry point wrapper (PR #112757)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 23 22:22:51 PDT 2024
================
@@ -469,14 +479,22 @@ void CGHLSLRuntime::generateGlobalCtorDtorCalls() {
for (auto &F : M.functions()) {
if (!F.hasFnAttribute("hlsl.shader"))
continue;
- IRBuilder<> B(&F.getEntryBlock(), F.getEntryBlock().begin());
+ auto *Token = getConvergenceToken(F.getEntryBlock());
+ Instruction *IP =
+ Token ? Token->getNextNode() : &*F.getEntryBlock().begin();
+ IRBuilder<> B(IP);
+ SmallVector<OperandBundleDef, 1> OB;
+ if (Token) {
----------------
farzonl wrote:
If you are going to have a conditional block for null checking token why even have the terinary? Your IRBuilder isn't used till the for loop this could be restructured to do one conditional.
https://github.com/llvm/llvm-project/pull/112757
More information about the cfe-commits
mailing list