[PATCH] D113484: [fir] Add fir.select_case conversion

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 11 05:04:46 PST 2021


clementval marked 2 inline comments as done.
clementval added inline comments.


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:378
+    mlir::Value selector = caseOp.getSelector(adaptor.getOperands());
+    auto loc = caseOp.getLoc();
+    assert(conds > 0 && "fir.selectcase must have cases");
----------------
kiranchandramohan wrote:
> clementval wrote:
> > kiranchandramohan wrote:
> > > No change requested: Would using this same location for branches of individual cases be correct?
> > Not sure what do mean here. We are using the same location right now. 
> I meant that the individual cases (for e.g case 1, case 2 below) have different locations in the source file. So the comparisons corresponding to the cases should ideally use the location of the individual cases.
> ```
> select case
> case 1:
> case 2:
> end select
> ```
Ok I get it. Will check if I can update that easily


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:379
+    auto loc = caseOp.getLoc();
+    assert(conds > 0 && "fir.selectcase must have cases");
+    for (unsigned t = 0; t != conds; ++t) {
----------------
kiranchandramohan wrote:
> Nit: Should this be part of the verifier (also)?
This is checked in the verifier in a slightly different way. I'll just drop it here. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113484



More information about the llvm-commits mailing list