Skip to content

Commit 6931630

Browse files
authoredMar 10, 2025
[NFC][SYCL] Fix constant propagation for matrix layout (#17338)
Fix use of uninitialized memory ASAN report. Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
1 parent a000e56 commit 6931630

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎llvm/lib/SYCLLowerIR/SYCLJointMatrixTransform.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ bool propagateConstexprLayout(Function *F) {
247247
// and keep track if we have removed them before to avoid double free().
248248
SmallPtrSet<Instruction *, 8> Erased;
249249
for (Instruction *II : ToErase) {
250-
if (!II->use_empty())
251-
continue;
252250
if (Erased.contains(II))
253251
continue;
252+
if (!II->use_empty())
253+
continue;
254+
Erased.insert(II);
254255
II->dropAllReferences();
255256
II->eraseFromParent();
256-
Erased.insert(II);
257257
}
258258
return !ToErase.empty();
259259
}

0 commit comments

Comments
 (0)