[fir] Set !fir.len_param_index conversion to unimplemented

This patch is part of the upstreaming effort from fir-dev.

The conversion of len_param_index in fir-dev is incomplete, so for now
we're marking this as unimplemented until we can settle on a design for
the runtime support of LEN parameters.

Differential Revision: https://reviews.llvm.org/D114241

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
This commit is contained in:
Diana Picus 2021-11-18 12:40:48 +00:00
parent f66b69a392
commit cdc476ab2f
2 changed files with 33 additions and 8 deletions

View File

@ -827,6 +827,20 @@ struct GlobalLenOpConversion : public FIROpConversion<fir::GlobalLenOp> {
}
};
/// 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 @@ public:
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);

View File

@ -86,6 +86,16 @@ fir.global @global_derived : !fir.type<minez(f:i32)> {
// -----
// Test `fir.len_param_index` conversion failure. Not implemented yet.
func @lenparamindex() {
// expected-error@+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() {