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

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 11 01:51:54 PST 2021


kiranchandramohan accepted this revision.
kiranchandramohan added a comment.

LGTM. Accepting since others are Nit 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");
----------------
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
```


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