[PATCH] D112961: [fir] Add fir.extract_value and fir.insert_value conversion
    Mehdi AMINI via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Nov  4 18:31:26 PDT 2021
    
    
  
mehdi_amini added inline comments.
================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:230-235
+    auto *defOp = value.getDefiningOp();
+    if (auto v = dyn_cast<mlir::LLVM::ConstantOp>(defOp))
+      return v.value();
+    if (auto v = dyn_cast<mlir::arith::ConstantOp>(defOp))
+      return v.value();
+    llvm_unreachable("must be a constant op");
----------------
(this is the canonical/generic way of handling constants)
================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:237
+    return {};
+  }
+
----------------
Function isn't used?
================
Comment at: flang/lib/Optimizer/CodeGen/TypeConverter.h:143
+    return mlir::Type();
   }
 
----------------
Is all the code related to the box type conversion coupled to the rest of this patch? I don't see where it is tested and it seems that the tests for  fir.extract_value and fir.insert_value lowering aren't involving the box type?
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112961/new/
https://reviews.llvm.org/D112961
    
    
More information about the llvm-commits
mailing list