[flang-commits] [PATCH] D113976: [fir] Add fir.cmpc conversion

Diana Picus via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Nov 16 02:50:35 PST 2021


rovka added inline comments.


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:503
+    mlir::MLIRContext *ctxt = cmp.getContext();
+    mlir::Type eleTy = convertType(getComplexEleTy(cmp.lhs().getType()));
+    mlir::Type resTy = convertType(cmp.getType());
----------------
kiranchandramohan wrote:
> rovka wrote:
> > I modified this to use getComplexEleTy instead of [[ https://github.com/flang-compiler/f18-llvm-project/blob/a2233bff405a91e8e6af23214eab2df42f2a69f9/flang/lib/Optimizer/CodeGen/CodeGen.cpp#L794 | reconstructing ]] it. Hope it's fine.
> The previous code kind of assumes the complex types are of FIR type. The new code accommodates both (FIR and mlir complex).
> 
> If the conversion supports both then we should have a test for mlir complex as well.
I don't think we can get past parsing or other things with a MLIR complex (FIROps.td says the inputs to cmpc are fir_ComplexType). So we'll never take that branch in getComplexEleTy.


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

https://reviews.llvm.org/D113976



More information about the flang-commits mailing list