You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/19 10:37:16 UTC
[GitHub] [incubator-nuttx] anchao opened a new pull request, #6105: arch/clang: add support for Clang LTO
anchao opened a new pull request, #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105
## Summary
arch/clang: add support for Clang LTO
add support of Clang's Link Time Optimization (LTO) on NuttX build system
Reference:
https://llvm.org/docs/LinkTimeOptimization.html
Signed-off-by: chao.an <an...@xiaomi.com>
## Impact
Clang + LTO
## Testing
1. Code Size
![b0a1bc5f-467f-4e24-af8a-99b479c5566a](https://user-images.githubusercontent.com/758493/163985684-bd94e0cc-806d-4b57-b679-2421056b12c0.png)
![bb8f21a8-512d-4520-b377-61ae50466d7f](https://user-images.githubusercontent.com/758493/163985766-84d64a74-a12f-428c-9746-123663057b96.png)
2. Coremark
![27b43ea1-aeec-4e60-ab0e-568194c9d895](https://user-images.githubusercontent.com/758493/163985814-502b0560-224c-495c-ab11-2a08ad452f25.png)
![0fe9284c-18d2-41d8-8040-fbfb88b091f1](https://user-images.githubusercontent.com/758493/163985831-79de68d7-404d-49d2-b0db-fb88c2f5dfff.png)
3. LVGL BenchMark
Weighted FPS
![f0999f8a-c2d9-4a75-99a3-752bee15ad86](https://user-images.githubusercontent.com/758493/163985938-322076eb-9f11-4d88-8905-a7b50b0e0fff.png)
![49a42f87-79bb-4100-b0e2-0e139a666896](https://user-images.githubusercontent.com/758493/163985949-f2d31258-4e8c-4c1a-87ca-049158c1f5c4.png)
All Cases
![8183bda1-bcec-4225-b906-b1d3ad79b863](https://user-images.githubusercontent.com/758493/163986045-02e5a1fd-767a-4eb8-a19f-9768a7388cc1.png)
![3071c750-af0f-412c-b454-4846e437416a](https://user-images.githubusercontent.com/758493/163986063-8856b914-80e4-4e96-8220-6ab460d59fb4.png)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
anchao commented on PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#issuecomment-1102488930
Depends on: https://github.com/apache/incubator-nuttx/pull/6097
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#discussion_r853221671
##########
arch/Kconfig:
##########
@@ -222,6 +222,57 @@ config ARCH_TOOLCHAIN_GNU
bool
default n
+config ARCH_TOOLCHAIN_CLANG
Review Comment:
let's add a new patch to support clang on armv6-m too.
##########
arch/arm/src/armv8-m/Toolchain.defs:
##########
@@ -65,6 +65,12 @@ else
MAXOPTIMIZATION ?= -Os
endif
+ifeq ($(CONFIG_LTO_CLANG_THIN),y)
Review Comment:
let's move to clang specific section
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#issuecomment-1102502498
@anchao have you tried GCC `Os` + `lto`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
anchao commented on PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#issuecomment-1102575346
> @anchao have you tried GCC `Os` + `lto`?
Not yet, will add gcc lto + link plugin support later
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#discussion_r854234212
##########
arch/Kconfig:
##########
@@ -222,6 +222,49 @@ config ARCH_TOOLCHAIN_GNU
bool
default n
+config ARCH_TOOLCHAIN_CLANG
+ bool
+ select ARCH_TOOLCHAIN_GNU
+ default n
+
+choice
+ prompt "Link Time Optimization (LTO)"
+ default LTO_NONE
+ ---help---
+ This option enables Link Time Optimization (LTO), which allows the
+ compiler to optimize binaries globally.
+
+ If unsure, select LTO_NONE. Note that LTO is very resource-intensive
+ so it's disabled by default.
+
+config LTO_NONE
+ bool "None"
+ help
+ Build the kernel normally, without Link Time Optimization (LTO).
Review Comment:
please use TABs only in Kconfig files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
anchao commented on PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#issuecomment-1106015800
> > @anchao have you tried GCC `Os` + `lto`?
>
> Not yet, will add gcc lto + link plugin support later
Update performance profiling data of GCC lto on below PR:
https://github.com/apache/incubator-nuttx/pull/6123
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#discussion_r854170140
##########
arch/arm/src/armv8-m/Toolchain.defs:
##########
@@ -65,6 +65,12 @@ else
MAXOPTIMIZATION ?= -Os
endif
+ifeq ($(CONFIG_LTO_CLANG_THIN),y)
Review Comment:
Done
##########
arch/Kconfig:
##########
@@ -222,6 +222,57 @@ config ARCH_TOOLCHAIN_GNU
bool
default n
+config ARCH_TOOLCHAIN_CLANG
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#discussion_r854239457
##########
arch/Kconfig:
##########
@@ -222,6 +222,49 @@ config ARCH_TOOLCHAIN_GNU
bool
default n
+config ARCH_TOOLCHAIN_CLANG
+ bool
+ select ARCH_TOOLCHAIN_GNU
+ default n
+
+choice
+ prompt "Link Time Optimization (LTO)"
+ default LTO_NONE
+ ---help---
+ This option enables Link Time Optimization (LTO), which allows the
+ compiler to optimize binaries globally.
+
+ If unsure, select LTO_NONE. Note that LTO is very resource-intensive
+ so it's disabled by default.
+
+config LTO_NONE
+ bool "None"
+ help
+ Build the kernel normally, without Link Time Optimization (LTO).
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#issuecomment-1103249944
@anchao
I think the results are very interesting.
Please add descriptions such as CPU arch and board config to the summary.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on pull request #6105: arch/clang: add support for Clang LTO
Posted by GitBox <gi...@apache.org>.
anchao commented on PR #6105:
URL: https://github.com/apache/incubator-nuttx/pull/6105#issuecomment-1103463134
> @anchao
>
> I think the results are very interesting. Please add descriptions such as CPU arch and board config to the summary.
@masayuki2009 architecture information and board config has been updated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org