We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
spirv.mlir.loop
LoopPattern
1 parent d8b17f2 commit 17b720eCopy full SHA for 17b720e
mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
@@ -1083,6 +1083,12 @@ class LoopPattern : public SPIRVToLLVMConversion<spirv::LoopOp> {
1083
if (loopOp.getLoopControl() != spirv::LoopControl::None)
1084
return failure();
1085
1086
+ // `spirv.mlir.loop` with empty region is redundant and should be erased.
1087
+ if (loopOp.getBody().empty()) {
1088
+ rewriter.eraseOp(loopOp);
1089
+ return success();
1090
+ }
1091
+
1092
Location loc = loopOp.getLoc();
1093
1094
// Split the current block after `spirv.mlir.loop`. The remaining ops will
0 commit comments