[llvm-branch-commits] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [pstl] Revise IDE folder structure (PR #89755)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89755 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [polly] [polly] Revise IDE folder structure (PR #89752)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89752 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89750 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/89750 >From c3edd260d7a917e120d02253083eb472e0985844 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Tue, 23 Apr 2024 13:27:20 +0200 Subject: [PATCH 1/4] [openmp] Revise IDE folder structure --- offload/unittests/CMakeLists.txt| 2 +- openmp/CMakeLists.txt | 1 + openmp/docs/CMakeLists.txt | 1 + openmp/runtime/cmake/LibompMicroTests.cmake | 5 + openmp/runtime/src/CMakeLists.txt | 7 +++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/offload/unittests/CMakeLists.txt b/offload/unittests/CMakeLists.txt index 73c87b708d25f..c818a3d985ba3 100644 --- a/offload/unittests/CMakeLists.txt +++ b/offload/unittests/CMakeLists.txt @@ -1,5 +1,5 @@ add_custom_target(LibomptUnitTests) -set_target_properties(LibomptUnitTests PROPERTIES FOLDER "Tests/UnitTests") +set_target_properties(LibomptUnitTests PROPERTIES FOLDER "Tests") function(add_libompt_unittest test_dirname) add_unittest(LibomptUnitTests ${test_dirname} ${ARGN}) diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt index 95f2425db3ee6..daef2b77fd4dd 100644 --- a/openmp/CMakeLists.txt +++ b/openmp/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.20.0) +set(LLVM_SUBPROJECT_TITLE "OpenMP") set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) diff --git a/openmp/docs/CMakeLists.txt b/openmp/docs/CMakeLists.txt index 1e4be31a6f609..4cb9fb486ff34 100644 --- a/openmp/docs/CMakeLists.txt +++ b/openmp/docs/CMakeLists.txt @@ -78,6 +78,7 @@ if (LLVM_ENABLE_DOXYGEN) COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating openmp doxygen documentation." VERBATIM) + set_target_properties(doxygen-openmp PROPERTIES FOLDER "OpenMP/Docs") if (LLVM_BUILD_DOCS) add_dependencies(doxygen doxygen-openmp) diff --git a/openmp/runtime/cmake/LibompMicroTests.cmake b/openmp/runtime/cmake/LibompMicroTests.cmake index e8cc218af0c29..6fcde37259931 100644 --- a/openmp/runtime/cmake/LibompMicroTests.cmake +++ b/openmp/runtime/cmake/LibompMicroTests.cmake @@ -126,6 +126,7 @@ macro(libomp_test_touch_recipe test_touch_dir) endmacro() libomp_append(libomp_test_touch_env "KMP_VERSION=1") add_custom_target(libomp-test-touch DEPENDS ${libomp_test_touch_targets}) +set_target_properties(libomp-test-touch PROPERTIES FOLDER "OpenMP/Tests") if(WIN32) libomp_test_touch_recipe(test-touch-mt) libomp_test_touch_recipe(test-touch-md) @@ -135,6 +136,7 @@ endif() # test-relo add_custom_target(libomp-test-relo DEPENDS test-relo/.success) +set_target_properties(libomp-test-relo PROPERTIES FOLDER "OpenMP/Tests") add_custom_command( OUTPUT test-relo/.success test-relo/readelf.log COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-relo @@ -146,6 +148,7 @@ add_custom_command( # test-execstack add_custom_target(libomp-test-execstack DEPENDS test-execstack/.success) +set_target_properties(libomp-test-execstack PROPERTIES FOLDER "OpenMP/Tests") add_custom_command( OUTPUT test-execstack/.success COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-execstack @@ -157,6 +160,7 @@ add_custom_command( # test-instr add_custom_target(libomp-test-instr DEPENDS test-instr/.success) +set_target_properties(libomp-test-instr PROPERTIES FOLDER "OpenMP/Tests") add_custom_command( OUTPUT test-instr/.success COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-instr @@ -168,6 +172,7 @@ add_custom_command( # test-deps add_custom_target(libomp-test-deps DEPENDS test-deps/.success) +set_target_properties(libomp-test-deps PROPERTIES FOLDER "OpenMP/Tests") set(libomp_expected_library_deps) if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(libomp_expected_library_deps libc.so.7 libthr.so.3 libm.so.5) diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index a2468d04e60af..963f14bb7ffc2 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -171,6 +171,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS) # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled. if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING)) add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES}) + set_property(TARGET omp PROPERTY FOLDER "OpenMP/Libraries") # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS}) else() @@ -252,6 +253,7 @@ set(LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER "${LIBOMP_LIBRARY_DIR}" CACHE STRING # Create *.inc before compiling any sources # objects depend on : .inc files add_custom_target(libomp-needed-headers DEPENDS kmp_i18n_id.inc kmp_i18n_default.inc)
[llvm-branch-commits] [mlir] [mlir] Revise IDE folder structure (PR #89749)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89749 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] [lldb] Revise IDE folder structure (PR #89748)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89748 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] [lld] Revise IDE folder structure (PR #89747)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89747 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89746 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/89746 >From 61ffad5a99c584ddb05a32b5d5bf54ecbf6c774b Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Tue, 21 May 2024 22:32:39 +0200 Subject: [PATCH 1/2] [libclc] Revise IDE folder structure --- libclc/CMakeLists.txt| 13 - libclc/cmake/modules/AddLibclc.cmake | 5 - 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt index 5ce1795243085..bacc0d83ba211 100644 --- a/libclc/CMakeLists.txt +++ b/libclc/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.20.0) project( libclc VERSION 0.2.0 LANGUAGES CXX C) +set(LLVM_SUBPROJECT_TITLE "libclc") set(CMAKE_CXX_STANDARD 17) @@ -54,7 +55,10 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DI foreach( tool IN ITEMS clang llvm-as llvm-link opt ) find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH ) add_executable( libclc::${tool} IMPORTED GLOBAL ) - set_target_properties( libclc::${tool} PROPERTIES IMPORTED_LOCATION ${LLVM_TOOL_${tool}} ) + set_target_properties( libclc::${tool} PROPERTIES +IMPORTED_LOCATION ${LLVM_TOOL_${tool}} +FOLDER "libclc/Tools" + ) endforeach() endif() else() @@ -168,6 +172,7 @@ if( LIBCLC_STANDALONE_BUILD ) else() add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp ) endif() +set_target_properties( prepare_builtins PROPERTIES FOLDER "libclc/Codegenning") target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) # These were not properly reported in early LLVM and we don't need them target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) @@ -225,12 +230,14 @@ add_custom_command( COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl DEPENDS ${script_loc} ) add_custom_target( "generate_convert.cl" DEPENDS convert.cl ) +set_target_properties( "generate_convert.cl" PROPERTIES FOLDER "libclc/Codegenning" ) add_custom_command( OUTPUT clspv-convert.cl COMMAND ${Python3_EXECUTABLE} ${script_loc} --clspv > clspv-convert.cl DEPENDS ${script_loc} ) add_custom_target( "clspv-generate_convert.cl" DEPENDS clspv-convert.cl ) +set_target_properties( "clspv-generate_convert.cl" PROPERTIES FOLDER "libclc/Codegenning" ) enable_testing() @@ -394,6 +401,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) DEPENDS ${builtins_link_lib} ) add_custom_target( "prepare-${spv_suffix}" ALL DEPENDS "${spv_suffix}" ) + set_target_properties( "prepare-${spv_suffix}" PROPERTIES FOLDER "libclc/Codegenning" ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" ) else() @@ -410,6 +418,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) ) set_target_properties( ${builtins_opt_lib_tgt} PROPERTIES TARGET_FILE ${builtins_opt_lib_tgt}.bc + FOLDER "libclc/Device IR/Opt" ) set( builtins_opt_lib $ ) @@ -420,6 +429,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib} DEPENDS ${builtins_opt_lib} prepare_builtins ) add_custom_target( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} ) + set_target_properties( "prepare-${obj_suffix}" PROPERTIES FOLDER "libclc/Device IR/Prepare" ) # nvptx-- targets don't include workitem builtins if( NOT clang_triple MATCHES ".*ptx.*--$" ) @@ -434,6 +444,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) add_custom_target( ${alias_suffix} ALL COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} ${alias_suffix} DEPENDS prepare-${obj_suffix} ) +set_target_properties( "${alias_suffix}" PROPERTIES FOLDER "libclc/Device IR/Aliases" ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" ) endforeach( a ) endif() diff --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake index 7f4620fa6a21d..0276c145ff20a 100644 --- a/libclc/cmake/modules/AddLibclc.cmake +++ b/libclc/cmake/modules/AddLibclc.cmake @@ -110,7 +110,10 @@ function(link_bc) ) add_custom_target( ${ARG_TARGET} ALL DEPENDS ${ARG_TARGET}.bc ) - set_target_properties( ${ARG_TARGET} PROPERTIES TARGET_FILE ${ARG_TARGET}.bc ) + set_target_properties( ${ARG_TARGET} PROPERTIES +TARGET_FILE ${ARG_TARGET}.bc +FOLDER "libclc/Device IR/Linking" + ) endfunction() # Decomposes and returns variables based on a libclc triple and architecture >From 015bf75aa9277c516b229e3c7412470da70b2d8b Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Sat, 25 May 2024 13:36:12 +0200 Subject: [PATCH 2/2] Address review from #89750 --- libclc/CMakeLists.txt | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff
[llvm-branch-commits] [flang] [flang] Revise IDE folder structure (PR #89745)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89745 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [compiler-rt] Revise IDE folder structure (PR #89753)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89753 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [lldb] [llvm] [mlir] [clang-tools-extra] Revise IDE folder structure (PR #89744)
Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,"A. Jiang" ,Dave Lee ,Vassil Vassilev ,Konstantin Zhuravlyov ,Matt Arsenault ,Jordan Rupprecht ,Zaara Syeda ,Vlad Serebrennikov ,Matt Arsenault ,Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Matt Arsenault ,Valentin Clement =?utf-8?q?,?�ron Ballman ,Matt Arsenault ,lolloz98 ,Edwin Vane ,Matt Arsenault ,Aaron Ballman ,Aaron Ballman ,Aaron Ballman , Martin =?utf-8?q?Storsjö?= ,Thurston Dang ,Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Craig Topper ,Vlad Serebrennikov ,Igor Kudrin ,shaw young <58664393+shawbyo...@users.noreply.github.com>,Amir Ayupov ,Thurston Dang ,Andrew Browne ,Vlad Serebrennikov ,Louis Dionne ,Heejin Ahn ,Petr Hosek ,"Nick Desaulniers (paternity leave)",Thomas Fransham ,Damien L-G ,Michael Jones ,Heewon Cho ,Matheus Izvekov ,Heewon Cho ,Thomas Fransham ,LLVM GN Syncbot ,Evgenii Stepanov ,Joachim Meyer <5982050+fodina...@users.noreply.github.com>,Connor Sughrue <55301806+cpsugh...@users.noreply.github.com>,Jason Molenda ,csstormq ,Amir Ayupov ,Yuxuan Chen ,Wu Yingcong ,Owen Pan ,Amir Ayupov ,Amir Ayupov ,Heejin Ahn ,Shilei Tian ,Mingming Liu ,Pengcheng Wang ,csstormq ,Nikita Popov ,Carlos Alberto Enciso ,AtariDreams ,Nikita Popov ,Ivan Murashko ,Christian Ulmann ,Nikita Popov ,Sander de Smalen ,Felix Schneider ,Yingwei Zheng ,Sven van Haastregt ,Mateusz Zych ,ZhangYin ,Vlad Serebrennikov ,Florian Hahn ,Mark de Wever ,Matt Arsenault ,Kiran Chandramohan ,Momchil Velikov ,Shengchen Kan ,Lukacma ,Timm =?utf-8?q?Bäder?= ,Abid Qadeer ,Simon Pilgrim ,Simon Pilgrim ,Simon Pilgrim , Timm =?utf-8?q?Bäder?= , =?utf-8?q?Balázs_Kéri?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,Tom Eccles ,Carlos Alberto Enciso ,Paul Walker ,Paul Walker ,Paul Walker ,pranavm-nvidia <49246958+pranavm-nvi...@users.noreply.github.com>, Timm =?utf-8?q?Bäder?= ,LLVM GN Syncbot ,Simon Pilgrim , Timm =?utf-8?q?Bäder?= ,Florian Hahn ,Yingwei Zheng ,Krzysztof Parzyszek ,Michael Maitland ,Michael Kruse ,Nikita Popov ,Simon Pilgrim ,Janek van Oirschot , =?utf-8?q?Donát?= Nagy ,Tom Eccles ,Simon Pilgrim , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,Rin Dobrescu ,Corentin Ferry ,Alexey Karyakin ,Ye Luo ,Yingwei Zheng ,Mikhail Goncharov ,YunQiang Su ,Emma Pilkington ,Mikhail Goncharov ,Matt Arsenault ,Mikhail Goncharov ,Jay Foad ,Alexey Bataev ,Matheus Izvekov ,Thomas Symalla <5754458+tsyma...@users.noreply.github.com>,Han-Kuan Chen ,Timm =?utf-8?q?Bäder?= ,Yingwei Zheng ,Yingwei Zheng ,Balazs Benics ,Tom Eccles ,Krzysztof Parzyszek ,Adrian Prantl , Timm =?utf-8?q?Bäder?= ,Sirraide ,Joseph Huber ,Adam Siemieniuk ,Amir Ayupov ,shaw young <58664393+shawbyo...@users.noreply.github.com>,Amir Ayupov ,Sirraide ,Tyler Lanphear ,Heejin Ahn ,Mingming Liu ,Craig Topper ,Kiran Chandramohan ,Kazu Hirata ,Aaron Ballman ,Yingwei Zheng ,Kevin Frei =?utf-8?q?,?�ron Ballman ,Amir Ayupov ,Thomas Fransham ,Alexey Bataev ,Aaron Ballman ,shaw young <58664393+shawbyo...@users.noreply.github.com>,Joseph Huber ,Zaara Syeda ,Sirraide ,Kunwar Grover ,Sirraide ,Daniel Thornburgh ,David Green ,Jay Foad ,Amir Ayupov =?utf-8?q?,?=Matheus Izvekov ,dpalermo ,Louis Dionne ,Boian Petkantchin ,Miguel Saldivar ,Philip Reames ,Chinmay Deshpande ,Amir Ayupov ,Daniel Thornburgh ,Amir Ayupov ,Amir Ayupov ,Kiran Chandramohan ,David Blaikie , Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=, Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Jeremy Kun ,David Blaikie ,Fangrui Song ,Fangrui Song ,Jessica Clarke ,Amir Ayupov =?utf-8?q?,?=Kazu Hirata ,yronglin =?utf-8?q?,?=Charlie Barto ,Ayke ,Freddy Ye ,Freddy Ye ,Kazu Hirata ,Mingming Liu ,NAKAMURA Takumi ,Matt Arsenault ,Johannes Doerfert ,Nikita Popov ,Nikita Popov ,Guray Ozen ,Timm =?utf-8?q?Bäder?= ,Yeting Kuo <46629943+yeti...@users.noreply.github.com>,Matt Arsenault ,Vlad Serebrennikov ,Dhruv Chawla ,Anchu Rajendran S , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,Med Ismail Bennani ,LLVM GN Syncbot ,Med Ismail Bennani ,Mubashar Ahmad ,Alexandros Lamprineas ,Pavel Labath ,csstormq ,Tom Eccles ,Sander de Smalen ,Timm =?utf-8?q?Bäder?= ,Nikita Popov ,Timm =?utf-8?q?Bäder?= ,Dmitry Vasilyev ,Dmitry Vasilyev ,Simon Pilgrim ,Guray Ozen ,Chuanqi Xu ,Pierre van Houtryve ,Chuanqi Xu ,LLVM GN Syncbot , =?utf-8?q?Balázs_Kéri?= ,LLVM GN Syncbot ,Ramkumar Ramachandra , Timm =?utf-8?q?Bäder?= ,Tom Eccles ,Simon Pilgrim ,Jan Patrick Lehr ,Jay Foad ,Hari Limaye ,Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= ,Abid Qadeer ,2LoS ,Matheus Izvekov ,David Spickett ,Vlad Serebrennikov ,Joseph Huber ,Nikita Popov ,Matt Arsenault ,Lukacma ,Lukacma ,Matt Arsenault ,Lukacma ,Lukacma ,Vlad Serebrennikov ,YunQiang Su , Thorsten =?utf-8?q?Schütt?= ,Chuanqi Xu ,Louis Dionne ,Shilei Tian ,Joseph Huber ,Vlad Serebrennikov ,Phoebe Wang ,erichkeane ,Simon Pilgrim ,yronglin ,Vitaly Buka ,yronglin ,cor3ntin ,Fred Grim ,Michael Maitland
[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89743 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Revise IDE folder structure (PR #89742)
https://github.com/Meinersbur reopened https://github.com/llvm/llvm-project/pull/89742 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89746 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang-tools-extra] [clang-tools-extra] Revise IDE folder structure (PR #89744)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89744 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [compiler-rt] Revise IDE folder structure (PR #89753)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89753 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89750 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [pstl] Revise IDE folder structure (PR #89755)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89755 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] [mlir] Revise IDE folder structure (PR #89749)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89749 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] [lldb] Revise IDE folder structure (PR #89748)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89748 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [polly] [polly] Revise IDE folder structure (PR #89752)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89752 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89743 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] [flang] Revise IDE folder structure (PR #89745)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89745 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Revise IDE folder structure (PR #89742)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89742 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] [lld] Revise IDE folder structure (PR #89747)
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/89747 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -9861,13 +9842,19 @@ buildPreInits(ASTContext , /// Build pre-init statement for the given statements. static Stmt *buildPreInits(ASTContext , ArrayRef PreInits) { - if (PreInits.empty()) -return nullptr; - - SmallVector Stmts; - for (Stmt *S : PreInits) -appendFlattendedStmtList(Stmts, S); - return CompoundStmt::Create(Context, PreInits, FPOptionsOverride(), {}, {}); + if (!PreInits.empty()) { +SmallVector Stmts; +for (Stmt *S : PreInits) { + // Do not nest CompoundStmts. + if (auto *CS = dyn_cast(S)) { +llvm::append_range(Stmts, CS->body()); +continue; + } + Stmts.push_back(S); +} +return CompoundStmt::Create(Context, PreInits, FPOptionsOverride(), {}, {}); + } + return nullptr; Meinersbur wrote: I don't know why, but this patch contained the state before #91459's review. Fixed. https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [BOLT][NFCI] Use heuristic for matching split global functions (PR #90429)
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/90429 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [Inline]Update value profile for non-call instructions (PR #83769)
minglotus-6 wrote: Close this. Going to update in https://github.com/llvm/llvm-project/pull/81442 https://github.com/llvm/llvm-project/pull/83769 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [Inline]Update value profile for non-call instructions (PR #83769)
https://github.com/minglotus-6 closed https://github.com/llvm/llvm-project/pull/83769 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [Inline]Update value profile for non-call instructions (PR #83769)
https://github.com/minglotus-6 edited https://github.com/llvm/llvm-project/pull/83769 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/18.x: [DAGCombiner] In mergeTruncStore, make sure we aren't storing shifted in bits. (#90939) (PR #91038)
https://github.com/AtariDreams closed https://github.com/llvm/llvm-project/pull/91038 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] [llvm] release/18.x: [lld] Fix -ObjC load behavior with LTO (#92162) (PR #92478)
https://github.com/AtariDreams closed https://github.com/llvm/llvm-project/pull/92478 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] 50cb216 - Revert "[mlir] Optimize ThreadLocalCache by removing atomic bottleneck (#93270)"
Author: Jacques Pienaar Date: 2024-05-24T07:45:37-07:00 New Revision: 50cb2160464ef916146c199ab8c9fe3ea9f054d6 URL: https://github.com/llvm/llvm-project/commit/50cb2160464ef916146c199ab8c9fe3ea9f054d6 DIFF: https://github.com/llvm/llvm-project/commit/50cb2160464ef916146c199ab8c9fe3ea9f054d6.diff LOG: Revert "[mlir] Optimize ThreadLocalCache by removing atomic bottleneck (#93270)" This reverts commit 1b803fe53dda11ca63f008f5ab8e206f3954ce48. Added: Modified: mlir/include/mlir/Support/ThreadLocalCache.h Removed: diff --git a/mlir/include/mlir/Support/ThreadLocalCache.h b/mlir/include/mlir/Support/ThreadLocalCache.h index d19257bf6e25e..1be94ca14bcfa 100644 --- a/mlir/include/mlir/Support/ThreadLocalCache.h +++ b/mlir/include/mlir/Support/ThreadLocalCache.h @@ -58,12 +58,11 @@ class ThreadLocalCache { /// ValueT. We use a weak reference here so that the object can be destroyed /// without needing to lock access to the cache itself. struct CacheType - : public llvm::SmallDenseMap, ValueT *>> { + : public llvm::SmallDenseMap> { ~CacheType() { // Remove the values of this cache that haven't already expired. for (auto : *this) -if (std::shared_ptr value = it.second.first.lock()) +if (std::shared_ptr value = it.second.lock()) it.first->remove(value.get()); } @@ -72,7 +71,7 @@ class ThreadLocalCache { void clearExpiredEntries() { for (auto it = this->begin(), e = this->end(); it != e;) { auto curIt = it++; -if (curIt->second.first.expired()) +if (curIt->second.expired()) this->erase(curIt); } } @@ -89,27 +88,22 @@ class ThreadLocalCache { ValueT () { // Check for an already existing instance for this thread. CacheType = getStaticCache(); -std::pair, ValueT *> = -staticCache[perInstanceState.get()]; -if (ValueT *value = threadInstance.second) +std::weak_ptr = staticCache[perInstanceState.get()]; +if (std::shared_ptr value = threadInstance.lock()) return *value; // Otherwise, create a new instance for this thread. -{ - llvm::sys::SmartScopedLock threadInstanceLock( - perInstanceState->instanceMutex); - threadInstance.second = - perInstanceState->instances.emplace_back(std::make_unique()) - .get(); -} -threadInstance.first = -std::shared_ptr(perInstanceState, threadInstance.second); +llvm::sys::SmartScopedLock threadInstanceLock( +perInstanceState->instanceMutex); +perInstanceState->instances.push_back(std::make_unique()); +ValueT *instance = perInstanceState->instances.back().get(); +threadInstance = std::shared_ptr(perInstanceState, instance); // Before returning the new instance, take the chance to clear out any used // entries in the static map. The cache is only cleared within the same // thread to remove the need to lock the cache itself. staticCache.clearExpiredEntries(); -return *threadInstance.second; +return *instance; } ValueT *() { return get(); } ValueT *operator->() { return (); } ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang] add fallback to expr in the template differ when comparing ValueDecl (PR #93266)
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93266 >From e74a7e69381731465efb8332890e0ebdc061fbb1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 23 May 2024 23:57:01 -0300 Subject: [PATCH 1/2] [clang] add fallback to expr in the template differ when comparing ValueDecl --- clang/docs/ReleaseNotes.rst | 1 + clang/lib/AST/ASTDiagnostic.cpp | 5 + clang/test/Misc/diag-template-diffing-cxx26.cpp | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 6e8687fadc6f7..5e217a76c81a1 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -784,6 +784,7 @@ Miscellaneous Bug Fixes - Fixed an infinite recursion in ASTImporter, on return type declared inside body of C++11 lambda without trailing return (#GH68775). - Fixed declaration name source location of instantiated function definitions (GH71161). +- Missing fallback to expression in the template differ when comparing ValueDecls. Miscellaneous Clang Crashes Fixed ^ diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp index 7e4a5709a44ce..1885b21178666 100644 --- a/clang/lib/AST/ASTDiagnostic.cpp +++ b/clang/lib/AST/ASTDiagnostic.cpp @@ -1936,6 +1936,11 @@ class TemplateDiff { return; } +if (E) { + PrintExpr(E); + return; +} + OS << "(no argument)"; } diff --git a/clang/test/Misc/diag-template-diffing-cxx26.cpp b/clang/test/Misc/diag-template-diffing-cxx26.cpp index cc174d6c334fb..2b6dd86a9885d 100644 --- a/clang/test/Misc/diag-template-diffing-cxx26.cpp +++ b/clang/test/Misc/diag-template-diffing-cxx26.cpp @@ -19,10 +19,10 @@ namespace GH93068 { // expected-note@#A {{no known conversion from 'A<0>' to 'const A<[1]> &' for 1st argument}} // expected-note@#A {{no known conversion from 'A<0>' to 'A<[1]> &&' for 1st argument}} -// notree-error@#2 {{no viable conversion from 'A' to 'A<(no argument)>'}} +// notree-error@#2 {{no viable conversion from 'A' to 'A'}} /* tree-error@#2 {{no viable conversion A< -[n != (no argument)]>}}*/ +[n != n + 1]>}}*/ A v2 = A(); // #2 // expected-note@#A {{no known conversion from 'A' to 'const A<[1]> &' for 1st argument}} >From 4b12139395d8bcabd053ed6db11aa049ee95d5c3 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 24 May 2024 11:29:13 -0300 Subject: [PATCH 2/2] Update clang/docs/ReleaseNotes.rst Co-authored-by: Erich Keane --- clang/docs/ReleaseNotes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 5e217a76c81a1..a63b0c2460cd7 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -784,7 +784,7 @@ Miscellaneous Bug Fixes - Fixed an infinite recursion in ASTImporter, on return type declared inside body of C++11 lambda without trailing return (#GH68775). - Fixed declaration name source location of instantiated function definitions (GH71161). -- Missing fallback to expression in the template differ when comparing ValueDecls. +- Improve diagnostic output to print an expression instead of 'no argument` when comparing Values as template arguments. Miscellaneous Clang Crashes Fixed ^ ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang] add fallback to expr in the template differ when comparing ValueDecl (PR #93266)
https://github.com/erichkeane approved this pull request. Fine other than the release note not being clear enough https://github.com/llvm/llvm-project/pull/93266 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang] add fallback to expr in the template differ when comparing ValueDecl (PR #93266)
@@ -784,6 +784,7 @@ Miscellaneous Bug Fixes - Fixed an infinite recursion in ASTImporter, on return type declared inside body of C++11 lambda without trailing return (#GH68775). - Fixed declaration name source location of instantiated function definitions (GH71161). +- Missing fallback to expression in the template differ when comparing ValueDecls. erichkeane wrote: ```suggestion - Improve diagnostic output to print an expression instead of 'no argument` when comparing Values as template arguments. ``` Or something like this? https://github.com/llvm/llvm-project/pull/93266 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [Serialization] No transitive identifier change (PR #92085)
@@ -3896,7 +3903,7 @@ void ASTWriter::WriteIdentifierTable(Preprocessor , // Write out identifiers if either the ID is local or the identifier has // changed since it was loaded. - if (ID >= FirstIdentID || !Chain || !II->isFromAST() || + if (isLocalIdentifierID(ID) || !Chain || !II->isFromAST() || jansvoboda11 wrote: This diff makes it seem that `ID >= FirstIdentID` is equivalent to `isLocalIdentifierID(ID)`, which I don't think is the case. Can you explain what's going on here? https://github.com/llvm/llvm-project/pull/92085 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [Serialization] No transitive identifier change (PR #92085)
@@ -918,7 +918,7 @@ ASTSelectorLookupTrait::ReadKey(const unsigned char* d, unsigned) { SelectorTable = Reader.getContext().Selectors; unsigned N = endian::readNext(d); const IdentifierInfo *FirstII = Reader.getLocalIdentifier( - F, endian::readNext(d)); + F, endian::readNext(d)); jansvoboda11 wrote: I think having some kind of `static_assert` that `IdentifierID` is an integral type would be helpful. Maybe that'd be useful even within `endian::readNext()`? https://github.com/llvm/llvm-project/pull/92085 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [Serialization] No transitive identifier change (PR #92085)
@@ -124,7 +124,7 @@ struct HeaderFileInfo { /// This ID number will be non-zero when there is a controlling /// macro whose IdentifierInfo may not yet have been loaded from /// external storage. - unsigned ControllingMacroID = 0; + uint64_t ControllingMacroID = 0; jansvoboda11 wrote: This increases the size of `HeaderFileInfo` from 32 to 40 bytes. Can we squash this member with `ControllingMacro` into some kind of tagged pointer & `uint64_t` union to save space? https://github.com/llvm/llvm-project/pull/92085 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] 2790b4d - Revert "[mlir] Fix race condition introduced in ThreadLocalCache (#93280)"
Author: Kiran Chandramohan Date: 2024-05-24T11:18:55+01:00 New Revision: 2790b4d9e63c13d1e692cc301bbd373b10f28070 URL: https://github.com/llvm/llvm-project/commit/2790b4d9e63c13d1e692cc301bbd373b10f28070 DIFF: https://github.com/llvm/llvm-project/commit/2790b4d9e63c13d1e692cc301bbd373b10f28070.diff LOG: Revert "[mlir] Fix race condition introduced in ThreadLocalCache (#93280)" This reverts commit 6977bfb57c3efb9488aef463cd7ea521fd25a067. Added: Modified: mlir/include/mlir/Support/ThreadLocalCache.h Removed: diff --git a/mlir/include/mlir/Support/ThreadLocalCache.h b/mlir/include/mlir/Support/ThreadLocalCache.h index fe6c6fa3cf6bd..d19257bf6e25e 100644 --- a/mlir/include/mlir/Support/ThreadLocalCache.h +++ b/mlir/include/mlir/Support/ThreadLocalCache.h @@ -16,6 +16,7 @@ #include "mlir/Support/LLVM.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Mutex.h" namespace mlir { @@ -24,80 +25,28 @@ namespace mlir { /// cache has very large lock contention. template class ThreadLocalCache { - struct PerInstanceState; - - /// The "observer" is owned by a thread-local cache instance. It is - /// constructed the first time a `ThreadLocalCache` instance is accessed by a - /// thread, unless `perInstanceState` happens to get re-allocated to the same - /// address as a previous one. This class is destructed the thread in which - /// the `thread_local` cache lives is destroyed. - /// - /// This class is called the "observer" because while values cached in - /// thread-local caches are owned by `PerInstanceState`, a reference is stored - /// via this class in the TLC. With a double pointer, it knows when the - /// referenced value has been destroyed. - struct Observer { -/// This is the double pointer, explicitly allocated because we need to keep -/// the address stable if the TLC map re-allocates. It is owned by the -/// observer and shared with the value owner. -std::shared_ptr ptr = std::make_shared(nullptr); -/// Because `Owner` living inside `PerInstanceState` contains a reference to -/// the double pointer, and livkewise this class contains a reference to the -/// value, we need to synchronize destruction of the TLC and the -/// `PerInstanceState` to avoid racing. This weak pointer is acquired during -/// TLC destruction if the `PerInstanceState` hasn't entered its destructor -/// yet, and prevents it from happening. -std::weak_ptr keepalive; - }; - - /// This struct owns the cache entries. It contains a reference back to the - /// reference inside the cache so that it can be written to null to indicate - /// that the cache entry is invalidated. It needs to do this because - /// `perInstanceState` could get re-allocated to the same pointer and we don't - /// remove entries from the TLC when it is deallocated. Thus, we have to reset - /// the TLC entries to a starting state in case the `ThreadLocalCache` lives - /// shorter than the threads. - struct Owner { -/// Save a pointer to the reference and write it to the newly created entry. -Owner(Observer ) -: value(std::make_unique()), ptrRef(observer.ptr) { - *observer.ptr = value.get(); -} -~Owner() { - if (std::shared_ptr ptr = ptrRef.lock()) -*ptr = nullptr; -} - -Owner(Owner &&) = default; -Owner =(Owner &&) = default; - -std::unique_ptr value; -std::weak_ptr ptrRef; - }; - // Keep a separate shared_ptr protected state that can be acquired atomically // instead of using shared_ptr's for each value. This avoids a problem // where the instance shared_ptr is locked() successfully, and then the // ThreadLocalCache gets destroyed before remove() can be called successfully. struct PerInstanceState { -/// Remove the given value entry. This is called when a thread local cache -/// is destructing but still contains references to values owned by the -/// `PerInstanceState`. Removal is required because it prevents writeback to -/// a pointer that was deallocated. +/// Remove the given value entry. This is generally called when a thread +/// local cache is destructing. void remove(ValueT *value) { // Erase the found value directly, because it is guaranteed to be in the // list. llvm::sys::SmartScopedLock threadInstanceLock(instanceMutex); - auto it = llvm::find_if(instances, [&](Owner ) { -return instance.value.get() == value; - }); + auto it = + llvm::find_if(instances, [&](std::unique_ptr ) { +return instance.get() == value; + }); assert(it != instances.end() && "expected value to exist in cache"); instances.erase(it); } /// Owning pointers to all of the values that have been constructed for this /// object in the static
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -1694,6 +1718,35 @@ let Predicates = [HasPAuth] in { def BLRABZ : AuthOneOperand<0b001, 1, "blrabz">; } + // BLRA pseudo, generalized version of BLRAA/BLRAB/Z. + // This directly manipulates x16/x17, which are the only registers the OS + // guarantees are safe to use for sensitive operations. kovdan01 wrote: Yes, having a more detailed comment here would be nice. As for now, from the comment it was unclear that this is Darwin-specific. It's also probably worth mentioning that it's harmless for non-Darwin, as you said. https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER( MachineInstr = *MBBI; MachineOperand = MI.getOperand(0); assert(RVTarget.isGlobal() && "invalid operand for attached call"); - MachineInstr *OriginalCall = - createCall(MBB, MBBI, TII, MI.getOperand(1), - // Regmask starts after the RV and call targets. - /*RegMaskStartIdx=*/2); + + MachineInstr *OriginalCall = nullptr; + + if (MI.getOpcode() == AArch64::BLRA_RVMARKER) { +// Pointer auth call. +MachineOperand = MI.getOperand(2); +assert((Key.getImm() == 0 || Key.getImm() == 1) && + "invalid key for ptrauth call"); +MachineOperand = MI.getOperand(3); kovdan01 wrote: ```suggestion const MachineOperand = MI.getOperand(3); ``` https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER( MachineInstr = *MBBI; MachineOperand = MI.getOperand(0); assert(RVTarget.isGlobal() && "invalid operand for attached call"); - MachineInstr *OriginalCall = - createCall(MBB, MBBI, TII, MI.getOperand(1), - // Regmask starts after the RV and call targets. - /*RegMaskStartIdx=*/2); + + MachineInstr *OriginalCall = nullptr; + + if (MI.getOpcode() == AArch64::BLRA_RVMARKER) { +// Pointer auth call. +MachineOperand = MI.getOperand(2); +assert((Key.getImm() == 0 || Key.getImm() == 1) && + "invalid key for ptrauth call"); +MachineOperand = MI.getOperand(3); +MachineOperand = MI.getOperand(4); + +OriginalCall = BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::BLRA)) + .getInstr(); +OriginalCall->addOperand(MI.getOperand(1)); +OriginalCall->addOperand(Key); +OriginalCall->addOperand(IntDisc); +OriginalCall->addOperand(AddrDisc); + +unsigned RegMaskStartIdx = 5; +// Skip register arguments. Those are added during ISel, but are not +// needed for the concrete branch. +while (!MI.getOperand(RegMaskStartIdx).isRegMask()) { + auto MOP = MI.getOperand(RegMaskStartIdx); kovdan01 wrote: Just above `auto` is not used in the same kind of assignments. IMHO things should be kept consistent, so either `const auto &` or `const MachineOperand &` should be used for all such cases in this context. https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -9206,6 +9222,31 @@ void SelectionDAGBuilder::visitCall(const CallInst ) { LowerCallTo(I, Callee, I.isTailCall(), I.isMustTailCall()); } +void SelectionDAGBuilder::LowerCallSiteWithPtrAuthBundle( +const CallBase , const BasicBlock *EHPadBB) { + auto PAB = CB.getOperandBundle("ptrauth"); + auto *CalleeV = CB.getCalledOperand(); kovdan01 wrote: ```suggestion const auto *CalleeV = CB.getCalledOperand(); ``` https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -9206,6 +9222,31 @@ void SelectionDAGBuilder::visitCall(const CallInst ) { LowerCallTo(I, Callee, I.isTailCall(), I.isMustTailCall()); } +void SelectionDAGBuilder::LowerCallSiteWithPtrAuthBundle( +const CallBase , const BasicBlock *EHPadBB) { + auto PAB = CB.getOperandBundle("ptrauth"); + auto *CalleeV = CB.getCalledOperand(); + + // Gather the call ptrauth data from the operand bundle: + // [ i32 , i64 ] + auto *Key = cast(PAB->Inputs[0]); + Value *Discriminator = PAB->Inputs[1]; kovdan01 wrote: ```suggestion const Value *Discriminator = PAB->Inputs[1]; ``` https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -8640,6 +8642,15 @@ void SelectionDAGBuilder::LowerCallTo(const CallBase , SDValue Callee, CB.countOperandBundlesOfType(LLVMContext::OB_preallocated) != 0) .setCFIType(CFIType) .setConvergenceControlToken(ConvControlToken); + + // Set the pointer authentication info if we have it. + if (PAI) { +if (!TLI.supportPtrAuthBundles()) + report_fatal_error( kovdan01 wrote: OK, your point makes sense, let's leave it "as is" if nobody else minds https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER( MachineInstr = *MBBI; MachineOperand = MI.getOperand(0); assert(RVTarget.isGlobal() && "invalid operand for attached call"); - MachineInstr *OriginalCall = - createCall(MBB, MBBI, TII, MI.getOperand(1), - // Regmask starts after the RV and call targets. - /*RegMaskStartIdx=*/2); + + MachineInstr *OriginalCall = nullptr; + + if (MI.getOpcode() == AArch64::BLRA_RVMARKER) { +// Pointer auth call. +MachineOperand = MI.getOperand(2); +assert((Key.getImm() == 0 || Key.getImm() == 1) && + "invalid key for ptrauth call"); +MachineOperand = MI.getOperand(3); +MachineOperand = MI.getOperand(4); kovdan01 wrote: ```suggestion const MachineOperand = MI.getOperand(4); ``` https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -2642,6 +2642,20 @@ bool IRTranslator::translateCallBase(const CallBase , } } + std::optional PAI; + if (CB.countOperandBundlesOfType(LLVMContext::OB_ptrauth)) { +// Functions should never be ptrauth-called directly. +assert(!CB.getCalledFunction() && "invalid direct ptrauth call"); + +auto PAB = CB.getOperandBundle("ptrauth"); +Value *Key = PAB->Inputs[0]; +Value *Discriminator = PAB->Inputs[1]; kovdan01 wrote: ```suggestion const Value *Discriminator = PAB->Inputs[1]; ``` https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -9206,6 +9222,31 @@ void SelectionDAGBuilder::visitCall(const CallInst ) { LowerCallTo(I, Callee, I.isTailCall(), I.isMustTailCall()); } +void SelectionDAGBuilder::LowerCallSiteWithPtrAuthBundle( +const CallBase , const BasicBlock *EHPadBB) { + auto PAB = CB.getOperandBundle("ptrauth"); + auto *CalleeV = CB.getCalledOperand(); + + // Gather the call ptrauth data from the operand bundle: + // [ i32 , i64 ] + auto *Key = cast(PAB->Inputs[0]); kovdan01 wrote: ```suggestion const auto *Key = cast(PAB->Inputs[0]); ``` https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -2642,6 +2642,20 @@ bool IRTranslator::translateCallBase(const CallBase , } } + std::optional PAI; + if (CB.countOperandBundlesOfType(LLVMContext::OB_ptrauth)) { +// Functions should never be ptrauth-called directly. +assert(!CB.getCalledFunction() && "invalid direct ptrauth call"); + +auto PAB = CB.getOperandBundle("ptrauth"); +Value *Key = PAB->Inputs[0]; kovdan01 wrote: ```suggestion const Value *Key = PAB->Inputs[0]; ``` https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
https://github.com/kovdan01 requested changes to this pull request. @ahmedbougacha In terms of functionality, LGTM (but I'll prefer other guys also looking through the changes). I've left several minor style-related comments. One more overall style comment which might probably require an additional PR: sometimes identifiers use `PtrAuth`, sometimes `Ptrauth`. Is this intentional? If not, I suggest to use the same case style - it would keep things consistent and allow for case-sensitive search. https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -1769,6 +1775,41 @@ void AArch64AsmPrinter::emitPtrauthAuthResign(const MachineInstr *MI) { OutStreamer->emitLabel(EndSym); } +void AArch64AsmPrinter::emitPtrauthBranch(const MachineInstr *MI) { + unsigned InstsEmitted = 0; + kovdan01 wrote: This blank line is probably unintentional and does not seem to improve readability, so IMHO should be deleted https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER( MachineInstr = *MBBI; MachineOperand = MI.getOperand(0); assert(RVTarget.isGlobal() && "invalid operand for attached call"); - MachineInstr *OriginalCall = - createCall(MBB, MBBI, TII, MI.getOperand(1), - // Regmask starts after the RV and call targets. - /*RegMaskStartIdx=*/2); + + MachineInstr *OriginalCall = nullptr; + + if (MI.getOpcode() == AArch64::BLRA_RVMARKER) { +// Pointer auth call. +MachineOperand = MI.getOperand(2); kovdan01 wrote: ```suggestion const MachineOperand = MI.getOperand(2); ``` https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
https://github.com/kovdan01 edited https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 92f6036 - Revert "[AMDGPU] Add AMDGPU-specific module splitting (#89245)"
Author: Vitaly Buka Date: 2024-05-23T23:44:21-07:00 New Revision: 92f6036dfea9e64b141dcba8f8329ab17e53c3a5 URL: https://github.com/llvm/llvm-project/commit/92f6036dfea9e64b141dcba8f8329ab17e53c3a5 DIFF: https://github.com/llvm/llvm-project/commit/92f6036dfea9e64b141dcba8f8329ab17e53c3a5.diff LOG: Revert "[AMDGPU] Add AMDGPU-specific module splitting (#89245)" This reverts commit d7c37130008374341e79c355ad85cc48942136ff. Added: Modified: llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h llvm/lib/Target/AMDGPU/CMakeLists.txt Removed: llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp llvm/lib/Target/AMDGPU/AMDGPUSplitModule.h llvm/test/tools/llvm-split/AMDGPU/address-taken-externalize-with-call.ll llvm/test/tools/llvm-split/AMDGPU/address-taken-externalize.ll llvm/test/tools/llvm-split/AMDGPU/debug-name-hiding.ll llvm/test/tools/llvm-split/AMDGPU/kernels-alias-dependencies.ll llvm/test/tools/llvm-split/AMDGPU/kernels-cost-ranking.ll llvm/test/tools/llvm-split/AMDGPU/kernels-dependencies.ll llvm/test/tools/llvm-split/AMDGPU/kernels-dependency-duplication.ll llvm/test/tools/llvm-split/AMDGPU/kernels-dependency-external.ll llvm/test/tools/llvm-split/AMDGPU/kernels-dependency-indirect.ll llvm/test/tools/llvm-split/AMDGPU/kernels-dependency-overridable.ll llvm/test/tools/llvm-split/AMDGPU/kernels-global-variables-noexternal.ll llvm/test/tools/llvm-split/AMDGPU/kernels-global-variables.ll llvm/test/tools/llvm-split/AMDGPU/kernels-load-balancing.ll llvm/test/tools/llvm-split/AMDGPU/kernels-no-dependencies.ll llvm/test/tools/llvm-split/AMDGPU/large-kernels-merging.ll llvm/test/tools/llvm-split/AMDGPU/lit.local.cfg diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp deleted file mode 100644 index 56e275ce707b6..0 --- a/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp +++ /dev/null @@ -1,744 +0,0 @@ -//===- AMDGPUSplitModule.cpp --===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===--===// -// -/// \file Implements a module splitting algorithm designed to support the -/// FullLTO --lto-partitions option for parallel codegen. This is completely -/// diff erent from the common SplitModule pass, as this system is designed with -/// AMDGPU in mind. -/// -/// The basic idea of this module splitting implementation is the same as -/// SplitModule: load-balance the module's functions across a set of N -/// partitions to allow parallel codegen. However, it does it very -/// diff erently than the target-agnostic variant: -/// - Kernels are used as the module's "roots". -/// They're known entry points on AMDGPU, and everything else is often -/// internal only. -/// - Each kernel has a set of dependencies, and when a kernel and its -/// dependencies is considered "big", we try to put it in a partition where -/// most dependencies are already imported, to avoid duplicating large -/// amounts of code. -/// - There's special care for indirect calls in order to ensure -/// AMDGPUResourceUsageAnalysis can work correctly. -/// -/// This file also includes a more elaborate logging system to enable -/// users to easily generate logs that (if desired) do not include any value -/// names, in order to not leak information about the source file. -/// Such logs are very helpful to understand and fix potential issues with -/// module splitting. - -#include "AMDGPUSplitModule.h" -#include "AMDGPUTargetMachine.h" -#include "Utils/AMDGPUBaseInfo.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Analysis/CallGraph.h" -#include "llvm/Analysis/TargetTransformInfo.h" -#include "llvm/IR/Function.h" -#include "llvm/IR/Instruction.h" -#include "llvm/IR/Module.h" -#include "llvm/IR/User.h" -#include "llvm/IR/Value.h" -#include "llvm/Support/Casting.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/Path.h" -#include "llvm/Support/Process.h" -#include "llvm/Support/SHA256.h" -#include "llvm/Support/Threading.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Transforms/Utils/Cloning.h" -#include -#include -#include -#include -#include -#include - -using namespace llvm; - -#define DEBUG_TYPE "amdgpu-split-module" - -namespace { - -static cl::opt LargeKernelFactor( -"amdgpu-module-splitting-large-kernel-threshold", cl::init(2.0f), -cl::Hidden, -cl::desc( -"consider a kernel as large
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
ahmedbougacha wrote: Thanks for taking a look; updated https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -8640,6 +8642,15 @@ void SelectionDAGBuilder::LowerCallTo(const CallBase , SDValue Callee, CB.countOperandBundlesOfType(LLVMContext::OB_preallocated) != 0) .setCFIType(CFIType) .setConvergenceControlToken(ConvControlToken); + + // Set the pointer authentication info if we have it. + if (PAI) { +if (!TLI.supportPtrAuthBundles()) + report_fatal_error( ahmedbougacha wrote: I don't think testing this one is reasonable; we couldn't even put it in AArch64 and would have to pollute another innocent backend https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -0,0 +1,183 @@ +; RUN: llc -mtriple arm64e-apple-darwin -o - -global-isel -global-isel-abort=1 -verify-machineinstrs %s | FileCheck %s --check-prefixes=CHECK ahmedbougacha wrote: It's not standard practice to test other platforms, but sure, I added ELF checks. Now you folks owe me darwin tests for future PAC changes you make ;) https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
@@ -1694,6 +1718,35 @@ let Predicates = [HasPAuth] in { def BLRABZ : AuthOneOperand<0b001, 1, "blrabz">; } + // BLRA pseudo, generalized version of BLRAA/BLRAB/Z. + // This directly manipulates x16/x17, which are the only registers the OS + // guarantees are safe to use for sensitive operations. ahmedbougacha wrote: Unfortunately this sort of thing isn't documented. We do describe the general contract in the security model sections of the clang docs. For ELF it might make sense to have a formalization in the PAuth ABI, but that would have to be actually honored in an OS; I imagine it currently isn't anywhere other than Darwin. https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/85736 >From 75825f36ec58a2cf5d1a3f2d4de6a49ad06c02d8 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Mon, 27 Sep 2021 08:00:00 -0700 Subject: [PATCH 1/3] [AArch64] Adopt x8+ allocation order for GPR64noip. 73078ecd381 added GPR64noip for hwasan pseudos. Give it an allocation order that prefers allocating from x8 and up, to match GPR64: this allows for easier regalloc, as x0-x7 are likely to be used for parameter passing. --- llvm/lib/Target/AArch64/AArch64RegisterInfo.td | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64RegisterInfo.td b/llvm/lib/Target/AArch64/AArch64RegisterInfo.td index 80d0f9c57f4b3..dfaa67dd1959d 100644 --- a/llvm/lib/Target/AArch64/AArch64RegisterInfo.td +++ b/llvm/lib/Target/AArch64/AArch64RegisterInfo.td @@ -234,7 +234,10 @@ def tcGPRnotx16 : RegisterClass<"AArch64", [i64], 64, (sub tcGPR64, X16)>; // Register set that excludes registers that are reserved for procedure calls. // This is used for pseudo-instructions that are actually implemented using a // procedure call. -def GPR64noip : RegisterClass<"AArch64", [i64], 64, (sub GPR64, X16, X17, LR)>; +def GPR64noip : RegisterClass<"AArch64", [i64], 64, (sub GPR64, X16, X17, LR)> { + let AltOrders = [(rotl GPR64noip, 8)]; + let AltOrderSelect = [{ return 1; }]; +} // GPR register classes for post increment amount of vector load/store that // has alternate printing when Rm=31 and prints a constant immediate value >From 536ab53e4a300841db5850efaf0ecc5b29733e6d Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Wed, 24 Jan 2024 15:03:49 -0800 Subject: [PATCH 2/3] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. This adds codegen support for the "ptrauth" operand bundles, which can be used to augment indirect calls with the equivalent of an `@llvm.ptrauth.auth` intrinsic call on the call target (possibly preceded by an `@llvm.ptrauth.blend` on the auth discriminator if applicable.) This allows the generation of combined authenticating calls on AArch64 (in the BLRA* PAuth instructions), while avoiding the raw just-authenticated function pointer from being exposed to attackers. This is done by threading a PtrAuthInfo descriptor through the call lowering infrastructure. Note that this also applies to the other forms of indirect calls, notably invokes, rvmarker, and tail calls. Tail-calls in particular bring some additional complexity, with the intersecting register constraints of BTI and PAC discriminator computation. --- .../llvm/CodeGen/GlobalISel/CallLowering.h| 8 + llvm/include/llvm/CodeGen/TargetLowering.h| 18 ++ llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 2 + llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 16 +- .../SelectionDAG/SelectionDAGBuilder.cpp | 51 - .../SelectionDAG/SelectionDAGBuilder.h| 6 +- llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp | 90 .../AArch64/AArch64ExpandPseudoInsts.cpp | 43 +++- .../Target/AArch64/AArch64ISelLowering.cpp| 103 ++--- llvm/lib/Target/AArch64/AArch64ISelLowering.h | 12 ++ llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 2 + llvm/lib/Target/AArch64/AArch64InstrInfo.td | 80 +++ .../AArch64/GISel/AArch64CallLowering.cpp | 88 ++-- .../AArch64/GISel/AArch64GlobalISelUtils.cpp | 2 +- .../AArch64/GlobalISel/ptrauth-invoke.ll | 183 ...ranch-target-enforcement-indirect-calls.ll | 4 +- llvm/test/CodeGen/AArch64/ptrauth-bti-call.ll | 105 ++ .../CodeGen/AArch64/ptrauth-call-rv-marker.ll | 154 ++ llvm/test/CodeGen/AArch64/ptrauth-call.ll | 195 ++ llvm/test/CodeGen/AArch64/ptrauth-invoke.ll | 189 + 20 files changed, 1292 insertions(+), 59 deletions(-) create mode 100644 llvm/test/CodeGen/AArch64/GlobalISel/ptrauth-invoke.ll create mode 100644 llvm/test/CodeGen/AArch64/ptrauth-bti-call.ll create mode 100644 llvm/test/CodeGen/AArch64/ptrauth-call-rv-marker.ll create mode 100644 llvm/test/CodeGen/AArch64/ptrauth-call.ll create mode 100644 llvm/test/CodeGen/AArch64/ptrauth-invoke.ll diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h index 4c187a3068d82..fb298898304eb 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h @@ -99,6 +99,11 @@ class CallLowering { ArgInfo() = default; }; + struct PointerAuthInfo { +Register Discriminator; +uint64_t Key; + }; + struct CallLoweringInfo { /// Calling convention to be used for the call. CallingConv::ID CallConv = CallingConv::C; @@ -125,6 +130,8 @@ class CallLowering { MDNode *KnownCallees = nullptr; +std::optional PAI; + /// True if the call must be tail call optimized. bool IsMustTailCall = false; @@ -587,6
[llvm-branch-commits] [clang] [clang] add fallback to expr in the template differ when comparing ValueDecl (PR #93266)
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/93266.diff 3 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+1) - (modified) clang/lib/AST/ASTDiagnostic.cpp (+5) - (modified) clang/test/Misc/diag-template-diffing-cxx26.cpp (+2-2) ``diff diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 6e8687fadc6f7..5e217a76c81a1 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -784,6 +784,7 @@ Miscellaneous Bug Fixes - Fixed an infinite recursion in ASTImporter, on return type declared inside body of C++11 lambda without trailing return (#GH68775). - Fixed declaration name source location of instantiated function definitions (GH71161). +- Missing fallback to expression in the template differ when comparing ValueDecls. Miscellaneous Clang Crashes Fixed ^ diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp index 7e4a5709a44ce..1885b21178666 100644 --- a/clang/lib/AST/ASTDiagnostic.cpp +++ b/clang/lib/AST/ASTDiagnostic.cpp @@ -1936,6 +1936,11 @@ class TemplateDiff { return; } +if (E) { + PrintExpr(E); + return; +} + OS << "(no argument)"; } diff --git a/clang/test/Misc/diag-template-diffing-cxx26.cpp b/clang/test/Misc/diag-template-diffing-cxx26.cpp index cc174d6c334fb..2b6dd86a9885d 100644 --- a/clang/test/Misc/diag-template-diffing-cxx26.cpp +++ b/clang/test/Misc/diag-template-diffing-cxx26.cpp @@ -19,10 +19,10 @@ namespace GH93068 { // expected-note@#A {{no known conversion from 'A<0>' to 'const A<[1]> &' for 1st argument}} // expected-note@#A {{no known conversion from 'A<0>' to 'A<[1]> &&' for 1st argument}} -// notree-error@#2 {{no viable conversion from 'A' to 'A<(no argument)>'}} +// notree-error@#2 {{no viable conversion from 'A' to 'A'}} /* tree-error@#2 {{no viable conversion A< -[n != (no argument)]>}}*/ +[n != n + 1]>}}*/ A v2 = A(); // #2 // expected-note@#A {{no known conversion from 'A' to 'const A<[1]> &' for 1st argument}} `` https://github.com/llvm/llvm-project/pull/93266 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang] add fallback to expr in the template differ when comparing ValueDecl (PR #93266)
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/93266 None >From e74a7e69381731465efb8332890e0ebdc061fbb1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 23 May 2024 23:57:01 -0300 Subject: [PATCH] [clang] add fallback to expr in the template differ when comparing ValueDecl --- clang/docs/ReleaseNotes.rst | 1 + clang/lib/AST/ASTDiagnostic.cpp | 5 + clang/test/Misc/diag-template-diffing-cxx26.cpp | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 6e8687fadc6f7..5e217a76c81a1 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -784,6 +784,7 @@ Miscellaneous Bug Fixes - Fixed an infinite recursion in ASTImporter, on return type declared inside body of C++11 lambda without trailing return (#GH68775). - Fixed declaration name source location of instantiated function definitions (GH71161). +- Missing fallback to expression in the template differ when comparing ValueDecls. Miscellaneous Clang Crashes Fixed ^ diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp index 7e4a5709a44ce..1885b21178666 100644 --- a/clang/lib/AST/ASTDiagnostic.cpp +++ b/clang/lib/AST/ASTDiagnostic.cpp @@ -1936,6 +1936,11 @@ class TemplateDiff { return; } +if (E) { + PrintExpr(E); + return; +} + OS << "(no argument)"; } diff --git a/clang/test/Misc/diag-template-diffing-cxx26.cpp b/clang/test/Misc/diag-template-diffing-cxx26.cpp index cc174d6c334fb..2b6dd86a9885d 100644 --- a/clang/test/Misc/diag-template-diffing-cxx26.cpp +++ b/clang/test/Misc/diag-template-diffing-cxx26.cpp @@ -19,10 +19,10 @@ namespace GH93068 { // expected-note@#A {{no known conversion from 'A<0>' to 'const A<[1]> &' for 1st argument}} // expected-note@#A {{no known conversion from 'A<0>' to 'A<[1]> &&' for 1st argument}} -// notree-error@#2 {{no viable conversion from 'A' to 'A<(no argument)>'}} +// notree-error@#2 {{no viable conversion from 'A' to 'A'}} /* tree-error@#2 {{no viable conversion A< -[n != (no argument)]>}}*/ +[n != n + 1]>}}*/ A v2 = A(); // #2 // expected-note@#A {{no known conversion from 'A' to 'const A<[1]> &' for 1st argument}} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] 8871ef5 - Revert "[clang] Implement CWG2398 provisional TTP matching to class templates…"
Author: Matheus Izvekov Date: 2024-05-23T21:30:43-03:00 New Revision: 8871ef58ece10234b8cd97c5e7199dee7d7a8b08 URL: https://github.com/llvm/llvm-project/commit/8871ef58ece10234b8cd97c5e7199dee7d7a8b08 DIFF: https://github.com/llvm/llvm-project/commit/8871ef58ece10234b8cd97c5e7199dee7d7a8b08.diff LOG: Revert "[clang] Implement CWG2398 provisional TTP matching to class templates…" This reverts commit ff3f41deb04c03ba57658776e4e0dc26ef01187d. Added: Modified: clang/lib/Sema/SemaTemplate.cpp clang/lib/Sema/SemaTemplateDeduction.cpp clang/test/CXX/temp/temp.decls/temp.alias/p2.cpp clang/test/SemaTemplate/cwg2398.cpp Removed: diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 268f079980a6c..39e9dbed0c3e0 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -1807,8 +1807,6 @@ static void SetNestedNameSpecifier(Sema , TagDecl *T, // Returns the template parameter list with all default template argument // information. static TemplateParameterList *GetTemplateParameterList(TemplateDecl *TD) { - if (TD->isImplicit()) -return TD->getTemplateParameters(); // Make sure we get the template parameter list from the most // recent declaration, since that is the only one that is guaranteed to // have all the default template argument information. @@ -1829,8 +1827,7 @@ static TemplateParameterList *GetTemplateParameterList(TemplateDecl *TD) { //template friend struct C; // }; // template struct S; - while ((D->isImplicit() || - D->getFriendObjectKind() != Decl::FriendObjectKind::FOK_None) && + while (D->getFriendObjectKind() != Decl::FriendObjectKind::FOK_None && D->getPreviousDecl()) D = D->getPreviousDecl(); return cast(D)->getTemplateParameters(); diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index 08a69d3cb2589..f9ec34163e656 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -527,8 +527,8 @@ static NamedDecl *getTemplateParameterWithDefault(Sema , NamedDecl *A, R->setDefaultArgument( S.Context, S.getTrivialTemplateArgumentLoc(Default, QualType(), SourceLocation())); -if (T->hasTypeConstraint()) { - auto *C = T->getTypeConstraint(); +if (R->hasTypeConstraint()) { + auto *C = R->getTypeConstraint(); R->setTypeConstraint(C->getConceptReference(), C->getImmediatelyDeclaredConstraint()); } @@ -583,53 +583,37 @@ DeduceTemplateArguments(Sema , TemplateParameterList *TemplateParams, return TemplateDeductionResult::Success; auto NewDeduced = DeducedTemplateArgument(Arg); -// Provisional resolution for CWG2398: If Arg names a template -// specialization, then we deduce a synthesized template template parameter -// based on A, but using the TS's arguments as defaults. -if (DefaultArguments.size() != 0) { +// Provisional resolution for CWG2398: If Arg is also a template template +// param, and it names a template specialization, then we deduce a +// synthesized template template parameter based on A, but using the TS's +// arguments as defaults. +if (auto *TempArg = dyn_cast_or_null( +Arg.getAsTemplateDecl())) { assert(Arg.getKind() == TemplateName::Template); - TemplateDecl *TempArg = Arg.getAsTemplateDecl(); + assert(!TempArg->isExpandedParameterPack()); + TemplateParameterList *As = TempArg->getTemplateParameters(); - assert(DefaultArguments.size() <= As->size()); - - SmallVector Params(As->size()); - for (unsigned I = 0; I < DefaultArguments.size(); ++I) -Params[I] = getTemplateParameterWithDefault(S, As->getParam(I), -DefaultArguments[I]); - for (unsigned I = DefaultArguments.size(); I < As->size(); ++I) -Params[I] = As->getParam(I); - // FIXME: We could unique these, and also the parameters, but we don't - // expect programs to contain a large enough amount of these deductions - // for that to be worthwhile. - auto *TPL = TemplateParameterList::Create( - S.Context, SourceLocation(), SourceLocation(), Params, - SourceLocation(), As->getRequiresClause()); - - TemplateDecl *TD; - switch (TempArg->getKind()) { - case Decl::TemplateTemplateParm: { -auto *A = cast(TempArg); -assert(!A->isExpandedParameterPack()); -TD = TemplateTemplateParmDecl::Create( -S.Context, A->getDeclContext(), SourceLocation(), A->getDepth(), -A->getPosition(), A->isParameterPack(), A->getIdentifier(), -A->wasDeclaredWithTypename(), TPL); -break; - } - case Decl::ClassTemplate: { -auto *A = cast(TempArg); -
[llvm-branch-commits] [clang] 1786075 - Revert "[SME] Add intrinsics for FCVT(wid.) and FCVTL (#90215)"
Author: Lukacma Date: 2024-05-23T15:13:01+01:00 New Revision: 1786075d2a347465e518cfaa04a40cb75eb75828 URL: https://github.com/llvm/llvm-project/commit/1786075d2a347465e518cfaa04a40cb75eb75828 DIFF: https://github.com/llvm/llvm-project/commit/1786075d2a347465e518cfaa04a40cb75eb75828.diff LOG: Revert "[SME] Add intrinsics for FCVT(wid.) and FCVTL (#90215)" This reverts commit 05c154f2bcba34f002b1f0c22c7a9e9614e9d83c. Added: Modified: clang/include/clang/Basic/arm_sve.td clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvt.c llvm/include/llvm/IR/IntrinsicsAArch64.td llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp llvm/test/CodeGen/AArch64/sme2-intrinsics-cvt.ll Removed: clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvtl.c llvm/test/CodeGen/AArch64/sme2-intrinsics-cvtl.ll diff --git a/clang/include/clang/Basic/arm_sve.td b/clang/include/clang/Basic/arm_sve.td index 4f28547998550..03570f94de666 100644 --- a/clang/include/clang/Basic/arm_sve.td +++ b/clang/include/clang/Basic/arm_sve.td @@ -2265,10 +2265,6 @@ let TargetGuard = "sme2" in { def SVCVT_S32_F32_X4 : SInst<"svcvt_{d}[_f32_x4]", "4.d4.M", "i", MergeNone, "aarch64_sve_fcvtzs_x4", [IsStreaming, IsOverloadWhileOrMultiVecCvt], []>; } -let TargetGuard = "sme-f16f16" in { - def SVCVT_F32_X2 : SInst<"svcvt_{d}[_f16_x2]", "2h", "f", MergeNone, "aarch64_sve_fcvt_widen_x2", [ IsStreaming],[]>; -} - // // Multi-vector floating-point convert from single-precision to interleaved half-precision/BFloat16 // @@ -2277,13 +2273,6 @@ let TargetGuard = "sme2" in { def SVCVTN_BF16_X2 : SInst<"svcvtn_bf16[_f32_x2]", "$2", "f", MergeNone, "aarch64_sve_bfcvtn_x2", [IsOverloadNone, IsStreaming],[]>; } -// -//Multi-vector floating-point convert from half-precision to deinterleaved single-precision. -// -let TargetGuard = "sme-f16f16" in { - def SVCVTL_F32_X2 : SInst<"svcvtl_f32[_f16_x2]", "2h", "f", MergeNone, "aarch64_sve_fcvtl_widen_x2", [ IsStreaming],[]>; -} - // // Multi-vector saturating extract narrow // diff --git a/clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvt.c b/clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvt.c index e26499d3a63cc..4a5ee7e021f74 100644 --- a/clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvt.c +++ b/clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvt.c @@ -497,25 +497,3 @@ svuint8_t test_qcvt_u8_s32_x4(svint32x4_t zn) __arm_streaming { svuint16_t test_qcvt_u16_s64_x4(svint64x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqcvt_u16,_s64_x4,,)(zn); } - -// CHECK-LABEL: @test_cvt_f32_x2( -// CHECK-NEXT: entry: -// CHECK-NEXT:[[TMP0:%.*]] = tail call { , } @llvm.aarch64.sve.fcvt.widen.x2.nxv4f32( [[ZN:%.*]]) -// CHECK-NEXT:[[TMP1:%.*]] = extractvalue { , } [[TMP0]], 0 -// CHECK-NEXT:[[TMP2:%.*]] = tail call @llvm.vector.insert.nxv8f32.nxv4f32( poison, [[TMP1]], i64 0) -// CHECK-NEXT:[[TMP3:%.*]] = extractvalue { , } [[TMP0]], 1 -// CHECK-NEXT:[[TMP4:%.*]] = tail call @llvm.vector.insert.nxv8f32.nxv4f32( [[TMP2]], [[TMP3]], i64 4) -// CHECK-NEXT:ret [[TMP4]] -// -// CPP-CHECK-LABEL: @_Z15test_cvt_f32_x2u13__SVFloat16_t( -// CPP-CHECK-NEXT: entry: -// CPP-CHECK-NEXT:[[TMP0:%.*]] = tail call { , } @llvm.aarch64.sve.fcvt.widen.x2.nxv4f32( [[ZN:%.*]]) -// CPP-CHECK-NEXT:[[TMP1:%.*]] = extractvalue { , } [[TMP0]], 0 -// CPP-CHECK-NEXT:[[TMP2:%.*]] = tail call @llvm.vector.insert.nxv8f32.nxv4f32( poison, [[TMP1]], i64 0) -// CPP-CHECK-NEXT:[[TMP3:%.*]] = extractvalue { , } [[TMP0]], 1 -// CPP-CHECK-NEXT:[[TMP4:%.*]] = tail call @llvm.vector.insert.nxv8f32.nxv4f32( [[TMP2]], [[TMP3]], i64 4) -// CPP-CHECK-NEXT:ret [[TMP4]] -// -__attribute__((target("sme-f16f16"))) svfloat32x2_t test_cvt_f32_x2(svfloat16_t zn) __arm_streaming { - return SVE_ACLE_FUNC(svcvt_f32,_f16_x2,,)(zn); -} diff --git a/clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvtl.c b/clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvtl.c deleted file mode 100644 index 1142065614b8f..0 --- a/clang/test/CodeGen/aarch64-sme2-intrinsics/acle_sme2_cvtl.c +++ /dev/null @@ -1,40 +0,0 @@ -// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py - -// REQUIRES: aarch64-registered-target - -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme-f16f16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme-f16f16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK -// RUN: %clang_cc1 -D__SVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme-f16f16 -S
[llvm-branch-commits] [clang] 8c86a4b - Revert "[AArch64][SME] Add intrinsics for vector groups ZERO (#88114)"
Author: Lukacma Date: 2024-05-23T15:12:27+01:00 New Revision: 8c86a4b19b8c6d7ed5dcb31709bd518383130174 URL: https://github.com/llvm/llvm-project/commit/8c86a4b19b8c6d7ed5dcb31709bd518383130174 DIFF: https://github.com/llvm/llvm-project/commit/8c86a4b19b8c6d7ed5dcb31709bd518383130174.diff LOG: Revert "[AArch64][SME] Add intrinsics for vector groups ZERO (#88114)" This reverts commit 7a1022a3895f51a3c11dd326c47d861575ffaf55. Added: Modified: clang/include/clang/Basic/arm_sme.td llvm/include/llvm/IR/IntrinsicsAArch64.td llvm/lib/Target/AArch64/SMEInstrFormats.td Removed: clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_zero.c llvm/test/CodeGen/AArch64/sme2p1-intrinsics-zero.ll diff --git a/clang/include/clang/Basic/arm_sme.td b/clang/include/clang/Basic/arm_sme.td index 564a58e4eb670..80e635e4a57ec 100644 --- a/clang/include/clang/Basic/arm_sme.td +++ b/clang/include/clang/Basic/arm_sme.td @@ -146,25 +146,6 @@ let TargetGuard = "sme" in { [IsOverloadNone, IsStreamingCompatible, IsOutZA]>; } -let TargetGuard = "sme2p1" in { - def SVZERO_ZA64_VG1x2 : SInst<"svzero_za64_vg1x2", "vm", "", MergeNone, "aarch64_sme_zero_za64_vg1x2", -[IsOverloadNone, IsStreaming, IsInOutZA]>; - def SVZERO_ZA64_VG1x4 : SInst<"svzero_za64_vg1x4", "vm", "", MergeNone, "aarch64_sme_zero_za64_vg1x4", -[IsOverloadNone, IsStreaming, IsInOutZA]>; - def SVZERO_ZA64_VG2x1 : SInst<"svzero_za64_vg2x1", "vm", "", MergeNone, "aarch64_sme_zero_za64_vg2x1", -[IsOverloadNone, IsStreaming, IsInOutZA]>; - def SVZERO_ZA64_VG2x2 : SInst<"svzero_za64_vg2x2", "vm", "", MergeNone, "aarch64_sme_zero_za64_vg2x2", -[IsOverloadNone, IsStreaming, IsInOutZA]>; - def SVZERO_ZA64_VG2x4 : SInst<"svzero_za64_vg2x4", "vm", "", MergeNone, "aarch64_sme_zero_za64_vg2x4", -[IsOverloadNone, IsStreaming, IsInOutZA]>; - def SVZERO_ZA64_VG4x1 : SInst<"svzero_za64_vg4x1", "vm", "", MergeNone, "aarch64_sme_zero_za64_vg4x1", -[IsOverloadNone, IsStreaming, IsInOutZA]>; - def SVZERO_ZA64_VG4x2 : SInst<"svzero_za64_vg4x2", "vm", "", MergeNone, "aarch64_sme_zero_za64_vg4x2", -[IsOverloadNone, IsStreaming, IsInOutZA]>; - def SVZERO_ZA64_VG4x4 : SInst<"svzero_za64_vg4x4", "vm", "", MergeNone, "aarch64_sme_zero_za64_vg4x4", -[IsOverloadNone, IsStreaming, IsInOutZA]>; -} - // SME - Counting elements in a streaming vector diff --git a/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_zero.c b/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_zero.c deleted file mode 100644 index bdd7579855414..0 --- a/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_zero.c +++ /dev/null @@ -1,139 +0,0 @@ -// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 -// REQUIRES: aarch64-registered-target - -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s - -#include - -#define SVE_ACLE_FUNC(A1,A2) A1##A2 - -// CHECK-LABEL: define dso_local void @test_svzero_za64_vg1x2( -// CHECK-SAME: i32 noundef [[SLICE:%.*]]) #[[ATTR0:[0-9]+]] { -// CHECK-NEXT: entry: -// CHECK-NEXT:tail call void @llvm.aarch64.sme.zero.za64.vg1x2(i32 [[SLICE]]) -// CHECK-NEXT:ret void -// -// CPP-CHECK-LABEL: define dso_local void @_Z22test_svzero_za64_vg1x2j( -// CPP-CHECK-SAME: i32 noundef [[SLICE:%.*]]) #[[ATTR0:[0-9]+]] { -// CPP-CHECK-NEXT: entry: -// CPP-CHECK-NEXT:tail call void @llvm.aarch64.sme.zero.za64.vg1x2(i32 [[SLICE]]) -// CPP-CHECK-NEXT:ret void -// -void test_svzero_za64_vg1x2(uint32_t slice) __arm_streaming __arm_inout("za") -{ - SVE_ACLE_FUNC(svzero_za64,_vg1x2)(slice); -} - -// CHECK-LABEL: define dso_local void @test_svzero_za64_vg1x4( -// CHECK-SAME: i32 noundef [[SLICE:%.*]]) #[[ATTR0]] { -// CHECK-NEXT: entry: -// CHECK-NEXT:tail call void @llvm.aarch64.sme.zero.za64.vg1x4(i32 [[SLICE]]) -// CHECK-NEXT:ret void -// -// CPP-CHECK-LABEL: define dso_local void @_Z22test_svzero_za64_vg1x4j( -// CPP-CHECK-SAME: i32 noundef [[SLICE:%.*]]) #[[ATTR0]] { -// CPP-CHECK-NEXT: entry: -// CPP-CHECK-NEXT:tail call void
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
@@ -292,6 +294,7 @@ if(WIN32) set(LIBOMP_IMP_LIB_TARGET omp) set(LIBOMP_GENERATED_DEF_FILE ${LIBOMP_LIB_NAME}.def) add_custom_target(libomp-needed-def-file DEPENDS ${LIBOMP_GENERATED_DEF_FILE}) + set_target_properties(libomp-needed-def-file PROPERTIES FOLDER "OpenMP/Codegenning") Meinersbur wrote: For LLVM/Clang/MLIR the folder is already named ["Tablegenning"](https://github.com/llvm/llvm-project/blob/31f1590e4fb324c43dc36199587c453e27b6f6fa/llvm/cmake/modules/TableGen.cmake#L170) since forever. Since tablegen is not involved here, I found "Codegenning" more appropriate. https://github.com/llvm/llvm-project/pull/89750 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/89750 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] 788e65c - Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan …"
Author: Med Ismail Bennani Date: 2024-05-23T01:45:18-07:00 New Revision: 788e65c8171e233d399f3f1df645d6f9fb8f66bc URL: https://github.com/llvm/llvm-project/commit/788e65c8171e233d399f3f1df645d6f9fb8f66bc DIFF: https://github.com/llvm/llvm-project/commit/788e65c8171e233d399f3f1df645d6f9fb8f66bc.diff LOG: Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan …" This reverts commit 4cc6d0f4dfb26deb9863901c70258d6d7f0c8ba4. Added: Modified: lldb/bindings/python/python-swigsafecast.swig lldb/bindings/python/python-wrapper.swig lldb/include/lldb/API/SBEvent.h lldb/include/lldb/API/SBStream.h lldb/include/lldb/Interpreter/Interfaces/ScriptedInterface.h lldb/include/lldb/Interpreter/ScriptInterpreter.h lldb/include/lldb/Target/ThreadPlanPython.h lldb/include/lldb/lldb-forward.h lldb/source/Interpreter/ScriptInterpreter.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h lldb/source/Target/ThreadPlanPython.cpp lldb/test/API/functionalities/step_scripted/Steps.py lldb/test/API/functionalities/thread_plan/wrap_step_over.py lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp Removed: lldb/include/lldb/Interpreter/Interfaces/ScriptedThreadPlanInterface.h lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h diff --git a/lldb/bindings/python/python-swigsafecast.swig b/lldb/bindings/python/python-swigsafecast.swig index 34f8c6f0ff8d3..d5ea514872713 100644 --- a/lldb/bindings/python/python-swigsafecast.swig +++ b/lldb/bindings/python/python-swigsafecast.swig @@ -37,6 +37,10 @@ PythonObject SWIGBridge::ToSWIGWrapper(const Status& status) { return ToSWIGHelper(new lldb::SBError(status), SWIGTYPE_p_lldb__SBError); } +PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr stream_sb) { + return ToSWIGHelper(stream_sb.release(), SWIGTYPE_p_lldb__SBStream); +} + PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr data_sb) { return ToSWIGHelper(data_sb.release(), SWIGTYPE_p_lldb__SBStructuredData); } @@ -111,16 +115,9 @@ SWIGBridge::ToSWIGWrapper(CommandReturnObject _retobj) { SWIGTYPE_p_lldb__SBCommandReturnObject); } -PythonObject SWIGBridge::ToSWIGWrapper(const Stream *s) { - return ToSWIGHelper(new lldb::SBStream(), SWIGTYPE_p_lldb__SBStream); -} - -PythonObject SWIGBridge::ToSWIGWrapper(std::shared_ptr stream_sb) { - return ToSWIGHelper(stream_sb.get(), SWIGTYPE_p_lldb__SBStream); -} - -PythonObject SWIGBridge::ToSWIGWrapper(Event *event) { - return ToSWIGHelper(new lldb::SBEvent(event), SWIGTYPE_p_lldb__SBEvent); +ScopedPythonObject SWIGBridge::ToSWIGWrapper(Event *event) { + return ScopedPythonObject(new lldb::SBEvent(event), + SWIGTYPE_p_lldb__SBEvent); } PythonObject SWIGBridge::ToSWIGWrapper( diff --git a/lldb/bindings/python/python-wrapper.swig b/lldb/bindings/python/python-wrapper.swig index 28ab58f8ce495..1370afc885d43 100644 --- a/lldb/bindings/python/python-wrapper.swig +++ b/lldb/bindings/python/python-wrapper.swig @@ -229,6 +229,133 @@ PythonObject lldb_private::python::SWIGBridge::LLDBSwigPythonCreateCommandObject return pfunc(SWIGBridge::ToSWIGWrapper(std::move(debugger_sp)), dict); } +PythonObject lldb_private::python::SWIGBridge::LLDBSwigPythonCreateScriptedThreadPlan( +const char *python_class_name, const char *session_dictionary_name, +const lldb_private::StructuredDataImpl _impl, +std::string _string, const lldb::ThreadPlanSP _plan_sp) { + if (python_class_name == NULL || python_class_name[0] == '\0' || + !session_dictionary_name) +return PythonObject(); + + PyErr_Cleaner py_err_cleaner(true); + + auto dict = PythonModule::MainModule().ResolveName( + session_dictionary_name); + auto pfunc = PythonObject::ResolveNameWithDictionary( + python_class_name, dict); + + if (!pfunc.IsAllocated()) { +error_string.append("could not find script class: "); +error_string.append(python_class_name); +return PythonObject(); + } + + PythonObject tp_arg =
[llvm-branch-commits] [llvm] release/18.x: [DAGCombiner] In mergeTruncStore, make sure we aren't storing shifted in bits. (#90939) (PR #91038)
https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/91038 >From 094e4fbb65a5f24474cbe556f895ee784f6bdffb Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 3 May 2024 09:59:33 -0700 Subject: [PATCH] [DAGCombiner] In mergeTruncStore, make sure we aren't storing shifted in bits. (#90939) When looking through a right shift, we need to make sure that all of the bits we are using from the shift come from the shift input and not the sign or zero bits that are shifted in. Fixes #90936. (cherry picked from commit 3563af6c06ebc92bcaacef0e33285148ef0f75bd) --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 llvm/test/CodeGen/AArch64/pr90936.ll | 20 +++ 2 files changed, 24 insertions(+) create mode 100644 llvm/test/CodeGen/AArch64/pr90936.ll diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5038f8a1fc156..4951e45edb9ed 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -8952,6 +8952,10 @@ SDValue DAGCombiner::mergeTruncStores(StoreSDNode *N) { if (ShiftAmtC % NarrowNumBits != 0) return SDValue(); + // Make sure we aren't reading bits that are shifted in. + if (ShiftAmtC > WideVal.getScalarValueSizeInBits() - NarrowNumBits) +return SDValue(); + Offset = ShiftAmtC / NarrowNumBits; WideVal = WideVal.getOperand(0); } diff --git a/llvm/test/CodeGen/AArch64/pr90936.ll b/llvm/test/CodeGen/AArch64/pr90936.ll new file mode 100644 index 0..38cda8d388945 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/pr90936.ll @@ -0,0 +1,20 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 +; RUN: llc < %s -mtriple=aarch64 | FileCheck %s + +define void @f(i16 %arg, ptr %arg1) { +; CHECK-LABEL: f: +; CHECK: // %bb.0: +; CHECK-NEXT:ubfx w8, w0, #8, #6 +; CHECK-NEXT:strb w0, [x1] +; CHECK-NEXT:strb w8, [x1, #1] +; CHECK-NEXT:ret +bb: + %i = trunc i16 %arg to i8 + %i2 = trunc i16 %arg to i14 + %i3 = lshr i14 %i2, 8 + store i8 %i, ptr %arg1, align 1 + %i4 = getelementptr i8, ptr %arg1, i64 1 + %i5 = trunc i14 %i3 to i8 + store i8 %i5, ptr %i4, align 1 + ret void +} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [BOLT][NFC] Simplify analyzeIndirectBranch (PR #91662)
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/91662 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Eliminate dead jump tables (PR #91666)
aaupov wrote: > Looks like this is dangerous and crashes binaries in our tests? Do you still > want to move forward with this stack? Or are you working on it? If this stack > is work in progress, maybe mark it as "changes planned" or the equivalent in > github. Yes, we'll need to discuss how to move forward with it, as it's unsafe as is. Marking as draft for now. https://github.com/llvm/llvm-project/pull/91666 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Eliminate dead jump tables (PR #91666)
https://github.com/aaupov converted_to_draft https://github.com/llvm/llvm-project/pull/91666 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Eliminate dead jump tables (PR #91666)
https://github.com/rafaelauler requested changes to this pull request. Looks like this is dangerous and crashes binaries in our tests? Do you still want to move forward with this stack? Or are you working on it? If this stack is work in progress, maybe mark it as "changes planned" or the equivalent in github. https://github.com/llvm/llvm-project/pull/91666 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT][NFCI] Fix return type of BC::getSignedValueAtAddress (PR #91664)
https://github.com/rafaelauler approved this pull request. LG https://github.com/llvm/llvm-project/pull/91664 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] daa63e1 - Revert "[lldb] Added Debuginfod tests and fixed a couple issues (#92572)"
Author: Daniel Thornburgh Date: 2024-05-22T13:54:32-07:00 New Revision: daa63e1870999e8ca8db454a788a0720740d194a URL: https://github.com/llvm/llvm-project/commit/daa63e1870999e8ca8db454a788a0720740d194a DIFF: https://github.com/llvm/llvm-project/commit/daa63e1870999e8ca8db454a788a0720740d194a.diff LOG: Revert "[lldb] Added Debuginfod tests and fixed a couple issues (#92572)" This reverts commit e558d21e87882d40e29d858b1269ee8f1ddf2a38. Added: Modified: lldb/include/lldb/Host/Config.h.cmake lldb/packages/Python/lldbsuite/test/decorators.py lldb/packages/Python/lldbsuite/test/make/Makefile.rules lldb/source/API/SBDebugger.cpp lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/source/Plugins/SymbolLocator/CMakeLists.txt lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp Removed: lldb/test/API/debuginfod/Normal/Makefile lldb/test/API/debuginfod/Normal/TestDebuginfod.py lldb/test/API/debuginfod/Normal/main.c lldb/test/API/debuginfod/SplitDWARF/Makefile lldb/test/API/debuginfod/SplitDWARF/TestDebuginfodDWP.py lldb/test/API/debuginfod/SplitDWARF/main.c diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake index 9e538534086a2..3defa454f6d42 100644 --- a/lldb/include/lldb/Host/Config.h.cmake +++ b/lldb/include/lldb/Host/Config.h.cmake @@ -33,8 +33,6 @@ #cmakedefine01 LLDB_ENABLE_LZMA -#cmakedefine01 LLVM_ENABLE_CURL - #cmakedefine01 LLDB_ENABLE_CURSES #cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index b4ac3bdabac86..79cc0a2aeacbe 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -1055,10 +1055,6 @@ def _get_bool_config_skip_if_decorator(key): return unittest.skipIf(not have, "requires " + key) -def skipIfCurlSupportMissing(func): -return _get_bool_config_skip_if_decorator("curl")(func) - - def skipIfCursesSupportMissing(func): return _get_bool_config_skip_if_decorator("curses")(func) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 2cbc918ebbaeb..bd8eea3d6f5a0 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -51,7 +51,7 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # # GNUWin32 uname gives "windows32" or "server version windows32" while # some versions of MSYS uname return "MSYS_NT*", but most environments -# standardize on "Windows_NT", so we'll make it consistent here. +# standardize on "Windows_NT", so we'll make it consistent here. # When running tests from Visual Studio, the environment variable isn't # inherited all the way down to the process spawned for make. #-- @@ -210,12 +210,6 @@ else ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES" DSYM = $(EXE).debug endif - - ifeq "$(MAKE_DWP)" "YES" - MAKE_DWO := YES - DWP_NAME = $(EXE).dwp - DYLIB_DWP_NAME = $(DYLIB_NAME).dwp - endif endif LIMIT_DEBUG_INFO_FLAGS = @@ -364,7 +358,6 @@ ifneq "$(OS)" "Darwin" OBJCOPY ?= $(call replace_cc_with,objcopy) ARCHIVER ?= $(call replace_cc_with,ar) - DWP ?= $(call replace_cc_with,dwp) override AR = $(ARCHIVER) endif @@ -535,10 +528,6 @@ ifneq "$(CXX)" "" endif endif -ifeq "$(GEN_GNU_BUILD_ID)" "YES" - LDFLAGS += -Wl,--build-id -endif - #-- # DYLIB_ONLY variable can be used to skip the building of a.out. # See the sections below regarding dSYM file as well as the building of @@ -577,17 +566,10 @@ else endif else ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES" -ifeq "$(SAVE_FULL_DEBUG_BINARY)" "YES" - cp "$(EXE)" "$(EXE).unstripped" -endif $(OBJCOPY) --only-keep-debug "$(EXE)" "$(DSYM)" $(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DSYM)" "$(EXE)" "$(EXE)" endif -ifeq "$(MAKE_DWP)" "YES" - $(DWP) -o "$(DWP_NAME)" $(DWOS) endif -endif - #-- # Make the dylib @@ -629,15 +611,9 @@ endif else $(LD) $(DYLIB_OBJECTS) $(LDFLAGS) -shared -o "$(DYLIB_FILENAME)" ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES" - ifeq "$(SAVE_FULL_DEBUG_BINARY)" "YES" - cp "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME).unstripped" - endif $(OBJCOPY) --only-keep-debug "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME).debug" $(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DYLIB_FILENAME).debug" "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME)" endif -ifeq "$(MAKE_DWP)" "YES" - $(DWP) -o
[llvm-branch-commits] [BOLT][NFC] Define getExprValue helper (PR #91663)
https://github.com/rafaelauler approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/91663 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [BOLT][NFC] Simplify analyzeIndirectBranch (PR #91662)
https://github.com/rafaelauler approved this pull request. LG https://github.com/llvm/llvm-project/pull/91662 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [workflows] Rework pre-commit CI for the release branch (PR #91550)
https://github.com/tstellar milestoned https://github.com/llvm/llvm-project/pull/91550 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [BOLT][NFC] Move out PrintProgramStats from Profile into Rewrite (PR #93075)
https://github.com/rafaelauler approved this pull request. LGTM thanks https://github.com/llvm/llvm-project/pull/93075 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] bf19260 - Revert "[IR] Avoid creating icmp/fcmp constant expressions (#92885)"
Author: Daniel Thornburgh Date: 2024-05-22T11:27:27-07:00 New Revision: bf19260fe0d348aee801f4446c4f8666740c8896 URL: https://github.com/llvm/llvm-project/commit/bf19260fe0d348aee801f4446c4f8666740c8896 DIFF: https://github.com/llvm/llvm-project/commit/bf19260fe0d348aee801f4446c4f8666740c8896.diff LOG: Revert "[IR] Avoid creating icmp/fcmp constant expressions (#92885)" This reverts commit 108575f02ea9927009ed81231474d3a6f053602f. Added: Modified: clang/test/Analysis/builtin_signbit.cpp clang/test/CodeGen/catch-nullptr-and-nonzero-offset.c clang/test/CodeGen/constantexpr-fneg.c clang/test/CodeGenCXX/cxx11-thread-local.cpp clang/test/CodeGenCXX/ubsan-nullability-arg.cpp clang/test/CodeGenCXX/weak-external.cpp clang/test/Driver/linker-wrapper-image.c clang/test/OpenMP/threadprivate_codegen.cpp llvm/include/llvm/Analysis/TargetFolder.h llvm/include/llvm/IR/ConstantFolder.h llvm/lib/Analysis/ConstantFolding.cpp llvm/lib/IR/ConstantFold.cpp llvm/test/Assembler/ConstantExprFold.ll llvm/test/Assembler/ConstantExprNoFold.ll llvm/test/Assembler/vector-cmp.ll llvm/test/CodeGen/AMDGPU/lower-ctor-dtor-constexpr-alias.ll llvm/test/CodeGen/AMDGPU/lower-ctor-dtor.ll llvm/test/CodeGen/AMDGPU/lower-multiple-ctor-dtor.ll llvm/test/Instrumentation/MemorySanitizer/check-constant-shadow.ll llvm/test/Instrumentation/SanitizerBinaryMetadata/atomics.ll llvm/test/Transforms/Attributor/value-simplify.ll llvm/test/Transforms/InstCombine/binop-select-cast-of-select-cond.ll llvm/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll llvm/test/Transforms/InstCombine/getelementptr.ll llvm/test/Transforms/InstCombine/hoist-xor-by-constant-from-xor-by-value.ll llvm/test/Transforms/InstCombine/pr33453.ll llvm/test/Transforms/InstCombine/pr83947.ll llvm/test/Transforms/InstCombine/rem.ll llvm/test/Transforms/InstCombine/select-and-or.ll llvm/test/Transforms/InstCombine/select-safe-transforms.ll llvm/test/Transforms/InstSimplify/ConstProp/bitcast.ll llvm/test/Transforms/InstSimplify/ConstProp/icmp-global.ll llvm/test/Transforms/InstSimplify/bitcast-vector-fold.ll llvm/test/Transforms/InstSimplify/compare.ll llvm/test/Transforms/InstSimplify/past-the-end.ll llvm/test/Transforms/JumpThreading/constant-fold-status.ll llvm/test/Transforms/LowerTypeTests/cfi-direct-call1.ll llvm/test/Transforms/LowerTypeTests/function-weak.ll llvm/test/Transforms/SCCP/conditions-ranges.ll llvm/test/Transforms/SimplifyCFG/phi-to-select-constexpr-icmp.ll Removed: diff --git a/clang/test/Analysis/builtin_signbit.cpp b/clang/test/Analysis/builtin_signbit.cpp index be10f0950f69b..57e6816ce2802 100644 --- a/clang/test/Analysis/builtin_signbit.cpp +++ b/clang/test/Analysis/builtin_signbit.cpp @@ -84,30 +84,28 @@ long double ld = -1.0L; // CHECK-LE-LABEL: define dso_local void @_Z12test_signbitv( // CHECK-LE-SAME: ) #[[ATTR0:[0-9]+]] { // CHECK-LE-NEXT: entry: -// CHECK-LE-NEXT:[[TMP0:%.*]] = icmp slt i64 trunc (i128 bitcast (ppc_fp128 0xM3FF0 to i128) to i64), 0 -// CHECK-LE-NEXT:[[FROMBOOL:%.*]] = zext i1 [[TMP0]] to i8 +// CHECK-LE-NEXT:[[FROMBOOL:%.*]] = zext i1 icmp slt (i64 trunc (i128 bitcast (ppc_fp128 0xM3FF0 to i128) to i64), i64 0) to i8 // CHECK-LE-NEXT:store i8 [[FROMBOOL]], ptr @b, align 1 -// CHECK-LE-NEXT:[[TMP1:%.*]] = load ppc_fp128, ptr @ld, align 16 -// CHECK-LE-NEXT:[[TMP2:%.*]] = bitcast ppc_fp128 [[TMP1]] to i128 -// CHECK-LE-NEXT:[[TMP3:%.*]] = trunc i128 [[TMP2]] to i64 -// CHECK-LE-NEXT:[[TMP4:%.*]] = icmp slt i64 [[TMP3]], 0 -// CHECK-LE-NEXT:[[FROMBOOL1:%.*]] = zext i1 [[TMP4]] to i8 +// CHECK-LE-NEXT:[[TMP0:%.*]] = load ppc_fp128, ptr @ld, align 16 +// CHECK-LE-NEXT:[[TMP1:%.*]] = bitcast ppc_fp128 [[TMP0]] to i128 +// CHECK-LE-NEXT:[[TMP2:%.*]] = trunc i128 [[TMP1]] to i64 +// CHECK-LE-NEXT:[[TMP3:%.*]] = icmp slt i64 [[TMP2]], 0 +// CHECK-LE-NEXT:[[FROMBOOL1:%.*]] = zext i1 [[TMP3]] to i8 // CHECK-LE-NEXT:store i8 [[FROMBOOL1]], ptr @b, align 1 // CHECK-LE-NEXT:store i8 0, ptr @b, align 1 -// CHECK-LE-NEXT:[[TMP5:%.*]] = load double, ptr @d, align 8 -// CHECK-LE-NEXT:[[CONV:%.*]] = fptrunc double [[TMP5]] to float -// CHECK-LE-NEXT:[[TMP6:%.*]] = bitcast float [[CONV]] to i32 -// CHECK-LE-NEXT:[[TMP7:%.*]] = icmp slt i32 [[TMP6]], 0 -// CHECK-LE-NEXT:[[FROMBOOL2:%.*]] = zext i1 [[TMP7]] to i8 +// CHECK-LE-NEXT:[[TMP4:%.*]] = load double, ptr @d, align 8 +// CHECK-LE-NEXT:[[CONV:%.*]] = fptrunc double [[TMP4]] to float +// CHECK-LE-NEXT:[[TMP5:%.*]] = bitcast float [[CONV]] to i32 +// CHECK-LE-NEXT:[[TMP6:%.*]] = icmp slt i32 [[TMP5]], 0 +// CHECK-LE-NEXT:[[FROMBOOL2:%.*]] = zext i1 [[TMP6]] to i8
[llvm-branch-commits] [BOLT][NFC] Move out PrintProgramStats from Profile into Rewrite (PR #93075)
llvmbot wrote: @llvm/pr-subscribers-bolt Author: Amir Ayupov (aaupov) Changes Eliminate the dependence of Profile on Passes. Test Plan: NFC --- Full diff: https://github.com/llvm/llvm-project/pull/93075.diff 3 Files Affected: - (modified) bolt/lib/Profile/CMakeLists.txt (-1) - (modified) bolt/lib/Profile/DataAggregator.cpp (-2) - (modified) bolt/lib/Rewrite/RewriteInstance.cpp (+5-1) ``diff diff --git a/bolt/lib/Profile/CMakeLists.txt b/bolt/lib/Profile/CMakeLists.txt index 045ac47edb950..ca8b9c34e63b1 100644 --- a/bolt/lib/Profile/CMakeLists.txt +++ b/bolt/lib/Profile/CMakeLists.txt @@ -17,6 +17,5 @@ add_llvm_library(LLVMBOLTProfile target_link_libraries(LLVMBOLTProfile PRIVATE LLVMBOLTCore - LLVMBOLTPasses LLVMBOLTUtils ) diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp index c0fd69b98c82d..a9252ea04453d 100644 --- a/bolt/lib/Profile/DataAggregator.cpp +++ b/bolt/lib/Profile/DataAggregator.cpp @@ -613,8 +613,6 @@ Error DataAggregator::readProfile(BinaryContext ) { if (std::error_code EC = writeBATYAML(BC, opts::SaveProfile)) report_error("cannot create output data file", EC); } -PrintProgramStats PPS(BAT); -BC.logBOLTErrorsAndQuitOnFatal(PPS.runOnFunctions(BC)); } return Error::success(); diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 9cc4c8c8c4faf..7024437110314 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -17,6 +17,7 @@ #include "bolt/Core/MCPlusBuilder.h" #include "bolt/Core/ParallelUtilities.h" #include "bolt/Core/Relocation.h" +#include "bolt/Passes/BinaryPasses.h" #include "bolt/Passes/CacheMetrics.h" #include "bolt/Passes/ReorderFunctions.h" #include "bolt/Profile/BoltAddressTranslation.h" @@ -3285,8 +3286,11 @@ void RewriteInstance::processProfileData() { // Release memory used by profile reader. ProfileReader.reset(); - if (opts::AggregateOnly) + if (opts::AggregateOnly) { +PrintProgramStats PPS(&*BAT); +BC->logBOLTErrorsAndQuitOnFatal(PPS.runOnFunctions(*BC)); exit(0); + } } void RewriteInstance::disassembleFunctions() { `` https://github.com/llvm/llvm-project/pull/93075 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [BOLT][NFC] Move out PrintProgramStats from Profile into Rewrite (PR #93075)
https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/93075 Eliminate the dependence of Profile on Passes. Test Plan: NFC ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [LAA] Use SCEVUse to add extra NUW flags to pointer bounds. (WIP) (PR #91962)
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/91962 >From ab0311667695fb255625cc846e02373800fad8b1 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 1 May 2024 11:03:42 +0100 Subject: [PATCH 1/3] [SCEV,LAA] Add tests to make sure scoped SCEVs don't impact other SCEVs. --- .../LoopAccessAnalysis/scoped-scevs.ll| 182 ++ 1 file changed, 182 insertions(+) create mode 100644 llvm/test/Analysis/LoopAccessAnalysis/scoped-scevs.ll diff --git a/llvm/test/Analysis/LoopAccessAnalysis/scoped-scevs.ll b/llvm/test/Analysis/LoopAccessAnalysis/scoped-scevs.ll new file mode 100644 index 0..323ba2a739cf8 --- /dev/null +++ b/llvm/test/Analysis/LoopAccessAnalysis/scoped-scevs.ll @@ -0,0 +1,182 @@ +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4 +; RUN: opt -passes='print,print' -disable-output %s 2>&1 | FileCheck --check-prefixes=LAA,AFTER %s +; RUN: opt -passes='print,print,print' -disable-output %s 2>&1 | FileCheck --check-prefixes=BEFORE,LAA,AFTER %s + +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" + +declare void @use(ptr) + +; Check that scoped expressions created by LAA do not interfere with non-scoped +; SCEVs with the same operands. The tests first run print to +; populate the SCEV cache. They contain a GEP computing A+405, which is the end +; of the accessed range, before and/or after the loop. No nuw flags should be +; added to them in the second print output. + +define ptr @test_ptr_range_end_computed_before_and_after_loop(ptr %A) { +; BEFORE-LABEL: 'test_ptr_range_end_computed_before_and_after_loop' +; BEFORE-NEXT: Classifying expressions for: @test_ptr_range_end_computed_before_and_after_loop +; BEFORE:%x = getelementptr inbounds i8, ptr %A, i64 405 +; BEFORE-NEXT:--> (405 + %A) U: full-set S: full-set +; BEFORE:%y = getelementptr inbounds i8, ptr %A, i64 405 +; BEFORE-NEXT:--> (405 + %A) U: full-set S: full-set +; +; LAA-LABEL: 'test_ptr_range_end_computed_before_and_after_loop' +; LAA-NEXT:loop: +; LAA-NEXT: Memory dependences are safe with run-time checks +; LAA-NEXT: Dependences: +; LAA-NEXT: Run-time memory checks: +; LAA-NEXT: Check 0: +; LAA-NEXT:Comparing group ([[GRP1:0x[0-9a-f]+]]): +; LAA-NEXT: %gep.A.400 = getelementptr inbounds i32, ptr %A.1, i64 %iv +; LAA-NEXT:Against group ([[GRP2:0x[0-9a-f]+]]): +; LAA-NEXT: %gep.A = getelementptr inbounds i8, ptr %A, i64 %iv +; LAA-NEXT: Grouped accesses: +; LAA-NEXT:Group [[GRP1]]: +; LAA-NEXT: (Low: (1 + %A) High: (405 + %A)) +; LAA-NEXT:Member: {(1 + %A),+,4}<%loop> +; LAA-NEXT:Group [[GRP2]]: +; LAA-NEXT: (Low: %A High: (101 + %A)) +; LAA-NEXT:Member: {%A,+,1}<%loop> +; LAA-EMPTY: +; LAA-NEXT: Non vectorizable stores to invariant address were not found in loop. +; LAA-NEXT: SCEV assumptions: +; LAA-EMPTY: +; LAA-NEXT: Expressions re-written: +; +; AFTER-LABEL: 'test_ptr_range_end_computed_before_and_after_loop' +; AFTER-NEXT: Classifying expressions for: @test_ptr_range_end_computed_before_and_after_loop +; AFTER:%x = getelementptr inbounds i8, ptr %A, i64 405 +; AFTER-NEXT:--> (405 + %A) U: full-set S: full-set +; AFTER:%y = getelementptr inbounds i8, ptr %A, i64 405 +; AFTER-NEXT:--> (405 + %A) U: full-set S: full-set +entry: + %A.1 = getelementptr inbounds i8, ptr %A, i64 1 + %x = getelementptr inbounds i8, ptr %A, i64 405 + call void @use(ptr %x) + br label %loop + +loop: + %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ] + %gep.A.400 = getelementptr inbounds i32, ptr %A.1, i64 %iv + %gep.A = getelementptr inbounds i8, ptr %A, i64 %iv + %l = load i8, ptr %gep.A, align 1 + %ext = zext i8 %l to i32 + store i32 %ext, ptr %gep.A.400, align 4 + %iv.next = add nuw nsw i64 %iv, 1 + %ec = icmp eq i64 %iv, 100 + br i1 %ec, label %exit, label %loop + +exit: + %y = getelementptr inbounds i8, ptr %A, i64 405 + ret ptr %y +} + +define void @test_ptr_range_end_computed_before_loop(ptr %A) { +; BEFORE-LABEL: 'test_ptr_range_end_computed_before_loop' +; BEFORE-NEXT: Classifying expressions for: @test_ptr_range_end_computed_before_loop +; BEFORE-NEXT:%A.1 = getelementptr inbounds i8, ptr %A, i64 1 +; BEFORE-NEXT:--> (1 + %A) U: full-set S: full-set +; BEFORE-NEXT:%x = getelementptr inbounds i8, ptr %A, i64 405 +; +; LAA-LABEL: 'test_ptr_range_end_computed_before_loop' +; LAA-NEXT:loop: +; LAA-NEXT: Memory dependences are safe with run-time checks +; LAA-NEXT: Dependences: +; LAA-NEXT: Run-time memory checks: +; LAA-NEXT: Check 0: +; LAA-NEXT:Comparing group ([[GRP3:0x[0-9a-f]+]]): +; LAA-NEXT: %gep.A.400 = getelementptr inbounds i32, ptr %A.1, i64 %iv +; LAA-NEXT:Against group ([[GRP4:0x[0-9a-f]+]]): +; LAA-NEXT: %gep.A = getelementptr inbounds i8, ptr
[llvm-branch-commits] [llvm] 5474b1f - Revert "[MIPS] match llvm.{min, max}num with {min, max}.fmt for R6 (#89021)"
Author: YunQiang Su Date: 2024-05-22T22:09:27+08:00 New Revision: 5474b1f0bd73c94f78ccf63565b46fd1ee34b589 URL: https://github.com/llvm/llvm-project/commit/5474b1f0bd73c94f78ccf63565b46fd1ee34b589 DIFF: https://github.com/llvm/llvm-project/commit/5474b1f0bd73c94f78ccf63565b46fd1ee34b589.diff LOG: Revert "[MIPS] match llvm.{min,max}num with {min,max}.fmt for R6 (#89021)" This reverts commit 715219482b99ceef9bf83a2ff68c64c8faa930cd. Added: Modified: llvm/lib/Target/Mips/Mips32r6InstrInfo.td llvm/lib/Target/Mips/MipsISelLowering.cpp llvm/test/CodeGen/Mips/msa/f16-llvm-ir.ll Removed: llvm/test/CodeGen/Mips/mipsr6-minmaxnum.ll diff --git a/llvm/lib/Target/Mips/Mips32r6InstrInfo.td b/llvm/lib/Target/Mips/Mips32r6InstrInfo.td index f609305bfee42..bef7607118ce0 100644 --- a/llvm/lib/Target/Mips/Mips32r6InstrInfo.td +++ b/llvm/lib/Target/Mips/Mips32r6InstrInfo.td @@ -1117,22 +1117,6 @@ def : MipsPat<(select i32:$cond, immz, i32:$f), ISA_MIPS32R6; } -// llvm.fmin/fmax operations. -let AdditionalPredicates = [NotInMicroMips] in { - def : MipsPat<(fmaxnum f32:$lhs, f32:$rhs), -(MAX_S f32:$lhs, f32:$rhs)>, -ISA_MIPS32R6; - def : MipsPat<(fmaxnum f64:$lhs, f64:$rhs), -(MAX_D f64:$lhs, f64:$rhs)>, -ISA_MIPS32R6; - def : MipsPat<(fminnum f32:$lhs, f32:$rhs), -(MIN_S f32:$lhs, f32:$rhs)>, -ISA_MIPS32R6; - def : MipsPat<(fminnum f64:$lhs, f64:$rhs), -(MIN_D f64:$lhs, f64:$rhs)>, -ISA_MIPS32R6; -} - // Pseudo instructions let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1, hasDelaySlot = 1, hasExtraSrcRegAllocReq = 1, isCTI = 1, Defs = [AT], hasPostISelHook = 1 in { diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index 459164fa7a29d..834728a5b46e8 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -358,15 +358,6 @@ MipsTargetLowering::MipsTargetLowering(const MipsTargetMachine , setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom); setOperationAction(ISD::FP_TO_SINT, MVT::i32, Custom); - // Lower fmin and fmax operations for MIPS R6. - // Instructions are defined but never used. - if (Subtarget.hasMips32r6() || Subtarget.hasMips64r6()) { -setOperationAction(ISD::FMINNUM, MVT::f32, Legal); -setOperationAction(ISD::FMINNUM, MVT::f64, Legal); -setOperationAction(ISD::FMAXNUM, MVT::f32, Legal); -setOperationAction(ISD::FMAXNUM, MVT::f64, Legal); - } - if (Subtarget.isGP64bit()) { setOperationAction(ISD::GlobalAddress, MVT::i64, Custom); setOperationAction(ISD::BlockAddress, MVT::i64, Custom); diff --git a/llvm/test/CodeGen/Mips/mipsr6-minmaxnum.ll b/llvm/test/CodeGen/Mips/mipsr6-minmaxnum.ll deleted file mode 100644 index e14e89916e6dc..0 --- a/llvm/test/CodeGen/Mips/mipsr6-minmaxnum.ll +++ /dev/null @@ -1,69 +0,0 @@ -; RUN: llc %s -mtriple=mipsisa32r6el-linux-gnu -o - | \ -; RUN: FileCheck %s --check-prefix=MIPS32R6EL -; RUN: llc %s -mtriple=mipsisa64r6el-linux-gnuabi64 -o - | \ -; RUN: FileCheck %s --check-prefix=MIPS64R6EL - -define float @mins(float %x, float %y) { -; MIPS32R6EL-LABEL:mins -; MIPS32R6EL: # %bb.0: -; MIPS32R6EL-NEXT: jr $ra -; MIPS32R6EL-NEXT: min.s $f0, $f12, $f14 -; -; MIPS64R6EL-LABEL:mins -; MIPS64R6EL: # %bb.0: -; MIPS64R6EL-NEXT: jr $ra -; MIPS64R6EL-NEXT: min.s $f0, $f12, $f13 - - %r = tail call float @llvm.minnum.f32(float %x, float %y) - ret float %r -} - -define float @maxs(float %x, float %y) { -; MIPS32R6EL-LABEL:maxs -; MIPS32R6EL: # %bb.0: -; MIPS32R6EL-NEXT: jr $ra -; MIPS32R6EL-NEXT: max.s $f0, $f12, $f14 -; -; MIPS64R6EL-LABEL:maxs -; MIPS64R6EL: # %bb.0: -; MIPS64R6EL-NEXT: jr $ra -; MIPS64R6EL-NEXT: max.s $f0, $f12, $f13 - - %r = tail call float @llvm.maxnum.f32(float %x, float %y) - ret float %r -} - -define double @mind(double %x, double %y) { -; MIPS32R6EL-LABEL:mind -; MIPS32R6EL: # %bb.0: -; MIPS32R6EL-NEXT: jr $ra -; MIPS32R6EL-NEXT: min.d $f0, $f12, $f14 -; -; MIPS64R6EL-LABEL:mind -; MIPS64R6EL: # %bb.0: -; MIPS64R6EL-NEXT: jr $ra -; MIPS64R6EL-NEXT: min.d $f0, $f12, $f13 - - %r = tail call double @llvm.minnum.f64(double %x, double %y) - ret double %r -} - -define double @maxd(double %x, double %y) { -; MIPS32R6EL-LABEL:maxd -; MIPS32R6EL: # %bb.0: -; MIPS32R6EL-NEXT: jr $ra -; MIPS32R6EL-NEXT: max.d $f0, $f12, $f14 -; -; MIPS64R6EL-LABEL:maxd -; MIPS64R6EL: # %bb.0: -; MIPS64R6EL-NEXT: jr $ra -; MIPS64R6EL-NEXT: max.d $f0, $f12, $f13 - - %r = tail call
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
@@ -292,6 +294,7 @@ if(WIN32) set(LIBOMP_IMP_LIB_TARGET omp) set(LIBOMP_GENERATED_DEF_FILE ${LIBOMP_LIB_NAME}.def) add_custom_target(libomp-needed-def-file DEPENDS ${LIBOMP_GENERATED_DEF_FILE}) + set_target_properties(libomp-needed-def-file PROPERTIES FOLDER "OpenMP/Codegenning") shiltian wrote: `Codegenning` is really weird. I don't see this word anywhere else in LLVM project. Probably just `OpenMP/CodeGen`. https://github.com/llvm/llvm-project/pull/89750 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
@@ -126,6 +126,7 @@ macro(libomp_test_touch_recipe test_touch_dir) endmacro() libomp_append(libomp_test_touch_env "KMP_VERSION=1") add_custom_target(libomp-test-touch DEPENDS ${libomp_test_touch_targets}) +set_target_properties(libomp-test-touch PROPERTIES FOLDER "OpenMP/Tests") shiltian wrote: My point is, when it comes to directory (except the top level folder), we don't call it "OpenMP". I don't have a strong objection, but just find `libomp` more conventional. I'll leave it up to you. https://github.com/llvm/llvm-project/pull/89750 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/89750 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [openmp] [openmp] Revise IDE folder structure (PR #89750)
https://github.com/shiltian approved this pull request. LG with nit https://github.com/llvm/llvm-project/pull/89750 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -15980,7 +15985,44 @@ StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective( "affected loops"); // Decode the permutation clause. - constexpr uint64_t Permutation[] = {1, 0}; + SmallVector Permutation; + if (!PermutationClause) { +Permutation = {1, 0}; + } else { +ArrayRef PermArgs = PermutationClause->getArgsRefs(); +llvm::BitVector Flags(PermArgs.size()); +for (Expr *PermArg : PermArgs) { + std::optional PermCstExpr = + PermArg->getIntegerConstantExpr(Context); + if (!PermCstExpr) +continue; + uint64_t PermInt = PermCstExpr->getZExtValue(); + assert(1 <= PermInt && PermInt <= NumLoops && + "Must be a permutation; diagnostic emitted in " + "ActOnOpenMPPermutationClause"); + if (Flags[PermInt - 1]) { +SourceRange ExprRange(PermArg->getBeginLoc(), PermArg->getEndLoc()); +Diag(PermArg->getExprLoc(), + diag::err_omp_interchange_permutation_value_repeated) +<< PermInt << ExprRange; +continue; + } + Flags[PermInt - 1] = true; + + Permutation.push_back(PermInt - 1); +} + +if (Permutation.size() != NumLoops) + return StmtError(); + } + + // Nothing to transform with trivial permutation. + if (NumLoops <= 1 || llvm::all_of(llvm::enumerate(Permutation), [](auto p) { alexey-bataev wrote: `auto P` https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -15972,6 +15971,12 @@ StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective( return OMPInterchangeDirective::Create(Context, StartLoc, EndLoc, Clauses, NumLoops, AStmt, nullptr, nullptr); + // An invalid expression in the permutation clause is set to nullptr in + // ActOnOpenMPPermutationClause. + if (PermutationClause && llvm::any_of(PermutationClause->getArgsRefs(), +[](Expr *E) { return !E; })) alexey-bataev wrote: Use is_contained https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -9861,13 +9842,19 @@ buildPreInits(ASTContext , /// Build pre-init statement for the given statements. static Stmt *buildPreInits(ASTContext , ArrayRef PreInits) { - if (PreInits.empty()) -return nullptr; - - SmallVector Stmts; - for (Stmt *S : PreInits) -appendFlattendedStmtList(Stmts, S); - return CompoundStmt::Create(Context, PreInits, FPOptionsOverride(), {}, {}); + if (!PreInits.empty()) { +SmallVector Stmts; +for (Stmt *S : PreInits) { + // Do not nest CompoundStmts. + if (auto *CS = dyn_cast(S)) { +llvm::append_range(Stmts, CS->body()); +continue; + } + Stmts.push_back(S); +} +return CompoundStmt::Create(Context, PreInits, FPOptionsOverride(), {}, {}); + } + return nullptr; alexey-bataev wrote: Original code should work correctly, no? https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -15209,7 +15206,7 @@ static void collectLoopStmts(Stmt *AStmt, MutableArrayRef LoopStmts) { LoopStmts[Cnt] = CurStmt; return false; }); - assert(!is_contained(LoopStmts, nullptr) && + assert(llvm::all_of(LoopStmts, [](Stmt *LoopStmt) { return LoopStmt; }) && alexey-bataev wrote: restore https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -1774,6 +1793,18 @@ void OMPClausePrinter::VisitOMPSizesClause(OMPSizesClause *Node) { OS << ")"; } +void OMPClausePrinter::VisitOMPPermutationClause(OMPPermutationClause *Node) { + OS << "permutation("; + bool First = true; + for (Expr *Size : Node->getArgsRefs()) { +if (!First) + OS << ", "; +Size->printPretty(OS, nullptr, Policy, 0); +First = false; + } alexey-bataev wrote: `llvm::interleaveComma(Node->getArgsRefs(), OS, [&](const Expr *E) { E->printPretty(OS, nullptr, Policy, 0); });` https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -9970,9 +9957,12 @@ checkOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr, // Search for pre-init declared variables that need to be captured // to be referenceable inside the directive. SmallVector Constituents; -appendFlattendedStmtList(Constituents, DependentPreInits); +if (auto *CS = dyn_cast(DependentPreInits)) alexey-bataev wrote: Restore original https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -15149,8 +15139,15 @@ bool SemaOpenMP::checkTransformableLoopNest( DependentPreInits = Dir->getPreInits(); else llvm_unreachable("Unhandled loop transformation"); - -appendFlattendedStmtList(OriginalInits.back(), DependentPreInits); +if (!DependentPreInits) alexey-bataev wrote: Restore https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [flang] [llvm] [Clang][OpenMP] Add permutation clause (PR #92030)
@@ -870,6 +870,106 @@ class OMPSizesClause final } }; +/// This class represents the 'permutation' clause in the +/// '#pragma omp interchange' directive. +/// +/// \code{c} +/// #pragma omp interchange permutation(2,1) +/// for (int i = 0; i < 64; ++i) +/// for (int j = 0; j < 64; ++j) +/// \endcode +class OMPPermutationClause final +: public OMPClause, + private llvm::TrailingObjects { + friend class OMPClauseReader; + friend class llvm::TrailingObjects; + + /// Location of '('. + SourceLocation LParenLoc; + + /// Number of arguments in the clause, and hence also the number of loops to + /// be permuted. + unsigned NumLoops; + + /// Sets the permutation index expressions. + void setArgRefs(ArrayRef VL) { +assert(VL.size() == NumLoops); +std::copy(VL.begin(), VL.end(), alexey-bataev wrote: Use llvm::copy https://github.com/llvm/llvm-project/pull/92030 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits