-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
Description
There seems to be some unexpected issue in the bytecode rountrip. When running mlir-opt -verify-roundtrip with the following input, the property parsing explodes.
llvm.func @foo()
llvm.func @repro(%val: f32) {
llvm.call @foo() : () -> ()
%t = arith.addf %val, %val : f32
llvm.return
}
Crash log:
loc("-":8:10): error: invalid properties {fastmath = #llvm.fastmath<none>} for op arith.addf: Invalid attribute `fastmath` in property conversion: #llvm.fastmath<none>
repro.mlir:0:0: error: 'builtin.module' op failed to parse textual content back, cannot verify round-trip.
repro.mlir:0:0: note: see current operation:
"builtin.module"() ({
"llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<void ()>, linkage = #llvm.linkage<external>, sym_name = "foo", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
}) : () -> ()
"llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<void (f32)>, linkage = #llvm.linkage<external>, sym_name = "repro", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
^bb0(%arg0: f32):
"llvm.call"() <{CConv = #llvm.cconv<ccc>, TailCallKind = #llvm.tailcallkind<none>, callee = @foo, fastmathFlags = #llvm.fastmath<none>, op_bundle_sizes = array<i32>, operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
%0 = "arith.addf"(%arg0, %arg0) <{fastmath = #arith.fastmath<none>}> : (f32, f32) -> f32
"llvm.return"() : () -> ()
}) : () -> ()
}) : () -> ()
loc("-":0:0): error: expected mlir::arith::FastMathFlagsAttr, but got: #llvm.fastmath<none>
repro.mlir:0:0: error: 'builtin.module' op failed to parse bytecode content back, cannot verify round-trip.
repro.mlir:0:0: note: see current operation:
"builtin.module"() ({
"llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<void ()>, linkage = #llvm.linkage<external>, sym_name = "foo", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
}) : () -> ()
"llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<void (f32)>, linkage = #llvm.linkage<external>, sym_name = "repro", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({
^bb0(%arg0: f32):
"llvm.call"() <{CConv = #llvm.cconv<ccc>, TailCallKind = #llvm.tailcallkind<none>, callee = @foo, fastmathFlags = #llvm.fastmath<none>, op_bundle_sizes = array<i32>, operandSegmentSizes = array<i32: 0, 0>}> : () -> ()
%0 = "arith.addf"(%arg0, %arg0) <{fastmath = #arith.fastmath<none>}> : (f32, f32) -> f32
"llvm.return"() : () -> ()
}) : () -> ()
}) : () -> ()
So far, I'm not entirely sure what might have introduce this breakage. For now, my suspicion is #151267 (FYI: @hankluo6 @joker-eph). I'll try to revert this commit locally to see if that resolves my issue. I'll report back once I gathered insights.