[PATCH] D119429: [flang] Lower simple RETURN statement

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 10 05:49:25 PST 2022


kiranchandramohan added inline comments.


================
Comment at: flang/lib/Lower/Bridge.cpp:679
+    }
+    builder->create<mlir::cf::BranchOp>(loc, funit->finalBlock);
   }
----------------
kiranchandramohan wrote:
> Is this branch necessary? The branch seems to be added in 343 of `genProcedureExit`.

Scratch that. It is probably needed for situations like the following code. Can you have a look and add this test instead?

```
subroutine sub2()
  goto 3
  2 return
  3 goto 2
end
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119429/new/

https://reviews.llvm.org/D119429



More information about the llvm-commits mailing list