From ef8d2e0d5adc3170955d98a2cf33b19099d965a8 Mon Sep 17 00:00:00 2001 From: Naoya Maruyama Date: Thu, 12 Dec 2024 18:14:16 -0800 Subject: [PATCH] Don't disable ExprSimplify in shouldUseZero --- csrc/id_model/utils.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/csrc/id_model/utils.h b/csrc/id_model/utils.h index 6926ea6e779..c0f73d0f8c3 100644 --- a/csrc/id_model/utils.h +++ b/csrc/id_model/utils.h @@ -159,6 +159,12 @@ inline bool shouldUseZeroIndex( // Trivial loop auto promotion_id = getLoopPromotion(loop_group->front()->as(), id_model); + + // ExprSimplify should be disabled here as it would fail to + // recognize size-one IterDomain. + DisableOptionsGuard options_guard; + DisableOptionsGuard::getCurOptions().unset(DisableOption::ExprSimplify); + if (promotion_id->isBroadcast() || simplifyExpr(promotion_id->extent())->isOneInt()) { return true;