Skip to content

Commit

Permalink
[HAL] Implement AssignLegacyTargetDevices::getDependentDialects. (#19051
Browse files Browse the repository at this point in the history
)

Similar to
ef5cc6e

The pass needs to register related dialects. Those dialects are hidden
behind interfaces (in OOP concept). The child classes already implement
it and the pass needs to register them using the interface method.

Signed-off-by: hanhanW <[email protected]>
  • Loading branch information
hanhanW authored Nov 6, 2024
1 parent 50f32e5 commit e4f3960
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ struct AssignLegacyTargetDevicesPass
using IREE::HAL::impl::AssignLegacyTargetDevicesPassBase<
AssignLegacyTargetDevicesPass>::AssignLegacyTargetDevicesPassBase;

void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<IREE::HAL::HALDialect>();
for (StringRef name : targetRegistry->getRegisteredTargetBackends()) {
targetRegistry->getTargetBackend(name)->getDependentDialects(registry);
}
}

void runOnOperation() override {
auto moduleOp = getOperation();

Expand Down

0 comments on commit e4f3960

Please sign in to comment.