File tree Expand file tree Collapse file tree
lib/Conversion/AIEToConfiguration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -636,9 +636,15 @@ static LogicalResult convertTransactionOpsToMLIR(
636636 // for each blockwrite in the binary, create a GlobalOp with the data at the
637637 // device level
638638 std::vector<memref::GlobalOp> global_data;
639- DeviceOp device = llvm::dyn_cast<DeviceOp>(builder.getBlock ()->getParentOp ());
639+ Operation *parentOp = builder.getBlock ()->getParentOp ();
640+ DeviceOp device = llvm::dyn_cast<DeviceOp>(parentOp);
640641 if (!device) {
641- device = builder.getBlock ()->getParentOp ()->getParentOfType <DeviceOp>();
642+ device = parentOp->getParentOfType <DeviceOp>();
643+ }
644+ if (!device) {
645+ parentOp->emitError (
646+ " expected insertion point to be nested under an aie.device op" );
647+ return failure ();
642648 }
643649 Location loc = device.getLoc ();
644650 {
You can’t perform that action at this time.
0 commit comments