Skip to content

Commit 8ad42d5

Browse files
authored
[SYCL] Fix invalid interator after removal in SYCLJointMatrixTransform (#16134)
Can be exposed in windows debug build on the tests added by the original patch: LLVM::SYCLLowerIR/JointMatrixTransform/access-chain-no-uses.ll Author: Jinsong Ji <jinsong.ji@intel.com> Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
1 parent d9c7bcb commit 8ad42d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/SYCLLowerIR/SYCLJointMatrixTransform.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ static constexpr char MATRIX_TYPE[] = "spirv.CooperativeMatrixKHR";
2626
// its users and operands to make LLVM IR more SPIR-V friendly.
2727
bool transformAccessChain(Function *F) {
2828
bool ModuleChanged = false;
29-
for (auto I : F->users()) {
30-
auto *CI = dyn_cast<CallInst>(I);
29+
for (auto I = F->user_begin(), E = F->user_end(); I != E;) {
30+
User *U = *I++;
31+
auto *CI = dyn_cast<CallInst>(U);
3132
if (!CI)
3233
continue;
3334

0 commit comments

Comments
 (0)