Closed MaheshRavishankar closed 4 years ago
@MaheshRavishankar thanks for report, this is looks like my fault, I'll take it in couple of hours.
@MaheshRavishankar can you please provide the flags with which the error appears? I just cannot reproduce it on my machine and mlir on master with flags:
mlir-opt module.mlir -pass-pipeline='module(canonicalize)'
mlir-opt module.mlir -pass-pipeline='func(canonicalize)'
By the way, it seems like only few ops from SPIR-V dialect have canonicalizer:
spv.AccessChain, spv.Bitcast, spv.selection, spv.LogicalNot
and it does not look like this example contains those ops.
Thanks.
Thanks @denis0x0D . I just ran using -canonicalize
flag.
I haven't triaged it at all. So it might not be related to spv canonicalizations specifically
@MaheshRavishankar oh, now I see the same, seems like a check for null attribute is needed in fold
for CompositeExtract.
#10 0x0000561dc79a5748 bool mlir::Attribute::isa<mlir::ElementsAttr>() const /home/llvm-project/llvm/projects/mlir/include/mlir/IR/Attributes.h:1341:20
#11 0x0000561dc7ab2792 mlir::ElementsAttr mlir::Attribute::dyn_cast<mlir::ElementsAttr>() const /home/llvm-project/llvm/projects/mlir/include/mlir/IR/Attributes.h:1344:40
#12 0x0000561dc7a1bd2c extractCompositeElement(mlir::Attribute, llvm::ArrayRef<unsigned int>) /home/llvm-project/llvm/projects/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp:342:55
#13 0x0000561dc7a21621 mlir::spirv::CompositeExtractOp::fold(llvm::ArrayRef<mlir::Attribute>) /home/llvm-project/llvm/projects/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp:1052:58
By the way, I'm not super familiar about how folding works in MLIR, and it would be good if I can take this bug and fix tomorrow, if it can wait, thanks!
Thanks for the investigation, @denis0x0D! Yes this can wait so if you'd like to take a look and fix it, that'd be awesome! :)
Thanks for the investigation, @denis0x0D! Yes this can wait so if you'd like to take a look and fix it, that'd be awesome! :)
Fixed via #281. Thanks Denis!
Running canonicalization on this module leads to an assertion failure
I get the following assert message