Skip to content

Commit

Permalink
Fix error message if no device.
Browse files Browse the repository at this point in the history
We need to return with an error message, or later code will
segfault.
  • Loading branch information
stephenneuendorffer committed Aug 28, 2023
1 parent 06d7183 commit bae0a2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Targets/AIETargetXAIEV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ mlir::LogicalResult AIETranslateToXAIEV2(ModuleOp module, raw_ostream &output) {
DenseMap<Operation *, SwitchboxOp> switchboxes;

if (module.getOps<DeviceOp>().empty()) {
module.emitOpError("expected AIE.device operation at toplevel");
return module.emitOpError("expected AIE.device operation at toplevel");
}
DeviceOp targetOp = *(module.getOps<DeviceOp>().begin());
const auto &target_model = targetOp.getTargetModel();
Expand Down

0 comments on commit bae0a2b

Please sign in to comment.