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

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 11 05:58:58 PST 2021


kiranchandramohan 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");
----------------
clementval wrote:
> clementval wrote:
> > 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
> I have tried to retrieved the loc from the case arg but it seems to be null. It's probably something taht will take more time to be fined tune. 
OK. We can work on it a separate patch.


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