[PATCH] D114241: [fir] Add !fir.len_param_index conversion
Diana Picus via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 22 04:06:36 PST 2021
rovka updated this revision to Diff 388870.
rovka added a comment.
Bail out until we finalize the design.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114241/new/
https://reviews.llvm.org/D114241
Files:
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/test/Fir/convert-to-llvm-invalid.fir
Index: flang/test/Fir/convert-to-llvm-invalid.fir
===================================================================
--- flang/test/Fir/convert-to-llvm-invalid.fir
+++ flang/test/Fir/convert-to-llvm-invalid.fir
@@ -86,6 +86,16 @@
// -----
+// Test `fir.len_param_index` conversion failure. Not implemented yet.
+
+func @lenparamindex() {
+ // expected-error at +1{{failed to legalize operation 'fir.len_param_index'}}
+ %0 = fir.len_param_index l1, !fir.type<twolens(l1:i32, l2:i32){i:i32, f:f32, l:i64}>
+ return
+}
+
+// -----
+
// Test `fir.gentypedesc` conversion failure. Not implemented yet.
func @gentypedesc() {
Index: flang/lib/Optimizer/CodeGen/CodeGen.cpp
===================================================================
--- flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -827,6 +827,20 @@
}
};
+/// Lower fir.len_param_index
+struct LenParamIndexOpConversion
+ : public FIROpConversion<fir::LenParamIndexOp> {
+ using FIROpConversion::FIROpConversion;
+
+ // FIXME: this should be specialized by the runtime target
+ mlir::LogicalResult
+ matchAndRewrite(fir::LenParamIndexOp lenp, OpAdaptor,
+ mlir::ConversionPatternRewriter &rewriter) const override {
+ return rewriter.notifyMatchFailure(
+ lenp, "fir.len_param_index codegen is not implemented yet");
+ }
+};
+
/// Lower `fir.gentypedesc` to a global constant.
struct GenTypeDescOpConversion : public FIROpConversion<fir::GenTypeDescOp> {
using FIROpConversion::FIROpConversion;
@@ -2179,14 +2193,15 @@
EmboxProcOpConversion, ExtractValueOpConversion, FieldIndexOpConversion,
FirEndOpConversion, HasValueOpConversion, GenTypeDescOpConversion,
GlobalLenOpConversion, GlobalOpConversion, InsertOnRangeOpConversion,
- InsertValueOpConversion, IsPresentOpConversion, LoadOpConversion,
- NegcOpConversion, NoReassocOpConversion, MulcOpConversion,
- SelectCaseOpConversion, SelectOpConversion, SelectRankOpConversion,
- SelectTypeOpConversion, ShapeOpConversion, ShapeShiftOpConversion,
- ShiftOpConversion, SliceOpConversion, StoreOpConversion,
- StringLitOpConversion, SubcOpConversion, UnboxCharOpConversion,
- UnboxProcOpConversion, UndefOpConversion, UnreachableOpConversion,
- ZeroOpConversion>(typeConverter);
+ InsertValueOpConversion, IsPresentOpConversion,
+ LenParamIndexOpConversion, LoadOpConversion, NegcOpConversion,
+ NoReassocOpConversion, MulcOpConversion, SelectCaseOpConversion,
+ SelectOpConversion, SelectRankOpConversion, SelectTypeOpConversion,
+ ShapeOpConversion, ShapeShiftOpConversion, ShiftOpConversion,
+ SliceOpConversion, StoreOpConversion, StringLitOpConversion,
+ SubcOpConversion, UnboxCharOpConversion, UnboxProcOpConversion,
+ UndefOpConversion, UnreachableOpConversion, ZeroOpConversion>(
+ typeConverter);
mlir::populateStdToLLVMConversionPatterns(typeConverter, pattern);
mlir::arith::populateArithmeticToLLVMConversionPatterns(typeConverter,
pattern);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114241.388870.patch
Type: text/x-patch
Size: 3170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211122/1ad7ce6f/attachment.bin>
More information about the llvm-commits
mailing list