mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-29 16:41:27 +00:00
[mlir][Shape] Fix a crash when folding nary broadcast ops
operands[2] can be nullptr here. I'm not able to build a lit test for this because of the commutative reordering of operands. It's possible to trigger this with a createOrFold<BroadcastOp> though. Differential Revision: https://reviews.llvm.org/D97206
This commit is contained in:
parent
55dff8b2e4
commit
ed4d12c2ce
@ -358,7 +358,7 @@ OpFoldResult BroadcastOp::fold(ArrayRef<Attribute> operands) {
|
||||
return nullptr;
|
||||
|
||||
// TODO: Support folding with more than 2 input shapes
|
||||
if (operands.size() > 2 && !operands[2].isa<StringAttr>())
|
||||
if (shapes().size() > 2)
|
||||
return nullptr;
|
||||
|
||||
auto rhsShape = llvm::to_vector<6>(
|
||||
|
Loading…
Reference in New Issue
Block a user