From 1548bb13d754069ab67657741fab5d97a52584ca Mon Sep 17 00:00:00 2001 From: akrieger <667719+akrieger@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:25:49 -0700 Subject: [PATCH] Force -O3 for executorch op_div.cpp in "clang 17" also (#13660) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/13660 Some platforms use clang 19 under the hood but are setting the clang 17 constraint for bad reasons. Reviewed By: swolchok Differential Revision: D80980948 --- .../executorch/kernels/optimized/op_registration_util.bzl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl b/shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl index 5a0b509ed06..ae1a6b83859 100644 --- a/shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl +++ b/shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl @@ -174,9 +174,10 @@ OPTIMIZED_ATEN_OPS = ( # is not sufficient to avoid it. compiler_flags = [] if runtime.is_oss else select({ "DEFAULT": [], - "ovr_config//toolchain/clang/constraints:19": select({ + "ovr_config//os:android": select({ "DEFAULT": [], - "ovr_config//os:android": ["-O3"], + "ovr_config//toolchain/clang/constraints:17": ["-O3"], + "ovr_config//toolchain/clang/constraints:19": ["-O3"], }), }), deps = [