mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[CMake] Remove forcing of -O2
from torch_compile_options
(#164894)
That was introduced by 75a65ffe0f
Hattip to @jathu for alerting me about the issue. As result, all our PyTorch builds were shipped with `-O2` for almost all of its modern history
Partially undo the damage introduced by https://github.com/pytorch/pytorch/pull/128406 that cause cross-ISA symbols leak, to be properly followed up in https://github.com/pytorch/pytorch/issues/165123
Pull Request resolved: https://github.com/pytorch/pytorch/pull/164894
Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
df514a6d5a
commit
9a3c4b917e
@ -439,10 +439,6 @@ function(torch_compile_options libname)
|
||||
$<$<COMPILE_LANGUAGE:CXX>: -fvisibility=hidden>)
|
||||
endif()
|
||||
|
||||
# Use -O2 for release builds (-O3 doesn't improve perf, and -Os results in perf regression)
|
||||
target_compile_options(${libname} PRIVATE
|
||||
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>>:-O2>)
|
||||
|
||||
endfunction()
|
||||
|
||||
##############################################################################
|
||||
@ -530,4 +526,4 @@ function(target_link_options_if_supported tgt flag)
|
||||
else()
|
||||
message(WARNING "Attempted to use unsupported link option : ${flag}.")
|
||||
endif()
|
||||
endfunction()
|
||||
endfunction()
|
||||
|
Reference in New Issue
Block a user