[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-05-07 Thread Nathan Gauër via cfe-commits
Keenuts wrote: Hi all, rebased on main, and addressed the comments. This commits changes the register order on SPIR-V vs DXIL, which required me to fix the mad+lerp intrinsic tests. Should be NFC, just storing the register name in a CHECK variable.

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-05-07 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts updated https://github.com/llvm/llvm-project/pull/88918 From a8bf6fe83a1c145ef81ee30471dc51de1b5354ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= Date: Mon, 15 Apr 2024 17:05:40 +0200 Subject: [PATCH 1/5] [clang][SPIR-V] Always add convervence

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-05-07 Thread Nathan Gauër via cfe-commits
@@ -3101,3 +3130,68 @@ CodeGenFunction::GenerateCapturedStmtFunction(const CapturedStmt ) { return F; } + +namespace { +// Returns the first convergence entry/loop/anchor instruction found in |BB|. +// std::nullptr otherwise. +llvm::IntrinsicInst

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-05-07 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts updated https://github.com/llvm/llvm-project/pull/88918 From 94d76dcdfac88d1d50fe705406c0280c33766e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= Date: Mon, 15 Apr 2024 17:05:40 +0200 Subject: [PATCH 1/4] [clang][SPIR-V] Always add convervence

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-22 Thread Chris B via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -3101,3 +3130,68 @@ CodeGenFunction::GenerateCapturedStmtFunction(const CapturedStmt ) { return F; } + +namespace { +// Returns the first convergence entry/loop/anchor instruction found in

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-22 Thread Justin Bogner via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -3101,3 +3130,68 @@ CodeGenFunction::GenerateCapturedStmtFunction(const CapturedStmt ) { return F; } + +namespace { +// Returns the first convergence entry/loop/anchor instruction found in

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-22 Thread Justin Bogner via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -3101,3 +3130,68 @@ CodeGenFunction::GenerateCapturedStmtFunction(const CapturedStmt ) { return F; } + +namespace { +// Returns the first convergence entry/loop/anchor instruction found in

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-17 Thread Nathan Gauër via cfe-commits
@@ -1109,6 +1124,10 @@ void CodeGenFunction::EmitForStmt(const ForStmt , llvm::BasicBlock *CondBlock = CondDest.getBlock(); EmitBlock(CondBlock); + if (getTarget().getTriple().isSPIRVLogical()) Keenuts wrote: Changed those for a module-level function

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-17 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts updated https://github.com/llvm/llvm-project/pull/88918 From 94d76dcdfac88d1d50fe705406c0280c33766e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= Date: Mon, 15 Apr 2024 17:05:40 +0200 Subject: [PATCH 1/3] [clang][SPIR-V] Always add convervence

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-17 Thread Nathan Gauër via cfe-commits
@@ -1109,6 +1124,10 @@ void CodeGenFunction::EmitForStmt(const ForStmt , llvm::BasicBlock *CondBlock = CondDest.getBlock(); EmitBlock(CondBlock); + if (getTarget().getTriple().isSPIRVLogical()) Keenuts wrote: Right, something at the module level, which

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-17 Thread Matt Arsenault via cfe-commits
Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -4824,6 +4824,9 @@ llvm::CallInst *CodeGenFunction::EmitRuntimeCall(llvm::FunctionCallee callee, llvm::CallInst *call = Builder.CreateCall( callee, args, getBundlesForFunclet(callee.getCallee()), name);

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-17 Thread Matt Arsenault via cfe-commits
Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -1109,6 +1124,10 @@ void CodeGenFunction::EmitForStmt(const ForStmt , llvm::BasicBlock *CondBlock = CondDest.getBlock(); EmitBlock(CondBlock); + if (getTarget().getTriple().isSPIRVLogical()) arsenm

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-16 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts updated https://github.com/llvm/llvm-project/pull/88918 From 94d76dcdfac88d1d50fe705406c0280c33766e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= Date: Mon, 15 Apr 2024 17:05:40 +0200 Subject: [PATCH 1/2] [clang][SPIR-V] Always add convervence

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-16 Thread Nathan Gauër via cfe-commits
@@ -4987,7 +4990,11 @@ class CodeGenFunction : public CodeGenTypeCache { const llvm::Twine = ""); // Adds a convergence_ctrl token to |Input| and emits the required parent // convergence instructions. - llvm::CallBase

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-16 Thread Matt Arsenault via cfe-commits
@@ -4824,6 +4824,9 @@ llvm::CallInst *CodeGenFunction::EmitRuntimeCall(llvm::FunctionCallee callee, llvm::CallInst *call = Builder.CreateCall( callee, args, getBundlesForFunclet(callee.getCallee()), name); call->setCallingConv(getRuntimeCC()); + + if

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-16 Thread Matt Arsenault via cfe-commits
@@ -4987,7 +4990,11 @@ class CodeGenFunction : public CodeGenTypeCache { const llvm::Twine = ""); // Adds a convergence_ctrl token to |Input| and emits the required parent // convergence instructions. - llvm::CallBase

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nathan Gauër (Keenuts) Changes PR #80680 added bits in the codegen to lazily add convergence intrinsics when required. This logic relied on the LoopStack. The issue is when parsing the condition, the loopstack doesn't yet reflect the

[clang] [clang][SPIR-V] Always add convervence intrinsics (PR #88918)

2024-04-16 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts created https://github.com/llvm/llvm-project/pull/88918 PR #80680 added bits in the codegen to lazily add convergence intrinsics when required. This logic relied on the LoopStack. The issue is when parsing the condition, the loopstack doesn't yet reflect the correct