Skip to content

Commit f8c1648

Browse files
Fix clang error: add explicit braces to avoid dangling else (#5301)
Build fails with the following error: ``` LoadStoreOpToLLVM.cpp:2050:9: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else] ```
1 parent 2908846 commit f8c1648

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

third_party/intel/lib/TritonIntelGPUToLLVM/LoadStoreOpToLLVM.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ struct LoadOpToBlockIOConversion
20282028
Value other = op.getOther();
20292029
Value llOther = adaptor.getOther();
20302030
DenseElementsAttr constAttr;
2031-
if (other)
2031+
if (other) {
20322032
if (matchPattern(other, m_Constant(&constAttr)) && constAttr.isSplat()) {
20332033
Type elemTy = constAttr.getElementType();
20342034
auto handleSplatValue = [&](auto splatVal) {
@@ -2049,6 +2049,7 @@ struct LoadOpToBlockIOConversion
20492049
} else {
20502050
otherElems = unpackLLElements(loc, llOther, rewriter);
20512051
}
2052+
}
20522053

20532054
// re-arrange the ptrs and masks to for large 2D block IO.
20542055
// Layout is unrelated to the scalar type.
@@ -2562,7 +2563,7 @@ struct LoadOpToBlockIOConversion
25622563
SmallVector<Value> otherElems;
25632564
Value llOther = adaptor.getOther();
25642565
DenseElementsAttr constAttr;
2565-
if (other)
2566+
if (other) {
25662567
if (matchPattern(other, m_Constant(&constAttr)) && constAttr.isSplat()) {
25672568
Type elemTy = constAttr.getElementType();
25682569
auto handleSplatValue = [&](auto splatVal) {
@@ -2583,6 +2584,7 @@ struct LoadOpToBlockIOConversion
25832584
} else {
25842585
otherElems = unpackLLElements(loc, llOther, rewriter);
25852586
}
2587+
}
25862588

25872589
unsigned threadsPerWarp =
25882590
TritonGPUDialect::getThreadsPerWarp(op->getParentOfType<ModuleOp>());

0 commit comments

Comments
 (0)