================
@@ -60,3 +60,31 @@ cir.func @c() {
// CHECK: cir.label "label1"
----------------
Andres-Salamanca wrote:
Should we add a test covering the case where a `LabelOp` is placed in the entry
block?
LLVM does not permit branches targeting the entry block. That's why both CIRGen
and the lowering check `currBlock->isEntryBlock()` and, if necessary, create a
new block containing the `LabelOp`, branching to that block instead.
Should `GotoSolver` handle this case as well? For example, if it directly
receives a target `LabelOp` in the entry block, should it also create the
additional block before resolving the goto?
Alternatively, would it make sense to enforce this as an IR invariant by adding
a verifier to `LabelOp` that rejects labels in the entry block?
https://github.com/llvm/llvm-project/pull/206176
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits