Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/SCF/SCF.cpp | ||
---|---|---|
1384–1385 | Does !llvm::hasSingleElement(*elseBlock) work? I thought it should be something like elseBlock->begin() != elseBlock->end()? It could have two or more operations in the else branch right? | |
1389 | They are probably no difference in this case, but I would prefer to use replaceOp here. | |
mlir/test/Dialect/SCF/canonicalize.mlir | ||
492–494 | Revert this part? |
mlir/lib/Dialect/SCF/SCF.cpp | ||
---|---|---|
1384–1385 | The pattern is trying to remove and empty else block. So basically the case where the else block has a single scf.yield operation (it will always have an scf.yield op). If that is not the case, then the else block is kept as is. |
mlir/lib/Dialect/SCF/SCF.cpp | ||
---|---|---|
1384–1385 | I see, thanks for the explanation. |
Does !llvm::hasSingleElement(*elseBlock) work? I thought it should be something like elseBlock->begin() != elseBlock->end()? It could have two or more operations in the else branch right?