@@ -159,6 +159,107 @@ struct SimplifySelect : public OpRewritePattern
{
}
};
+/// Simplify `cir.switch` operations by folding cascading cases
+/// into a single `cir.case` with the `anyof` kind.
+///
+/// This pattern identifies cascading cases within a `cir.switch` operati
@@ -186,7 +288,7 @@ void CIRSimplifyPass::runOnOperation() {
// Collect operations to apply patterns.
llvm::SmallVector ops;
getOperation()->walk([&](Operation *op) {
-if (isa(op))
+if (isa(op))
bcardosolopes wrote:
Can you double check if the te
https://github.com/bcardosolopes edited
https://github.com/llvm/llvm-project/pull/140649
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bcardosolopes commented:
Overall looks good, some inline comments.
https://github.com/llvm/llvm-project/pull/140649
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (Andres-Salamanca)
Changes
This PR introduces a new **CIR simplify for `switch` cases**, which folds
multiple **cascading `Equal` cases** (that contain only a `YieldOp`) into a
single `CaseOp` of kind `AnyOf`.
This logic is based on
llvmbot wrote:
@llvm/pr-subscribers-clangir
Author: None (Andres-Salamanca)
Changes
This PR introduces a new **CIR simplify for `switch` cases**, which folds
multiple **cascading `Equal` cases** (that contain only a `YieldOp`) into a
single `CaseOp` of kind `AnyOf`.
This logic is based
https://github.com/Andres-Salamanca created
https://github.com/llvm/llvm-project/pull/140649
This PR introduces a new **CIR simplify for `switch` cases**, which folds
multiple **cascading `Equal` cases** (that contain only a `YieldOp`) into a
single `CaseOp` of kind `AnyOf`.
This logic is bas