[PATCH] D113484: [fir] Add fir.select_case conversion
Kiran Chandramohan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 10 17:48:06 PST 2021
kiranchandramohan added inline comments.
================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:376
+ // Type can be CHARACTER, INTEGER, or LOGICAL (C1145)
+ LLVM_ATTRIBUTE_UNUSED auto ty = caseOp.getSelector().getType();
+ mlir::Value selector = caseOp.getSelector(adaptor.getOperands());
----------------
Nit: Should we have a notify failure for the character case?
================
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");
----------------
No change requested: Would using this same location for branches of individual cases be correct?
================
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) {
----------------
Nit: Should this be part of the verifier (also)?
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