Skip to content

Commit 976d502

Browse files
authored
Force -O3 for executorch op_div.cpp in clang 19
Differential Revision: D80374269 Pull Request resolved: #13480
1 parent 83749ae commit 976d502

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,17 @@ OPTIMIZED_ATEN_OPS = (
165165
),
166166
op_target(
167167
name = "op_div",
168+
# A bug in instruction selection in clang 19 for android seems to trigger some
169+
# terrible, multiple hour, backend generation when building for asan with thinlto.
170+
# generally maybe a good idea to just make this fully optimized anyway, but -O2
171+
# is not sufficient to avoid it.
172+
compiler_flags = [] if runtime.is_oss else select({
173+
"DEFAULT": [],
174+
"ovr_config//toolchain/clang/constraints:19": select({
175+
"DEFAULT": [],
176+
"ovr_config//os:android": ["-O3"],
177+
}),
178+
}),
168179
deps = [
169180
":binary_ops",
170181
"//executorch/kernels/portable/cpu:scalar_utils",

0 commit comments

Comments
 (0)