Issue |
146629
|
Summary |
[mlir][support] Operation::getRawDictionaryAttrs return value that does not meet expectations
|
Labels |
bug
|
Assignees |
|
Reporter |
lipracer
|
When I wanted to obtain a list of attributes from `Operation` that were declared in the same order as the tbgen file, I found this method defined in `Operation.h:509 getRawDictionaryAttrs `, but this method returns an empty list. Here is a simple test:
```
constexpr char ir[] = R"(
func.func @test_unary_f32(%arg0 : tensor<4xf32>) -> () {
%2 = tosa.clamp %arg0 { min_val = 0.0 : f32, max_val = 10.0 : f32 } : (tensor<4xf32>) -> tensor<*xf32>
return
}
)";
TEST(OperationAttribueTest, getRawDictionaryAttrs) {
MLIRContext context;
context.getOrLoadDialect<tosa::TosaDialect>();
context.getOrLoadDialect<func::FuncDialect>();
auto module =
mlir::parseSourceString<mlir::ModuleOp>(ir, mlir::ParserConfig{&context});
auto clampOp =
&module->getBodyRegion().front().front().getRegion(0).front().front();
clampOp->dump();
llvm::errs() << clampOp->getRawDictionaryAttrs() << "\n";
}
```
and test output:
```
%0 = tosa.clamp %arg0 { min_val = 0.0 : f32, max_val = 10.0 : f32 } : (tensor<4xf32>) -> tensor<*xf32>
{}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs