diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 4015246a0ba5..146957a6b87f 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,447 @@ # xargs -n1 | sort | uniq -d; # done +# 2024mmdd: new clang import which bumps version from 17 to 18 +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_math.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/17/include/__clang_cuda_texture_intrinsics.h +OLD_FILES+=usr/lib/clang/17/include/__clang_hip_cmath.h +OLD_FILES+=usr/lib/clang/17/include/__clang_hip_libdevice_declares.h +OLD_FILES+=usr/lib/clang/17/include/__clang_hip_math.h +OLD_FILES+=usr/lib/clang/17/include/__clang_hip_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/17/include/__clang_hip_stdlib.h +OLD_FILES+=usr/lib/clang/17/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/17/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/17/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/17/include/adxintrin.h +OLD_FILES+=usr/lib/clang/17/include/altivec.h +OLD_FILES+=usr/lib/clang/17/include/ammintrin.h +OLD_FILES+=usr/lib/clang/17/include/amxcomplexintrin.h +OLD_FILES+=usr/lib/clang/17/include/amxfp16intrin.h +OLD_FILES+=usr/lib/clang/17/include/amxintrin.h +OLD_FILES+=usr/lib/clang/17/include/arm64intr.h +OLD_FILES+=usr/lib/clang/17/include/arm_acle.h +OLD_FILES+=usr/lib/clang/17/include/arm_bf16.h +OLD_FILES+=usr/lib/clang/17/include/arm_cde.h +OLD_FILES+=usr/lib/clang/17/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/17/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/17/include/arm_mve.h +OLD_FILES+=usr/lib/clang/17/include/arm_neon.h +OLD_FILES+=usr/lib/clang/17/include/arm_neon_sve_bridge.h +OLD_FILES+=usr/lib/clang/17/include/arm_sme_draft_spec_subject_to_change.h +OLD_FILES+=usr/lib/clang/17/include/arm_sve.h +OLD_FILES+=usr/lib/clang/17/include/armintr.h +OLD_FILES+=usr/lib/clang/17/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512fp16intrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlfp16intrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/17/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/17/include/avxifmaintrin.h +OLD_FILES+=usr/lib/clang/17/include/avxintrin.h +OLD_FILES+=usr/lib/clang/17/include/avxneconvertintrin.h +OLD_FILES+=usr/lib/clang/17/include/avxvnniint16intrin.h +OLD_FILES+=usr/lib/clang/17/include/avxvnniint8intrin.h +OLD_FILES+=usr/lib/clang/17/include/avxvnniintrin.h +OLD_FILES+=usr/lib/clang/17/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/17/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/17/include/builtins.h +OLD_FILES+=usr/lib/clang/17/include/cet.h +OLD_FILES+=usr/lib/clang/17/include/cetintrin.h +OLD_FILES+=usr/lib/clang/17/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/17/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/17/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/17/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/17/include/cmpccxaddintrin.h +OLD_FILES+=usr/lib/clang/17/include/cpuid.h +OLD_FILES+=usr/lib/clang/17/include/crc32intrin.h +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/bits/shared_ptr_base.h +OLD_DIRS+=usr/lib/clang/17/include/cuda_wrappers/bits +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/cmath +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/17/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/17/include/emmintrin.h +OLD_FILES+=usr/lib/clang/17/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/17/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/17/include/float.h +OLD_FILES+=usr/lib/clang/17/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/17/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/17/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/17/include/fuzzer +OLD_FILES+=usr/lib/clang/17/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/17/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/17/include/hexagon_circ_brev_intrinsics.h +OLD_FILES+=usr/lib/clang/17/include/hexagon_protos.h +OLD_FILES+=usr/lib/clang/17/include/hexagon_types.h +OLD_FILES+=usr/lib/clang/17/include/hlsl/hlsl_basic_types.h +OLD_FILES+=usr/lib/clang/17/include/hlsl/hlsl_intrinsics.h +OLD_DIRS+=usr/lib/clang/17/include/hlsl +OLD_FILES+=usr/lib/clang/17/include/hlsl.h +OLD_FILES+=usr/lib/clang/17/include/hresetintrin.h +OLD_FILES+=usr/lib/clang/17/include/htmintrin.h +OLD_FILES+=usr/lib/clang/17/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/17/include/hvx_hexagon_protos.h +OLD_FILES+=usr/lib/clang/17/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/17/include/immintrin.h +OLD_FILES+=usr/lib/clang/17/include/intrin.h +OLD_FILES+=usr/lib/clang/17/include/inttypes.h +OLD_FILES+=usr/lib/clang/17/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/17/include/iso646.h +OLD_FILES+=usr/lib/clang/17/include/keylockerintrin.h +OLD_FILES+=usr/lib/clang/17/include/larchintrin.h +OLD_FILES+=usr/lib/clang/17/include/limits.h +OLD_FILES+=usr/lib/clang/17/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/17/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/17/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/17/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/17/include/mmintrin.h +OLD_FILES+=usr/lib/clang/17/include/module.modulemap +OLD_FILES+=usr/lib/clang/17/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/17/include/msa.h +OLD_FILES+=usr/lib/clang/17/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/17/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/17/include/omp-tools.h +OLD_FILES+=usr/lib/clang/17/include/omp.h +OLD_FILES+=usr/lib/clang/17/include/ompt.h +OLD_FILES+=usr/lib/clang/17/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/17/include/opencl-c.h +OLD_FILES+=usr/lib/clang/17/include/openmp_wrappers/__clang_openmp_device_functions.h +OLD_FILES+=usr/lib/clang/17/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/17/include/openmp_wrappers/complex +OLD_FILES+=usr/lib/clang/17/include/openmp_wrappers/complex.h +OLD_FILES+=usr/lib/clang/17/include/openmp_wrappers/complex_cmath.h +OLD_FILES+=usr/lib/clang/17/include/openmp_wrappers/math.h +OLD_FILES+=usr/lib/clang/17/include/openmp_wrappers/new +OLD_DIRS+=usr/lib/clang/17/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/17/include/orc_rt/c_api.h +OLD_DIRS+=usr/lib/clang/17/include/orc_rt +OLD_FILES+=usr/lib/clang/17/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/17/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/17/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/17/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/bmi2intrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/bmiintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/immintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/x86gprintrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/x86intrin.h +OLD_FILES+=usr/lib/clang/17/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/17/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/17/include/prfchiintrin.h +OLD_FILES+=usr/lib/clang/17/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/17/include/profile/InstrProfData.inc +OLD_FILES+=usr/lib/clang/17/include/profile/MemProfData.inc +OLD_DIRS+=usr/lib/clang/17/include/profile +OLD_FILES+=usr/lib/clang/17/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/17/include/raointintrin.h +OLD_FILES+=usr/lib/clang/17/include/rdpruintrin.h +OLD_FILES+=usr/lib/clang/17/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/17/include/riscv_ntlh.h +OLD_FILES+=usr/lib/clang/17/include/riscv_vector.h +OLD_FILES+=usr/lib/clang/17/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/17/include/s390intrin.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/memprof_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/17/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/17/include/sanitizer +OLD_FILES+=usr/lib/clang/17/include/serializeintrin.h +OLD_FILES+=usr/lib/clang/17/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/17/include/sha512intrin.h +OLD_FILES+=usr/lib/clang/17/include/shaintrin.h +OLD_FILES+=usr/lib/clang/17/include/sifive_vector.h +OLD_FILES+=usr/lib/clang/17/include/sm3intrin.h +OLD_FILES+=usr/lib/clang/17/include/sm4intrin.h +OLD_FILES+=usr/lib/clang/17/include/smmintrin.h +OLD_FILES+=usr/lib/clang/17/include/stdalign.h +OLD_FILES+=usr/lib/clang/17/include/stdarg.h +OLD_FILES+=usr/lib/clang/17/include/stdatomic.h +OLD_FILES+=usr/lib/clang/17/include/stdbool.h +OLD_FILES+=usr/lib/clang/17/include/stddef.h +OLD_FILES+=usr/lib/clang/17/include/stdint.h +OLD_FILES+=usr/lib/clang/17/include/stdnoreturn.h +OLD_FILES+=usr/lib/clang/17/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/17/include/tgmath.h +OLD_FILES+=usr/lib/clang/17/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/17/include/tsxldtrkintrin.h +OLD_FILES+=usr/lib/clang/17/include/uintrintrin.h +OLD_FILES+=usr/lib/clang/17/include/unwind.h +OLD_FILES+=usr/lib/clang/17/include/vadefs.h +OLD_FILES+=usr/lib/clang/17/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/17/include/varargs.h +OLD_FILES+=usr/lib/clang/17/include/vecintrin.h +OLD_FILES+=usr/lib/clang/17/include/velintrin.h +OLD_FILES+=usr/lib/clang/17/include/velintrin_approx.h +OLD_FILES+=usr/lib/clang/17/include/velintrin_gen.h +OLD_FILES+=usr/lib/clang/17/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/17/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/17/include/wasm_simd128.h +OLD_FILES+=usr/lib/clang/17/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/17/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/17/include/x86gprintrin.h +OLD_FILES+=usr/lib/clang/17/include/x86intrin.h +OLD_FILES+=usr/lib/clang/17/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/17/include/xopintrin.h +OLD_FILES+=usr/lib/clang/17/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/17/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/17/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/17/include/xray +OLD_FILES+=usr/lib/clang/17/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/17/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/17/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/17/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/17/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/17/include +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-powerpc64.so +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-powerpc64le.so +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-preinit-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-preinit-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-preinit-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-riscv64.so +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_cxx-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_cxx-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_cxx-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_static-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_static-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_static-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.asan_static-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.fuzzer_interceptors-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.msan-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.msan-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.msan_cxx-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.msan_cxx-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats_client-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats_client-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats_client-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.tsan-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.tsan-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.tsan_cxx-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.tsan_cxx-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_minimal-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_minimal-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_minimal-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone_cxx-powerpc64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone_cxx-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone_cxx-riscv64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-basic-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-basic-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-basic-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-basic-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-basic-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-fdr-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-fdr-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-fdr-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-fdr-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-fdr-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-profiling-aarch64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-profiling-arm.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-profiling-armhf.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-profiling-powerpc64le.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-profiling-x86_64.a +OLD_FILES+=usr/lib/clang/17/lib/freebsd/libclang_rt.xray-x86_64.a +OLD_DIRS+=usr/lib/clang/17/lib/freebsd +OLD_DIRS+=usr/lib/clang/17/lib +OLD_FILES+=usr/lib/clang/17/share/asan_ignorelist.txt +OLD_FILES+=usr/lib/clang/17/share/cfi_ignorelist.txt +OLD_FILES+=usr/lib/clang/17/share/msan_ignorelist.txt +OLD_DIRS+=usr/lib/clang/17/share +OLD_DIRS+=usr/lib/clang/17 + +# 2024mmdd: new libc++ import which bumps version from 17 to 18 +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/algorithm_fwd.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/algorithm_impl.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/execution_defs.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/execution_impl.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/glue_algorithm_defs.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/glue_algorithm_impl.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/glue_memory_defs.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/glue_memory_impl.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/glue_numeric_defs.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/glue_numeric_impl.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/memory_impl.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/numeric_fwd.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/numeric_impl.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_for.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_for_each.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_invoke.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_merge.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_scan.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_stable_partial_sort.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_stable_sort.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_transform_reduce.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/parallel_transform_scan.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/omp/util.h +OLD_DIRS+=usr/include/include/c++/v1/__pstl/internal/omp +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/parallel_backend.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/parallel_backend_omp.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/parallel_backend_serial.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/parallel_backend_tbb.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/parallel_backend_utils.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/unseq_backend_simd.h +OLD_FILES+=usr/include/include/c++/v1/__pstl/internal/utils.h +OLD_DIRS+=usr/include/include/c++/v1/__pstl/internal +OLD_DIRS+=usr/include/include/c++/v1/__pstl +OLD_FILES+=usr/include/include/c++/v1/__pstl_algorithm +OLD_FILES+=usr/include/include/c++/v1/__pstl_memory +OLD_FILES+=usr/include/include/c++/v1/__pstl_numeric +OLD_FILES+=usr/include/include/c++/v1/__type_traits/predicate_traits.h +OLD_FILES+=usr/include/include/c++/v1/__utility/terminate_on_exception.h +OLD_FILES+=usr/include/include/c++/v1/experimental/deque +OLD_FILES+=usr/include/include/c++/v1/experimental/forward_list +OLD_FILES+=usr/include/include/c++/v1/experimental/list +OLD_FILES+=usr/include/include/c++/v1/experimental/map +OLD_FILES+=usr/include/include/c++/v1/experimental/memory_resource +OLD_FILES+=usr/include/include/c++/v1/experimental/regex +OLD_FILES+=usr/include/include/c++/v1/experimental/set +OLD_FILES+=usr/include/include/c++/v1/experimental/string +OLD_FILES+=usr/include/include/c++/v1/experimental/unordered_map +OLD_FILES+=usr/include/include/c++/v1/experimental/unordered_set +OLD_FILES+=usr/include/include/c++/v1/experimental/vector +OLD_FILES+=usr/include/include/c++/v1/limits.h +OLD_FILES+=usr/include/include/c++/v1/setjmp.h + # 20240321: remove empty /usr/libdata/gcc directory OLD_DIRS+=usr/libdata/gcc diff --git a/contrib/llvm-project/FREEBSD-Xlist b/contrib/llvm-project/FREEBSD-Xlist index 33dc1ed3867f..68c5f33ba058 100644 --- a/contrib/llvm-project/FREEBSD-Xlist +++ b/contrib/llvm-project/FREEBSD-Xlist @@ -7,6 +7,7 @@ .github/ .gitignore .mailmap +CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE.TXT README.md @@ -111,6 +112,7 @@ clang/tools/clang-format/clang-format.el clang/tools/clang-format/clang-format.py clang/tools/clang-format/fuzzer/ clang/tools/clang-format/git-clang-format +clang/tools/clang-format/git-clang-format.bat clang/tools/clang-format-vs/ clang/tools/clang-fuzzer/ clang/tools/clang-import-test/ @@ -144,6 +146,7 @@ clang/utils/FuzzTest clang/utils/TableGen/CMakeLists.txt clang/utils/TestUtils/ clang/utils/VtableTest/ +clang/utils/analyze_safe_buffer_debug_notes.py clang/utils/analyzer/ clang/utils/bash-autocomplete.sh clang/utils/builtin-defines.c @@ -160,6 +163,7 @@ clang/utils/modfuzz.py clang/utils/module-deps-to-rsp.py clang/utils/perf-training/ clang/utils/token-delta.py +clang/utils/update_options_td_flags.py clang/utils/valgrind/ clang/www/ clang-tools-extra/ @@ -216,6 +220,7 @@ compiler-rt/lib/safestack/CMakeLists.txt compiler-rt/lib/sanitizer_common/.clang-format compiler-rt/lib/sanitizer_common/CMakeLists.txt compiler-rt/lib/sanitizer_common/scripts/ +compiler-rt/lib/sanitizer_common/symbolizer/CMakeLists.txt compiler-rt/lib/sanitizer_common/tests/ compiler-rt/lib/scudo/standalone/CMakeLists.txt compiler-rt/lib/scudo/standalone/benchmarks/ @@ -262,6 +267,7 @@ libcxx/include/__support/ libcxx/lib/ libcxx/modules/CMakeLists.txt libcxx/modules/CMakeLists.txt.in +libcxx/modules/README.md libcxx/src/CMakeLists.txt libcxx/src/support/win32/ libcxx/test/ @@ -291,7 +297,7 @@ lldb/.clang-format lldb/.clang-tidy lldb/.gitignore lldb/CMakeLists.txt -lldb/CODE_OWNERS.txt +lldb/CodeOwners.rst lldb/bindings/CMakeLists.txt lldb/bindings/lua/CMakeLists.txt lldb/bindings/python/CMakeLists.txt @@ -299,7 +305,6 @@ lldb/bindings/python/get-python-config.py lldb/cmake/ lldb/docs/.htaccess lldb/docs/CMakeLists.txt -lldb/docs/_static/ lldb/docs/conf.py lldb/docs/doxygen-mainpage.dox lldb/docs/doxygen.cfg.in @@ -308,7 +313,6 @@ lldb/docs/lldb-for-gdb-users.txt lldb/docs/lldb-gdb-remote.txt lldb/docs/lldb-platform-packets.txt lldb/docs/resources/ -lldb/docs/status/ lldb/docs/testsuite/ lldb/docs/use/ lldb/examples/ @@ -341,6 +345,7 @@ lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt lldb/source/Plugins/ABI/MSP430/CMakeLists.txt lldb/source/Plugins/ABI/Mips/CMakeLists.txt lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt +lldb/source/Plugins/ABI/RISCV/CMakeLists.txt lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt lldb/source/Plugins/ABI/X86/CMakeLists.txt lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt @@ -353,6 +358,7 @@ lldb/source/Plugins/Disassembler/CMakeLists.txt lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt lldb/source/Plugins/DynamicLoader/CMakeLists.txt lldb/source/Plugins/DynamicLoader/Darwin-Kernel/ +lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/CMakeLists.txt lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/CMakeLists.txt lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/ lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt @@ -370,10 +376,12 @@ lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt lldb/source/Plugins/Instruction/RISCV/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/ASanLibsanitizers/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/Utility/CMakeLists.txt lldb/source/Plugins/JITLoader/CMakeLists.txt lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt lldb/source/Plugins/Language/CMakeLists.txt @@ -438,6 +446,7 @@ lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/CMakeLists.txt lldb/source/Plugins/StructuredData/CMakeLists.txt lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt lldb/source/Plugins/SymbolFile/Breakpad/CMakeLists.txt @@ -448,6 +457,10 @@ lldb/source/Plugins/SymbolFile/JSON/CMakeLists.txt lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt lldb/source/Plugins/SymbolFile/Symtab/CMakeLists.txt +lldb/source/Plugins/SymbolLocator/CMakeLists.txt +lldb/source/Plugins/SymbolLocator/DebugSymbols/CMakeLists.txt +lldb/source/Plugins/SymbolLocator/Debuginfod/CMakeLists.txt +lldb/source/Plugins/SymbolLocator/Default/CMakeLists.txt lldb/source/Plugins/SymbolVendor/CMakeLists.txt lldb/source/Plugins/SymbolVendor/ELF/CMakeLists.txt lldb/source/Plugins/SymbolVendor/MacOSX/ @@ -479,11 +492,12 @@ lldb/tools/debugserver/ lldb/tools/driver/CMakeLists.txt lldb/tools/driver/lldb-Info.plist.in lldb/tools/intel-features/ +lldb/tools/lldb-dap/ lldb/tools/lldb-fuzzer/ lldb/tools/lldb-instr/CMakeLists.txt lldb/tools/lldb-server/CMakeLists.txt lldb/tools/lldb-test/ -lldb/tools/lldb-vscode/ +lldb/tools/lldb-vscode lldb/unittests/ lldb/use_lldb_suite_root.py lldb/utils/CMakeLists.txt @@ -555,6 +569,7 @@ llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt llvm/lib/ExecutionEngine/Orc/CMakeLists.txt +llvm/lib/ExecutionEngine/Orc/Debugging/CMakeLists.txt llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt @@ -562,7 +577,9 @@ llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt llvm/lib/Extensions/ llvm/lib/FileCheck/CMakeLists.txt llvm/lib/Frontend/CMakeLists.txt +llvm/lib/Frontend/Driver/CMakeLists.txt llvm/lib/Frontend/HLSL/CMakeLists.txt +llvm/lib/Frontend/Offloading/CMakeLists.txt llvm/lib/Frontend/OpenACC/CMakeLists.txt llvm/lib/Frontend/OpenMP/CMakeLists.txt llvm/lib/FuzzMutate/CMakeLists.txt @@ -743,6 +760,7 @@ llvm/lib/Transforms/CFGuard/CMakeLists.txt llvm/lib/Transforms/CMakeLists.txt llvm/lib/Transforms/Coroutines/CMakeLists.txt llvm/lib/Transforms/Hello/ +llvm/lib/Transforms/HipStdPar/CMakeLists.txt llvm/lib/Transforms/IPO/CMakeLists.txt llvm/lib/Transforms/InstCombine/CMakeLists.txt llvm/lib/Transforms/Instrumentation/CMakeLists.txt @@ -824,8 +842,8 @@ llvm/tools/llvm-profdata/CMakeLists.txt llvm/tools/llvm-profgen/ llvm/tools/llvm-rc/ llvm/tools/llvm-readobj/CMakeLists.txt +llvm/tools/llvm-readtapi/ llvm/tools/llvm-reduce/ -llvm/tools/llvm-remark-size-diff/ llvm/tools/llvm-remarkutil/CMakeLists.txt llvm/tools/llvm-rtdyld/CMakeLists.txt llvm/tools/llvm-rust-demangle-fuzzer/ @@ -837,7 +855,6 @@ llvm/tools/llvm-split/ llvm/tools/llvm-stress/CMakeLists.txt llvm/tools/llvm-strings/CMakeLists.txt llvm/tools/llvm-symbolizer/CMakeLists.txt -llvm/tools/llvm-tapi-diff/CMakeLists.txt llvm/tools/llvm-tli-checker/CMakeLists.txt llvm/tools/llvm-undname/ llvm/tools/llvm-xray/CMakeLists.txt @@ -850,6 +867,7 @@ llvm/tools/opt-viewer/ llvm/tools/remarks-shlib/ llvm/tools/sancov/ llvm/tools/sanstats/ +llvm/tools/spirv-tools/ llvm/tools/verify-uselistorder/ llvm/tools/vfabi-demangle-fuzzer/ llvm/tools/xcode-toolchain/ @@ -867,6 +885,7 @@ llvm/utils/PerfectShuffle/ llvm/utils/Reviewing/ llvm/utils/TableGen/CMakeLists.txt llvm/utils/TableGen/GlobalISel/CMakeLists.txt +llvm/utils/TableGen/README.md llvm/utils/TableGen/jupyter/ llvm/utils/TableGen/tdtags llvm/utils/Target/ @@ -918,7 +937,6 @@ llvm/utils/llvm-original-di-preservation.py llvm/utils/llvm.grm llvm/utils/merge-stats.py llvm/utils/not/ -llvm/utils/phabricator/ llvm/utils/pipeline.py llvm/utils/prepare-code-coverage-artifact.py llvm/utils/reduce_pipeline.py diff --git a/contrib/llvm-project/clang/include/clang-c/BuildSystem.h b/contrib/llvm-project/clang/include/clang-c/BuildSystem.h index 296e61247cef..57e16af20a70 100644 --- a/contrib/llvm-project/clang/include/clang-c/BuildSystem.h +++ b/contrib/llvm-project/clang/include/clang-c/BuildSystem.h @@ -95,7 +95,7 @@ CINDEX_LINKAGE void clang_free(void *buffer); CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay); /** - * Object encapsulating information about a module.map file. + * Object encapsulating information about a module.modulemap file. */ typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor; @@ -109,7 +109,7 @@ CINDEX_LINKAGE CXModuleMapDescriptor clang_ModuleMapDescriptor_create(unsigned options); /** - * Sets the framework module name that the module.map describes. + * Sets the framework module name that the module.modulemap describes. * \returns 0 for success, non-zero to indicate an error. */ CINDEX_LINKAGE enum CXErrorCode @@ -117,7 +117,7 @@ clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor, const char *name); /** - * Sets the umbrella header name that the module.map describes. + * Sets the umbrella header name that the module.modulemap describes. * \returns 0 for success, non-zero to indicate an error. */ CINDEX_LINKAGE enum CXErrorCode diff --git a/contrib/llvm-project/clang/include/clang-c/Index.h b/contrib/llvm-project/clang/include/clang-c/Index.h index 601b91f67d65..64ab3378957c 100644 --- a/contrib/llvm-project/clang/include/clang-c/Index.h +++ b/contrib/llvm-project/clang/include/clang-c/Index.h @@ -2136,7 +2136,11 @@ enum CXCursorKind { */ CXCursor_OMPErrorDirective = 305, - CXCursor_LastStmt = CXCursor_OMPErrorDirective, + /** OpenMP scope directive. + */ + CXCursor_OMPScopeDirective = 306, + + CXCursor_LastStmt = CXCursor_OMPScopeDirective, /** * Cursor that represents the translation unit itself. @@ -2976,6 +2980,7 @@ enum CXCallingConv { CXCallingConv_AArch64VectorCall = 16, CXCallingConv_SwiftAsync = 17, CXCallingConv_AArch64SVEPCS = 18, + CXCallingConv_M68kRTD = 19, CXCallingConv_Invalid = 100, CXCallingConv_Unexposed = 200 diff --git a/contrib/llvm-project/clang/include/clang/APINotes/APINotesManager.h b/contrib/llvm-project/clang/include/clang/APINotes/APINotesManager.h new file mode 100644 index 000000000000..18375c9e51a1 --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/APINotes/APINotesManager.h @@ -0,0 +1,175 @@ +//===--- APINotesManager.h - Manage API Notes Files -------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_APINOTES_APINOTESMANAGER_H +#define LLVM_CLANG_APINOTES_APINOTESMANAGER_H + +#include "clang/Basic/Module.h" +#include "clang/Basic/SourceLocation.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/PointerUnion.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/VersionTuple.h" +#include +#include + +namespace clang { + +class DirectoryEntry; +class FileEntry; +class LangOptions; +class SourceManager; + +namespace api_notes { + +class APINotesReader; + +/// The API notes manager helps find API notes associated with declarations. +/// +/// API notes are externally-provided annotations for declarations that can +/// introduce new attributes (covering availability, nullability of +/// parameters/results, and so on) for specific declarations without directly +/// modifying the headers that contain those declarations. +/// +/// The API notes manager is responsible for finding and loading the +/// external API notes files that correspond to a given header. Its primary +/// operation is \c findAPINotes(), which finds the API notes reader that +/// provides information about the declarations at that location. +class APINotesManager { + using ReaderEntry = llvm::PointerUnion; + + SourceManager &SM; + + /// Whether to implicitly search for API notes files based on the + /// source file from which an entity was declared. + bool ImplicitAPINotes; + + /// The Swift version to use when interpreting versioned API notes. + llvm::VersionTuple SwiftVersion; + + enum ReaderKind : unsigned { Public = 0, Private = 1 }; + + /// API notes readers for the current module. + /// + /// There can be up to two of these, one for public headers and one + /// for private headers. + /// + /// Not using std::unique_ptr to store these, since the reader pointers are + /// also stored in llvm::PointerUnion below. + APINotesReader *CurrentModuleReaders[2] = {nullptr, nullptr}; + + /// A mapping from header file directories to the API notes reader for + /// that directory, or a redirection to another directory entry that may + /// have more information, or NULL to indicate that there is no API notes + /// reader for this directory. + llvm::DenseMap Readers; + + /// Load the API notes associated with the given file, whether it is + /// the binary or source form of API notes. + /// + /// \returns the API notes reader for this file, or null if there is + /// a failure. + std::unique_ptr loadAPINotes(FileEntryRef APINotesFile); + + /// Load the API notes associated with the given buffer, whether it is + /// the binary or source form of API notes. + /// + /// \returns the API notes reader for this file, or null if there is + /// a failure. + std::unique_ptr loadAPINotes(StringRef Buffer); + + /// Load the given API notes file for the given header directory. + /// + /// \param HeaderDir The directory at which we + /// + /// \returns true if an error occurred. + bool loadAPINotes(const DirectoryEntry *HeaderDir, FileEntryRef APINotesFile); + + /// Look for API notes in the given directory. + /// + /// This might find either a binary or source API notes. + OptionalFileEntryRef findAPINotesFile(DirectoryEntryRef Directory, + StringRef FileName, + bool WantPublic = true); + + /// Attempt to load API notes for the given framework. A framework will have + /// the API notes file under either {FrameworkPath}/APINotes, + /// {FrameworkPath}/Headers or {FrameworkPath}/PrivateHeaders, while a + /// library will have the API notes simply in its directory. + /// + /// \param FrameworkPath The path to the framework. + /// \param Public Whether to load the public API notes. Otherwise, attempt + /// to load the private API notes. + /// + /// \returns the header directory entry (e.g., for Headers or PrivateHeaders) + /// for which the API notes were successfully loaded, or NULL if API notes + /// could not be loaded for any reason. + OptionalDirectoryEntryRef loadFrameworkAPINotes(llvm::StringRef FrameworkPath, + llvm::StringRef FrameworkName, + bool Public); + +public: + APINotesManager(SourceManager &SM, const LangOptions &LangOpts); + ~APINotesManager(); + + /// Set the Swift version to use when filtering API notes. + void setSwiftVersion(llvm::VersionTuple Version) { + this->SwiftVersion = Version; + } + + /// Load the API notes for the current module. + /// + /// \param M The current module. + /// \param LookInModule Whether to look inside the module itself. + /// \param SearchPaths The paths in which we should search for API notes + /// for the current module. + /// + /// \returns true if API notes were successfully loaded, \c false otherwise. + bool loadCurrentModuleAPINotes(Module *M, bool LookInModule, + ArrayRef SearchPaths); + + /// Get FileEntry for the APINotes of the module that is currently being + /// compiled. + /// + /// \param M The current module. + /// \param LookInModule Whether to look inside the directory of the current + /// module. + /// \param SearchPaths The paths in which we should search for API + /// notes for the current module. + /// + /// \returns a vector of FileEntry where APINotes files are. + llvm::SmallVector + getCurrentModuleAPINotes(Module *M, bool LookInModule, + ArrayRef SearchPaths); + + /// Load Compiled API notes for current module. + /// + /// \param Buffers Array of compiled API notes. + /// + /// \returns true if API notes were successfully loaded, \c false otherwise. + bool loadCurrentModuleAPINotesFromBuffer(ArrayRef Buffers); + + /// Retrieve the set of API notes readers for the current module. + ArrayRef getCurrentModuleReaders() const { + bool HasPublic = CurrentModuleReaders[ReaderKind::Public]; + bool HasPrivate = CurrentModuleReaders[ReaderKind::Private]; + assert((!HasPrivate || HasPublic) && "private module requires public module"); + if (!HasPrivate && !HasPublic) + return {}; + return ArrayRef(CurrentModuleReaders).slice(0, HasPrivate ? 2 : 1); + } + + /// Find the API notes readers that correspond to the given source location. + llvm::SmallVector findAPINotes(SourceLocation Loc); +}; + +} // end namespace api_notes +} // end namespace clang + +#endif diff --git a/contrib/llvm-project/clang/include/clang/APINotes/APINotesOptions.h b/contrib/llvm-project/clang/include/clang/APINotes/APINotesOptions.h new file mode 100644 index 000000000000..e8b8a9ed2261 --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/APINotes/APINotesOptions.h @@ -0,0 +1,34 @@ +//===--- APINotesOptions.h --------------------------------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_APINOTES_APINOTESOPTIONS_H +#define LLVM_CLANG_APINOTES_APINOTESOPTIONS_H + +#include "llvm/Support/VersionTuple.h" +#include +#include + +namespace clang { + +/// Tracks various options which control how API notes are found and handled. +class APINotesOptions { +public: + /// The Swift version which should be used for API notes. + llvm::VersionTuple SwiftVersion; + + /// The set of search paths where we API notes can be found for particular + /// modules. + /// + /// The API notes in this directory are stored as .apinotes, and + /// are only applied when building the module . + std::vector ModuleSearchPaths; +}; + +} // namespace clang + +#endif // LLVM_CLANG_APINOTES_APINOTESOPTIONS_H diff --git a/contrib/llvm-project/clang/include/clang/APINotes/APINotesReader.h b/contrib/llvm-project/clang/include/clang/APINotes/APINotesReader.h new file mode 100644 index 000000000000..1c5aab095955 --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/APINotes/APINotesReader.h @@ -0,0 +1,200 @@ +//===--- APINotesReader.h - API Notes Reader --------------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +// This file defines the \c APINotesReader class that reads source API notes +// data providing additional information about source code as a separate input, +// such as the non-nil/nilable annotations for method parameters. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_APINOTES_READER_H +#define LLVM_CLANG_APINOTES_READER_H + +#include "clang/APINotes/Types.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/VersionTuple.h" +#include + +namespace clang { +namespace api_notes { + +/// A class that reads API notes data from a binary file that was written by +/// the \c APINotesWriter. +class APINotesReader { + class Implementation; + std::unique_ptr Implementation; + + APINotesReader(llvm::MemoryBuffer *InputBuffer, + llvm::VersionTuple SwiftVersion, bool &Failed); + +public: + /// Create a new API notes reader from the given member buffer, which + /// contains the contents of a binary API notes file. + /// + /// \returns the new API notes reader, or null if an error occurred. + static std::unique_ptr + Create(std::unique_ptr InputBuffer, + llvm::VersionTuple SwiftVersion); + + ~APINotesReader(); + + APINotesReader(const APINotesReader &) = delete; + APINotesReader &operator=(const APINotesReader &) = delete; + + /// Captures the completed versioned information for a particular part of + /// API notes, including both unversioned API notes and each versioned API + /// note for that particular entity. + template class VersionedInfo { + /// The complete set of results. + llvm::SmallVector, 1> Results; + + /// The index of the result that is the "selected" set based on the desired + /// Swift version, or null if nothing matched. + std::optional Selected; + + public: + /// Form an empty set of versioned information. + VersionedInfo(std::nullopt_t) : Selected(std::nullopt) {} + + /// Form a versioned info set given the desired version and a set of + /// results. + VersionedInfo( + llvm::VersionTuple Version, + llvm::SmallVector, 1> Results); + + /// Retrieve the selected index in the result set. + std::optional getSelected() const { return Selected; } + + /// Return the number of versioned results we know about. + unsigned size() const { return Results.size(); } + + /// Access all versioned results. + const std::pair *begin() const { + assert(!Results.empty()); + return Results.begin(); + } + const std::pair *end() const { + return Results.end(); + } + + /// Access a specific versioned result. + const std::pair &operator[](unsigned index) const { + assert(index < Results.size()); + return Results[index]; + } + }; + + /// Look for the context ID of the given Objective-C class. + /// + /// \param Name The name of the class we're looking for. + /// + /// \returns The ID, if known. + std::optional lookupObjCClassID(llvm::StringRef Name); + + /// Look for information regarding the given Objective-C class. + /// + /// \param Name The name of the class we're looking for. + /// + /// \returns The information about the class, if known. + VersionedInfo lookupObjCClassInfo(llvm::StringRef Name); + + /// Look for the context ID of the given Objective-C protocol. + /// + /// \param Name The name of the protocol we're looking for. + /// + /// \returns The ID of the protocol, if known. + std::optional lookupObjCProtocolID(llvm::StringRef Name); + + /// Look for information regarding the given Objective-C protocol. + /// + /// \param Name The name of the protocol we're looking for. + /// + /// \returns The information about the protocol, if known. + VersionedInfo lookupObjCProtocolInfo(llvm::StringRef Name); + + /// Look for information regarding the given Objective-C property in + /// the given context. + /// + /// \param CtxID The ID that references the context we are looking for. + /// \param Name The name of the property we're looking for. + /// \param IsInstance Whether we are looking for an instance property (vs. + /// a class property). + /// + /// \returns Information about the property, if known. + VersionedInfo + lookupObjCProperty(ContextID CtxID, llvm::StringRef Name, bool IsInstance); + + /// Look for information regarding the given Objective-C method in + /// the given context. + /// + /// \param CtxID The ID that references the context we are looking for. + /// \param Selector The selector naming the method we're looking for. + /// \param IsInstanceMethod Whether we are looking for an instance method. + /// + /// \returns Information about the method, if known. + VersionedInfo lookupObjCMethod(ContextID CtxID, + ObjCSelectorRef Selector, + bool IsInstanceMethod); + + /// Look for information regarding the given global variable. + /// + /// \param Name The name of the global variable. + /// + /// \returns information about the global variable, if known. + VersionedInfo + lookupGlobalVariable(llvm::StringRef Name, + std::optional Ctx = std::nullopt); + + /// Look for information regarding the given global function. + /// + /// \param Name The name of the global function. + /// + /// \returns information about the global function, if known. + VersionedInfo + lookupGlobalFunction(llvm::StringRef Name, + std::optional Ctx = std::nullopt); + + /// Look for information regarding the given enumerator. + /// + /// \param Name The name of the enumerator. + /// + /// \returns information about the enumerator, if known. + VersionedInfo lookupEnumConstant(llvm::StringRef Name); + + /// Look for information regarding the given tag + /// (struct/union/enum/C++ class). + /// + /// \param Name The name of the tag. + /// + /// \returns information about the tag, if known. + VersionedInfo lookupTag(llvm::StringRef Name, + std::optional Ctx = std::nullopt); + + /// Look for information regarding the given typedef. + /// + /// \param Name The name of the typedef. + /// + /// \returns information about the typedef, if known. + VersionedInfo + lookupTypedef(llvm::StringRef Name, + std::optional Ctx = std::nullopt); + + /// Look for the context ID of the given C++ namespace. + /// + /// \param Name The name of the class we're looking for. + /// + /// \returns The ID, if known. + std::optional + lookupNamespaceID(llvm::StringRef Name, + std::optional ParentNamespaceID = std::nullopt); +}; + +} // end namespace api_notes +} // end namespace clang + +#endif // LLVM_CLANG_APINOTES_READER_H diff --git a/contrib/llvm-project/clang/include/clang/APINotes/APINotesWriter.h b/contrib/llvm-project/clang/include/clang/APINotes/APINotesWriter.h new file mode 100644 index 000000000000..dad44623e16a --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/APINotes/APINotesWriter.h @@ -0,0 +1,110 @@ +//===-- APINotesWriter.h - API Notes Writer ---------------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_APINOTES_WRITER_H +#define LLVM_CLANG_APINOTES_WRITER_H + +#include "clang/APINotes/Types.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/VersionTuple.h" +#include "llvm/Support/raw_ostream.h" + +#include + +namespace clang { +class FileEntry; + +namespace api_notes { +class APINotesWriter { + class Implementation; + std::unique_ptr Implementation; + +public: + APINotesWriter(llvm::StringRef ModuleName, const FileEntry *SF); + ~APINotesWriter(); + + APINotesWriter(const APINotesWriter &) = delete; + APINotesWriter &operator=(const APINotesWriter &) = delete; + + void writeToStream(llvm::raw_ostream &OS); + + /// Add information about a specific Objective-C class or protocol or a C++ + /// namespace. + /// + /// \param Name The name of this class/protocol/namespace. + /// \param Kind Whether this is a class, a protocol, or a namespace. + /// \param Info Information about this class/protocol/namespace. + /// + /// \returns the ID of the class, protocol, or namespace, which can be used to + /// add properties and methods to the class/protocol/namespace. + ContextID addObjCContext(std::optional ParentCtxID, + llvm::StringRef Name, ContextKind Kind, + const ObjCContextInfo &Info, + llvm::VersionTuple SwiftVersion); + + /// Add information about a specific Objective-C property. + /// + /// \param CtxID The context in which this property resides. + /// \param Name The name of this property. + /// \param Info Information about this property. + void addObjCProperty(ContextID CtxID, llvm::StringRef Name, + bool IsInstanceProperty, const ObjCPropertyInfo &Info, + llvm::VersionTuple SwiftVersion); + + /// Add information about a specific Objective-C method. + /// + /// \param CtxID The context in which this method resides. + /// \param Selector The selector that names this method. + /// \param IsInstanceMethod Whether this method is an instance method + /// (vs. a class method). + /// \param Info Information about this method. + void addObjCMethod(ContextID CtxID, ObjCSelectorRef Selector, + bool IsInstanceMethod, const ObjCMethodInfo &Info, + llvm::VersionTuple SwiftVersion); + + /// Add information about a global variable. + /// + /// \param Name The name of this global variable. + /// \param Info Information about this global variable. + void addGlobalVariable(std::optional Ctx, llvm::StringRef Name, + const GlobalVariableInfo &Info, + llvm::VersionTuple SwiftVersion); + + /// Add information about a global function. + /// + /// \param Name The name of this global function. + /// \param Info Information about this global function. + void addGlobalFunction(std::optional Ctx, llvm::StringRef Name, + const GlobalFunctionInfo &Info, + llvm::VersionTuple SwiftVersion); + + /// Add information about an enumerator. + /// + /// \param Name The name of this enumerator. + /// \param Info Information about this enumerator. + void addEnumConstant(llvm::StringRef Name, const EnumConstantInfo &Info, + llvm::VersionTuple SwiftVersion); + + /// Add information about a tag (struct/union/enum/C++ class). + /// + /// \param Name The name of this tag. + /// \param Info Information about this tag. + void addTag(std::optional Ctx, llvm::StringRef Name, + const TagInfo &Info, llvm::VersionTuple SwiftVersion); + + /// Add information about a typedef. + /// + /// \param Name The name of this typedef. + /// \param Info Information about this typedef. + void addTypedef(std::optional Ctx, llvm::StringRef Name, + const TypedefInfo &Info, llvm::VersionTuple SwiftVersion); +}; +} // namespace api_notes +} // namespace clang + +#endif // LLVM_CLANG_APINOTES_WRITER_H diff --git a/contrib/llvm-project/clang/include/clang/APINotes/APINotesYAMLCompiler.h b/contrib/llvm-project/clang/include/clang/APINotes/APINotesYAMLCompiler.h index 6098d0ee36fc..9c24ed85b6a1 100644 --- a/contrib/llvm-project/clang/include/clang/APINotes/APINotesYAMLCompiler.h +++ b/contrib/llvm-project/clang/include/clang/APINotes/APINotesYAMLCompiler.h @@ -10,14 +10,25 @@ #define LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H #include "llvm/ADT/StringRef.h" +#include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" +namespace clang { +class FileEntry; +} // namespace clang + namespace clang { namespace api_notes { /// Parses the APINotes YAML content and writes the representation back to the /// specified stream. This provides a means of testing the YAML processing of /// the APINotes format. bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS); + +/// Converts API notes from YAML format to binary format. +bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile, + llvm::raw_ostream &OS, + llvm::SourceMgr::DiagHandlerTy DiagHandler = nullptr, + void *DiagHandlerCtxt = nullptr); } // namespace api_notes } // namespace clang diff --git a/contrib/llvm-project/clang/include/clang/APINotes/Types.h b/contrib/llvm-project/clang/include/clang/APINotes/Types.h index 61f3592ea145..1d116becf06c 100644 --- a/contrib/llvm-project/clang/include/clang/APINotes/Types.h +++ b/contrib/llvm-project/clang/include/clang/APINotes/Types.h @@ -10,6 +10,7 @@ #define LLVM_CLANG_APINOTES_TYPES_H #include "clang/Basic/Specifiers.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" #include #include @@ -143,16 +144,10 @@ public: return SwiftBridge; } - void setSwiftBridge(const std::optional &SwiftType) { + void setSwiftBridge(std::optional SwiftType) { SwiftBridge = SwiftType; } - void setSwiftBridge(const std::optional &SwiftType) { - SwiftBridge = SwiftType - ? std::optional(std::string(*SwiftType)) - : std::nullopt; - } - const std::optional &getNSErrorDomain() const { return NSErrorDomain; } @@ -659,6 +654,10 @@ class TagInfo : public CommonTypeInfo { unsigned IsFlagEnum : 1; public: + std::optional SwiftImportAs; + std::optional SwiftRetainOp; + std::optional SwiftReleaseOp; + std::optional EnumExtensibility; TagInfo() : HasFlagEnum(0), IsFlagEnum(0) {} @@ -676,6 +675,13 @@ public: TagInfo &operator|=(const TagInfo &RHS) { static_cast(*this) |= RHS; + if (!SwiftImportAs) + SwiftImportAs = RHS.SwiftImportAs; + if (!SwiftRetainOp) + SwiftRetainOp = RHS.SwiftRetainOp; + if (!SwiftReleaseOp) + SwiftReleaseOp = RHS.SwiftReleaseOp; + if (!HasFlagEnum) setFlagEnum(RHS.isFlagEnum()); @@ -692,6 +698,9 @@ public: inline bool operator==(const TagInfo &LHS, const TagInfo &RHS) { return static_cast(LHS) == RHS && + LHS.SwiftImportAs == RHS.SwiftImportAs && + LHS.SwiftRetainOp == RHS.SwiftRetainOp && + LHS.SwiftReleaseOp == RHS.SwiftReleaseOp && LHS.isFlagEnum() == RHS.isFlagEnum() && LHS.EnumExtensibility == RHS.EnumExtensibility; } @@ -727,6 +736,42 @@ inline bool operator==(const TypedefInfo &LHS, const TypedefInfo &RHS) { inline bool operator!=(const TypedefInfo &LHS, const TypedefInfo &RHS) { return !(LHS == RHS); } + +/// The file extension used for the source representation of API notes. +static const constexpr char SOURCE_APINOTES_EXTENSION[] = "apinotes"; + +/// Opaque context ID used to refer to an Objective-C class or protocol or a C++ +/// namespace. +class ContextID { +public: + unsigned Value; + + explicit ContextID(unsigned value) : Value(value) {} +}; + +enum class ContextKind : uint8_t { + ObjCClass = 0, + ObjCProtocol = 1, + Namespace = 2, +}; + +struct Context { + ContextID id; + ContextKind kind; + + Context(ContextID id, ContextKind kind) : id(id), kind(kind) {} +}; + +/// A temporary reference to an Objective-C selector, suitable for +/// referencing selector data on the stack. +/// +/// Instances of this struct do not store references to any of the +/// data they contain; it is up to the user to ensure that the data +/// referenced by the identifier list persists. +struct ObjCSelectorRef { + unsigned NumArgs; + llvm::ArrayRef Identifiers; +}; } // namespace api_notes } // namespace clang diff --git a/contrib/llvm-project/clang/include/clang/ARCMigrate/ARCMT.h b/contrib/llvm-project/clang/include/clang/ARCMigrate/ARCMT.h index 49e94a92cd0b..2b950e3d2cc2 100644 --- a/contrib/llvm-project/clang/include/clang/ARCMigrate/ARCMT.h +++ b/contrib/llvm-project/clang/include/clang/ARCMigrate/ARCMT.h @@ -102,7 +102,7 @@ class MigrationProcess { public: bool HadARCErrors; - MigrationProcess(const CompilerInvocation &CI, + MigrationProcess(CompilerInvocation &CI, std::shared_ptr PCHContainerOps, DiagnosticConsumer *diagClient, StringRef outputDir = StringRef()); diff --git a/contrib/llvm-project/clang/include/clang/ARCMigrate/FileRemapper.h b/contrib/llvm-project/clang/include/clang/ARCMigrate/FileRemapper.h index 4da68a678be2..afcee363516a 100644 --- a/contrib/llvm-project/clang/include/clang/ARCMigrate/FileRemapper.h +++ b/contrib/llvm-project/clang/include/clang/ARCMigrate/FileRemapper.h @@ -9,12 +9,13 @@ #ifndef LLVM_CLANG_ARCMIGRATE_FILEREMAPPER_H #define LLVM_CLANG_ARCMIGRATE_FILEREMAPPER_H +#include "clang/Basic/FileEntry.h" #include "clang/Basic/LLVM.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" #include +#include namespace llvm { class MemoryBuffer; @@ -23,7 +24,6 @@ namespace llvm { namespace clang { class FileManager; - class FileEntry; class DiagnosticsEngine; class PreprocessorOptions; @@ -33,11 +33,11 @@ class FileRemapper { // FIXME: Reuse the same FileManager for multiple ASTContexts. std::unique_ptr FileMgr; - typedef llvm::PointerUnion Target; - typedef llvm::DenseMap MappingsTy; + using Target = std::variant; + using MappingsTy = llvm::DenseMap; MappingsTy FromToMappings; - llvm::DenseMap ToFromMappings; + llvm::DenseMap ToFromMappings; public: FileRemapper(); @@ -66,10 +66,10 @@ public: void clear(StringRef outputDir = StringRef()); private: - void remap(const FileEntry *file, std::unique_ptr memBuf); - void remap(const FileEntry *file, const FileEntry *newfile); + void remap(FileEntryRef file, std::unique_ptr memBuf); + void remap(FileEntryRef file, FileEntryRef newfile); - const FileEntry *getOriginalFile(StringRef filePath); + OptionalFileEntryRef getOriginalFile(StringRef filePath); void resetTarget(Target &targ); bool report(const Twine &err, DiagnosticsEngine &Diag); diff --git a/contrib/llvm-project/clang/include/clang/AST/APValue.h b/contrib/llvm-project/clang/include/clang/AST/APValue.h index 286c1a1b0941..c4206b73b115 100644 --- a/contrib/llvm-project/clang/include/clang/AST/APValue.h +++ b/contrib/llvm-project/clang/include/clang/AST/APValue.h @@ -270,12 +270,16 @@ private: APValue *Elts = nullptr; unsigned NumElts = 0; Vec() = default; + Vec(const Vec &) = delete; + Vec &operator=(const Vec &) = delete; ~Vec() { delete[] Elts; } }; struct Arr { APValue *Elts; unsigned NumElts, ArrSize; Arr(unsigned NumElts, unsigned ArrSize); + Arr(const Arr &) = delete; + Arr &operator=(const Arr &) = delete; ~Arr(); }; struct StructData { @@ -283,12 +287,16 @@ private: unsigned NumBases; unsigned NumFields; StructData(unsigned NumBases, unsigned NumFields); + StructData(const StructData &) = delete; + StructData &operator=(const StructData &) = delete; ~StructData(); }; struct UnionData { const FieldDecl *Field; APValue *Value; UnionData(); + UnionData(const UnionData &) = delete; + UnionData &operator=(const UnionData &) = delete; ~UnionData(); }; struct AddrLabelDiffData { diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTConcept.h b/contrib/llvm-project/clang/include/clang/AST/ASTConcept.h index e6e2d57597ea..5f9aa41d3e6c 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTConcept.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTConcept.h @@ -14,14 +14,21 @@ #ifndef LLVM_CLANG_AST_ASTCONCEPT_H #define LLVM_CLANG_AST_ASTCONCEPT_H -#include "clang/AST/Expr.h" +#include "clang/AST/DeclarationName.h" +#include "clang/AST/NestedNameSpecifier.h" +#include "clang/AST/TemplateBase.h" #include "clang/Basic/SourceLocation.h" +#include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/SmallVector.h" #include namespace clang { + class ConceptDecl; +class Expr; +class NamedDecl; +struct PrintingPolicy; /// The result of a constraint satisfaction check, containing the necessary /// information to diagnose an unsatisfied constraint. @@ -107,10 +114,18 @@ struct ASTConstraintSatisfaction final : Rebuild(const ASTContext &C, const ASTConstraintSatisfaction &Satisfaction); }; -/// \brief Common data class for constructs that reference concepts with -/// template arguments. +/// A reference to a concept and its template args, as it appears in the code. +/// +/// Examples: +/// template requires is_even int half = X/2; +/// ~~~~~~~~~~ (in ConceptSpecializationExpr) +/// +/// std::input_iterator auto I = Container.begin(); +/// ~~~~~~~~~~~~~~~~~~~ (in AutoTypeLoc) +/// +/// template T> void dump(); +/// ~~~~~~~~~~~~~~~~~~~~~~~ (in TemplateTypeParmDecl) class ConceptReference { -protected: // \brief The optional nested name specifier used when naming the concept. NestedNameSpecifierLoc NestedNameSpec; @@ -134,7 +149,6 @@ protected: /// concept. const ASTTemplateArgumentListInfo *ArgsAsWritten; -public: ConceptReference(NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, @@ -143,8 +157,12 @@ public: ConceptName(ConceptNameInfo), FoundDecl(FoundDecl), NamedConcept(NamedConcept), ArgsAsWritten(ArgsAsWritten) {} - ConceptReference() - : FoundDecl(nullptr), NamedConcept(nullptr), ArgsAsWritten(nullptr) {} +public: + static ConceptReference * + Create(const ASTContext &C, NestedNameSpecifierLoc NNS, + SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, + NamedDecl *FoundDecl, ConceptDecl *NamedConcept, + const ASTTemplateArgumentListInfo *ArgsAsWritten); const NestedNameSpecifierLoc &getNestedNameSpecifierLoc() const { return NestedNameSpec; @@ -158,6 +176,26 @@ public: SourceLocation getTemplateKWLoc() const { return TemplateKWLoc; } + SourceLocation getLocation() const { return getConceptNameLoc(); } + + SourceLocation getBeginLoc() const LLVM_READONLY { + // Note that if the qualifier is null the template KW must also be null. + if (auto QualifierLoc = getNestedNameSpecifierLoc()) + return QualifierLoc.getBeginLoc(); + return getConceptNameInfo().getBeginLoc(); + } + + SourceLocation getEndLoc() const LLVM_READONLY { + return getTemplateArgsAsWritten() && + getTemplateArgsAsWritten()->getRAngleLoc().isValid() + ? getTemplateArgsAsWritten()->getRAngleLoc() + : getConceptNameInfo().getEndLoc(); + } + + SourceRange getSourceRange() const LLVM_READONLY { + return SourceRange(getBeginLoc(), getEndLoc()); + } + NamedDecl *getFoundDecl() const { return FoundDecl; } @@ -175,22 +213,32 @@ public: bool hasExplicitTemplateArgs() const { return ArgsAsWritten != nullptr; } + + void print(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const; + void dump() const; + void dump(llvm::raw_ostream &) const; }; -class TypeConstraint : public ConceptReference { +/// Models the abbreviated syntax to constrain a template type parameter: +/// template T> void print(T object); +/// ~~~~~~~~~~~~~~~~~~~~~~ +/// Semantically, this adds an "immediately-declared constraint" with extra arg: +/// requires convertible_to +/// +/// In the C++ grammar, a type-constraint is also used for auto types: +/// convertible_to auto X = ...; +/// We do *not* model these as TypeConstraints, but AutoType(Loc) directly. +class TypeConstraint { /// \brief The immediately-declared constraint expression introduced by this /// type-constraint. Expr *ImmediatelyDeclaredConstraint = nullptr; + ConceptReference *ConceptRef; public: - TypeConstraint(NestedNameSpecifierLoc NNS, - DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, - ConceptDecl *NamedConcept, - const ASTTemplateArgumentListInfo *ArgsAsWritten, - Expr *ImmediatelyDeclaredConstraint) : - ConceptReference(NNS, /*TemplateKWLoc=*/SourceLocation(), ConceptNameInfo, - FoundDecl, NamedConcept, ArgsAsWritten), - ImmediatelyDeclaredConstraint(ImmediatelyDeclaredConstraint) {} + TypeConstraint(ConceptReference *ConceptRef, + Expr *ImmediatelyDeclaredConstraint) + : ImmediatelyDeclaredConstraint(ImmediatelyDeclaredConstraint), + ConceptRef(ConceptRef) {} /// \brief Get the immediately-declared constraint expression introduced by /// this type-constraint, that is - the constraint expression that is added to @@ -199,7 +247,41 @@ public: return ImmediatelyDeclaredConstraint; } - void print(llvm::raw_ostream &OS, PrintingPolicy Policy) const; + ConceptReference *getConceptReference() const { return ConceptRef; } + + // FIXME: Instead of using these concept related functions the callers should + // directly work with the corresponding ConceptReference. + ConceptDecl *getNamedConcept() const { return ConceptRef->getNamedConcept(); } + + SourceLocation getConceptNameLoc() const { + return ConceptRef->getConceptNameLoc(); + } + + bool hasExplicitTemplateArgs() const { + return ConceptRef->hasExplicitTemplateArgs(); + } + + const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { + return ConceptRef->getTemplateArgsAsWritten(); + } + + SourceLocation getTemplateKWLoc() const { + return ConceptRef->getTemplateKWLoc(); + } + + NamedDecl *getFoundDecl() const { return ConceptRef->getFoundDecl(); } + + const NestedNameSpecifierLoc &getNestedNameSpecifierLoc() const { + return ConceptRef->getNestedNameSpecifierLoc(); + } + + const DeclarationNameInfo &getConceptNameInfo() const { + return ConceptRef->getConceptNameInfo(); + } + + void print(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const { + ConceptRef->print(OS, Policy); + } }; } // clang diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTContext.h b/contrib/llvm-project/clang/include/clang/AST/ASTContext.h index 40cadd93158c..3e46a5da3fc0 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTContext.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTContext.h @@ -21,18 +21,12 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/ExternalASTSource.h" -#include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/PrettyPrinter.h" #include "clang/AST/RawCommentList.h" #include "clang/AST/TemplateName.h" -#include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" -#include "clang/Basic/LangOptions.h" -#include "clang/Basic/NoSanitizeList.h" #include "clang/Basic/PartialDiagnostic.h" -#include "clang/Basic/ProfileList.h" #include "clang/Basic/SourceLocation.h" -#include "clang/Basic/XRayLists.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/FoldingSet.h" @@ -63,6 +57,7 @@ class ASTMutationListener; class ASTRecordLayout; class AtomicExpr; class BlockExpr; +struct BlockVarCopyInit; class BuiltinTemplateDecl; class CharUnits; class ConceptDecl; @@ -71,16 +66,19 @@ class CXXConstructorDecl; class CXXMethodDecl; class CXXRecordDecl; class DiagnosticsEngine; -class ParentMapContext; class DynTypedNodeList; class Expr; enum class FloatModeKind; class GlobalDecl; +class IdentifierTable; +class LangOptions; class MangleContext; class MangleNumberingContext; class MemberSpecializationInfo; class Module; struct MSGuidDeclParts; +class NestedNameSpecifier; +class NoSanitizeList; class ObjCCategoryDecl; class ObjCCategoryImplDecl; class ObjCContainerDecl; @@ -94,8 +92,10 @@ class ObjCPropertyImplDecl; class ObjCProtocolDecl; class ObjCTypeParamDecl; class OMPTraitInfo; +class ParentMapContext; struct ParsedTargetAttr; class Preprocessor; +class ProfileList; class StoredDeclsMap; class TargetAttr; class TargetInfo; @@ -108,7 +108,7 @@ class UnresolvedSetIterator; class UsingShadowDecl; class VarTemplateDecl; class VTableContextBase; -struct BlockVarCopyInit; +class XRayFunctionFilter; namespace Builtin { @@ -195,20 +195,25 @@ class ASTContext : public RefCountedBase { ConstantArrayTypes; mutable llvm::FoldingSet IncompleteArrayTypes; mutable std::vector VariableArrayTypes; - mutable llvm::FoldingSet DependentSizedArrayTypes; - mutable llvm::FoldingSet - DependentSizedExtVectorTypes; - mutable llvm::FoldingSet + mutable llvm::ContextualFoldingSet + DependentSizedArrayTypes; + mutable llvm::ContextualFoldingSet + DependentSizedExtVectorTypes; + mutable llvm::ContextualFoldingSet DependentAddressSpaceTypes; mutable llvm::FoldingSet VectorTypes; - mutable llvm::FoldingSet DependentVectorTypes; + mutable llvm::ContextualFoldingSet + DependentVectorTypes; mutable llvm::FoldingSet MatrixTypes; - mutable llvm::FoldingSet DependentSizedMatrixTypes; + mutable llvm::ContextualFoldingSet + DependentSizedMatrixTypes; mutable llvm::FoldingSet FunctionNoProtoTypes; mutable llvm::ContextualFoldingSet FunctionProtoTypes; - mutable llvm::FoldingSet DependentTypeOfExprTypes; - mutable llvm::FoldingSet DependentDecltypeTypes; + mutable llvm::ContextualFoldingSet + DependentTypeOfExprTypes; + mutable llvm::ContextualFoldingSet + DependentDecltypeTypes; mutable llvm::FoldingSet TemplateTypeParmTypes; mutable llvm::FoldingSet ObjCTypeParamTypes; mutable llvm::FoldingSet @@ -238,7 +243,8 @@ class ASTContext : public RefCountedBase { mutable llvm::FoldingSet AttributedTypes; mutable llvm::FoldingSet PipeTypes; mutable llvm::FoldingSet BitIntTypes; - mutable llvm::FoldingSet DependentBitIntTypes; + mutable llvm::ContextualFoldingSet + DependentBitIntTypes; llvm::FoldingSet BTFTagAttributedTypes; mutable llvm::FoldingSet QualifiedTemplateNames; @@ -1141,12 +1147,19 @@ public: mutable TagDecl *MSGuidTagDecl = nullptr; /// Keep track of CUDA/HIP device-side variables ODR-used by host code. + /// This does not include extern shared variables used by device host + /// functions as addresses of shared variables are per warp, therefore + /// cannot be accessed by host code. llvm::DenseSet CUDADeviceVarODRUsedByHost; /// Keep track of CUDA/HIP external kernels or device variables ODR-used by /// host code. llvm::DenseSet CUDAExternalDeviceDeclODRUsedByHost; + /// Keep track of CUDA/HIP implicit host device functions used on device side + /// in device compilation. + llvm::DenseSet CUDAImplicitHostDeviceFunUsedByDevice; + ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind); @@ -1188,8 +1201,9 @@ public: /// Create a new implicit TU-level CXXRecordDecl or RecordDecl /// declaration. - RecordDecl *buildImplicitRecord(StringRef Name, - RecordDecl::TagKind TK = TTK_Struct) const; + RecordDecl *buildImplicitRecord( + StringRef Name, + RecordDecl::TagKind TK = RecordDecl::TagKind::Struct) const; /// Create a new implicit TU-level typedef declaration. TypedefDecl *buildImplicitTypedef(QualType T, StringRef Name) const; @@ -1421,8 +1435,7 @@ public: /// Return a non-unique reference to the type for a variable array of /// the specified element type. QualType getVariableArrayType(QualType EltTy, Expr *NumElts, - ArrayType::ArraySizeModifier ASM, - unsigned IndexTypeQuals, + ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const; /// Return a non-unique reference to the type for a dependently-sized @@ -1431,21 +1444,19 @@ public: /// FIXME: We will need these to be uniqued, or at least comparable, at some /// point. QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts, - ArrayType::ArraySizeModifier ASM, + ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const; /// Return a unique reference to the type for an incomplete array of /// the specified element type. - QualType getIncompleteArrayType(QualType EltTy, - ArrayType::ArraySizeModifier ASM, + QualType getIncompleteArrayType(QualType EltTy, ArraySizeModifier ASM, unsigned IndexTypeQuals) const; /// Return the unique reference to the type for a constant array of /// the specified element type. QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize, - const Expr *SizeExpr, - ArrayType::ArraySizeModifier ASM, + const Expr *SizeExpr, ArraySizeModifier ASM, unsigned IndexTypeQuals) const; /// Return a type for a constant array for a string literal of the @@ -1487,12 +1498,12 @@ public: /// /// \pre \p VectorType must be a built-in type. QualType getVectorType(QualType VectorType, unsigned NumElts, - VectorType::VectorKind VecKind) const; + VectorKind VecKind) const; /// Return the unique reference to the type for a dependently sized vector of /// the specified element type. QualType getDependentVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc, - VectorType::VectorKind VecKind) const; + VectorKind VecKind) const; /// Return the unique reference to an extended vector type /// of the specified element type and size. @@ -1693,7 +1704,7 @@ public: /// Return a ObjCObjectPointerType type for the given ObjCObjectType. QualType getObjCObjectPointerType(QualType OIT) const; - /// C2x feature and GCC extension. + /// C23 feature and GCC extension. QualType getTypeOfExprType(Expr *E, TypeOfKind Kind) const; QualType getTypeOfType(QualType QT, TypeOfKind Kind) const; diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTFwd.h b/contrib/llvm-project/clang/include/clang/AST/ASTFwd.h index f84b3238e32b..8823663386ea 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTFwd.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTFwd.h @@ -34,6 +34,7 @@ class Attr; #define ATTR(A) class A##Attr; #include "clang/Basic/AttrList.inc" class ObjCProtocolLoc; +class ConceptReference; } // end namespace clang diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTLambda.h b/contrib/llvm-project/clang/include/clang/AST/ASTLambda.h index 230e0c848610..646cb574847f 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTLambda.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTLambda.h @@ -35,6 +35,21 @@ inline bool isLambdaCallOperator(const DeclContext *DC) { return isLambdaCallOperator(cast(DC)); } +inline bool isLambdaCallWithExplicitObjectParameter(const DeclContext *DC) { + return isLambdaCallOperator(DC) && + cast(DC)->isExplicitObjectMemberFunction(); +} + +inline bool isLambdaCallWithImplicitObjectParameter(const DeclContext *DC) { + return isLambdaCallOperator(DC) && + // FIXME: Checking for a null type is not great + // but lambdas with invalid captures or whose closure parameter list + // have not fully been parsed may have a call operator whose type is + // null. + !cast(DC)->getType().isNull() && + !cast(DC)->isExplicitObjectMemberFunction(); +} + inline bool isGenericLambdaCallOperatorSpecialization(const CXXMethodDecl *MD) { if (!MD) return false; const CXXRecordDecl *LambdaClass = MD->getParent(); diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTNodeTraverser.h b/contrib/llvm-project/clang/include/clang/AST/ASTNodeTraverser.h index d649ef6816ca..cc8dab97f8b0 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTNodeTraverser.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTNodeTraverser.h @@ -104,8 +104,7 @@ public: Visit(Comment, Comment); // Decls within functions are visited by the body. - if (!isa(*D) && !isa(*D) && - !isa(*D)) { + if (!isa(*D)) { if (Traversal != TK_AsIs) { if (const auto *CTSD = dyn_cast(D)) { auto SK = CTSD->getSpecializationKind(); @@ -253,6 +252,10 @@ public: }); } + void Visit(const ConceptReference *R) { + getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(R); }); + } + void Visit(const APValue &Value, QualType Ty) { getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(Value, Ty); }); } @@ -289,6 +292,8 @@ public: Visit(C); else if (const auto *T = N.get()) Visit(*T); + else if (const auto *CR = N.get()) + Visit(CR); } void dumpDeclContext(const DeclContext *DC) { @@ -421,8 +426,12 @@ public: } void VisitFunctionDecl(const FunctionDecl *D) { - if (const auto *FTSI = D->getTemplateSpecializationInfo()) + if (FunctionTemplateSpecializationInfo *FTSI = + D->getTemplateSpecializationInfo()) dumpTemplateArgumentList(*FTSI->TemplateArguments); + else if (DependentFunctionTemplateSpecializationInfo *DFTSI = + D->getDependentSpecializationInfo()) + dumpASTTemplateArgumentListInfo(DFTSI->TemplateArgumentsAsWritten); if (D->param_begin()) for (const auto *Parameter : D->parameters()) @@ -573,11 +582,6 @@ public: dumpTemplateParameters(D->getTemplateParameters()); } - void VisitClassScopeFunctionSpecializationDecl( - const ClassScopeFunctionSpecializationDecl *D) { - Visit(D->getSpecialization()); - dumpASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten()); - } void VisitVarTemplateDecl(const VarTemplateDecl *D) { dumpTemplateDecl(D); } void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D) { diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTStructuralEquivalence.h b/contrib/llvm-project/clang/include/clang/AST/ASTStructuralEquivalence.h index 4a79e64fe5d5..029439c8e9a3 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTStructuralEquivalence.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTStructuralEquivalence.h @@ -69,15 +69,19 @@ struct StructuralEquivalenceContext { /// \c true if the last diagnostic came from ToCtx. bool LastDiagFromC2 = false; + /// Whether to ignore comparing the depth of template param(TemplateTypeParm) + bool IgnoreTemplateParmDepth; + StructuralEquivalenceContext( ASTContext &FromCtx, ASTContext &ToCtx, llvm::DenseSet> &NonEquivalentDecls, - StructuralEquivalenceKind EqKind, - bool StrictTypeSpelling = false, bool Complain = true, - bool ErrorOnTagTypeMismatch = false) + StructuralEquivalenceKind EqKind, bool StrictTypeSpelling = false, + bool Complain = true, bool ErrorOnTagTypeMismatch = false, + bool IgnoreTemplateParmDepth = false) : FromCtx(FromCtx), ToCtx(ToCtx), NonEquivalentDecls(NonEquivalentDecls), EqKind(EqKind), StrictTypeSpelling(StrictTypeSpelling), - ErrorOnTagTypeMismatch(ErrorOnTagTypeMismatch), Complain(Complain) {} + ErrorOnTagTypeMismatch(ErrorOnTagTypeMismatch), Complain(Complain), + IgnoreTemplateParmDepth(IgnoreTemplateParmDepth) {} DiagnosticBuilder Diag1(SourceLocation Loc, unsigned DiagID); DiagnosticBuilder Diag2(SourceLocation Loc, unsigned DiagID); diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTTypeTraits.h b/contrib/llvm-project/clang/include/clang/AST/ASTTypeTraits.h index 78661823ca85..3988a15971db 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTTypeTraits.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTTypeTraits.h @@ -163,6 +163,7 @@ private: #define ATTR(A) NKI_##A##Attr, #include "clang/Basic/AttrList.inc" NKI_ObjCProtocolLoc, + NKI_ConceptReference, NKI_NumberOfKinds }; @@ -222,6 +223,7 @@ KIND_TO_KIND_ID(OMPClause) KIND_TO_KIND_ID(Attr) KIND_TO_KIND_ID(ObjCProtocolLoc) KIND_TO_KIND_ID(CXXBaseSpecifier) +KIND_TO_KIND_ID(ConceptReference) #define DECL(DERIVED, BASE) KIND_TO_KIND_ID(DERIVED##Decl) #include "clang/AST/DeclNodes.inc" #define STMT(DERIVED, BASE) KIND_TO_KIND_ID(DERIVED) @@ -582,6 +584,10 @@ template <> struct DynTypedNode::BaseConverter : public ValueConverter {}; +template <> +struct DynTypedNode::BaseConverter + : public PtrConverter {}; + // The only operation we allow on unsupported types is \c get. // This allows to conveniently use \c DynTypedNode when having an arbitrary // AST node that is not supported, but prevents misuse - a user cannot create diff --git a/contrib/llvm-project/clang/include/clang/AST/Attr.h b/contrib/llvm-project/clang/include/clang/AST/Attr.h index 793732cd26b0..1b831c9511e2 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Attr.h +++ b/contrib/llvm-project/clang/include/clang/AST/Attr.h @@ -19,11 +19,12 @@ #include "clang/AST/Type.h" #include "clang/Basic/AttrKinds.h" #include "clang/Basic/AttributeCommonInfo.h" -#include "clang/Basic/LangOptions.h" #include "clang/Basic/LLVM.h" +#include "clang/Basic/LangOptions.h" #include "clang/Basic/OpenMPKinds.h" #include "clang/Basic/Sanitizers.h" #include "clang/Basic/SourceLocation.h" +#include "llvm/Frontend/HLSL/HLSLResource.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/VersionTuple.h" #include "llvm/Support/raw_ostream.h" @@ -39,17 +40,23 @@ class OMPTraitInfo; /// Attr - This represents one attribute. class Attr : public AttributeCommonInfo { private: + LLVM_PREFERRED_TYPE(attr::Kind) unsigned AttrKind : 16; protected: /// An index into the spelling list of an /// attribute defined in Attr.td file. + LLVM_PREFERRED_TYPE(bool) unsigned Inherited : 1; + LLVM_PREFERRED_TYPE(bool) unsigned IsPackExpansion : 1; + LLVM_PREFERRED_TYPE(bool) unsigned Implicit : 1; // FIXME: These are properties of the attribute kind, not state for this // instance of the attribute. + LLVM_PREFERRED_TYPE(bool) unsigned IsLateParsed : 1; + LLVM_PREFERRED_TYPE(bool) unsigned InheritEvenIfAlreadyPresent : 1; void *operator new(size_t bytes) noexcept { @@ -242,7 +249,9 @@ public: class ParamIdx { // Idx is exposed only via accessors that specify specific encodings. unsigned Idx : 30; + LLVM_PREFERRED_TYPE(bool) unsigned HasThis : 1; + LLVM_PREFERRED_TYPE(bool) unsigned IsValid : 1; void assertComparable(const ParamIdx &I) const { diff --git a/contrib/llvm-project/clang/include/clang/AST/CXXInheritance.h b/contrib/llvm-project/clang/include/clang/AST/CXXInheritance.h index eec2119f4a18..bbef01843e0b 100644 --- a/contrib/llvm-project/clang/include/clang/AST/CXXInheritance.h +++ b/contrib/llvm-project/clang/include/clang/AST/CXXInheritance.h @@ -20,7 +20,6 @@ #include "clang/AST/TypeOrdering.h" #include "clang/Basic/Specifiers.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/MapVector.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" @@ -131,6 +130,7 @@ class CXXBasePaths { /// class subobjects for that class type. The key of the map is /// the cv-unqualified canonical type of the base class subobject. struct IsVirtBaseAndNumberNonVirtBases { + LLVM_PREFERRED_TYPE(bool) unsigned IsVirtBase : 1; unsigned NumberOfNonVirtBases : 31; }; diff --git a/contrib/llvm-project/clang/include/clang/AST/Comment.h b/contrib/llvm-project/clang/include/clang/AST/Comment.h index 0b68c1131664..dd9906727293 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Comment.h +++ b/contrib/llvm-project/clang/include/clang/AST/Comment.h @@ -27,6 +27,8 @@ class TemplateParameterList; namespace comments { class FullComment; +enum class InlineCommandRenderKind; +enum class ParamCommandPassDirection; /// Describes the syntax that was used in a documentation command. /// @@ -47,6 +49,17 @@ enum CommandMarkerKind { CMK_At = 1 }; +enum class CommentKind { + None = 0, +#define COMMENT(CLASS, PARENT) CLASS, +#define COMMENT_RANGE(BASE, FIRST, LAST) \ + First##BASE##Constant = FIRST, Last##BASE##Constant = LAST, +#define LAST_COMMENT_RANGE(BASE, FIRST, LAST) \ + First##BASE##Constant = FIRST, Last##BASE##Constant = LAST +#define ABSTRACT_COMMENT(COMMENT) +#include "clang/AST/CommentNodes.inc" +}; + /// Any part of the comment. /// Abstract class. class Comment { @@ -61,6 +74,7 @@ protected: friend class Comment; /// Type of this AST node. + LLVM_PREFERRED_TYPE(CommentKind) unsigned Kind : 8; }; enum { NumCommentBits = 8 }; @@ -68,10 +82,12 @@ protected: class InlineContentCommentBitfields { friend class InlineContentComment; + LLVM_PREFERRED_TYPE(CommentBitfields) unsigned : NumCommentBits; /// True if there is a newline after this inline content node. /// (There is no separate AST node for a newline.) + LLVM_PREFERRED_TYPE(bool) unsigned HasTrailingNewline : 1; }; enum { NumInlineContentCommentBits = NumCommentBits + 1 }; @@ -79,12 +95,15 @@ protected: class TextCommentBitfields { friend class TextComment; + LLVM_PREFERRED_TYPE(InlineContentCommentBitfields) unsigned : NumInlineContentCommentBits; /// True if \c IsWhitespace field contains a valid value. + LLVM_PREFERRED_TYPE(bool) mutable unsigned IsWhitespaceValid : 1; /// True if this comment AST node contains only whitespace. + LLVM_PREFERRED_TYPE(bool) mutable unsigned IsWhitespace : 1; }; enum { NumTextCommentBits = NumInlineContentCommentBits + 2 }; @@ -92,10 +111,13 @@ protected: class InlineCommandCommentBitfields { friend class InlineCommandComment; + LLVM_PREFERRED_TYPE(InlineContentCommentBitfields) unsigned : NumInlineContentCommentBits; + LLVM_PREFERRED_TYPE(InlineCommandRenderKind) unsigned RenderKind : 3; + LLVM_PREFERRED_TYPE(CommandTraits::KnownCommandIDs) unsigned CommandID : CommandInfo::NumCommandIDBits; }; enum { NumInlineCommandCommentBits = NumInlineContentCommentBits + 3 + @@ -104,9 +126,11 @@ protected: class HTMLTagCommentBitfields { friend class HTMLTagComment; + LLVM_PREFERRED_TYPE(InlineContentCommentBitfields) unsigned : NumInlineContentCommentBits; /// True if we found that this tag is malformed in some way. + LLVM_PREFERRED_TYPE(bool) unsigned IsMalformed : 1; }; enum { NumHTMLTagCommentBits = NumInlineContentCommentBits + 1 }; @@ -114,10 +138,12 @@ protected: class HTMLStartTagCommentBitfields { friend class HTMLStartTagComment; + LLVM_PREFERRED_TYPE(HTMLTagCommentBitfields) unsigned : NumHTMLTagCommentBits; /// True if this tag is self-closing (e. g.,
). This is based on tag /// spelling in comment (plain
would not set this flag). + LLVM_PREFERRED_TYPE(bool) unsigned IsSelfClosing : 1; }; enum { NumHTMLStartTagCommentBits = NumHTMLTagCommentBits + 1 }; @@ -125,12 +151,15 @@ protected: class ParagraphCommentBitfields { friend class ParagraphComment; + LLVM_PREFERRED_TYPE(CommentBitfields) unsigned : NumCommentBits; /// True if \c IsWhitespace field contains a valid value. + LLVM_PREFERRED_TYPE(bool) mutable unsigned IsWhitespaceValid : 1; /// True if this comment AST node contains only whitespace. + LLVM_PREFERRED_TYPE(bool) mutable unsigned IsWhitespace : 1; }; enum { NumParagraphCommentBits = NumCommentBits + 2 }; @@ -138,12 +167,15 @@ protected: class BlockCommandCommentBitfields { friend class BlockCommandComment; + LLVM_PREFERRED_TYPE(CommentBitfields) unsigned : NumCommentBits; + LLVM_PREFERRED_TYPE(CommandTraits::KnownCommandIDs) unsigned CommandID : CommandInfo::NumCommandIDBits; /// Describes the syntax that was used in a documentation command. /// Contains values from CommandMarkerKind enum. + LLVM_PREFERRED_TYPE(CommandMarkerKind) unsigned CommandMarker : 1; }; enum { NumBlockCommandCommentBits = NumCommentBits + @@ -152,12 +184,15 @@ protected: class ParamCommandCommentBitfields { friend class ParamCommandComment; + LLVM_PREFERRED_TYPE(BlockCommandCommentBitfields) unsigned : NumBlockCommandCommentBits; - /// Parameter passing direction, see ParamCommandComment::PassDirection. + /// Parameter passing direction. + LLVM_PREFERRED_TYPE(ParamCommandPassDirection) unsigned Direction : 2; /// True if direction was specified explicitly in the comment. + LLVM_PREFERRED_TYPE(bool) unsigned IsDirectionExplicit : 1; }; enum { NumParamCommandCommentBits = NumBlockCommandCommentBits + 3 }; @@ -183,17 +218,6 @@ protected: } public: - enum CommentKind { - NoCommentKind = 0, -#define COMMENT(CLASS, PARENT) CLASS##Kind, -#define COMMENT_RANGE(BASE, FIRST, LAST) \ - First##BASE##Constant=FIRST##Kind, Last##BASE##Constant=LAST##Kind, -#define LAST_COMMENT_RANGE(BASE, FIRST, LAST) \ - First##BASE##Constant=FIRST##Kind, Last##BASE##Constant=LAST##Kind -#define ABSTRACT_COMMENT(COMMENT) -#include "clang/AST/CommentNodes.inc" - }; - struct Argument { SourceRange Range; StringRef Text; @@ -203,7 +227,7 @@ public: SourceLocation LocBegin, SourceLocation LocEnd) : Loc(LocBegin), Range(SourceRange(LocBegin, LocEnd)) { - CommentBits.Kind = K; + CommentBits.Kind = llvm::to_underlying(K); } CommentKind getCommentKind() const { @@ -249,8 +273,9 @@ protected: public: static bool classof(const Comment *C) { - return C->getCommentKind() >= FirstInlineContentCommentConstant && - C->getCommentKind() <= LastInlineContentCommentConstant; + return C->getCommentKind() >= + CommentKind::FirstInlineContentCommentConstant && + C->getCommentKind() <= CommentKind::LastInlineContentCommentConstant; } void addTrailingNewline() { @@ -267,16 +292,14 @@ class TextComment : public InlineContentComment { StringRef Text; public: - TextComment(SourceLocation LocBegin, - SourceLocation LocEnd, - StringRef Text) : - InlineContentComment(TextCommentKind, LocBegin, LocEnd), - Text(Text) { + TextComment(SourceLocation LocBegin, SourceLocation LocEnd, StringRef Text) + : InlineContentComment(CommentKind::TextComment, LocBegin, LocEnd), + Text(Text) { TextCommentBits.IsWhitespaceValid = false; } static bool classof(const Comment *C) { - return C->getCommentKind() == TextCommentKind; + return C->getCommentKind() == CommentKind::TextComment; } child_iterator child_begin() const { return nullptr; } @@ -298,37 +321,35 @@ private: bool isWhitespaceNoCache() const; }; +/// The most appropriate rendering mode for this command, chosen on command +/// semantics in Doxygen. +enum class InlineCommandRenderKind { + Normal, + Bold, + Monospaced, + Emphasized, + Anchor +}; + /// A command with word-like arguments that is considered inline content. class InlineCommandComment : public InlineContentComment { -public: - /// The most appropriate rendering mode for this command, chosen on command - /// semantics in Doxygen. - enum RenderKind { - RenderNormal, - RenderBold, - RenderMonospaced, - RenderEmphasized, - RenderAnchor - }; - protected: /// Command arguments. ArrayRef Args; public: - InlineCommandComment(SourceLocation LocBegin, - SourceLocation LocEnd, - unsigned CommandID, - RenderKind RK, - ArrayRef Args) : - InlineContentComment(InlineCommandCommentKind, LocBegin, LocEnd), - Args(Args) { - InlineCommandCommentBits.RenderKind = RK; + InlineCommandComment(SourceLocation LocBegin, SourceLocation LocEnd, + unsigned CommandID, InlineCommandRenderKind RK, + ArrayRef Args) + : InlineContentComment(CommentKind::InlineCommandComment, LocBegin, + LocEnd), + Args(Args) { + InlineCommandCommentBits.RenderKind = llvm::to_underlying(RK); InlineCommandCommentBits.CommandID = CommandID; } static bool classof(const Comment *C) { - return C->getCommentKind() == InlineCommandCommentKind; + return C->getCommentKind() == CommentKind::InlineCommandComment; } child_iterator child_begin() const { return nullptr; } @@ -347,8 +368,9 @@ public: return SourceRange(getBeginLoc().getLocWithOffset(-1), getEndLoc()); } - RenderKind getRenderKind() const { - return static_cast(InlineCommandCommentBits.RenderKind); + InlineCommandRenderKind getRenderKind() const { + return static_cast( + InlineCommandCommentBits.RenderKind); } unsigned getNumArgs() const { @@ -386,8 +408,8 @@ protected: public: static bool classof(const Comment *C) { - return C->getCommentKind() >= FirstHTMLTagCommentConstant && - C->getCommentKind() <= LastHTMLTagCommentConstant; + return C->getCommentKind() >= CommentKind::FirstHTMLTagCommentConstant && + C->getCommentKind() <= CommentKind::LastHTMLTagCommentConstant; } StringRef getTagName() const LLVM_READONLY { return TagName; } @@ -443,18 +465,16 @@ private: ArrayRef Attributes; public: - HTMLStartTagComment(SourceLocation LocBegin, - StringRef TagName) : - HTMLTagComment(HTMLStartTagCommentKind, - LocBegin, LocBegin.getLocWithOffset(1 + TagName.size()), - TagName, - LocBegin.getLocWithOffset(1), - LocBegin.getLocWithOffset(1 + TagName.size())) { + HTMLStartTagComment(SourceLocation LocBegin, StringRef TagName) + : HTMLTagComment(CommentKind::HTMLStartTagComment, LocBegin, + LocBegin.getLocWithOffset(1 + TagName.size()), TagName, + LocBegin.getLocWithOffset(1), + LocBegin.getLocWithOffset(1 + TagName.size())) { HTMLStartTagCommentBits.IsSelfClosing = false; } static bool classof(const Comment *C) { - return C->getCommentKind() == HTMLStartTagCommentKind; + return C->getCommentKind() == CommentKind::HTMLStartTagComment; } child_iterator child_begin() const { return nullptr; } @@ -498,18 +518,14 @@ public: /// A closing HTML tag. class HTMLEndTagComment : public HTMLTagComment { public: - HTMLEndTagComment(SourceLocation LocBegin, - SourceLocation LocEnd, - StringRef TagName) : - HTMLTagComment(HTMLEndTagCommentKind, - LocBegin, LocEnd, - TagName, - LocBegin.getLocWithOffset(2), - LocBegin.getLocWithOffset(2 + TagName.size())) - { } + HTMLEndTagComment(SourceLocation LocBegin, SourceLocation LocEnd, + StringRef TagName) + : HTMLTagComment(CommentKind::HTMLEndTagComment, LocBegin, LocEnd, + TagName, LocBegin.getLocWithOffset(2), + LocBegin.getLocWithOffset(2 + TagName.size())) {} static bool classof(const Comment *C) { - return C->getCommentKind() == HTMLEndTagCommentKind; + return C->getCommentKind() == CommentKind::HTMLEndTagComment; } child_iterator child_begin() const { return nullptr; } @@ -529,8 +545,9 @@ protected: public: static bool classof(const Comment *C) { - return C->getCommentKind() >= FirstBlockContentCommentConstant && - C->getCommentKind() <= LastBlockContentCommentConstant; + return C->getCommentKind() >= + CommentKind::FirstBlockContentCommentConstant && + C->getCommentKind() <= CommentKind::LastBlockContentCommentConstant; } }; @@ -539,11 +556,10 @@ class ParagraphComment : public BlockContentComment { ArrayRef Content; public: - ParagraphComment(ArrayRef Content) : - BlockContentComment(ParagraphCommentKind, - SourceLocation(), - SourceLocation()), - Content(Content) { + ParagraphComment(ArrayRef Content) + : BlockContentComment(CommentKind::ParagraphComment, SourceLocation(), + SourceLocation()), + Content(Content) { if (Content.empty()) { ParagraphCommentBits.IsWhitespace = true; ParagraphCommentBits.IsWhitespaceValid = true; @@ -558,7 +574,7 @@ public: } static bool classof(const Comment *C) { - return C->getCommentKind() == ParagraphCommentKind; + return C->getCommentKind() == CommentKind::ParagraphComment; } child_iterator child_begin() const { @@ -606,20 +622,19 @@ protected: } public: - BlockCommandComment(SourceLocation LocBegin, - SourceLocation LocEnd, - unsigned CommandID, - CommandMarkerKind CommandMarker) : - BlockContentComment(BlockCommandCommentKind, LocBegin, LocEnd), - Paragraph(nullptr) { + BlockCommandComment(SourceLocation LocBegin, SourceLocation LocEnd, + unsigned CommandID, CommandMarkerKind CommandMarker) + : BlockContentComment(CommentKind::BlockCommandComment, LocBegin, LocEnd), + Paragraph(nullptr) { setLocation(getCommandNameBeginLoc()); BlockCommandCommentBits.CommandID = CommandID; BlockCommandCommentBits.CommandMarker = CommandMarker; } static bool classof(const Comment *C) { - return C->getCommentKind() >= FirstBlockCommandCommentConstant && - C->getCommentKind() <= LastBlockCommandCommentConstant; + return C->getCommentKind() >= + CommentKind::FirstBlockCommandCommentConstant && + C->getCommentKind() <= CommentKind::LastBlockCommandCommentConstant; } child_iterator child_begin() const { @@ -690,6 +705,8 @@ public: } }; +enum class ParamCommandPassDirection { In, Out, InOut }; + /// Doxygen \\param command. class ParamCommandComment : public BlockCommandComment { private: @@ -702,39 +719,33 @@ public: VarArgParamIndex = ~0U/*InvalidParamIndex*/ - 1U }; - ParamCommandComment(SourceLocation LocBegin, - SourceLocation LocEnd, - unsigned CommandID, - CommandMarkerKind CommandMarker) : - BlockCommandComment(ParamCommandCommentKind, LocBegin, LocEnd, - CommandID, CommandMarker), - ParamIndex(InvalidParamIndex) { - ParamCommandCommentBits.Direction = In; + ParamCommandComment(SourceLocation LocBegin, SourceLocation LocEnd, + unsigned CommandID, CommandMarkerKind CommandMarker) + : BlockCommandComment(CommentKind::ParamCommandComment, LocBegin, LocEnd, + CommandID, CommandMarker), + ParamIndex(InvalidParamIndex) { + ParamCommandCommentBits.Direction = + llvm::to_underlying(ParamCommandPassDirection::In); ParamCommandCommentBits.IsDirectionExplicit = false; } static bool classof(const Comment *C) { - return C->getCommentKind() == ParamCommandCommentKind; + return C->getCommentKind() == CommentKind::ParamCommandComment; } - enum PassDirection { - In, - Out, - InOut - }; + static const char *getDirectionAsString(ParamCommandPassDirection D); - static const char *getDirectionAsString(PassDirection D); - - PassDirection getDirection() const LLVM_READONLY { - return static_cast(ParamCommandCommentBits.Direction); + ParamCommandPassDirection getDirection() const LLVM_READONLY { + return static_cast( + ParamCommandCommentBits.Direction); } bool isDirectionExplicit() const LLVM_READONLY { return ParamCommandCommentBits.IsDirectionExplicit; } - void setDirection(PassDirection Direction, bool Explicit) { - ParamCommandCommentBits.Direction = Direction; + void setDirection(ParamCommandPassDirection Direction, bool Explicit) { + ParamCommandCommentBits.Direction = llvm::to_underlying(Direction); ParamCommandCommentBits.IsDirectionExplicit = Explicit; } @@ -796,16 +807,13 @@ private: ArrayRef Position; public: - TParamCommandComment(SourceLocation LocBegin, - SourceLocation LocEnd, - unsigned CommandID, - CommandMarkerKind CommandMarker) : - BlockCommandComment(TParamCommandCommentKind, LocBegin, LocEnd, CommandID, - CommandMarker) - { } + TParamCommandComment(SourceLocation LocBegin, SourceLocation LocEnd, + unsigned CommandID, CommandMarkerKind CommandMarker) + : BlockCommandComment(CommentKind::TParamCommandComment, LocBegin, LocEnd, + CommandID, CommandMarker) {} static bool classof(const Comment *C) { - return C->getCommentKind() == TParamCommandCommentKind; + return C->getCommentKind() == CommentKind::TParamCommandComment; } bool hasParamName() const { @@ -847,16 +855,13 @@ class VerbatimBlockLineComment : public Comment { StringRef Text; public: - VerbatimBlockLineComment(SourceLocation LocBegin, - StringRef Text) : - Comment(VerbatimBlockLineCommentKind, - LocBegin, - LocBegin.getLocWithOffset(Text.size())), - Text(Text) - { } + VerbatimBlockLineComment(SourceLocation LocBegin, StringRef Text) + : Comment(CommentKind::VerbatimBlockLineComment, LocBegin, + LocBegin.getLocWithOffset(Text.size())), + Text(Text) {} static bool classof(const Comment *C) { - return C->getCommentKind() == VerbatimBlockLineCommentKind; + return C->getCommentKind() == CommentKind::VerbatimBlockLineComment; } child_iterator child_begin() const { return nullptr; } @@ -878,16 +883,15 @@ protected: ArrayRef Lines; public: - VerbatimBlockComment(SourceLocation LocBegin, - SourceLocation LocEnd, - unsigned CommandID) : - BlockCommandComment(VerbatimBlockCommentKind, - LocBegin, LocEnd, CommandID, - CMK_At) // FIXME: improve source fidelity. - { } + VerbatimBlockComment(SourceLocation LocBegin, SourceLocation LocEnd, + unsigned CommandID) + : BlockCommandComment(CommentKind::VerbatimBlockComment, LocBegin, LocEnd, + CommandID, + CMK_At) // FIXME: improve source fidelity. + {} static bool classof(const Comment *C) { - return C->getCommentKind() == VerbatimBlockCommentKind; + return C->getCommentKind() == CommentKind::VerbatimBlockComment; } child_iterator child_begin() const { @@ -929,21 +933,16 @@ protected: SourceLocation TextBegin; public: - VerbatimLineComment(SourceLocation LocBegin, - SourceLocation LocEnd, - unsigned CommandID, - SourceLocation TextBegin, - StringRef Text) : - BlockCommandComment(VerbatimLineCommentKind, - LocBegin, LocEnd, - CommandID, - CMK_At), // FIXME: improve source fidelity. - Text(Text), - TextBegin(TextBegin) - { } + VerbatimLineComment(SourceLocation LocBegin, SourceLocation LocEnd, + unsigned CommandID, SourceLocation TextBegin, + StringRef Text) + : BlockCommandComment(CommentKind::VerbatimLineComment, LocBegin, LocEnd, + CommandID, + CMK_At), // FIXME: improve source fidelity. + Text(Text), TextBegin(TextBegin) {} static bool classof(const Comment *C) { - return C->getCommentKind() == VerbatimLineCommentKind; + return C->getCommentKind() == CommentKind::VerbatimLineComment; } child_iterator child_begin() const { return nullptr; } @@ -1036,28 +1035,35 @@ struct DeclInfo { }; /// If false, only \c CommentDecl is valid. + LLVM_PREFERRED_TYPE(bool) unsigned IsFilled : 1; /// Simplified kind of \c CommentDecl, see \c DeclKind enum. + LLVM_PREFERRED_TYPE(DeclKind) unsigned Kind : 3; /// Is \c CommentDecl a template declaration. + LLVM_PREFERRED_TYPE(TemplateDeclKind) unsigned TemplateKind : 2; /// Is \c CommentDecl an ObjCMethodDecl. + LLVM_PREFERRED_TYPE(bool) unsigned IsObjCMethod : 1; /// Is \c CommentDecl a non-static member function of C++ class or /// instance method of ObjC class. /// Can be true only if \c IsFunctionDecl is true. + LLVM_PREFERRED_TYPE(bool) unsigned IsInstanceMethod : 1; /// Is \c CommentDecl a static member function of C++ class or /// class method of ObjC class. /// Can be true only if \c IsFunctionDecl is true. + LLVM_PREFERRED_TYPE(bool) unsigned IsClassMethod : 1; /// Is \c CommentDecl something we consider a "function" that's variadic. + LLVM_PREFERRED_TYPE(bool) unsigned IsVariadic : 1; void fill(); @@ -1079,9 +1085,9 @@ class FullComment : public Comment { DeclInfo *ThisDeclInfo; public: - FullComment(ArrayRef Blocks, DeclInfo *D) : - Comment(FullCommentKind, SourceLocation(), SourceLocation()), - Blocks(Blocks), ThisDeclInfo(D) { + FullComment(ArrayRef Blocks, DeclInfo *D) + : Comment(CommentKind::FullComment, SourceLocation(), SourceLocation()), + Blocks(Blocks), ThisDeclInfo(D) { if (Blocks.empty()) return; @@ -1091,7 +1097,7 @@ public: } static bool classof(const Comment *C) { - return C->getCommentKind() == FullCommentKind; + return C->getCommentKind() == CommentKind::FullComment; } child_iterator child_begin() const { diff --git a/contrib/llvm-project/clang/include/clang/AST/CommentSema.h b/contrib/llvm-project/clang/include/clang/AST/CommentSema.h index 5d8df7dbf385..03f13283ac0d 100644 --- a/contrib/llvm-project/clang/include/clang/AST/CommentSema.h +++ b/contrib/llvm-project/clang/include/clang/AST/CommentSema.h @@ -244,8 +244,7 @@ private: StringRef Typo, const TemplateParameterList *TemplateParameters); - InlineCommandComment::RenderKind - getInlineCommandRenderKind(StringRef Name) const; + InlineCommandRenderKind getInlineCommandRenderKind(StringRef Name) const; }; } // end namespace comments diff --git a/contrib/llvm-project/clang/include/clang/AST/CommentVisitor.h b/contrib/llvm-project/clang/include/clang/AST/CommentVisitor.h index d9a7439f7cc0..bbb624a23e68 100644 --- a/contrib/llvm-project/clang/include/clang/AST/CommentVisitor.h +++ b/contrib/llvm-project/clang/include/clang/AST/CommentVisitor.h @@ -31,8 +31,9 @@ public: switch (C->getCommentKind()) { default: llvm_unreachable("Unknown comment kind!"); #define ABSTRACT_COMMENT(COMMENT) -#define COMMENT(CLASS, PARENT) \ - case Comment::CLASS##Kind: DISPATCH(CLASS, CLASS); +#define COMMENT(CLASS, PARENT) \ + case CommentKind::CLASS: \ + DISPATCH(CLASS, CLASS); #include "clang/AST/CommentNodes.inc" #undef ABSTRACT_COMMENT #undef COMMENT diff --git a/contrib/llvm-project/clang/include/clang/AST/Decl.h b/contrib/llvm-project/clang/include/clang/AST/Decl.h index 788f6ab97b1b..cd0878d70825 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Decl.h +++ b/contrib/llvm-project/clang/include/clang/AST/Decl.h @@ -75,6 +75,7 @@ class TemplateParameterList; class TypeAliasTemplateDecl; class UnresolvedSetImpl; class VarTemplateDecl; +enum class ImplicitParamKind; /// The top declaration context. class TranslationUnitDecl : public Decl, @@ -452,6 +453,8 @@ public: return hasCachedLinkage(); } + bool isPlaceholderVar(const LangOptions &LangOpts) const; + /// Looks through UsingDecls and ObjCCompatibleAliasDecls for /// the underlying named decl. NamedDecl *getUnderlyingDecl() { @@ -967,12 +970,16 @@ private: friend class ASTDeclReader; friend class VarDecl; + LLVM_PREFERRED_TYPE(StorageClass) unsigned SClass : 3; + LLVM_PREFERRED_TYPE(ThreadStorageClassSpecifier) unsigned TSCSpec : 2; + LLVM_PREFERRED_TYPE(InitializationStyle) unsigned InitStyle : 2; /// Whether this variable is an ARC pseudo-__strong variable; see /// isARCPseudoStrong() for details. + LLVM_PREFERRED_TYPE(bool) unsigned ARCPseudoStrong : 1; }; enum { NumVarDeclBits = 8 }; @@ -993,22 +1000,27 @@ protected: friend class ASTDeclReader; friend class ParmVarDecl; + LLVM_PREFERRED_TYPE(VarDeclBitfields) unsigned : NumVarDeclBits; /// Whether this parameter inherits a default argument from a /// prior declaration. + LLVM_PREFERRED_TYPE(bool) unsigned HasInheritedDefaultArg : 1; /// Describes the kind of default argument for this parameter. By default /// this is none. If this is normal, then the default argument is stored in /// the \c VarDecl initializer expression unless we were unable to parse /// (even an invalid) expression for the default argument. + LLVM_PREFERRED_TYPE(DefaultArgKind) unsigned DefaultArgKind : 2; /// Whether this parameter undergoes K&R argument promotion. + LLVM_PREFERRED_TYPE(bool) unsigned IsKNRPromoted : 1; /// Whether this parameter is an ObjC method parameter or not. + LLVM_PREFERRED_TYPE(bool) unsigned IsObjCMethodParam : 1; /// If IsObjCMethodParam, a Decl::ObjCDeclQualifier. @@ -1027,51 +1039,64 @@ protected: friend class ImplicitParamDecl; friend class VarDecl; + LLVM_PREFERRED_TYPE(VarDeclBitfields) unsigned : NumVarDeclBits; // FIXME: We need something similar to CXXRecordDecl::DefinitionData. /// Whether this variable is a definition which was demoted due to /// module merge. + LLVM_PREFERRED_TYPE(bool) unsigned IsThisDeclarationADemotedDefinition : 1; /// Whether this variable is the exception variable in a C++ catch /// or an Objective-C @catch statement. + LLVM_PREFERRED_TYPE(bool) unsigned ExceptionVar : 1; /// Whether this local variable could be allocated in the return /// slot of its function, enabling the named return value optimization /// (NRVO). + LLVM_PREFERRED_TYPE(bool) unsigned NRVOVariable : 1; /// Whether this variable is the for-range-declaration in a C++0x /// for-range statement. + LLVM_PREFERRED_TYPE(bool) unsigned CXXForRangeDecl : 1; /// Whether this variable is the for-in loop declaration in Objective-C. + LLVM_PREFERRED_TYPE(bool) unsigned ObjCForDecl : 1; /// Whether this variable is (C++1z) inline. + LLVM_PREFERRED_TYPE(bool) unsigned IsInline : 1; /// Whether this variable has (C++1z) inline explicitly specified. + LLVM_PREFERRED_TYPE(bool) unsigned IsInlineSpecified : 1; /// Whether this variable is (C++0x) constexpr. + LLVM_PREFERRED_TYPE(bool) unsigned IsConstexpr : 1; /// Whether this variable is the implicit variable for a lambda /// init-capture. + LLVM_PREFERRED_TYPE(bool) unsigned IsInitCapture : 1; /// Whether this local extern variable's previous declaration was /// declared in the same block scope. This controls whether we should merge /// the type of this declaration with its previous declaration. + LLVM_PREFERRED_TYPE(bool) unsigned PreviousDeclInSameBlockScope : 1; /// Defines kind of the ImplicitParamDecl: 'this', 'self', 'vtt', '_cmd' or /// something else. + LLVM_PREFERRED_TYPE(ImplicitParamKind) unsigned ImplicitParamKind : 3; + LLVM_PREFERRED_TYPE(bool) unsigned EscapingByref : 1; }; @@ -1652,36 +1677,36 @@ public: static bool classofKind(Kind K) { return K >= firstVar && K <= lastVar; } }; +/// Defines the kind of the implicit parameter: is this an implicit parameter +/// with pointer to 'this', 'self', '_cmd', virtual table pointers, captured +/// context or something else. +enum class ImplicitParamKind { + /// Parameter for Objective-C 'self' argument + ObjCSelf, + + /// Parameter for Objective-C '_cmd' argument + ObjCCmd, + + /// Parameter for C++ 'this' argument + CXXThis, + + /// Parameter for C++ virtual table pointers + CXXVTT, + + /// Parameter for captured context + CapturedContext, + + /// Parameter for Thread private variable + ThreadPrivateVar, + + /// Other implicit parameter + Other, +}; + class ImplicitParamDecl : public VarDecl { void anchor() override; public: - /// Defines the kind of the implicit parameter: is this an implicit parameter - /// with pointer to 'this', 'self', '_cmd', virtual table pointers, captured - /// context or something else. - enum ImplicitParamKind : unsigned { - /// Parameter for Objective-C 'self' argument - ObjCSelf, - - /// Parameter for Objective-C '_cmd' argument - ObjCCmd, - - /// Parameter for C++ 'this' argument - CXXThis, - - /// Parameter for C++ virtual table pointers - CXXVTT, - - /// Parameter for captured context - CapturedContext, - - /// Parameter for Thread private variable - ThreadPrivateVar, - - /// Other implicit parameter - Other, - }; - /// Create implicit parameter. static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, @@ -1696,7 +1721,7 @@ public: ImplicitParamKind ParamKind) : VarDecl(ImplicitParam, C, DC, IdLoc, IdLoc, Id, Type, /*TInfo=*/nullptr, SC_None) { - NonParmVarDeclBits.ImplicitParamKind = ParamKind; + NonParmVarDeclBits.ImplicitParamKind = llvm::to_underlying(ParamKind); setImplicit(); } @@ -1704,7 +1729,7 @@ public: : VarDecl(ImplicitParam, C, /*DC=*/nullptr, SourceLocation(), SourceLocation(), /*Id=*/nullptr, Type, /*TInfo=*/nullptr, SC_None) { - NonParmVarDeclBits.ImplicitParamKind = ParamKind; + NonParmVarDeclBits.ImplicitParamKind = llvm::to_underlying(ParamKind); setImplicit(); } @@ -1807,6 +1832,18 @@ public: ParmVarDeclBits.IsKNRPromoted = promoted; } + bool isExplicitObjectParameter() const { + return ExplicitObjectParameterIntroducerLoc.isValid(); + } + + void setExplicitObjectParameterLoc(SourceLocation Loc) { + ExplicitObjectParameterIntroducerLoc = Loc; + } + + SourceLocation getExplicitObjectParamThisLoc() const { + return ExplicitObjectParameterIntroducerLoc; + } + Expr *getDefaultArg(); const Expr *getDefaultArg() const { return const_cast(this)->getDefaultArg(); @@ -1873,7 +1910,10 @@ public: static bool classofKind(Kind K) { return K == ParmVar; } private: + friend class ASTDeclReader; + enum { ParameterIndexSentinel = (1 << NumParameterIndexBits) - 1 }; + SourceLocation ExplicitObjectParameterIntroducerLoc; void setParameterIndex(unsigned parameterIndex) { if (parameterIndex >= ParameterIndexSentinel) { @@ -2638,6 +2678,23 @@ public: /// parameters have default arguments (in C++). unsigned getMinRequiredArguments() const; + /// Returns the minimum number of non-object arguments needed to call this + /// function. This produces the same value as getMinRequiredArguments except + /// it does not count the explicit object argument, if any. + unsigned getMinRequiredExplicitArguments() const; + + bool hasCXXExplicitFunctionObjectParameter() const; + + unsigned getNumNonObjectParams() const; + + const ParmVarDecl *getNonObjectParameter(unsigned I) const { + return getParamDecl(hasCXXExplicitFunctionObjectParameter() ? I + 1 : I); + } + + ParmVarDecl *getNonObjectParameter(unsigned I) { + return getParamDecl(hasCXXExplicitFunctionObjectParameter() ? I + 1 : I); + } + /// Determine whether this function has a single parameter, or multiple /// parameters where all but the first have default arguments. /// @@ -2811,9 +2868,7 @@ public: /// Determine whether this function is a function template /// specialization. - bool isFunctionTemplateSpecialization() const { - return getPrimaryTemplate() != nullptr; - } + bool isFunctionTemplateSpecialization() const; /// If this function is actually a function template specialization, /// retrieve information about this function template specialization. @@ -2896,9 +2951,9 @@ public: /// Specifies that this function declaration is actually a /// dependent function template specialization. - void setDependentTemplateSpecialization(ASTContext &Context, - const UnresolvedSetImpl &Templates, - const TemplateArgumentListInfo &TemplateArgs); + void setDependentTemplateSpecialization( + ASTContext &Context, const UnresolvedSetImpl &Templates, + const TemplateArgumentListInfo *TemplateArgs); DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const; @@ -2981,8 +3036,11 @@ class FieldDecl : public DeclaratorDecl, public Mergeable { ISK_CapturedVLAType, }; + LLVM_PREFERRED_TYPE(bool) unsigned BitField : 1; + LLVM_PREFERRED_TYPE(bool) unsigned Mutable : 1; + LLVM_PREFERRED_TYPE(InitStorageKind) unsigned StorageKind : 2; mutable unsigned CachedFieldIndex : 28; @@ -3056,12 +3114,16 @@ public: /// store the data for the anonymous union or struct. bool isAnonymousStructOrUnion() const; + /// Returns the expression that represents the bit width, if this field + /// is a bit field. For non-bitfields, this returns \c nullptr. Expr *getBitWidth() const { if (!BitField) return nullptr; return hasInClassInitializer() ? InitAndBitWidth->BitWidth : BitWidth; } + /// Computes the bit width of this field, if this is a bit field. + /// May not be called on non-bitfields. unsigned getBitWidthValue(const ASTContext &Ctx) const; /// Set the bit-field width for this member. @@ -3180,6 +3242,8 @@ public: // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classofKind(Kind K) { return K >= firstField && K <= lastField; } + + void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override; }; /// An instance of this object exists for each enum constant @@ -3665,13 +3729,15 @@ public: return static_cast(TagDeclBits.TagDeclKind); } - void setTagKind(TagKind TK) { TagDeclBits.TagDeclKind = TK; } + void setTagKind(TagKind TK) { + TagDeclBits.TagDeclKind = llvm::to_underlying(TK); + } - bool isStruct() const { return getTagKind() == TTK_Struct; } - bool isInterface() const { return getTagKind() == TTK_Interface; } - bool isClass() const { return getTagKind() == TTK_Class; } - bool isUnion() const { return getTagKind() == TTK_Union; } - bool isEnum() const { return getTagKind() == TTK_Enum; } + bool isStruct() const { return getTagKind() == TagTypeKind::Struct; } + bool isInterface() const { return getTagKind() == TagTypeKind::Interface; } + bool isClass() const { return getTagKind() == TagTypeKind::Class; } + bool isUnion() const { return getTagKind() == TagTypeKind::Union; } + bool isEnum() const { return getTagKind() == TagTypeKind::Enum; } /// Is this tag type named, either directly or via being defined in /// a typedef of this type? @@ -4021,6 +4087,29 @@ public: static bool classofKind(Kind K) { return K == Enum; } }; +/// Enum that represents the different ways arguments are passed to and +/// returned from function calls. This takes into account the target-specific +/// and version-specific rules along with the rules determined by the +/// language. +enum class RecordArgPassingKind { + /// The argument of this type can be passed directly in registers. + CanPassInRegs, + + /// The argument of this type cannot be passed directly in registers. + /// Records containing this type as a subobject are not forced to be passed + /// indirectly. This value is used only in C++. This value is required by + /// C++ because, in uncommon situations, it is possible for a class to have + /// only trivial copy/move constructors even when one of its subobjects has + /// a non-trivial copy/move constructor (if e.g. the corresponding copy/move + /// constructor in the derived class is deleted). + CannotPassInRegs, + + /// The argument of this type cannot be passed directly in registers. + /// Records containing this type as a subobject are forced to be passed + /// indirectly. + CanNeverPassInRegs +}; + /// Represents a struct/union/class. For example: /// struct X; // Forward declaration, no "body". /// union Y { int A, B; }; // Has body with members A and B (FieldDecls). @@ -4031,28 +4120,6 @@ class RecordDecl : public TagDecl { public: friend class DeclContext; friend class ASTDeclReader; - /// Enum that represents the different ways arguments are passed to and - /// returned from function calls. This takes into account the target-specific - /// and version-specific rules along with the rules determined by the - /// language. - enum ArgPassingKind : unsigned { - /// The argument of this type can be passed directly in registers. - APK_CanPassInRegs, - - /// The argument of this type cannot be passed directly in registers. - /// Records containing this type as a subobject are not forced to be passed - /// indirectly. This value is used only in C++. This value is required by - /// C++ because, in uncommon situations, it is possible for a class to have - /// only trivial copy/move constructors even when one of its subobjects has - /// a non-trivial copy/move constructor (if e.g. the corresponding copy/move - /// constructor in the derived class is deleted). - APK_CannotPassInRegs, - - /// The argument of this type cannot be passed directly in registers. - /// Records containing this type as a subobject are forced to be passed - /// indirectly. - APK_CanNeverPassInRegs - }; protected: RecordDecl(Kind DK, TagKind TK, const ASTContext &C, DeclContext *DC, @@ -4177,15 +4244,16 @@ public: /// it must have at least one trivial, non-deleted copy or move constructor. /// FIXME: This should be set as part of completeDefinition. bool canPassInRegisters() const { - return getArgPassingRestrictions() == APK_CanPassInRegs; + return getArgPassingRestrictions() == RecordArgPassingKind::CanPassInRegs; } - ArgPassingKind getArgPassingRestrictions() const { - return static_cast(RecordDeclBits.ArgPassingRestrictions); + RecordArgPassingKind getArgPassingRestrictions() const { + return static_cast( + RecordDeclBits.ArgPassingRestrictions); } - void setArgPassingRestrictions(ArgPassingKind Kind) { - RecordDeclBits.ArgPassingRestrictions = Kind; + void setArgPassingRestrictions(RecordArgPassingKind Kind) { + RecordDeclBits.ArgPassingRestrictions = llvm::to_underlying(Kind); } bool isParamDestroyedInCallee() const { @@ -4264,6 +4332,30 @@ public: return field_begin() == field_end(); } + FieldDecl *getLastField() { + FieldDecl *FD = nullptr; + for (FieldDecl *Field : fields()) + FD = Field; + return FD; + } + const FieldDecl *getLastField() const { + return const_cast(this)->getLastField(); + } + + template + const FieldDecl *findFieldIf(Functor &Pred) const { + for (const Decl *D : decls()) { + if (const auto *FD = dyn_cast(D); FD && Pred(FD)) + return FD; + + if (const auto *RD = dyn_cast(D)) + if (const FieldDecl *FD = RD->findFieldIf(Pred)) + return FD; + } + + return nullptr; + } + /// Note that the definition of this type is now complete. virtual void completeDefinition(); diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclBase.h b/contrib/llvm-project/clang/include/clang/AST/DeclBase.h index 12137387b676..5b1038582bc6 100644 --- a/contrib/llvm-project/clang/include/clang/AST/DeclBase.h +++ b/contrib/llvm-project/clang/include/clang/AST/DeclBase.h @@ -16,8 +16,10 @@ #include "clang/AST/ASTDumperUtils.h" #include "clang/AST/AttrIterator.h" #include "clang/AST/DeclarationName.h" +#include "clang/AST/SelectorLocationsKind.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" +#include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/Specifiers.h" #include "llvm/ADT/ArrayRef.h" @@ -48,7 +50,7 @@ class ExternalSourceSymbolAttr; class FunctionDecl; class FunctionType; class IdentifierInfo; -enum Linkage : unsigned char; +enum class Linkage : unsigned char; class LinkageSpecDecl; class Module; class NamedDecl; @@ -210,7 +212,7 @@ public: /// The kind of ownership a declaration has, for visibility purposes. /// This enumeration is designed such that higher values represent higher /// levels of name hiding. - enum class ModuleOwnershipKind : unsigned { + enum class ModuleOwnershipKind : unsigned char { /// This declaration is not owned by a module. Unowned, @@ -283,31 +285,38 @@ private: SourceLocation Loc; /// DeclKind - This indicates which class this is. + LLVM_PREFERRED_TYPE(Kind) unsigned DeclKind : 7; /// InvalidDecl - This indicates a semantic error occurred. + LLVM_PREFERRED_TYPE(bool) unsigned InvalidDecl : 1; /// HasAttrs - This indicates whether the decl has attributes or not. + LLVM_PREFERRED_TYPE(bool) unsigned HasAttrs : 1; /// Implicit - Whether this declaration was implicitly generated by /// the implementation rather than explicitly written by the user. + LLVM_PREFERRED_TYPE(bool) unsigned Implicit : 1; /// Whether this declaration was "used", meaning that a definition is /// required. + LLVM_PREFERRED_TYPE(bool) unsigned Used : 1; /// Whether this declaration was "referenced". /// The difference with 'Used' is whether the reference appears in a /// evaluated context or not, e.g. functions used in uninstantiated templates /// are regarded as "referenced" but not "used". + LLVM_PREFERRED_TYPE(bool) unsigned Referenced : 1; /// Whether this declaration is a top-level declaration (function, /// global variable, etc.) that is lexically inside an objc container /// definition. + LLVM_PREFERRED_TYPE(bool) unsigned TopLevelDeclInObjCContainer : 1; /// Whether statistic collection is enabled. @@ -325,16 +334,19 @@ protected: /// Access - Used by C++ decls for the access specifier. // NOTE: VC++ treats enums as signed, avoid using the AccessSpecifier enum + LLVM_PREFERRED_TYPE(AccessSpecifier) unsigned Access : 2; /// Whether this declaration was loaded from an AST file. + LLVM_PREFERRED_TYPE(bool) unsigned FromASTFile : 1; /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in. + LLVM_PREFERRED_TYPE(IdentifierNamespace) unsigned IdentifierNamespace : 14; /// If 0, we have not computed the linkage of this declaration. - /// Otherwise, it is the linkage + 1. + LLVM_PREFERRED_TYPE(Linkage) mutable unsigned CacheValidAndLinkage : 3; /// Allocate memory for a deserialized declaration. @@ -385,7 +397,7 @@ protected: Implicit(false), Used(false), Referenced(false), TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0), IdentifierNamespace(getIdentifierNamespaceForKind(DK)), - CacheValidAndLinkage(0) { + CacheValidAndLinkage(llvm::to_underlying(Linkage::Invalid)) { if (StatisticsEnabled) add(DK); } @@ -394,7 +406,7 @@ protected: Used(false), Referenced(false), TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0), IdentifierNamespace(getIdentifierNamespaceForKind(DK)), - CacheValidAndLinkage(0) { + CacheValidAndLinkage(llvm::to_underlying(Linkage::Invalid)) { if (StatisticsEnabled) add(DK); } @@ -404,11 +416,11 @@ protected: void updateOutOfDate(IdentifierInfo &II) const; Linkage getCachedLinkage() const { - return Linkage(CacheValidAndLinkage - 1); + return static_cast(CacheValidAndLinkage); } void setCachedLinkage(Linkage L) const { - CacheValidAndLinkage = L + 1; + CacheValidAndLinkage = llvm::to_underlying(L); } bool hasCachedLinkage() const { @@ -477,6 +489,15 @@ public: // Return true if this is a FileContext Decl. bool isFileContextDecl() const; + /// Whether it resembles a flexible array member. This is a static member + /// because we want to be able to call it with a nullptr. That allows us to + /// perform non-Decl specific checks based on the object's type and strict + /// flex array level. + static bool isFlexibleArrayMemberLike( + ASTContext &Context, const Decl *D, QualType Ty, + LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, + bool IgnoreTemplateOrMacroSubstitution); + ASTContext &getASTContext() const LLVM_READONLY; /// Helper to get the language options from the ASTContext. @@ -1389,6 +1410,11 @@ enum class DeductionCandidate : unsigned char { Aggregate, }; +enum class RecordArgPassingKind; +enum class OMPDeclareReductionInitKind; +enum class ObjCImplementationControl; +enum class LinkageSpecLanguageIDs; + /// DeclContext - This is used only as base class of specific decl types that /// can act as declaration contexts. These decls are (only the top classes /// that directly derive from DeclContext are mentioned, not their subclasses): @@ -1429,35 +1455,42 @@ class DeclContext { class DeclContextBitfields { friend class DeclContext; /// DeclKind - This indicates which class this is. + LLVM_PREFERRED_TYPE(Decl::Kind) uint64_t DeclKind : 7; /// Whether this declaration context also has some external /// storage that contains additional declarations that are lexically /// part of this context. + LLVM_PREFERRED_TYPE(bool) mutable uint64_t ExternalLexicalStorage : 1; /// Whether this declaration context also has some external /// storage that contains additional declarations that are visible /// in this context. + LLVM_PREFERRED_TYPE(bool) mutable uint64_t ExternalVisibleStorage : 1; /// Whether this declaration context has had externally visible /// storage added since the last lookup. In this case, \c LookupPtr's /// invariant may not hold and needs to be fixed before we perform /// another lookup. + LLVM_PREFERRED_TYPE(bool) mutable uint64_t NeedToReconcileExternalVisibleStorage : 1; /// If \c true, this context may have local lexical declarations /// that are missing from the lookup table. + LLVM_PREFERRED_TYPE(bool) mutable uint64_t HasLazyLocalLexicalLookups : 1; /// If \c true, the external source may have lexical declarations /// that are missing from the lookup table. + LLVM_PREFERRED_TYPE(bool) mutable uint64_t HasLazyExternalLexicalLookups : 1; /// If \c true, lookups should only return identifier from /// DeclContext scope (for example TranslationUnit). Used in /// LookupQualifiedName() + LLVM_PREFERRED_TYPE(bool) mutable uint64_t UseQualifiedLookup : 1; }; @@ -1470,52 +1503,60 @@ class DeclContext { class TagDeclBitfields { friend class TagDecl; /// For the bits in DeclContextBitfields + LLVM_PREFERRED_TYPE(DeclContextBitfields) uint64_t : NumDeclContextBits; /// The TagKind enum. + LLVM_PREFERRED_TYPE(TagTypeKind) uint64_t TagDeclKind : 3; /// True if this is a definition ("struct foo {};"), false if it is a /// declaration ("struct foo;"). It is not considered a definition /// until the definition has been fully processed. + LLVM_PREFERRED_TYPE(bool) uint64_t IsCompleteDefinition : 1; /// True if this is currently being defined. + LLVM_PREFERRED_TYPE(bool) uint64_t IsBeingDefined : 1; /// True if this tag declaration is "embedded" (i.e., defined or declared /// for the very first time) in the syntax of a declarator. + LLVM_PREFERRED_TYPE(bool) uint64_t IsEmbeddedInDeclarator : 1; /// True if this tag is free standing, e.g. "struct foo;". + LLVM_PREFERRED_TYPE(bool) uint64_t IsFreeStanding : 1; /// Indicates whether it is possible for declarations of this kind /// to have an out-of-date definition. /// /// This option is only enabled when modules are enabled. + LLVM_PREFERRED_TYPE(bool) uint64_t MayHaveOutOfDateDef : 1; /// Has the full definition of this type been required by a use somewhere in /// the TU. + LLVM_PREFERRED_TYPE(bool) uint64_t IsCompleteDefinitionRequired : 1; /// Whether this tag is a definition which was demoted due to /// a module merge. + LLVM_PREFERRED_TYPE(bool) uint64_t IsThisDeclarationADemotedDefinition : 1; }; - /// Number of non-inherited bits in TagDeclBitfields. - enum { NumTagDeclBits = 10 }; + /// Number of inherited and non-inherited bits in TagDeclBitfields. + enum { NumTagDeclBits = NumDeclContextBits + 10 }; /// Stores the bits used by EnumDecl. /// If modified NumEnumDeclBit and the accessor /// methods in EnumDecl should be updated appropriately. class EnumDeclBitfields { friend class EnumDecl; - /// For the bits in DeclContextBitfields. - uint64_t : NumDeclContextBits; /// For the bits in TagDeclBitfields. + LLVM_PREFERRED_TYPE(TagDeclBitfields) uint64_t : NumTagDeclBits; /// Width in bits required to store all the non-negative @@ -1528,76 +1569,93 @@ class DeclContext { /// True if this tag declaration is a scoped enumeration. Only /// possible in C++11 mode. + LLVM_PREFERRED_TYPE(bool) uint64_t IsScoped : 1; /// If this tag declaration is a scoped enum, /// then this is true if the scoped enum was declared using the class /// tag, false if it was declared with the struct tag. No meaning is /// associated if this tag declaration is not a scoped enum. + LLVM_PREFERRED_TYPE(bool) uint64_t IsScopedUsingClassTag : 1; /// True if this is an enumeration with fixed underlying type. Only /// possible in C++11, Microsoft extensions, or Objective C mode. + LLVM_PREFERRED_TYPE(bool) uint64_t IsFixed : 1; /// True if a valid hash is stored in ODRHash. + LLVM_PREFERRED_TYPE(bool) uint64_t HasODRHash : 1; }; - /// Number of non-inherited bits in EnumDeclBitfields. - enum { NumEnumDeclBits = 20 }; + /// Number of inherited and non-inherited bits in EnumDeclBitfields. + enum { NumEnumDeclBits = NumTagDeclBits + 20 }; /// Stores the bits used by RecordDecl. /// If modified NumRecordDeclBits and the accessor /// methods in RecordDecl should be updated appropriately. class RecordDeclBitfields { friend class RecordDecl; - /// For the bits in DeclContextBitfields. - uint64_t : NumDeclContextBits; /// For the bits in TagDeclBitfields. + LLVM_PREFERRED_TYPE(TagDeclBitfields) uint64_t : NumTagDeclBits; /// This is true if this struct ends with a flexible /// array member (e.g. int X[]) or if this union contains a struct that does. /// If so, this cannot be contained in arrays or other structs as a member. + LLVM_PREFERRED_TYPE(bool) uint64_t HasFlexibleArrayMember : 1; /// Whether this is the type of an anonymous struct or union. + LLVM_PREFERRED_TYPE(bool) uint64_t AnonymousStructOrUnion : 1; /// This is true if this struct has at least one member /// containing an Objective-C object pointer type. + LLVM_PREFERRED_TYPE(bool) uint64_t HasObjectMember : 1; /// This is true if struct has at least one member of /// 'volatile' type. + LLVM_PREFERRED_TYPE(bool) uint64_t HasVolatileMember : 1; /// Whether the field declarations of this record have been loaded /// from external storage. To avoid unnecessary deserialization of /// methods/nested types we allow deserialization of just the fields /// when needed. + LLVM_PREFERRED_TYPE(bool) mutable uint64_t LoadedFieldsFromExternalStorage : 1; /// Basic properties of non-trivial C structs. + LLVM_PREFERRED_TYPE(bool) uint64_t NonTrivialToPrimitiveDefaultInitialize : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t NonTrivialToPrimitiveCopy : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t NonTrivialToPrimitiveDestroy : 1; /// The following bits indicate whether this is or contains a C union that /// is non-trivial to default-initialize, destruct, or copy. These bits /// imply the associated basic non-triviality predicates declared above. + LLVM_PREFERRED_TYPE(bool) uint64_t HasNonTrivialToPrimitiveDefaultInitializeCUnion : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t HasNonTrivialToPrimitiveDestructCUnion : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t HasNonTrivialToPrimitiveCopyCUnion : 1; /// Indicates whether this struct is destroyed in the callee. + LLVM_PREFERRED_TYPE(bool) uint64_t ParamDestroyedInCallee : 1; /// Represents the way this type is passed to a function. + LLVM_PREFERRED_TYPE(RecordArgPassingKind) uint64_t ArgPassingRestrictions : 2; /// Indicates whether this struct has had its field layout randomized. + LLVM_PREFERRED_TYPE(bool) uint64_t IsRandomized : 1; /// True if a valid hash is stored in ODRHash. This should shave off some @@ -1605,8 +1663,8 @@ class DeclContext { uint64_t ODRHash : 26; }; - /// Number of non-inherited bits in RecordDeclBitfields. - enum { NumRecordDeclBits = 41 }; + /// Number of inherited and non-inherited bits in RecordDeclBitfields. + enum { NumRecordDeclBits = NumTagDeclBits + 41 }; /// Stores the bits used by OMPDeclareReductionDecl. /// If modified NumOMPDeclareReductionDeclBits and the accessor @@ -1614,15 +1672,18 @@ class DeclContext { class OMPDeclareReductionDeclBitfields { friend class OMPDeclareReductionDecl; /// For the bits in DeclContextBitfields + LLVM_PREFERRED_TYPE(DeclContextBitfields) uint64_t : NumDeclContextBits; /// Kind of initializer, /// function call or omp_priv initialization. + LLVM_PREFERRED_TYPE(OMPDeclareReductionInitKind) uint64_t InitializerKind : 2; }; - /// Number of non-inherited bits in OMPDeclareReductionDeclBitfields. - enum { NumOMPDeclareReductionDeclBits = 2 }; + /// Number of inherited and non-inherited bits in + /// OMPDeclareReductionDeclBitfields. + enum { NumOMPDeclareReductionDeclBits = NumDeclContextBits + 2 }; /// Stores the bits used by FunctionDecl. /// If modified NumFunctionDeclBits and the accessor @@ -1633,85 +1694,112 @@ class DeclContext { /// For DeductionCandidateKind friend class CXXDeductionGuideDecl; /// For the bits in DeclContextBitfields. + LLVM_PREFERRED_TYPE(DeclContextBitfields) uint64_t : NumDeclContextBits; + LLVM_PREFERRED_TYPE(StorageClass) uint64_t SClass : 3; + LLVM_PREFERRED_TYPE(bool) uint64_t IsInline : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsInlineSpecified : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsVirtualAsWritten : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsPure : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t HasInheritedPrototype : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t HasWrittenPrototype : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsDeleted : 1; /// Used by CXXMethodDecl + LLVM_PREFERRED_TYPE(bool) uint64_t IsTrivial : 1; /// This flag indicates whether this function is trivial for the purpose of /// calls. This is meaningful only when this function is a copy/move /// constructor or a destructor. + LLVM_PREFERRED_TYPE(bool) uint64_t IsTrivialForCall : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsDefaulted : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsExplicitlyDefaulted : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t HasDefaultedFunctionInfo : 1; /// For member functions of complete types, whether this is an ineligible /// special member function or an unselected destructor. See /// [class.mem.special]. + LLVM_PREFERRED_TYPE(bool) uint64_t IsIneligibleOrNotSelected : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t HasImplicitReturnZero : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsLateTemplateParsed : 1; /// Kind of contexpr specifier as defined by ConstexprSpecKind. + LLVM_PREFERRED_TYPE(ConstexprSpecKind) uint64_t ConstexprKind : 2; + LLVM_PREFERRED_TYPE(bool) uint64_t BodyContainsImmediateEscalatingExpression : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t InstantiationIsPending : 1; /// Indicates if the function uses __try. + LLVM_PREFERRED_TYPE(bool) uint64_t UsesSEHTry : 1; /// Indicates if the function was a definition /// but its body was skipped. + LLVM_PREFERRED_TYPE(bool) uint64_t HasSkippedBody : 1; /// Indicates if the function declaration will /// have a body, once we're done parsing it. + LLVM_PREFERRED_TYPE(bool) uint64_t WillHaveBody : 1; /// Indicates that this function is a multiversioned /// function using attribute 'target'. + LLVM_PREFERRED_TYPE(bool) uint64_t IsMultiVersion : 1; /// Only used by CXXDeductionGuideDecl. Indicates the kind /// of the Deduction Guide that is implicitly generated /// (used during overload resolution). + LLVM_PREFERRED_TYPE(DeductionCandidate) uint64_t DeductionCandidateKind : 2; /// Store the ODRHash after first calculation. + LLVM_PREFERRED_TYPE(bool) uint64_t HasODRHash : 1; /// Indicates if the function uses Floating Point Constrained Intrinsics + LLVM_PREFERRED_TYPE(bool) uint64_t UsesFPIntrin : 1; // Indicates this function is a constrained friend, where the constraint // refers to an enclosing template for hte purposes of [temp.friend]p9. + LLVM_PREFERRED_TYPE(bool) uint64_t FriendConstraintRefersToEnclosingTemplate : 1; }; - /// Number of non-inherited bits in FunctionDeclBitfields. - enum { NumFunctionDeclBits = 31 }; + /// Number of inherited and non-inherited bits in FunctionDeclBitfields. + enum { NumFunctionDeclBits = NumDeclContextBits + 31 }; /// Stores the bits used by CXXConstructorDecl. If modified /// NumCXXConstructorDeclBits and the accessor /// methods in CXXConstructorDecl should be updated appropriately. class CXXConstructorDeclBitfields { friend class CXXConstructorDecl; - /// For the bits in DeclContextBitfields. - uint64_t : NumDeclContextBits; /// For the bits in FunctionDeclBitfields. + LLVM_PREFERRED_TYPE(FunctionDeclBitfields) uint64_t : NumFunctionDeclBits; /// 20 bits to fit in the remaining available space. @@ -1720,19 +1808,20 @@ class DeclContext { /// will need to be shrunk if some bit is added to NumDeclContextBitfields, /// NumFunctionDeclBitfields or CXXConstructorDeclBitfields. uint64_t NumCtorInitializers : 17; + LLVM_PREFERRED_TYPE(bool) uint64_t IsInheritingConstructor : 1; /// Whether this constructor has a trail-allocated explicit specifier. + LLVM_PREFERRED_TYPE(bool) uint64_t HasTrailingExplicitSpecifier : 1; /// If this constructor does't have a trail-allocated explicit specifier. /// Whether this constructor is explicit specified. + LLVM_PREFERRED_TYPE(bool) uint64_t IsSimpleExplicit : 1; }; - /// Number of non-inherited bits in CXXConstructorDeclBitfields. - enum { - NumCXXConstructorDeclBits = 64 - NumDeclContextBits - NumFunctionDeclBits - }; + /// Number of inherited and non-inherited bits in CXXConstructorDeclBitfields. + enum { NumCXXConstructorDeclBits = NumFunctionDeclBits + 20 }; /// Stores the bits used by ObjCMethodDecl. /// If modified NumObjCMethodDeclBits and the accessor @@ -1741,43 +1830,56 @@ class DeclContext { friend class ObjCMethodDecl; /// For the bits in DeclContextBitfields. + LLVM_PREFERRED_TYPE(DeclContextBitfields) uint64_t : NumDeclContextBits; /// The conventional meaning of this method; an ObjCMethodFamily. /// This is not serialized; instead, it is computed on demand and /// cached. + LLVM_PREFERRED_TYPE(ObjCMethodFamily) mutable uint64_t Family : ObjCMethodFamilyBitWidth; /// instance (true) or class (false) method. + LLVM_PREFERRED_TYPE(bool) uint64_t IsInstance : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsVariadic : 1; /// True if this method is the getter or setter for an explicit property. + LLVM_PREFERRED_TYPE(bool) uint64_t IsPropertyAccessor : 1; /// True if this method is a synthesized property accessor stub. + LLVM_PREFERRED_TYPE(bool) uint64_t IsSynthesizedAccessorStub : 1; /// Method has a definition. + LLVM_PREFERRED_TYPE(bool) uint64_t IsDefined : 1; /// Method redeclaration in the same interface. + LLVM_PREFERRED_TYPE(bool) uint64_t IsRedeclaration : 1; /// Is redeclared in the same interface. + LLVM_PREFERRED_TYPE(bool) mutable uint64_t HasRedeclaration : 1; /// \@required/\@optional + LLVM_PREFERRED_TYPE(ObjCImplementationControl) uint64_t DeclImplementation : 2; /// in, inout, etc. + LLVM_PREFERRED_TYPE(Decl::ObjCDeclQualifier) uint64_t objcDeclQualifier : 7; /// Indicates whether this method has a related result type. + LLVM_PREFERRED_TYPE(bool) uint64_t RelatedResultType : 1; /// Whether the locations of the selector identifiers are in a /// "standard" position, a enum SelectorLocationsKind. + LLVM_PREFERRED_TYPE(SelectorLocationsKind) uint64_t SelLocsKind : 2; /// Whether this method overrides any other in the class hierarchy. @@ -1787,14 +1889,16 @@ class DeclContext { /// the same selector and is of the same kind (class or instance). /// A method in an implementation is not considered as overriding the same /// method in the interface or its categories. + LLVM_PREFERRED_TYPE(bool) uint64_t IsOverriding : 1; /// Indicates if the method was a definition but its body was skipped. + LLVM_PREFERRED_TYPE(bool) uint64_t HasSkippedBody : 1; }; - /// Number of non-inherited bits in ObjCMethodDeclBitfields. - enum { NumObjCMethodDeclBits = 24 }; + /// Number of inherited and non-inherited bits in ObjCMethodDeclBitfields. + enum { NumObjCMethodDeclBits = NumDeclContextBits + 24 }; /// Stores the bits used by ObjCContainerDecl. /// If modified NumObjCContainerDeclBits and the accessor @@ -1802,6 +1906,7 @@ class DeclContext { class ObjCContainerDeclBitfields { friend class ObjCContainerDecl; /// For the bits in DeclContextBitfields + LLVM_PREFERRED_TYPE(DeclContextBitfields) uint32_t : NumDeclContextBits; // Not a bitfield but this saves space. @@ -1809,10 +1914,10 @@ class DeclContext { SourceLocation AtStart; }; - /// Number of non-inherited bits in ObjCContainerDeclBitfields. + /// Number of inherited and non-inherited bits in ObjCContainerDeclBitfields. /// Note that here we rely on the fact that SourceLocation is 32 bits /// wide. We check this with the static_assert in the ctor of DeclContext. - enum { NumObjCContainerDeclBits = 64 - NumDeclContextBits }; + enum { NumObjCContainerDeclBits = 64 }; /// Stores the bits used by LinkageSpecDecl. /// If modified NumLinkageSpecDeclBits and the accessor @@ -1820,21 +1925,23 @@ class DeclContext { class LinkageSpecDeclBitfields { friend class LinkageSpecDecl; /// For the bits in DeclContextBitfields. + LLVM_PREFERRED_TYPE(DeclContextBitfields) uint64_t : NumDeclContextBits; - /// The language for this linkage specification with values - /// in the enum LinkageSpecDecl::LanguageIDs. + /// The language for this linkage specification. + LLVM_PREFERRED_TYPE(LinkageSpecLanguageIDs) uint64_t Language : 3; /// True if this linkage spec has braces. /// This is needed so that hasBraces() returns the correct result while the /// linkage spec body is being parsed. Once RBraceLoc has been set this is /// not used, so it doesn't need to be serialized. + LLVM_PREFERRED_TYPE(bool) uint64_t HasBraces : 1; }; - /// Number of non-inherited bits in LinkageSpecDeclBitfields. - enum { NumLinkageSpecDeclBits = 4 }; + /// Number of inherited and non-inherited bits in LinkageSpecDeclBitfields. + enum { NumLinkageSpecDeclBits = NumDeclContextBits + 4 }; /// Stores the bits used by BlockDecl. /// If modified NumBlockDeclBits and the accessor @@ -1842,25 +1949,32 @@ class DeclContext { class BlockDeclBitfields { friend class BlockDecl; /// For the bits in DeclContextBitfields. + LLVM_PREFERRED_TYPE(DeclContextBitfields) uint64_t : NumDeclContextBits; + LLVM_PREFERRED_TYPE(bool) uint64_t IsVariadic : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t CapturesCXXThis : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t BlockMissingReturnType : 1; + LLVM_PREFERRED_TYPE(bool) uint64_t IsConversionFromLambda : 1; /// A bit that indicates this block is passed directly to a function as a /// non-escaping parameter. + LLVM_PREFERRED_TYPE(bool) uint64_t DoesNotEscape : 1; /// A bit that indicates whether it's possible to avoid coying this block to /// the heap when it initializes or is assigned to a local variable with /// automatic storage. + LLVM_PREFERRED_TYPE(bool) uint64_t CanAvoidCopyToHeap : 1; }; - /// Number of non-inherited bits in BlockDeclBitfields. - enum { NumBlockDeclBits = 5 }; + /// Number of inherited and non-inherited bits in BlockDeclBitfields. + enum { NumBlockDeclBits = NumDeclContextBits + 5 }; /// Pointer to the data structure used to lookup declarations /// within this context (or a DependentStoredDeclsMap if this is a diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h b/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h index afec8150c2c9..432293583576 100644 --- a/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h +++ b/contrib/llvm-project/clang/include/clang/AST/DeclCXX.h @@ -154,22 +154,26 @@ class CXXBaseSpecifier { SourceLocation EllipsisLoc; /// Whether this is a virtual base class or not. + LLVM_PREFERRED_TYPE(bool) unsigned Virtual : 1; /// Whether this is the base of a class (true) or of a struct (false). /// /// This determines the mapping from the access specifier as written in the /// source code to the access specifier used for semantic analysis. + LLVM_PREFERRED_TYPE(bool) unsigned BaseOfClass : 1; /// Access specifier as written in the source code (may be AS_none). /// /// The actual type of data stored here is an AccessSpecifier, but we use - /// "unsigned" here to work around a VC++ bug. + /// "unsigned" here to work around Microsoft ABI. + LLVM_PREFERRED_TYPE(AccessSpecifier) unsigned Access : 2; /// Whether the class contains a using declaration /// to inherit the named class's constructors. + LLVM_PREFERRED_TYPE(bool) unsigned InheritConstructors : 1; /// The type of the base class. @@ -290,15 +294,19 @@ private: #include "CXXRecordDeclDefinitionBits.def" /// Whether this class describes a C++ lambda. + LLVM_PREFERRED_TYPE(bool) unsigned IsLambda : 1; /// Whether we are currently parsing base specifiers. + LLVM_PREFERRED_TYPE(bool) unsigned IsParsingBaseSpecifiers : 1; /// True when visible conversion functions are already computed /// and are available. + LLVM_PREFERRED_TYPE(bool) unsigned ComputedVisibleConversions : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HasODRHash : 1; /// A hash of parts of the class to help in ODR checking. @@ -383,12 +391,15 @@ private: /// lambda will have been created with the enclosing context as its /// declaration context, rather than function. This is an unfortunate /// artifact of having to parse the default arguments before. + LLVM_PREFERRED_TYPE(LambdaDependencyKind) unsigned DependencyKind : 2; /// Whether this lambda is a generic lambda. + LLVM_PREFERRED_TYPE(bool) unsigned IsGenericLambda : 1; /// The Default Capture. + LLVM_PREFERRED_TYPE(LambdaCaptureDefault) unsigned CaptureDefault : 2; /// The number of captures in this lambda is limited 2^NumCaptures. @@ -398,6 +409,7 @@ private: unsigned NumExplicitCaptures : 12; /// Has known `internal` linkage. + LLVM_PREFERRED_TYPE(bool) unsigned HasKnownInternalLinkage : 1; /// The number used to indicate this lambda expression for name @@ -1052,6 +1064,12 @@ public: return static_cast(getLambdaData().CaptureDefault); } + bool isCapturelessLambda() const { + if (!isLambda()) + return false; + return getLambdaCaptureDefault() == LCD_None && capture_size() == 0; + } + /// Set the captures for this lambda closure type. void setCaptures(ASTContext &Context, ArrayRef Captures); @@ -2061,6 +2079,17 @@ public: bool isStatic() const; bool isInstance() const { return !isStatic(); } + /// [C++2b][dcl.fct]/p7 + /// An explicit object member function is a non-static + /// member function with an explicit object parameter. e.g., + /// void func(this SomeType); + bool isExplicitObjectMemberFunction() const; + + /// [C++2b][dcl.fct]/p7 + /// An implicit object member function is a non-static + /// member function without an explicit object parameter. + bool isImplicitObjectMemberFunction() const; + /// Returns true if the given operator is implicitly static in a record /// context. static bool isStaticOverloadedOperator(OverloadedOperatorKind OOK) { @@ -2169,14 +2198,19 @@ public: /// Return the type of the object pointed by \c this. /// /// See getThisType() for usage restriction. - QualType getThisObjectType() const; + + QualType getFunctionObjectParameterReferenceType() const; + QualType getFunctionObjectParameterType() const { + return getFunctionObjectParameterReferenceType().getNonReferenceType(); + } + + unsigned getNumExplicitParams() const { + return getNumParams() - (isExplicitObjectMemberFunction() ? 1 : 0); + } static QualType getThisType(const FunctionProtoType *FPT, const CXXRecordDecl *Decl); - static QualType getThisObjectType(const FunctionProtoType *FPT, - const CXXRecordDecl *Decl); - Qualifiers getMethodQualifiers() const { return getType()->castAs()->getMethodQuals(); } @@ -2283,14 +2317,17 @@ class CXXCtorInitializer final { /// If the initializee is a type, whether that type makes this /// a delegating initialization. + LLVM_PREFERRED_TYPE(bool) unsigned IsDelegating : 1; /// If the initializer is a base initializer, this keeps track /// of whether the base is virtual or not. + LLVM_PREFERRED_TYPE(bool) unsigned IsVirtual : 1; /// Whether or not the initializer is explicitly written /// in the sources. + LLVM_PREFERRED_TYPE(bool) unsigned IsWritten : 1; /// If IsWritten is true, then this number keeps track of the textual order @@ -2875,6 +2912,12 @@ public: static bool classofKind(Kind K) { return K == CXXConversion; } }; +/// Represents the language in a linkage specification. +/// +/// The values are part of the serialization ABI for +/// ASTs and cannot be changed without altering that ABI. +enum class LinkageSpecLanguageIDs { C = 1, CXX = 2 }; + /// Represents a linkage specification. /// /// For example: @@ -2885,14 +2928,7 @@ class LinkageSpecDecl : public Decl, public DeclContext { virtual void anchor(); // This class stores some data in DeclContext::LinkageSpecDeclBits to save // some space. Use the provided accessors to access it. -public: - /// Represents the language in a linkage specification. - /// - /// The values are part of the serialization ABI for - /// ASTs and cannot be changed without altering that ABI. - enum LanguageIDs { lang_c = 1, lang_cxx = 2 }; -private: /// The source location for the extern keyword. SourceLocation ExternLoc; @@ -2900,22 +2936,25 @@ private: SourceLocation RBraceLoc; LinkageSpecDecl(DeclContext *DC, SourceLocation ExternLoc, - SourceLocation LangLoc, LanguageIDs lang, bool HasBraces); + SourceLocation LangLoc, LinkageSpecLanguageIDs lang, + bool HasBraces); public: static LinkageSpecDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation ExternLoc, - SourceLocation LangLoc, LanguageIDs Lang, - bool HasBraces); + SourceLocation LangLoc, + LinkageSpecLanguageIDs Lang, bool HasBraces); static LinkageSpecDecl *CreateDeserialized(ASTContext &C, unsigned ID); /// Return the language specified by this linkage specification. - LanguageIDs getLanguage() const { - return static_cast(LinkageSpecDeclBits.Language); + LinkageSpecLanguageIDs getLanguage() const { + return static_cast(LinkageSpecDeclBits.Language); } /// Set the language specified by this linkage specification. - void setLanguage(LanguageIDs L) { LinkageSpecDeclBits.Language = L; } + void setLanguage(LinkageSpecLanguageIDs L) { + LinkageSpecDeclBits.Language = llvm::to_underlying(L); + } /// Determines whether this linkage specification had braces in /// its syntactic form. @@ -3564,6 +3603,7 @@ class ConstructorUsingShadowDecl final : public UsingShadowDecl { /// \c true if the constructor ultimately named by this using shadow /// declaration is within a virtual base class subobject of the class that /// contains this declaration. + LLVM_PREFERRED_TYPE(bool) unsigned IsVirtual : 1; ConstructorUsingShadowDecl(ASTContext &C, DeclContext *DC, SourceLocation Loc, diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclFriend.h b/contrib/llvm-project/clang/include/clang/AST/DeclFriend.h index 52efbb130631..3e6ca5b32192 100644 --- a/contrib/llvm-project/clang/include/clang/AST/DeclFriend.h +++ b/contrib/llvm-project/clang/include/clang/AST/DeclFriend.h @@ -73,6 +73,7 @@ private: /// True if this 'friend' declaration is unsupported. Eventually we /// will support every possible friend declaration, but for now we /// silently ignore some and set this flag to authorize all access. + LLVM_PREFERRED_TYPE(bool) unsigned UnsupportedFriend : 1; // The number of "outer" template parameter lists in non-templatic diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclObjC.h b/contrib/llvm-project/clang/include/clang/AST/DeclObjC.h index ee8ec7a6a016..f8f894b4b10d 100644 --- a/contrib/llvm-project/clang/include/clang/AST/DeclObjC.h +++ b/contrib/llvm-project/clang/include/clang/AST/DeclObjC.h @@ -115,6 +115,8 @@ public: const SourceLocation *Locs, ASTContext &Ctx); }; +enum class ObjCImplementationControl { None, Required, Optional }; + /// ObjCMethodDecl - Represents an instance or class method declaration. /// ObjC methods can be declared within 4 contexts: class interfaces, /// categories, protocols, and class implementations. While C++ member @@ -139,10 +141,6 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { // This class stores some data in DeclContext::ObjCMethodDeclBits // to save some space. Use the provided accessors to access it. -public: - enum ImplementationControl { None, Required, Optional }; - -private: /// Return type of this method. QualType MethodDeclType; @@ -168,14 +166,14 @@ private: /// constructed by createImplicitParams. ImplicitParamDecl *CmdDecl = nullptr; - ObjCMethodDecl(SourceLocation beginLoc, SourceLocation endLoc, - Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, - DeclContext *contextDecl, bool isInstance = true, - bool isVariadic = false, bool isPropertyAccessor = false, - bool isSynthesizedAccessorStub = false, - bool isImplicitlyDeclared = false, bool isDefined = false, - ImplementationControl impControl = None, - bool HasRelatedResultType = false); + ObjCMethodDecl( + SourceLocation beginLoc, SourceLocation endLoc, Selector SelInfo, + QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, + bool isInstance = true, bool isVariadic = false, + bool isPropertyAccessor = false, bool isSynthesizedAccessorStub = false, + bool isImplicitlyDeclared = false, bool isDefined = false, + ObjCImplementationControl impControl = ObjCImplementationControl::None, + bool HasRelatedResultType = false); SelectorLocationsKind getSelLocsKind() const { return static_cast(ObjCMethodDeclBits.SelLocsKind); @@ -235,7 +233,7 @@ public: bool isVariadic = false, bool isPropertyAccessor = false, bool isSynthesizedAccessorStub = false, bool isImplicitlyDeclared = false, bool isDefined = false, - ImplementationControl impControl = None, + ObjCImplementationControl impControl = ObjCImplementationControl::None, bool HasRelatedResultType = false); static ObjCMethodDecl *CreateDeserialized(ASTContext &C, unsigned ID); @@ -495,16 +493,17 @@ public: const ObjCPropertyDecl *findPropertyDecl(bool CheckOverrides = true) const; // Related to protocols declared in \@protocol - void setDeclImplementation(ImplementationControl ic) { - ObjCMethodDeclBits.DeclImplementation = ic; + void setDeclImplementation(ObjCImplementationControl ic) { + ObjCMethodDeclBits.DeclImplementation = llvm::to_underlying(ic); } - ImplementationControl getImplementationControl() const { - return ImplementationControl(ObjCMethodDeclBits.DeclImplementation); + ObjCImplementationControl getImplementationControl() const { + return static_cast( + ObjCMethodDeclBits.DeclImplementation); } bool isOptional() const { - return getImplementationControl() == Optional; + return getImplementationControl() == ObjCImplementationControl::Optional; } /// Returns true if this specific method declaration is marked with the @@ -581,6 +580,7 @@ class ObjCTypeParamDecl : public TypedefNameDecl { unsigned Index : 14; /// The variance of the type parameter. + LLVM_PREFERRED_TYPE(ObjCTypeParamVariance) unsigned Variance : 2; /// The location of the variance, if any. @@ -742,10 +742,13 @@ private: QualType DeclType; TypeSourceInfo *DeclTypeSourceInfo; + LLVM_PREFERRED_TYPE(ObjCPropertyAttribute::Kind) unsigned PropertyAttributes : NumObjCPropertyAttrsBits; + LLVM_PREFERRED_TYPE(ObjCPropertyAttribute::Kind) unsigned PropertyAttributesAsWritten : NumObjCPropertyAttrsBits; // \@required/\@optional + LLVM_PREFERRED_TYPE(PropertyControl) unsigned PropertyImplementation : 2; // getter name of NULL if no getter @@ -1179,14 +1182,17 @@ class ObjCInterfaceDecl : public ObjCContainerDecl /// Indicates that the contents of this Objective-C class will be /// completed by the external AST source when required. + LLVM_PREFERRED_TYPE(bool) mutable unsigned ExternallyCompleted : 1; /// Indicates that the ivar cache does not yet include ivars /// declared in the implementation. + LLVM_PREFERRED_TYPE(bool) mutable unsigned IvarListMissingImplementation : 1; /// Indicates that this interface decl contains at least one initializer /// marked with the 'objc_designated_initializer' attribute. + LLVM_PREFERRED_TYPE(bool) unsigned HasDesignatedInitializers : 1; enum InheritedDesignatedInitializersState { @@ -1202,9 +1208,11 @@ class ObjCInterfaceDecl : public ObjCContainerDecl }; /// One of the \c InheritedDesignatedInitializersState enumeratos. + LLVM_PREFERRED_TYPE(InheritedDesignatedInitializersState) mutable unsigned InheritedDesignatedInitializers : 2; /// Tracks whether a ODR hash has been computed for this interface. + LLVM_PREFERRED_TYPE(bool) unsigned HasODRHash : 1; /// A hash of parts of the class to help in ODR checking. @@ -2008,7 +2016,9 @@ private: ObjCIvarDecl *NextIvar = nullptr; // NOTE: VC++ treats enums as signed, avoid using the AccessControl enum + LLVM_PREFERRED_TYPE(AccessControl) unsigned DeclAccess : 3; + LLVM_PREFERRED_TYPE(bool) unsigned Synthesized : 1; }; @@ -2075,6 +2085,7 @@ class ObjCProtocolDecl : public ObjCContainerDecl, ObjCProtocolList ReferencedProtocols; /// Tracks whether a ODR hash has been computed for this protocol. + LLVM_PREFERRED_TYPE(bool) unsigned HasODRHash : 1; /// A hash of parts of the class to help in ODR checking. @@ -2597,9 +2608,11 @@ class ObjCImplementationDecl : public ObjCImplDecl { /// Do the ivars of this class require initialization other than /// zero-initialization? + LLVM_PREFERRED_TYPE(bool) bool HasNonZeroConstructors : 1; /// Do the ivars of this class require non-trivial destruction? + LLVM_PREFERRED_TYPE(bool) bool HasDestructors : 1; ObjCImplementationDecl(DeclContext *DC, diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h b/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h index dd63a4f5d680..73725e6e8566 100644 --- a/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h +++ b/contrib/llvm-project/clang/include/clang/AST/DeclOpenMP.h @@ -158,6 +158,12 @@ public: static bool classofKind(Kind K) { return K == OMPThreadPrivate; } }; +enum class OMPDeclareReductionInitKind { + Call, // Initialized by function call. + Direct, // omp_priv() + Copy // omp_priv = +}; + /// This represents '#pragma omp declare reduction ...' directive. /// For example, in the following, declared reduction 'foo' for types 'int' and /// 'float': @@ -171,14 +177,7 @@ public: class OMPDeclareReductionDecl final : public ValueDecl, public DeclContext { // This class stores some data in DeclContext::OMPDeclareReductionDeclBits // to save some space. Use the provided accessors to access it. -public: - enum InitKind { - CallInit, // Initialized by function call. - DirectInit, // omp_priv() - CopyInit // omp_priv = - }; -private: friend class ASTDeclReader; /// Combiner for declare reduction construct. Expr *Combiner = nullptr; @@ -239,8 +238,9 @@ public: Expr *getInitializer() { return Initializer; } const Expr *getInitializer() const { return Initializer; } /// Get initializer kind. - InitKind getInitializerKind() const { - return static_cast(OMPDeclareReductionDeclBits.InitializerKind); + OMPDeclareReductionInitKind getInitializerKind() const { + return static_cast( + OMPDeclareReductionDeclBits.InitializerKind); } /// Get Orig variable of the initializer. Expr *getInitOrig() { return Orig; } @@ -249,9 +249,9 @@ public: Expr *getInitPriv() { return Priv; } const Expr *getInitPriv() const { return Priv; } /// Set initializer expression for the declare reduction construct. - void setInitializer(Expr *E, InitKind IK) { + void setInitializer(Expr *E, OMPDeclareReductionInitKind IK) { Initializer = E; - OMPDeclareReductionDeclBits.InitializerKind = IK; + OMPDeclareReductionDeclBits.InitializerKind = llvm::to_underlying(IK); } /// Set initializer Orig and Priv vars. void setInitializerData(Expr *OrigE, Expr *PrivE) { diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclTemplate.h b/contrib/llvm-project/clang/include/clang/AST/DeclTemplate.h index 7cd505218f2b..832ad2de6b08 100755 --- a/contrib/llvm-project/clang/include/clang/AST/DeclTemplate.h +++ b/contrib/llvm-project/clang/include/clang/AST/DeclTemplate.h @@ -83,13 +83,16 @@ class TemplateParameterList final /// Whether this template parameter list contains an unexpanded parameter /// pack. + LLVM_PREFERRED_TYPE(bool) unsigned ContainsUnexpandedParameterPack : 1; /// Whether this template parameter list has a requires clause. + LLVM_PREFERRED_TYPE(bool) unsigned HasRequiresClause : 1; /// Whether any of the template parameters has constrained-parameter /// constraint-expression. + LLVM_PREFERRED_TYPE(bool) unsigned HasConstrainedParameters : 1; protected: @@ -377,7 +380,8 @@ public: InheritedFrom = getParmOwningDefaultArg(InheritedFrom); if (!isSet()) ValueOrInherited = InheritedFrom; - else if (auto *D = ValueOrInherited.template dyn_cast()) { + else if ([[maybe_unused]] auto *D = + ValueOrInherited.template dyn_cast()) { assert(C.isSameDefaultTemplateArgument(D, InheritedFrom)); ValueOrInherited = new (allocateDefaultArgStorageChain(C)) Chain{InheritedFrom, get()}; @@ -582,7 +586,7 @@ public: /// \code /// template struct A { /// template void f(); - /// template<> void f(); // ClassScopeFunctionSpecializationDecl + /// template<> void f(); /// }; /// \endcode /// @@ -681,82 +685,48 @@ public: /// Provides information about a dependent function-template /// specialization declaration. /// -/// Since explicit function template specialization and instantiation -/// declarations can only appear in namespace scope, and you can only -/// specialize a member of a fully-specialized class, the only way to -/// get one of these is in a friend declaration like the following: +/// This is used for function templates explicit specializations declared +/// within class templates: +/// +/// \code +/// template struct A { +/// template void f(); +/// template<> void f(); // DependentFunctionTemplateSpecializationInfo +/// }; +/// \endcode +/// +/// As well as dependent friend declarations naming function template +/// specializations declared within class templates: /// /// \code /// template \ void foo(T); /// template \ class A { -/// friend void foo<>(T); +/// friend void foo<>(T); // DependentFunctionTemplateSpecializationInfo /// }; /// \endcode class DependentFunctionTemplateSpecializationInfo final : private llvm::TrailingObjects { - /// The number of potential template candidates. - unsigned NumTemplates; - - /// The number of template arguments. - unsigned NumArgs; - - /// The locations of the left and right angle brackets. - SourceRange AngleLocs; - - size_t numTrailingObjects(OverloadToken) const { - return NumArgs; - } - size_t numTrailingObjects(OverloadToken) const { - return NumTemplates; - } - - DependentFunctionTemplateSpecializationInfo( - const UnresolvedSetImpl &Templates, - const TemplateArgumentListInfo &TemplateArgs); - -public: friend TrailingObjects; + /// The number of candidates for the primary template. + unsigned NumCandidates; + + DependentFunctionTemplateSpecializationInfo( + const UnresolvedSetImpl &Candidates, + const ASTTemplateArgumentListInfo *TemplateArgsWritten); + +public: + /// The template arguments as written in the sources, if provided. + const ASTTemplateArgumentListInfo *TemplateArgumentsAsWritten; + static DependentFunctionTemplateSpecializationInfo * - Create(ASTContext &Context, const UnresolvedSetImpl &Templates, - const TemplateArgumentListInfo &TemplateArgs); + Create(ASTContext &Context, const UnresolvedSetImpl &Candidates, + const TemplateArgumentListInfo *TemplateArgs); - /// Returns the number of function templates that this might - /// be a specialization of. - unsigned getNumTemplates() const { return NumTemplates; } - - /// Returns the i'th template candidate. - FunctionTemplateDecl *getTemplate(unsigned I) const { - assert(I < getNumTemplates() && "template index out of range"); - return getTrailingObjects()[I]; - } - - /// Returns the explicit template arguments that were given. - const TemplateArgumentLoc *getTemplateArgs() const { - return getTrailingObjects(); - } - - /// Returns the number of explicit template arguments that were given. - unsigned getNumTemplateArgs() const { return NumArgs; } - - llvm::ArrayRef arguments() const { - return llvm::ArrayRef(getTemplateArgs(), getNumTemplateArgs()); - } - - /// Returns the nth template argument. - const TemplateArgumentLoc &getTemplateArg(unsigned I) const { - assert(I < getNumTemplateArgs() && "template arg index out of range"); - return getTemplateArgs()[I]; - } - - SourceLocation getLAngleLoc() const { - return AngleLocs.getBegin(); - } - - SourceLocation getRAngleLoc() const { - return AngleLocs.getEnd(); + /// Returns the candidates for the primary function template. + ArrayRef getCandidates() const { + return {getTrailingObjects(), NumCandidates}; } }; @@ -1373,10 +1343,7 @@ public: nullptr; } - void setTypeConstraint(NestedNameSpecifierLoc NNS, - DeclarationNameInfo NameInfo, NamedDecl *FoundDecl, - ConceptDecl *CD, - const ASTTemplateArgumentListInfo *ArgsAsWritten, + void setTypeConstraint(ConceptReference *CR, Expr *ImmediatelyDeclaredConstraint); /// Determine whether this template parameter has a type-constraint. @@ -1869,7 +1836,7 @@ class ClassTemplateSpecializationDecl SourceLocation PointOfInstantiation; /// The kind of specialization this declaration refers to. - /// Really a value of type TemplateSpecializationKind. + LLVM_PREFERRED_TYPE(TemplateSpecializationKind) unsigned SpecializationKind : 3; protected: @@ -2615,70 +2582,6 @@ public: static bool classofKind(Kind K) { return K == TypeAliasTemplate; } }; -/// Declaration of a function specialization at template class scope. -/// -/// For example: -/// \code -/// template -/// class A { -/// template void foo(U a) { } -/// template<> void foo(int a) { } -/// } -/// \endcode -/// -/// "template<> foo(int a)" will be saved in Specialization as a normal -/// CXXMethodDecl. Then during an instantiation of class A, it will be -/// transformed into an actual function specialization. -/// -/// FIXME: This is redundant; we could store the same information directly on -/// the CXXMethodDecl as a DependentFunctionTemplateSpecializationInfo. -class ClassScopeFunctionSpecializationDecl : public Decl { - CXXMethodDecl *Specialization; - const ASTTemplateArgumentListInfo *TemplateArgs; - - ClassScopeFunctionSpecializationDecl( - DeclContext *DC, SourceLocation Loc, CXXMethodDecl *FD, - const ASTTemplateArgumentListInfo *TemplArgs) - : Decl(Decl::ClassScopeFunctionSpecialization, DC, Loc), - Specialization(FD), TemplateArgs(TemplArgs) {} - - ClassScopeFunctionSpecializationDecl(EmptyShell Empty) - : Decl(Decl::ClassScopeFunctionSpecialization, Empty) {} - - virtual void anchor(); - -public: - friend class ASTDeclReader; - friend class ASTDeclWriter; - - CXXMethodDecl *getSpecialization() const { return Specialization; } - bool hasExplicitTemplateArgs() const { return TemplateArgs; } - const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { - return TemplateArgs; - } - - static ClassScopeFunctionSpecializationDecl * - Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, CXXMethodDecl *FD, - bool HasExplicitTemplateArgs, - const TemplateArgumentListInfo &TemplateArgs) { - return new (C, DC) ClassScopeFunctionSpecializationDecl( - DC, Loc, FD, - HasExplicitTemplateArgs - ? ASTTemplateArgumentListInfo::Create(C, TemplateArgs) - : nullptr); - } - - static ClassScopeFunctionSpecializationDecl * - CreateDeserialized(ASTContext &Context, unsigned ID); - - // Implement isa/cast/dyncast/etc. - static bool classof(const Decl *D) { return classofKind(D->getKind()); } - - static bool classofKind(Kind K) { - return K == Decl::ClassScopeFunctionSpecialization; - } -}; - /// Represents a variable template specialization, which refers to /// a variable template with a given set of template arguments. /// @@ -2738,13 +2641,14 @@ class VarTemplateSpecializationDecl : public VarDecl, SourceLocation PointOfInstantiation; /// The kind of specialization this declaration refers to. - /// Really a value of type TemplateSpecializationKind. + LLVM_PREFERRED_TYPE(TemplateSpecializationKind) unsigned SpecializationKind : 3; /// Whether this declaration is a complete definition of the /// variable template specialization. We can't otherwise tell apart /// an instantiated declaration from an instantiated definition with /// no initializer. + LLVM_PREFERRED_TYPE(bool) unsigned IsCompleteDefinition : 1; protected: diff --git a/contrib/llvm-project/clang/include/clang/AST/DeclarationName.h b/contrib/llvm-project/clang/include/clang/AST/DeclarationName.h index b06931ea3e41..c9b01dc53964 100644 --- a/contrib/llvm-project/clang/include/clang/AST/DeclarationName.h +++ b/contrib/llvm-project/clang/include/clang/AST/DeclarationName.h @@ -362,7 +362,8 @@ public: } /// Construct a declaration name from an Objective-C selector. - DeclarationName(Selector Sel) : Ptr(Sel.InfoPtr) {} + DeclarationName(Selector Sel) + : Ptr(reinterpret_cast(Sel.InfoPtr.getOpaqueValue())) {} /// Returns the name for all C++ using-directives. static DeclarationName getUsingDirectiveName() { diff --git a/contrib/llvm-project/clang/include/clang/AST/DependentDiagnostic.h b/contrib/llvm-project/clang/include/clang/AST/DependentDiagnostic.h index 18276d54d540..cadf97062004 100644 --- a/contrib/llvm-project/clang/include/clang/AST/DependentDiagnostic.h +++ b/contrib/llvm-project/clang/include/clang/AST/DependentDiagnostic.h @@ -113,7 +113,9 @@ private: struct { SourceLocation Loc; + LLVM_PREFERRED_TYPE(AccessSpecifier) unsigned Access : 2; + LLVM_PREFERRED_TYPE(bool) unsigned IsMember : 1; NamedDecl *TargetDecl; CXXRecordDecl *NamingClass; diff --git a/contrib/llvm-project/clang/include/clang/AST/Expr.h b/contrib/llvm-project/clang/include/clang/AST/Expr.h index f9795b6386c4..a41f2d66b37b 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Expr.h +++ b/contrib/llvm-project/clang/include/clang/AST/Expr.h @@ -541,8 +541,8 @@ public: /// Note: This does not perform the implicit conversions required by C++11 /// [expr.const]p5. std::optional - getIntegerConstantExpr(const ASTContext &Ctx, SourceLocation *Loc = nullptr, - bool isEvaluated = true) const; + getIntegerConstantExpr(const ASTContext &Ctx, + SourceLocation *Loc = nullptr) const; bool isIntegerConstantExpr(const ASTContext &Ctx, SourceLocation *Loc = nullptr) const; @@ -566,7 +566,7 @@ public: SmallVectorImpl< PartialDiagnosticAt> &Diags); - /// isPotentialConstantExprUnevaluted - Return true if this expression might + /// isPotentialConstantExprUnevaluated - Return true if this expression might /// be usable in a constant expression in C++11 in an unevaluated context, if /// it were in function FD marked constexpr. Return false if the function can /// never produce a constant expression, along with diagnostics describing @@ -607,6 +607,13 @@ public: /// foldable. If the expression is foldable, but not a constant expression, /// the notes will describes why it isn't a constant expression. If the /// expression *is* a constant expression, no notes will be produced. + /// + /// FIXME: this causes significant performance concerns and should be + /// refactored at some point. Not all evaluations of the constant + /// expression interpreter will display the given diagnostics, this means + /// those kinds of uses are paying the expense of generating a diagnostic + /// (which may include expensive operations like converting APValue objects + /// to a string representation). SmallVectorImpl *Diag = nullptr; EvalStatus() = default; @@ -1042,6 +1049,9 @@ public: } }; +/// Describes the kind of result that can be tail-allocated. +enum class ConstantResultStorageKind { None, Int64, APValue }; + /// ConstantExpr - An expression that occurs in a constant context and /// optionally the result of evaluating the expression. class ConstantExpr final @@ -1054,20 +1064,15 @@ class ConstantExpr final friend class ASTStmtReader; friend class ASTStmtWriter; -public: - /// Describes the kind of result that can be tail-allocated. - enum ResultStorageKind { RSK_None, RSK_Int64, RSK_APValue }; - -private: size_t numTrailingObjects(OverloadToken) const { - return ConstantExprBits.ResultKind == ConstantExpr::RSK_APValue; + return getResultStorageKind() == ConstantResultStorageKind::APValue; } size_t numTrailingObjects(OverloadToken) const { - return ConstantExprBits.ResultKind == ConstantExpr::RSK_Int64; + return getResultStorageKind() == ConstantResultStorageKind::Int64; } uint64_t &Int64Result() { - assert(ConstantExprBits.ResultKind == ConstantExpr::RSK_Int64 && + assert(getResultStorageKind() == ConstantResultStorageKind::Int64 && "invalid accessor"); return *getTrailingObjects(); } @@ -1075,7 +1080,7 @@ private: return const_cast(this)->Int64Result(); } APValue &APValueResult() { - assert(ConstantExprBits.ResultKind == ConstantExpr::RSK_APValue && + assert(getResultStorageKind() == ConstantResultStorageKind::APValue && "invalid accessor"); return *getTrailingObjects(); } @@ -1083,22 +1088,23 @@ private: return const_cast(this)->APValueResult(); } - ConstantExpr(Expr *SubExpr, ResultStorageKind StorageKind, + ConstantExpr(Expr *SubExpr, ConstantResultStorageKind StorageKind, bool IsImmediateInvocation); - ConstantExpr(EmptyShell Empty, ResultStorageKind StorageKind); + ConstantExpr(EmptyShell Empty, ConstantResultStorageKind StorageKind); public: static ConstantExpr *Create(const ASTContext &Context, Expr *E, const APValue &Result); - static ConstantExpr *Create(const ASTContext &Context, Expr *E, - ResultStorageKind Storage = RSK_None, - bool IsImmediateInvocation = false); + static ConstantExpr * + Create(const ASTContext &Context, Expr *E, + ConstantResultStorageKind Storage = ConstantResultStorageKind::None, + bool IsImmediateInvocation = false); static ConstantExpr *CreateEmpty(const ASTContext &Context, - ResultStorageKind StorageKind); + ConstantResultStorageKind StorageKind); - static ResultStorageKind getStorageKind(const APValue &Value); - static ResultStorageKind getStorageKind(const Type *T, - const ASTContext &Context); + static ConstantResultStorageKind getStorageKind(const APValue &Value); + static ConstantResultStorageKind getStorageKind(const Type *T, + const ASTContext &Context); SourceLocation getBeginLoc() const LLVM_READONLY { return SubExpr->getBeginLoc(); @@ -1119,8 +1125,8 @@ public: APValue::ValueKind getResultAPValueKind() const { return static_cast(ConstantExprBits.APValueKind); } - ResultStorageKind getResultStorageKind() const { - return static_cast(ConstantExprBits.ResultKind); + ConstantResultStorageKind getResultStorageKind() const { + return static_cast(ConstantExprBits.ResultKind); } bool isImmediateInvocation() const { return ConstantExprBits.IsImmediateInvocation; @@ -1449,6 +1455,16 @@ public: DeclRefExprBits.IsImmediateEscalating = Set; } + bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const { + return DeclRefExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter; + } + + void setCapturedByCopyInLambdaWithExplicitObjectParameter( + bool Set, const ASTContext &Context) { + DeclRefExprBits.CapturedByCopyInLambdaWithExplicitObjectParameter = Set; + setDependence(computeDependence(this, Context)); + } + static bool classof(const Stmt *T) { return T->getStmtClass() == DeclRefExprClass; } @@ -1604,26 +1620,18 @@ class FixedPointLiteral : public Expr, public APIntStorage { } }; -class CharacterLiteral : public Expr { -public: - enum CharacterKind { - Ascii, - Wide, - UTF8, - UTF16, - UTF32 - }; +enum class CharacterLiteralKind { Ascii, Wide, UTF8, UTF16, UTF32 }; -private: +class CharacterLiteral : public Expr { unsigned Value; SourceLocation Loc; public: // type should be IntTy - CharacterLiteral(unsigned value, CharacterKind kind, QualType type, + CharacterLiteral(unsigned value, CharacterLiteralKind kind, QualType type, SourceLocation l) : Expr(CharacterLiteralClass, type, VK_PRValue, OK_Ordinary), Value(value), Loc(l) { - CharacterLiteralBits.Kind = kind; + CharacterLiteralBits.Kind = llvm::to_underlying(kind); setDependence(ExprDependence::None); } @@ -1631,8 +1639,8 @@ public: CharacterLiteral(EmptyShell Empty) : Expr(CharacterLiteralClass, Empty) { } SourceLocation getLocation() const { return Loc; } - CharacterKind getKind() const { - return static_cast(CharacterLiteralBits.Kind); + CharacterLiteralKind getKind() const { + return static_cast(CharacterLiteralBits.Kind); } SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } @@ -1641,14 +1649,16 @@ public: unsigned getValue() const { return Value; } void setLocation(SourceLocation Location) { Loc = Location; } - void setKind(CharacterKind kind) { CharacterLiteralBits.Kind = kind; } + void setKind(CharacterLiteralKind kind) { + CharacterLiteralBits.Kind = llvm::to_underlying(kind); + } void setValue(unsigned Val) { Value = Val; } static bool classof(const Stmt *T) { return T->getStmtClass() == CharacterLiteralClass; } - static void print(unsigned val, CharacterKind Kind, raw_ostream &OS); + static void print(unsigned val, CharacterLiteralKind Kind, raw_ostream &OS); // Iterators child_range children() { @@ -1770,6 +1780,15 @@ public: } }; +enum class StringLiteralKind { + Ordinary, + Wide, + UTF8, + UTF16, + UTF32, + Unevaluated +}; + /// StringLiteral - This represents a string literal expression, e.g. "foo" /// or L"bar" (wide strings). The actual string data can be obtained with /// getBytes() and is NOT null-terminated. The length of the string data is @@ -1808,10 +1827,6 @@ class StringLiteral final /// /// * An array of getByteLength() char used to store the string data. -public: - enum StringKind { Ordinary, Wide, UTF8, UTF16, UTF32, Unevaluated }; - -private: unsigned numTrailingObjects(OverloadToken) const { return 1; } unsigned numTrailingObjects(OverloadToken) const { return getNumConcatenated(); @@ -1833,7 +1848,7 @@ private: } /// Build a string literal. - StringLiteral(const ASTContext &Ctx, StringRef Str, StringKind Kind, + StringLiteral(const ASTContext &Ctx, StringRef Str, StringLiteralKind Kind, bool Pascal, QualType Ty, const SourceLocation *Loc, unsigned NumConcatenated); @@ -1842,7 +1857,8 @@ private: unsigned CharByteWidth); /// Map a target and string kind to the appropriate character width. - static unsigned mapCharByteWidth(TargetInfo const &Target, StringKind SK); + static unsigned mapCharByteWidth(TargetInfo const &Target, + StringLiteralKind SK); /// Set one of the string literal token. void setStrTokenLoc(unsigned TokNum, SourceLocation L) { @@ -1854,13 +1870,13 @@ public: /// This is the "fully general" constructor that allows representation of /// strings formed from multiple concatenated tokens. static StringLiteral *Create(const ASTContext &Ctx, StringRef Str, - StringKind Kind, bool Pascal, QualType Ty, + StringLiteralKind Kind, bool Pascal, QualType Ty, const SourceLocation *Loc, unsigned NumConcatenated); /// Simple constructor for string literals made from one token. static StringLiteral *Create(const ASTContext &Ctx, StringRef Str, - StringKind Kind, bool Pascal, QualType Ty, + StringLiteralKind Kind, bool Pascal, QualType Ty, SourceLocation Loc) { return Create(Ctx, Str, Kind, Pascal, Ty, &Loc, 1); } @@ -1902,16 +1918,16 @@ public: unsigned getLength() const { return *getTrailingObjects(); } unsigned getCharByteWidth() const { return StringLiteralBits.CharByteWidth; } - StringKind getKind() const { - return static_cast(StringLiteralBits.Kind); + StringLiteralKind getKind() const { + return static_cast(StringLiteralBits.Kind); } - bool isOrdinary() const { return getKind() == Ordinary; } - bool isWide() const { return getKind() == Wide; } - bool isUTF8() const { return getKind() == UTF8; } - bool isUTF16() const { return getKind() == UTF16; } - bool isUTF32() const { return getKind() == UTF32; } - bool isUnevaluated() const { return getKind() == Unevaluated; } + bool isOrdinary() const { return getKind() == StringLiteralKind::Ordinary; } + bool isWide() const { return getKind() == StringLiteralKind::Wide; } + bool isUTF8() const { return getKind() == StringLiteralKind::UTF8; } + bool isUTF16() const { return getKind() == StringLiteralKind::UTF16; } + bool isUTF32() const { return getKind() == StringLiteralKind::UTF32; } + bool isUnevaluated() const { return getKind() == StringLiteralKind::Unevaluated; } bool isPascal() const { return StringLiteralBits.IsPascal; } bool containsNonAscii() const { @@ -1979,6 +1995,19 @@ public: } }; +enum class PredefinedIdentKind { + Func, + Function, + LFunction, // Same as Function, but as wide string. + FuncDName, + FuncSig, + LFuncSig, // Same as FuncSig, but as wide string + PrettyFunction, + /// The same as PrettyFunction, except that the + /// 'virtual' keyword is omitted for virtual member functions. + PrettyFunctionNoVirtual +}; + /// [C99 6.4.2.2] - A predefined identifier such as __func__. class PredefinedExpr final : public Expr, @@ -1990,22 +2019,7 @@ class PredefinedExpr final // "Stmt *" for the predefined identifier. It is present if and only if // hasFunctionName() is true and is always a "StringLiteral *". -public: - enum IdentKind { - Func, - Function, - LFunction, // Same as Function, but as wide string. - FuncDName, - FuncSig, - LFuncSig, // Same as FuncSig, but as wide string - PrettyFunction, - /// The same as PrettyFunction, except that the - /// 'virtual' keyword is omitted for virtual member functions. - PrettyFunctionNoVirtual - }; - -private: - PredefinedExpr(SourceLocation L, QualType FNTy, IdentKind IK, + PredefinedExpr(SourceLocation L, QualType FNTy, PredefinedIdentKind IK, bool IsTransparent, StringLiteral *SL); explicit PredefinedExpr(EmptyShell Empty, bool HasFunctionName); @@ -2025,15 +2039,15 @@ public: /// If IsTransparent, the PredefinedExpr is transparently handled as a /// StringLiteral. static PredefinedExpr *Create(const ASTContext &Ctx, SourceLocation L, - QualType FNTy, IdentKind IK, bool IsTransparent, - StringLiteral *SL); + QualType FNTy, PredefinedIdentKind IK, + bool IsTransparent, StringLiteral *SL); /// Create an empty PredefinedExpr. static PredefinedExpr *CreateEmpty(const ASTContext &Ctx, bool HasFunctionName); - IdentKind getIdentKind() const { - return static_cast(PredefinedExprBits.Kind); + PredefinedIdentKind getIdentKind() const { + return static_cast(PredefinedExprBits.Kind); } bool isTransparent() const { return PredefinedExprBits.IsTransparent; } @@ -2053,12 +2067,13 @@ public: : nullptr; } - static StringRef getIdentKindName(IdentKind IK); + static StringRef getIdentKindName(PredefinedIdentKind IK); StringRef getIdentKindName() const { return getIdentKindName(getIdentKind()); } - static std::string ComputeName(IdentKind IK, const Decl *CurrentDecl); + static std::string ComputeName(PredefinedIdentKind IK, + const Decl *CurrentDecl); SourceLocation getBeginLoc() const { return getLocation(); } SourceLocation getEndLoc() const { return getLocation(); } @@ -2341,7 +2356,7 @@ public: } protected: - /// Set FPFeatures in trailing storage, used only by Serialization + /// Set FPFeatures in trailing storage, used by Serialization & ASTImporter. void setStoredFPFeatures(FPOptionsOverride F) { getTrailingFPFeatures() = F; } public: @@ -2359,6 +2374,7 @@ public: } friend TrailingObjects; + friend class ASTNodeImporter; friend class ASTReader; friend class ASTStmtReader; friend class ASTStmtWriter; @@ -3607,6 +3623,19 @@ public: return FPOptionsOverride(); } + /// Return + // True : if this conversion changes the volatile-ness of a gl-value. + // Qualification conversions on gl-values currently use CK_NoOp, but + // it's important to recognize volatile-changing conversions in + // clients code generation that normally eagerly peephole loads. Note + // that the query is answering for this specific node; Sema may + // produce multiple cast nodes for any particular conversion sequence. + // False : Otherwise. + bool changesVolatileQualification() const { + return (isGLValue() && (getType().isVolatileQualified() != + getSubExpr()->getType().isVolatileQualified())); + } + static const FieldDecl *getTargetFieldForToUnionCast(QualType unionType, QualType opType); static const FieldDecl *getTargetFieldForToUnionCast(const RecordDecl *RD, @@ -4704,6 +4733,16 @@ public: } }; +enum class SourceLocIdentKind { + Function, + FuncSig, + File, + FileName, + Line, + Column, + SourceLocStruct +}; + /// Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), /// __builtin_FUNCTION(), __builtin_FUNCSIG(), __builtin_FILE(), /// __builtin_FILE_NAME() or __builtin_source_location(). @@ -4712,19 +4751,9 @@ class SourceLocExpr final : public Expr { DeclContext *ParentContext; public: - enum IdentKind { - Function, - FuncSig, - File, - FileName, - Line, - Column, - SourceLocStruct - }; - - SourceLocExpr(const ASTContext &Ctx, IdentKind Type, QualType ResultTy, - SourceLocation BLoc, SourceLocation RParenLoc, - DeclContext *Context); + SourceLocExpr(const ASTContext &Ctx, SourceLocIdentKind Type, + QualType ResultTy, SourceLocation BLoc, + SourceLocation RParenLoc, DeclContext *Context); /// Build an empty call expression. explicit SourceLocExpr(EmptyShell Empty) : Expr(SourceLocExprClass, Empty) {} @@ -4737,20 +4766,20 @@ public: /// Return a string representing the name of the specific builtin function. StringRef getBuiltinStr() const; - IdentKind getIdentKind() const { - return static_cast(SourceLocExprBits.Kind); + SourceLocIdentKind getIdentKind() const { + return static_cast(SourceLocExprBits.Kind); } bool isIntType() const { switch (getIdentKind()) { - case File: - case FileName: - case Function: - case FuncSig: - case SourceLocStruct: + case SourceLocIdentKind::File: + case SourceLocIdentKind::FileName: + case SourceLocIdentKind::Function: + case SourceLocIdentKind::FuncSig: + case SourceLocIdentKind::SourceLocStruct: return false; - case Line: - case Column: + case SourceLocIdentKind::Line: + case SourceLocIdentKind::Column: return true; } llvm_unreachable("unknown source location expression kind"); @@ -5083,6 +5112,7 @@ private: /// Whether this designated initializer used the GNU deprecated /// syntax rather than the C99 '=' syntax. + LLVM_PREFERRED_TYPE(bool) unsigned GNUSyntax : 1; /// The number of designators in this initializer expression. @@ -5714,6 +5744,7 @@ class GenericSelectionExpr final /// if and only if the generic selection expression is result-dependent. unsigned NumAssocs : 15; unsigned ResultIndex : 15; // NB: ResultDependentIndex is tied to this width. + LLVM_PREFERRED_TYPE(bool) unsigned IsExprPredicate : 1; enum : unsigned { ResultDependentIndex = 0x7FFF @@ -6467,7 +6498,7 @@ public: return cast(SubExprs[ORDER_FAIL]); } Expr *getVal2() const { - if (Op == AO__atomic_exchange) + if (Op == AO__atomic_exchange || Op == AO__scoped_atomic_exchange) return cast(SubExprs[ORDER_FAIL]); assert(NumSubExprs > VAL2); return cast(SubExprs[VAL2]); @@ -6479,6 +6510,16 @@ public: QualType getValueType() const; AtomicOp getOp() const { return Op; } + StringRef getOpAsString() const { + switch (Op) { +#define BUILTIN(ID, TYPE, ATTRS) +#define ATOMIC_BUILTIN(ID, TYPE, ATTRS) \ + case AO##ID: \ + return #ID; +#include "clang/Basic/Builtins.def" + } + llvm_unreachable("not an atomic operator?"); + } unsigned getNumSubExprs() const { return NumSubExprs; } Expr **getSubExprs() { return reinterpret_cast(SubExprs); } @@ -6498,7 +6539,9 @@ public: getOp() == AO__opencl_atomic_compare_exchange_weak || getOp() == AO__hip_atomic_compare_exchange_weak || getOp() == AO__atomic_compare_exchange || - getOp() == AO__atomic_compare_exchange_n; + getOp() == AO__atomic_compare_exchange_n || + getOp() == AO__scoped_atomic_compare_exchange || + getOp() == AO__scoped_atomic_compare_exchange_n; } bool isOpenCL() const { @@ -6528,13 +6571,13 @@ public: /// \return empty atomic scope model if the atomic op code does not have /// scope operand. static std::unique_ptr getScopeModel(AtomicOp Op) { - auto Kind = - (Op >= AO__opencl_atomic_load && Op <= AO__opencl_atomic_fetch_max) - ? AtomicScopeModelKind::OpenCL - : (Op >= AO__hip_atomic_load && Op <= AO__hip_atomic_fetch_max) - ? AtomicScopeModelKind::HIP - : AtomicScopeModelKind::None; - return AtomicScopeModel::create(Kind); + if (Op >= AO__opencl_atomic_load && Op <= AO__opencl_atomic_fetch_max) + return AtomicScopeModel::create(AtomicScopeModelKind::OpenCL); + else if (Op >= AO__hip_atomic_load && Op <= AO__hip_atomic_fetch_max) + return AtomicScopeModel::create(AtomicScopeModelKind::HIP); + else if (Op >= AO__scoped_atomic_load && Op <= AO__scoped_atomic_fetch_max) + return AtomicScopeModel::create(AtomicScopeModelKind::Generic); + return AtomicScopeModel::create(AtomicScopeModelKind::None); } /// Get atomic scope model. diff --git a/contrib/llvm-project/clang/include/clang/AST/ExprCXX.h b/contrib/llvm-project/clang/include/clang/AST/ExprCXX.h index f5e805257ce5..242780164318 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ExprCXX.h +++ b/contrib/llvm-project/clang/include/clang/AST/ExprCXX.h @@ -760,7 +760,7 @@ public: /// The null pointer literal (C++11 [lex.nullptr]) /// /// Introduced in C++11, the only literal of type \c nullptr_t is \c nullptr. -/// This also implements the null pointer literal in C2x (C2x 6.4.1) which is +/// This also implements the null pointer literal in C23 (C23 6.4.1) which is /// intended to have the same semantics as the feature in C++. class CXXNullPtrLiteralExpr : public Expr { public: @@ -1146,9 +1146,8 @@ public: /// }; /// \endcode class CXXThisExpr : public Expr { -public: - CXXThisExpr(SourceLocation L, QualType Ty, bool IsImplicit) - : Expr(CXXThisExprClass, Ty, VK_PRValue, OK_Ordinary) { + CXXThisExpr(SourceLocation L, QualType Ty, bool IsImplicit, ExprValueKind VK) + : Expr(CXXThisExprClass, Ty, VK, OK_Ordinary) { CXXThisExprBits.IsImplicit = IsImplicit; CXXThisExprBits.Loc = L; setDependence(computeDependence(this)); @@ -1156,6 +1155,12 @@ public: CXXThisExpr(EmptyShell Empty) : Expr(CXXThisExprClass, Empty) {} +public: + static CXXThisExpr *Create(const ASTContext &Ctx, SourceLocation L, + QualType Ty, bool IsImplicit); + + static CXXThisExpr *CreateEmpty(const ASTContext &Ctx); + SourceLocation getLocation() const { return CXXThisExprBits.Loc; } void setLocation(SourceLocation L) { CXXThisExprBits.Loc = L; } @@ -1514,19 +1519,17 @@ public: } }; +enum class CXXConstructionKind { + Complete, + NonVirtualBase, + VirtualBase, + Delegating +}; + /// Represents a call to a C++ constructor. class CXXConstructExpr : public Expr { friend class ASTStmtReader; -public: - enum ConstructionKind { - CK_Complete, - CK_NonVirtualBase, - CK_VirtualBase, - CK_Delegating - }; - -private: /// A pointer to the constructor which will be ultimately called. CXXConstructorDecl *Constructor; @@ -1562,7 +1565,7 @@ protected: CXXConstructorDecl *Ctor, bool Elidable, ArrayRef Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, - bool ZeroInitialization, ConstructionKind ConstructKind, + bool ZeroInitialization, CXXConstructionKind ConstructKind, SourceRange ParenOrBraceRange); /// Build an empty C++ construction expression. @@ -1581,7 +1584,7 @@ public: CXXConstructorDecl *Ctor, bool Elidable, ArrayRef Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, - ConstructionKind ConstructKind, SourceRange ParenOrBraceRange); + CXXConstructionKind ConstructKind, SourceRange ParenOrBraceRange); /// Create an empty C++ construction expression. static CXXConstructExpr *CreateEmpty(const ASTContext &Ctx, unsigned NumArgs); @@ -1635,11 +1638,12 @@ public: /// Determine whether this constructor is actually constructing /// a base class (rather than a complete object). - ConstructionKind getConstructionKind() const { - return static_cast(CXXConstructExprBits.ConstructionKind); + CXXConstructionKind getConstructionKind() const { + return static_cast( + CXXConstructExprBits.ConstructionKind); } - void setConstructionKind(ConstructionKind CK) { - CXXConstructExprBits.ConstructionKind = CK; + void setConstructionKind(CXXConstructionKind CK) { + CXXConstructExprBits.ConstructionKind = llvm::to_underlying(CK); } using arg_iterator = ExprIterator; @@ -1722,10 +1726,12 @@ private: SourceLocation Loc; /// Whether this is the construction of a virtual base. + LLVM_PREFERRED_TYPE(bool) unsigned ConstructsVirtualBase : 1; /// Whether the constructor is inherited from a virtual base class of the /// class that we construct. + LLVM_PREFERRED_TYPE(bool) unsigned InheritedFromVirtualBase : 1; public: @@ -1754,9 +1760,9 @@ public: /// Determine whether this constructor is actually constructing /// a base class (rather than a complete object). bool constructsVBase() const { return ConstructsVirtualBase; } - CXXConstructExpr::ConstructionKind getConstructionKind() const { - return ConstructsVirtualBase ? CXXConstructExpr::CK_VirtualBase - : CXXConstructExpr::CK_NonVirtualBase; + CXXConstructionKind getConstructionKind() const { + return ConstructsVirtualBase ? CXXConstructionKind::VirtualBase + : CXXConstructionKind::NonVirtualBase; } /// Determine whether the inherited constructor is inherited from a @@ -2200,6 +2206,20 @@ public: } }; +enum class CXXNewInitializationStyle { + /// New-expression has no initializer as written. + None, + + /// New-expression has no written initializer, but has an implicit one. + Implicit, + + /// New-expression has a C++98 paren-delimited initializer. + Call, + + /// New-expression has a C++11 list-initializer. + List +}; + /// Represents a new-expression for memory allocation and constructor /// calls, e.g: "new CXXNewExpr(foo)". class CXXNewExpr final @@ -2253,25 +2273,12 @@ class CXXNewExpr final return isParenTypeId(); } -public: - enum InitializationStyle { - /// New-expression has no initializer as written. - NoInit, - - /// New-expression has a C++98 paren-delimited initializer. - CallInit, - - /// New-expression has a C++11 list-initializer. - ListInit - }; - -private: /// Build a c++ new expression. CXXNewExpr(bool IsGlobalNew, FunctionDecl *OperatorNew, FunctionDecl *OperatorDelete, bool ShouldPassAlignment, bool UsualArrayDeleteWantsSize, ArrayRef PlacementArgs, SourceRange TypeIdParens, std::optional ArraySize, - InitializationStyle InitializationStyle, Expr *Initializer, + CXXNewInitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange); @@ -2286,7 +2293,7 @@ public: FunctionDecl *OperatorDelete, bool ShouldPassAlignment, bool UsualArrayDeleteWantsSize, ArrayRef PlacementArgs, SourceRange TypeIdParens, std::optional ArraySize, - InitializationStyle InitializationStyle, Expr *Initializer, + CXXNewInitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange); @@ -2382,15 +2389,21 @@ public: /// Whether this new-expression has any initializer at all. bool hasInitializer() const { - return CXXNewExprBits.StoredInitializationStyle > 0; + switch (getInitializationStyle()) { + case CXXNewInitializationStyle::None: + return false; + case CXXNewInitializationStyle::Implicit: + case CXXNewInitializationStyle::Call: + case CXXNewInitializationStyle::List: + return true; + } + llvm_unreachable("Unknown initializer"); } /// The kind of initializer this new-expression has. - InitializationStyle getInitializationStyle() const { - if (CXXNewExprBits.StoredInitializationStyle == 0) - return NoInit; - return static_cast( - CXXNewExprBits.StoredInitializationStyle - 1); + CXXNewInitializationStyle getInitializationStyle() const { + return static_cast( + CXXNewExprBits.StoredInitializationStyle); } /// The initializer of this new-expression. @@ -2605,6 +2618,7 @@ class CXXPseudoDestructorExpr : public Expr { /// Whether the operator was an arrow ('->'); otherwise, it was a /// period ('.'). + LLVM_PREFERRED_TYPE(bool) bool IsArrow : 1; /// The location of the '.' or '->' operator. @@ -2834,6 +2848,7 @@ public: /// \endcode class ArrayTypeTraitExpr : public Expr { /// The trait. An ArrayTypeTrait enum in MSVC compat unsigned. + LLVM_PREFERRED_TYPE(ArrayTypeTrait) unsigned ATT : 2; /// The value of the type trait. Unspecified if dependent. @@ -2904,9 +2919,11 @@ public: /// \endcode class ExpressionTraitExpr : public Expr { /// The trait. A ExpressionTrait enum in MSVC compatible unsigned. + LLVM_PREFERRED_TYPE(ExpressionTrait) unsigned ET : 31; /// The value of the type trait. Unspecified if dependent. + LLVM_PREFERRED_TYPE(bool) unsigned Value : 1; /// The location of the type trait keyword. @@ -3186,7 +3203,8 @@ class UnresolvedLookupExpr final const DeclarationNameInfo &NameInfo, bool RequiresADL, bool Overloaded, const TemplateArgumentListInfo *TemplateArgs, - UnresolvedSetIterator Begin, UnresolvedSetIterator End); + UnresolvedSetIterator Begin, UnresolvedSetIterator End, + bool KnownDependent); UnresolvedLookupExpr(EmptyShell Empty, unsigned NumResults, bool HasTemplateKWAndArgsInfo); @@ -3206,12 +3224,15 @@ public: const DeclarationNameInfo &NameInfo, bool RequiresADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End); + // After canonicalization, there may be dependent template arguments in + // CanonicalConverted But none of Args is dependent. When any of + // CanonicalConverted dependent, KnownDependent is true. static UnresolvedLookupExpr * Create(const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, const TemplateArgumentListInfo *Args, UnresolvedSetIterator Begin, - UnresolvedSetIterator End); + UnresolvedSetIterator End, bool KnownDependent); static UnresolvedLookupExpr *CreateEmpty(const ASTContext &Context, unsigned NumResults, diff --git a/contrib/llvm-project/clang/include/clang/AST/ExprConcepts.h b/contrib/llvm-project/clang/include/clang/AST/ExprConcepts.h index 13d4568119eb..29913fd84c58 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ExprConcepts.h +++ b/contrib/llvm-project/clang/include/clang/AST/ExprConcepts.h @@ -39,14 +39,13 @@ class ASTStmtWriter; /// /// According to C++2a [expr.prim.id]p3 an id-expression that denotes the /// specialization of a concept results in a prvalue of type bool. -class ConceptSpecializationExpr final : public Expr, public ConceptReference { +class ConceptSpecializationExpr final : public Expr { friend class ASTReader; friend class ASTStmtReader; -public: - using SubstitutionDiagnostic = std::pair; +private: + ConceptReference *ConceptRef; -protected: /// \brief The Implicit Concept Specialization Decl, which holds the template /// arguments for this specialization. ImplicitConceptSpecializationDecl *SpecDecl; @@ -56,16 +55,11 @@ protected: /// ignored. ASTConstraintSatisfaction *Satisfaction; - ConceptSpecializationExpr(const ASTContext &C, NestedNameSpecifierLoc NNS, - SourceLocation TemplateKWLoc, - DeclarationNameInfo ConceptNameInfo, - NamedDecl *FoundDecl, ConceptDecl *NamedConcept, - const ASTTemplateArgumentListInfo *ArgsAsWritten, + ConceptSpecializationExpr(const ASTContext &C, ConceptReference *ConceptRef, ImplicitConceptSpecializationDecl *SpecDecl, const ConstraintSatisfaction *Satisfaction); - ConceptSpecializationExpr(const ASTContext &C, ConceptDecl *NamedConcept, - const ASTTemplateArgumentListInfo *ArgsAsWritten, + ConceptSpecializationExpr(const ASTContext &C, ConceptReference *ConceptRef, ImplicitConceptSpecializationDecl *SpecDecl, const ConstraintSatisfaction *Satisfaction, bool Dependent, @@ -74,16 +68,12 @@ protected: public: static ConceptSpecializationExpr * - Create(const ASTContext &C, NestedNameSpecifierLoc NNS, - SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, - NamedDecl *FoundDecl, ConceptDecl *NamedConcept, - const ASTTemplateArgumentListInfo *ArgsAsWritten, + Create(const ASTContext &C, ConceptReference *ConceptRef, ImplicitConceptSpecializationDecl *SpecDecl, const ConstraintSatisfaction *Satisfaction); static ConceptSpecializationExpr * - Create(const ASTContext &C, ConceptDecl *NamedConcept, - const ASTTemplateArgumentListInfo *ArgsAsWritten, + Create(const ASTContext &C, ConceptReference *ConceptRef, ImplicitConceptSpecializationDecl *SpecDecl, const ConstraintSatisfaction *Satisfaction, bool Dependent, bool ContainsUnexpandedParameterPack); @@ -92,6 +82,37 @@ public: return SpecDecl->getTemplateArguments(); } + ConceptReference *getConceptReference() const { return ConceptRef; } + + ConceptDecl *getNamedConcept() const { return ConceptRef->getNamedConcept(); } + + // FIXME: Several of the following functions can be removed. Instead the + // caller can directly work with the ConceptReference. + bool hasExplicitTemplateArgs() const { + return ConceptRef->hasExplicitTemplateArgs(); + } + + SourceLocation getConceptNameLoc() const { + return ConceptRef->getConceptNameLoc(); + } + const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { + return ConceptRef->getTemplateArgsAsWritten(); + } + + const NestedNameSpecifierLoc &getNestedNameSpecifierLoc() const { + return ConceptRef->getNestedNameSpecifierLoc(); + } + + SourceLocation getTemplateKWLoc() const { + return ConceptRef->getTemplateKWLoc(); + } + + NamedDecl *getFoundDecl() const { return ConceptRef->getFoundDecl(); } + + const DeclarationNameInfo &getConceptNameInfo() const { + return ConceptRef->getConceptNameInfo(); + } + const ImplicitConceptSpecializationDecl *getSpecializationDecl() const { assert(SpecDecl && "Template Argument Decl not initialized"); return SpecDecl; @@ -120,17 +141,15 @@ public: } SourceLocation getBeginLoc() const LLVM_READONLY { - if (auto QualifierLoc = getNestedNameSpecifierLoc()) - return QualifierLoc.getBeginLoc(); - return ConceptName.getBeginLoc(); + return ConceptRef->getBeginLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - // If the ConceptSpecializationExpr is the ImmediatelyDeclaredConstraint - // of a TypeConstraint written syntactically as a constrained-parameter, - // there may not be a template argument list. - return ArgsAsWritten->RAngleLoc.isValid() ? ArgsAsWritten->RAngleLoc - : ConceptName.getEndLoc(); + return ConceptRef->getEndLoc(); + } + + SourceLocation getExprLoc() const LLVM_READONLY { + return ConceptRef->getLocation(); } // Iterators @@ -154,8 +173,11 @@ public: private: const RequirementKind Kind; // FIXME: use RequirementDependence to model dependence? + LLVM_PREFERRED_TYPE(bool) bool Dependent : 1; + LLVM_PREFERRED_TYPE(bool) bool ContainsUnexpandedParameterPack : 1; + LLVM_PREFERRED_TYPE(bool) bool Satisfied : 1; public: struct SubstitutionDiagnostic { @@ -492,6 +514,8 @@ class RequiresExpr final : public Expr, unsigned NumLocalParameters; unsigned NumRequirements; RequiresExprBodyDecl *Body; + SourceLocation LParenLoc; + SourceLocation RParenLoc; SourceLocation RBraceLoc; unsigned numTrailingObjects(OverloadToken) const { @@ -503,19 +527,22 @@ class RequiresExpr final : public Expr, } RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc, - RequiresExprBodyDecl *Body, + RequiresExprBodyDecl *Body, SourceLocation LParenLoc, ArrayRef LocalParameters, + SourceLocation RParenLoc, ArrayRef Requirements, SourceLocation RBraceLoc); RequiresExpr(ASTContext &C, EmptyShell Empty, unsigned NumLocalParameters, unsigned NumRequirements); public: - static RequiresExpr * - Create(ASTContext &C, SourceLocation RequiresKWLoc, - RequiresExprBodyDecl *Body, ArrayRef LocalParameters, - ArrayRef Requirements, - SourceLocation RBraceLoc); + static RequiresExpr *Create(ASTContext &C, SourceLocation RequiresKWLoc, + RequiresExprBodyDecl *Body, + SourceLocation LParenLoc, + ArrayRef LocalParameters, + SourceLocation RParenLoc, + ArrayRef Requirements, + SourceLocation RBraceLoc); static RequiresExpr * Create(ASTContext &C, EmptyShell Empty, unsigned NumLocalParameters, unsigned NumRequirements); @@ -548,6 +575,8 @@ public: return RequiresExprBits.RequiresKWLoc; } + SourceLocation getLParenLoc() const { return LParenLoc; } + SourceLocation getRParenLoc() const { return RParenLoc; } SourceLocation getRBraceLoc() const { return RBraceLoc; } static bool classof(const Stmt *T) { diff --git a/contrib/llvm-project/clang/include/clang/AST/ExprObjC.h b/contrib/llvm-project/clang/include/clang/AST/ExprObjC.h index 55bb5fa06b8b..f833916c91aa 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ExprObjC.h +++ b/contrib/llvm-project/clang/include/clang/AST/ExprObjC.h @@ -317,6 +317,7 @@ class ObjCDictionaryLiteral final /// key/value pairs, which provide the locations of the ellipses (if /// any) and number of elements in the expansion (if known). If /// there are no pack expansions, we optimize away this storage. + LLVM_PREFERRED_TYPE(bool) unsigned HasPackExpansions : 1; SourceRange Range; @@ -554,9 +555,11 @@ class ObjCIvarRefExpr : public Expr { SourceLocation OpLoc; // True if this is "X->F", false if this is "X.F". + LLVM_PREFERRED_TYPE(bool) bool IsArrow : 1; // True if ivar reference has no base (self assumed). + LLVM_PREFERRED_TYPE(bool) bool IsFreeIvar : 1; public: @@ -940,6 +943,23 @@ private: class ObjCMessageExpr final : public Expr, private llvm::TrailingObjects { +public: + /// The kind of receiver this message is sending to. + enum ReceiverKind { + /// The receiver is a class. + Class = 0, + + /// The receiver is an object instance. + Instance, + + /// The receiver is a superclass. + SuperClass, + + /// The receiver is the instance of the superclass object. + SuperInstance + }; + +private: /// Stores either the selector that this message is sending /// to (when \c HasMethod is zero) or an \c ObjCMethodDecl pointer /// referring to the method that we type-checked against. @@ -955,6 +975,7 @@ class ObjCMessageExpr final /// ReceiverKind values. /// /// We pad this out to a byte to avoid excessive masking and shifting. + LLVM_PREFERRED_TYPE(ReceiverKind) unsigned Kind : 8; /// Whether we have an actual method prototype in \c @@ -962,18 +983,22 @@ class ObjCMessageExpr final /// /// When non-zero, we have a method declaration; otherwise, we just /// have a selector. + LLVM_PREFERRED_TYPE(bool) unsigned HasMethod : 1; /// Whether this message send is a "delegate init call", /// i.e. a call of an init method on self from within an init method. + LLVM_PREFERRED_TYPE(bool) unsigned IsDelegateInitCall : 1; /// Whether this message send was implicitly generated by /// the implementation rather than explicitly written by the user. + LLVM_PREFERRED_TYPE(bool) unsigned IsImplicit : 1; /// Whether the locations of the selector identifiers are in a /// "standard" position, a enum SelectorLocationsKind. + LLVM_PREFERRED_TYPE(SelectorLocationsKind) unsigned SelLocsKind : 2; /// When the message expression is a send to 'super', this is @@ -1082,21 +1107,6 @@ public: friend class ASTStmtWriter; friend TrailingObjects; - /// The kind of receiver this message is sending to. - enum ReceiverKind { - /// The receiver is a class. - Class = 0, - - /// The receiver is an object instance. - Instance, - - /// The receiver is a superclass. - SuperClass, - - /// The receiver is the instance of the superclass object. - SuperInstance - }; - /// Create a message send to super. /// /// \param Context The ASTContext in which this expression will be created. @@ -1631,6 +1641,7 @@ class ObjCBridgedCastExpr final SourceLocation LParenLoc; SourceLocation BridgeKeywordLoc; + LLVM_PREFERRED_TYPE(ObjCBridgeCastKind) unsigned Kind : 2; public: diff --git a/contrib/llvm-project/clang/include/clang/AST/JSONNodeDumper.h b/contrib/llvm-project/clang/include/clang/AST/JSONNodeDumper.h index 5e2756f2a203..4def5389137f 100644 --- a/contrib/llvm-project/clang/include/clang/AST/JSONNodeDumper.h +++ b/contrib/llvm-project/clang/include/clang/AST/JSONNodeDumper.h @@ -208,6 +208,14 @@ public: void Visit(const concepts::Requirement *R); void Visit(const APValue &Value, QualType Ty); + void VisitAliasAttr(const AliasAttr *AA); + void VisitCleanupAttr(const CleanupAttr *CA); + void VisitDeprecatedAttr(const DeprecatedAttr *DA); + void VisitUnavailableAttr(const UnavailableAttr *UA); + void VisitSectionAttr(const SectionAttr *SA); + void VisitVisibilityAttr(const VisibilityAttr *VA); + void VisitTLSModelAttr(const TLSModelAttr *TA); + void VisitTypedefType(const TypedefType *TT); void VisitUsingType(const UsingType *TT); void VisitFunctionType(const FunctionType *T); @@ -277,6 +285,7 @@ public: void VisitBinaryOperator(const BinaryOperator *BO); void VisitCompoundAssignOperator(const CompoundAssignOperator *CAO); void VisitMemberExpr(const MemberExpr *ME); + void VisitAtomicExpr(const AtomicExpr *AE); void VisitCXXNewExpr(const CXXNewExpr *NE); void VisitCXXDeleteExpr(const CXXDeleteExpr *DE); void VisitCXXThisExpr(const CXXThisExpr *TE); diff --git a/contrib/llvm-project/clang/include/clang/AST/Mangle.h b/contrib/llvm-project/clang/include/clang/AST/Mangle.h index c04bcc7f01cb..e586b0cec43d 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Mangle.h +++ b/contrib/llvm-project/clang/include/clang/AST/Mangle.h @@ -178,8 +178,8 @@ public: /// or type uniquing. /// TODO: Extend this to internal types by generating names that are unique /// across translation units so it can be used with LTO. - virtual void mangleTypeName(QualType T, raw_ostream &, - bool NormalizeIntegers = false) = 0; + virtual void mangleCanonicalTypeName(QualType T, raw_ostream &, + bool NormalizeIntegers = false) = 0; /// @} }; diff --git a/contrib/llvm-project/clang/include/clang/AST/OpenMPClause.h b/contrib/llvm-project/clang/include/clang/AST/OpenMPClause.h index 0bea21270692..924ca189381b 100644 --- a/contrib/llvm-project/clang/include/clang/AST/OpenMPClause.h +++ b/contrib/llvm-project/clang/include/clang/AST/OpenMPClause.h @@ -2513,6 +2513,89 @@ public: } }; +/// This represents 'fail' clause in the '#pragma omp atomic' +/// directive. +/// +/// \code +/// #pragma omp atomic compare fail +/// \endcode +/// In this example directive '#pragma omp atomic compare' has 'fail' clause. +class OMPFailClause final : public OMPClause { + + // FailParameter is a memory-order-clause. Storing the ClauseKind is + // sufficient for our purpose. + OpenMPClauseKind FailParameter = llvm::omp::Clause::OMPC_unknown; + SourceLocation FailParameterLoc; + SourceLocation LParenLoc; + + friend class OMPClauseReader; + + /// Sets the location of '(' in fail clause. + void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } + + /// Sets the location of memoryOrder clause argument in fail clause. + void setFailParameterLoc(SourceLocation Loc) { FailParameterLoc = Loc; } + + /// Sets the mem_order clause for 'atomic compare fail' directive. + void setFailParameter(OpenMPClauseKind FailParameter) { + this->FailParameter = FailParameter; + assert(checkFailClauseParameter(FailParameter) && + "Invalid fail clause parameter"); + } + +public: + /// Build 'fail' clause. + /// + /// \param StartLoc Starting location of the clause. + /// \param EndLoc Ending location of the clause. + OMPFailClause(SourceLocation StartLoc, SourceLocation EndLoc) + : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc) {} + + OMPFailClause(OpenMPClauseKind FailParameter, SourceLocation FailParameterLoc, + SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc) + : OMPClause(llvm::omp::OMPC_fail, StartLoc, EndLoc), + FailParameterLoc(FailParameterLoc), LParenLoc(LParenLoc) { + + setFailParameter(FailParameter); + } + + /// Build an empty clause. + OMPFailClause() + : OMPClause(llvm::omp::OMPC_fail, SourceLocation(), SourceLocation()) {} + + child_range children() { + return child_range(child_iterator(), child_iterator()); + } + + const_child_range children() const { + return const_child_range(const_child_iterator(), const_child_iterator()); + } + + child_range used_children() { + return child_range(child_iterator(), child_iterator()); + } + const_child_range used_children() const { + return const_child_range(const_child_iterator(), const_child_iterator()); + } + + static bool classof(const OMPClause *T) { + return T->getClauseKind() == llvm::omp::OMPC_fail; + } + + /// Gets the location of '(' (for the parameter) in fail clause. + SourceLocation getLParenLoc() const { + return LParenLoc; + } + + /// Gets the location of Fail Parameter (type memory-order-clause) in + /// fail clause. + SourceLocation getFailParameterLoc() const { return FailParameterLoc; } + + /// Gets the parameter (type memory-order-clause) in Fail clause. + OpenMPClauseKind getFailParameter() const { return FailParameter; } +}; + /// This represents clause 'private' in the '#pragma omp ...' directives. /// /// \code @@ -3918,6 +4001,9 @@ class OMPLinearClause final /// Location of ':'. SourceLocation ColonLoc; + /// Location of 'step' modifier. + SourceLocation StepModifierLoc; + /// Sets the linear step for clause. void setStep(Expr *Step) { *(getFinals().end()) = Step; } @@ -3929,16 +4015,18 @@ class OMPLinearClause final /// \param StartLoc Starting location of the clause. /// \param LParenLoc Location of '('. /// \param ColonLoc Location of ':'. + /// \param StepModifierLoc Location of 'step' modifier. /// \param EndLoc Ending location of the clause. /// \param NumVars Number of variables. OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, - SourceLocation ColonLoc, SourceLocation EndLoc, - unsigned NumVars) + SourceLocation ColonLoc, SourceLocation StepModifierLoc, + SourceLocation EndLoc, unsigned NumVars) : OMPVarListClause(llvm::omp::OMPC_linear, StartLoc, LParenLoc, EndLoc, NumVars), OMPClauseWithPostUpdate(this), Modifier(Modifier), - ModifierLoc(ModifierLoc), ColonLoc(ColonLoc) {} + ModifierLoc(ModifierLoc), ColonLoc(ColonLoc), + StepModifierLoc(StepModifierLoc) {} /// Build an empty clause. /// @@ -4017,6 +4105,7 @@ public: /// \param Modifier Modifier of 'linear' clause. /// \param ModifierLoc Modifier location. /// \param ColonLoc Location of ':'. + /// \param StepModifierLoc Location of 'step' modifier. /// \param EndLoc Ending location of the clause. /// \param VL List of references to the variables. /// \param PL List of private copies of original variables. @@ -4030,9 +4119,10 @@ public: static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, - SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef VL, - ArrayRef PL, ArrayRef IL, Expr *Step, Expr *CalcStep, - Stmt *PreInit, Expr *PostUpdate); + SourceLocation ColonLoc, SourceLocation StepModifierLoc, + SourceLocation EndLoc, ArrayRef VL, ArrayRef PL, + ArrayRef IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, + Expr *PostUpdate); /// Creates an empty clause with the place for \a NumVars variables. /// @@ -4055,9 +4145,15 @@ public: /// Sets the location of ':'. void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; } + /// Sets the location of 'step' modifier. + void setStepModifierLoc(SourceLocation Loc) { StepModifierLoc = Loc; } + /// Returns the location of ':'. SourceLocation getColonLoc() const { return ColonLoc; } + /// Returns the location of 'step' modifier. + SourceLocation getStepModifierLoc() const { return StepModifierLoc; } + /// Returns linear step. Expr *getStep() { return *(getFinals().end()); } @@ -7763,10 +7859,10 @@ public: /// \param MLoc Location of the modifier OMPOrderClause(OpenMPOrderClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc, OpenMPOrderClauseModifier M, + SourceLocation EndLoc, OpenMPOrderClauseModifier Modifier, SourceLocation MLoc) : OMPClause(llvm::omp::OMPC_order, StartLoc, EndLoc), - LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(M), + LParenLoc(LParenLoc), Kind(A), KindKwLoc(ALoc), Modifier(Modifier), ModifierKwLoc(MLoc) {} /// Build an empty clause. @@ -9172,6 +9268,75 @@ public: } }; +/// This represents 'ompx_attribute' clause in a directive that might generate +/// an outlined function. An example is given below. +/// +/// \code +/// #pragma omp target [...] ompx_attribute(flatten) +/// \endcode +class OMPXAttributeClause + : public OMPNoChildClause { + friend class OMPClauseReader; + + /// Location of '('. + SourceLocation LParenLoc; + + /// The parsed attributes (clause arguments) + SmallVector Attrs; + +public: + /// Build 'ompx_attribute' clause. + /// + /// \param Attrs The parsed attributes (clause arguments) + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param EndLoc Ending location of the clause. + OMPXAttributeClause(ArrayRef Attrs, SourceLocation StartLoc, + SourceLocation LParenLoc, SourceLocation EndLoc) + : OMPNoChildClause(StartLoc, EndLoc), LParenLoc(LParenLoc), Attrs(Attrs) { + } + + /// Build an empty clause. + OMPXAttributeClause() : OMPNoChildClause() {} + + /// Sets the location of '('. + void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; } + + /// Returns the location of '('. + SourceLocation getLParenLoc() const { return LParenLoc; } + + /// Returned the attributes parsed from this clause. + ArrayRef getAttrs() const { return Attrs; } + +private: + /// Replace the attributes with \p NewAttrs. + void setAttrs(ArrayRef NewAttrs) { + Attrs.clear(); + Attrs.append(NewAttrs.begin(), NewAttrs.end()); + } +}; + +/// This represents 'ompx_bare' clause in the '#pragma omp target teams ...' +/// directive. +/// +/// \code +/// #pragma omp target teams ompx_bare +/// \endcode +/// In this example directive '#pragma omp target teams' has a 'ompx_bare' +/// clause. +class OMPXBareClause : public OMPNoChildClause { +public: + /// Build 'ompx_bare' clause. + /// + /// \param StartLoc Starting location of the clause. + /// \param EndLoc Ending location of the clause. + OMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc) + : OMPNoChildClause(StartLoc, EndLoc) {} + + /// Build an empty clause. + OMPXBareClause() = default; +}; + } // namespace clang #endif // LLVM_CLANG_AST_OPENMPCLAUSE_H diff --git a/contrib/llvm-project/clang/include/clang/AST/OperationKinds.def b/contrib/llvm-project/clang/include/clang/AST/OperationKinds.def index 96b5a4db55e0..8dd98730dff7 100644 --- a/contrib/llvm-project/clang/include/clang/AST/OperationKinds.def +++ b/contrib/llvm-project/clang/include/clang/AST/OperationKinds.def @@ -80,6 +80,7 @@ CAST_OPERATION(LValueToRValue) /// (possibly) adding qualifiers or removing noexcept. /// int -> int /// char** -> const char * const * +/// int[1] -> int[] /// void () noexcept -> void () CAST_OPERATION(NoOp) diff --git a/contrib/llvm-project/clang/include/clang/AST/PrettyPrinter.h b/contrib/llvm-project/clang/include/clang/AST/PrettyPrinter.h index 8a0bc6dfb57b..da276e26049b 100644 --- a/contrib/llvm-project/clang/include/clang/AST/PrettyPrinter.h +++ b/contrib/llvm-project/clang/include/clang/AST/PrettyPrinter.h @@ -66,7 +66,7 @@ struct PrintingPolicy { SuppressLifetimeQualifiers(false), SuppressTemplateArgsInCXXConstructors(false), SuppressDefaultTemplateArgs(true), Bool(LO.Bool), - Nullptr(LO.CPlusPlus11 || LO.C2x), NullptrTypeInNamespace(LO.CPlusPlus), + Nullptr(LO.CPlusPlus11 || LO.C23), NullptrTypeInNamespace(LO.CPlusPlus), Restrict(LO.C99), Alignof(LO.CPlusPlus11), UnderscoreAlignof(LO.C11), UseVoidForZeroParams(!LO.CPlusPlus), SplitTemplateClosers(!LO.CPlusPlus11), TerseOutput(false), @@ -106,6 +106,7 @@ struct PrintingPolicy { /// declaration for "x", so that we will print "int *x"; it will be /// \c true when we print "y", so that we suppress printing the /// "const int" type specifier and instead only print the "*y". + LLVM_PREFERRED_TYPE(bool) unsigned SuppressSpecifiers : 1; /// Whether type printing should skip printing the tag keyword. @@ -116,6 +117,7 @@ struct PrintingPolicy { /// \code /// struct Geometry::Point; /// \endcode + LLVM_PREFERRED_TYPE(bool) unsigned SuppressTagKeyword : 1; /// When true, include the body of a tag definition. @@ -126,22 +128,27 @@ struct PrintingPolicy { /// \code /// typedef struct { int x, y; } Point; /// \endcode + LLVM_PREFERRED_TYPE(bool) unsigned IncludeTagDefinition : 1; /// Suppresses printing of scope specifiers. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressScope : 1; /// Suppress printing parts of scope specifiers that are never /// written, e.g., for anonymous namespaces. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressUnwrittenScope : 1; /// Suppress printing parts of scope specifiers that correspond /// to inline namespaces, where the name is unambiguous with the specifier /// removed. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressInlineNamespace : 1; /// Ignore qualifiers and tag keywords as specified by elaborated type sugar, /// instead letting the underlying type print as normal. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressElaboration : 1; /// Suppress printing of variable initializers. @@ -155,6 +162,7 @@ struct PrintingPolicy { /// /// SuppressInitializers will be true when printing "auto x", so that the /// internal initializer constructed for x will not be printed. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressInitializers : 1; /// Whether we should print the sizes of constant array expressions as written @@ -173,53 +181,67 @@ struct PrintingPolicy { /// int a[104]; /// char a[9] = "A string"; /// \endcode + LLVM_PREFERRED_TYPE(bool) unsigned ConstantArraySizeAsWritten : 1; /// When printing an anonymous tag name, also print the location of that /// entity (e.g., "enum "). Otherwise, just prints /// "(anonymous)" for the name. + LLVM_PREFERRED_TYPE(bool) unsigned AnonymousTagLocations : 1; /// When true, suppress printing of the __strong lifetime qualifier in ARC. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressStrongLifetime : 1; /// When true, suppress printing of lifetime qualifier in ARC. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressLifetimeQualifiers : 1; /// When true, suppresses printing template arguments in names of C++ /// constructors. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressTemplateArgsInCXXConstructors : 1; /// When true, attempt to suppress template arguments that match the default /// argument for the parameter. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressDefaultTemplateArgs : 1; /// Whether we can use 'bool' rather than '_Bool' (even if the language /// doesn't actually have 'bool', because, e.g., it is defined as a macro). + LLVM_PREFERRED_TYPE(bool) unsigned Bool : 1; /// Whether we should use 'nullptr' rather than '0' as a null pointer /// constant. + LLVM_PREFERRED_TYPE(bool) unsigned Nullptr : 1; /// Whether 'nullptr_t' is in namespace 'std' or not. + LLVM_PREFERRED_TYPE(bool) unsigned NullptrTypeInNamespace : 1; /// Whether we can use 'restrict' rather than '__restrict'. + LLVM_PREFERRED_TYPE(bool) unsigned Restrict : 1; /// Whether we can use 'alignof' rather than '__alignof'. + LLVM_PREFERRED_TYPE(bool) unsigned Alignof : 1; /// Whether we can use '_Alignof' rather than '__alignof'. + LLVM_PREFERRED_TYPE(bool) unsigned UnderscoreAlignof : 1; /// Whether we should use '(void)' rather than '()' for a function prototype /// with zero parameters. + LLVM_PREFERRED_TYPE(bool) unsigned UseVoidForZeroParams : 1; /// Whether nested templates must be closed like 'a\ \>' rather than /// 'a\\>'. + LLVM_PREFERRED_TYPE(bool) unsigned SplitTemplateClosers : 1; /// Provide a 'terse' output. @@ -227,27 +249,33 @@ struct PrintingPolicy { /// For example, in this mode we don't print function bodies, class members, /// declarations inside namespaces etc. Effectively, this should print /// only the requested declaration. + LLVM_PREFERRED_TYPE(bool) unsigned TerseOutput : 1; /// When true, do certain refinement needed for producing proper declaration /// tag; such as, do not print attributes attached to the declaration. /// + LLVM_PREFERRED_TYPE(bool) unsigned PolishForDeclaration : 1; /// When true, print the half-precision floating-point type as 'half' /// instead of '__fp16' + LLVM_PREFERRED_TYPE(bool) unsigned Half : 1; /// When true, print the built-in wchar_t type as __wchar_t. For use in /// Microsoft mode when wchar_t is not available. + LLVM_PREFERRED_TYPE(bool) unsigned MSWChar : 1; /// When true, include newlines after statements like "break", etc. + LLVM_PREFERRED_TYPE(bool) unsigned IncludeNewlines : 1; /// Use whitespace and punctuation like MSVC does. In particular, this prints /// anonymous namespaces as `anonymous namespace' and does not insert spaces /// after template arguments. + LLVM_PREFERRED_TYPE(bool) unsigned MSVCFormatting : 1; /// Whether we should print the constant expressions as written in the @@ -266,42 +294,52 @@ struct PrintingPolicy { /// 0x10 /// 2.5e3 /// \endcode + LLVM_PREFERRED_TYPE(bool) unsigned ConstantsAsWritten : 1; /// When true, don't print the implicit 'self' or 'this' expressions. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressImplicitBase : 1; /// When true, print the fully qualified name of function declarations. /// This is the opposite of SuppressScope and thus overrules it. + LLVM_PREFERRED_TYPE(bool) unsigned FullyQualifiedName : 1; /// Whether to print types as written or canonically. + LLVM_PREFERRED_TYPE(bool) unsigned PrintCanonicalTypes : 1; /// Whether to print an InjectedClassNameType with template arguments or as /// written. When a template argument is unnamed, printing it results in /// invalid C++ code. + LLVM_PREFERRED_TYPE(bool) unsigned PrintInjectedClassNameWithArguments : 1; /// Whether to use C++ template preferred_name attributes when printing /// templates. + LLVM_PREFERRED_TYPE(bool) unsigned UsePreferredNames : 1; /// Whether to use type suffixes (eg: 1U) on integral non-type template /// parameters. + LLVM_PREFERRED_TYPE(bool) unsigned AlwaysIncludeTypeForTemplateArgument : 1; /// Whether to strip underscores when printing reserved parameter names. /// e.g. std::vector becomes std::vector. /// This only affects parameter names, and so describes a compatible API. + LLVM_PREFERRED_TYPE(bool) unsigned CleanUglifiedParameters : 1; /// Whether to print the entire array initializers, especially on non-type /// template parameters, no matter how many elements there are. + LLVM_PREFERRED_TYPE(bool) unsigned EntireContentsOfLargeArray : 1; /// Whether to print enumerator non-type template parameters with a matching /// enumerator name or via cast of an integer. + LLVM_PREFERRED_TYPE(bool) unsigned UseEnumerators : 1; /// Callbacks to use to allow the behavior of printing to be customized. diff --git a/contrib/llvm-project/clang/include/clang/AST/PropertiesBase.td b/contrib/llvm-project/clang/include/clang/AST/PropertiesBase.td index c6fe790e1964..d86c4eba6a22 100644 --- a/contrib/llvm-project/clang/include/clang/AST/PropertiesBase.td +++ b/contrib/llvm-project/clang/include/clang/AST/PropertiesBase.td @@ -74,7 +74,7 @@ def APInt : PropertyType<"llvm::APInt"> { let PassByReference = 1; } def APSInt : PropertyType<"llvm::APSInt"> { let PassByReference = 1; } def APValue : PropertyType { let PassByReference = 1; } def APValueKind : EnumPropertyType<"APValue::ValueKind">; -def ArraySizeModifier : EnumPropertyType<"ArrayType::ArraySizeModifier">; +def ArraySizeModifier : EnumPropertyType<"ArraySizeModifier">; def AttrKind : EnumPropertyType<"attr::Kind">; def AutoTypeKeyword : EnumPropertyType; def Bool : PropertyType<"bool">; @@ -142,7 +142,7 @@ def TypeOfKind : EnumPropertyType<"TypeOfKind">; def UInt32 : CountPropertyType<"uint32_t">; def UInt64 : CountPropertyType<"uint64_t">; def UnaryTypeTransformKind : EnumPropertyType<"UnaryTransformType::UTTKind">; -def VectorKind : EnumPropertyType<"VectorType::VectorKind">; +def VectorKind : EnumPropertyType<"VectorKind">; def ExceptionSpecInfo : PropertyType<"FunctionProtoType::ExceptionSpecInfo"> { let BufferElementTypes = [ QualType ]; diff --git a/contrib/llvm-project/clang/include/clang/AST/RawCommentList.h b/contrib/llvm-project/clang/include/clang/AST/RawCommentList.h index 2f44a77d4503..53aae24fa7bb 100644 --- a/contrib/llvm-project/clang/include/clang/AST/RawCommentList.h +++ b/contrib/llvm-project/clang/include/clang/AST/RawCommentList.h @@ -178,6 +178,7 @@ private: mutable bool RawTextValid : 1; ///< True if RawText is valid mutable bool BriefTextValid : 1; ///< True if BriefText is valid + LLVM_PREFERRED_TYPE(CommentKind) unsigned Kind : 3; /// True if comment is attached to a declaration in ASTContext. diff --git a/contrib/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h b/contrib/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h index 604875cd6337..c501801b95bd 100644 --- a/contrib/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h +++ b/contrib/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h @@ -312,6 +312,13 @@ public: /// \returns false if the visitation was terminated early, true otherwise. bool TraverseObjCProtocolLoc(ObjCProtocolLoc ProtocolLoc); + /// Recursively visit concept reference with location information. + /// + /// \returns false if the visitation was terminated early, true otherwise. + bool TraverseConceptReference(ConceptReference *CR); + + // Visit concept reference. + bool VisitConceptReference(ConceptReference *CR) { return true; } // ---- Methods on Attrs ---- // Visit an attribute. @@ -469,9 +476,6 @@ public: private: // These are helper methods used by more than one Traverse* method. bool TraverseTemplateParameterListHelper(TemplateParameterList *TPL); - /// Traverses the qualifier, name and template arguments of a concept - /// reference. - bool TraverseConceptReferenceHelper(const ConceptReference &C); // Traverses template parameter lists of either a DeclaratorDecl or TagDecl. template @@ -507,7 +511,7 @@ template bool RecursiveASTVisitor::TraverseTypeConstraint( const TypeConstraint *C) { if (!getDerived().shouldVisitImplicitCode()) { - TRY_TO(TraverseConceptReferenceHelper(*C)); + TRY_TO(TraverseConceptReference(C->getConceptReference())); return true; } if (Expr *IDC = C->getImmediatelyDeclaredConstraint()) { @@ -517,7 +521,7 @@ bool RecursiveASTVisitor::TraverseTypeConstraint( // if we have an immediately-declared-constraint, otherwise // we'll end up visiting the concept and the arguments in // the TC twice. - TRY_TO(TraverseConceptReferenceHelper(*C)); + TRY_TO(TraverseConceptReference(C->getConceptReference())); } return true; } @@ -540,18 +544,6 @@ bool RecursiveASTVisitor::TraverseConceptRequirement( llvm_unreachable("unexpected case"); } -template -bool RecursiveASTVisitor::TraverseConceptReferenceHelper( - const ConceptReference &C) { - TRY_TO(TraverseNestedNameSpecifierLoc(C.getNestedNameSpecifierLoc())); - TRY_TO(TraverseDeclarationNameInfo(C.getConceptNameInfo())); - if (C.hasExplicitTemplateArgs()) - TRY_TO(TraverseTemplateArgumentLocsHelper( - C.getTemplateArgsAsWritten()->getTemplateArgs(), - C.getTemplateArgsAsWritten()->NumTemplateArgs)); - return true; -} - template bool RecursiveASTVisitor::dataTraverseNode(Stmt *S, DataRecursionQueue *Queue) { @@ -1356,10 +1348,7 @@ DEF_TRAVERSE_TYPELOC(UnaryTransformType, { DEF_TRAVERSE_TYPELOC(AutoType, { TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType())); if (TL.isConstrained()) { - TRY_TO(TraverseNestedNameSpecifierLoc(TL.getNestedNameSpecifierLoc())); - TRY_TO(TraverseDeclarationNameInfo(TL.getConceptNameInfo())); - for (unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) - TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(I))); + TRY_TO(TraverseConceptReference(TL.getConceptReference())); } }) @@ -1574,16 +1563,6 @@ DEF_TRAVERSE_DECL(FriendTemplateDecl, { } }) -DEF_TRAVERSE_DECL(ClassScopeFunctionSpecializationDecl, { - TRY_TO(TraverseDecl(D->getSpecialization())); - - if (D->hasExplicitTemplateArgs()) { - TRY_TO(TraverseTemplateArgumentLocsHelper( - D->getTemplateArgsAsWritten()->getTemplateArgs(), - D->getTemplateArgsAsWritten()->NumTemplateArgs)); - } -}) - DEF_TRAVERSE_DECL(LinkageSpecDecl, {}) DEF_TRAVERSE_DECL(ExportDecl, {}) @@ -2124,7 +2103,7 @@ DEF_TRAVERSE_DECL(FieldDecl, { TRY_TO(TraverseDeclaratorHelper(D)); if (D->isBitField()) TRY_TO(TraverseStmt(D->getBitWidth())); - else if (D->hasInClassInitializer()) + if (D->hasInClassInitializer()) TRY_TO(TraverseStmt(D->getInClassInitializer())); }) @@ -2165,6 +2144,13 @@ bool RecursiveASTVisitor::TraverseFunctionHelper(FunctionDecl *D) { TALI->NumTemplateArgs)); } } + } else if (const DependentFunctionTemplateSpecializationInfo *DFSI = + D->getDependentSpecializationInfo()) { + if (const ASTTemplateArgumentListInfo *TALI = + DFSI->TemplateArgumentsAsWritten) { + TRY_TO(TraverseTemplateArgumentLocsHelper(TALI->getTemplateArgs(), + TALI->NumTemplateArgs)); + } } // Visit the function type itself, which can be either @@ -2522,6 +2508,22 @@ bool RecursiveASTVisitor::TraverseObjCProtocolLoc( return true; } +template +bool RecursiveASTVisitor::TraverseConceptReference( + ConceptReference *CR) { + if (!getDerived().shouldTraversePostOrder()) + TRY_TO(VisitConceptReference(CR)); + TRY_TO(TraverseNestedNameSpecifierLoc(CR->getNestedNameSpecifierLoc())); + TRY_TO(TraverseDeclarationNameInfo(CR->getConceptNameInfo())); + if (CR->hasExplicitTemplateArgs()) + TRY_TO(TraverseTemplateArgumentLocsHelper( + CR->getTemplateArgsAsWritten()->getTemplateArgs(), + CR->getTemplateArgsAsWritten()->NumTemplateArgs)); + if (getDerived().shouldTraversePostOrder()) + TRY_TO(VisitConceptReference(CR)); + return true; +} + // If shouldVisitImplicitCode() returns false, this method traverses only the // syntactic form of InitListExpr. // If shouldVisitImplicitCode() return true, this method is called once for @@ -2903,8 +2905,9 @@ DEF_TRAVERSE_STMT(CoyieldExpr, { } }) -DEF_TRAVERSE_STMT(ConceptSpecializationExpr, - { TRY_TO(TraverseConceptReferenceHelper(*S)); }) +DEF_TRAVERSE_STMT(ConceptSpecializationExpr, { + TRY_TO(TraverseConceptReference(S->getConceptReference())); +}) DEF_TRAVERSE_STMT(RequiresExpr, { TRY_TO(TraverseDecl(S->getBody())); @@ -2980,6 +2983,9 @@ DEF_TRAVERSE_STMT(OMPSectionsDirective, DEF_TRAVERSE_STMT(OMPSectionDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) +DEF_TRAVERSE_STMT(OMPScopeDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + DEF_TRAVERSE_STMT(OMPSingleDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) @@ -3392,6 +3398,11 @@ bool RecursiveASTVisitor::VisitOMPCompareClause(OMPCompareClause *) { return true; } +template +bool RecursiveASTVisitor::VisitOMPFailClause(OMPFailClause *) { + return true; +} + template bool RecursiveASTVisitor::VisitOMPSeqCstClause(OMPSeqCstClause *) { return true; @@ -3875,6 +3886,17 @@ bool RecursiveASTVisitor::VisitOMPDoacrossClause( return true; } +template +bool RecursiveASTVisitor::VisitOMPXAttributeClause( + OMPXAttributeClause *C) { + return true; +} + +template +bool RecursiveASTVisitor::VisitOMPXBareClause(OMPXBareClause *C) { + return true; +} + // FIXME: look at the following tricky-seeming exprs to see if we // need to recurse on anything. These are ones that have methods // returning decls or qualtypes or nestednamespecifier -- though I'm diff --git a/contrib/llvm-project/clang/include/clang/AST/Stmt.h b/contrib/llvm-project/clang/include/clang/AST/Stmt.h index 87ffebc00d7b..da7b37ce0e12 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Stmt.h +++ b/contrib/llvm-project/clang/include/clang/AST/Stmt.h @@ -13,15 +13,20 @@ #ifndef LLVM_CLANG_AST_STMT_H #define LLVM_CLANG_AST_STMT_H +#include "clang/AST/APValue.h" #include "clang/AST/DeclGroup.h" #include "clang/AST/DependenceFlags.h" +#include "clang/AST/OperationKinds.h" #include "clang/AST/StmtIterator.h" #include "clang/Basic/CapturedStmt.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" +#include "clang/Basic/Lambda.h" #include "clang/Basic/LangOptions.h" +#include "clang/Basic/OperatorKinds.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/Specifiers.h" +#include "clang/Basic/TypeTraits.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/BitmaskEnum.h" @@ -62,6 +67,13 @@ class SourceManager; class StringLiteral; class Token; class VarDecl; +enum class CharacterLiteralKind; +enum class ConstantResultStorageKind; +enum class CXXConstructionKind; +enum class CXXNewInitializationStyle; +enum class PredefinedIdentKind; +enum class SourceLocIdentKind; +enum class StringLiteralKind; //===----------------------------------------------------------------------===// // AST classes for statements. @@ -103,6 +115,7 @@ protected: friend class Stmt; /// The statement class. + LLVM_PREFERRED_TYPE(StmtClass) unsigned sClass : 8; }; enum { NumStmtBits = 8 }; @@ -112,6 +125,7 @@ protected: friend class ASTStmtWriter; friend class NullStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// True if the null statement was preceded by an empty macro, e.g: @@ -119,6 +133,7 @@ protected: /// #define CALL(x) /// CALL(0); /// @endcode + LLVM_PREFERRED_TYPE(bool) unsigned HasLeadingEmptyMacro : 1; /// The location of the semi-colon. @@ -129,10 +144,12 @@ protected: friend class ASTStmtReader; friend class CompoundStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// True if the compound statement has one or more pragmas that set some /// floating-point features. + LLVM_PREFERRED_TYPE(bool) unsigned HasFPFeatures : 1; unsigned NumStmts; @@ -141,6 +158,7 @@ protected: class LabelStmtBitfields { friend class LabelStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; SourceLocation IdentLoc; @@ -150,6 +168,7 @@ protected: friend class ASTStmtReader; friend class AttributedStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// Number of attributes. @@ -163,18 +182,23 @@ protected: friend class ASTStmtReader; friend class IfStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// Whether this is a constexpr if, or a consteval if, or neither. + LLVM_PREFERRED_TYPE(IfStatementKind) unsigned Kind : 3; /// True if this if statement has storage for an else statement. + LLVM_PREFERRED_TYPE(bool) unsigned HasElse : 1; /// True if this if statement has storage for a variable declaration. + LLVM_PREFERRED_TYPE(bool) unsigned HasVar : 1; /// True if this if statement has storage for an init statement. + LLVM_PREFERRED_TYPE(bool) unsigned HasInit : 1; /// The location of the "if". @@ -184,17 +208,21 @@ protected: class SwitchStmtBitfields { friend class SwitchStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// True if the SwitchStmt has storage for an init statement. + LLVM_PREFERRED_TYPE(bool) unsigned HasInit : 1; /// True if the SwitchStmt has storage for a condition variable. + LLVM_PREFERRED_TYPE(bool) unsigned HasVar : 1; /// If the SwitchStmt is a switch on an enum value, records whether all /// the enum values were covered by CaseStmts. The coverage information /// value is meant to be a hint for possible clients. + LLVM_PREFERRED_TYPE(bool) unsigned AllEnumCasesCovered : 1; /// The location of the "switch". @@ -205,9 +233,11 @@ protected: friend class ASTStmtReader; friend class WhileStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// True if the WhileStmt has storage for a condition variable. + LLVM_PREFERRED_TYPE(bool) unsigned HasVar : 1; /// The location of the "while". @@ -217,6 +247,7 @@ protected: class DoStmtBitfields { friend class DoStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// The location of the "do". @@ -226,6 +257,7 @@ protected: class ForStmtBitfields { friend class ForStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// The location of the "for". @@ -236,6 +268,7 @@ protected: friend class GotoStmt; friend class IndirectGotoStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// The location of the "goto". @@ -245,6 +278,7 @@ protected: class ContinueStmtBitfields { friend class ContinueStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// The location of the "continue". @@ -254,6 +288,7 @@ protected: class BreakStmtBitfields { friend class BreakStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// The location of the "break". @@ -263,9 +298,11 @@ protected: class ReturnStmtBitfields { friend class ReturnStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// True if this ReturnStmt has storage for an NRVO candidate. + LLVM_PREFERRED_TYPE(bool) unsigned HasNRVOCandidate : 1; /// The location of the "return". @@ -276,10 +313,12 @@ protected: friend class SwitchCase; friend class CaseStmt; + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; /// Used by CaseStmt to store whether it is a case statement /// of the form case LHS ... RHS (a GNU extension). + LLVM_PREFERRED_TYPE(bool) unsigned CaseStmtIsGNURange : 1; /// The location of the "case" or "default" keyword. @@ -312,11 +351,15 @@ protected: friend class PseudoObjectExpr; // ctor friend class ShuffleVectorExpr; // ctor + LLVM_PREFERRED_TYPE(StmtBitfields) unsigned : NumStmtBits; + LLVM_PREFERRED_TYPE(ExprValueKind) unsigned ValueKind : 2; + LLVM_PREFERRED_TYPE(ExprObjectKind) unsigned ObjectKind : 3; - unsigned /*ExprDependence*/ Dependent : llvm::BitWidth; + LLVM_PREFERRED_TYPE(ExprDependence) + unsigned Dependent : llvm::BitWidth; }; enum { NumExprBits = NumStmtBits + 5 + llvm::BitWidth }; @@ -325,28 +368,35 @@ protected: friend class ASTStmtWriter; friend class ConstantExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The kind of result that is tail-allocated. + LLVM_PREFERRED_TYPE(ConstantResultStorageKind) unsigned ResultKind : 2; - /// The kind of Result as defined by APValue::Kind. + /// The kind of Result as defined by APValue::ValueKind. + LLVM_PREFERRED_TYPE(APValue::ValueKind) unsigned APValueKind : 4; - /// When ResultKind == RSK_Int64, true if the tail-allocated integer is - /// unsigned. + /// When ResultKind == ConstantResultStorageKind::Int64, true if the + /// tail-allocated integer is unsigned. + LLVM_PREFERRED_TYPE(bool) unsigned IsUnsigned : 1; - /// When ResultKind == RSK_Int64. the BitWidth of the tail-allocated - /// integer. 7 bits because it is the minimal number of bits to represent a - /// value from 0 to 64 (the size of the tail-allocated integer). + /// When ResultKind == ConstantResultStorageKind::Int64. the BitWidth of the + /// tail-allocated integer. 7 bits because it is the minimal number of bits + /// to represent a value from 0 to 64 (the size of the tail-allocated + /// integer). unsigned BitWidth : 7; - /// When ResultKind == RSK_APValue, true if the ASTContext will cleanup the - /// tail-allocated APValue. + /// When ResultKind == ConstantResultStorageKind::APValue, true if the + /// ASTContext will cleanup the tail-allocated APValue. + LLVM_PREFERRED_TYPE(bool) unsigned HasCleanup : 1; /// True if this ConstantExpr was created for immediate invocation. + LLVM_PREFERRED_TYPE(bool) unsigned IsImmediateInvocation : 1; }; @@ -354,18 +404,20 @@ protected: friend class ASTStmtReader; friend class PredefinedExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; - /// The kind of this PredefinedExpr. One of the enumeration values - /// in PredefinedExpr::IdentKind. + LLVM_PREFERRED_TYPE(PredefinedIdentKind) unsigned Kind : 4; /// True if this PredefinedExpr has a trailing "StringLiteral *" /// for the predefined identifier. + LLVM_PREFERRED_TYPE(bool) unsigned HasFunctionName : 1; /// True if this PredefinedExpr should be treated as a StringLiteral (for /// MSVC compatibility). + LLVM_PREFERRED_TYPE(bool) unsigned IsTransparent : 1; /// The location of this PredefinedExpr. @@ -376,14 +428,24 @@ protected: friend class ASTStmtReader; // deserialization friend class DeclRefExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(bool) unsigned HasQualifier : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HasTemplateKWAndArgsInfo : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HasFoundDecl : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HadMultipleCandidates : 1; + LLVM_PREFERRED_TYPE(bool) unsigned RefersToEnclosingVariableOrCapture : 1; + LLVM_PREFERRED_TYPE(bool) + unsigned CapturedByCopyInLambdaWithExplicitObjectParameter : 1; + LLVM_PREFERRED_TYPE(NonOdrUseReason) unsigned NonOdrUseReason : 2; + LLVM_PREFERRED_TYPE(bool) unsigned IsImmediateEscalating : 1; /// The location of the declaration name itself. @@ -394,12 +456,15 @@ protected: class FloatingLiteralBitfields { friend class FloatingLiteral; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; static_assert( llvm::APFloat::S_MaxSemantics < 16, "Too many Semantics enum values to fit in bitfield of size 4"); + LLVM_PREFERRED_TYPE(llvm::APFloat::Semantics) unsigned Semantics : 4; // Provides semantics for APFloat construction + LLVM_PREFERRED_TYPE(bool) unsigned IsExact : 1; }; @@ -407,10 +472,12 @@ protected: friend class ASTStmtReader; friend class StringLiteral; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The kind of this string literal. /// One of the enumeration values of StringLiteral::StringKind. + LLVM_PREFERRED_TYPE(StringLiteralKind) unsigned Kind : 3; /// The width of a single character in bytes. Only values of 1, 2, @@ -418,6 +485,7 @@ protected: /// the target + string kind to the appropriate CharByteWidth. unsigned CharByteWidth : 3; + LLVM_PREFERRED_TYPE(bool) unsigned IsPascal : 1; /// The number of concatenated token this string is made of. @@ -428,22 +496,28 @@ protected: class CharacterLiteralBitfields { friend class CharacterLiteral; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(CharacterLiteralKind) unsigned Kind : 3; }; class UnaryOperatorBitfields { friend class UnaryOperator; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(UnaryOperatorKind) unsigned Opc : 5; + LLVM_PREFERRED_TYPE(bool) unsigned CanOverflow : 1; // /// This is only meaningful for operations on floating point /// types when additional values need to be in trailing storage. /// It is 0 otherwise. + LLVM_PREFERRED_TYPE(bool) unsigned HasFPFeatures : 1; SourceLocation Loc; @@ -452,9 +526,12 @@ protected: class UnaryExprOrTypeTraitExprBitfields { friend class UnaryExprOrTypeTraitExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(UnaryExprOrTypeTrait) unsigned Kind : 3; + LLVM_PREFERRED_TYPE(bool) unsigned IsType : 1; // true if operand is a type, false if an expression. }; @@ -462,6 +539,7 @@ protected: friend class ArraySubscriptExpr; friend class MatrixSubscriptExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; SourceLocation RBracketLoc; @@ -470,14 +548,17 @@ protected: class CallExprBitfields { friend class CallExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; unsigned NumPreArgs : 1; /// True if the callee of the call expression was found using ADL. + LLVM_PREFERRED_TYPE(bool) unsigned UsesADL : 1; /// True if the call expression has some floating-point features. + LLVM_PREFERRED_TYPE(bool) unsigned HasFPFeatures : 1; /// Padding used to align OffsetToTrailingObjects to a byte multiple. @@ -494,15 +575,18 @@ protected: friend class ASTStmtReader; friend class MemberExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// IsArrow - True if this is "X->F", false if this is "X.F". + LLVM_PREFERRED_TYPE(bool) unsigned IsArrow : 1; /// True if this member expression used a nested-name-specifier to /// refer to the member, e.g., "x->Base::f", or found its member via /// a using declaration. When true, a MemberExprNameQualifier /// structure is allocated immediately after the MemberExpr. + LLVM_PREFERRED_TYPE(bool) unsigned HasQualifierOrFoundDecl : 1; /// True if this member expression specified a template keyword @@ -510,15 +594,18 @@ protected: /// x->template f, x->template f. /// When true, an ASTTemplateKWAndArgsInfo structure and its /// TemplateArguments (if any) are present. + LLVM_PREFERRED_TYPE(bool) unsigned HasTemplateKWAndArgsInfo : 1; /// True if this member expression refers to a method that /// was resolved from an overloaded set having size greater than 1. + LLVM_PREFERRED_TYPE(bool) unsigned HadMultipleCandidates : 1; /// Value of type NonOdrUseReason indicating why this MemberExpr does /// not constitute an odr-use of the named declaration. Meaningful only /// when naming a static member. + LLVM_PREFERRED_TYPE(NonOdrUseReason) unsigned NonOdrUseReason : 2; /// This is the location of the -> or . in the expression. @@ -529,12 +616,16 @@ protected: friend class CastExpr; friend class ImplicitCastExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(CastKind) unsigned Kind : 7; + LLVM_PREFERRED_TYPE(bool) unsigned PartOfExplicitCast : 1; // Only set for ImplicitCastExpr. /// True if the call expression has some floating-point features. + LLVM_PREFERRED_TYPE(bool) unsigned HasFPFeatures : 1; /// The number of CXXBaseSpecifiers in the cast. 14 bits would be enough @@ -545,13 +636,16 @@ protected: class BinaryOperatorBitfields { friend class BinaryOperator; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(BinaryOperatorKind) unsigned Opc : 6; /// This is only meaningful for operations on floating point /// types when additional values need to be in trailing storage. /// It is 0 otherwise. + LLVM_PREFERRED_TYPE(bool) unsigned HasFPFeatures : 1; SourceLocation OpLoc; @@ -560,10 +654,12 @@ protected: class InitListExprBitfields { friend class InitListExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Whether this initializer list originally had a GNU array-range /// designator in it. This is a temporary marker used by CodeGen. + LLVM_PREFERRED_TYPE(bool) unsigned HadArrayRangeDesignator : 1; }; @@ -571,6 +667,7 @@ protected: friend class ASTStmtReader; friend class ParenListExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The number of expressions in the paren list. @@ -581,6 +678,7 @@ protected: friend class ASTStmtReader; friend class GenericSelectionExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The location of the "_Generic". @@ -591,6 +689,7 @@ protected: friend class ASTStmtReader; // deserialization friend class PseudoObjectExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; unsigned NumSubExprs : 16; @@ -601,10 +700,12 @@ protected: friend class ASTStmtReader; friend class SourceLocExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The kind of source location builtin represented by the SourceLocExpr. /// Ex. __builtin_LINE, __builtin_FUNCTION, etc. + LLVM_PREFERRED_TYPE(SourceLocIdentKind) unsigned Kind : 3; }; @@ -612,6 +713,7 @@ protected: friend class ASTStmtReader; friend class StmtExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The number of levels of template parameters enclosing this statement @@ -626,10 +728,12 @@ protected: friend class ASTStmtReader; friend class CXXOperatorCallExpr; + LLVM_PREFERRED_TYPE(CallExprBitfields) unsigned : NumCallExprBits; /// The kind of this overloaded operator. One of the enumerator /// value of OverloadedOperatorKind. + LLVM_PREFERRED_TYPE(OverloadedOperatorKind) unsigned OperatorKind : 6; }; @@ -637,17 +741,21 @@ protected: friend class ASTStmtReader; friend class CXXRewrittenBinaryOperator; + LLVM_PREFERRED_TYPE(CallExprBitfields) unsigned : NumCallExprBits; + LLVM_PREFERRED_TYPE(bool) unsigned IsReversed : 1; }; class CXXBoolLiteralExprBitfields { friend class CXXBoolLiteralExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The value of the boolean literal. + LLVM_PREFERRED_TYPE(bool) unsigned Value : 1; /// The location of the boolean literal. @@ -657,6 +765,7 @@ protected: class CXXNullPtrLiteralExprBitfields { friend class CXXNullPtrLiteralExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The location of the null pointer literal. @@ -666,9 +775,11 @@ protected: class CXXThisExprBitfields { friend class CXXThisExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Whether this is an implicit "this". + LLVM_PREFERRED_TYPE(bool) unsigned IsImplicit : 1; /// The location of the "this". @@ -679,9 +790,11 @@ protected: friend class ASTStmtReader; friend class CXXThrowExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Whether the thrown variable (if any) is in scope. + LLVM_PREFERRED_TYPE(bool) unsigned IsThrownVariableInScope : 1; /// The location of the "throw". @@ -692,9 +805,11 @@ protected: friend class ASTStmtReader; friend class CXXDefaultArgExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Whether this CXXDefaultArgExpr rewrote its argument and stores a copy. + LLVM_PREFERRED_TYPE(bool) unsigned HasRewrittenInit : 1; /// The location where the default argument expression was used. @@ -705,10 +820,12 @@ protected: friend class ASTStmtReader; friend class CXXDefaultInitExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Whether this CXXDefaultInitExprBitfields rewrote its argument and stores /// a copy. + LLVM_PREFERRED_TYPE(bool) unsigned HasRewrittenInit : 1; /// The location where the default initializer expression was used. @@ -719,6 +836,7 @@ protected: friend class ASTStmtReader; friend class CXXScalarValueInitExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; SourceLocation RParenLoc; @@ -729,28 +847,35 @@ protected: friend class ASTStmtWriter; friend class CXXNewExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Was the usage ::new, i.e. is the global new to be used? + LLVM_PREFERRED_TYPE(bool) unsigned IsGlobalNew : 1; /// Do we allocate an array? If so, the first trailing "Stmt *" is the /// size expression. + LLVM_PREFERRED_TYPE(bool) unsigned IsArray : 1; /// Should the alignment be passed to the allocation function? + LLVM_PREFERRED_TYPE(bool) unsigned ShouldPassAlignment : 1; /// If this is an array allocation, does the usual deallocation /// function for the allocated type want to know the allocated size? + LLVM_PREFERRED_TYPE(bool) unsigned UsualArrayDeleteWantsSize : 1; /// What kind of initializer do we have? Could be none, parens, or braces. /// In storage, we distinguish between "none, and no initializer expr", and /// "none, but an implicit initializer expr". + LLVM_PREFERRED_TYPE(CXXNewInitializationStyle) unsigned StoredInitializationStyle : 2; /// True if the allocated type was expressed as a parenthesized type-id. + LLVM_PREFERRED_TYPE(bool) unsigned IsParenTypeId : 1; /// The number of placement new arguments. @@ -761,21 +886,26 @@ protected: friend class ASTStmtReader; friend class CXXDeleteExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Is this a forced global delete, i.e. "::delete"? + LLVM_PREFERRED_TYPE(bool) unsigned GlobalDelete : 1; /// Is this the array form of delete, i.e. "delete[]"? + LLVM_PREFERRED_TYPE(bool) unsigned ArrayForm : 1; /// ArrayFormAsWritten can be different from ArrayForm if 'delete' is /// applied to pointer-to-array type (ArrayFormAsWritten will be false /// while ArrayForm will be true). + LLVM_PREFERRED_TYPE(bool) unsigned ArrayFormAsWritten : 1; /// Does the usual deallocation function for the element type require /// a size_t argument? + LLVM_PREFERRED_TYPE(bool) unsigned UsualArrayDeleteWantsSize : 1; /// Location of the expression. @@ -787,13 +917,16 @@ protected: friend class ASTStmtWriter; friend class TypeTraitExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The kind of type trait, which is a value of a TypeTrait enumerator. + LLVM_PREFERRED_TYPE(TypeTrait) unsigned Kind : 8; /// If this expression is not value-dependent, this indicates whether /// the trait evaluated true or false. + LLVM_PREFERRED_TYPE(bool) unsigned Value : 1; /// The number of arguments to this type trait. According to [implimits] @@ -807,10 +940,12 @@ protected: friend class ASTStmtWriter; friend class DependentScopeDeclRefExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Whether the name includes info for explicit template /// keyword and arguments. + LLVM_PREFERRED_TYPE(bool) unsigned HasTemplateKWAndArgsInfo : 1; }; @@ -818,14 +953,22 @@ protected: friend class ASTStmtReader; friend class CXXConstructExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(bool) unsigned Elidable : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HadMultipleCandidates : 1; + LLVM_PREFERRED_TYPE(bool) unsigned ListInitialization : 1; + LLVM_PREFERRED_TYPE(bool) unsigned StdInitListInitialization : 1; + LLVM_PREFERRED_TYPE(bool) unsigned ZeroInitialization : 1; + LLVM_PREFERRED_TYPE(CXXConstructionKind) unsigned ConstructionKind : 3; + LLVM_PREFERRED_TYPE(bool) unsigned IsImmediateEscalating : 1; SourceLocation Loc; @@ -835,9 +978,11 @@ protected: friend class ASTStmtReader; // deserialization friend class ExprWithCleanups; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; // When false, it must not have side effects. + LLVM_PREFERRED_TYPE(bool) unsigned CleanupsHaveSideEffects : 1; unsigned NumObjects : 32 - 1 - NumExprBits; @@ -847,6 +992,7 @@ protected: friend class ASTStmtReader; friend class CXXUnresolvedConstructExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The number of arguments used to construct the type. @@ -857,18 +1003,22 @@ protected: friend class ASTStmtReader; friend class CXXDependentScopeMemberExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Whether this member expression used the '->' operator or /// the '.' operator. + LLVM_PREFERRED_TYPE(bool) unsigned IsArrow : 1; /// Whether this member expression has info for explicit template /// keyword and arguments. + LLVM_PREFERRED_TYPE(bool) unsigned HasTemplateKWAndArgsInfo : 1; /// See getFirstQualifierFoundInScope() and the comment listing /// the trailing objects. + LLVM_PREFERRED_TYPE(bool) unsigned HasFirstQualifierFoundInScope : 1; /// The location of the '->' or '.' operator. @@ -879,10 +1029,12 @@ protected: friend class ASTStmtReader; friend class OverloadExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// Whether the name includes info for explicit template /// keyword and arguments. + LLVM_PREFERRED_TYPE(bool) unsigned HasTemplateKWAndArgsInfo : 1; /// Padding used by the derived classes to store various bits. If you @@ -899,14 +1051,17 @@ protected: friend class ASTStmtReader; friend class UnresolvedLookupExpr; + LLVM_PREFERRED_TYPE(OverloadExprBitfields) unsigned : NumOverloadExprBits; /// True if these lookup results should be extended by /// argument-dependent lookup if this is the operand of a function call. + LLVM_PREFERRED_TYPE(bool) unsigned RequiresADL : 1; /// True if these lookup results are overloaded. This is pretty trivially /// rederivable if we urgently need to kill this field. + LLVM_PREFERRED_TYPE(bool) unsigned Overloaded : 1; }; static_assert(sizeof(UnresolvedLookupExprBitfields) <= 4, @@ -917,13 +1072,16 @@ protected: friend class ASTStmtReader; friend class UnresolvedMemberExpr; + LLVM_PREFERRED_TYPE(OverloadExprBitfields) unsigned : NumOverloadExprBits; /// Whether this member expression used the '->' operator or /// the '.' operator. + LLVM_PREFERRED_TYPE(bool) unsigned IsArrow : 1; /// Whether the lookup results contain an unresolved using declaration. + LLVM_PREFERRED_TYPE(bool) unsigned HasUnresolvedUsing : 1; }; static_assert(sizeof(UnresolvedMemberExprBitfields) <= 4, @@ -934,8 +1092,10 @@ protected: friend class ASTStmtReader; friend class CXXNoexceptExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(bool) unsigned Value : 1; }; @@ -943,6 +1103,7 @@ protected: friend class ASTStmtReader; friend class SubstNonTypeTemplateParmExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The location of the non-type template parameter reference. @@ -954,17 +1115,21 @@ protected: friend class ASTStmtWriter; friend class LambdaExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The default capture kind, which is a value of type /// LambdaCaptureDefault. + LLVM_PREFERRED_TYPE(LambdaCaptureDefault) unsigned CaptureDefault : 2; /// Whether this lambda had an explicit parameter list vs. an /// implicit (and empty) parameter list. + LLVM_PREFERRED_TYPE(bool) unsigned ExplicitParams : 1; /// Whether this lambda had the result type explicitly specified. + LLVM_PREFERRED_TYPE(bool) unsigned ExplicitResultType : 1; /// The number of captures. @@ -976,8 +1141,10 @@ protected: friend class ASTStmtWriter; friend class RequiresExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(bool) unsigned IsSatisfied : 1; SourceLocation RequiresKWLoc; }; @@ -987,8 +1154,10 @@ protected: class CoawaitExprBitfields { friend class CoawaitExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(bool) unsigned IsImplicit : 1; }; @@ -997,8 +1166,10 @@ protected: class ObjCIndirectCopyRestoreExprBitfields { friend class ObjCIndirectCopyRestoreExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; + LLVM_PREFERRED_TYPE(bool) unsigned ShouldCopy : 1; }; @@ -1008,10 +1179,12 @@ protected: friend class ASTStmtReader; friend class OpaqueValueExpr; + LLVM_PREFERRED_TYPE(ExprBitfields) unsigned : NumExprBits; /// The OVE is a unique semantic reference to its source expression if this /// bit is set to true. + LLVM_PREFERRED_TYPE(bool) unsigned IsUnique : 1; SourceLocation Loc; diff --git a/contrib/llvm-project/clang/include/clang/AST/StmtOpenMP.h b/contrib/llvm-project/clang/include/clang/AST/StmtOpenMP.h index 2d37fdbf4ca8..621643391535 100644 --- a/contrib/llvm-project/clang/include/clang/AST/StmtOpenMP.h +++ b/contrib/llvm-project/clang/include/clang/AST/StmtOpenMP.h @@ -281,6 +281,15 @@ class OMPExecutableDirective : public Stmt { return Data->getClauses(); } + /// Was this directive mapped from an another directive? + /// e.g. 1) omp loop bind(parallel) is mapped to OMPD_for + /// 2) omp loop bind(teams) is mapped to OMPD_distribute + /// 3) omp loop bind(thread) is mapped to OMPD_simd + /// It was necessary to note it down in the Directive because of + /// clang::TreeTransform::TransformOMPExecutableDirective() pass in + /// the frontend. + OpenMPDirectiveKind PrevMappedDirective = llvm::omp::OMPD_unknown; + protected: /// Data, associated with the directive. OMPChildren *Data = nullptr; @@ -345,6 +354,10 @@ protected: return Inst; } + void setMappedDirective(OpenMPDirectiveKind MappedDirective) { + PrevMappedDirective = MappedDirective; + } + public: /// Iterates over expressions/statements used in the construct. class used_clauses_child_iterator @@ -598,6 +611,8 @@ public: "Expected directive with the associated statement."); return Data->getRawStmt(); } + + OpenMPDirectiveKind getMappedDirective() const { return PrevMappedDirective; } }; /// This represents '#pragma omp parallel' directive. @@ -979,7 +994,7 @@ public: unsigned getNumAssociatedLoops() const { return getLoopsNumber(); } /// Return the number of loops generated by this loop transformation. - unsigned getNumGeneratedLoops() { return NumGeneratedLoops; } + unsigned getNumGeneratedLoops() const { return NumGeneratedLoops; } /// Get the de-sugared statements after the loop transformation. /// @@ -1604,7 +1619,8 @@ public: SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef Clauses, Stmt *AssociatedStmt, - const HelperExprs &Exprs); + const HelperExprs &Exprs, + OpenMPDirectiveKind ParamPrevMappedDirective); /// Creates an empty directive with the place /// for \a NumClauses clauses. @@ -1682,7 +1698,8 @@ public: SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, - Expr *TaskRedRef, bool HasCancel); + Expr *TaskRedRef, bool HasCancel, + OpenMPDirectiveKind ParamPrevMappedDirective); /// Creates an empty directive with the place /// for \a NumClauses clauses. @@ -1914,6 +1931,57 @@ public: } }; +/// This represents '#pragma omp scope' directive. +/// \code +/// #pragma omp scope private(a,b) nowait +/// \endcode +/// In this example directive '#pragma omp scope' has clauses 'private' with +/// the variables 'a' and 'b' and nowait. +/// +class OMPScopeDirective final : public OMPExecutableDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// + OMPScopeDirective(SourceLocation StartLoc, SourceLocation EndLoc) + : OMPExecutableDirective(OMPScopeDirectiveClass, llvm::omp::OMPD_scope, + StartLoc, EndLoc) {} + + /// Build an empty directive. + /// + explicit OMPScopeDirective() + : OMPExecutableDirective(OMPScopeDirectiveClass, llvm::omp::OMPD_scope, + SourceLocation(), SourceLocation()) {} + +public: + /// Creates directive. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param AssociatedStmt Statement, associated with the directive. + /// + static OMPScopeDirective *Create(const ASTContext &C, SourceLocation StartLoc, + SourceLocation EndLoc, + ArrayRef Clauses, + Stmt *AssociatedStmt); + + /// Creates an empty directive. + /// + /// \param C AST context. + /// + static OMPScopeDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, EmptyShell); + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPScopeDirectiveClass; + } +}; + /// This represents '#pragma omp single' directive. /// /// \code @@ -4406,7 +4474,8 @@ public: static OMPDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef Clauses, - Stmt *AssociatedStmt, const HelperExprs &Exprs); + Stmt *AssociatedStmt, const HelperExprs &Exprs, + OpenMPDirectiveKind ParamPrevMappedDirective); /// Creates an empty directive with the place /// for \a NumClauses clauses. diff --git a/contrib/llvm-project/clang/include/clang/AST/TemplateBase.h b/contrib/llvm-project/clang/include/clang/AST/TemplateBase.h index 8e6b4d819740..b7cd71f17c94 100644 --- a/contrib/llvm-project/clang/include/clang/AST/TemplateBase.h +++ b/contrib/llvm-project/clang/include/clang/AST/TemplateBase.h @@ -103,18 +103,23 @@ private: /// The kind of template argument we're storing. struct DA { + LLVM_PREFERRED_TYPE(ArgKind) unsigned Kind : 31; + LLVM_PREFERRED_TYPE(bool) unsigned IsDefaulted : 1; void *QT; ValueDecl *D; }; struct I { + LLVM_PREFERRED_TYPE(ArgKind) unsigned Kind : 31; + LLVM_PREFERRED_TYPE(bool) unsigned IsDefaulted : 1; // We store a decomposed APSInt with the data allocated by ASTContext if // BitWidth > 64. The memory may be shared between multiple // TemplateArgument instances. unsigned BitWidth : 31; + LLVM_PREFERRED_TYPE(bool) unsigned IsUnsigned : 1; union { /// Used to store the <= 64 bits integer value. @@ -126,19 +131,25 @@ private: void *Type; }; struct A { + LLVM_PREFERRED_TYPE(ArgKind) unsigned Kind : 31; + LLVM_PREFERRED_TYPE(bool) unsigned IsDefaulted : 1; unsigned NumArgs; const TemplateArgument *Args; }; struct TA { + LLVM_PREFERRED_TYPE(ArgKind) unsigned Kind : 31; + LLVM_PREFERRED_TYPE(bool) unsigned IsDefaulted : 1; unsigned NumExpansions; void *Name; }; struct TV { + LLVM_PREFERRED_TYPE(ArgKind) unsigned Kind : 31; + LLVM_PREFERRED_TYPE(bool) unsigned IsDefaulted : 1; uintptr_t V; }; diff --git a/contrib/llvm-project/clang/include/clang/AST/TemplateName.h b/contrib/llvm-project/clang/include/clang/AST/TemplateName.h index d56361b50059..b7732e54ba10 100644 --- a/contrib/llvm-project/clang/include/clang/AST/TemplateName.h +++ b/contrib/llvm-project/clang/include/clang/AST/TemplateName.h @@ -55,7 +55,7 @@ protected: }; struct BitsTag { - /// A Kind. + LLVM_PREFERRED_TYPE(Kind) unsigned Kind : 2; // The template parameter index. diff --git a/contrib/llvm-project/clang/include/clang/AST/TextNodeDumper.h b/contrib/llvm-project/clang/include/clang/AST/TextNodeDumper.h index e8480543a3b8..2f4ed082a0c7 100644 --- a/contrib/llvm-project/clang/include/clang/AST/TextNodeDumper.h +++ b/contrib/llvm-project/clang/include/clang/AST/TextNodeDumper.h @@ -189,6 +189,8 @@ public: void Visit(const GenericSelectionExpr::ConstAssociation &A); + void Visit(const ConceptReference *); + void Visit(const concepts::Requirement *R); void Visit(const APValue &Value, QualType Ty); @@ -202,6 +204,9 @@ public: void dumpName(const NamedDecl *ND); void dumpAccessSpecifier(AccessSpecifier AS); void dumpCleanupObject(const ExprWithCleanups::CleanupObject &C); + void dumpTemplateSpecializationKind(TemplateSpecializationKind TSK); + void dumpNestedNameSpecifier(const NestedNameSpecifier *NNS); + void dumpConceptReference(const ConceptReference *R); void dumpDeclRef(const Decl *D, StringRef Label = {}); @@ -246,6 +251,7 @@ public: void VisitLabelStmt(const LabelStmt *Node); void VisitGotoStmt(const GotoStmt *Node); void VisitCaseStmt(const CaseStmt *Node); + void VisitReturnStmt(const ReturnStmt *Node); void VisitCompoundStmt(const CompoundStmt *Node); void VisitConstantExpr(const ConstantExpr *Node); void VisitCallExpr(const CallExpr *Node); @@ -253,6 +259,7 @@ public: void VisitCastExpr(const CastExpr *Node); void VisitImplicitCastExpr(const ImplicitCastExpr *Node); void VisitDeclRefExpr(const DeclRefExpr *Node); + void VisitDependentScopeDeclRefExpr(const DependentScopeDeclRefExpr *Node); void VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *Node); void VisitPredefinedExpr(const PredefinedExpr *Node); void VisitCharacterLiteral(const CharacterLiteral *Node); diff --git a/contrib/llvm-project/clang/include/clang/AST/Type.h b/contrib/llvm-project/clang/include/clang/AST/Type.h index 8d20d088bb63..b3ae66e6e769 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Type.h +++ b/contrib/llvm-project/clang/include/clang/AST/Type.h @@ -36,6 +36,7 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/PointerUnion.h" +#include "llvm/ADT/STLForwardCompat.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" #include "llvm/ADT/iterator_range.h" @@ -817,6 +818,26 @@ public: /// Determine whether this type is const-qualified. bool isConstQualified() const; + enum class NonConstantStorageReason { + MutableField, + NonConstNonReferenceType, + NonTrivialCtor, + NonTrivialDtor, + }; + /// Determine whether instances of this type can be placed in immutable + /// storage. + /// If ExcludeCtor is true, the duration when the object's constructor runs + /// will not be considered. The caller will need to verify that the object is + /// not written to during its construction. ExcludeDtor works similarly. + std::optional + isNonConstantStorage(const ASTContext &Ctx, bool ExcludeCtor, + bool ExcludeDtor); + + bool isConstantStorage(const ASTContext &Ctx, bool ExcludeCtor, + bool ExcludeDtor) { + return !isNonConstantStorage(Ctx, ExcludeCtor, ExcludeDtor); + } + /// Determine whether this particular QualType instance has the /// "restrict" qualifier set, without looking through typedefs that may have /// added "restrict" at a different level. @@ -1011,7 +1032,7 @@ public: /// type. To strip qualifiers even from within a sugared array type, use /// ASTContext::getUnqualifiedArrayType. /// - /// Note: In C, the _Atomic qualifier is special (see C2x 6.2.5p29 for + /// Note: In C, the _Atomic qualifier is special (see C23 6.2.5p32 for /// details), and it is not stripped by this function. Use /// getAtomicUnqualifiedType() to strip qualifiers including _Atomic. inline QualType getUnqualifiedType() const; @@ -1462,7 +1483,8 @@ class ExtQualsTypeCommonBase { /// in three low bits on the QualType pointer; a fourth bit records whether /// the pointer is an ExtQuals node. The extended qualifiers (address spaces, /// Objective-C GC attributes) are much more rare. -class ExtQuals : public ExtQualsTypeCommonBase, public llvm::FoldingSetNode { +class alignas(TypeAlignment) ExtQuals : public ExtQualsTypeCommonBase, + public llvm::FoldingSetNode { // NOTE: changing the fast qualifiers should be straightforward as // long as you don't make 'const' non-fast. // 1. Qualifiers: @@ -1548,6 +1570,10 @@ enum class AutoTypeKeyword { GNUAutoType }; +enum class ArraySizeModifier; +enum class ElaboratedTypeKeyword; +enum class VectorKind; + /// The base class of the type hierarchy. /// /// A central concept with types is that each type always has a canonical @@ -1574,7 +1600,7 @@ enum class AutoTypeKeyword { /// /// Types, once created, are immutable. /// -class alignas(8) Type : public ExtQualsTypeCommonBase { +class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { public: enum TypeClass { #define TYPE(Class, Base) Class, @@ -1590,22 +1616,28 @@ private: template friend class TypePropertyCache; /// TypeClass bitfield - Enum that specifies what subclass this belongs to. + LLVM_PREFERRED_TYPE(TypeClass) unsigned TC : 8; /// Store information on the type dependency. + LLVM_PREFERRED_TYPE(TypeDependence) unsigned Dependence : llvm::BitWidth; /// True if the cache (i.e. the bitfields here starting with /// 'Cache') is valid. + LLVM_PREFERRED_TYPE(bool) mutable unsigned CacheValid : 1; /// Linkage of this type. + LLVM_PREFERRED_TYPE(Linkage) mutable unsigned CachedLinkage : 3; /// Whether this type involves and local or unnamed types. + LLVM_PREFERRED_TYPE(bool) mutable unsigned CachedLocalOrUnnamed : 1; /// Whether this type comes from an AST file. + LLVM_PREFERRED_TYPE(bool) mutable unsigned FromAST : 1; bool isCacheValid() const { @@ -1631,30 +1663,36 @@ protected: class ArrayTypeBitfields { friend class ArrayType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// CVR qualifiers from declarations like /// 'int X[static restrict 4]'. For function parameters only. + LLVM_PREFERRED_TYPE(Qualifiers) unsigned IndexTypeQuals : 3; /// Storage class qualifiers from declarations like /// 'int X[static restrict 4]'. For function parameters only. - /// Actually an ArrayType::ArraySizeModifier. + LLVM_PREFERRED_TYPE(ArraySizeModifier) unsigned SizeModifier : 3; }; + enum { NumArrayTypeBits = NumTypeBits + 6 }; class ConstantArrayTypeBitfields { friend class ConstantArrayType; - unsigned : NumTypeBits + 3 + 3; + LLVM_PREFERRED_TYPE(ArrayTypeBitfields) + unsigned : NumArrayTypeBits; /// Whether we have a stored size expression. + LLVM_PREFERRED_TYPE(bool) unsigned HasStoredSizeExpr : 1; }; class BuiltinTypeBitfields { friend class BuiltinType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// The kind (BuiltinType::Kind) of builtin type this is. @@ -1669,15 +1707,18 @@ protected: friend class FunctionProtoType; friend class FunctionType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// Extra information which affects how the function is called, like /// regparm and the calling convention. + LLVM_PREFERRED_TYPE(CallingConv) unsigned ExtInfo : 13; /// The ref-qualifier associated with a \c FunctionProtoType. /// /// This is a value of type \c RefQualifierKind. + LLVM_PREFERRED_TYPE(RefQualifierKind) unsigned RefQualifier : 2; /// Used only by FunctionProtoType, put here to pack with the @@ -1686,8 +1727,10 @@ protected: /// /// C++ 8.3.5p4: The return type, the parameter type list and the /// cv-qualifier-seq, [...], are part of the function type. + LLVM_PREFERRED_TYPE(Qualifiers) unsigned FastTypeQuals : Qualifiers::FastWidth; /// Whether this function has extended Qualifiers. + LLVM_PREFERRED_TYPE(bool) unsigned HasExtQuals : 1; /// The number of parameters this function has, not counting '...'. @@ -1697,24 +1740,30 @@ protected: unsigned NumParams : 16; /// The type of exception specification this function has. + LLVM_PREFERRED_TYPE(ExceptionSpecificationType) unsigned ExceptionSpecType : 4; /// Whether this function has extended parameter information. + LLVM_PREFERRED_TYPE(bool) unsigned HasExtParameterInfos : 1; /// Whether this function has extra bitfields for the prototype. + LLVM_PREFERRED_TYPE(bool) unsigned HasExtraBitfields : 1; /// Whether the function is variadic. + LLVM_PREFERRED_TYPE(bool) unsigned Variadic : 1; /// Whether this function has a trailing return type. + LLVM_PREFERRED_TYPE(bool) unsigned HasTrailingReturn : 1; }; class ObjCObjectTypeBitfields { friend class ObjCObjectType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// The number of type arguments stored directly on this object type. @@ -1724,12 +1773,14 @@ protected: unsigned NumProtocols : 6; /// Whether this is a "kindof" type. + LLVM_PREFERRED_TYPE(bool) unsigned IsKindOf : 1; }; class ReferenceTypeBitfields { friend class ReferenceType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// True if the type was originally spelled with an lvalue sigil. @@ -1743,31 +1794,36 @@ protected: /// ref &&a; // lvalue, inner ref /// rvref &a; // lvalue, inner ref, spelled lvalue /// rvref &&a; // rvalue, inner ref + LLVM_PREFERRED_TYPE(bool) unsigned SpelledAsLValue : 1; /// True if the inner type is a reference type. This only happens /// in non-canonical forms. + LLVM_PREFERRED_TYPE(bool) unsigned InnerRef : 1; }; class TypeWithKeywordBitfields { friend class TypeWithKeyword; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// An ElaboratedTypeKeyword. 8 bits for efficient access. + LLVM_PREFERRED_TYPE(ElaboratedTypeKeyword) unsigned Keyword : 8; }; - enum { NumTypeWithKeywordBits = 8 }; + enum { NumTypeWithKeywordBits = NumTypeBits + 8 }; class ElaboratedTypeBitfields { friend class ElaboratedType; - unsigned : NumTypeBits; + LLVM_PREFERRED_TYPE(TypeWithKeywordBitfields) unsigned : NumTypeWithKeywordBits; /// Whether the ElaboratedType has a trailing OwnedTagDecl. + LLVM_PREFERRED_TYPE(bool) unsigned HasOwnedTagDecl : 1; }; @@ -1775,10 +1831,12 @@ protected: friend class VectorType; friend class DependentVectorType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// The kind of vector, either a generic vector type or some /// target-specific vector type such as for AltiVec or Neon. + LLVM_PREFERRED_TYPE(VectorKind) unsigned VecKind : 4; /// The number of elements in the vector. uint32_t NumElements; @@ -1787,19 +1845,22 @@ protected: class AttributedTypeBitfields { friend class AttributedType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; - /// An AttributedType::Kind + LLVM_PREFERRED_TYPE(attr::Kind) unsigned AttrKind : 32 - NumTypeBits; }; class AutoTypeBitfields { friend class AutoType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// Was this placeholder type spelled as 'auto', 'decltype(auto)', /// or '__auto_type'? AutoTypeKeyword value. + LLVM_PREFERRED_TYPE(AutoTypeKeyword) unsigned Keyword : 2; /// The number of template arguments in the type-constraints, which is @@ -1816,33 +1877,41 @@ protected: friend class TypeOfType; friend class TypeOfExprType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; + LLVM_PREFERRED_TYPE(bool) unsigned IsUnqual : 1; // If true: typeof_unqual, else: typeof }; class UsingBitfields { friend class UsingType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// True if the underlying type is different from the declared one. + LLVM_PREFERRED_TYPE(bool) unsigned hasTypeDifferentFromDecl : 1; }; class TypedefBitfields { friend class TypedefType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// True if the underlying type is different from the declared one. + LLVM_PREFERRED_TYPE(bool) unsigned hasTypeDifferentFromDecl : 1; }; class SubstTemplateTypeParmTypeBitfields { friend class SubstTemplateTypeParmType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; + LLVM_PREFERRED_TYPE(bool) unsigned HasNonCanonicalUnderlyingType : 1; // The index of the template parameter this substitution represents. @@ -1859,6 +1928,7 @@ protected: class SubstTemplateTypeParmPackTypeBitfields { friend class SubstTemplateTypeParmPackType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; // The index of the template parameter this substitution represents. @@ -1874,9 +1944,11 @@ protected: class TemplateSpecializationTypeBitfields { friend class TemplateSpecializationType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// Whether this template specialization type is a substituted type alias. + LLVM_PREFERRED_TYPE(bool) unsigned TypeAlias : 1; /// The number of template arguments named in this class template @@ -1892,7 +1964,7 @@ protected: class DependentTemplateSpecializationTypeBitfields { friend class DependentTemplateSpecializationType; - unsigned : NumTypeBits; + LLVM_PREFERRED_TYPE(TypeWithKeywordBitfields) unsigned : NumTypeWithKeywordBits; /// The number of template arguments named in this class template @@ -1908,6 +1980,7 @@ protected: class PackExpansionTypeBitfields { friend class PackExpansionType; + LLVM_PREFERRED_TYPE(TypeBitfields) unsigned : NumTypeBits; /// The number of expansions that this pack expansion will @@ -1962,15 +2035,16 @@ protected: Type(TypeClass tc, QualType canon, TypeDependence Dependence) : ExtQualsTypeCommonBase(this, canon.isNull() ? QualType(this_(), 0) : canon) { - static_assert(sizeof(*this) <= 8 + sizeof(ExtQualsTypeCommonBase), + static_assert(sizeof(*this) <= + alignof(decltype(*this)) + sizeof(ExtQualsTypeCommonBase), "changing bitfields changed sizeof(Type)!"); - static_assert(alignof(decltype(*this)) % sizeof(void *) == 0, + static_assert(alignof(decltype(*this)) % TypeAlignment == 0, "Insufficient alignment!"); TypeBits.TC = tc; TypeBits.Dependence = static_cast(Dependence); TypeBits.CacheValid = false; TypeBits.CachedLocalOrUnnamed = false; - TypeBits.CachedLinkage = NoLinkage; + TypeBits.CachedLinkage = llvm::to_underlying(Linkage::Invalid); TypeBits.FromAST = false; } @@ -2038,6 +2112,9 @@ public: bool isSizelessType() const; bool isSizelessBuiltinType() const; + /// Returns true for all scalable vector types. + bool isSizelessVectorType() const; + /// Returns true for SVE scalable vector types. bool isSVESizelessBuiltinType() const; @@ -2055,7 +2132,7 @@ public: /// Determines if this is a sizeless type supported by the /// 'arm_sve_vector_bits' type attribute, which can be applied to a single /// SVE vector or predicate, excluding tuple types such as svint32x4_t. - bool isVLSTBuiltinType() const; + bool isSveVLSBuiltinType() const; /// Returns the representative type for the element of an SVE builtin type. /// This is used to represent fixed-length SVE vectors created with the @@ -2264,7 +2341,7 @@ public: bool isCARCBridgableType() const; bool isTemplateTypeParmType() const; // C++ template type parameter bool isNullPtrType() const; // C++11 std::nullptr_t or - // C2x nullptr_t + // C23 nullptr_t bool isNothrowT() const; // C++ std::nothrow_t bool isAlignValT() const; // C++17 std::align_val_t bool isStdByteType() const; // C++17 std::byte @@ -2308,9 +2385,7 @@ public: bool isRVVType(unsigned ElementCount) const; - bool isRVVType() const; - - bool isRVVType(unsigned Bitwidth, bool IsFloat) const; + bool isRVVType(unsigned Bitwidth, bool IsFloat, bool IsBFloat = false) const; /// Return the implicit lifetime for this type, which must not be dependent. Qualifiers::ObjCLifetime getObjCARCImplicitLifetime() const; @@ -3059,17 +3134,14 @@ public: } }; +/// Capture whether this is a normal array (e.g. int X[4]) +/// an array with a static size (e.g. int X[static 4]), or an array +/// with a star size (e.g. int X[*]). +/// 'static' is only allowed on function parameters. +enum class ArraySizeModifier { Normal, Static, Star }; + /// Represents an array type, per C99 6.7.5.2 - Array Declarators. class ArrayType : public Type, public llvm::FoldingSetNode { -public: - /// Capture whether this is a normal array (e.g. int X[4]) - /// an array with a static size (e.g. int X[static 4]), or an array - /// with a star size (e.g. int X[*]). - /// 'static' is only allowed on function parameters. - enum ArraySizeModifier { - Normal, Static, Star - }; - private: /// The element type of the array. QualType ElementType; @@ -3144,6 +3216,8 @@ public: QualType ElementType, const llvm::APInt &NumElements); + unsigned getNumAddressingBits(const ASTContext &Context) const; + /// Determine the maximum number of active bits that an array's size /// can require, which limits the maximum size of the array. static unsigned getMaxSizeBits(const ASTContext &Context); @@ -3191,7 +3265,7 @@ public: static void Profile(llvm::FoldingSetNodeID &ID, QualType ET, ArraySizeModifier SizeMod, unsigned TypeQuals) { ID.AddPointer(ET.getAsOpaquePtr()); - ID.AddInteger(SizeMod); + ID.AddInteger(llvm::to_underlying(SizeMod)); ID.AddInteger(TypeQuals); } }; @@ -3267,8 +3341,6 @@ public: class DependentSizedArrayType : public ArrayType { friend class ASTContext; // ASTContext creates these. - const ASTContext &Context; - /// An assignment expression that will instantiate to the /// size of the array. /// @@ -3279,8 +3351,8 @@ class DependentSizedArrayType : public ArrayType { /// The range spanned by the left and right array brackets. SourceRange Brackets; - DependentSizedArrayType(const ASTContext &Context, QualType et, QualType can, - Expr *e, ArraySizeModifier sm, unsigned tq, + DependentSizedArrayType(QualType et, QualType can, Expr *e, + ArraySizeModifier sm, unsigned tq, SourceRange brackets); public: @@ -3303,7 +3375,7 @@ public: return T->getTypeClass() == DependentSizedArray; } - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getElementType(), getSizeModifier(), getIndexTypeCVRQualifiers(), getSizeExpr()); } @@ -3327,14 +3399,12 @@ public: class DependentAddressSpaceType : public Type, public llvm::FoldingSetNode { friend class ASTContext; - const ASTContext &Context; Expr *AddrSpaceExpr; QualType PointeeType; SourceLocation loc; - DependentAddressSpaceType(const ASTContext &Context, QualType PointeeType, - QualType can, Expr *AddrSpaceExpr, - SourceLocation loc); + DependentAddressSpaceType(QualType PointeeType, QualType can, + Expr *AddrSpaceExpr, SourceLocation loc); public: Expr *getAddrSpaceExpr() const { return AddrSpaceExpr; } @@ -3348,7 +3418,7 @@ public: return T->getTypeClass() == DependentAddressSpace; } - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getPointeeType(), getAddrSpaceExpr()); } @@ -3369,7 +3439,6 @@ public: class DependentSizedExtVectorType : public Type, public llvm::FoldingSetNode { friend class ASTContext; - const ASTContext &Context; Expr *SizeExpr; /// The element type of the array. @@ -3377,8 +3446,8 @@ class DependentSizedExtVectorType : public Type, public llvm::FoldingSetNode { SourceLocation loc; - DependentSizedExtVectorType(const ASTContext &Context, QualType ElementType, - QualType can, Expr *SizeExpr, SourceLocation loc); + DependentSizedExtVectorType(QualType ElementType, QualType can, + Expr *SizeExpr, SourceLocation loc); public: Expr *getSizeExpr() const { return SizeExpr; } @@ -3392,7 +3461,7 @@ public: return T->getTypeClass() == DependentSizedExtVector; } - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getElementType(), getSizeExpr()); } @@ -3400,6 +3469,34 @@ public: QualType ElementType, Expr *SizeExpr); }; +enum class VectorKind { + /// not a target-specific vector type + Generic, + + /// is AltiVec vector + AltiVecVector, + + /// is AltiVec 'vector Pixel' + AltiVecPixel, + + /// is AltiVec 'vector bool ...' + AltiVecBool, + + /// is ARM Neon vector + Neon, + + /// is ARM Neon polynomial vector + NeonPoly, + + /// is AArch64 SVE fixed-length data vector + SveFixedLengthData, + + /// is AArch64 SVE fixed-length predicate vector + SveFixedLengthPredicate, + + /// is RISC-V RVV fixed-length data vector + RVVFixedLengthData, +}; /// Represents a GCC generic vector type. This type is created using /// __attribute__((vector_size(n)), where "n" specifies the vector size in @@ -3407,36 +3504,6 @@ public: /// Since the constructor takes the number of vector elements, the /// client is responsible for converting the size into the number of elements. class VectorType : public Type, public llvm::FoldingSetNode { -public: - enum VectorKind { - /// not a target-specific vector type - GenericVector, - - /// is AltiVec vector - AltiVecVector, - - /// is AltiVec 'vector Pixel' - AltiVecPixel, - - /// is AltiVec 'vector bool ...' - AltiVecBool, - - /// is ARM Neon vector - NeonVector, - - /// is ARM Neon polynomial vector - NeonPolyVector, - - /// is AArch64 SVE fixed-length data vector - SveFixedLengthDataVector, - - /// is AArch64 SVE fixed-length predicate vector - SveFixedLengthPredicateVector, - - /// is RISC-V RVV fixed-length data vector - RVVFixedLengthDataVector, - }; - protected: friend class ASTContext; // ASTContext creates these. @@ -3471,7 +3538,7 @@ public: ID.AddPointer(ElementType.getAsOpaquePtr()); ID.AddInteger(NumElements); ID.AddInteger(TypeClass); - ID.AddInteger(VecKind); + ID.AddInteger(llvm::to_underlying(VecKind)); } static bool classof(const Type *T) { @@ -3491,21 +3558,19 @@ public: class DependentVectorType : public Type, public llvm::FoldingSetNode { friend class ASTContext; - const ASTContext &Context; QualType ElementType; Expr *SizeExpr; SourceLocation Loc; - DependentVectorType(const ASTContext &Context, QualType ElementType, - QualType CanonType, Expr *SizeExpr, - SourceLocation Loc, VectorType::VectorKind vecKind); + DependentVectorType(QualType ElementType, QualType CanonType, Expr *SizeExpr, + SourceLocation Loc, VectorKind vecKind); public: Expr *getSizeExpr() const { return SizeExpr; } QualType getElementType() const { return ElementType; } SourceLocation getAttributeLoc() const { return Loc; } - VectorType::VectorKind getVectorKind() const { - return VectorType::VectorKind(VectorTypeBits.VecKind); + VectorKind getVectorKind() const { + return VectorKind(VectorTypeBits.VecKind); } bool isSugared() const { return false; } @@ -3515,13 +3580,13 @@ public: return T->getTypeClass() == DependentVector; } - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getElementType(), getSizeExpr(), getVectorKind()); } static void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, QualType ElementType, const Expr *SizeExpr, - VectorType::VectorKind VecKind); + VectorKind VecKind); }; /// ExtVectorType - Extended vector type. This type is created using @@ -3534,7 +3599,8 @@ class ExtVectorType : public VectorType { friend class ASTContext; // ASTContext creates these. ExtVectorType(QualType vecType, unsigned nElements, QualType canonType) - : VectorType(ExtVector, vecType, nElements, canonType, GenericVector) {} + : VectorType(ExtVector, vecType, nElements, canonType, + VectorKind::Generic) {} public: static int getPointAccessorIdx(char c) { @@ -3616,7 +3682,7 @@ public: QualType getElementType() const { return ElementType; } /// Valid elements types are the following: - /// * an integer type (as in C2x 6.2.5p19), but excluding enumerated types + /// * an integer type (as in C23 6.2.5p22), but excluding enumerated types /// and _Bool /// * the standard floating types float or double /// * a half-precision floating point type, if one is supported on the target @@ -3697,15 +3763,13 @@ public: class DependentSizedMatrixType final : public MatrixType { friend class ASTContext; - const ASTContext &Context; Expr *RowExpr; Expr *ColumnExpr; SourceLocation loc; - DependentSizedMatrixType(const ASTContext &Context, QualType ElementType, - QualType CanonicalType, Expr *RowExpr, - Expr *ColumnExpr, SourceLocation loc); + DependentSizedMatrixType(QualType ElementType, QualType CanonicalType, + Expr *RowExpr, Expr *ColumnExpr, SourceLocation loc); public: Expr *getRowExpr() const { return RowExpr; } @@ -3716,7 +3780,7 @@ public: return T->getTypeClass() == DependentSizedMatrix; } - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getElementType(), getRowExpr(), getColumnExpr()); } @@ -3966,6 +4030,19 @@ public: /// because TrailingObjects cannot handle repeated types. struct ExceptionType { QualType Type; }; + /// The AArch64 SME ACLE (Arm C/C++ Language Extensions) define a number + /// of function type attributes that can be set on function types, including + /// function pointers. + enum AArch64SMETypeAttributes : unsigned { + SME_NormalFunction = 0, + SME_PStateSMEnabledMask = 1 << 0, + SME_PStateSMCompatibleMask = 1 << 1, + SME_PStateZASharedMask = 1 << 2, + SME_PStateZAPreservedMask = 1 << 3, + SME_AttributeMask = 0b111'111 // We only support maximum 6 bits because of the + // bitmask in FunctionTypeExtraBitfields. + }; + /// A simple holder for various uncommon bits which do not fit in /// FunctionTypeBitfields. Aligned to alignof(void *) to maintain the /// alignment of subsequent objects in TrailingObjects. @@ -3973,7 +4050,13 @@ public: /// The number of types in the exception specification. /// A whole unsigned is not needed here and according to /// [implimits] 8 bits would be enough here. - uint16_t NumExceptionType = 0; + unsigned NumExceptionType : 10; + + /// Any AArch64 SME ACLE type attributes that need to be propagated + /// on declarations and function pointers. + unsigned AArch64SMEAttributes : 6; + FunctionTypeExtraBitfields() + : NumExceptionType(0), AArch64SMEAttributes(SME_NormalFunction) {} }; protected: @@ -4152,18 +4235,22 @@ public: /// the various bits of extra information about a function prototype. struct ExtProtoInfo { FunctionType::ExtInfo ExtInfo; - bool Variadic : 1; - bool HasTrailingReturn : 1; + unsigned Variadic : 1; + unsigned HasTrailingReturn : 1; + unsigned AArch64SMEAttributes : 6; Qualifiers TypeQuals; RefQualifierKind RefQualifier = RQ_None; ExceptionSpecInfo ExceptionSpec; const ExtParameterInfo *ExtParameterInfos = nullptr; SourceLocation EllipsisLoc; - ExtProtoInfo() : Variadic(false), HasTrailingReturn(false) {} + ExtProtoInfo() + : Variadic(false), HasTrailingReturn(false), + AArch64SMEAttributes(SME_NormalFunction) {} ExtProtoInfo(CallingConv CC) - : ExtInfo(CC), Variadic(false), HasTrailingReturn(false) {} + : ExtInfo(CC), Variadic(false), HasTrailingReturn(false), + AArch64SMEAttributes(SME_NormalFunction) {} ExtProtoInfo withExceptionSpec(const ExceptionSpecInfo &ESI) { ExtProtoInfo Result(*this); @@ -4172,7 +4259,15 @@ public: } bool requiresFunctionProtoTypeExtraBitfields() const { - return ExceptionSpec.Type == EST_Dynamic; + return ExceptionSpec.Type == EST_Dynamic || + AArch64SMEAttributes != SME_NormalFunction; + } + + void setArmSMEAttribute(AArch64SMETypeAttributes Kind, bool Enable = true) { + if (Enable) + AArch64SMEAttributes |= Kind; + else + AArch64SMEAttributes &= ~Kind; } }; @@ -4299,6 +4394,7 @@ public: EPI.TypeQuals = getMethodQuals(); EPI.RefQualifier = getRefQualifier(); EPI.ExtParameterInfos = getExtParameterInfosOrNull(); + EPI.AArch64SMEAttributes = getAArch64SMEAttributes(); return EPI; } @@ -4480,6 +4576,15 @@ public: return getTrailingObjects(); } + /// Return a bitmask describing the SME attributes on the function type, see + /// AArch64SMETypeAttributes for their values. + unsigned getAArch64SMEAttributes() const { + if (!hasExtraBitfields()) + return SME_NormalFunction; + return getTrailingObjects() + ->AArch64SMEAttributes; + } + ExtParameterInfo getExtParameterInfo(unsigned I) const { assert(I < getNumParams() && "parameter index out of range"); if (hasExtParameterInfos()) @@ -4652,8 +4757,8 @@ public: } }; -/// Represents a `typeof` (or __typeof__) expression (a C2x feature and GCC -/// extension) or a `typeof_unqual` expression (a C2x feature). +/// Represents a `typeof` (or __typeof__) expression (a C23 feature and GCC +/// extension) or a `typeof_unqual` expression (a C23 feature). class TypeOfExprType : public Type { Expr *TOExpr; @@ -4686,15 +4791,12 @@ public: /// This class is used internally by the ASTContext to manage /// canonical, dependent types, only. Clients will only see instances /// of this class via TypeOfExprType nodes. -class DependentTypeOfExprType - : public TypeOfExprType, public llvm::FoldingSetNode { - const ASTContext &Context; - +class DependentTypeOfExprType : public TypeOfExprType, + public llvm::FoldingSetNode { public: - DependentTypeOfExprType(const ASTContext &Context, Expr *E, TypeOfKind Kind) - : TypeOfExprType(E, Kind), Context(Context) {} + DependentTypeOfExprType(Expr *E, TypeOfKind Kind) : TypeOfExprType(E, Kind) {} - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getUnderlyingExpr(), getKind() == TypeOfKind::Unqualified); } @@ -4703,8 +4805,8 @@ public: Expr *E, bool IsUnqual); }; -/// Represents `typeof(type)`, a C2x feature and GCC extension, or -/// `typeof_unqual(type), a C2x feature. +/// Represents `typeof(type)`, a C23 feature and GCC extension, or +/// `typeof_unqual(type), a C23 feature. class TypeOfType : public Type { friend class ASTContext; // ASTContext creates these. @@ -4770,12 +4872,10 @@ public: /// canonical, dependent types, only. Clients will only see instances /// of this class via DecltypeType nodes. class DependentDecltypeType : public DecltypeType, public llvm::FoldingSetNode { - const ASTContext &Context; - public: - DependentDecltypeType(const ASTContext &Context, Expr *E); + DependentDecltypeType(Expr *E, QualType UnderlyingTpe); - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getUnderlyingExpr()); } @@ -5299,7 +5399,7 @@ public: /// Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained /// by a type-constraint. -class alignas(8) AutoType : public DeducedType, public llvm::FoldingSetNode { +class AutoType : public DeducedType, public llvm::FoldingSetNode { friend class ASTContext; // ASTContext creates these ConceptDecl *TypeConstraintConcept; @@ -5407,9 +5507,7 @@ public: /// TemplateArguments, followed by a QualType representing the /// non-canonical aliased type when the template is a type alias /// template. -class alignas(8) TemplateSpecializationType - : public Type, - public llvm::FoldingSetNode { +class TemplateSpecializationType : public Type, public llvm::FoldingSetNode { friend class ASTContext; // ASTContext creates these /// The name of the template being specialized. This is @@ -5592,48 +5690,48 @@ public: } }; -/// The kind of a tag type. -enum TagTypeKind { - /// The "struct" keyword. - TTK_Struct, - - /// The "__interface" keyword. - TTK_Interface, - - /// The "union" keyword. - TTK_Union, - - /// The "class" keyword. - TTK_Class, - - /// The "enum" keyword. - TTK_Enum -}; - /// The elaboration keyword that precedes a qualified type name or /// introduces an elaborated-type-specifier. -enum ElaboratedTypeKeyword { +enum class ElaboratedTypeKeyword { /// The "struct" keyword introduces the elaborated-type-specifier. - ETK_Struct, + Struct, /// The "__interface" keyword introduces the elaborated-type-specifier. - ETK_Interface, + Interface, /// The "union" keyword introduces the elaborated-type-specifier. - ETK_Union, + Union, /// The "class" keyword introduces the elaborated-type-specifier. - ETK_Class, + Class, /// The "enum" keyword introduces the elaborated-type-specifier. - ETK_Enum, + Enum, /// The "typename" keyword precedes the qualified type name, e.g., /// \c typename T::type. - ETK_Typename, + Typename, /// No keyword precedes the qualified type name. - ETK_None + None +}; + +/// The kind of a tag type. +enum class TagTypeKind { + /// The "struct" keyword. + Struct, + + /// The "__interface" keyword. + Interface, + + /// The "union" keyword. + Union, + + /// The "class" keyword. + Class, + + /// The "enum" keyword. + Enum }; /// A helper class for Type nodes having an ElaboratedTypeKeyword. @@ -5645,7 +5743,7 @@ protected: TypeWithKeyword(ElaboratedTypeKeyword Keyword, TypeClass tc, QualType Canonical, TypeDependence Dependence) : Type(tc, Canonical, Dependence) { - TypeWithKeywordBits.Keyword = Keyword; + TypeWithKeywordBits.Keyword = llvm::to_underlying(Keyword); } public: @@ -5751,7 +5849,7 @@ public: static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl) { - ID.AddInteger(Keyword); + ID.AddInteger(llvm::to_underlying(Keyword)); ID.AddPointer(NNS); NamedType.Profile(ID); ID.AddPointer(OwnedTagDecl); @@ -5810,7 +5908,7 @@ public: static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name) { - ID.AddInteger(Keyword); + ID.AddInteger(llvm::to_underlying(Keyword)); ID.AddPointer(NNS); ID.AddPointer(Name); } @@ -5823,9 +5921,8 @@ public: /// Represents a template specialization type whose template cannot be /// resolved, e.g. /// A::template B -class alignas(8) DependentTemplateSpecializationType - : public TypeWithKeyword, - public llvm::FoldingSetNode { +class DependentTemplateSpecializationType : public TypeWithKeyword, + public llvm::FoldingSetNode { friend class ASTContext; // ASTContext creates these /// The nested name specifier containing the qualifier. @@ -6565,6 +6662,7 @@ public: /// A fixed int type of a specified bitwidth. class BitIntType final : public Type, public llvm::FoldingSetNode { friend class ASTContext; + LLVM_PREFERRED_TYPE(bool) unsigned IsUnsigned : 1; unsigned NumBits : 24; @@ -6579,7 +6677,7 @@ public: bool isSugared() const { return false; } QualType desugar() const { return QualType(this, 0); } - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID) const { Profile(ID, isUnsigned(), getNumBits()); } @@ -6594,12 +6692,10 @@ public: class DependentBitIntType final : public Type, public llvm::FoldingSetNode { friend class ASTContext; - const ASTContext &Context; llvm::PointerIntPair ExprAndUnsigned; protected: - DependentBitIntType(const ASTContext &Context, bool IsUnsigned, - Expr *NumBits); + DependentBitIntType(bool IsUnsigned, Expr *NumBits); public: bool isUnsigned() const; @@ -6609,7 +6705,7 @@ public: bool isSugared() const { return false; } QualType desugar() const { return QualType(this, 0); } - void Profile(llvm::FoldingSetNodeID &ID) { + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, isUnsigned(), getNumBitsExpr()); } static void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, @@ -7187,30 +7283,23 @@ inline bool Type::isOpenCLSpecificType() const { isQueueT() || isReserveIDT() || isPipeType() || isOCLExtOpaqueType(); } -inline bool Type::isRVVType() const { -#define RVV_TYPE(Name, Id, SingletonId) \ - isSpecificBuiltinType(BuiltinType::Id) || - return -#include "clang/Basic/RISCVVTypes.def" - false; // end of boolean or operation. -} - inline bool Type::isRVVType(unsigned ElementCount) const { bool Ret = false; #define RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, \ - IsFP) \ + IsFP, IsBF) \ if (NumEls == ElementCount) \ Ret |= isSpecificBuiltinType(BuiltinType::Id); #include "clang/Basic/RISCVVTypes.def" return Ret; } -inline bool Type::isRVVType(unsigned Bitwidth, bool IsFloat) const { +inline bool Type::isRVVType(unsigned Bitwidth, bool IsFloat, + bool IsBFloat) const { bool Ret = false; #define RVV_TYPE(Name, Id, SingletonId) #define RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, \ - IsFP) \ - if (ElBits == Bitwidth && IsFloat == IsFP) \ + IsFP, IsBF) \ + if (ElBits == Bitwidth && IsFloat == IsFP && IsBFloat == IsBF) \ Ret |= isSpecificBuiltinType(BuiltinType::Id); #include "clang/Basic/RISCVVTypes.def" return Ret; @@ -7426,7 +7515,7 @@ inline const Type *Type::getPointeeOrArrayElementType() const { /// spaces into a diagnostic with <<. inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD, LangAS AS) { - PD.AddTaggedVal(static_cast>(AS), + PD.AddTaggedVal(llvm::to_underlying(AS), DiagnosticsEngine::ArgumentKind::ak_addrspace); return PD; } diff --git a/contrib/llvm-project/clang/include/clang/AST/TypeLoc.h b/contrib/llvm-project/clang/include/clang/AST/TypeLoc.h index 27f714b7c983..471deb14aba5 100644 --- a/contrib/llvm-project/clang/include/clang/AST/TypeLoc.h +++ b/contrib/llvm-project/clang/include/clang/AST/TypeLoc.h @@ -14,6 +14,7 @@ #ifndef LLVM_CLANG_AST_TYPELOC_H #define LLVM_CLANG_AST_TYPELOC_H +#include "clang/AST/ASTConcept.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/TemplateBase.h" @@ -242,7 +243,7 @@ private: inline TypeSourceInfo::TypeSourceInfo(QualType ty, size_t DataSize) : Ty(ty) { // Init data attached to the object. See getTypeLoc. - memset(this + 1, 0, DataSize); + memset(static_cast(this + 1), 0, DataSize); } /// Return the TypeLoc for a type source info. @@ -2104,17 +2105,10 @@ class DeducedTypeLoc DeducedType> {}; struct AutoTypeLocInfo : TypeSpecLocInfo { - NestedNameSpecifierLoc NestedNameSpec; - SourceLocation TemplateKWLoc; - SourceLocation ConceptNameLoc; - NamedDecl *FoundDecl = nullptr; - SourceLocation LAngleLoc; - SourceLocation RAngleLoc; - // For decltype(auto). SourceLocation RParenLoc; - // Followed by a TemplateArgumentLocInfo[] + ConceptReference *CR = nullptr; }; class AutoTypeLoc @@ -2135,79 +2129,77 @@ public: return getTypePtr()->isConstrained(); } - const NestedNameSpecifierLoc &getNestedNameSpecifierLoc() const { - return getLocalData()->NestedNameSpec; - } + void setConceptReference(ConceptReference *CR) { getLocalData()->CR = CR; } - void setNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS) { - getLocalData()->NestedNameSpec = NNS; + ConceptReference *getConceptReference() const { return getLocalData()->CR; } + + // FIXME: Several of the following functions can be removed. Instead the + // caller can directly work with the ConceptReference. + const NestedNameSpecifierLoc getNestedNameSpecifierLoc() const { + if (const auto *CR = getConceptReference()) + return CR->getNestedNameSpecifierLoc(); + return NestedNameSpecifierLoc(); } SourceLocation getTemplateKWLoc() const { - return getLocalData()->TemplateKWLoc; - } - - void setTemplateKWLoc(SourceLocation Loc) { - getLocalData()->TemplateKWLoc = Loc; + if (const auto *CR = getConceptReference()) + return CR->getTemplateKWLoc(); + return SourceLocation(); } SourceLocation getConceptNameLoc() const { - return getLocalData()->ConceptNameLoc; - } - - void setConceptNameLoc(SourceLocation Loc) { - getLocalData()->ConceptNameLoc = Loc; + if (const auto *CR = getConceptReference()) + return CR->getConceptNameLoc(); + return SourceLocation(); } NamedDecl *getFoundDecl() const { - return getLocalData()->FoundDecl; - } - - void setFoundDecl(NamedDecl *D) { - getLocalData()->FoundDecl = D; + if (const auto *CR = getConceptReference()) + return CR->getFoundDecl(); + return nullptr; } ConceptDecl *getNamedConcept() const { - return getTypePtr()->getTypeConstraintConcept(); + if (const auto *CR = getConceptReference()) + return CR->getNamedConcept(); + return nullptr; } - DeclarationNameInfo getConceptNameInfo() const; + DeclarationNameInfo getConceptNameInfo() const { + return getConceptReference()->getConceptNameInfo(); + } bool hasExplicitTemplateArgs() const { - return getLocalData()->LAngleLoc.isValid(); + return (getConceptReference() && + getConceptReference()->getTemplateArgsAsWritten() && + getConceptReference() + ->getTemplateArgsAsWritten() + ->getLAngleLoc() + .isValid()); } SourceLocation getLAngleLoc() const { - return this->getLocalData()->LAngleLoc; - } - - void setLAngleLoc(SourceLocation Loc) { - this->getLocalData()->LAngleLoc = Loc; + if (const auto *CR = getConceptReference()) + if (const auto *TAAW = CR->getTemplateArgsAsWritten()) + return TAAW->getLAngleLoc(); + return SourceLocation(); } SourceLocation getRAngleLoc() const { - return this->getLocalData()->RAngleLoc; - } - - void setRAngleLoc(SourceLocation Loc) { - this->getLocalData()->RAngleLoc = Loc; + if (const auto *CR = getConceptReference()) + if (const auto *TAAW = CR->getTemplateArgsAsWritten()) + return TAAW->getRAngleLoc(); + return SourceLocation(); } unsigned getNumArgs() const { return getTypePtr()->getTypeConstraintArguments().size(); } - void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI) { - getArgInfos()[i] = AI; - } - - TemplateArgumentLocInfo getArgLocInfo(unsigned i) const { - return getArgInfos()[i]; - } - TemplateArgumentLoc getArgLoc(unsigned i) const { - return TemplateArgumentLoc(getTypePtr()->getTypeConstraintArguments()[i], - getArgLocInfo(i)); + const auto *CR = getConceptReference(); + assert(CR && "No ConceptReference"); + return CR->getTemplateArgsAsWritten()->getTemplateArgs()[i]; } SourceRange getLocalSourceRange() const { @@ -2227,19 +2219,6 @@ public: } void initializeLocal(ASTContext &Context, SourceLocation Loc); - - unsigned getExtraLocalDataSize() const { - return getNumArgs() * sizeof(TemplateArgumentLocInfo); - } - - unsigned getExtraLocalDataAlignment() const { - return alignof(TemplateArgumentLocInfo); - } - -private: - TemplateArgumentLocInfo *getArgInfos() const { - return static_cast(getExtraLocalData()); - } }; class DeducedTemplateSpecializationTypeLoc @@ -2315,7 +2294,7 @@ public: QualType getInnerType() const { return getTypePtr()->getNamedType(); } bool isEmpty() const { - return getTypePtr()->getKeyword() == ElaboratedTypeKeyword::ETK_None && + return getTypePtr()->getKeyword() == ElaboratedTypeKeyword::None && !getTypePtr()->getQualifier(); } diff --git a/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td b/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td index 3cc826c1463a..682c869b0c58 100644 --- a/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td +++ b/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td @@ -323,6 +323,9 @@ let Class = FunctionProtoType in { ? node->getExtParameterInfos() : llvm::ArrayRef() }]; } + def : Property<"AArch64SMEAttributes", UInt32> { + let Read = [{ node->getAArch64SMEAttributes() }]; + } def : Creator<[{ auto extInfo = FunctionType::ExtInfo(noReturn, hasRegParm, regParm, @@ -338,6 +341,7 @@ let Class = FunctionProtoType in { epi.ExceptionSpec = exceptionSpecifier; epi.ExtParameterInfos = extParameterInfo.empty() ? nullptr : extParameterInfo.data(); + epi.AArch64SMEAttributes = AArch64SMEAttributes; return ctx.getFunctionType(returnType, parameters, epi); }]>; } diff --git a/contrib/llvm-project/clang/include/clang/AST/VTableBuilder.h b/contrib/llvm-project/clang/include/clang/AST/VTableBuilder.h index 1bf7d0467aa3..fbf6c041a1ec 100644 --- a/contrib/llvm-project/clang/include/clang/AST/VTableBuilder.h +++ b/contrib/llvm-project/clang/include/clang/AST/VTableBuilder.h @@ -279,7 +279,7 @@ public: AddressPointLocation getAddressPoint(BaseSubobject Base) const { assert(AddressPoints.count(Base) && "Did not find address point!"); - return AddressPoints.find(Base)->second; + return AddressPoints.lookup(Base); } const AddressPointsMapTy &getAddressPoints() const { diff --git a/contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchers.h b/contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchers.h index f49204a3d906..82a26356c58f 100644 --- a/contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchers.h +++ b/contrib/llvm-project/clang/include/clang/ASTMatchers/ASTMatchers.h @@ -300,7 +300,7 @@ AST_POLYMORPHIC_MATCHER_REGEX(isExpansionInFileMatching, return false; } auto FileEntry = - SourceManager.getFileEntryForID(SourceManager.getFileID(ExpansionLoc)); + SourceManager.getFileEntryRefForID(SourceManager.getFileID(ExpansionLoc)); if (!FileEntry) { return false; } @@ -2519,6 +2519,10 @@ extern const internal::VariadicDynCastAllOfMatcher extern const internal::VariadicDynCastAllOfMatcher chooseExpr; +/// Matches builtin function __builtin_convertvector. +extern const internal::VariadicDynCastAllOfMatcher + convertVectorExpr; + /// Matches GNU __null expression. extern const internal::VariadicDynCastAllOfMatcher gnuNullExpr; @@ -3924,7 +3928,7 @@ AST_MATCHER_P(CallExpr, callee, internal::Matcher, AST_POLYMORPHIC_MATCHER_P_OVERLOAD( callee, AST_POLYMORPHIC_SUPPORTED_TYPES(ObjCMessageExpr, CallExpr), internal::Matcher, InnerMatcher, 1) { - if (const auto *CallNode = dyn_cast(&Node)) + if (isa(&Node)) return callExpr(hasDeclaration(InnerMatcher)) .matches(Node, Finder, Builder); else { @@ -6934,10 +6938,25 @@ AST_POLYMORPHIC_MATCHER_P(hasSize, /// T data[Size]; /// }; /// \endcode -/// dependentSizedArrayType +/// dependentSizedArrayType() /// matches "T data[Size]" extern const AstTypeMatcher dependentSizedArrayType; +/// Matches C++ extended vector type where either the type or size is +/// dependent. +/// +/// Given +/// \code +/// template +/// class vector { +/// typedef T __attribute__((ext_vector_type(Size))) type; +/// }; +/// \endcode +/// dependentSizedExtVectorType() +/// matches "T __attribute__((ext_vector_type(Size)))" +extern const AstTypeMatcher + dependentSizedExtVectorType; + /// Matches C arrays with unspecified size. /// /// Given @@ -7239,6 +7258,18 @@ AST_TYPELOC_TRAVERSE_MATCHER_DECL( /// matches "typedef int X" extern const AstTypeMatcher typedefType; +/// Matches qualified types when the qualifier is applied via a macro. +/// +/// Given +/// \code +/// #define CDECL __attribute__((cdecl)) +/// typedef void (CDECL *X)(); +/// typedef void (__attribute__((cdecl)) *Y)(); +/// \endcode +/// macroQualifiedType() +/// matches the type of the typedef declaration of \c X but not \c Y. +extern const AstTypeMatcher macroQualifiedType; + /// Matches enum types. /// /// Given diff --git a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/Dominators.h b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/Dominators.h index 9ac9cbe7d3ec..7dd54c5ce262 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/Dominators.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/Dominators.h @@ -202,7 +202,7 @@ struct ChildrenGetterTy { auto Children = children(N); ChildrenTy Ret{Children.begin(), Children.end()}; - llvm::erase_value(Ret, nullptr); + llvm::erase(Ret, nullptr); return Ret; } }; diff --git a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/IntervalPartition.h b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/IntervalPartition.h index cc04bab7bf6c..28a7afad41a7 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/IntervalPartition.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/IntervalPartition.h @@ -6,9 +6,13 @@ // //===----------------------------------------------------------------------===// // -// This file defines functionality for partitioning a CFG into intervals. The -// concepts and implementations are based on the presentation in "Compilers" by -// Aho, Sethi and Ullman (the "dragon book"), pages 664-666. +// This file defines functionality for partitioning a CFG into intervals and +// building a weak topological order (WTO) of the nodes, based on the +// partitioning. The concepts and implementations for the graph partitioning +// are based on the presentation in "Compilers" by Aho, Sethi and Ullman (the +// "dragon book"), pages 664-666. The concepts around WTOs is taken from the +// paper "Efficient chaotic iteration strategies with widenings," by +// F. Bourdoncle ([Bourdoncle1993]). // //===----------------------------------------------------------------------===// @@ -17,34 +21,103 @@ #include "clang/Analysis/CFG.h" #include "llvm/ADT/DenseSet.h" +#include +#include #include namespace clang { +/// A _weak topological ordering_ (WTO) of CFG nodes provides a total order over +/// the CFG (defined in `WTOCompare`, below), which can guide the order in which +/// to visit nodes in fixpoint computations over the CFG. +/// +/// Roughly, a WTO a) groups the blocks so that loop heads are grouped with +/// their bodies and any nodes they dominate after the loop and b) orders the +/// groups topologically. As a result, the blocks in a series of loops are +/// ordered such that all nodes in loop `i` are earlier in the order than nodes +/// in loop `j`. This ordering, when combined with widening, bounds the number +/// of times a node must be visited for a dataflow algorithm to reach a +/// fixpoint. For the precise definition of a WTO and its properties, see +/// [Bourdoncle1993]. +/// +/// Here, we provide a simplified WTO which drops its nesting structure, +/// maintaining only the ordering itself. The ordering is built from the limit +/// flow graph of `Cfg` (derived from iteratively partitioning it into +/// intervals) if and only if it is reducible (its limit flow graph has one +/// node). Returns `nullopt` when `Cfg` is not reducible. +/// +/// This WTO construction is described in Section 4.2 of [Bourdoncle1993]. +using WeakTopologicalOrdering = std::vector; +std::optional getIntervalWTO(const CFG &Cfg); -// An interval is a strongly-connected component of the CFG along with a -// trailing acyclic structure. The _header_ of the interval is either the CFG -// entry block or has at least one predecessor outside of the interval. All -// other blocks in the interval have only predecessors also in the interval. -struct CFGInterval { - CFGInterval(const CFGBlock *Header) : Header(Header), Blocks({Header}) {} +struct WTOCompare { + WTOCompare(const WeakTopologicalOrdering &WTO); - // The block from which the interval was constructed. Is either the CFG entry - // block or has at least one predecessor outside the interval. - const CFGBlock *Header; + bool operator()(const CFGBlock *B1, const CFGBlock *B2) const { + auto ID1 = B1->getBlockID(); + auto ID2 = B2->getBlockID(); - llvm::SmallDenseSet Blocks; + unsigned V1 = ID1 >= BlockOrder.size() ? 0 : BlockOrder[ID1]; + unsigned V2 = ID2 >= BlockOrder.size() ? 0 : BlockOrder[ID2]; + return V1 > V2; + } - // Successor blocks of the *interval*: blocks outside the interval for - // reachable (in one edge) from within the interval. - llvm::SmallDenseSet Successors; + std::vector BlockOrder; }; -CFGInterval buildInterval(const CFG &Cfg, const CFGBlock &Header); +namespace internal { +// An interval is a strongly-connected component of the CFG along with a +// trailing acyclic structure. An interval can be constructed directly from CFG +// blocks or from a graph of other intervals. Each interval has one _header_ +// block, from which the interval is built. The _header_ of the interval is +// either the graph's entry block or has at least one predecessor outside of the +// interval. All other blocks in the interval have only predecessors also in the +// interval. +struct CFGIntervalNode { + CFGIntervalNode() = default; + CFGIntervalNode(unsigned ID) : ID(ID) {} -// Partitions `Cfg` into intervals and constructs a graph of the intervals, + CFGIntervalNode(unsigned ID, std::vector Nodes) + : ID(ID), Nodes(std::move(Nodes)) {} + + const llvm::SmallDenseSet &preds() const { + return Predecessors; + } + const llvm::SmallDenseSet &succs() const { + return Successors; + } + + // Unique identifier of this interval relative to other intervals in the same + // graph. + unsigned ID; + + std::vector Nodes; + + // Predessor intervals of this interval: those intervals for which there + // exists an edge from a node in that other interval to the head of this + // interval. + llvm::SmallDenseSet Predecessors; + + // Successor intervals of this interval: those intervals for which there + // exists an edge from a node in this interval to the head of that other + // interval. + llvm::SmallDenseSet Successors; +}; + +// Since graphs are built from pointers to nodes, we use a deque to ensure +// pointer stability. +using CFGIntervalGraph = std::deque; + +std::vector buildInterval(const CFGBlock *Header); + +// Partitions `Cfg` into intervals and constructs the graph of the intervals // based on the edges between nodes in these intervals. -std::vector partitionIntoIntervals(const CFG &Cfg); +CFGIntervalGraph partitionIntoIntervals(const CFG &Cfg); +// (Further) partitions `Graph` into intervals and constructs the graph of the +// intervals based on the edges between nodes (themselves intervals) in these +// intervals. +CFGIntervalGraph partitionIntoIntervals(const CFGIntervalGraph &Graph); +} // namespace internal } // namespace clang #endif // LLVM_CLANG_ANALYSIS_ANALYSES_INTERVALPARTITION_H diff --git a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ThreadSafety.h b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ThreadSafety.h index 1808d1d71e05..0866b09bab29 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ThreadSafety.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ThreadSafety.h @@ -47,7 +47,13 @@ enum ProtectedOperationKind { POK_PassByRef, /// Passing a pt-guarded variable by reference. - POK_PtPassByRef + POK_PtPassByRef, + + /// Returning a guarded variable by reference. + POK_ReturnByRef, + + /// Returning a pt-guarded variable by reference. + POK_PtReturnByRef, }; /// This enum distinguishes between different kinds of lock actions. For diff --git a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h index 9d28325c1ea6..13e37ac2b56b 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h @@ -361,7 +361,7 @@ public: unsigned NumArgs = 0; // Function arguments - const Expr *const *FunArgs = nullptr; + llvm::PointerUnion FunArgs = nullptr; // is Self referred to with -> or .? bool SelfArrow = false; diff --git a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h index 6766ba8ec277..8a2d56668e32 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h @@ -16,14 +16,46 @@ #include "clang/AST/Decl.h" #include "clang/AST/Stmt.h" +#include "llvm/Support/Debug.h" namespace clang { -using DefMapTy = llvm::DenseMap>; +using VarGrpTy = std::vector; +using VarGrpRef = ArrayRef; + +class VariableGroupsManager { +public: + VariableGroupsManager() = default; + virtual ~VariableGroupsManager() = default; + /// Returns the set of variables (including `Var`) that need to be fixed + /// together in one step. + /// + /// `Var` must be a variable that needs fix (so it must be in a group). + /// `HasParm` is an optional argument that will be set to true if the set of + /// variables, where `Var` is in, contains parameters. + virtual VarGrpRef getGroupOfVar(const VarDecl *Var, + bool *HasParm = nullptr) const =0; + + /// Returns the non-empty group of variables that include parameters of the + /// analyzing function, if such a group exists. An empty group, otherwise. + virtual VarGrpRef getGroupOfParms() const =0; +}; /// The interface that lets the caller handle unsafe buffer usage analysis /// results by overriding this class's handle... methods. class UnsafeBufferUsageHandler { +#ifndef NDEBUG +public: + // A self-debugging facility that you can use to notify the user when + // suggestions or fixits are incomplete. + // Uses std::function to avoid computing the message when it won't + // actually be displayed. + using DebugNote = std::pair; + using DebugNoteList = std::vector; + using DebugNoteByVar = std::map; + DebugNoteByVar DebugNotesByVar; +#endif + public: UnsafeBufferUsageHandler() = default; virtual ~UnsafeBufferUsageHandler() = default; @@ -37,12 +69,35 @@ public: bool IsRelatedToDecl) = 0; /// Invoked when a fix is suggested against a variable. This function groups - /// all variables that must be fixed together (i.e their types must be changed to the - /// same target type to prevent type mismatches) into a single fixit. + /// all variables that must be fixed together (i.e their types must be changed + /// to the same target type to prevent type mismatches) into a single fixit. + /// + /// `D` is the declaration of the callable under analysis that owns `Variable` + /// and all of its group mates. virtual void handleUnsafeVariableGroup(const VarDecl *Variable, - const DefMapTy &VarGrpMap, - FixItList &&Fixes) = 0; + const VariableGroupsManager &VarGrpMgr, + FixItList &&Fixes, const Decl *D) = 0; +#ifndef NDEBUG +public: + bool areDebugNotesRequested() { + DEBUG_WITH_TYPE("SafeBuffers", return true); + return false; + } + + void addDebugNoteForVar(const VarDecl *VD, SourceLocation Loc, + std::string Text) { + if (areDebugNotesRequested()) + DebugNotesByVar[VD].push_back(std::make_pair(Loc, Text)); + } + + void clearDebugNotes() { + if (areDebugNotesRequested()) + DebugNotesByVar.clear(); + } +#endif + +public: /// Returns a reference to the `Preprocessor`: virtual bool isSafeBufferOptOut(const SourceLocation &Loc) const = 0; diff --git a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def index ff687a0d178b..757ee452ced7 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def +++ b/contrib/llvm-project/clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def @@ -36,6 +36,7 @@ FIXABLE_GADGET(PointerDereference) FIXABLE_GADGET(UPCAddressofArraySubscript) // '&DRE[any]' in an Unspecified Pointer Context FIXABLE_GADGET(UPCStandalonePointer) FIXABLE_GADGET(UPCPreIncrement) // '++Ptr' in an Unspecified Pointer Context +FIXABLE_GADGET(UUCAddAssign) // 'Ptr += n' in an Unspecified Untyped Context FIXABLE_GADGET(PointerAssignment) FIXABLE_GADGET(PointerInit) diff --git a/contrib/llvm-project/clang/include/clang/Analysis/CFG.h b/contrib/llvm-project/clang/include/clang/Analysis/CFG.h index eacebe176dda..67383bb316d3 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/CFG.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/CFG.h @@ -14,10 +14,11 @@ #ifndef LLVM_CLANG_ANALYSIS_CFG_H #define LLVM_CLANG_ANALYSIS_CFG_H -#include "clang/Analysis/Support/BumpVector.h" -#include "clang/Analysis/ConstructionContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" +#include "clang/Analysis/ConstructionContext.h" +#include "clang/Analysis/Support/BumpVector.h" #include "clang/Basic/LLVM.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/GraphTraits.h" @@ -74,7 +75,8 @@ public: MemberDtor, TemporaryDtor, DTOR_BEGIN = AutomaticObjectDtor, - DTOR_END = TemporaryDtor + DTOR_END = TemporaryDtor, + CleanupFunction, }; protected: @@ -383,6 +385,32 @@ private: } }; +class CFGCleanupFunction final : public CFGElement { +public: + CFGCleanupFunction() = default; + CFGCleanupFunction(const VarDecl *VD) + : CFGElement(Kind::CleanupFunction, VD) { + assert(VD->hasAttr()); + } + + const VarDecl *getVarDecl() const { + return static_cast(Data1.getPointer()); + } + + /// Returns the function to be called when cleaning up the var decl. + const FunctionDecl *getFunctionDecl() const { + const CleanupAttr *A = getVarDecl()->getAttr(); + return A->getFunctionDecl(); + } + +private: + friend class CFGElement; + + static bool isKind(const CFGElement E) { + return E.getKind() == Kind::CleanupFunction; + } +}; + /// Represents C++ object destructor implicitly generated for automatic object /// or temporary bound to const reference at the point of leaving its local /// scope. @@ -1142,6 +1170,10 @@ public: Elements.push_back(CFGAutomaticObjDtor(VD, S), C); } + void appendCleanupFunction(const VarDecl *VD, BumpVectorContext &C) { + Elements.push_back(CFGCleanupFunction(VD), C); + } + void appendLifetimeEnds(VarDecl *VD, Stmt *S, BumpVectorContext &C) { Elements.push_back(CFGLifetimeEnds(VD, S), C); } @@ -1162,6 +1194,7 @@ public: CFGCallback() = default; virtual ~CFGCallback() = default; + virtual void logicAlwaysTrue(const BinaryOperator *B, bool isAlwaysTrue) {} virtual void compareAlwaysTrue(const BinaryOperator *B, bool isAlwaysTrue) {} virtual void compareBitwiseEquality(const BinaryOperator *B, bool isAlwaysTrue) {} diff --git a/contrib/llvm-project/clang/include/clang/Analysis/CFGStmtMap.h b/contrib/llvm-project/clang/include/clang/Analysis/CFGStmtMap.h index 8cf02372ff0f..93cd9cfc5bdf 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/CFGStmtMap.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/CFGStmtMap.h @@ -26,6 +26,8 @@ class CFGStmtMap { void *M; CFGStmtMap(ParentMap *pm, void *m) : PM(pm), M(m) {} + CFGStmtMap(const CFGStmtMap &) = delete; + CFGStmtMap &operator=(const CFGStmtMap &) = delete; public: ~CFGStmtMap(); diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Arena.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Arena.h index 373697dc7379..394ce054e65f 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Arena.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Arena.h @@ -11,6 +11,7 @@ #include "clang/Analysis/FlowSensitive/Formula.h" #include "clang/Analysis/FlowSensitive/StorageLocation.h" #include "clang/Analysis/FlowSensitive/Value.h" +#include "llvm/ADT/StringRef.h" #include namespace clang::dataflow { @@ -19,15 +20,17 @@ namespace clang::dataflow { /// For example, `Value`, `StorageLocation`, `Atom`, and `Formula`. class Arena { public: - Arena() : True(makeAtom()), False(makeAtom()) {} + Arena() + : True(Formula::create(Alloc, Formula::Literal, {}, 1)), + False(Formula::create(Alloc, Formula::Literal, {}, 0)) {} Arena(const Arena &) = delete; Arena &operator=(const Arena &) = delete; /// Creates a `T` (some subclass of `StorageLocation`), forwarding `args` to /// the constructor, and returns a reference to it. /// - /// The `DataflowAnalysisContext` takes ownership of the created object. The - /// object will be destroyed when the `DataflowAnalysisContext` is destroyed. + /// The `Arena` takes ownership of the created object. The object will be + /// destroyed when the `Arena` is destroyed. template std::enable_if_t::value, T &> create(Args &&...args) { @@ -42,8 +45,8 @@ public: /// Creates a `T` (some subclass of `Value`), forwarding `args` to the /// constructor, and returns a reference to it. /// - /// The `DataflowAnalysisContext` takes ownership of the created object. The - /// object will be destroyed when the `DataflowAnalysisContext` is destroyed. + /// The `Arena` takes ownership of the created object. The object will be + /// destroyed when the `Arena` is destroyed. template std::enable_if_t::value, T &> create(Args &&...args) { @@ -105,9 +108,11 @@ public: const Formula &makeAtomRef(Atom A); /// Returns a formula for a literal true/false. - const Formula &makeLiteral(bool Value) { - return makeAtomRef(Value ? True : False); - } + const Formula &makeLiteral(bool Value) { return Value ? True : False; } + + // Parses a formula from its textual representation. + // This may refer to atoms that were not produced by makeAtom() yet! + llvm::Expected parseFormula(llvm::StringRef); /// Returns a new atomic boolean variable, distinct from any other. Atom makeAtom() { return static_cast(NextAtom++); }; @@ -139,7 +144,7 @@ private: llvm::DenseMap FormulaValues; unsigned NextAtom = 0; - Atom True, False; + const Formula &True, &False; }; } // namespace clang::dataflow diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h index bb36ed237c1e..768387a121b9 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h @@ -40,15 +40,9 @@ public: static llvm::Expected build(const Decl &D, Stmt &S, ASTContext &C); - /// Builds a ControlFlowContext from an AST node. `D` is the function in which - /// `S` resides. `D` must not be null and `D->isTemplated()` must be false. - LLVM_DEPRECATED("Use the version that takes a const Decl & instead", "") - static llvm::Expected build(const Decl *D, Stmt &S, - ASTContext &C); - /// Returns the `Decl` containing the statement used to construct the CFG, if /// available. - const Decl *getDecl() const { return ContainingDecl; } + const Decl &getDecl() const { return ContainingDecl; } /// Returns the CFG that is stored in this context. const CFG &getCFG() const { return *Cfg; } @@ -64,9 +58,7 @@ public: } private: - // FIXME: Once the deprecated `build` method is removed, mark `D` as "must not - // be null" and add an assertion. - ControlFlowContext(const Decl *D, std::unique_ptr Cfg, + ControlFlowContext(const Decl &D, std::unique_ptr Cfg, llvm::DenseMap StmtToBlock, llvm::BitVector BlockReachable) : ContainingDecl(D), Cfg(std::move(Cfg)), @@ -74,7 +66,7 @@ private: BlockReachable(std::move(BlockReachable)) {} /// The `Decl` containing the statement used to construct the CFG. - const Decl *ContainingDecl; + const Decl &ContainingDecl; std::unique_ptr Cfg; llvm::DenseMap StmtToBlock; llvm::BitVector BlockReachable; diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h index 33eb42897b8a..1dffbe8a09c3 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h @@ -25,9 +25,13 @@ #include "clang/Analysis/FlowSensitive/ControlFlowContext.h" #include "clang/Analysis/FlowSensitive/DataflowEnvironment.h" #include "clang/Analysis/FlowSensitive/DataflowLattice.h" +#include "clang/Analysis/FlowSensitive/MatchSwitch.h" #include "clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h" -#include "llvm/ADT/Any.h" +#include "clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/STLFunctionalExtras.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/Support/Errc.h" #include "llvm/Support/Error.h" namespace clang { @@ -81,14 +85,6 @@ public: explicit DataflowAnalysis(ASTContext &Context) : Context(Context) {} - /// Deprecated. Use the `DataflowAnalysisOptions` constructor instead. - explicit DataflowAnalysis(ASTContext &Context, bool ApplyBuiltinTransfer) - : DataflowAnalysis( - Context, - {ApplyBuiltinTransfer - ? DataflowAnalysisContext::Options{} - : std::optional()}) {} - explicit DataflowAnalysis(ASTContext &Context, DataflowAnalysisOptions Options) : TypeErasedDataflowAnalysis(Options), Context(Context) {} @@ -238,6 +234,76 @@ runDataflowAnalysis( return std::move(BlockStates); } +// Create an analysis class that is derived from `DataflowAnalysis`. This is an +// SFINAE adapter that allows us to call two different variants of constructor +// (either with or without the optional `Environment` parameter). +// FIXME: Make all classes derived from `DataflowAnalysis` take an `Environment` +// parameter in their constructor so that we can get rid of this abomination. +template +auto createAnalysis(ASTContext &ASTCtx, Environment &Env) + -> decltype(AnalysisT(ASTCtx, Env)) { + return AnalysisT(ASTCtx, Env); +} +template +auto createAnalysis(ASTContext &ASTCtx, Environment &Env) + -> decltype(AnalysisT(ASTCtx)) { + return AnalysisT(ASTCtx); +} + +/// Runs a dataflow analysis over the given function and then runs `Diagnoser` +/// over the results. Returns a list of diagnostics for `FuncDecl` or an +/// error. Currently, errors can occur (at least) because the analysis requires +/// too many iterations over the CFG or the SAT solver times out. +/// +/// The default value of `MaxSATIterations` was chosen based on the following +/// observations: +/// - Non-pathological calls to the solver typically require only a few hundred +/// iterations. +/// - This limit is still low enough to keep runtimes acceptable (on typical +/// machines) in cases where we hit the limit. +template +llvm::Expected> diagnoseFunction( + const FunctionDecl &FuncDecl, ASTContext &ASTCtx, + llvm::function_ref( + const CFGElement &, ASTContext &, + const TransferStateForDiagnostics &)> + Diagnoser, + std::int64_t MaxSATIterations = 1'000'000'000) { + llvm::Expected Context = + ControlFlowContext::build(FuncDecl); + if (!Context) + return Context.takeError(); + + auto OwnedSolver = std::make_unique(MaxSATIterations); + const WatchedLiteralsSolver *Solver = OwnedSolver.get(); + DataflowAnalysisContext AnalysisContext(std::move(OwnedSolver)); + Environment Env(AnalysisContext, FuncDecl); + AnalysisT Analysis = createAnalysis(ASTCtx, Env); + llvm::SmallVector Diagnostics; + if (llvm::Error Err = + runTypeErasedDataflowAnalysis( + *Context, Analysis, Env, + [&ASTCtx, &Diagnoser, &Diagnostics]( + const CFGElement &Elt, + const TypeErasedDataflowAnalysisState &State) mutable { + auto EltDiagnostics = Diagnoser( + Elt, ASTCtx, + TransferStateForDiagnostics( + llvm::any_cast( + State.Lattice.Value), + State.Env)); + llvm::move(EltDiagnostics, std::back_inserter(Diagnostics)); + }) + .takeError()) + return std::move(Err); + + if (Solver->reachedLimit()) + return llvm::createStringError(llvm::errc::interrupted, + "SAT solver timed out"); + + return Diagnostics; +} + /// Abstract base class for dataflow "models": reusable analysis components that /// model a particular aspect of program semantics in the `Environment`. For /// example, a model may capture a type and its related functions. diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h index e5c325b876bd..20e45cc27b01 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h @@ -58,6 +58,10 @@ using FieldSet = llvm::SmallSetVector; /// Returns the set of all fields in the type. FieldSet getObjectFields(QualType Type); +/// Returns whether `Fields` and `FieldLocs` contain the same fields. +bool containsSameFields(const FieldSet &Fields, + const RecordStorageLocation::FieldToLoc &FieldLocs); + struct ContextSensitiveOptions { /// The maximum depth to analyze. A value of zero is equivalent to disabling /// context-sensitive analysis entirely. @@ -92,55 +96,59 @@ public: /*Logger=*/nullptr}); ~DataflowAnalysisContext(); + /// Sets a callback that returns the names and types of the synthetic fields + /// to add to a `RecordStorageLocation` of a given type. + /// Typically, this is called from the constructor of a `DataflowAnalysis` + /// + /// To maintain the invariant that all `RecordStorageLocation`s of a given + /// type have the same fields: + /// * The callback must always return the same result for a given type + /// * `setSyntheticFieldCallback()` must be called before any + // `RecordStorageLocation`s are created. + void setSyntheticFieldCallback( + std::function(QualType)> CB) { + assert(!RecordStorageLocationCreated); + SyntheticFieldCallback = CB; + } + /// Returns a new storage location appropriate for `Type`. /// /// A null `Type` is interpreted as the pointee type of `std::nullptr_t`. StorageLocation &createStorageLocation(QualType Type); + /// Creates a `RecordStorageLocation` for the given type and with the given + /// fields. + /// + /// Requirements: + /// + /// `FieldLocs` must contain exactly the fields returned by + /// `getModeledFields(Type)`. + /// `SyntheticFields` must contain exactly the fields returned by + /// `getSyntheticFields(Type)`. + RecordStorageLocation &createRecordStorageLocation( + QualType Type, RecordStorageLocation::FieldToLoc FieldLocs, + RecordStorageLocation::SyntheticFieldMap SyntheticFields); + /// Returns a stable storage location for `D`. - StorageLocation &getStableStorageLocation(const VarDecl &D); + StorageLocation &getStableStorageLocation(const ValueDecl &D); /// Returns a stable storage location for `E`. StorageLocation &getStableStorageLocation(const Expr &E); - /// Assigns `Loc` as the storage location of `D`. - /// - /// Requirements: - /// - /// `D` must not be assigned a storage location. - void setStorageLocation(const ValueDecl &D, StorageLocation &Loc) { - assert(!DeclToLoc.contains(&D)); - DeclToLoc[&D] = &Loc; - } - - /// Returns the storage location assigned to `D` or null if `D` has no - /// assigned storage location. - StorageLocation *getStorageLocation(const ValueDecl &D) const { - return DeclToLoc.lookup(&D); - } - - /// Assigns `Loc` as the storage location of `E`. - /// - /// Requirements: - /// - /// `E` must not be assigned a storage location. - void setStorageLocation(const Expr &E, StorageLocation &Loc) { - const Expr &CanonE = ignoreCFGOmittedNodes(E); - assert(!ExprToLoc.contains(&CanonE)); - ExprToLoc[&CanonE] = &Loc; - } - - /// Returns the storage location assigned to `E` or null if `E` has no - /// assigned storage location. - StorageLocation *getStorageLocation(const Expr &E) const { - return ExprToLoc.lookup(&ignoreCFGOmittedNodes(E)); - } - /// Returns a pointer value that represents a null pointer. Calls with /// `PointeeType` that are canonically equivalent will return the same result. /// A null `PointeeType` can be used for the pointee of `std::nullptr_t`. PointerValue &getOrCreateNullPointerValue(QualType PointeeType); + /// Adds `Constraint` to current and future flow conditions in this context. + /// + /// Invariants must contain only flow-insensitive information, i.e. facts that + /// are true on all paths through the program. + /// Information can be added eagerly (when analysis begins), or lazily (e.g. + /// when values are first used). The analysis must be careful that the same + /// information is added regardless of which order blocks are analyzed in. + void addInvariant(const Formula &Constraint); + /// Adds `Constraint` to the flow condition identified by `Token`. void addFlowConditionConstraint(Atom Token, const Formula &Constraint); @@ -153,13 +161,17 @@ public: /// token. Atom joinFlowConditions(Atom FirstToken, Atom SecondToken); - /// Returns true if and only if the constraints of the flow condition - /// identified by `Token` imply that `Val` is true. - bool flowConditionImplies(Atom Token, const Formula &); + /// Returns true if the constraints of the flow condition identified by + /// `Token` imply that `F` is true. + /// Returns false if the flow condition does not imply `F` or if the solver + /// times out. + bool flowConditionImplies(Atom Token, const Formula &F); - /// Returns true if and only if the constraints of the flow condition - /// identified by `Token` are always true. - bool flowConditionIsTautology(Atom Token); + /// Returns true if the constraints of the flow condition identified by + /// `Token` still allow `F` to be true. + /// Returns false if the flow condition implies that `F` is false or if the + /// solver times out. + bool flowConditionAllows(Atom Token, const Formula &F); /// Returns true if `Val1` is equivalent to `Val2`. /// Note: This function doesn't take into account constraints on `Val1` and @@ -189,6 +201,15 @@ public: /// context. FieldSet getModeledFields(QualType Type); + /// Returns the names and types of the synthetic fields for the given record + /// type. + llvm::StringMap getSyntheticFields(QualType Type) { + assert(Type->isRecordType()); + if (SyntheticFieldCallback) + return SyntheticFieldCallback(Type); + return {}; + } + private: friend class Environment; @@ -207,12 +228,17 @@ private: void addModeledFields(const FieldSet &Fields); /// Adds all constraints of the flow condition identified by `Token` and all - /// of its transitive dependencies to `Constraints`. `VisitedTokens` is used - /// to track tokens of flow conditions that were already visited by recursive - /// calls. - void addTransitiveFlowConditionConstraints( - Atom Token, llvm::SetVector &Constraints, - llvm::DenseSet &VisitedTokens); + /// of its transitive dependencies to `Constraints`. + void + addTransitiveFlowConditionConstraints(Atom Token, + llvm::SetVector &Out); + + /// Returns true if the solver is able to prove that there is a satisfying + /// assignment for `Constraints`. + bool isSatisfiable(llvm::SetVector Constraints) { + return querySolver(std::move(Constraints)).getStatus() == + Solver::Result::Status::Satisfiable; + } /// Returns true if the solver is able to prove that there is no satisfying /// assignment for `Constraints` @@ -257,6 +283,7 @@ private: // dependencies is stored in the `FlowConditionDeps` map. llvm::DenseMap> FlowConditionDeps; llvm::DenseMap FlowConditionConstraints; + const Formula *Invariant = nullptr; llvm::DenseMap FunctionContexts; @@ -264,6 +291,11 @@ private: FieldSet ModeledFields; std::unique_ptr LogOwner; // If created via flags. + + std::function(QualType)> SyntheticFieldCallback; + + /// Has any `RecordStorageLocation` been created yet? + bool RecordStorageLocationCreated = false; }; } // namespace dataflow diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h index 5cf52ad3d722..d7e39ab2616f 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h @@ -38,18 +38,6 @@ namespace clang { namespace dataflow { -/// Indicates what kind of indirections should be skipped past when retrieving -/// storage locations or values. -/// -/// FIXME: Consider renaming this or replacing it with a more appropriate model. -/// See the discussion in https://reviews.llvm.org/D116596 for context. -enum class SkipPast { - /// No indirections should be skipped past. - None, - /// An optional reference should be skipped past. - Reference, -}; - /// Indicates the result of a tentative comparison. enum class ComparisonResult { Same, @@ -88,7 +76,7 @@ public: virtual ComparisonResult compare(QualType Type, const Value &Val1, const Environment &Env1, const Value &Val2, const Environment &Env2) { - // FIXME: Consider adding QualType to StructValue and removing the Type + // FIXME: Consider adding QualType to RecordValue and removing the Type // argument here. return ComparisonResult::Unknown; } @@ -178,6 +166,15 @@ public: /// with a symbolic representation of the `this` pointee. Environment(DataflowAnalysisContext &DACtx, const DeclContext &DeclCtx); + /// Assigns storage locations and values to all parameters, captures, global + /// variables, fields and functions referenced in the function currently being + /// analyzed. + /// + /// Requirements: + /// + /// The function must have a body. + void initialize(); + /// Returns a new environment that is a copy of this one. /// /// The state of the program is initially the same, but can be mutated without @@ -254,7 +251,7 @@ public: /// Creates a storage location for `D`. Does not assign the returned storage /// location to `D` in the environment. Does not assign a value to the /// returned storage location in the environment. - StorageLocation &createStorageLocation(const VarDecl &D); + StorageLocation &createStorageLocation(const ValueDecl &D); /// Creates a storage location for `E`. Does not assign the returned storage /// location to `E` in the environment. Does not assign a value to the @@ -266,73 +263,44 @@ public: /// Requirements: /// /// `D` must not already have a storage location in the environment. - /// - /// If `D` has reference type, `Loc` must refer directly to the referenced - /// object (if any), not to a `ReferenceValue`, and it is not permitted to - /// later change `Loc` to refer to a `ReferenceValue.` void setStorageLocation(const ValueDecl &D, StorageLocation &Loc); /// Returns the storage location assigned to `D` in the environment, or null /// if `D` isn't assigned a storage location in the environment. - /// - /// Note that if `D` has reference type, the storage location that is returned - /// refers directly to the referenced object, not a `ReferenceValue`. StorageLocation *getStorageLocation(const ValueDecl &D) const; - /// Assigns `Loc` as the storage location of `E` in the environment. - /// - /// This function is deprecated; prefer `setStorageLocationStrict()`. - /// For details, see https://discourse.llvm.org/t/70086. - /// - /// Requirements: - /// - /// `E` must not be assigned a storage location in the environment. - void setStorageLocation(const Expr &E, StorageLocation &Loc); + /// Removes the location assigned to `D` in the environment (if any). + void removeDecl(const ValueDecl &D); /// Assigns `Loc` as the storage location of the glvalue `E` in the /// environment. /// - /// This function is the preferred alternative to - /// `setStorageLocation(const Expr &, StorageLocation &)`. Once the migration - /// to strict handling of value categories is complete (see - /// https://discourse.llvm.org/t/70086), `setStorageLocation()` will be - /// removed and this function will be renamed to `setStorageLocation()`. - /// /// Requirements: /// /// `E` must not be assigned a storage location in the environment. /// `E` must be a glvalue or a `BuiltinType::BuiltinFn` - void setStorageLocationStrict(const Expr &E, StorageLocation &Loc); - - /// Returns the storage location assigned to `E` in the environment, applying - /// the `SP` policy for skipping past indirections, or null if `E` isn't - /// assigned a storage location in the environment. - /// - /// This function is deprecated; prefer `getStorageLocationStrict()`. - /// For details, see https://discourse.llvm.org/t/70086. - StorageLocation *getStorageLocation(const Expr &E, SkipPast SP) const; + void setStorageLocation(const Expr &E, StorageLocation &Loc); /// Returns the storage location assigned to the glvalue `E` in the /// environment, or null if `E` isn't assigned a storage location in the /// environment. /// - /// If the storage location for `E` is associated with a - /// `ReferenceValue RefVal`, returns `RefVal.getReferentLoc()` instead. - /// - /// This function is the preferred alternative to - /// `getStorageLocation(const Expr &, SkipPast)`. Once the migration - /// to strict handling of value categories is complete (see - /// https://discourse.llvm.org/t/70086), `getStorageLocation()` will be - /// removed and this function will be renamed to `getStorageLocation()`. - /// /// Requirements: /// `E` must be a glvalue or a `BuiltinType::BuiltinFn` - StorageLocation *getStorageLocationStrict(const Expr &E) const; + StorageLocation *getStorageLocation(const Expr &E) const; /// Returns the storage location assigned to the `this` pointee in the /// environment or null if the `this` pointee has no assigned storage location /// in the environment. - AggregateStorageLocation *getThisPointeeStorageLocation() const; + RecordStorageLocation *getThisPointeeStorageLocation() const { + return ThisPointeeLoc; + } + + /// Sets the storage location assigned to the `this` pointee in the + /// environment. + void setThisPointeeStorageLocation(RecordStorageLocation &Loc) { + ThisPointeeLoc = &Loc; + } /// Returns the location of the result object for a record-type prvalue. /// @@ -357,7 +325,7 @@ public: /// /// Requirements: /// `E` must be a prvalue of record type. - AggregateStorageLocation &getResultObjectLocation(const Expr &RecordPRValue); + RecordStorageLocation &getResultObjectLocation(const Expr &RecordPRValue); /// Returns the return value of the current function. This can be null if: /// - The function has a void return type @@ -416,9 +384,10 @@ public: /// storage locations and values for indirections until it finds a /// non-pointer/non-reference type. /// - /// If `Type` is a class, struct, or union type, calls `setValue()` to - /// associate the `StructValue` with its storage location - /// (`StructValue::getAggregateLoc()`). + /// If `Type` is a class, struct, or union type, creates values for all + /// modeled fields (including synthetic fields) and calls `setValue()` to + /// associate the `RecordValue` with its storage location + /// (`RecordValue::getLoc()`). /// /// If `Type` is one of the following types, this function will always return /// a non-null pointer: @@ -453,7 +422,7 @@ public: /// this value. Otherwise, initializes the object with a value created using /// `createValue()`. Uses the storage location returned by /// `DataflowAnalysisContext::getStableStorageLocation(D)`. - StorageLocation &createObject(const VarDecl &D, const Expr *InitExpr) { + StorageLocation &createObject(const ValueDecl &D, const Expr *InitExpr) { return createObjectInternal(&D, D.getType(), InitExpr); } @@ -479,41 +448,23 @@ public: /// Requirements: /// /// `E` must be a prvalue - /// `Val` must not be a `ReferenceValue` - /// If `Val` is a `StructValue`, its `AggregateStorageLocation` must be the - /// same as that of any `StructValue` that has already been associated with + /// If `Val` is a `RecordValue`, its `RecordStorageLocation` must be the + /// same as that of any `RecordValue` that has already been associated with /// `E`. This is to guarantee that the result object initialized by a prvalue - /// `StructValue` has a durable storage location. - void setValueStrict(const Expr &E, Value &Val); + /// `RecordValue` has a durable storage location. + void setValue(const Expr &E, Value &Val); /// Returns the value assigned to `Loc` in the environment or null if `Loc` /// isn't assigned a value in the environment. Value *getValue(const StorageLocation &Loc) const; - /// Equivalent to `getValue(getStorageLocation(D, SP), SkipPast::None)` if `D` - /// is assigned a storage location in the environment, otherwise returns null. + /// Equivalent to `getValue(getStorageLocation(D))` if `D` is assigned a + /// storage location in the environment, otherwise returns null. Value *getValue(const ValueDecl &D) const; - /// Equivalent to `getValue(getStorageLocation(E, SP), SkipPast::None)` if `E` - /// is assigned a storage location in the environment, otherwise returns null. - /// - /// This function is deprecated; prefer `getValueStrict()`. For details, see - /// https://discourse.llvm.org/t/70086. - Value *getValue(const Expr &E, SkipPast SP) const; - - /// Returns the `Value` assigned to the prvalue `E` in the environment, or - /// null if `E` isn't assigned a value in the environment. - /// - /// This function is the preferred alternative to - /// `getValue(const Expr &, SkipPast)`. Once the migration to strict handling - /// of value categories is complete (see https://discourse.llvm.org/t/70086), - /// `getValue()` will be removed and this function will be renamed to - /// `getValue()`. - /// - /// Requirements: - /// - /// `E` must be a prvalue - Value *getValueStrict(const Expr &E) const; + /// Equivalent to `getValue(getStorageLocation(E, SP))` if `E` is assigned a + /// storage location in the environment, otherwise returns null. + Value *getValue(const Expr &E) const; // FIXME: should we deprecate the following & call arena().create() directly? @@ -536,9 +487,8 @@ public: /// Returns a symbolic boolean value that models a boolean literal equal to /// `Value` - AtomicBoolValue &getBoolLiteralValue(bool Value) const { - return cast( - arena().makeBoolValue(arena().makeLiteral(Value))); + BoolValue &getBoolLiteralValue(bool Value) const { + return arena().makeBoolValue(arena().makeLiteral(Value)); } /// Returns an atomic boolean value. @@ -610,12 +560,23 @@ public: Atom getFlowConditionToken() const { return FlowConditionToken; } /// Record a fact that must be true if this point in the program is reached. - void addToFlowCondition(const Formula &); + void assume(const Formula &); /// Returns true if the formula is always true when this point is reached. - /// Returns false if the formula may be false, or if the flow condition isn't - /// sufficiently precise to prove that it is true. - bool flowConditionImplies(const Formula &) const; + /// Returns false if the formula may be false (or the flow condition isn't + /// sufficiently precise to prove that it is true) or if the solver times out. + /// + /// Note that there is an asymmetry between this function and `allows()` in + /// that they both return false if the solver times out. The assumption is + /// that if `proves()` or `allows()` returns true, this will result in a + /// diagnostic, and we want to bias towards false negatives in the case where + /// the solver times out. + bool proves(const Formula &) const; + + /// Returns true if the formula may be true when this point is reached. + /// Returns false if the formula is always false when this point is reached + /// (or the flow condition is overly constraining) or if the solver times out. + bool allows(const Formula &) const; /// Returns the `DeclContext` of the block being analysed, if any. Otherwise, /// returns null. @@ -627,6 +588,9 @@ public: return dyn_cast(getDeclCtx()); } + /// Returns the size of the call stack. + size_t callStackSize() const { return CallStack.size(); } + /// Returns whether this `Environment` can be extended to analyze the given /// `Callee` (i.e. if `pushCall` can be used), with recursion disallowed and a /// given `MaxDepth`. @@ -644,6 +608,14 @@ private: // The copy-constructor is for use in fork() only. Environment(const Environment &) = default; + /// Internal version of `setStorageLocation()` that doesn't check if the + /// expression is a prvalue. + void setStorageLocationInternal(const Expr &E, StorageLocation &Loc); + + /// Internal version of `getStorageLocation()` that doesn't check if the + /// expression is a prvalue. + StorageLocation *getStorageLocationInternal(const Expr &E) const; + /// Creates a value appropriate for `Type`, if `Type` is supported, otherwise /// return null. /// @@ -669,12 +641,9 @@ private: /// Shared implementation of `createObject()` overloads. /// `D` and `InitExpr` may be null. - StorageLocation &createObjectInternal(const VarDecl *D, QualType Ty, + StorageLocation &createObjectInternal(const ValueDecl *D, QualType Ty, const Expr *InitExpr); - StorageLocation &skip(StorageLocation &Loc, SkipPast SP) const; - const StorageLocation &skip(const StorageLocation &Loc, SkipPast SP) const; - /// Shared implementation of `pushCall` overloads. Note that unlike /// `pushCall`, this member is invoked on the environment of the callee, not /// of the caller. @@ -703,16 +672,19 @@ private: StorageLocation *ReturnLoc = nullptr; // The storage location of the `this` pointee. Should only be null if the // function being analyzed is only a function and not a method. - AggregateStorageLocation *ThisPointeeLoc = nullptr; + RecordStorageLocation *ThisPointeeLoc = nullptr; - // Maps from program declarations and statements to storage locations that are + // Maps from declarations and glvalue expression to storage locations that are // assigned to them. Unlike the maps in `DataflowAnalysisContext`, these // include only storage locations that are in scope for a particular basic // block. llvm::DenseMap DeclToLoc; llvm::DenseMap ExprToLoc; + // Maps from prvalue expressions and storage locations to the values that + // are assigned to them. // We preserve insertion order so that join/widen process values in // deterministic sequence. This in turn produces deterministic SAT formulas. + llvm::MapVector ExprToVal; llvm::MapVector LocToVal; Atom FlowConditionToken; @@ -722,36 +694,35 @@ private: /// `CXXMemberCallExpr`, or null if none is defined in the environment. /// Dereferences the pointer if the member call expression was written using /// `->`. -AggregateStorageLocation * -getImplicitObjectLocation(const CXXMemberCallExpr &MCE, const Environment &Env); +RecordStorageLocation *getImplicitObjectLocation(const CXXMemberCallExpr &MCE, + const Environment &Env); /// Returns the storage location for the base object of a `MemberExpr`, or null /// if none is defined in the environment. Dereferences the pointer if the /// member expression was written using `->`. -AggregateStorageLocation *getBaseObjectLocation(const MemberExpr &ME, - const Environment &Env); +RecordStorageLocation *getBaseObjectLocation(const MemberExpr &ME, + const Environment &Env); /// Returns the fields of `RD` that are initialized by an `InitListExpr`, in the /// order in which they appear in `InitListExpr::inits()`. std::vector getFieldsForInitListExpr(const RecordDecl *RD); -/// Associates a new `StructValue` with `Loc` and returns the new value. +/// Associates a new `RecordValue` with `Loc` and returns the new value. /// It is not defined whether the field values remain the same or not. /// /// This function is primarily intended for use by checks that set custom -/// properties on `StructValue`s to model the state of these values. Such checks -/// should avoid modifying the properties of an existing `StructValue` because +/// properties on `RecordValue`s to model the state of these values. Such checks +/// should avoid modifying the properties of an existing `RecordValue` because /// these changes would be visible to other `Environment`s that share the same -/// `StructValue`. Instead, call `refreshStructValue()`, then set the properties -/// on the new `StructValue` that it returns. Typical usage: +/// `RecordValue`. Instead, call `refreshRecordValue()`, then set the properties +/// on the new `RecordValue` that it returns. Typical usage: /// -/// refreshStructValue(Loc, Env).setProperty("my_prop", MyPropValue); -StructValue &refreshStructValue(AggregateStorageLocation &Loc, - Environment &Env); +/// refreshRecordValue(Loc, Env).setProperty("my_prop", MyPropValue); +RecordValue &refreshRecordValue(RecordStorageLocation &Loc, Environment &Env); -/// Associates a new `StructValue` with `Expr` and returns the new value. +/// Associates a new `RecordValue` with `Expr` and returns the new value. /// See also documentation for the overload above. -StructValue &refreshStructValue(const Expr &Expr, Environment &Env); +RecordValue &refreshRecordValue(const Expr &Expr, Environment &Env); } // namespace dataflow } // namespace clang diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowWorklist.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowWorklist.h index e926adf6f0b2..f1d05743bf7f 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowWorklist.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowWorklist.h @@ -12,6 +12,7 @@ #ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_DATAFLOWWORKLIST_H #define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_DATAFLOWWORKLIST_H +#include "clang/Analysis/Analyses/IntervalPartition.h" #include "clang/Analysis/Analyses/PostOrderCFGView.h" #include "clang/Analysis/CFG.h" #include "llvm/ADT/PriorityQueue.h" @@ -21,16 +22,13 @@ namespace clang { /// on the order defined by 'Comp'. template class DataflowWorklistBase { llvm::BitVector EnqueuedBlocks; - PostOrderCFGView *POV; llvm::PriorityQueue, Comp> WorkList; public: - DataflowWorklistBase(const CFG &Cfg, PostOrderCFGView *POV, Comp C) - : EnqueuedBlocks(Cfg.getNumBlockIDs()), POV(POV), WorkList(C) {} - - const PostOrderCFGView *getCFGView() const { return POV; } + DataflowWorklistBase(const CFG &Cfg, Comp C) + : EnqueuedBlocks(Cfg.getNumBlockIDs()), WorkList(C) {} void enqueueBlock(const CFGBlock *Block) { if (Block && !EnqueuedBlocks[Block->getBlockID()]) { @@ -62,7 +60,7 @@ struct ReversePostOrderCompare { struct ForwardDataflowWorklist : DataflowWorklistBase { ForwardDataflowWorklist(const CFG &Cfg, PostOrderCFGView *POV) - : DataflowWorklistBase(Cfg, POV, + : DataflowWorklistBase(Cfg, ReversePostOrderCompare{POV->getComparator()}) {} ForwardDataflowWorklist(const CFG &Cfg, AnalysisDeclContext &Ctx) @@ -74,6 +72,19 @@ struct ForwardDataflowWorklist } }; +/// A worklist implementation for forward dataflow analysis based on a weak +/// topological ordering of the nodes. The worklist cannot contain the same +/// block multiple times at once. +struct WTODataflowWorklist : DataflowWorklistBase { + WTODataflowWorklist(const CFG &Cfg, const WTOCompare &Cmp) + : DataflowWorklistBase(Cfg, Cmp) {} + + void enqueueSuccessors(const CFGBlock *Block) { + for (auto B : Block->succs()) + enqueueBlock(B); + } +}; + /// A worklist implementation for backward dataflow analysis. The enqueued /// block will be dequeued in post order. The worklist cannot contain the same /// block multiple times at once. @@ -81,8 +92,7 @@ struct BackwardDataflowWorklist : DataflowWorklistBase { BackwardDataflowWorklist(const CFG &Cfg, AnalysisDeclContext &Ctx) : DataflowWorklistBase( - Cfg, Ctx.getAnalysis(), - Ctx.getAnalysis()->getComparator()) {} + Cfg, Ctx.getAnalysis()->getComparator()) {} void enqueuePredecessors(const CFGBlock *Block) { for (auto B : Block->preds()) diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Formula.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Formula.h index 64fe8f5b630a..982e400c1def 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Formula.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Formula.h @@ -13,12 +13,10 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseMapInfo.h" -#include "llvm/ADT/STLFunctionalExtras.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/raw_ostream.h" #include #include -#include namespace clang::dataflow { @@ -54,7 +52,8 @@ public: /// A reference to an atomic boolean variable. /// We name these e.g. "V3", where 3 == atom identity == Value. AtomRef, - // FIXME: add const true/false rather than modeling them as variables + /// Constant true or false. + Literal, Not, /// True if its only operand is false @@ -71,6 +70,11 @@ public: return static_cast(Value); } + bool literal() const { + assert(kind() == Literal); + return static_cast(Value); + } + ArrayRef operands() const { return ArrayRef(reinterpret_cast(this + 1), numOperands(kind())); @@ -83,9 +87,9 @@ public: void print(llvm::raw_ostream &OS, const AtomNames * = nullptr) const; // Allocate Formulas using Arena rather than calling this function directly. - static Formula &create(llvm::BumpPtrAllocator &Alloc, Kind K, - ArrayRef Operands, - unsigned Value = 0); + static const Formula &create(llvm::BumpPtrAllocator &Alloc, Kind K, + ArrayRef Operands, + unsigned Value = 0); private: Formula() = default; @@ -95,6 +99,7 @@ private: static unsigned numOperands(Kind K) { switch (K) { case AtomRef: + case Literal: return 0; case Not: return 1; diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Logger.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Logger.h index 6836488003a9..f4bd39f6ed49 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Logger.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Logger.h @@ -50,7 +50,9 @@ public: /// Called when we start (re-)processing a block in the CFG. /// The target program point is the entry to the specified block. /// Calls to log() describe transferBranch(), join() etc. - virtual void enterBlock(const CFGBlock &) {} + /// `PostVisit` specifies whether we're processing the block for the + /// post-visit callback. + virtual void enterBlock(const CFGBlock &, bool PostVisit) {} /// Called when we start processing an element in the current CFG block. /// The target program point is after the specified element. /// Calls to log() describe the transfer() function. diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h index 9a298478c510..085308f7db54 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h @@ -48,6 +48,10 @@ template struct TransferState { }; /// A read-only version of TransferState. +/// +/// FIXME: this type is being used as a general (typed) view type for untyped +/// dataflow analysis state, rather than strictly for transfer-function +/// purposes. Move it (and rename it) to DataflowAnalysis.h. template struct TransferStateForDiagnostics { TransferStateForDiagnostics(const LatticeT &Lattice, const Environment &Env) : Lattice(Lattice), Env(Env) {} diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h index 23dfdd49e94d..09eb8b938226 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h @@ -21,7 +21,7 @@ #include "clang/Analysis/FlowSensitive/DataflowEnvironment.h" #include "clang/Analysis/FlowSensitive/NoopLattice.h" #include "clang/Basic/SourceLocation.h" -#include +#include "llvm/ADT/SmallVector.h" namespace clang { namespace dataflow { @@ -45,7 +45,7 @@ struct UncheckedOptionalAccessModelOptions { class UncheckedOptionalAccessModel : public DataflowAnalysis { public: - UncheckedOptionalAccessModel(ASTContext &Ctx); + UncheckedOptionalAccessModel(ASTContext &Ctx, dataflow::Environment &Env); /// Returns a matcher for the optional classes covered by this model. static ast_matchers::DeclarationMatcher optionalClassDecl(); @@ -54,17 +54,6 @@ public: void transfer(const CFGElement &Elt, NoopLattice &L, Environment &Env); - ComparisonResult compare(QualType Type, const Value &Val1, - const Environment &Env1, const Value &Val2, - const Environment &Env2) override; - - bool merge(QualType Type, const Value &Val1, const Environment &Env1, - const Value &Val2, const Environment &Env2, Value &MergedVal, - Environment &MergedEnv) override; - - Value *widen(QualType Type, Value &Prev, const Environment &PrevEnv, - Value &Current, Environment &CurrentEnv) override; - private: CFGMatchSwitch> TransferMatchSwitch; }; @@ -74,11 +63,14 @@ public: UncheckedOptionalAccessDiagnoser( UncheckedOptionalAccessModelOptions Options = {}); - std::vector diagnose(ASTContext &Ctx, const CFGElement *Elt, - const Environment &Env); + llvm::SmallVector + operator()(const CFGElement &Elt, ASTContext &Ctx, + const TransferStateForDiagnostics &State) { + return DiagnoseMatchSwitch(Elt, Ctx, State.Env); + } private: - CFGMatchSwitch> + CFGMatchSwitch> DiagnoseMatchSwitch; }; diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h index e28a7f902faf..393f68300cb8 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h @@ -24,15 +24,9 @@ namespace dataflow { class NoopAnalysis : public DataflowAnalysis { public: - /// Deprecated. Use the `DataflowAnalysisOptions` constructor instead. - NoopAnalysis(ASTContext &Context, bool ApplyBuiltinTransfer) - : DataflowAnalysis(Context, - ApplyBuiltinTransfer) {} + NoopAnalysis(ASTContext &Context) + : DataflowAnalysis(Context) {} - /// `ApplyBuiltinTransfer` controls whether to run the built-in transfer - /// functions that model memory during the analysis. Their results are not - /// used by `NoopAnalysis`, but tests that need to inspect the environment - /// should enable them. NoopAnalysis(ASTContext &Context, DataflowAnalysisOptions Options) : DataflowAnalysis(Context, Options) {} diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/RecordOps.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/RecordOps.h index c9c302b9199b..7b87840d626b 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/RecordOps.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/RecordOps.h @@ -21,24 +21,24 @@ namespace dataflow { /// Copies a record (struct, class, or union) from `Src` to `Dst`. /// -/// This performs a deep copy, i.e. it copies every field and recurses on -/// fields of record type. It also copies properties from the `StructValue` -/// associated with `Src` to the `StructValue` associated with `Dst` (if these -/// `StructValue`s exist). +/// This performs a deep copy, i.e. it copies every field (including synthetic +/// fields) and recurses on fields of record type. It also copies properties +/// from the `RecordValue` associated with `Src` to the `RecordValue` associated +/// with `Dst` (if these `RecordValue`s exist). /// -/// If there is a `StructValue` associated with `Dst` in the environment, this -/// function creates a new `StructValue` and associates it with `Dst`; clients -/// need to be aware of this and must not assume that the `StructValue` +/// If there is a `RecordValue` associated with `Dst` in the environment, this +/// function creates a new `RecordValue` and associates it with `Dst`; clients +/// need to be aware of this and must not assume that the `RecordValue` /// associated with `Dst` remains the same after the call. /// -/// We create a new `StructValue` rather than modifying properties on the old -/// `StructValue` because the old `StructValue` may be shared with other +/// We create a new `RecordValue` rather than modifying properties on the old +/// `RecordValue` because the old `RecordValue` may be shared with other /// `Environment`s, and we don't want changes to properties to be visible there. /// /// Requirements: /// /// `Src` and `Dst` must have the same canonical unqualified type. -void copyRecord(AggregateStorageLocation &Src, AggregateStorageLocation &Dst, +void copyRecord(RecordStorageLocation &Src, RecordStorageLocation &Dst, Environment &Env); /// Returns whether the records `Loc1` and `Loc2` are equal. @@ -47,10 +47,11 @@ void copyRecord(AggregateStorageLocation &Src, AggregateStorageLocation &Dst, /// retrieved from `Env2`. A convenience overload retrieves values for `Loc1` /// and `Loc2` from the same environment. /// -/// This performs a deep comparison, i.e. it compares every field and recurses -/// on fields of record type. Fields of reference type compare equal if they -/// refer to the same storage location. If `StructValue`s are associated with -/// `Loc1` and `Loc2`, it also compares the properties on those `StructValue`s. +/// This performs a deep comparison, i.e. it compares every field (including +/// synthetic fields) and recurses on fields of record type. Fields of reference +/// type compare equal if they refer to the same storage location. If +/// `RecordValue`s are associated with `Loc1` and Loc2`, it also compares the +/// properties on those `RecordValue`s. /// /// Note on how to interpret the result: /// - If this returns true, the records are guaranteed to be equal at runtime. @@ -60,12 +61,11 @@ void copyRecord(AggregateStorageLocation &Src, AggregateStorageLocation &Dst, /// Requirements: /// /// `Src` and `Dst` must have the same canonical unqualified type. -bool recordsEqual(const AggregateStorageLocation &Loc1, const Environment &Env1, - const AggregateStorageLocation &Loc2, - const Environment &Env2); +bool recordsEqual(const RecordStorageLocation &Loc1, const Environment &Env1, + const RecordStorageLocation &Loc2, const Environment &Env2); -inline bool recordsEqual(const AggregateStorageLocation &Loc1, - const AggregateStorageLocation &Loc2, +inline bool recordsEqual(const RecordStorageLocation &Loc1, + const RecordStorageLocation &Loc2, const Environment &Env) { return recordsEqual(Loc1, Env, Loc2, Env); } diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/SimplifyConstraints.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/SimplifyConstraints.h new file mode 100644 index 000000000000..fadb3caf0a4c --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/SimplifyConstraints.h @@ -0,0 +1,49 @@ +//===-- SimplifyConstraints.h -----------------------------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_SIMPLIFYCONSTRAINTS_H +#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_SIMPLIFYCONSTRAINTS_H + +#include "clang/Analysis/FlowSensitive/Arena.h" +#include "clang/Analysis/FlowSensitive/Formula.h" +#include "llvm/ADT/SetVector.h" + +namespace clang { +namespace dataflow { + +/// Information on the way a set of constraints was simplified. +struct SimplifyConstraintsInfo { + /// List of equivalence classes of atoms. For each equivalence class, the + /// original constraints imply that all atoms in it must be equivalent. + /// Simplification replaces all occurrences of atoms in an equivalence class + /// with a single representative atom from the class. + /// Does not contain equivalence classes with just one member or atoms + /// contained in `TrueAtoms` or `FalseAtoms`. + llvm::SmallVector> EquivalentAtoms; + /// Atoms that the original constraints imply must be true. + /// Simplification replaces all occurrences of these atoms by a true literal + /// (which may enable additional simplifications). + llvm::SmallVector TrueAtoms; + /// Atoms that the original constraints imply must be false. + /// Simplification replaces all occurrences of these atoms by a false literal + /// (which may enable additional simplifications). + llvm::SmallVector FalseAtoms; +}; + +/// Simplifies a set of constraints (implicitly connected by "and") in a way +/// that does not change satisfiability of the constraints. This does _not_ mean +/// that the set of solutions is the same before and after simplification. +/// `Info`, if non-null, will be populated with information about the +/// simplifications that were made to the formula (e.g. to display to the user). +void simplifyConstraints(llvm::SetVector &Constraints, + Arena &arena, SimplifyConstraintsInfo *Info = nullptr); + +} // namespace dataflow +} // namespace clang + +#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_SIMPLIFYCONSTRAINTS_H diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h index 62e3d5e59c65..8fcc6a44027a 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h @@ -31,7 +31,10 @@ namespace dataflow { /// values is stored in the environment. class StorageLocation { public: - enum class Kind { Scalar, Aggregate }; + enum class Kind { + Scalar, + Record, + }; StorageLocation(Kind LocKind, QualType Type) : LocKind(LocKind), Type(Type) { assert(Type.isNull() || !Type->isReferenceType()); @@ -66,11 +69,17 @@ public: } }; -/// A storage location which is subdivided into smaller storage locations that -/// can be traced independently by abstract interpretation. For example: a -/// struct with public members. The child map is flat, so when used for a struct -/// or class type, all accessible members of base struct and class types are -/// directly accesible as children of this location. +/// A storage location for a record (struct, class, or union). +/// +/// Contains storage locations for all modeled fields of the record (also +/// referred to as "children"). The child map is flat, so accessible members of +/// the base class are directly accessible as children of this location. +/// +/// Record storage locations may also contain so-called synthetic fields. These +/// are typically used to model the internal state of a class (e.g. the value +/// stored in a `std::optional`) without having to depend on that class's +/// implementation details. All `RecordStorageLocation`s of a given type should +/// have the same synthetic fields. /// /// The storage location for a field of reference type may be null. This /// typically occurs in one of two situations: @@ -82,16 +91,15 @@ public: /// FIXME: Currently, the storage location of unions is modelled the same way as /// that of structs or classes. Eventually, we need to change this modelling so /// that all of the members of a given union have the same storage location. -class AggregateStorageLocation final : public StorageLocation { +class RecordStorageLocation final : public StorageLocation { public: using FieldToLoc = llvm::DenseMap; + using SyntheticFieldMap = llvm::StringMap; - explicit AggregateStorageLocation(QualType Type) - : AggregateStorageLocation(Type, FieldToLoc()) {} - - AggregateStorageLocation(QualType Type, FieldToLoc TheChildren) - : StorageLocation(Kind::Aggregate, Type), - Children(std::move(TheChildren)) { + RecordStorageLocation(QualType Type, FieldToLoc TheChildren, + SyntheticFieldMap TheSyntheticFields) + : StorageLocation(Kind::Record, Type), Children(std::move(TheChildren)), + SyntheticFields(std::move(TheSyntheticFields)) { assert(!Type.isNull()); assert(Type->isRecordType()); assert([this] { @@ -104,7 +112,7 @@ public: } static bool classof(const StorageLocation *Loc) { - return Loc->getKind() == Kind::Aggregate; + return Loc->getKind() == Kind::Record; } /// Returns the child storage location for `D`. @@ -131,9 +139,22 @@ public: return It->second; } + /// Returns the storage location for the synthetic field `Name`. + /// The synthetic field must exist. + StorageLocation &getSyntheticField(llvm::StringRef Name) const { + StorageLocation *Loc = SyntheticFields.lookup(Name); + assert(Loc != nullptr); + return *Loc; + } + + llvm::iterator_range + synthetic_fields() const { + return {SyntheticFields.begin(), SyntheticFields.end()}; + } + /// Changes the child storage location for a field `D` of reference type. /// All other fields cannot change their storage location and always retain - /// the storage location passed to the `AggregateStorageLocation` constructor. + /// the storage location passed to the `RecordStorageLocation` constructor. /// /// Requirements: /// @@ -149,6 +170,7 @@ public: private: FieldToLoc Children; + SyntheticFieldMap SyntheticFields; }; } // namespace dataflow diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h index 88a33d19f7d8..67c323dbf45e 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h @@ -132,25 +132,6 @@ struct TypeErasedDataflowAnalysisState { } }; -/// Transfers the state of a basic block by evaluating each of its elements in -/// the context of `Analysis` and the states of its predecessors that are -/// available in `BlockStates`. `PostVisitCFG` (if provided) will be applied to -/// each element in the block, after it is evaluated. -/// -/// Requirements: -/// -/// All predecessors of `Block` except those with loop back edges must have -/// already been transferred. States in `BlockStates` that are set to -/// `std::nullopt` represent basic blocks that are not evaluated yet. -TypeErasedDataflowAnalysisState transferBlock( - const ControlFlowContext &CFCtx, - llvm::ArrayRef> BlockStates, - const CFGBlock &Block, const Environment &InitEnv, - TypeErasedDataflowAnalysis &Analysis, - std::function - PostVisitCFG = nullptr); - /// Performs dataflow analysis and returns a mapping from basic block IDs to /// dataflow analysis states that model the respective basic blocks. Indices of /// the returned vector correspond to basic block IDs. Returns an error if the diff --git a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Value.h b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Value.h index 7d9a7b7d2825..e6c68e5b4e93 100644 --- a/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Value.h +++ b/contrib/llvm-project/clang/include/clang/Analysis/FlowSensitive/Value.h @@ -34,9 +34,8 @@ class Value { public: enum class Kind { Integer, - Reference, Pointer, - Struct, + Record, // TODO: Top values should not be need to be type-specific. TopBool, @@ -82,8 +81,8 @@ private: /// transitivity. It does *not* include comparison of `Properties`. /// /// Computes equivalence for these subclasses: -/// * ReferenceValue, PointerValue -- pointee locations are equal. Does not -/// compute deep equality of `Value` at said location. +/// * PointerValue -- pointee locations are equal. Does not compute deep +/// equality of `Value` at said location. /// * TopBoolValue -- both are `TopBoolValue`s. /// /// Otherwise, falls back to pointer equality. @@ -165,23 +164,6 @@ public: } }; -/// Models a dereferenced pointer. For example, a reference in C++ or an lvalue -/// in C. -class ReferenceValue final : public Value { -public: - explicit ReferenceValue(StorageLocation &ReferentLoc) - : Value(Kind::Reference), ReferentLoc(ReferentLoc) {} - - static bool classof(const Value *Val) { - return Val->getKind() == Kind::Reference; - } - - StorageLocation &getReferentLoc() const { return ReferentLoc; } - -private: - StorageLocation &ReferentLoc; -}; - /// Models a symbolic pointer. Specifically, any value of type `T*`. class PointerValue final : public Value { public: @@ -202,13 +184,13 @@ private: /// In C++, prvalues of class type serve only a limited purpose: They can only /// be used to initialize a result object. It is not possible to access member /// variables or call member functions on a prvalue of class type. -/// Correspondingly, `StructValue` also serves only two limited purposes: +/// Correspondingly, `RecordValue` also serves only two limited purposes: /// - It conveys a prvalue of class type from the place where the object is /// constructed to the result object that it initializes. /// /// When creating a prvalue of class type, we already need a storage location /// for `this`, even though prvalues are otherwise not associated with storage -/// locations. `StructValue` is therefore essentially a wrapper for a storage +/// locations. `RecordValue` is therefore essentially a wrapper for a storage /// location, which is then used to set the storage location for the result /// object when we process the AST node for that result object. /// @@ -216,41 +198,35 @@ private: /// MyStruct S = MyStruct(3); /// /// In this example, `MyStruct(3) is a prvalue, which is modeled as a -/// `StructValue` that wraps an `AbstractStorageLocation`. This -// `AbstractStorageLocation` is then used as the storage location for `S`. +/// `RecordValue` that wraps a `RecordStorageLocation`. This +// `RecordStorageLocation` is then used as the storage location for `S`. /// /// - It allows properties to be associated with an object of class type. /// Note that when doing so, you should avoid mutating the properties of an -/// existing `StructValue` in place, as these changes would be visible to -/// other `Environment`s that share the same `StructValue`. Instead, associate -/// a new `StructValue` with the `AggregateStorageLocation` and set the -/// properties on this new `StructValue`. (See also `refreshStructValue()` in +/// existing `RecordValue` in place, as these changes would be visible to +/// other `Environment`s that share the same `RecordValue`. Instead, associate +/// a new `RecordValue` with the `RecordStorageLocation` and set the +/// properties on this new `RecordValue`. (See also `refreshRecordValue()` in /// DataflowEnvironment.h, which makes this easy.) /// Note also that this implies that it is common for the same -/// `AggregateStorageLocation` to be associated with different `StructValue`s +/// `RecordStorageLocation` to be associated with different `RecordValue`s /// in different environments. -/// Over time, we may eliminate `StructValue` entirely. See also the discussion +/// Over time, we may eliminate `RecordValue` entirely. See also the discussion /// here: https://reviews.llvm.org/D155204#inline-1503204 -class StructValue final : public Value { +class RecordValue final : public Value { public: - explicit StructValue(AggregateStorageLocation &Loc) - : Value(Kind::Struct), Loc(Loc) {} + explicit RecordValue(RecordStorageLocation &Loc) + : Value(Kind::Record), Loc(Loc) {} static bool classof(const Value *Val) { - return Val->getKind() == Kind::Struct; + return Val->getKind() == Kind::Record; } - /// Returns the storage location that this `StructValue` is associated with. - AggregateStorageLocation &getAggregateLoc() const { return Loc; } - - /// Convenience function that returns the child storage location for `Field`. - /// See also the documentation for `AggregateStorageLocation::getChild()`. - StorageLocation *getChild(const ValueDecl &Field) const { - return Loc.getChild(Field); - } + /// Returns the storage location that this `RecordValue` is associated with. + RecordStorageLocation &getLoc() const { return Loc; } private: - AggregateStorageLocation &Loc; + RecordStorageLocation &Loc; }; raw_ostream &operator<<(raw_ostream &OS, const Value &Val); diff --git a/contrib/llvm-project/clang/include/clang/Basic/AArch64SVEACLETypes.def b/contrib/llvm-project/clang/include/clang/Basic/AArch64SVEACLETypes.def index 56af270e1d10..fa9c1ac0491c 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/AArch64SVEACLETypes.def +++ b/contrib/llvm-project/clang/include/clang/Basic/AArch64SVEACLETypes.def @@ -71,7 +71,7 @@ SVE_VECTOR_TYPE("__SVFloat16_t", "__SVFloat16_t", SveFloat16, SveFloat16Ty, 8, 1 SVE_VECTOR_TYPE("__SVFloat32_t", "__SVFloat32_t", SveFloat32, SveFloat32Ty, 4, 32, true, true, false) SVE_VECTOR_TYPE("__SVFloat64_t", "__SVFloat64_t", SveFloat64, SveFloat64Ty, 2, 64, true, true, false) -SVE_VECTOR_TYPE("__SVBFloat16_t", "__SVBFloat16_t", SveBFloat16, SveBFloat16Ty, 8, 16, true, false, true) +SVE_VECTOR_TYPE("__SVBfloat16_t", "__SVBfloat16_t", SveBFloat16, SveBFloat16Ty, 8, 16, true, false, true) // // x2 diff --git a/contrib/llvm-project/clang/include/clang/Basic/Attr.td b/contrib/llvm-project/clang/include/clang/Basic/Attr.td index d5204b286966..2b57058d3f1c 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Attr.td +++ b/contrib/llvm-project/clang/include/clang/Basic/Attr.td @@ -107,6 +107,10 @@ def NonBitField : SubsetSubjectisBitField()}], "non-bit-field non-static data members">; +def BitField : SubsetSubjectisBitField()}], + "bit-field data members">; + def NonStaticCXXMethod : SubsetSubjectisStatic()}], "non-static member functions">; @@ -273,23 +277,28 @@ class DefaultIntArgument : IntArgument { int Default = default; } -// This argument is more complex, it includes the enumerator type name, -// a list of strings to accept, and a list of enumerators to map them to. +// This argument is more complex, it includes the enumerator type +// name, whether the enum type is externally defined, a list of +// strings to accept, and a list of enumerators to map them to. class EnumArgument values, - list enums, bit opt = 0, bit fake = 0> + list enums, bit opt = 0, bit fake = 0, + bit isExternalType = 0> : Argument { string Type = type; list Values = values; list Enums = enums; + bit IsExternalType = isExternalType; } // FIXME: There should be a VariadicArgument type that takes any other type // of argument and generates the appropriate type. class VariadicEnumArgument values, - list enums> : Argument { + list enums, bit isExternalType = 0> + : Argument { string Type = type; list Values = values; list Enums = enums; + bit IsExternalType = isExternalType; } // This handles one spelling of an attribute. @@ -300,14 +309,17 @@ class Spelling { } class GNU : Spelling; -class Declspec : Spelling; +class Declspec : Spelling { + bit PrintOnLeft = 1; +} class Microsoft : Spelling; class CXX11 : Spelling { + bit CanPrintOnLeft = 0; string Namespace = namespace; } -class C2x - : Spelling { +class C23 + : Spelling { string Namespace = namespace; } @@ -330,14 +342,14 @@ class Pragma : Spelling { } // The GCC spelling implies GNU, CXX11<"gnu", name>, and optionally, -// C2x<"gnu", name>. This spelling should be used for any GCC-compatible +// C23<"gnu", name>. This spelling should be used for any GCC-compatible // attributes. class GCC : Spelling { bit AllowInC = allowInC; } // The Clang spelling implies GNU, CXX11<"clang", name>, and optionally, -// C2x<"clang", name>. This spelling should be used for any Clang-specific +// C23<"clang", name>. This spelling should be used for any Clang-specific // attributes. class Clang : Spelling { @@ -415,7 +427,7 @@ class TargetArch arches> : TargetSpec { let Arches = arches; } def TargetARM : TargetArch<["arm", "thumb", "armeb", "thumbeb"]>; -def TargetAArch64 : TargetArch<["aarch64"]>; +def TargetAArch64 : TargetArch<["aarch64", "aarch64_be", "aarch64_32"]>; def TargetAnyArm : TargetArch; def TargetAVR : TargetArch<["avr"]>; def TargetBPF : TargetArch<["bpfel", "bpfeb"]>; @@ -443,10 +455,19 @@ def TargetMicrosoftCXXABI : TargetArch<["x86", "x86_64", "arm", "thumb", "aarch6 def TargetELF : TargetSpec { let ObjectFormats = ["ELF"]; } +def TargetELFOrMachO : TargetSpec { + let ObjectFormats = ["ELF", "MachO"]; +} def TargetSupportsInitPriority : TargetSpec { let CustomCode = [{ !Target.getTriple().isOSzOS() }]; } + +class TargetSpecificSpelling spellings> { + TargetSpec Target = target; + list Spellings = spellings; +} + // Attribute subject match rules that are used for #pragma clang attribute. // // A instance of AttrSubjectMatcherRule represents an individual match rule. @@ -559,6 +580,12 @@ class AttrSubjectMatcherAggregateRule { def SubjectMatcherForNamed : AttrSubjectMatcherAggregateRule; class Attr { + // Specifies that when printed, this attribute is meaningful on the + // 'left side' of the declaration. + bit CanPrintOnLeft = 1; + // Specifies that when printed, this attribute is required to be printed on + // the 'left side' of the declaration. + bit PrintOnLeft = 0; // The various ways in which an attribute can be spelled in source list Spellings; // The things to which an attribute can appertain @@ -567,6 +594,8 @@ class Attr { list Args = []; // Accessors which should be generated for the attribute. list Accessors = []; + // Specify targets for spellings. + list TargetSpecificSpellings = []; // Set to true for attributes with arguments which require delayed parsing. bit LateParsed = 0; // Set to false to prevent an attribute from being propagated from a template @@ -707,7 +736,7 @@ def Alias : Attr { def BuiltinAlias : Attr { let Spellings = [CXX11<"clang", "builtin_alias">, - C2x<"clang", "builtin_alias">, + C23<"clang", "builtin_alias">, GNU<"clang_builtin_alias">]; let Args = [IdentifierArgument<"BuiltinName">]; let Subjects = SubjectList<[Function], ErrorDiag>; @@ -769,9 +798,9 @@ def AlignNatural : InheritableAttr { def AlwaysInline : DeclOrStmtAttr { let Spellings = [GCC<"always_inline">, CXX11<"clang", "always_inline">, - C2x<"clang", "always_inline">, CustomKeyword<"__forceinline">]; + C23<"clang", "always_inline">, CustomKeyword<"__forceinline">]; let Accessors = [Accessor<"isClangAlwaysInline", [CXX11<"clang", "always_inline">, - C2x<"clang", "always_inline">]>]; + C23<"clang", "always_inline">]>]; let Subjects = SubjectList<[Function, Stmt], WarnDiag, "functions and statements">; let Documentation = [AlwaysInlineDocs]; @@ -857,7 +886,7 @@ def Annotate : InheritableParamAttr { } def AnnotateType : TypeAttr { - let Spellings = [CXX11<"clang", "annotate_type">, C2x<"clang", "annotate_type">]; + let Spellings = [CXX11<"clang", "annotate_type">, C23<"clang", "annotate_type">]; let Args = [StringArgument<"Annotation">, VariadicExprArgument<"Args">]; let HasCustomParsing = 1; let AcceptsExprPack = 1; @@ -892,6 +921,7 @@ def AVRSignal : InheritableAttr, TargetSpecificAttr { } def AsmLabel : InheritableAttr { + let CanPrintOnLeft = 0; let Spellings = [CustomKeyword<"asm">, CustomKeyword<"__asm__">]; let Args = [ // Label specifies the mangled name for the decl. @@ -1055,6 +1085,42 @@ def CFConsumed : InheritableParamAttr { let Documentation = [RetainBehaviorDocs]; } + +// coro_only_destroy_when_complete indicates the coroutines whose return type +// is marked by coro_only_destroy_when_complete can only be destroyed when the +// coroutine completes. Then the space for the destroy functions can be saved. +def CoroOnlyDestroyWhenComplete : InheritableAttr { + let Spellings = [Clang<"coro_only_destroy_when_complete">]; + let Subjects = SubjectList<[CXXRecord]>; + let LangOpts = [CPlusPlus]; + let Documentation = [CoroOnlyDestroyWhenCompleteDocs]; + let SimpleHandler = 1; +} + +def CoroReturnType : InheritableAttr { + let Spellings = [Clang<"coro_return_type">]; + let Subjects = SubjectList<[CXXRecord]>; + let LangOpts = [CPlusPlus]; + let Documentation = [CoroReturnTypeAndWrapperDoc]; + let SimpleHandler = 1; +} + +def CoroWrapper : InheritableAttr { + let Spellings = [Clang<"coro_wrapper">]; + let Subjects = SubjectList<[Function]>; + let LangOpts = [CPlusPlus]; + let Documentation = [CoroReturnTypeAndWrapperDoc]; + let SimpleHandler = 1; +} + +def CoroLifetimeBound : InheritableAttr { + let Spellings = [Clang<"coro_lifetimebound">]; + let Subjects = SubjectList<[CXXRecord]>; + let LangOpts = [CPlusPlus]; + let Documentation = [CoroLifetimeBoundDoc]; + let SimpleHandler = 1; +} + // OSObject-based attributes. def OSConsumed : InheritableParamAttr { let Spellings = [Clang<"os_consumed">]; @@ -1148,7 +1214,7 @@ def Constructor : InheritableAttr { let Spellings = [GCC<"constructor">]; let Args = [DefaultIntArgument<"Priority", 65535>]; let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; + let Documentation = [CtorDtorDocs]; } def CPUSpecific : InheritableAttr { @@ -1257,7 +1323,8 @@ def CUDAInvalidTarget : InheritableAttr { def CUDALaunchBounds : InheritableAttr { let Spellings = [GNU<"launch_bounds">, Declspec<"__launch_bounds__">]; - let Args = [ExprArgument<"MaxThreads">, ExprArgument<"MinBlocks", 1>]; + let Args = [ExprArgument<"MaxThreads">, ExprArgument<"MinBlocks", 1>, + ExprArgument<"MaxBlocks", 1>]; let LangOpts = [CUDA]; let Subjects = SubjectList<[ObjCMethod, FunctionLike]>; // An AST node is created for this attribute, but is not used by other parts @@ -1297,7 +1364,7 @@ def C11NoReturn : InheritableAttr { def CXX11NoReturn : InheritableAttr { let Spellings = [CXX11<"", "noreturn", 200809>, - C2x<"", "noreturn", 202202>, C2x<"", "_Noreturn", 202202>]; + C23<"", "noreturn", 202202>, C23<"", "_Noreturn", 202202>]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [CXX11NoReturnDocs]; } @@ -1401,7 +1468,7 @@ def RenderScriptKernel : Attr { def Deprecated : InheritableAttr { let Spellings = [GCC<"deprecated">, Declspec<"deprecated">, CXX11<"","deprecated", 201309>, - C2x<"", "deprecated", 201904>]; + C23<"", "deprecated", 201904>]; let Args = [StringArgument<"Message", 1>, // An optional string argument that enables us to provide a // Fix-It. @@ -1414,7 +1481,7 @@ def Destructor : InheritableAttr { let Spellings = [GCC<"destructor">]; let Args = [DefaultIntArgument<"Priority", 65535>]; let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; + let Documentation = [CtorDtorDocs]; } def EmptyBases : InheritableAttr, TargetSpecificAttr { @@ -1434,6 +1501,7 @@ def AllocSize : InheritableAttr { } def EnableIf : InheritableAttr { + let CanPrintOnLeft = 0; // Does not have a [[]] spelling because this attribute requires the ability // to parse function arguments but the attribute is not written in the type // position. @@ -1459,7 +1527,7 @@ def ExtVectorType : Attr { def FallThrough : StmtAttr { let Spellings = [CXX11<"", "fallthrough", 201603>, - C2x<"", "fallthrough", 201910>, + C23<"", "fallthrough", 201910>, CXX11<"clang", "fallthrough">, GCC<"fallthrough">]; // The attribute only applies to a NullStmt, but we have special fix-it // behavior if applied to a case label. @@ -1469,12 +1537,12 @@ def FallThrough : StmtAttr { } def Likely : StmtAttr { - let Spellings = [CXX11<"", "likely", 201803>, C2x<"clang", "likely">]; + let Spellings = [CXX11<"", "likely", 201803>, C23<"clang", "likely">]; let Documentation = [LikelihoodDocs]; } def Unlikely : StmtAttr { - let Spellings = [CXX11<"", "unlikely", 201803>, C2x<"clang", "unlikely">]; + let Spellings = [CXX11<"", "unlikely", 201803>, C23<"clang", "unlikely">]; let Documentation = [LikelihoodDocs]; } def : MutualExclusions<[Likely, Unlikely]>; @@ -1600,7 +1668,7 @@ def IBOutletCollection : InheritableAttr { let Documentation = [Undocumented]; } -def IFunc : Attr, TargetSpecificAttr { +def IFunc : Attr, TargetSpecificAttr { let Spellings = [GCC<"ifunc">]; let Args = [StringArgument<"Resolver">]; let Subjects = SubjectList<[Function]>; @@ -1787,11 +1855,14 @@ def ArmMveStrictPolymorphism : TypeAttr, TargetSpecificAttr { let Documentation = [ArmMveStrictPolymorphismDocs]; } -def NoUniqueAddress : InheritableAttr, TargetSpecificAttr { - let Spellings = [CXX11<"", "no_unique_address", 201803>]; +def NoUniqueAddress : InheritableAttr { let Subjects = SubjectList<[NonBitField], ErrorDiag>; + let Spellings = [CXX11<"", "no_unique_address", 201803>, CXX11<"msvc", "no_unique_address", 201803>]; + let TargetSpecificSpellings = [ + TargetSpecificSpelling]>, + TargetSpecificSpelling]>, + ]; let Documentation = [NoUniqueAddressDocs]; - let SimpleHandler = 1; } def ReturnsTwice : InheritableAttr { @@ -1853,10 +1924,10 @@ def Convergent : InheritableAttr { def NoInline : DeclOrStmtAttr { let Spellings = [CustomKeyword<"__noinline__">, GCC<"noinline">, - CXX11<"clang", "noinline">, C2x<"clang", "noinline">, + CXX11<"clang", "noinline">, C23<"clang", "noinline">, Declspec<"noinline">]; let Accessors = [Accessor<"isClangNoInline", [CXX11<"clang", "noinline">, - C2x<"clang", "noinline">]>]; + C23<"clang", "noinline">]>]; let Documentation = [NoInlineDocs]; let Subjects = SubjectList<[Function, Stmt], WarnDiag, "functions and statements">; @@ -1956,6 +2027,14 @@ def BPFPreserveAccessIndex : InheritableAttr, let LangOpts = [COnly]; } +def BPFPreserveStaticOffset : InheritableAttr, + TargetSpecificAttr { + let Spellings = [Clang<"preserve_static_offset">]; + let Subjects = SubjectList<[Record], ErrorDiag>; + let Documentation = [BPFPreserveStaticOffsetDocs]; + let LangOpts = [COnly]; +} + def BTFDeclTag : InheritableAttr { let Spellings = [Clang<"btf_decl_tag">]; let Args = [StringArgument<"BTFDeclTag">]; @@ -2136,7 +2215,8 @@ def NotTailCalled : InheritableAttr { def : MutualExclusions<[AlwaysInline, NotTailCalled]>; def NoStackProtector : InheritableAttr { - let Spellings = [Clang<"no_stack_protector">, Declspec<"safebuffers">]; + let Spellings = [Clang<"no_stack_protector">, CXX11<"gnu", "no_stack_protector">, + C23<"gnu", "no_stack_protector">, Declspec<"safebuffers">]; let Subjects = SubjectList<[Function]>; let Documentation = [NoStackProtectorDocs]; let SimpleHandler = 1; @@ -2435,9 +2515,43 @@ def AArch64SVEPcs: DeclOrTypeAttr { def ArmStreaming : TypeAttr, TargetSpecificAttr { let Spellings = [RegularKeyword<"__arm_streaming">]; - let Documentation = [ArmStreamingDocs]; + let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>; + let Documentation = [ArmSmeStreamingDocs]; } +def ArmStreamingCompatible : TypeAttr, TargetSpecificAttr { + let Spellings = [RegularKeyword<"__arm_streaming_compatible">]; + let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>; + let Documentation = [ArmSmeStreamingCompatibleDocs]; +} + +def ArmSharedZA : TypeAttr, TargetSpecificAttr { + let Spellings = [RegularKeyword<"__arm_shared_za">]; + let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>; + let Documentation = [ArmSmeSharedZADocs]; +} + +def ArmPreservesZA : TypeAttr, TargetSpecificAttr { + let Spellings = [RegularKeyword<"__arm_preserves_za">]; + let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>; + let Documentation = [ArmSmePreservesZADocs]; +} + +def ArmLocallyStreaming : InheritableAttr, TargetSpecificAttr { + let Spellings = [RegularKeyword<"__arm_locally_streaming">]; + let Subjects = SubjectList<[Function], ErrorDiag>; + let Documentation = [ArmSmeLocallyStreamingDocs]; +} + +def ArmNewZA : InheritableAttr, TargetSpecificAttr { + let Spellings = [RegularKeyword<"__arm_new_za">]; + let Subjects = SubjectList<[Function], ErrorDiag>; + let Documentation = [ArmSmeNewZADocs]; +} +def : MutualExclusions<[ArmNewZA, ArmSharedZA]>; +def : MutualExclusions<[ArmNewZA, ArmPreservesZA]>; + + def Pure : InheritableAttr { let Spellings = [GCC<"pure">]; let Documentation = [Undocumented]; @@ -2682,9 +2796,10 @@ def SwiftAsyncError : InheritableAttr { let Documentation = [SwiftAsyncErrorDocs]; } -def Suppress : StmtAttr { - let Spellings = [CXX11<"gsl", "suppress">]; +def Suppress : DeclOrStmtAttr { + let Spellings = [CXX11<"gsl", "suppress">, Clang<"suppress">]; let Args = [VariadicStringArgument<"DiagnosticIdentifiers">]; + let Accessors = [Accessor<"isGSL", [CXX11<"gsl", "suppress">]>]; let Documentation = [SuppressDocs]; } @@ -2748,6 +2863,11 @@ def PreserveAll : DeclOrTypeAttr { let Documentation = [PreserveAllDocs]; } +def M68kRTD: DeclOrTypeAttr { + let Spellings = [Clang<"m68k_rtd">]; + let Documentation = [M68kRTDDocs]; +} + def Target : InheritableAttr { let Spellings = [GCC<"target">]; let Args = [StringArgument<"featuresStr">]; @@ -2763,7 +2883,7 @@ def Target : InheritableAttr { for (auto &Feature : AttrFeatures) { Feature = Feature.trim(); - if (Feature.startswith("arch=")) + if (Feature.starts_with("arch=")) return Feature.drop_front(sizeof("arch=") - 1); } return ""; @@ -2781,8 +2901,8 @@ def Target : InheritableAttr { for (auto &Feature : AttrFeatures) { Feature = Feature.trim(); - if (!Feature.startswith("no-") && !Feature.startswith("arch=") && - !Feature.startswith("fpmath=") && !Feature.startswith("tune=")) + if (!Feature.starts_with("no-") && !Feature.starts_with("arch=") && + !Feature.starts_with("fpmath=") && !Feature.starts_with("tune=")) Out.push_back(Feature); } } @@ -2886,6 +3006,7 @@ def Unavailable : InheritableAttr { } def DiagnoseIf : InheritableAttr { + let CanPrintOnLeft = 0; // Does not have a [[]] spelling because this attribute requires the ability // to parse function arguments but the attribute is not written in the type // position. @@ -2936,7 +3057,7 @@ def ObjCRequiresPropertyDefs : InheritableAttr { def Unused : InheritableAttr { let Spellings = [CXX11<"", "maybe_unused", 201603>, GCC<"unused">, - C2x<"", "maybe_unused", 202106>]; + C23<"", "maybe_unused", 202106>]; let Subjects = SubjectList<[Var, ObjCIvar, Type, Enum, EnumConstant, Label, Field, ObjCMethod, FunctionLike]>; let Documentation = [WarnMaybeUnusedDocs]; @@ -3030,7 +3151,7 @@ def WarnUnused : InheritableAttr { def WarnUnusedResult : InheritableAttr { let Spellings = [CXX11<"", "nodiscard", 201907>, - C2x<"", "nodiscard", 202003>, + C23<"", "nodiscard", 202003>, CXX11<"clang", "warn_unused_result">, GCC<"warn_unused_result">]; let Subjects = SubjectList<[ObjCMethod, Enum, Record, FunctionLike, TypedefName]>; @@ -3079,7 +3200,7 @@ def AnyX86Interrupt : InheritableAttr, TargetSpecificAttr { let Subjects = SubjectList<[HasFunctionProto]>; let ParseKind = "Interrupt"; let HasCustomParsing = 1; - let Documentation = [Undocumented]; + let Documentation = [AnyX86InterruptDocs]; } def AnyX86NoCallerSavedRegisters : InheritableAttr, @@ -3530,6 +3651,14 @@ def : MutualExclusions<[Owner, Pointer]>; // Microsoft-related attributes +def MSConstexpr : InheritableAttr { + let LangOpts = [MicrosoftExt]; + let Spellings = [CXX11<"msvc", "constexpr">]; + let Subjects = SubjectList<[Function, ReturnStmt], ErrorDiag, + "functions and return statements">; + let Documentation = [MSConstexprDocs]; +} + def MSNoVTable : InheritableAttr, TargetSpecificAttr { let Spellings = [Declspec<"novtable">]; let Subjects = SubjectList<[CXXRecord]>; @@ -4099,24 +4228,14 @@ def HLSLShader : InheritableAttr { let Spellings = [Microsoft<"shader">]; let Subjects = SubjectList<[HLSLEntry]>; let LangOpts = [HLSL]; - // NOTE: - // order for the enum should match order in llvm::Triple::EnvironmentType. - // ShaderType will be converted to llvm::Triple::EnvironmentType like - // (llvm::Triple::EnvironmentType)((uint32_t)ShaderType + - // (uint32_t)llvm::Triple::EnvironmentType::Pixel). - // This will avoid update code for convert when new shader type is added. let Args = [ EnumArgument<"Type", "ShaderType", - [ - "pixel", "vertex", "geometry", "hull", "domain", "compute", - "library", "raygeneration", "intersection", "anyHit", - "closestHit", "miss", "callable", "mesh", "amplification" - ], - [ - "Pixel", "Vertex", "Geometry", "Hull", "Domain", "Compute", - "Library", "RayGeneration", "Intersection", "AnyHit", - "ClosestHit", "Miss", "Callable", "Mesh", "Amplification" - ]> + ["pixel", "vertex", "geometry", "hull", "domain", "compute", + "raygeneration", "intersection", "anyhit", "closesthit", + "miss", "callable", "mesh", "amplification"], + ["Pixel", "Vertex", "Geometry", "Hull", "Domain", "Compute", + "RayGeneration", "Intersection", "AnyHit", "ClosestHit", + "Miss", "Callable", "Mesh", "Amplification"]> ]; let Documentation = [HLSLSV_ShaderTypeAttrDocs]; } @@ -4125,26 +4244,27 @@ def HLSLResource : InheritableAttr { let Spellings = []; let Subjects = SubjectList<[Struct]>; let LangOpts = [HLSL]; - let Args = [EnumArgument<"ResourceType", "ResourceClass", + let Args = [EnumArgument<"ResourceClass", "llvm::hlsl::ResourceClass", ["SRV", "UAV", "CBuffer", "Sampler"], - ["SRV", "UAV", "CBuffer", "Sampler"] - >, - EnumArgument<"ResourceShape", "ResourceKind", + ["SRV", "UAV", "CBuffer", "Sampler"], + /*opt=*/0, /*fake=*/0, /*isExternalType=*/1>, + EnumArgument<"ResourceKind", "llvm::hlsl::ResourceKind", ["Texture1D", "Texture2D", "Texture2DMS", "Texture3D", "TextureCube", "Texture1DArray", "Texture2DArray", "Texture2DMSArray", "TextureCubeArray", "TypedBuffer", "RawBuffer", - "StructuredBuffer", "CBufferKind", "SamplerKind", - "TBuffer", "RTAccelerationStructure", "FeedbackTexture2D", - "FeedbackTexture2DArray"], + "StructuredBuffer", "CBuffer", "Sampler", + "TBuffer", "RTAccelerationStructure", + "FeedbackTexture2D", "FeedbackTexture2DArray"], ["Texture1D", "Texture2D", "Texture2DMS", "Texture3D", "TextureCube", "Texture1DArray", "Texture2DArray", "Texture2DMSArray", "TextureCubeArray", "TypedBuffer", "RawBuffer", - "StructuredBuffer", "CBufferKind", "SamplerKind", - "TBuffer", "RTAccelerationStructure", "FeedbackTexture2D", - "FeedbackTexture2DArray"] - > + "StructuredBuffer", "CBuffer", "Sampler", + "TBuffer", "RTAccelerationStructure", + "FeedbackTexture2D", "FeedbackTexture2DArray"], + /*opt=*/0, /*fake=*/0, /*isExternalType=*/1>, + DefaultBoolArgument<"isROV", /*default=*/0> ]; let Documentation = [InternalOnly]; } @@ -4155,6 +4275,18 @@ def HLSLGroupSharedAddressSpace : TypeAttr { let Documentation = [HLSLGroupSharedAddressSpaceDocs]; } +def HLSLParamModifier : TypeAttr { + let Spellings = [CustomKeyword<"in">, CustomKeyword<"inout">, CustomKeyword<"out">]; + let Accessors = [Accessor<"isIn", [CustomKeyword<"in">]>, + Accessor<"isInOut", [CustomKeyword<"inout">]>, + Accessor<"isOut", [CustomKeyword<"out">]>, + Accessor<"isAnyOut", [CustomKeyword<"out">, CustomKeyword<"inout">]>, + Accessor<"isAnyIn", [CustomKeyword<"in">, CustomKeyword<"inout">]>]; + let Subjects = SubjectList<[ParmVar]>; + let Documentation = [HLSLParamQualifierDocs]; + let Args = [DefaultBoolArgument<"MergedSpelling", /*default*/0, /*fake*/1>]; +} + def RandomizeLayout : InheritableAttr { let Spellings = [GCC<"randomize_layout">]; let Subjects = SubjectList<[Record]>; @@ -4199,3 +4331,39 @@ def AvailableOnlyInDefaultEvalMethod : InheritableAttr { let Documentation = [Undocumented]; } +def CountedBy : InheritableAttr { + let Spellings = [Clang<"counted_by">]; + let Subjects = SubjectList<[Field]>; + let Args = [IdentifierArgument<"CountedByField">]; + let Documentation = [CountedByDocs]; + let LangOpts = [COnly]; + // FIXME: This is ugly. Let using a DeclArgument would be nice, but a Decl + // isn't yet available due to the fact that we're still parsing the + // structure. Maybe that code could be changed sometime in the future. + code AdditionalMembers = [{ + private: + SourceRange CountedByFieldLoc; + public: + SourceRange getCountedByFieldLoc() const { return CountedByFieldLoc; } + void setCountedByFieldLoc(SourceRange Loc) { CountedByFieldLoc = Loc; } + }]; +} + +def PreferredType: InheritableAttr { + let Spellings = [Clang<"preferred_type">]; + let Subjects = SubjectList<[BitField], ErrorDiag>; + let Args = [TypeArgument<"Type", 1>]; + let Documentation = [PreferredTypeDocumentation]; +} + +def CodeAlign: StmtAttr { + let Spellings = [Clang<"code_align">]; + let Subjects = SubjectList<[ForStmt, CXXForRangeStmt, WhileStmt, DoStmt], + ErrorDiag, "'for', 'while', and 'do' statements">; + let Args = [ExprArgument<"Alignment">]; + let Documentation = [CodeAlignAttrDocs]; + let AdditionalMembers = [{ + static constexpr int MinimumAlignment = 1; + static constexpr int MaximumAlignment = 4096; + }]; +} diff --git a/contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td b/contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td index 2c950231255d..90041fa8dbb3 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td +++ b/contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td @@ -1163,7 +1163,7 @@ caveats to this use of name mangling: * The ``overloadable`` attribute has almost no meaning when used in C++, because names will already be mangled and functions are already overloadable. However, when an ``overloadable`` function occurs within an ``extern "C"`` - linkage specification, it's name *will* be mangled in the same way as it + linkage specification, its name *will* be mangled in the same way as it would in C. For the purpose of backwards compatibility, at most one function with the same @@ -1405,6 +1405,10 @@ Example usage: ``[[no_unique_address]]`` is a standard C++20 attribute. Clang supports its use in C++11 onwards. + +On MSVC targets, ``[[no_unique_address]]`` is ignored; use +``[[msvc::no_unique_address]]`` instead. Currently there is no guarantee of ABI +compatibility or stability with MSVC. }]; } @@ -1858,7 +1862,8 @@ The attribute may be applied to the declaration of a class, a typedef, a variable, a function or method, a function parameter, an enumeration, an enumerator, a non-static data member, or a label. -.. code-block: c++ +.. code-block:: c++ + #include [[maybe_unused]] void f([[maybe_unused]] bool thing1, @@ -1887,7 +1892,8 @@ literal contents) are allowed. If there are redeclarations of the entity with differing string literals, it is unspecified which one will be used by Clang in any resulting diagnostics. -.. code-block: c++ +.. code-block:: c++ + struct [[nodiscard]] error_info { /*...*/ }; error_info enable_missile_safety_mode(); @@ -1904,7 +1910,8 @@ marked with ``[[nodiscard]]`` or a constructor of a type marked ``[[nodiscard]]`` will also diagnose. This also applies to type conversions that use the annotated ``[[nodiscard]]`` constructor or result in an annotated type. -.. code-block: c++ +.. code-block:: c++ + struct [[nodiscard]] marked_type {/*..*/ }; struct marked_ctor { [[nodiscard]] marked_ctor(); @@ -2192,6 +2199,43 @@ preserving struct or union member access debuginfo indices of this struct or union, similar to clang ``__builtin_preserve_access_index()``. }]; } + +def BPFPreserveStaticOffsetDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +Clang supports the ``__attribute__((preserve_static_offset))`` +attribute for the BPF target. This attribute may be attached to a +struct or union declaration. Reading or writing fields of types having +such annotation is guaranteed to generate LDX/ST/STX instruction with +offset corresponding to the field. + +For example: + +.. code-block:: c + + struct foo { + int a; + int b; + }; + + struct bar { + int a; + struct foo b; + } __attribute__((preserve_static_offset)); + + void buz(struct bar *g) { + g->b.a = 42; + } + +The assignment to ``g``'s field would produce an ST instruction with +offset 8: ``*(u32)(r1 + 8) = 42;``. + +Without this attribute generated instructions might be different, +depending on optimizations behavior. E.g. the example above could be +rewritten as ``r1 += 8; *(u32)(r1 + 0) = 42;``. + }]; +} + def BTFDeclTagDocs : Documentation { let Category = DocCatFunction; let Content = [{ @@ -2508,6 +2552,13 @@ example, the following will emit 4 versions of the function: __attribute__((target_clones("arch=atom,avx2","arch=ivybridge","default"))) void foo() {} +For targets that support the GNU indirect function (IFUNC) feature, dispatch +is performed by emitting an indirect function that is resolved to the appropriate +target clone at load time. The indirect function is given the name the +multiversioned function would have if it had been declared without the attribute. +For backward compatibility with earlier Clang releases, a function alias with an +``.ifunc`` suffix is also emitted. The ``.ifunc`` suffixed symbol is a deprecated +feature and support for it may be removed in the future. }]; } @@ -2608,8 +2659,9 @@ An error will be given if: - Specified values violate subtarget specifications; - Specified values are not compatible with values provided through other attributes; - - The AMDGPU target backend is unable to create machine code that can meet the - request. + +The AMDGPU target backend will emit a warning whenever it is unable to +create machine code that meets the request. }]; } @@ -2774,7 +2826,7 @@ On x86 targets, this attribute changes the calling convention to as possible in registers. It also tries to utilize registers for the return value whenever it is possible. -.. _`__regcall`: https://software.intel.com/en-us/node/693069 +.. _`__regcall`: https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2023-2/c-c-sycl-calling-conventions.html }]; } @@ -2818,6 +2870,18 @@ See the documentation for `__vectorcall`_ on MSDN for more details. }]; } +def M68kRTDDocs : Documentation { + let Category = DocCatCallingConvs; + let Content = [{ +On M68k targets, this attribute changes the calling convention of a function +to clear parameters off the stack on return. In other words, callee is +responsible for cleaning out the stack space allocated for incoming paramters. +This convention does not support variadic calls or unprototyped functions in C. +When targeting M68010 or newer CPUs, this calling convention is implemented +using the `rtd` instruction. + }]; +} + def DocCatConsumed : DocumentationCategory<"Consumed Annotation Checking"> { let Content = [{ Clang supports additional attributes for checking basic resource management @@ -3593,6 +3657,21 @@ an error: }]; } +def MSConstexprDocs : Documentation { + let Category = DocCatStmt; + let Content = [{ +The ``[[msvc::constexpr]]`` attribute can be applied only to a function +definition or a ``return`` statement. It does not impact function declarations. +A ``[[msvc::constexpr]]`` function cannot be ``constexpr`` or ``consteval``. +A ``[[msvc::constexpr]]`` function is treated as if it were a ``constexpr`` function +when it is evaluated in a constant context of ``[[msvc::constexpr]] return`` statement. +Otherwise, it is treated as a regular function. + +Semantics of this attribute are enabled only under MSVC compatibility +(``-fms-compatibility-version``) 19.33 and later. + }]; +} + def MSNoVTableDocs : Documentation { let Category = DocCatDecl; let Content = [{ @@ -4798,6 +4877,54 @@ Marking virtual functions as ``disable_tail_calls`` is legal. }]; } +def AnyX86InterruptDocs : Documentation { + let Category = DocCatFunction; + let Heading = "interrupt (X86)"; + let Content = [{ +Clang supports the GNU style ``__attribute__((interrupt))`` attribute on X86 +targets. This attribute may be attached to a function definition and instructs +the backend to generate appropriate function entry/exit code so that it can be +used directly as an interrupt service routine. + +Interrupt handlers have access to the stack frame pushed onto the stack by the processor, +and return using the ``IRET`` instruction. All registers in an interrupt handler are callee-saved. +Exception handlers also have access to the error code pushed onto the stack by the processor, +when applicable. + +An interrupt handler must take the following arguments: + + .. code-block:: c + + __attribute__ ((interrupt)) + void f (struct stack_frame *frame) { + ... + } + + Where ``struct stack_frame`` is a suitable struct matching the stack frame pushed by the + processor. + +An exception handler must take the following arguments: + + .. code-block:: c + + __attribute__ ((interrupt)) + void g (struct stack_frame *frame, unsigned long code) { + ... + } + + On 32-bit targets, the ``code`` argument should be of type ``unsigned int``. + +Exception handlers should only be used when an error code is pushed by the processor. +Using the incorrect handler type will crash the system. + +Interrupt and exception handlers cannot be called by other functions and must have return type ``void``. + +Interrupt and exception handlers should only call functions with the 'no_caller_saved_registers' +attribute, or should be compiled with the '-mgeneral-regs-only' flag to avoid saving unused +non-GPR registers. + }]; +} + def AnyX86NoCallerSavedRegistersDocs : Documentation { let Category = DocCatFunction; let Content = [{ @@ -4812,6 +4939,10 @@ The user can call functions specified with the 'no_caller_saved_registers' attribute from an interrupt handler without saving and restoring all call-clobbered registers. +Functions specified with the 'no_caller_saved_registers' attribute should only +call other functions with the 'no_caller_saved_registers' attribute, or should be +compiled with the '-mgeneral-regs-only' flag to avoid saving unused non-GPR registers. + Note that 'no_caller_saved_registers' attribute is not a calling convention. In fact, it only overrides the decision of which registers should be saved by the caller, but not how the parameters are passed from the caller to the callee. @@ -5136,7 +5267,74 @@ the ``int`` parameter is the one that represents the error. def SuppressDocs : Documentation { let Category = DocCatStmt; let Content = [{ -The ``[[gsl::suppress]]`` attribute suppresses specific +The ``suppress`` attribute suppresses unwanted warnings coming from static +analysis tools such as the Clang Static Analyzer. The tool will not report +any issues in source code annotated with the attribute. + +The attribute cannot be used to suppress traditional Clang warnings, because +many such warnings are emitted before the attribute is fully parsed. +Consider using ``#pragma clang diagnostic`` to control such diagnostics, +as described in `Controlling Diagnostics via Pragmas +`_. + +The ``suppress`` attribute can be placed on an individual statement in order to +suppress warnings about undesirable behavior occurring at that statement: + +.. code-block:: c++ + + int foo() { + int *x = nullptr; + ... + [[clang::suppress]] + return *x; // null pointer dereference warning suppressed here + } + +Putting the attribute on a compound statement suppresses all warnings in scope: + +.. code-block:: c++ + + int foo() { + [[clang::suppress]] { + int *x = nullptr; + ... + return *x; // warnings suppressed in the entire scope + } + } + +Some static analysis warnings are accompanied by one or more notes, and the +line of code against which the warning is emitted isn't necessarily the best +for suppression purposes. In such cases the tools are allowed to implement +additional ways to suppress specific warnings based on the attribute attached +to a note location. + +For example, the Clang Static Analyzer suppresses memory leak warnings when +the suppression attribute is placed at the allocation site (highlited by +a "note: memory is allocated"), which may be different from the line of code +at which the program "loses track" of the pointer (where the warning +is ultimately emitted): + +.. code-block:: c + + int bar1(bool coin_flip) { + __attribute__((suppress)) + int *result = (int *)malloc(sizeof(int)); + if (coin_flip) + return 1; // warning about this leak path is suppressed + + return *result; // warning about this leak path is also suppressed + } + + int bar2(bool coin_flip) { + int *result = (int *)malloc(sizeof(int)); + if (coin_flip) + return 1; // leak warning on this path NOT suppressed + + __attribute__((suppress)) + return *result; // leak warning is suppressed only on this path + } + + +When written as ``[[gsl::suppress]]``, this attribute suppresses specific clang-tidy diagnostics for rules of the `C++ Core Guidelines`_ in a portable way. The attribute can be attached to declarations, statements, and at namespace scope. @@ -5337,7 +5535,9 @@ considered inline. Not all targets support this attribute. ELF target support depends on both the linker and runtime linker, and is available in at least lld 4.0 and later, binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later. -Non-ELF targets currently do not support this attribute. +Mach-O targets support it, but with slightly different semantics: the resolver +is run at first call, instead of at load time by the runtime linker. Targets +other than ELF and Mach-O currently do not support this attribute. }]; } @@ -5685,12 +5885,12 @@ accessed. The following are examples of valid expressions where may not be diagn ``noderef`` is currently only supported for pointers and arrays and not usable for references or Objective-C object pointers. -.. code-block: c++ +.. code-block:: c++ int x = 2; int __attribute__((noderef)) &y = x; // warning: 'noderef' can only be used on an array or pointer type -.. code-block: objc +.. code-block:: objc id __attribute__((noderef)) obj = [NSObject new]; // warning: 'noderef' can only be used on an array or pointer type }]; @@ -6578,38 +6778,147 @@ Requirements on Development Tools - Engineering Specification Documentation }]; } -def ArmStreamingDocs : Documentation { - let Category = DocCatType; +def DocCatArmSmeAttributes : DocumentationCategory<"AArch64 SME Attributes"> { let Content = [{ -.. Note:: This attribute has not been implemented yet, but once it is - implemented, it will behave as described below. +Clang supports a number of AArch64-specific attributes to manage state +added by the Scalable Matrix Extension (SME). This state includes the +runtime mode that the processor is in (e.g. non-streaming or streaming) +as well as the state of the ``ZA`` Matrix Storage. -The ``__arm_streaming`` keyword is only available on AArch64 targets. -It applies to function types and specifies that the function has a -"streaming interface". This means that: +The attributes come in the form of type- and declaration attributes: -* the function requires the Scalable Matrix Extension (SME) +* The SME declaration attributes can appear anywhere that a standard + ``[[...]]`` declaration attribute can appear. + +* The SME type attributes apply only to prototyped functions and can appear + anywhere that a standard ``[[...]]`` type attribute can appear. The SME + type attributes do not apply to functions having a K&R-style + unprototyped function type. + +See `Arm C Language Extensions `_ +for more details about the features related to the SME extension. + +See `Procedure Call Standard for the Arm® 64-bit Architecture (AArch64) +`_ for more details about +streaming-interface functions and shared/private-ZA interface functions. + }]; +} + +def ArmSmeStreamingDocs : Documentation { + let Category = DocCatArmSmeAttributes; + let Content = [{ +The ``__arm_streaming`` keyword applies to prototyped function types and specifies +that the function has a "streaming interface". This means that: + +* the function requires that the processor implements the Scalable Matrix + Extension (SME). * the function must be entered in streaming mode (that is, with PSTATE.SM set to 1) * the function must return in streaming mode -See `Procedure Call Standard for the Arm® 64-bit Architecture (AArch64) -`_ for more details about -streaming-interface functions. - Clang manages PSTATE.SM automatically; it is not the source code's -responsibility to do this. For example, if a normal non-streaming +responsibility to do this. For example, if a non-streaming function calls an ``__arm_streaming`` function, Clang generates code that switches into streaming mode before calling the function and switches back to non-streaming mode on return. + }]; +} -``__arm_streaming`` can appear anywhere that a standard ``[[...]]`` type -attribute can appear. +def ArmSmeStreamingCompatibleDocs : Documentation { + let Category = DocCatArmSmeAttributes; + let Content = [{ +The ``__arm_streaming_compatible`` keyword applies to prototyped function types and +specifies that the function has a "streaming compatible interface". This +means that: -See `Arm C Language Extensions `_ -for more details about this extension, and for other related SME features. +* the function may be entered in either non-streaming mode (PSTATE.SM=0) or + in streaming mode (PSTATE.SM=1). + +* the function must return in the same mode as it was entered. + +* the code executed in the function is compatible with either mode. + +Clang manages PSTATE.SM automatically; it is not the source code's +responsibility to do this. Clang will ensure that the generated code in +streaming-compatible functions is valid in either mode (PSTATE.SM=0 or +PSTATE.SM=1). For example, if an ``__arm_streaming_compatible`` function calls a +non-streaming function, Clang generates code to temporarily switch out of streaming +mode before calling the function and switch back to streaming-mode on return if +``PSTATE.SM`` is ``1`` on entry of the caller. If ``PSTATE.SM`` is ``0`` on +entry to the ``__arm_streaming_compatible`` function, the call will be executed +without changing modes. + }]; +} + +def ArmSmeSharedZADocs : Documentation { + let Category = DocCatArmSmeAttributes; + let Content = [{ +The ``__arm_shared_za`` keyword applies to prototyped function types and specifies +that the function shares SME's matrix storage (ZA) with its caller. This +means that: + +* the function requires that the processor implements the Scalable Matrix + Extension (SME). + +* the function enters with ZA in an active state. + +* the function returns with ZA in an active state. + }]; +} + +def ArmSmePreservesZADocs : Documentation { + let Category = DocCatArmSmeAttributes; + let Content = [{ +The ``__arm_preserves_za`` keyword applies to prototyped function types and +specifies that the function does not modify ZA state. + }]; +} + + +def ArmSmeLocallyStreamingDocs : Documentation { + let Category = DocCatArmSmeAttributes; + let Content = [{ +The ``__arm_locally_streaming`` keyword applies to function declarations +and specifies that all the statements in the function are executed in +streaming mode. This means that: + +* the function requires that the target processor implements the Scalable Matrix + Extension (SME). + +* the program automatically puts the machine into streaming mode before + executing the statements and automatically restores the previous mode + afterwards. + +Clang manages PSTATE.SM automatically; it is not the source code's +responsibility to do this. For example, Clang will emit code to enable +streaming mode at the start of the function, and disable streaming mode +at the end of the function. + }]; +} + +def ArmSmeNewZADocs : Documentation { + let Category = DocCatArmSmeAttributes; + let Content = [{ +The ``__arm_new_za`` keyword applies to function declarations and specifies +that the function will be set up with a fresh ZA context. + +This means that: + +* the function requires that the target processor implements the Scalable Matrix + Extension (SME). + +* the function will commit any lazily saved ZA data. + +* the function will create a new ZA context and enable PSTATE.ZA. + +* the function will disable PSTATE.ZA (by setting it to 0) before returning. + +For ``__arm_new_za`` functions Clang will set up the ZA context automatically +on entry to the function, and disable it before returning. For example, if ZA is +in a dormant state Clang will generate the code to commit a lazy-save and set up +a new ZA state before executing user code. }]; } @@ -6881,6 +7190,26 @@ The full documentation is available here: https://learn.microsoft.com/en-us/wind }]; } +def HLSLParamQualifierDocs : Documentation { + let Category = DocCatVariable; + let Heading = "HLSL Parameter Modifiers"; + let Content = [{ +HLSL function parameters are passed by value. Parameter declarations support +three qualifiers to denote parameter passing behavior. The three qualifiers are +`in`, `out` and `inout`. + +Parameters annotated with `in` or with no annotation are passed by value from +the caller to the callee. + +Parameters annotated with `out` are written to the argument after the callee +returns (Note: arguments values passed into `out` parameters *are not* copied +into the callee). + +Parameters annotated with `inout` are copied into the callee via a temporary, +and copied back to the argument after the callee returns. + }]; +} + def AnnotateTypeDocs : Documentation { let Category = DocCatType; let Heading = "annotate_type"; @@ -7051,8 +7380,71 @@ its underlying representation to be a WebAssembly ``funcref``. }]; } +def PreferredTypeDocumentation : Documentation { + let Category = DocCatField; + let Content = [{ +This attribute allows adjusting the type of a bit-field in debug information. +This can be helpful when a bit-field is intended to store an enumeration value, +but has to be specified as having the enumeration's underlying type in order to +facilitate compiler optimizations or bit-field packing behavior. Normally, the +underlying type is what is emitted in debug information, which can make it hard +for debuggers to know to map a bit-field's value back to a particular enumeration. + +.. code-block:: c++ + + enum Colors { Red, Green, Blue }; + + struct S { + [[clang::preferred_type(Colors)]] unsigned ColorVal : 2; + [[clang::preferred_type(bool)]] unsigned UseAlternateColorSpace : 1; + } s = { Green, false }; + +Without the attribute, a debugger is likely to display the value ``1`` for ``ColorVal`` +and ``0`` for ``UseAlternateColorSpace``. With the attribute, the debugger may now +display ``Green`` and ``false`` instead. + +This can be used to map a bit-field to an arbitrary type that isn't integral +or an enumeration type. For example: + +.. code-block:: c++ + + struct A { + short a1; + short a2; + }; + + struct B { + [[clang::preferred_type(A)]] unsigned b1 : 32 = 0x000F'000C; + }; + +will associate the type ``A`` with the ``b1`` bit-field and is intended to display +something like this in the debugger: + +.. code-block:: text + + Process 2755547 stopped + * thread #1, name = 'test-preferred-', stop reason = step in + frame #0: 0x0000555555555148 test-preferred-type`main at test.cxx:13:14 + 10 int main() + 11 { + 12 B b; + -> 13 return b.b1; + 14 } + (lldb) v -T + (B) b = { + (A:32) b1 = { + (short) a1 = 12 + (short) a2 = 15 + } + } + +Note that debuggers may not be able to handle more complex mappings, and so +this usage is debugger-dependent. + }]; +} + def CleanupDocs : Documentation { - let Category = DocCatType; + let Category = DocCatVariable; let Content = [{ This attribute allows a function to be run when a local variable goes out of scope. The attribute takes the identifier of a function with a parameter type @@ -7077,3 +7469,322 @@ the variables were declared in. It is not possible to check the return value (if any) of these ``cleanup`` callback functions. }]; } + +def CtorDtorDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``constructor`` attribute causes the function to be called before entering +``main()``, and the ``destructor`` attribute causes the function to be called +after returning from ``main()`` or when the ``exit()`` function has been +called. Note, ``quick_exit()``, ``_Exit()``, and ``abort()`` prevent a function +marked ``destructor`` from being called. + +The constructor or destructor function should not accept any arguments and its +return type should be ``void``. + +The attributes accept an optional argument used to specify the priority order +in which to execute constructor and destructor functions. The priority is +given as an integer constant expression between 101 and 65535 (inclusive). +Priorities outside of that range are reserved for use by the implementation. A +lower value indicates a higher priority of initialization. Note that only the +relative ordering of values is important. For example: + +.. code-block:: c++ + + __attribute__((constructor(200))) void foo(void); + __attribute__((constructor(101))) void bar(void); + +``bar()`` will be called before ``foo()``, and both will be called before +``main()``. If no argument is given to the ``constructor`` or ``destructor`` +attribute, they default to the value ``65535``. +}]; +} + +def CountedByDocs : Documentation { + let Category = DocCatField; + let Content = [{ +Clang supports the ``counted_by`` attribute on the flexible array member of a +structure in C. The argument for the attribute is the name of a field member in +the same structure holding the count of elements in the flexible array. This +information can be used to improve the results of the array bound sanitizer and +the ``__builtin_dynamic_object_size`` builtin. + +For example, the following code: + +.. code-block:: c + + struct bar; + + struct foo { + size_t count; + char other; + struct bar *array[] __attribute__((counted_by(count))); + }; + +specifies that the flexible array member ``array`` has the number of elements +allocated for it stored in ``count``. This establishes a relationship between +``array`` and ``count``. Specifically, ``p->array`` must have at least +``p->count`` number of elements available. It's the user's responsibility to +ensure that this relationship is maintained through changes to the structure. + +In the following example, the allocated array erroneously has fewer elements +than what's specified by ``p->count``. This would result in an out-of-bounds +access not being detected. + +.. code-block:: c + + #define SIZE_INCR 42 + + struct foo *p; + + void foo_alloc(size_t count) { + p = malloc(MAX(sizeof(struct foo), + offsetof(struct foo, array[0]) + count * sizeof(struct bar *))); + p->count = count + SIZE_INCR; + } + +The next example updates ``p->count``, breaking the relationship requirement +that ``p->array`` must have at least ``p->count`` number of elements available: + +.. code-block:: c + + #define SIZE_INCR 42 + + struct foo *p; + + void foo_alloc(size_t count) { + p = malloc(MAX(sizeof(struct foo), + offsetof(struct foo, array[0]) + count * sizeof(struct bar *))); + p->count = count; + } + + void use_foo(int index) { + p->count += SIZE_INCR + 1; /* 'count' is now larger than the number of elements of 'array'. */ + p->array[index] = 0; /* the sanitizer can't properly check if this is an out-of-bounds access. */ + } + + }]; +} + +def CoroOnlyDestroyWhenCompleteDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +The `coro_only_destroy_when_complete` attribute should be marked on a C++ class. The coroutines +whose return type is marked with the attribute are assumed to be destroyed only after the coroutine has +reached the final suspend point. + +This is helpful for the optimizers to reduce the size of the destroy function for the coroutines. + +For example, + +.. code-block:: c++ + + A foo() { + dtor d; + co_await something(); + dtor d1; + co_await something(); + dtor d2; + co_return 43; + } + +The compiler may generate the following pseudocode: + +.. code-block:: c++ + + void foo.destroy(foo.Frame *frame) { + switch(frame->suspend_index()) { + case 1: + frame->d.~dtor(); + break; + case 2: + frame->d.~dtor(); + frame->d1.~dtor(); + break; + case 3: + frame->d.~dtor(); + frame->d1.~dtor(); + frame->d2.~dtor(); + break; + default: // coroutine completed or haven't started + break; + } + + frame->promise.~promise_type(); + delete frame; + } + +The `foo.destroy()` function's purpose is to release all of the resources +initialized for the coroutine when it is destroyed in a suspended state. +However, if the coroutine is only ever destroyed at the final suspend state, +the rest of the conditions are superfluous. + +The user can use the `coro_only_destroy_when_complete` attributo suppress +generation of the other destruction cases, optimizing the above `foo.destroy` to: + +.. code-block:: c++ + + void foo.destroy(foo.Frame *frame) { + frame->promise.~promise_type(); + delete frame; + } + + }]; +} + +def CoroReturnTypeAndWrapperDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_return_type]]`` attribute is used to help static analyzers to recognize +coroutines from the function signatures. + +The ``coro_return_type`` attribute should be marked on a C++ class to mark it as +a **coroutine return type (CRT)**. + +A function ``R func(P1, .., PN)`` has a coroutine return type (CRT) ``R`` if ``R`` +is marked by ``[[clang::coro_return_type]]`` and ``R`` has a promise type associated to it +(i.e., std::coroutine_traits::promise_type is a valid promise type). + +If the return type of a function is a ``CRT`` then the function must be a coroutine. +Otherwise the program is invalid. It is allowed for a non-coroutine to return a ``CRT`` +if the function is marked with ``[[clang::coro_wrapper]]``. + +The ``[[clang::coro_wrapper]]`` attribute should be marked on a C++ function to mark it as +a **coroutine wrapper**. A coroutine wrapper is a function which returns a ``CRT``, +is not a coroutine itself and is marked with ``[[clang::coro_wrapper]]``. + +Clang will enforce that all functions that return a ``CRT`` are either coroutines or marked +with ``[[clang::coro_wrapper]]``. Clang will enforce this with an error. + +From a language perspective, it is not possible to differentiate between a coroutine and a +function returning a CRT by merely looking at the function signature. + +Coroutine wrappers, in particular, are susceptible to capturing +references to temporaries and other lifetime issues. This allows to avoid such lifetime +issues with coroutine wrappers. + +For example, + +.. code-block:: c++ + + // This is a CRT. + template struct [[clang::coro_return_type]] Task { + using promise_type = some_promise_type; + }; + + Task increment(int a) { co_return a + 1; } // Fine. This is a coroutine. + Task foo() { return increment(1); } // Error. foo is not a coroutine. + + // Fine for a coroutine wrapper to return a CRT. + [[clang::coro_wrapper]] Task foo() { return increment(1); } + + void bar() { + // Invalid. This intantiates a function which returns a CRT but is not marked as + // a coroutine wrapper. + std::function(int)> f = increment; + } + +Note: ``a_promise_type::get_return_object`` is exempted from this analysis as it is a necessary +implementation detail of any coroutine library. +}]; +} + +def CodeAlignAttrDocs : Documentation { + let Category = DocCatVariable; + let Heading = "clang::code_align"; + let Content = [{ +The ``clang::code_align(N)`` attribute applies to a loop and specifies the byte +alignment for a loop. The attribute accepts a positive integer constant +initialization expression indicating the number of bytes for the minimum +alignment boundary. Its value must be a power of 2, between 1 and 4096 +(inclusive). + +.. code-block:: c++ + + void foo() { + int var = 0; + [[clang::code_align(16)]] for (int i = 0; i < 10; ++i) var++; + } + + void Array(int *array, size_t n) { + [[clang::code_align(64)]] for (int i = 0; i < n; ++i) array[i] = 0; + } + + void count () { + int a1[10], int i = 0; + [[clang::code_align(32)]] while (i < 10) { a1[i] += 3; } + } + + void check() { + int a = 10; + [[clang::code_align(8)]] do { + a = a + 1; + } while (a < 20); + } + + template + void func() { + [[clang::code_align(A)]] for(;;) { } + } + + }]; +} + +def CoroLifetimeBoundDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_lifetimebound]]`` is a class attribute which can be applied +to a coroutine return type (`CRT`_) (i.e. +it should also be annotated with ``[[clang::coro_return_type]]``). + +All parameters of a function are considered to be lifetime bound. See `documentation`_ +of ``[[clang::lifetimebound]]`` for more details. +if the function returns a coroutine return type (CRT) annotated with ``[[clang::coro_lifetimebound]]``. + +Reference parameters of a coroutine are susceptible to capturing references to temporaries or local variables. + +For example, + +.. code-block:: c++ + + task coro(const int& a) { co_return a + 1; } + task dangling_refs(int a) { + // `coro` captures reference to a temporary. `foo` would now contain a dangling reference to `a`. + auto foo = coro(1); + // `coro` captures reference to local variable `a` which is destroyed after the return. + return coro(a); + } + +Lifetime bound static analysis can be used to detect such instances when coroutines capture references +which may die earlier than the coroutine frame itself. In the above example, if the CRT `task` is annotated with +``[[clang::coro_lifetimebound]]``, then lifetime bound analysis would detect capturing reference to +temporaries or return address of a local variable. + +Both coroutines and coroutine wrappers are part of this analysis. + +.. code-block:: c++ + + template struct [[clang::coro_return_type, clang::coro_lifetimebound]] Task { + using promise_type = some_promise_type; + }; + + Task coro(const int& a) { co_return a + 1; } + Task [[clang::coro_wrapper]] coro_wrapper(const int& a, const int& b) { + return a > b ? coro(a) : coro(b); + } + Task temporary_reference() { + auto foo = coro(1); // warning: capturing reference to a temporary which would die after the expression. + + int a = 1; + auto bar = coro_wrapper(a, 0); // warning: `b` captures reference to a temporary. + + co_return co_await coro(1); // fine. + } + [[clang::coro_wrapper]] Task stack_reference(int a) { + return coro(a); // warning: returning address of stack variable `a`. + } + +.. _`documentation`: https://clang.llvm.org/docs/AttributeReference.html#lifetimebound +.. _`CRT`: https://clang.llvm.org/docs/AttributeReference.html#coro-return-type +}]; +} diff --git a/contrib/llvm-project/clang/include/clang/Basic/AttrSubjectMatchRules.h b/contrib/llvm-project/clang/include/clang/Basic/AttrSubjectMatchRules.h index e3dcb943e59d..bec8122ea930 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/AttrSubjectMatchRules.h +++ b/contrib/llvm-project/clang/include/clang/Basic/AttrSubjectMatchRules.h @@ -9,10 +9,12 @@ #ifndef LLVM_CLANG_BASIC_ATTRSUBJECTMATCHRULES_H #define LLVM_CLANG_BASIC_ATTRSUBJECTMATCHRULES_H -#include "clang/Basic/SourceLocation.h" #include "llvm/ADT/DenseMap.h" namespace clang { + +class SourceRange; + namespace attr { /// A list of all the recognized kinds of attributes. diff --git a/contrib/llvm-project/clang/include/clang/Basic/AttributeCommonInfo.h b/contrib/llvm-project/clang/include/clang/Basic/AttributeCommonInfo.h index 6396c0dc6ef0..018b92fdc11f 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/AttributeCommonInfo.h +++ b/contrib/llvm-project/clang/include/clang/Basic/AttributeCommonInfo.h @@ -13,12 +13,14 @@ #ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H #define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H + #include "clang/Basic/SourceLocation.h" #include "clang/Basic/TokenKinds.h" namespace clang { -class IdentifierInfo; + class ASTRecordWriter; +class IdentifierInfo; class AttributeCommonInfo { public: @@ -31,7 +33,7 @@ public: AS_CXX11, /// [[...]] - AS_C2x, + AS_C23, /// __declspec(...) AS_Declspec, @@ -72,11 +74,16 @@ private: SourceRange AttrRange; const SourceLocation ScopeLoc; // Corresponds to the Kind enum. + LLVM_PREFERRED_TYPE(Kind) unsigned AttrKind : 16; /// Corresponds to the Syntax enum. + LLVM_PREFERRED_TYPE(Syntax) unsigned SyntaxUsed : 4; + LLVM_PREFERRED_TYPE(bool) unsigned SpellingIndex : 4; + LLVM_PREFERRED_TYPE(bool) unsigned IsAlignas : 1; + LLVM_PREFERRED_TYPE(bool) unsigned IsRegularKeywordAttribute : 1; protected: @@ -104,7 +111,7 @@ public: static Form GNU() { return AS_GNU; } static Form CXX11() { return AS_CXX11; } - static Form C2x() { return AS_C2x; } + static Form C23() { return AS_C23; } static Form Declspec() { return AS_Declspec; } static Form Microsoft() { return AS_Microsoft; } static Form Keyword(bool IsAlignas, bool IsRegularKeywordAttribute) { @@ -121,9 +128,12 @@ public: : SyntaxUsed(SyntaxUsed), SpellingIndex(SpellingNotCalculated), IsAlignas(0), IsRegularKeywordAttribute(0) {} + LLVM_PREFERRED_TYPE(Syntax) unsigned SyntaxUsed : 4; unsigned SpellingIndex : 4; + LLVM_PREFERRED_TYPE(bool) unsigned IsAlignas : 1; + LLVM_PREFERRED_TYPE(bool) unsigned IsRegularKeywordAttribute : 1; }; @@ -167,6 +177,7 @@ public: IsRegularKeywordAttribute); } const IdentifierInfo *getAttrName() const { return AttrName; } + void setAttrName(const IdentifierInfo *AttrNameII) { AttrName = AttrNameII; } SourceLocation getLoc() const { return AttrRange.getBegin(); } SourceRange getRange() const { return AttrRange; } void setRange(SourceRange R) { AttrRange = R; } @@ -188,12 +199,21 @@ public: bool isCXX11Attribute() const { return SyntaxUsed == AS_CXX11 || IsAlignas; } - bool isC2xAttribute() const { return SyntaxUsed == AS_C2x; } + bool isC23Attribute() const { return SyntaxUsed == AS_C23; } + + bool isAlignas() const { + // FIXME: In the current state, the IsAlignas member variable is only true + // with the C++ `alignas` keyword but not `_Alignas`. The following + // expression works around the otherwise lost information so it will return + // true for `alignas` or `_Alignas` while still returning false for things + // like `__attribute__((aligned))`. + return (getParsedKind() == AT_Aligned && isKeywordAttribute()); + } /// The attribute is spelled [[]] in either C or C++ mode, including standard /// attributes spelled with a keyword, like alignas. bool isStandardAttributeSyntax() const { - return isCXX11Attribute() || isC2xAttribute(); + return isCXX11Attribute() || isC23Attribute(); } bool isGNUAttribute() const { return SyntaxUsed == AS_GNU; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/Attributes.h b/contrib/llvm-project/clang/include/clang/Basic/Attributes.h index 3fc5fbacdb2c..61666a6f4d9a 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Attributes.h +++ b/contrib/llvm-project/clang/include/clang/Basic/Attributes.h @@ -10,12 +10,12 @@ #define LLVM_CLANG_BASIC_ATTRIBUTES_H #include "clang/Basic/AttributeCommonInfo.h" -#include "clang/Basic/LangOptions.h" -#include "clang/Basic/TargetInfo.h" namespace clang { class IdentifierInfo; +class LangOptions; +class TargetInfo; /// Return the version number associated with the attribute if we /// recognize and implement the attribute specified by the given information. diff --git a/contrib/llvm-project/clang/include/clang/Basic/Builtins.def b/contrib/llvm-project/clang/include/clang/Basic/Builtins.def index 6dad8b512bd2..4dcbaf8a7bea 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Builtins.def +++ b/contrib/llvm-project/clang/include/clang/Basic/Builtins.def @@ -245,6 +245,11 @@ BUILTIN(__builtin_exp2f, "ff" , "Fne") BUILTIN(__builtin_exp2f16, "hh" , "Fne") BUILTIN(__builtin_exp2l, "LdLd", "Fne") BUILTIN(__builtin_exp2f128, "LLdLLd" , "Fne") +BUILTIN(__builtin_exp10 , "dd" , "Fne") +BUILTIN(__builtin_exp10f, "ff" , "Fne") +BUILTIN(__builtin_exp10f16, "hh" , "Fne") +BUILTIN(__builtin_exp10l, "LdLd", "Fne") +BUILTIN(__builtin_exp10f128, "LLdLLd" , "Fne") BUILTIN(__builtin_expm1 , "dd", "Fne") BUILTIN(__builtin_expm1f, "ff", "Fne") BUILTIN(__builtin_expm1l, "LdLd", "Fne") @@ -489,6 +494,9 @@ BUILTIN(__builtin_isinf, "i.", "FnctE") BUILTIN(__builtin_isinf_sign, "i.", "FnctE") BUILTIN(__builtin_isnan, "i.", "FnctE") BUILTIN(__builtin_isnormal, "i.", "FnctE") +BUILTIN(__builtin_issubnormal,"i.", "FnctE") +BUILTIN(__builtin_iszero, "i.", "FnctE") +BUILTIN(__builtin_issignaling,"i.", "FnctE") BUILTIN(__builtin_isfpclass, "i.", "nctE") // FP signbit builtins @@ -560,7 +568,7 @@ BUILTIN(__builtin_va_copy, "vAA", "n") BUILTIN(__builtin_stdarg_start, "vA.", "nt") BUILTIN(__builtin_assume_aligned, "v*vC*z.", "nctE") BUILTIN(__builtin_bcmp, "ivC*vC*z", "FnE") -BUILTIN(__builtin_bcopy, "vv*v*z", "n") +BUILTIN(__builtin_bcopy, "vvC*v*z", "nF") BUILTIN(__builtin_bzero, "vv*z", "nF") BUILTIN(__builtin_free, "vv*", "nF") BUILTIN(__builtin_malloc, "v*z", "nF") @@ -669,6 +677,7 @@ BUILTIN(__builtin_debugtrap, "v", "n") BUILTIN(__builtin_unreachable, "v", "nr") BUILTIN(__builtin_shufflevector, "v." , "nct") BUILTIN(__builtin_convertvector, "v." , "nct") +BUILTIN(__builtin_vectorelements, "v." , "nct") BUILTIN(__builtin_alloca, "v*z" , "Fn") BUILTIN(__builtin_alloca_uninitialized, "v*z", "Fn") BUILTIN(__builtin_alloca_with_align, "v*zIz", "Fn") @@ -677,6 +686,7 @@ BUILTIN(__builtin_call_with_static_chain, "v.", "nt") BUILTIN(__builtin_nondeterministic_value, "v.", "nt") BUILTIN(__builtin_elementwise_abs, "v.", "nct") +BUILTIN(__builtin_elementwise_bitreverse, "v.", "nct") BUILTIN(__builtin_elementwise_max, "v.", "nct") BUILTIN(__builtin_elementwise_min, "v.", "nct") BUILTIN(__builtin_elementwise_ceil, "v.", "nct") @@ -693,6 +703,7 @@ BUILTIN(__builtin_elementwise_round, "v.", "nct") BUILTIN(__builtin_elementwise_rint, "v.", "nct") BUILTIN(__builtin_elementwise_nearbyint, "v.", "nct") BUILTIN(__builtin_elementwise_sin, "v.", "nct") +BUILTIN(__builtin_elementwise_sqrt, "v.", "nct") BUILTIN(__builtin_elementwise_trunc, "v.", "nct") BUILTIN(__builtin_elementwise_canonicalize, "v.", "nct") BUILTIN(__builtin_elementwise_copysign, "v.", "nct") @@ -893,6 +904,32 @@ BUILTIN(__atomic_signal_fence, "vi", "n") BUILTIN(__atomic_always_lock_free, "bzvCD*", "nE") BUILTIN(__atomic_is_lock_free, "bzvCD*", "nE") +// GNU atomic builtins with atomic scopes. +ATOMIC_BUILTIN(__scoped_atomic_load, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_load_n, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_store, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_store_n, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_exchange, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_exchange_n, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_compare_exchange, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_compare_exchange_n, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_fetch_add, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_fetch_sub, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_fetch_and, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_fetch_or, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_fetch_xor, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_fetch_nand, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_add_fetch, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_sub_fetch, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_and_fetch, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_or_fetch, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_xor_fetch, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_max_fetch, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_min_fetch, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_nand_fetch, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_fetch_min, "v.", "t") +ATOMIC_BUILTIN(__scoped_atomic_fetch_max, "v.", "t") + // OpenCL 2.0 atomic builtins. ATOMIC_BUILTIN(__opencl_atomic_init, "v.", "t") ATOMIC_BUILTIN(__opencl_atomic_load, "v.", "t") @@ -1015,12 +1052,12 @@ LANGBUILTIN(__iso_volatile_store16, "vsD*s", "n", ALL_MS_LANGUAGES) LANGBUILTIN(__iso_volatile_store32, "viD*i", "n", ALL_MS_LANGUAGES) LANGBUILTIN(__iso_volatile_store64, "vLLiD*LLi", "n", ALL_MS_LANGUAGES) LANGBUILTIN(__noop, "i.", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__lzcnt16, "UsUs", "nc", ALL_MS_LANGUAGES) -LANGBUILTIN(__lzcnt, "UiUi", "nc", ALL_MS_LANGUAGES) -LANGBUILTIN(__lzcnt64, "UWiUWi", "nc", ALL_MS_LANGUAGES) -LANGBUILTIN(__popcnt16, "UsUs", "nc", ALL_MS_LANGUAGES) -LANGBUILTIN(__popcnt, "UiUi", "nc", ALL_MS_LANGUAGES) -LANGBUILTIN(__popcnt64, "UWiUWi", "nc", ALL_MS_LANGUAGES) +LANGBUILTIN(__lzcnt16, "UsUs", "ncE", ALL_MS_LANGUAGES) +LANGBUILTIN(__lzcnt, "UiUi", "ncE", ALL_MS_LANGUAGES) +LANGBUILTIN(__lzcnt64, "UWiUWi", "ncE", ALL_MS_LANGUAGES) +LANGBUILTIN(__popcnt16, "UsUs", "ncE", ALL_MS_LANGUAGES) +LANGBUILTIN(__popcnt, "UiUi", "ncE", ALL_MS_LANGUAGES) +LANGBUILTIN(__popcnt64, "UWiUWi", "ncE", ALL_MS_LANGUAGES) LANGBUILTIN(_ReturnAddress, "v*", "n", ALL_MS_LANGUAGES) LANGBUILTIN(_rotl8, "UcUcUc", "nE", ALL_MS_LANGUAGES) LANGBUILTIN(_rotl16, "UsUsUc", "nE", ALL_MS_LANGUAGES) @@ -1154,6 +1191,7 @@ LIBBUILTIN(strndup, "c*cC*z", "f", STRING_H, ALL_GNU_LANGUAGES) LIBBUILTIN(index, "c*cC*i", "f", STRINGS_H, ALL_GNU_LANGUAGES) LIBBUILTIN(rindex, "c*cC*i", "f", STRINGS_H, ALL_GNU_LANGUAGES) LIBBUILTIN(bzero, "vv*z", "f", STRINGS_H, ALL_GNU_LANGUAGES) +LIBBUILTIN(bcopy, "vvC*v*z", "f", STRINGS_H, ALL_GNU_LANGUAGES) LIBBUILTIN(bcmp, "ivC*vC*z", "fE", STRINGS_H, ALL_GNU_LANGUAGES) // In some systems str[n]casejmp is a macro that expands to _str[n]icmp. // We undefine then here to avoid wrong name. diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAArch64.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAArch64.def index eaae6c9ad846..82a1ba3c82ad 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAArch64.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAArch64.def @@ -259,7 +259,6 @@ TARGET_HEADER_BUILTIN(__umulh, "ULLiULLiULLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, TARGET_HEADER_BUILTIN(__break, "vi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") - TARGET_HEADER_BUILTIN(__writex18byte, "vUNiUc", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__writex18word, "vUNiUs", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__writex18dword, "vUNiUNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") @@ -270,6 +269,22 @@ TARGET_HEADER_BUILTIN(__readx18word, "UsUNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, TARGET_HEADER_BUILTIN(__readx18dword, "UNiUNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__readx18qword, "ULLiUNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CopyDoubleFromInt64, "dSLLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CopyFloatFromInt32, "fSi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CopyInt32FromFloat, "Sif", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CopyInt64FromDouble, "SLLid", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") + +TARGET_HEADER_BUILTIN(_CountLeadingOnes, "UiUNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CountLeadingOnes64, "UiULLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CountLeadingSigns, "UiSNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CountLeadingSigns64, "UiSLLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CountLeadingZeros, "UiUNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CountLeadingZeros64, "UiULLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CountOneBits, "UiUNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_CountOneBits64, "UiULLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") + +TARGET_HEADER_BUILTIN(__prefetch, "vv*", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") + #undef BUILTIN #undef LANGBUILTIN #undef TARGET_BUILTIN diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def index 29aa9ca7552e..e562ef04a301 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def @@ -67,11 +67,6 @@ BUILTIN(__builtin_amdgcn_sched_group_barrier, "vIiIiIi", "n") BUILTIN(__builtin_amdgcn_iglp_opt, "vIi", "n") BUILTIN(__builtin_amdgcn_s_dcache_inv, "v", "n") BUILTIN(__builtin_amdgcn_buffer_wbinvl1, "v", "n") -BUILTIN(__builtin_amdgcn_ds_gws_init, "vUiUi", "n") -BUILTIN(__builtin_amdgcn_ds_gws_barrier, "vUiUi", "n") -BUILTIN(__builtin_amdgcn_ds_gws_sema_v, "vUi", "n") -BUILTIN(__builtin_amdgcn_ds_gws_sema_br, "vUiUi", "n") -BUILTIN(__builtin_amdgcn_ds_gws_sema_p, "vUi", "n") BUILTIN(__builtin_amdgcn_fence, "vUicC*", "n") BUILTIN(__builtin_amdgcn_groupstaticsize, "Ui", "n") @@ -155,8 +150,8 @@ BUILTIN(__builtin_amdgcn_mqsad_u32_u8, "V4UiWUiUiV4Ui", "nc") // Ballot builtins. //===----------------------------------------------------------------------===// -TARGET_BUILTIN(__builtin_amdgcn_ballot_w32, "Uib", "nc", "wavefrontsize32") -TARGET_BUILTIN(__builtin_amdgcn_ballot_w64, "LUib", "nc", "wavefrontsize64") +TARGET_BUILTIN(__builtin_amdgcn_ballot_w32, "ZUib", "nc", "wavefrontsize32") +TARGET_BUILTIN(__builtin_amdgcn_ballot_w64, "WUib", "nc", "wavefrontsize64") // Deprecated intrinsics in favor of __builtin_amdgn_ballot_{w32|w64} BUILTIN(__builtin_amdgcn_uicmp, "WUiUiUiIi", "nc") @@ -172,6 +167,15 @@ BUILTIN(__builtin_amdgcn_fcmpf, "WUiffIi", "nc") BUILTIN(__builtin_amdgcn_is_shared, "bvC*0", "nc") BUILTIN(__builtin_amdgcn_is_private, "bvC*0", "nc") +//===----------------------------------------------------------------------===// +// GWS builtins. +//===----------------------------------------------------------------------===// +TARGET_BUILTIN(__builtin_amdgcn_ds_gws_init, "vUiUi", "n", "gws") +TARGET_BUILTIN(__builtin_amdgcn_ds_gws_barrier, "vUiUi", "n", "gws") +TARGET_BUILTIN(__builtin_amdgcn_ds_gws_sema_v, "vUi", "n", "gws") +TARGET_BUILTIN(__builtin_amdgcn_ds_gws_sema_br, "vUiUi", "n", "gws") +TARGET_BUILTIN(__builtin_amdgcn_ds_gws_sema_p, "vUi", "n", "gws") + //===----------------------------------------------------------------------===// // CI+ only builtins. //===----------------------------------------------------------------------===// @@ -288,6 +292,8 @@ TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_f16_w32, "V8fV16hV16hV8f", "nc TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf16_w32, "V8fV16sV16sV8f", "nc", "gfx11-insts") TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_w32, "V16hV16hV16hV16hIb", "nc", "gfx11-insts") TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_w32, "V16sV16sV16sV16sIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_tied_w32, "V16hV16hV16hV16hIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_tied_w32, "V16sV16sV16sV16sIb", "nc", "gfx11-insts") TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu8_w32, "V8iIbV4iIbV4iV8iIb", "nc", "gfx11-insts") TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu4_w32, "V8iIbV2iIbV2iV8iIb", "nc", "gfx11-insts") @@ -295,6 +301,8 @@ TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_f16_w64, "V4fV16hV16hV4f", "nc TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf16_w64, "V4fV16sV16sV4f", "nc", "gfx11-insts") TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_w64, "V8hV16hV16hV8hIb", "nc", "gfx11-insts") TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_w64, "V8sV16sV16sV8sIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_tied_w64, "V8hV16hV16hV8hIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_tied_w64, "V8sV16sV16sV8sIb", "nc", "gfx11-insts") TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu8_w64, "V4iIbV4iIbV4iV4iIb", "nc", "gfx11-insts") TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu4_w64, "V4iIbV2iIbV2iV4iIb", "nc", "gfx11-insts") @@ -398,5 +406,23 @@ TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_fp8_f32, "iffiIb", "nc", "fp8-insts") TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_bf8_f32, "ifiiIi", "nc", "fp8-insts") TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_fp8_f32, "ifiiIi", "nc", "fp8-insts") +//===----------------------------------------------------------------------===// +// GFX12+ only builtins. +//===----------------------------------------------------------------------===// + +TARGET_BUILTIN(__builtin_amdgcn_permlane16_var, "UiUiUiUiIbIb", "nc", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_permlanex16_var, "UiUiUiUiIbIb", "nc", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal, "vIi", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal_var, "vi", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_barrier_wait, "vIs", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal_isfirst, "bIi", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal_isfirst_var, "bi", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_barrier_init, "vii", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_barrier_join, "vi", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_wakeup_barrier, "vi", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_barrier_leave, "b", "n", "gfx12-insts") +TARGET_BUILTIN(__builtin_amdgcn_s_get_barrier_state, "Uii", "n", "gfx12-insts") + + #undef BUILTIN #undef TARGET_BUILTIN diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArch.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArch.def index 7f2c8403410d..95359a3fdc71 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArch.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArch.def @@ -15,47 +15,14 @@ # define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) #endif -// TODO: Support more builtins. -// TODO: Added feature constraints. -TARGET_BUILTIN(__builtin_loongarch_cacop_d, "vLiULiLi", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_cacop_w, "viUii", "nc", "32bit") -TARGET_BUILTIN(__builtin_loongarch_dbar, "vIUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_ibar, "vIUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_movfcsr2gr, "UiIUi", "nc", "f") -TARGET_BUILTIN(__builtin_loongarch_movgr2fcsr, "vIUiUi", "nc", "f") -TARGET_BUILTIN(__builtin_loongarch_break, "vIUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_syscall, "vIUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_cpucfg, "UiUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_asrtle_d, "vLiLi", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_asrtgt_d, "vLiLi", "nc", "64bit") +// Definition of LoongArch basic builtins. +#include "clang/Basic/BuiltinsLoongArchBase.def" -TARGET_BUILTIN(__builtin_loongarch_crc_w_b_w, "iii", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_crc_w_h_w, "iii", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_crc_w_w_w, "iii", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_crc_w_d_w, "iLii", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_crcc_w_b_w, "iii", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_crcc_w_h_w, "iii", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_crcc_w_w_w, "iii", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_crcc_w_d_w, "iLii", "nc", "64bit") +// Definition of LSX builtins. +#include "clang/Basic/BuiltinsLoongArchLSX.def" -TARGET_BUILTIN(__builtin_loongarch_csrrd_w, "UiIUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_csrrd_d, "ULiIUi", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_csrwr_w, "UiUiIUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_csrwr_d, "ULiULiIUi", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_csrxchg_w, "UiUiUiIUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_csrxchg_d, "ULiULiULiIUi", "nc", "64bit") - -TARGET_BUILTIN(__builtin_loongarch_iocsrrd_b, "UiUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_iocsrrd_h, "UiUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_iocsrrd_w, "UiUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_iocsrrd_d, "ULiUi", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_iocsrwr_b, "vUiUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_iocsrwr_h, "vUiUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_iocsrwr_w, "vUiUi", "nc", "") -TARGET_BUILTIN(__builtin_loongarch_iocsrwr_d, "vULiUi", "nc", "64bit") - -TARGET_BUILTIN(__builtin_loongarch_lddir_d, "LiLiIULi", "nc", "64bit") -TARGET_BUILTIN(__builtin_loongarch_ldpte_d, "vLiIULi", "nc", "64bit") +// Definition of LASX builtins. +#include "clang/Basic/BuiltinsLoongArchLASX.def" #undef BUILTIN #undef TARGET_BUILTIN diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchBase.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchBase.def new file mode 100644 index 000000000000..cbb239223aae --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchBase.def @@ -0,0 +1,53 @@ +//============------------ BuiltinsLoongArchBase.def -------------*- C++ -*-==// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +// This file defines the LoongArch-specific basic builtin function database. +// Users of this file must define the BUILTIN macro to make use of this +// information. +// +//===----------------------------------------------------------------------===// + +TARGET_BUILTIN(__builtin_loongarch_cacop_d, "vWiUWiWi", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_cacop_w, "viUii", "nc", "32bit") +TARGET_BUILTIN(__builtin_loongarch_dbar, "vIUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_ibar, "vIUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_movfcsr2gr, "UiIUi", "nc", "f") +TARGET_BUILTIN(__builtin_loongarch_movgr2fcsr, "vIUiUi", "nc", "f") +TARGET_BUILTIN(__builtin_loongarch_break, "vIUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_syscall, "vIUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_cpucfg, "UiUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_asrtle_d, "vWiWi", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_asrtgt_d, "vWiWi", "nc", "64bit") + +TARGET_BUILTIN(__builtin_loongarch_crc_w_b_w, "iii", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_crc_w_h_w, "iii", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_crc_w_w_w, "iii", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_crc_w_d_w, "iWii", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_crcc_w_b_w, "iii", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_crcc_w_h_w, "iii", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_crcc_w_w_w, "iii", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_crcc_w_d_w, "iWii", "nc", "64bit") + +TARGET_BUILTIN(__builtin_loongarch_csrrd_w, "UiIUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_csrrd_d, "UWiIUi", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_csrwr_w, "UiUiIUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_csrwr_d, "UWiUWiIUi", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_csrxchg_w, "UiUiUiIUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_csrxchg_d, "UWiUWiUWiIUi", "nc", "64bit") + +TARGET_BUILTIN(__builtin_loongarch_iocsrrd_b, "UiUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_iocsrrd_h, "UiUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_iocsrrd_w, "UiUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_iocsrrd_d, "UWiUi", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_iocsrwr_b, "vUiUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_iocsrwr_h, "vUiUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_iocsrwr_w, "vUiUi", "nc", "") +TARGET_BUILTIN(__builtin_loongarch_iocsrwr_d, "vUWiUi", "nc", "64bit") + +TARGET_BUILTIN(__builtin_loongarch_lddir_d, "WiWiIUWi", "nc", "64bit") +TARGET_BUILTIN(__builtin_loongarch_ldpte_d, "vWiIUWi", "nc", "64bit") diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchLASX.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchLASX.def new file mode 100644 index 000000000000..3de200f665b6 --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchLASX.def @@ -0,0 +1,982 @@ +//=BuiltinsLoongArchLASX.def - LoongArch Builtin function database -- C++ -*-=// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +// This file defines the LoongArch-specific LASX builtin function database. +// Users of this file must define the BUILTIN macro to make use of this +// information. +// +//===----------------------------------------------------------------------===// + +TARGET_BUILTIN(__builtin_lasx_xvadd_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvadd_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvadd_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvadd_d, "V4LLiV4LLiV4LLi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvadd_q, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsub_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsub_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsub_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsub_d, "V4LLiV4LLiV4LLi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsub_q, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvaddi_bu, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddi_hu, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddi_wu, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddi_du, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsubi_bu, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubi_hu, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubi_wu, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubi_du, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvneg_b, "V32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvneg_h, "V16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvneg_w, "V8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvneg_d, "V4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsadd_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsadd_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsadd_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsadd_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsadd_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsadd_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsadd_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsadd_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssub_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssub_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssub_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssub_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssub_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssub_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssub_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssub_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvhaddw_h_b, "V16SsV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhaddw_w_h, "V8SiV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhaddw_d_w, "V4SLLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhaddw_q_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvhaddw_hu_bu, "V16UsV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhaddw_wu_hu, "V8UiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhaddw_du_wu, "V4ULLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhaddw_qu_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvhsubw_h_b, "V16SsV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhsubw_w_h, "V8SiV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhsubw_d_w, "V4SLLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhsubw_q_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvhsubw_hu_bu, "V16UsV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhsubw_wu_hu, "V8UiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhsubw_du_wu, "V4ULLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvhsubw_qu_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvaddwev_h_b, "V16sV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_w_h, "V8SiV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_d_w, "V4LLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_q_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvaddwod_h_b, "V16sV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_w_h, "V8SiV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_d_w, "V4LLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_q_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsubwev_h_b, "V16sV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwev_w_h, "V8SiV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwev_d_w, "V4LLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwev_q_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsubwod_h_b, "V16sV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwod_w_h, "V8SiV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwod_d_w, "V4LLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwod_q_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvaddwev_h_bu, "V16sV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_w_hu, "V8SiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_d_wu, "V4LLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_q_du, "V4LLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvaddwod_h_bu, "V16sV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_w_hu, "V8SiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_d_wu, "V4LLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_q_du, "V4LLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsubwev_h_bu, "V16sV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwev_w_hu, "V8SiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwev_d_wu, "V4LLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwev_q_du, "V4LLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsubwod_h_bu, "V16sV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwod_w_hu, "V8SiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwod_d_wu, "V4LLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsubwod_q_du, "V4LLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvaddwev_h_bu_b, "V16sV32UcV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_w_hu_h, "V8SiV16UsV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_d_wu_w, "V4LLiV8UiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwev_q_du_d, "V4LLiV4ULLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvaddwod_h_bu_b, "V16sV32UcV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_w_hu_h, "V8SiV16UsV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_d_wu_w, "V4LLiV8UiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvaddwod_q_du_d, "V4LLiV4ULLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvavg_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavg_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavg_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavg_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvavg_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavg_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavg_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavg_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvavgr_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavgr_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavgr_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavgr_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvavgr_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavgr_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavgr_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvavgr_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvabsd_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvabsd_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvabsd_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvabsd_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvabsd_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvabsd_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvabsd_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvabsd_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvadda_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvadda_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvadda_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvadda_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmax_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmax_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmax_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmax_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmaxi_b, "V32ScV32ScIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaxi_h, "V16SsV16SsIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaxi_w, "V8SiV8SiIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaxi_d, "V4SLLiV4SLLiIi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmax_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmax_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmax_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmax_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmaxi_bu, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaxi_hu, "V16UsV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaxi_wu, "V8UiV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaxi_du, "V4ULLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmin_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmin_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmin_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmin_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmini_b, "V32ScV32ScIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmini_h, "V16SsV16SsIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmini_w, "V8SiV8SiIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmini_d, "V4SLLiV4SLLiIi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmin_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmin_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmin_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmin_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmini_bu, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmini_hu, "V16UsV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmini_wu, "V8UiV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmini_du, "V4ULLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmul_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmul_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmul_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmul_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmuh_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmuh_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmuh_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmuh_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmuh_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmuh_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmuh_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmuh_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmulwev_h_b, "V16sV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_w_h, "V8SiV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_d_w, "V4LLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_q_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmulwod_h_b, "V16sV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_w_h, "V8SiV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_d_w, "V4LLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_q_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmulwev_h_bu, "V16sV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_w_hu, "V8SiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_d_wu, "V4LLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_q_du, "V4LLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmulwod_h_bu, "V16sV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_w_hu, "V8SiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_d_wu, "V4LLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_q_du, "V4LLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmulwev_h_bu_b, "V16sV32UcV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_w_hu_h, "V8SiV16UsV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_d_wu_w, "V4LLiV8UiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwev_q_du_d, "V4LLiV4ULLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmulwod_h_bu_b, "V16sV32UcV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_w_hu_h, "V8SiV16UsV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_d_wu_w, "V4LLiV8UiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmulwod_q_du_d, "V4LLiV4ULLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmadd_b, "V32ScV32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmadd_h, "V16SsV16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmadd_w, "V8SiV8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmadd_d, "V4SLLiV4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmsub_b, "V32ScV32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmsub_h, "V16SsV16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmsub_w, "V8SiV8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmsub_d, "V4SLLiV4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_h_b, "V16sV16sV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_w_h, "V8SiV8SiV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_d_w, "V4LLiV4LLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_q_d, "V4LLiV4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_h_b, "V16sV16sV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_w_h, "V8SiV8SiV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_d_w, "V4LLiV4LLiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_q_d, "V4LLiV4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_h_bu, "V16UsV16UsV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_w_hu, "V8UiV8UiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_d_wu, "V4ULLiV4ULLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_q_du, "V4ULLiV4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_h_bu, "V16UsV16UsV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_w_hu, "V8UiV8UiV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_d_wu, "V4ULLiV4ULLiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_q_du, "V4ULLiV4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_h_bu_b, "V16sV16sV32UcV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_w_hu_h, "V8SiV8SiV16UsV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_d_wu_w, "V4LLiV4LLiV8UiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwev_q_du_d, "V4LLiV4LLiV4ULLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_h_bu_b, "V16sV16sV32UcV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_w_hu_h, "V8SiV8SiV16UsV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_d_wu_w, "V4LLiV4LLiV8UiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmaddwod_q_du_d, "V4LLiV4LLiV4ULLiV4LLi", "nc", "lasx") + + +TARGET_BUILTIN(__builtin_lasx_xvdiv_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvdiv_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvdiv_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvdiv_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvdiv_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvdiv_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvdiv_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvdiv_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmod_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmod_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmod_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmod_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmod_bu, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmod_hu, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmod_wu, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmod_du, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsat_b, "V32ScV32ScIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsat_h, "V16SsV16SsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsat_w, "V8SiV8SiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsat_d, "V4SLLiV4SLLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsat_bu, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsat_hu, "V16UsV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsat_wu, "V8UiV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsat_du, "V4ULLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvexth_h_b, "V16sV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvexth_w_h, "V8SiV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvexth_d_w, "V4LLiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvexth_q_d, "V4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvexth_hu_bu, "V16UsV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvexth_wu_hu, "V8UiV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvexth_du_wu, "V4ULLiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvexth_qu_du, "V4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_vext2xv_h_b, "V16sV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_vext2xv_w_b, "V8SiV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_vext2xv_d_b, "V4LLiV32c", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_vext2xv_w_h, "V8SiV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_vext2xv_d_h, "V4LLiV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_vext2xv_d_w, "V4LLiV8Si", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_vext2xv_hu_bu, "V16sV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_vext2xv_wu_bu, "V8SiV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_vext2xv_du_bu, "V4LLiV32c", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_vext2xv_wu_hu, "V8SiV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_vext2xv_du_hu, "V4LLiV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_vext2xv_du_wu, "V4LLiV8Si", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsigncov_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsigncov_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsigncov_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsigncov_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmskltz_b, "V32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmskltz_h, "V16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmskltz_w, "V8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmskltz_d, "V4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvmskgez_b, "V32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvmsknz_b, "V16sV16s", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvldi, "V4LLiIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrepli_b, "V32cIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrepli_h, "V16sIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrepli_w, "V8iIi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrepli_d, "V4LLiIi", "nc", "lasx") + + +TARGET_BUILTIN(__builtin_lasx_xvand_v, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvor_v, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvxor_v, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvnor_v, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvandn_v, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvorn_v, "V32ScV32ScV32Sc", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvandi_b, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvori_b, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvxori_b, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvnori_b, "V32UcV32UcIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsll_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsll_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsll_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsll_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvslli_b, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslli_h, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslli_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslli_d, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrl_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrl_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrl_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrl_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrli_b, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrli_h, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrli_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrli_d, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsra_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsra_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsra_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsra_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrai_b, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrai_h, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrai_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrai_d, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvrotr_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrotr_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrotr_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrotr_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvrotri_b, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrotri_h, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrotri_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrotri_d, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsllwil_h_b, "V16sV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsllwil_w_h, "V8SiV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsllwil_d_w, "V4LLiV8SiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvextl_q_d, "V4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsllwil_hu_bu, "V16UsV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsllwil_wu_hu, "V8UiV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsllwil_du_wu, "V4ULLiV8UiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvextl_qu_du, "V4LLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrlr_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlr_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlr_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlr_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrlri_b, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlri_h, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlri_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlri_d, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrar_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrar_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrar_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrar_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrari_b, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrari_h, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrari_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrari_d, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrln_b_h, "V32ScV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrln_h_w, "V16sV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrln_w_d, "V8SiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsran_b_h, "V32ScV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsran_h_w, "V16sV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsran_w_d, "V8SiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrlni_b_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlni_h_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlni_w_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlni_d_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrani_b_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrani_h_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrani_w_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrani_d_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrlrn_b_h, "V32ScV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlrn_h_w, "V16sV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlrn_w_d, "V8SiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrarn_b_h, "V32ScV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrarn_h_w, "V16sV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrarn_w_d, "V8SiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrlrni_b_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlrni_h_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlrni_w_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrlrni_d_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsrarni_b_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrarni_h_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrarni_w_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsrarni_d_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrln_b_h, "V32ScV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrln_h_w, "V16sV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrln_w_d, "V8SiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssran_b_h, "V32ScV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssran_h_w, "V16sV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssran_w_d, "V8SiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrln_bu_h, "V32UcV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrln_hu_w, "V16UsV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrln_wu_d, "V8UiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssran_bu_h, "V32UcV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssran_hu_w, "V16UsV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssran_wu_d, "V8UiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrlni_b_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlni_h_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlni_w_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlni_d_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrani_b_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrani_h_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrani_w_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrani_d_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrlrni_bu_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrni_hu_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrni_wu_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrni_du_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrani_bu_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrani_hu_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrani_wu_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrani_du_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrlrn_b_h, "V32ScV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrn_h_w, "V16sV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrn_w_d, "V8SiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrarn_b_h, "V32ScV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarn_h_w, "V16sV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarn_w_d, "V8SiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrlrn_bu_h, "V32UcV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrn_hu_w, "V16UsV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrn_wu_d, "V8UiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrarn_bu_h, "V32UcV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarn_hu_w, "V16UsV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarn_wu_d, "V8UiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrlrni_b_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrni_h_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrni_w_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlrni_d_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrarni_b_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarni_h_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarni_w_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarni_d_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrlni_bu_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlni_hu_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlni_wu_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrlni_du_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvssrarni_bu_h, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarni_hu_w, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarni_wu_d, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvssrarni_du_q, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvclo_b, "V32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvclo_h, "V16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvclo_w, "V8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvclo_d, "V4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvclz_b, "V32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvclz_h, "V16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvclz_w, "V8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvclz_d, "V4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpcnt_b, "V32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpcnt_h, "V16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpcnt_w, "V8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpcnt_d, "V4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbitclr_b, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitclr_h, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitclr_w, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitclr_d, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbitclri_b, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitclri_h, "V16UsV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitclri_w, "V8UiV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitclri_d, "V4ULLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbitset_b, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitset_h, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitset_w, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitset_d, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbitseti_b, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitseti_h, "V16UsV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitseti_w, "V8UiV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitseti_d, "V4ULLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbitrev_b, "V32UcV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitrev_h, "V16UsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitrev_w, "V8UiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitrev_d, "V4ULLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbitrevi_b, "V32UcV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitrevi_h, "V16UsV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitrevi_w, "V8UiV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbitrevi_d, "V4ULLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrstp_b, "V32ScV32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrstp_h, "V16SsV16SsV16SsV16Ss", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrstpi_b, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrstpi_h, "V16sV16sV16sIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfadd_s, "V8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfadd_d, "V4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfsub_s, "V8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfsub_d, "V4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfmul_s, "V8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfmul_d, "V4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfdiv_s, "V8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfdiv_d, "V4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfmadd_s, "V8fV8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfmadd_d, "V4dV4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfmsub_s, "V8fV8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfmsub_d, "V4dV4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfnmadd_s, "V8fV8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfnmadd_d, "V4dV4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfnmsub_s, "V8fV8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfnmsub_d, "V4dV4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfmax_s, "V8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfmax_d, "V4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfmin_s, "V8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfmin_d, "V4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfmaxa_s, "V8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfmaxa_d, "V4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfmina_s, "V8fV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfmina_d, "V4dV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvflogb_s, "V8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvflogb_d, "V4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfclass_s, "V8iV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfclass_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfsqrt_s, "V8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfsqrt_d, "V4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrecip_s, "V8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrecip_d, "V4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrsqrt_s, "V8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrsqrt_d, "V4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcvtl_s_h, "V8fV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcvth_s_h, "V8fV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcvtl_d_s, "V4dV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcvth_d_s, "V4dV8f", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcvt_h_s, "V16sV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcvt_s_d, "V8fV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrintrne_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrintrne_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrintrz_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrintrz_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrintrp_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrintrp_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrintrm_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrintrm_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfrint_s, "V8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfrint_d, "V4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrne_w_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrne_l_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrz_w_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrz_l_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrp_w_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrp_l_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrm_w_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrm_l_d, "V4LLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftint_w_s, "V8SiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftint_l_d, "V4SLLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrz_wu_s, "V8UiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrz_lu_d, "V4ULLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftint_wu_s, "V8UiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftint_lu_d, "V4ULLiV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrne_w_d, "V8SiV4dV4d", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrz_w_d, "V8SiV4dV4d", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrp_w_d, "V8SiV4dV4d", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrm_w_d, "V8SiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftint_w_d, "V8SiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrnel_l_s, "V4LLiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrneh_l_s, "V4LLiV8f", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrzl_l_s, "V4LLiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrzh_l_s, "V4LLiV8f", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrpl_l_s, "V4LLiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrph_l_s, "V4LLiV8f", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintrml_l_s, "V4LLiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftintrmh_l_s, "V4LLiV8f", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvftintl_l_s, "V4LLiV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvftinth_l_s, "V4LLiV8f", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvffint_s_w, "V8fV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvffint_d_l, "V4dV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvffint_s_wu, "V8fV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvffint_d_lu, "V4dV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvffintl_d_w, "V4dV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvffinth_d_w, "V4dV8Si", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvffint_s_l, "V8fV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvseq_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvseq_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvseq_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvseq_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvseqi_b, "V32ScV32ScISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvseqi_h, "V16SsV16SsISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvseqi_w, "V8SiV8SiISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvseqi_d, "V4SLLiV4SLLiISi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsle_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsle_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsle_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsle_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvslei_b, "V32ScV32ScISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslei_h, "V16SsV16SsISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslei_w, "V8SiV8SiISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslei_d, "V4SLLiV4SLLiISi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvsle_bu, "V32ScV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsle_hu, "V16SsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsle_wu, "V8SiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvsle_du, "V4SLLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvslei_bu, "V32ScV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslei_hu, "V16SsV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslei_wu, "V8SiV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslei_du, "V4SLLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvslt_b, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslt_h, "V16SsV16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslt_w, "V8SiV8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslt_d, "V4SLLiV4SLLiV4SLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvslti_b, "V32ScV32ScISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslti_h, "V16SsV16SsISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslti_w, "V8SiV8SiISi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslti_d, "V4SLLiV4SLLiISi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvslt_bu, "V32ScV32UcV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslt_hu, "V16SsV16UsV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslt_wu, "V8SiV8UiV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslt_du, "V4SLLiV4ULLiV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvslti_bu, "V32ScV32UcIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslti_hu, "V16SsV16UsIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslti_wu, "V8SiV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvslti_du, "V4SLLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_caf_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_caf_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cun_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cun_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_ceq_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_ceq_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cueq_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cueq_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_clt_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_clt_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cult_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cult_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cle_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cle_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cule_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cule_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cne_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cne_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cor_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cor_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cune_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_cune_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_saf_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_saf_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sun_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sun_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_seq_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_seq_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sueq_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sueq_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_slt_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_slt_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sult_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sult_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sle_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sle_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sule_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sule_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sne_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sne_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sor_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sor_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sune_s, "V8SiV8fV8f", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvfcmp_sune_d, "V4SLLiV4dV4d", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbitsel_v, "V32UcV32UcV32UcV32Uc", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbitseli_b, "V32UcV32UcV32UcIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvreplgr2vr_b, "V32Sci", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplgr2vr_h, "V16Ssi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplgr2vr_w, "V8Sii", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplgr2vr_d, "V4SLLiLLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvinsgr2vr_w, "V8SiV8SiiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvinsgr2vr_d, "V4SLLiV4SLLiLLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpickve2gr_w, "iV8SiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickve2gr_d, "LLiV4SLLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpickve2gr_wu, "iV8UiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickve2gr_du, "LLiV4ULLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvreplve_b, "V32cV32cUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplve_h, "V16sV16sUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplve_w, "V8iV8iUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplve_d, "V4LLiV4LLiUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvrepl128vei_b, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrepl128vei_h, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrepl128vei_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvrepl128vei_d, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvreplve0_b, "V32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplve0_h, "V16SsV16Ss", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplve0_w, "V8SiV8Si", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplve0_d, "V4SLLiV4SLLi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvreplve0_q, "V32ScV32Sc", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvinsve0_w, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvinsve0_d, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpickve_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickve_d, "V4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpickve_w_f, "V8fV8fIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickve_d_f, "V4dV4dIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvbsll_v, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvbsrl_v, "V32cV32cIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpackev_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpackev_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpackev_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpackev_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpackod_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpackod_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpackod_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpackod_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpickev_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickev_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickev_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickev_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpickod_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickod_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickod_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpickod_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvilvl_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvilvl_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvilvl_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvilvl_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvilvh_b, "V32cV32cV32c", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvilvh_h, "V16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvilvh_w, "V8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvilvh_d, "V4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvshuf_b, "V32UcV32UcV32UcV32Uc", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvshuf_h, "V16sV16sV16sV16s", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvshuf_w, "V8iV8iV8iV8i", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvshuf_d, "V4LLiV4LLiV4LLiV4LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvperm_w, "V8iV8iV8i", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvshuf4i_b, "V32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvshuf4i_h, "V16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvshuf4i_w, "V8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvshuf4i_d, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvpermi_w, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpermi_d, "V4LLiV4LLiIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvpermi_q, "V32cV32cV32cIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvextrins_b, "V32cV32cV32cIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvextrins_h, "V16sV16sV16sIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvextrins_w, "V8iV8iV8iIUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvextrins_d, "V4LLiV4LLiV4LLiIUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvld, "V32ScvC*Ii", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvst, "vV32Scv*Ii", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvldx, "V32ScvC*LLi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvstx, "vV32Scv*LLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvldrepl_b, "V32cvC*Ii", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvldrepl_h, "V16svC*Ii", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvldrepl_w, "V8ivC*Ii", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvldrepl_d, "V4LLivC*Ii", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xvstelm_b, "vV32Scv*IiUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvstelm_h, "vV16Ssv*IiUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvstelm_w, "vV8Siv*IiUi", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvstelm_d, "vV4SLLiv*IiUi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xbz_v, "iV32Uc", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xbnz_v, "iV32Uc", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xbz_b, "iV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xbz_h, "iV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xbz_w, "iV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xbz_d, "iV4ULLi", "nc", "lasx") + +TARGET_BUILTIN(__builtin_lasx_xbnz_b, "iV32Uc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xbnz_h, "iV16Us", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xbnz_w, "iV8Ui", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xbnz_d, "iV4ULLi", "nc", "lasx") diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchLSX.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchLSX.def new file mode 100644 index 000000000000..8e6aec886c50 --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsLoongArchLSX.def @@ -0,0 +1,953 @@ +//=============------------- BuiltinsLoongArchLSX.def --------------- C++ -*-=// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +// This file defines the LoongArch-specific LSX builtin function database. +// Users of this file must define the BUILTIN macro to make use of this +// information. +// +//===----------------------------------------------------------------------===// + +TARGET_BUILTIN(__builtin_lsx_vadd_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vadd_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vadd_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vadd_d, "V2LLiV2LLiV2LLi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vadd_q, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsub_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsub_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsub_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsub_d, "V2LLiV2LLiV2LLi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsub_q, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vaddi_bu, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddi_hu, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddi_wu, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddi_du, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsubi_bu, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubi_hu, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubi_wu, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubi_du, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vneg_b, "V16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vneg_h, "V8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vneg_w, "V4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vneg_d, "V2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsadd_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsadd_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsadd_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsadd_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsadd_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsadd_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsadd_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsadd_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssub_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssub_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssub_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssub_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssub_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssub_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssub_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssub_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vhaddw_h_b, "V8SsV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhaddw_w_h, "V4SiV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhaddw_d_w, "V2SLLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhaddw_q_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vhaddw_hu_bu, "V8UsV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhaddw_wu_hu, "V4UiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhaddw_du_wu, "V2ULLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhaddw_qu_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vhsubw_h_b, "V8SsV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhsubw_w_h, "V4SiV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhsubw_d_w, "V2SLLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhsubw_q_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vhsubw_hu_bu, "V8UsV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhsubw_wu_hu, "V4UiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhsubw_du_wu, "V2ULLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vhsubw_qu_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vaddwev_h_b, "V8sV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_w_h, "V4SiV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_d_w, "V2LLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_q_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vaddwod_h_b, "V8sV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_w_h, "V4SiV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_d_w, "V2LLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_q_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsubwev_h_b, "V8sV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwev_w_h, "V4SiV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwev_d_w, "V2LLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwev_q_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsubwod_h_b, "V8sV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwod_w_h, "V4SiV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwod_d_w, "V2LLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwod_q_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vaddwev_h_bu, "V8sV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_w_hu, "V4SiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_d_wu, "V2LLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_q_du, "V2LLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vaddwod_h_bu, "V8sV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_w_hu, "V4SiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_d_wu, "V2LLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_q_du, "V2LLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsubwev_h_bu, "V8sV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwev_w_hu, "V4SiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwev_d_wu, "V2LLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwev_q_du, "V2LLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsubwod_h_bu, "V8sV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwod_w_hu, "V4SiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwod_d_wu, "V2LLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsubwod_q_du, "V2LLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vaddwev_h_bu_b, "V8sV16UcV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_w_hu_h, "V4SiV8UsV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_d_wu_w, "V2LLiV4UiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwev_q_du_d, "V2LLiV2ULLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vaddwod_h_bu_b, "V8sV16UcV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_w_hu_h, "V4SiV8UsV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_d_wu_w, "V2LLiV4UiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vaddwod_q_du_d, "V2LLiV2ULLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vavg_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavg_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavg_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavg_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vavg_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavg_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavg_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavg_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vavgr_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavgr_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavgr_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavgr_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vavgr_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavgr_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavgr_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vavgr_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vabsd_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vabsd_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vabsd_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vabsd_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vabsd_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vabsd_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vabsd_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vabsd_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vadda_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vadda_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vadda_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vadda_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmax_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmax_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmax_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmax_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmaxi_b, "V16ScV16ScIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaxi_h, "V8SsV8SsIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaxi_w, "V4SiV4SiIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaxi_d, "V2SLLiV2SLLiIi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmax_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmax_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmax_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmax_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmaxi_bu, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaxi_hu, "V8UsV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaxi_wu, "V4UiV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaxi_du, "V2ULLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmin_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmin_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmin_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmin_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmini_b, "V16ScV16ScIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmini_h, "V8SsV8SsIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmini_w, "V4SiV4SiIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmini_d, "V2SLLiV2SLLiIi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmin_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmin_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmin_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmin_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmini_bu, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmini_hu, "V8UsV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmini_wu, "V4UiV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmini_du, "V2ULLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmul_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmul_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmul_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmul_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmuh_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmuh_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmuh_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmuh_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmuh_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmuh_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmuh_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmuh_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmulwev_h_b, "V8sV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_w_h, "V4SiV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_d_w, "V2LLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_q_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmulwod_h_b, "V8sV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_w_h, "V4SiV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_d_w, "V2LLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_q_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmulwev_h_bu, "V8sV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_w_hu, "V4SiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_d_wu, "V2LLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_q_du, "V2LLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmulwod_h_bu, "V8sV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_w_hu, "V4SiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_d_wu, "V2LLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_q_du, "V2LLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmulwev_h_bu_b, "V8sV16UcV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_w_hu_h, "V4SiV8UsV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_d_wu_w, "V2LLiV4UiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwev_q_du_d, "V2LLiV2ULLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmulwod_h_bu_b, "V8sV16UcV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_w_hu_h, "V4SiV8UsV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_d_wu_w, "V2LLiV4UiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmulwod_q_du_d, "V2LLiV2ULLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmadd_b, "V16ScV16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmadd_h, "V8SsV8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmadd_w, "V4SiV4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmadd_d, "V2SLLiV2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmsub_b, "V16ScV16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmsub_h, "V8SsV8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmsub_w, "V4SiV4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmsub_d, "V2SLLiV2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmaddwev_h_b, "V8sV8sV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_w_h, "V4SiV4SiV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_d_w, "V2LLiV2LLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_q_d, "V2LLiV2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmaddwod_h_b, "V8sV8sV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_w_h, "V4SiV4SiV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_d_w, "V2LLiV2LLiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_q_d, "V2LLiV2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmaddwev_h_bu, "V8UsV8UsV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_w_hu, "V4UiV4UiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_d_wu, "V2ULLiV2ULLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_q_du, "V2ULLiV2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmaddwod_h_bu, "V8UsV8UsV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_w_hu, "V4UiV4UiV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_d_wu, "V2ULLiV2ULLiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_q_du, "V2ULLiV2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmaddwev_h_bu_b, "V8sV8sV16UcV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_w_hu_h, "V4SiV4SiV8UsV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_d_wu_w, "V2LLiV2LLiV4UiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwev_q_du_d, "V2LLiV2LLiV2ULLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmaddwod_h_bu_b, "V8sV8sV16UcV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_w_hu_h, "V4SiV4SiV8UsV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_d_wu_w, "V2LLiV2LLiV4UiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmaddwod_q_du_d, "V2LLiV2LLiV2ULLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vdiv_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vdiv_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vdiv_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vdiv_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vdiv_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vdiv_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vdiv_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vdiv_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmod_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmod_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmod_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmod_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + + +TARGET_BUILTIN(__builtin_lsx_vmod_bu, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmod_hu, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmod_wu, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmod_du, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsat_b, "V16ScV16ScIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsat_h, "V8SsV8SsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsat_w, "V4SiV4SiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsat_d, "V2SLLiV2SLLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsat_bu, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsat_hu, "V8UsV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsat_wu, "V4UiV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsat_du, "V2ULLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vexth_h_b, "V8sV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vexth_w_h, "V4SiV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vexth_d_w, "V2LLiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vexth_q_d, "V2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vexth_hu_bu, "V8UsV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vexth_wu_hu, "V4UiV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vexth_du_wu, "V2ULLiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vexth_qu_du, "V2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsigncov_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsigncov_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsigncov_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsigncov_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmskltz_b, "V16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmskltz_h, "V8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmskltz_w, "V4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmskltz_d, "V2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vmskgez_b, "V16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vmsknz_b, "V8sV8s", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vldi, "V2LLiIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrepli_b, "V16cIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrepli_h, "V8sIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrepli_w, "V4iIi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrepli_d, "V2LLiIi", "nc", "lsx") + + +TARGET_BUILTIN(__builtin_lsx_vand_v, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vor_v, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vxor_v, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vnor_v, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vandn_v, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vorn_v, "V16ScV16ScV16Sc", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vandi_b, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vori_b, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vxori_b, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vnori_b, "V16UcV16UcIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsll_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsll_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsll_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsll_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vslli_b, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslli_h, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslli_w, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslli_d, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrl_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrl_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrl_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrl_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrli_b, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrli_h, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrli_w, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrli_d, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsra_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsra_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsra_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsra_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrai_b, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrai_h, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrai_w, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrai_d, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vrotr_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrotr_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrotr_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrotr_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vrotri_b, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrotri_h, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrotri_w, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vrotri_d, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsllwil_h_b, "V8sV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsllwil_w_h, "V4SiV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsllwil_d_w, "V2LLiV4SiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vextl_q_d, "V2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsllwil_hu_bu, "V8UsV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsllwil_wu_hu, "V4UiV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsllwil_du_wu, "V2ULLiV4UiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vextl_qu_du, "V2LLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrlr_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlr_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlr_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlr_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrlri_b, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlri_h, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlri_w, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlri_d, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrar_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrar_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrar_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrar_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrari_b, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrari_h, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrari_w, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrari_d, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrln_b_h, "V16ScV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrln_h_w, "V8sV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrln_w_d, "V4SiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsran_b_h, "V16ScV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsran_h_w, "V8sV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsran_w_d, "V4SiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrlni_b_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlni_h_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlni_w_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlni_d_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrani_b_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrani_h_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrani_w_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrani_d_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrlrn_b_h, "V16ScV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlrn_h_w, "V8sV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlrn_w_d, "V4SiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrarn_b_h, "V16ScV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrarn_h_w, "V8sV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrarn_w_d, "V4SiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrlrni_b_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlrni_h_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlrni_w_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrlrni_d_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsrarni_b_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrarni_h_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrarni_w_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsrarni_d_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrln_b_h, "V16ScV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrln_h_w, "V8sV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrln_w_d, "V4SiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssran_b_h, "V16ScV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssran_h_w, "V8sV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssran_w_d, "V4SiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrln_bu_h, "V16UcV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrln_hu_w, "V8UsV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrln_wu_d, "V4UiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssran_bu_h, "V16UcV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssran_hu_w, "V8UsV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssran_wu_d, "V4UiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrlni_b_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlni_h_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlni_w_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlni_d_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrani_b_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrani_h_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrani_w_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrani_d_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrlrni_bu_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrni_hu_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrni_wu_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrni_du_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrani_bu_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrani_hu_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrani_wu_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrani_du_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrlrn_b_h, "V16ScV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrn_h_w, "V8sV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrn_w_d, "V4SiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrarn_b_h, "V16ScV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarn_h_w, "V8sV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarn_w_d, "V4SiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrlrn_bu_h, "V16UcV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrn_hu_w, "V8UsV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrn_wu_d, "V4UiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrarn_bu_h, "V16UcV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarn_hu_w, "V8UsV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarn_wu_d, "V4UiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrlrni_b_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrni_h_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrni_w_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlrni_d_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrarni_b_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarni_h_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarni_w_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarni_d_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrlni_bu_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlni_hu_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlni_wu_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrlni_du_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vssrarni_bu_h, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarni_hu_w, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarni_wu_d, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vssrarni_du_q, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vclo_b, "V16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vclo_h, "V8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vclo_w, "V4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vclo_d, "V2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vclz_b, "V16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vclz_h, "V8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vclz_w, "V4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vclz_d, "V2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vpcnt_b, "V16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpcnt_h, "V8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpcnt_w, "V4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpcnt_d, "V2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbitclr_b, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitclr_h, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitclr_w, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitclr_d, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbitclri_b, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitclri_h, "V8UsV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitclri_w, "V4UiV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitclri_d, "V2ULLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbitset_b, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitset_h, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitset_w, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitset_d, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbitseti_b, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitseti_h, "V8UsV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitseti_w, "V4UiV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitseti_d, "V2ULLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbitrev_b, "V16UcV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitrev_h, "V8UsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitrev_w, "V4UiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitrev_d, "V2ULLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbitrevi_b, "V16UcV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitrevi_h, "V8UsV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitrevi_w, "V4UiV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbitrevi_d, "V2ULLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrstp_b, "V16ScV16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrstp_h, "V8SsV8SsV8SsV8Ss", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrstpi_b, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrstpi_h, "V8sV8sV8sIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfadd_s, "V4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfadd_d, "V2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfsub_s, "V4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfsub_d, "V2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfmul_s, "V4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfmul_d, "V2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfdiv_s, "V4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfdiv_d, "V2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfmadd_s, "V4fV4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfmadd_d, "V2dV2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfmsub_s, "V4fV4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfmsub_d, "V2dV2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfnmadd_s, "V4fV4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfnmadd_d, "V2dV2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfnmsub_s, "V4fV4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfnmsub_d, "V2dV2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfmax_s, "V4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfmax_d, "V2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfmin_s, "V4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfmin_d, "V2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfmaxa_s, "V4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfmaxa_d, "V2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfmina_s, "V4fV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfmina_d, "V2dV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vflogb_s, "V4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vflogb_d, "V2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfclass_s, "V4iV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfclass_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfsqrt_s, "V4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfsqrt_d, "V2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrecip_s, "V4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrecip_d, "V2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrsqrt_s, "V4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrsqrt_d, "V2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcvtl_s_h, "V4fV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcvtl_d_s, "V2dV4f", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcvth_s_h, "V4fV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcvth_d_s, "V2dV4f", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcvt_h_s, "V8sV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcvt_s_d, "V4fV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrintrne_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrintrne_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrintrz_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrintrz_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrintrp_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrintrp_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrintrm_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrintrm_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfrint_s, "V4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfrint_d, "V2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrne_w_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrne_l_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrz_w_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrz_l_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrp_w_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrp_l_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrm_w_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrm_l_d, "V2LLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftint_w_s, "V4SiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftint_l_d, "V2SLLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrz_wu_s, "V4UiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrz_lu_d, "V2ULLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftint_wu_s, "V4UiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftint_lu_d, "V2ULLiV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrne_w_d, "V4SiV2dV2d", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrz_w_d, "V4SiV2dV2d", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrp_w_d, "V4SiV2dV2d", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrm_w_d, "V4SiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftint_w_d, "V4SiV2dV2d", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrnel_l_s, "V2LLiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrneh_l_s, "V2LLiV4f", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrzl_l_s, "V2LLiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrzh_l_s, "V2LLiV4f", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrpl_l_s, "V2LLiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrph_l_s, "V2LLiV4f", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintrml_l_s, "V2LLiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftintrmh_l_s, "V2LLiV4f", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vftintl_l_s, "V2LLiV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vftinth_l_s, "V2LLiV4f", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vffint_s_w, "V4fV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vffint_d_l, "V2dV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vffint_s_wu, "V4fV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vffint_d_lu, "V2dV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vffintl_d_w, "V2dV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vffinth_d_w, "V2dV4Si", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vffint_s_l, "V4fV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vseq_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vseq_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vseq_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vseq_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vseqi_b, "V16ScV16ScISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vseqi_h, "V8SsV8SsISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vseqi_w, "V4SiV4SiISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vseqi_d, "V2SLLiV2SLLiISi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsle_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsle_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsle_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsle_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vslei_b, "V16ScV16ScISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslei_h, "V8SsV8SsISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslei_w, "V4SiV4SiISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslei_d, "V2SLLiV2SLLiISi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vsle_bu, "V16ScV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsle_hu, "V8SsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsle_wu, "V4SiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vsle_du, "V2SLLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vslei_bu, "V16ScV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslei_hu, "V8SsV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslei_wu, "V4SiV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslei_du, "V2SLLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vslt_b, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslt_h, "V8SsV8SsV8Ss", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslt_w, "V4SiV4SiV4Si", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslt_d, "V2SLLiV2SLLiV2SLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vslti_b, "V16ScV16ScISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslti_h, "V8SsV8SsISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslti_w, "V4SiV4SiISi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslti_d, "V2SLLiV2SLLiISi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vslt_bu, "V16ScV16UcV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslt_hu, "V8SsV8UsV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslt_wu, "V4SiV4UiV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslt_du, "V2SLLiV2ULLiV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vslti_bu, "V16ScV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslti_hu, "V8SsV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslti_wu, "V4SiV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vslti_du, "V2SLLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_caf_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_caf_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_cun_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_cun_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_ceq_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_ceq_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_cueq_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_cueq_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_clt_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_clt_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_cult_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_cult_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_cle_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_cle_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_cule_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_cule_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_cne_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_cne_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_cor_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_cor_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_cune_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_cune_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_saf_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_saf_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_sun_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_sun_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_seq_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_seq_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_sueq_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_sueq_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_slt_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_slt_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_sult_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_sult_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_sle_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_sle_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_sule_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_sule_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_sne_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_sne_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_sor_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_sor_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vfcmp_sune_s, "V4SiV4fV4f", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vfcmp_sune_d, "V2SLLiV2dV2d", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbitsel_v, "V16UcV16UcV16UcV16Uc", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbitseli_b, "V16UcV16UcV16UcIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vreplgr2vr_b, "V16Sci", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplgr2vr_h, "V8Ssi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplgr2vr_w, "V4Sii", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplgr2vr_d, "V2SLLiLLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vinsgr2vr_b, "V16ScV16SciIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vinsgr2vr_h, "V8SsV8SsiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vinsgr2vr_w, "V4SiV4SiiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vinsgr2vr_d, "V2SLLiV2SLLiLLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vpickve2gr_b, "iV16ScIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickve2gr_h, "iV8SsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickve2gr_w, "iV4SiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickve2gr_d, "LLiV2SLLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vpickve2gr_bu, "iV16UcIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickve2gr_hu, "iV8UsIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickve2gr_wu, "iV4UiIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickve2gr_du, "LLiV2ULLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vreplve_b, "V16cV16cUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplve_h, "V8sV8sUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplve_w, "V4iV4iUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplve_d, "V2LLiV2LLiUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vreplvei_b, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplvei_h, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplvei_w, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vreplvei_d, "V2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vbsll_v, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vbsrl_v, "V16cV16cIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vpackev_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpackev_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpackev_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpackev_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vpackod_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpackod_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpackod_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpackod_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vpickev_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickev_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickev_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickev_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vpickod_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickod_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickod_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vpickod_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vilvl_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vilvl_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vilvl_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vilvl_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vilvh_b, "V16cV16cV16c", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vilvh_h, "V8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vilvh_w, "V4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vilvh_d, "V2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vshuf_b, "V16UcV16UcV16UcV16Uc", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vshuf_h, "V8sV8sV8sV8s", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vshuf_w, "V4iV4iV4iV4i", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vshuf_d, "V2LLiV2LLiV2LLiV2LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vshuf4i_b, "V16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vshuf4i_h, "V8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vshuf4i_w, "V4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vshuf4i_d, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vpermi_w, "V4iV4iV4iIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vextrins_b, "V16cV16cV16cIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vextrins_h, "V8sV8sV8sIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vextrins_w, "V4iV4iV4iIUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vextrins_d, "V2LLiV2LLiV2LLiIUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vld, "V16ScvC*Ii", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vst, "vV16Scv*Ii", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vldx, "V16ScvC*LLi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vstx, "vV16Scv*LLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vldrepl_b, "V16cvC*Ii", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vldrepl_h, "V8svC*Ii", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vldrepl_w, "V4ivC*Ii", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vldrepl_d, "V2LLivC*Ii", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_vstelm_b, "vV16Scv*IiUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vstelm_h, "vV8Ssv*IiUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vstelm_w, "vV4Siv*IiUi", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vstelm_d, "vV2SLLiv*IiUi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_bz_v, "iV16Uc", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_bnz_v, "iV16Uc", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_bz_b, "iV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_bz_h, "iV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_bz_w, "iV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_bz_d, "iV2ULLi", "nc", "lsx") + +TARGET_BUILTIN(__builtin_lsx_bnz_b, "iV16Uc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_bnz_h, "iV8Us", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_bnz_w, "iV4Ui", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_bnz_d, "iV2ULLi", "nc", "lsx") diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsNVPTX.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsNVPTX.def index f645ad25cbd8..0f2e8260143b 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsNVPTX.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsNVPTX.def @@ -26,7 +26,9 @@ #pragma push_macro("SM_87") #pragma push_macro("SM_89") #pragma push_macro("SM_90") -#define SM_90 "sm_90" +#pragma push_macro("SM_90a") +#define SM_90a "sm_90a" +#define SM_90 "sm_90|" SM_90a #define SM_89 "sm_89|" SM_90 #define SM_87 "sm_87|" SM_89 #define SM_86 "sm_86|" SM_87 @@ -56,7 +58,11 @@ #pragma push_macro("PTX78") #pragma push_macro("PTX80") #pragma push_macro("PTX81") -#define PTX81 "ptx81" +#pragma push_macro("PTX82") +#pragma push_macro("PTX83") +#define PTX83 "ptx83" +#define PTX82 "ptx82|" PTX83 +#define PTX81 "ptx81|" PTX82 #define PTX80 "ptx80|" PTX81 #define PTX78 "ptx78|" PTX80 #define PTX77 "ptx77|" PTX78 @@ -920,22 +926,22 @@ TARGET_BUILTIN(__hmma_m16n16k16_ld_a, "vi*iC*UiIi", "", AND(SM_70,PTX60)) TARGET_BUILTIN(__hmma_m16n16k16_ld_b, "vi*iC*UiIi", "", AND(SM_70,PTX60)) TARGET_BUILTIN(__hmma_m16n16k16_ld_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX60)) TARGET_BUILTIN(__hmma_m16n16k16_ld_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX60)) -TARGET_BUILTIN(__hmma_m16n16k16_st_c_f16, "vi*i*UiIi", "", AND(SM_70,PTX60)) -TARGET_BUILTIN(__hmma_m16n16k16_st_c_f32, "vf*f*UiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_st_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_st_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX60)) TARGET_BUILTIN(__hmma_m32n8k16_ld_a, "vi*iC*UiIi", "", AND(SM_70,PTX61)) TARGET_BUILTIN(__hmma_m32n8k16_ld_b, "vi*iC*UiIi", "", AND(SM_70,PTX61)) TARGET_BUILTIN(__hmma_m32n8k16_ld_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX61)) TARGET_BUILTIN(__hmma_m32n8k16_ld_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX61)) -TARGET_BUILTIN(__hmma_m32n8k16_st_c_f16, "vi*i*UiIi", "", AND(SM_70,PTX61)) -TARGET_BUILTIN(__hmma_m32n8k16_st_c_f32, "vf*f*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_st_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_st_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX61)) TARGET_BUILTIN(__hmma_m8n32k16_ld_a, "vi*iC*UiIi", "", AND(SM_70,PTX61)) TARGET_BUILTIN(__hmma_m8n32k16_ld_b, "vi*iC*UiIi", "", AND(SM_70,PTX61)) TARGET_BUILTIN(__hmma_m8n32k16_ld_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX61)) TARGET_BUILTIN(__hmma_m8n32k16_ld_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX61)) -TARGET_BUILTIN(__hmma_m8n32k16_st_c_f16, "vi*i*UiIi", "", AND(SM_70,PTX61)) -TARGET_BUILTIN(__hmma_m8n32k16_st_c_f32, "vf*f*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_st_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_st_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX61)) TARGET_BUILTIN(__hmma_m16n16k16_mma_f16f16, "vi*iC*iC*iC*IiIi", "", AND(SM_70,PTX60)) TARGET_BUILTIN(__hmma_m16n16k16_mma_f32f16, "vf*iC*iC*iC*IiIi", "", AND(SM_70,PTX60)) @@ -1055,6 +1061,7 @@ TARGET_BUILTIN(__nvvm_getctarank_shared_cluster, "iv*3", "", AND(SM_90,PTX78)) #pragma pop_macro("SM_87") #pragma pop_macro("SM_89") #pragma pop_macro("SM_90") +#pragma pop_macro("SM_90a") #pragma pop_macro("PTX42") #pragma pop_macro("PTX60") #pragma pop_macro("PTX61") @@ -1072,3 +1079,5 @@ TARGET_BUILTIN(__nvvm_getctarank_shared_cluster, "iv*3", "", AND(SM_90,PTX78)) #pragma pop_macro("PTX78") #pragma pop_macro("PTX80") #pragma pop_macro("PTX81") +#pragma pop_macro("PTX82") +#pragma pop_macro("PTX83") diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsPPC.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsPPC.def index 1e52d351780c..a35488ed3dfa 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsPPC.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsPPC.def @@ -151,8 +151,11 @@ TARGET_BUILTIN(__builtin_ppc_extract_exp, "Uid", "", "power9-vector") TARGET_BUILTIN(__builtin_ppc_extract_sig, "ULLid", "", "power9-vector") BUILTIN(__builtin_ppc_mtfsb0, "vUIi", "") BUILTIN(__builtin_ppc_mtfsb1, "vUIi", "") +BUILTIN(__builtin_ppc_mffs, "d", "") +TARGET_BUILTIN(__builtin_ppc_mffsl, "d", "", "isa-v30-instructions") BUILTIN(__builtin_ppc_mtfsf, "vUIiUi", "") BUILTIN(__builtin_ppc_mtfsfi, "vUIiUIi", "") +BUILTIN(__builtin_ppc_set_fpscr_rn, "di", "") TARGET_BUILTIN(__builtin_ppc_insert_exp, "ddULLi", "", "power9-vector") BUILTIN(__builtin_ppc_fmsub, "dddd", "") BUILTIN(__builtin_ppc_fmsubs, "ffff", "") diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsRISCV.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsRISCV.def index 50e912c2c1c7..1528b18c82ea 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsRISCV.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsRISCV.def @@ -86,8 +86,8 @@ TARGET_BUILTIN(__builtin_riscv_sm3p0, "UiUi", "nc", "zksh") TARGET_BUILTIN(__builtin_riscv_sm3p1, "UiUi", "nc", "zksh") // Zihintntl extension -TARGET_BUILTIN(__builtin_riscv_ntl_load, "v.", "t", "experimental-zihintntl") -TARGET_BUILTIN(__builtin_riscv_ntl_store, "v.", "t", "experimental-zihintntl") +TARGET_BUILTIN(__builtin_riscv_ntl_load, "v.", "t", "zihintntl") +TARGET_BUILTIN(__builtin_riscv_ntl_store, "v.", "t", "zihintntl") #undef BUILTIN #undef TARGET_BUILTIN diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsSystemZ.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsSystemZ.def index 079e41136488..f0c0ebfa622a 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsSystemZ.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsSystemZ.def @@ -64,14 +64,14 @@ TARGET_BUILTIN(__builtin_s390_vupllh, "V4UiV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vupllf, "V2ULLiV4Ui", "nc", "vector") // Vector integer instructions (chapter 22 of the PoP) -TARGET_BUILTIN(__builtin_s390_vaq, "V16UcV16UcV16Uc", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vacq, "V16UcV16UcV16UcV16Uc", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vaq, "SLLLiSLLLiSLLLi", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vacq, "ULLLiULLLiULLLiULLLi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vaccb, "V16UcV16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vacch, "V8UsV8UsV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vaccf, "V4UiV4UiV4Ui", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vaccg, "V2ULLiV2ULLiV2ULLi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vaccq, "V16UcV16UcV16Uc", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vacccq, "V16UcV16UcV16UcV16Uc", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vaccq, "ULLLiULLLiULLLi", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vacccq, "ULLLiULLLiULLLiULLLi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vavgb, "V16ScV16ScV16Sc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vavgh, "V8SsV8SsV8Ss", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vavgf, "V4SiV4SiV4Si", "nc", "vector") @@ -80,10 +80,10 @@ TARGET_BUILTIN(__builtin_s390_vavglb, "V16UcV16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vavglh, "V8UsV8UsV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vavglf, "V4UiV4UiV4Ui", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vavglg, "V2ULLiV2ULLiV2ULLi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vceqbs, "V16ScV16ScV16Sci*", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vceqhs, "V8SsV8SsV8Ssi*", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vceqfs, "V4SiV4SiV4Sii*", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vceqgs, "V2SLLiV2SLLiV2SLLii*", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vceqbs, "V16ScV16UcV16Uci*", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vceqhs, "V8SsV8UsV8Usi*", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vceqfs, "V4SiV4UiV4Uii*", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vceqgs, "V2SLLiV2ULLiV2ULLii*", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vchbs, "V16ScV16ScV16Sci*", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vchhs, "V8SsV8SsV8Ssi*", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vchfs, "V4SiV4SiV4Sii*", "nc", "vector") @@ -105,10 +105,10 @@ TARGET_BUILTIN(__builtin_s390_verimb, "V16UcV16UcV16UcV16UcIi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_verimh, "V8UsV8UsV8UsV8UsIi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_verimf, "V4UiV4UiV4UiV4UiIi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_verimg, "V2ULLiV2ULLiV2ULLiV2ULLiIi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_verllb, "V16UcV16UcUi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_verllh, "V8UsV8UsUi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_verllf, "V4UiV4UiUi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_verllg, "V2ULLiV2ULLiUi", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_verllb, "V16UcV16UcUc", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_verllh, "V8UsV8UsUc", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_verllf, "V4UiV4UiUc", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_verllg, "V2ULLiV2ULLiUc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_verllvb, "V16UcV16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_verllvh, "V8UsV8UsV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_verllvf, "V4UiV4UiV4Ui", "nc", "vector") @@ -116,11 +116,11 @@ TARGET_BUILTIN(__builtin_s390_verllvg, "V2ULLiV2ULLiV2ULLi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vgfmb, "V8UsV16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vgfmh, "V4UiV8UsV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vgfmf, "V2ULLiV4UiV4Ui", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vgfmg, "V16UcV2ULLiV2ULLi", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vgfmg, "ULLLiV2ULLiV2ULLi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vgfmab, "V8UsV16UcV16UcV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vgfmah, "V4UiV8UsV8UsV4Ui", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vgfmaf, "V2ULLiV4UiV4UiV2ULLi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vgfmag, "V16UcV2ULLiV2ULLiV16Uc", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vgfmag, "ULLLiV2ULLiV2ULLiULLLi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vmahb, "V16ScV16ScV16ScV16Sc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vmahh, "V8SsV8SsV8SsV8Ss", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vmahf, "V4SiV4SiV4SiV4Si", "nc", "vector") @@ -161,14 +161,14 @@ TARGET_BUILTIN(__builtin_s390_vpopctb, "V16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vpopcth, "V8UsV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vpopctf, "V4UiV4Ui", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vpopctg, "V2ULLiV2ULLi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vsq, "V16UcV16UcV16Uc", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vsbcbiq, "V16UcV16UcV16UcV16Uc", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vsbiq, "V16UcV16UcV16UcV16Uc", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vsq, "SLLLiSLLLiSLLLi", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vsbcbiq, "ULLLiULLLiULLLiULLLi", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vsbiq, "ULLLiULLLiULLLiULLLi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vscbib, "V16UcV16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vscbih, "V8UsV8UsV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vscbif, "V4UiV4UiV4Ui", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vscbig, "V2ULLiV2ULLiV2ULLi", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vscbiq, "V16UcV16UcV16Uc", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vscbiq, "ULLLiULLLiULLLi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vsl, "V16UcV16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vslb, "V16UcV16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vsldb, "V16UcV16UcV16UcIi", "nc", "vector") @@ -180,8 +180,8 @@ TARGET_BUILTIN(__builtin_s390_vsumb, "V4UiV16UcV16Uc", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vsumh, "V4UiV8UsV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vsumgh, "V2ULLiV8UsV8Us", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vsumgf, "V2ULLiV4UiV4Ui", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vsumqf, "V16UcV4UiV4Ui", "nc", "vector") -TARGET_BUILTIN(__builtin_s390_vsumqg, "V16UcV2ULLiV2ULLi", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vsumqf, "ULLLiV4UiV4Ui", "nc", "vector") +TARGET_BUILTIN(__builtin_s390_vsumqg, "ULLLiV2ULLiV2ULLi", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vtm, "iV16UcV16Uc", "nc", "vector") // Vector string instructions (chapter 23 of the PoP) @@ -253,10 +253,10 @@ TARGET_BUILTIN(__builtin_s390_vfsqdb, "V2dV2d", "nc", "vector") TARGET_BUILTIN(__builtin_s390_vftcidb, "V2SLLiV2dIii*", "nc", "vector") // Vector-enhancements facility 1 intrinsics. -TARGET_BUILTIN(__builtin_s390_vlrl, "V16ScUivC*", "", "vector-enhancements-1") -TARGET_BUILTIN(__builtin_s390_vstrl, "vV16ScUiv*", "", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vlrlr, "V16ScUivC*", "", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vstrlr, "vV16ScUiv*", "", "vector-enhancements-1") TARGET_BUILTIN(__builtin_s390_vbperm, "V2ULLiV16UcV16Uc", "nc", "vector-enhancements-1") -TARGET_BUILTIN(__builtin_s390_vmslg, "V16UcV2ULLiV2ULLiV16UcIi", "nc", "vector-enhancements-1") +TARGET_BUILTIN(__builtin_s390_vmslg, "ULLLiV2ULLiV2ULLiULLLiIi", "nc", "vector-enhancements-1") TARGET_BUILTIN(__builtin_s390_vfmaxdb, "V2dV2dV2dIi", "nc", "vector-enhancements-1") TARGET_BUILTIN(__builtin_s390_vfmindb, "V2dV2dV2dIi", "nc", "vector-enhancements-1") TARGET_BUILTIN(__builtin_s390_vfnmadb, "V2dV2dV2dV2d", "nc", "vector-enhancements-1") diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsX86.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsX86.def index 10ac3b3c34ef..60b752ad4854 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsX86.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsX86.def @@ -421,31 +421,31 @@ TARGET_BUILTIN(__builtin_ia32_aeskeygenassist128, "V2OiV2OiIc", "ncV:128:", "aes // VAES TARGET_BUILTIN(__builtin_ia32_aesenc256, "V4OiV4OiV4Oi", "ncV:256:", "vaes") -TARGET_BUILTIN(__builtin_ia32_aesenc512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesenc512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512,vaes") TARGET_BUILTIN(__builtin_ia32_aesenclast256, "V4OiV4OiV4Oi", "ncV:256:", "vaes") -TARGET_BUILTIN(__builtin_ia32_aesenclast512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesenclast512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512,vaes") TARGET_BUILTIN(__builtin_ia32_aesdec256, "V4OiV4OiV4Oi", "ncV:256:", "vaes") -TARGET_BUILTIN(__builtin_ia32_aesdec512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesdec512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512,vaes") TARGET_BUILTIN(__builtin_ia32_aesdeclast256, "V4OiV4OiV4Oi", "ncV:256:", "vaes") -TARGET_BUILTIN(__builtin_ia32_aesdeclast512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesdeclast512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512,vaes") // GFNI TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v16qi, "V16cV16cV16cIc", "ncV:128:", "gfni") TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v32qi, "V32cV32cV32cIc", "ncV:256:", "avx,gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v64qi, "V64cV64cV64cIc", "ncV:512:", "avx512f,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v64qi, "V64cV64cV64cIc", "ncV:512:", "avx512f,evex512,gfni") TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v16qi, "V16cV16cV16cIc", "ncV:128:", "gfni") TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v32qi, "V32cV32cV32cIc", "ncV:256:", "avx,gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v64qi, "V64cV64cV64cIc", "ncV:512:", "avx512f,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v64qi, "V64cV64cV64cIc", "ncV:512:", "avx512f,evex512,gfni") TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v16qi, "V16cV16cV16c", "ncV:128:", "gfni") TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v32qi, "V32cV32cV32c", "ncV:256:", "avx,gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v64qi, "V64cV64cV64c", "ncV:512:", "avx512f,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v64qi, "V64cV64cV64c", "ncV:512:", "avx512f,evex512,gfni") // CLMUL TARGET_BUILTIN(__builtin_ia32_pclmulqdq128, "V2OiV2OiV2OiIc", "ncV:128:", "pclmul") // VPCLMULQDQ TARGET_BUILTIN(__builtin_ia32_pclmulqdq256, "V4OiV4OiV4OiIc", "ncV:256:", "vpclmulqdq") -TARGET_BUILTIN(__builtin_ia32_pclmulqdq512, "V8OiV8OiV8OiIc", "ncV:512:", "avx512f,vpclmulqdq") +TARGET_BUILTIN(__builtin_ia32_pclmulqdq512, "V8OiV8OiV8OiIc", "ncV:512:", "avx512f,evex512,vpclmulqdq") // AVX TARGET_BUILTIN(__builtin_ia32_addsubpd256, "V4dV4dV4d", "ncV:256:", "avx") @@ -732,22 +732,22 @@ TARGET_BUILTIN(__builtin_ia32_vfmaddpd256, "V4dV4dV4dV4d", "ncV:256:", "fma|fma4 TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256, "V8fV8fV8fV8f", "ncV:256:", "fma|fma4") TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256, "V4dV4dV4dV4d", "ncV:256:", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_maskz, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmsubps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_maskz, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_maskz, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddps512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmsubps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_maskz, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmsubaddps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") // XOP TARGET_BUILTIN(__builtin_ia32_vpmacssww, "V8sV8sV8sV8s", "ncV:128:", "xop") @@ -832,93 +832,93 @@ TARGET_BUILTIN(__builtin_ia32_rdpkru, "Ui", "n", "pku") TARGET_BUILTIN(__builtin_ia32_wrpkru, "vUi", "n", "pku") // AVX-512 -TARGET_BUILTIN(__builtin_ia32_sqrtpd512, "V8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_sqrtps512, "V16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_sqrtpd512, "V8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_sqrtps512, "V16fV16fIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_rsqrt14sd_mask, "V2dV2dV2dV2dUc", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_rsqrt14ss_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14pd512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14ps512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rsqrt14pd512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_rsqrt14ps512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_rsqrt28sd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512er") TARGET_BUILTIN(__builtin_ia32_rsqrt28ss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rsqrt28pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rsqrt28ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_rsqrt28pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er,evex512") +TARGET_BUILTIN(__builtin_ia32_rsqrt28ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er,evex512") TARGET_BUILTIN(__builtin_ia32_rcp14sd_mask, "V2dV2dV2dV2dUc", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_rcp14ss_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rcp14pd512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rcp14ps512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rcp14pd512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_rcp14ps512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_rcp28sd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512er") TARGET_BUILTIN(__builtin_ia32_rcp28ss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rcp28pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rcp28ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er") -TARGET_BUILTIN(__builtin_ia32_exp2pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er") -TARGET_BUILTIN(__builtin_ia32_exp2ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_rcp28pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er,evex512") +TARGET_BUILTIN(__builtin_ia32_rcp28ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er,evex512") +TARGET_BUILTIN(__builtin_ia32_exp2pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er,evex512") +TARGET_BUILTIN(__builtin_ia32_exp2ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er,evex512") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttps2udq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttpd2udq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvttps2dq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvttps2udq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvttpd2dq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvttpd2udq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f,evex512") -TARGET_BUILTIN(__builtin_ia32_cmpps512_mask, "UsV16fV16fIiUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cmpps512_mask, "UsV16fV16fIiUsIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_cmpps256_mask, "UcV8fV8fIiUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_cmpps128_mask, "UcV4fV4fIiUc", "ncV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmppd512_mask, "UcV8dV8dIiUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cmppd512_mask, "UcV8dV8dIiUcIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_cmppd256_mask, "UcV4dV4dIiUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_cmppd128_mask, "UcV2dV2dIiUc", "ncV:128:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscaleps_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rndscalepd_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtps2udq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2udq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps512_mask, "V16fV16iV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtudq2ps512_mask, "V16fV16iV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps512_mask, "V8fV8dV8fUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph512_mask, "V16sV16fIiV16sUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps512_mask, "V16fV16sV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmuldq512, "V8OiV16iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmuludq512, "V8OiV16iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddqusi512_mask, "V16iiC*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddqudi512_mask, "V8OiOiC*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadups512_mask, "V16ffC*V16fUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadaps512_mask, "V16fV16fC*V16fUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadupd512_mask, "V8ddC*V8dUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadapd512_mask, "V8dV8dC*V8dUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storedqudi512_mask, "vOi*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storedqusi512_mask, "vi*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeupd512_mask, "vd*V8dUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeapd512_mask, "vV8d*V8dUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeups512_mask, "vf*V16fUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeaps512_mask, "vV16f*V16fUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_alignq512, "V8OiV8OiV8OiIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_alignd512, "V16iV16iV16iIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rndscaleps_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_rndscalepd_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtps2dq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtpd2dq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtps2udq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtpd2udq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_minps512, "V16fV16fV16fIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_minpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_maxps512, "V16fV16fV16fIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_maxpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtdq2ps512_mask, "V16fV16iV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtudq2ps512_mask, "V16fV16iV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtpd2ps512_mask, "V8fV8dV8fUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vcvtps2ph512_mask, "V16sV16fIiV16sUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vcvtph2ps512_mask, "V16fV16sV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmuldq512, "V8OiV16iV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmuludq512, "V8OiV16iV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_loaddqusi512_mask, "V16iiC*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_loaddqudi512_mask, "V8OiOiC*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_loadups512_mask, "V16ffC*V16fUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_loadaps512_mask, "V16fV16fC*V16fUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_loadupd512_mask, "V8ddC*V8dUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_loadapd512_mask, "V8dV8dC*V8dUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_storedqudi512_mask, "vOi*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_storedqusi512_mask, "vi*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_storeupd512_mask, "vd*V8dUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_storeapd512_mask, "vV8d*V8dUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_storeups512_mask, "vf*V16fUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_storeaps512_mask, "vV16f*V16fUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_alignq512, "V8OiV8OiV8OiIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_alignd512, "V16iV16iV16iIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_alignd128, "V4iV4iV4iIi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_alignd256, "V8iV8iV8iIi", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_alignq128, "V2OiV2OiV2OiIi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_alignq256, "V4OiV4OiV4OiIi", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_extractf64x4_mask, "V4dV8dIiV4dUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_extractf32x4_mask, "V4fV16fIiV4fUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_extractf64x4_mask, "V4dV8dIiV4dUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_extractf32x4_mask, "V4fV16fIiV4fUc", "ncV:512:", "avx512f,evex512") // AVX-VNNI and AVX512-VNNI TARGET_BUILTIN(__builtin_ia32_vpdpbusd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni|avxvnni") TARGET_BUILTIN(__builtin_ia32_vpdpbusd256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni|avxvnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni,evex512") TARGET_BUILTIN(__builtin_ia32_vpdpbusds128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni|avxvnni") TARGET_BUILTIN(__builtin_ia32_vpdpbusds256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni|avxvnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusds512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni,evex512") TARGET_BUILTIN(__builtin_ia32_vpdpwssd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni|avxvnni") TARGET_BUILTIN(__builtin_ia32_vpdpwssd256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni|avxvnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni,evex512") TARGET_BUILTIN(__builtin_ia32_vpdpwssds128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni|avxvnni") TARGET_BUILTIN(__builtin_ia32_vpdpwssds256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni|avxvnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssds512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni,evex512") // AVX-VNNI-INT8 TARGET_BUILTIN(__builtin_ia32_vpdpbssd128, "V4iV4iV4iV4i", "ncV:128:", "avxvnniint8") @@ -950,31 +950,31 @@ TARGET_BUILTIN(__builtin_ia32_gather3siv4sf, "V4fV4fvC*V4iUcIi", "nV:128:", "avx TARGET_BUILTIN(__builtin_ia32_gather3siv4si, "V4iV4ivC*V4iUcIi", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_gather3siv8sf, "V8fV8fvC*V8iUcIi", "nV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_gather3siv8si, "V8iV8ivC*V8iUcIi", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_gathersiv8df, "V8dV8dvC*V8iUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv16sf, "V16fV16fvC*V16iUsIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv8df, "V8dV8dvC*V8OiUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv16sf, "V8fV8fvC*V8OiUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv8di, "V8OiV8OivC*V8iUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv16si, "V16iV16ivC*V16iUsIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv8di, "V8OiV8OivC*V8OiUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv16si, "V8iV8ivC*V8OiUcIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv8df, "vv*UcV8iV8dIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv16sf, "vv*UsV16iV16fIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8df, "vv*UcV8OiV8dIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv16sf, "vv*UcV8OiV8fIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv8di, "vv*UcV8iV8OiIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv16si, "vv*UsV16iV16iIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8di, "vv*UcV8OiV8OiIi", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv16si, "vv*UcV8OiV8iIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gathersiv8df, "V8dV8dvC*V8iUcIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_gathersiv16sf, "V16fV16fvC*V16iUsIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_gatherdiv8df, "V8dV8dvC*V8OiUcIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_gatherdiv16sf, "V8fV8fvC*V8OiUcIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_gathersiv8di, "V8OiV8OivC*V8iUcIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_gathersiv16si, "V16iV16ivC*V16iUsIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_gatherdiv8di, "V8OiV8OivC*V8OiUcIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_gatherdiv16si, "V8iV8ivC*V8OiUcIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scattersiv8df, "vv*UcV8iV8dIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scattersiv16sf, "vv*UsV16iV16fIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8df, "vv*UcV8OiV8dIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scatterdiv16sf, "vv*UcV8OiV8fIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scattersiv8di, "vv*UcV8iV8OiIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scattersiv16si, "vv*UsV16iV16iIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8di, "vv*UcV8OiV8OiIi", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scatterdiv16si, "vv*UcV8OiV8iIi", "nV:512:", "avx512f,evex512") -TARGET_BUILTIN(__builtin_ia32_gatherpfdpd, "vUcV8ivC*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfdps, "vUsV16ivC*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfqpd, "vUcV8OivC*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfqps, "vUcV8OivC*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfdpd, "vUcV8iv*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfdps, "vUsV16iv*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfqpd, "vUcV8Oiv*IiIi", "nV:512:", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfqps, "vUcV8Oiv*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_gatherpfdpd, "vUcV8ivC*IiIi", "nV:512:", "avx512pf,evex512") +TARGET_BUILTIN(__builtin_ia32_gatherpfdps, "vUsV16ivC*IiIi", "nV:512:", "avx512pf,evex512") +TARGET_BUILTIN(__builtin_ia32_gatherpfqpd, "vUcV8OivC*IiIi", "nV:512:", "avx512pf,evex512") +TARGET_BUILTIN(__builtin_ia32_gatherpfqps, "vUcV8OivC*IiIi", "nV:512:", "avx512pf,evex512") +TARGET_BUILTIN(__builtin_ia32_scatterpfdpd, "vUcV8iv*IiIi", "nV:512:", "avx512pf,evex512") +TARGET_BUILTIN(__builtin_ia32_scatterpfdps, "vUsV16iv*IiIi", "nV:512:", "avx512pf,evex512") +TARGET_BUILTIN(__builtin_ia32_scatterpfqpd, "vUcV8Oiv*IiIi", "nV:512:", "avx512pf,evex512") +TARGET_BUILTIN(__builtin_ia32_scatterpfqps, "vUcV8Oiv*IiIi", "nV:512:", "avx512pf,evex512") TARGET_BUILTIN(__builtin_ia32_knotqi, "UcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_knothi, "UsUs", "nc", "avx512f") @@ -989,10 +989,10 @@ TARGET_BUILTIN(__builtin_ia32_cmpb256_mask, "UiV32cV32cIiUi", "ncV:256:", "avx51 TARGET_BUILTIN(__builtin_ia32_cmpd256_mask, "UcV8iV8iIiUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_cmpq256_mask, "UcV4OiV4OiIiUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_cmpw256_mask, "UsV16sV16sIiUs", "ncV:256:", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpb512_mask, "UOiV64cV64cIiUOi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpd512_mask, "UsV16iV16iIiUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpq512_mask, "UcV8OiV8OiIiUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpw512_mask, "UiV32sV32sIiUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_cmpb512_mask, "UOiV64cV64cIiUOi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_cmpd512_mask, "UsV16iV16iIiUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cmpq512_mask, "UcV8OiV8OiIiUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cmpw512_mask, "UiV32sV32sIiUi", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_ucmpb128_mask, "UsV16cV16cIiUs", "ncV:128:", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_ucmpd128_mask, "UcV4iV4iIiUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_ucmpq128_mask, "UcV2OiV2OiIiUc", "ncV:128:", "avx512vl") @@ -1001,61 +1001,61 @@ TARGET_BUILTIN(__builtin_ia32_ucmpb256_mask, "UiV32cV32cIiUi", "ncV:256:", "avx5 TARGET_BUILTIN(__builtin_ia32_ucmpd256_mask, "UcV8iV8iIiUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_ucmpq256_mask, "UcV4OiV4OiIiUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_ucmpw256_mask, "UsV16sV16sIiUs", "ncV:256:", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpb512_mask, "UOiV64cV64cIiUOi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpd512_mask, "UsV16iV16iIiUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_ucmpq512_mask, "UcV8OiV8OiIiUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_ucmpw512_mask, "UiV32sV32sIiUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_ucmpb512_mask, "UOiV64cV64cIiUOi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_ucmpd512_mask, "UsV16iV16iIiUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_ucmpq512_mask, "UcV8OiV8OiIiUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_ucmpw512_mask, "UiV32sV32sIiUi", "ncV:512:", "avx512bw,evex512") -TARGET_BUILTIN(__builtin_ia32_packssdw512, "V32sV16iV16i", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packsswb512, "V64cV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packusdw512, "V32sV16iV16i", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packuswb512, "V64cV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pavgb512, "V64cV64cV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pavgw512, "V32sV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pshufb512, "V64cV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_packssdw512, "V32sV16iV16i", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_packsswb512, "V64cV32sV32s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_packusdw512, "V32sV16iV16i", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_packuswb512, "V64cV32sV32s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pavgb512, "V64cV64cV64c", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pavgw512, "V32sV32sV32s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pshufb512, "V64cV64cV64c", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_vpconflictdi_128, "V2OiV2Oi", "ncV:128:", "avx512cd,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpconflictdi_256, "V4OiV4Oi", "ncV:256:", "avx512cd,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpconflictsi_128, "V4iV4i", "ncV:128:", "avx512cd,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpconflictsi_256, "V8iV8i", "ncV:256:", "avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpconflictdi_512, "V8OiV8Oi", "ncV:512:", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vpconflictsi_512, "V16iV16i", "ncV:512:", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vplzcntd_512, "V16iV16i", "ncV:512:", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vplzcntq_512, "V8OiV8Oi", "ncV:512:", "avx512cd") +TARGET_BUILTIN(__builtin_ia32_vpconflictdi_512, "V8OiV8Oi", "ncV:512:", "avx512cd,evex512") +TARGET_BUILTIN(__builtin_ia32_vpconflictsi_512, "V16iV16i", "ncV:512:", "avx512cd,evex512") +TARGET_BUILTIN(__builtin_ia32_vplzcntd_512, "V16iV16i", "ncV:512:", "avx512cd,evex512") +TARGET_BUILTIN(__builtin_ia32_vplzcntq_512, "V8OiV8Oi", "ncV:512:", "avx512cd,evex512") TARGET_BUILTIN(__builtin_ia32_vpopcntd_128, "V4iV4i", "ncV:128:", "avx512vpopcntdq,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpopcntq_128, "V2OiV2Oi", "ncV:128:", "avx512vpopcntdq,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpopcntd_256, "V8iV8i", "ncV:256:", "avx512vpopcntdq,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpopcntq_256, "V4OiV4Oi", "ncV:256:", "avx512vpopcntdq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpopcntd_512, "V16iV16i", "ncV:512:", "avx512vpopcntdq") -TARGET_BUILTIN(__builtin_ia32_vpopcntq_512, "V8OiV8Oi", "ncV:512:", "avx512vpopcntdq") +TARGET_BUILTIN(__builtin_ia32_vpopcntd_512, "V16iV16i", "ncV:512:", "avx512vpopcntdq,evex512") +TARGET_BUILTIN(__builtin_ia32_vpopcntq_512, "V8OiV8Oi", "ncV:512:", "avx512vpopcntdq,evex512") TARGET_BUILTIN(__builtin_ia32_vpopcntb_128, "V16cV16c", "ncV:128:", "avx512vl,avx512bitalg") TARGET_BUILTIN(__builtin_ia32_vpopcntw_128, "V8sV8s", "ncV:128:", "avx512vl,avx512bitalg") TARGET_BUILTIN(__builtin_ia32_vpopcntb_256, "V32cV32c", "ncV:256:", "avx512vl,avx512bitalg") TARGET_BUILTIN(__builtin_ia32_vpopcntw_256, "V16sV16s", "ncV:256:", "avx512vl,avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpopcntb_512, "V64cV64c", "ncV:512:", "avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpopcntw_512, "V32sV32s", "ncV:512:", "avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntb_512, "V64cV64c", "ncV:512:", "avx512bitalg,evex512") +TARGET_BUILTIN(__builtin_ia32_vpopcntw_512, "V32sV32s", "ncV:512:", "avx512bitalg,evex512") TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb128_mask, "UsV16cV16cUs", "ncV:128:", "avx512vl,avx512bitalg") TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb256_mask, "UiV32cV32cUi", "ncV:256:", "avx512vl,avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb512_mask, "UOiV64cV64cUOi", "ncV:512:", "avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb512_mask, "UOiV64cV64cUOi", "ncV:512:", "avx512bitalg,evex512") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw512, "V32sV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhuw512, "V32sV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhw512, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmulhrsw512, "V32sV32sV32s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pmulhuw512, "V32sV32sV32s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pmulhw512, "V32sV32sV32s", "ncV:512:", "avx512bw,evex512") -TARGET_BUILTIN(__builtin_ia32_addpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_addps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_addpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_addps512, "V16fV16fV16fIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_divpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_divps512, "V16fV16fV16fIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_mulpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_mulps512, "V16fV16fV16fIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_subpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_subps512, "V16fV16fV16fIi", "ncV:512:", "avx512f,evex512") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw512, "V32sV64cV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaddwd512, "V16iV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmaddubsw512, "V32sV64cV64c", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pmaddwd512, "V16iV32sV32s", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_addss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_divss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") @@ -1169,66 +1169,66 @@ TARGET_BUILTIN(__builtin_ia32_scattersiv8si, "vv*UcV8iV8iIi", "nV:256:", "avx512 TARGET_BUILTIN(__builtin_ia32_vpermi2vard128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermi2vard256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2vard512, "V16iV16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermi2vard512, "V16iV16iV16iV16i", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_vpermi2varpd128, "V2dV2dV2OiV2d", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermi2varpd256, "V4dV4dV4OiV4d", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varpd512, "V8dV8dV8OiV8d", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermi2varpd512, "V8dV8dV8OiV8d", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_vpermi2varps128, "V4fV4fV4iV4f", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermi2varps256, "V8fV8fV8iV8f", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varps512, "V16fV16fV16iV16f", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermi2varps512, "V16fV16fV16iV16f", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_vpermi2varq128, "V2OiV2OiV2OiV2Oi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermi2varq256, "V4OiV4OiV4OiV4Oi", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermi2varq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_vpermi2varqi128, "V16cV16cV16cV16c", "ncV:128:", "avx512vbmi,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpermi2varqi256, "V32cV32cV32cV32c", "ncV:256:", "avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varqi512, "V64cV64cV64cV64c", "ncV:512:", "avx512vbmi") +TARGET_BUILTIN(__builtin_ia32_vpermi2varqi512, "V64cV64cV64cV64c", "ncV:512:", "avx512vbmi,evex512") TARGET_BUILTIN(__builtin_ia32_vpermi2varhi128, "V8sV8sV8sV8s", "ncV:128:", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_vpermi2varhi256, "V16sV16sV16sV16s", "ncV:256:", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermi2varhi512, "V32sV32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_vpermi2varhi512, "V32sV32sV32sV32s", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_vpshldd128, "V4iV4iV4iIi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshldd256, "V8iV8iV8iIi", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldd512, "V16iV16iV16iIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldd512, "V16iV16iV16iIi", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshldq128, "V2OiV2OiV2OiIi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshldq256, "V4OiV4OiV4OiIi", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldq512, "V8OiV8OiV8OiIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldq512, "V8OiV8OiV8OiIi", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshldw128, "V8sV8sV8sIi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshldw256, "V16sV16sV16sIi", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldw512, "V32sV32sV32sIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldw512, "V32sV32sV32sIi", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshldvd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshldvd256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshldvq128, "V2OiV2OiV2OiV2Oi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshldvq256, "V4OiV4OiV4OiV4Oi", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshldvw128, "V8sV8sV8sV8s", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshldvw256, "V16sV16sV16sV16s", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw512, "V32sV32sV32sV32s", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw512, "V32sV32sV32sV32s", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshrdvd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshrdvd256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshrdvq128, "V2OiV2OiV2OiV2Oi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshrdvq256, "V4OiV4OiV4OiV4Oi", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshrdvw128, "V8sV8sV8sV8s", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshrdvw256, "V16sV16sV16sV16s", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw512, "V32sV32sV32sV32s", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw512, "V32sV32sV32sV32s", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshrdd128, "V4iV4iV4iIi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshrdd256, "V8iV8iV8iIi", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdd512, "V16iV16iV16iIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdd512, "V16iV16iV16iIi", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshrdq128, "V2OiV2OiV2OiIi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshrdq256, "V4OiV4OiV4OiIi", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdq512, "V8OiV8OiV8OiIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdq512, "V8OiV8OiV8OiIi", "ncV:512:", "avx512vbmi2,evex512") TARGET_BUILTIN(__builtin_ia32_vpshrdw128, "V8sV8sV8sIi", "ncV:128:", "avx512vl,avx512vbmi2") TARGET_BUILTIN(__builtin_ia32_vpshrdw256, "V16sV16sV16sIi", "ncV:256:", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdw512, "V32sV32sV32sIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdw512, "V32sV32sV32sIi", "ncV:512:", "avx512vbmi2,evex512") -TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_cvtpd2qq128_mask, "V2OiV2dV2OiUc", "ncV:128:", "avx512vl,avx512dq") TARGET_BUILTIN(__builtin_ia32_cvtpd2qq256_mask, "V4OiV4dV4OiUc", "ncV:256:", "avx512vl,avx512dq") TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq128_mask, "V2OiV2dV2OiUc", "ncV:128:", "avx512vl,avx512dq") @@ -1264,32 +1264,32 @@ TARGET_BUILTIN(__builtin_ia32_pmovswb256_mask, "V16cV16sV16cUs", "ncV:256:", "av TARGET_BUILTIN(__builtin_ia32_pmovuswb128_mask, "V16cV8sV16cUc", "ncV:128:", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_pmovuswb256_mask, "V16cV16sV16cUs", "ncV:256:", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_pmovwb128_mask, "V16cV8sV16cUc", "ncV:128:", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtpd2qq512_mask, "V8OiV8dV8OiUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq512_mask, "V8OiV8dV8OiUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2qq512_mask, "V8OiV8fV8OiUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2uqq512_mask, "V8OiV8fV8OiUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2pd512_mask, "V8dV8OiV8dUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2ps512_mask, "V8fV8OiV8fUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2qq512_mask, "V8OiV8dV8OiUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq512_mask, "V8OiV8dV8OiUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2qq512_mask, "V8OiV8fV8OiUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2uqq512_mask, "V8OiV8fV8OiUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd512_mask, "V8dV8OiV8dUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps512_mask, "V8fV8OiV8fUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangepd512_mask, "V8dV8dV8dIiV8dUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangeps512_mask, "V16fV16fV16fIiV16fUsIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducepd512_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_reduceps512_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_prold512, "V16iV16iIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_prolq512, "V8OiV8OiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtpd2qq512_mask, "V8OiV8dV8OiUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq512_mask, "V8OiV8dV8OiUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtps2qq512_mask, "V8OiV8fV8OiUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtps2uqq512_mask, "V8OiV8fV8OiUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtqq2pd512_mask, "V8dV8OiV8dUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtqq2ps512_mask, "V8fV8OiV8fUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvttpd2qq512_mask, "V8OiV8dV8OiUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq512_mask, "V8OiV8dV8OiUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvttps2qq512_mask, "V8OiV8fV8OiUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvttps2uqq512_mask, "V8OiV8fV8OiUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd512_mask, "V8dV8OiV8dUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps512_mask, "V8fV8OiV8fUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_rangepd512_mask, "V8dV8dV8dIiV8dUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_rangeps512_mask, "V16fV16fV16fIiV16fUsIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_reducepd512_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_reduceps512_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_prold512, "V16iV16iIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_prolq512, "V8OiV8OiIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_prold128, "V4iV4iIi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prold256, "V8iV8iIi", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prolq128, "V2OiV2OiIi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prolq256, "V4OiV4OiIi", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_prolvd512, "V16iV16iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_prolvq512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_prord512, "V16iV16iIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_prorq512, "V8OiV8OiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prolvd512, "V16iV16iV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_prolvq512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_prord512, "V16iV16iIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_prorq512, "V8OiV8OiIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_prolvd128, "V4iV4iV4i", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prolvd256, "V8iV8iV8i", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prolvq128, "V2OiV2OiV2Oi", "ncV:128:", "avx512vl") @@ -1298,51 +1298,51 @@ TARGET_BUILTIN(__builtin_ia32_prord128, "V4iV4iIi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prord256, "V8iV8iIi", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prorq128, "V2OiV2OiIi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prorq256, "V4OiV4OiIi", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_prorvd512, "V16iV16iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_prorvq512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prorvd512, "V16iV16iV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_prorvq512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_prorvd128, "V4iV4iV4i", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prorvd256, "V8iV8iV8i", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prorvq128, "V2OiV2OiV2Oi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_prorvq256, "V4OiV4OiV4Oi", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pshufhw512, "V32sV32sIi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pshuflw512, "V32sV32sIi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psllv32hi, "V32sV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psllw512, "V32sV32sV8s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psllwi512, "V32sV32si", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pshufhw512, "V32sV32sIi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pshuflw512, "V32sV32sIi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_psllv32hi, "V32sV32sV32s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_psllw512, "V32sV32sV8s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_psllwi512, "V32sV32si", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_psllv16hi, "V16sV16sV16s", "ncV:256:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_psllv8hi, "V8sV8sV8s", "ncV:128:", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_pslldi512, "V16iV16ii", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psllqi512, "V8OiV8Oii", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlv32hi, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pslldi512, "V16iV16ii", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psllqi512, "V8OiV8Oii", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrlv32hi, "V32sV32sV32s", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_psrlv16hi, "V16sV16sV16s", "ncV:256:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_psrlv8hi, "V8sV8sV8s", "ncV:128:", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_psrldi512, "V16iV16ii", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlqi512, "V8OiV8Oii", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrav32hi, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psrldi512, "V16iV16ii", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrlqi512, "V8OiV8Oii", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrav32hi, "V32sV32sV32s", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_psrav16hi, "V16sV16sV16s", "ncV:256:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_psrav8hi, "V8sV8sV8s", "ncV:128:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_psravq128, "V2OiV2OiV2Oi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_psravq256, "V4OiV4OiV4Oi", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psraw512, "V32sV32sV8s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrawi512, "V32sV32si", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrlw512, "V32sV32sV8s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrlwi512, "V32sV32si", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pslldqi512_byteshift, "V8OiV8OiIi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrldqi512_byteshift, "V8OiV8OiIi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psraw512, "V32sV32sV8s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_psrawi512, "V32sV32si", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_psrlw512, "V32sV32sV8s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_psrlwi512, "V32sV32si", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pslldqi512_byteshift, "V8OiV8OiIi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_psrldqi512_byteshift, "V8OiV8OiIi", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_movdqa32load128_mask, "V4iV4iC*V4iUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_movdqa32load256_mask, "V8iV8iC*V8iUc", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_movdqa32load512_mask, "V16iV16iC*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa32store512_mask, "vV16i*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa64load512_mask, "V8OiV8OiC*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa64store512_mask, "vV8Oi*V8OiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_movdqa32load512_mask, "V16iV16iC*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_movdqa32store512_mask, "vV16i*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_movdqa64load512_mask, "V8OiV8OiC*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_movdqa64store512_mask, "vV8Oi*V8OiUc", "nV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_movdqa32store128_mask, "vV4i*V4iUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_movdqa32store256_mask, "vV8i*V8iUc", "nV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_movdqa64load128_mask, "V2OiV2OiC*V2OiUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_movdqa64load256_mask, "V4OiV4OiC*V4OiUc", "nV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_movdqa64store128_mask, "vV2Oi*V2OiUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_movdqa64store256_mask, "vV4Oi*V4OiUc", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmadd52huq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512ifma") -TARGET_BUILTIN(__builtin_ia32_vpmadd52luq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512ifma") +TARGET_BUILTIN(__builtin_ia32_vpmadd52huq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512ifma,evex512") +TARGET_BUILTIN(__builtin_ia32_vpmadd52luq512, "V8OiV8OiV8OiV8Oi", "ncV:512:", "avx512ifma,evex512") TARGET_BUILTIN(__builtin_ia32_vpmadd52huq128, "V2OiV2OiV2OiV2Oi", "ncV:128:", "avx512ifma,avx512vl|avxifma") TARGET_BUILTIN(__builtin_ia32_vpmadd52huq256, "V4OiV4OiV4OiV4Oi", "ncV:256:", "avx512ifma,avx512vl|avxifma") TARGET_BUILTIN(__builtin_ia32_vpmadd52luq128, "V2OiV2OiV2OiV2Oi", "ncV:128:", "avx512ifma,avx512vl|avxifma") @@ -1351,12 +1351,12 @@ TARGET_BUILTIN(__builtin_ia32_vcomisd, "iV2dV2dIiIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_vcomiss, "iV4fV4fIiIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_kunpckdi, "UOiUOiUOi", "nc", "avx512bw") TARGET_BUILTIN(__builtin_ia32_kunpcksi, "UiUiUi", "nc", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_loaddquhi512_mask, "V32sV32sC*V32sUi", "nV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_loaddquqi512_mask, "V64cV64cC*V64cUOi", "nV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_fixupimmpd512_mask, "V8dV8dV8dV8OiIiUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmpd512_maskz, "V8dV8dV8dV8OiIiUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmps512_mask, "V16fV16fV16fV16iIiUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmps512_maskz, "V16fV16fV16fV16iIiUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loaddquhi512_mask, "V32sV32sC*V32sUi", "nV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_loaddquqi512_mask, "V64cV64cC*V64cUOi", "nV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_fixupimmpd512_mask, "V8dV8dV8dV8OiIiUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_fixupimmpd512_maskz, "V8dV8dV8dV8OiIiUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_fixupimmps512_mask, "V16fV16fV16fV16iIiUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_fixupimmps512_maskz, "V16fV16fV16fV16iIiUsIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_fixupimmsd_mask, "V2dV2dV2dV2OiIiUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_fixupimmsd_maskz, "V2dV2dV2dV2OiIiUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_fixupimmss_mask, "V4fV4fV4fV4iIiUcIi", "ncV:128:", "avx512f") @@ -1391,8 +1391,8 @@ TARGET_BUILTIN(__builtin_ia32_loadupd128_mask, "V2dV2dC*V2dUc", "nV:128:", "avx5 TARGET_BUILTIN(__builtin_ia32_loadupd256_mask, "V4dV4dC*V4dUc", "nV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_loadups128_mask, "V4fV4fC*V4fUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_loadups256_mask, "V8fV8fC*V8fUc", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_storedquhi512_mask, "vV32s*V32sUi", "nV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_storedquqi512_mask, "vV64c*V64cUOi", "nV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_storedquhi512_mask, "vV32s*V32sUi", "nV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_storedquqi512_mask, "vV64c*V64cUOi", "nV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_storedquhi128_mask, "vV8s*V8sUc", "nV:128:", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_storedquhi256_mask, "vV16s*V16sUs", "nV:256:", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_storedquqi128_mask, "vV16c*V16cUs", "nV:128:", "avx512vl,avx512bw") @@ -1427,38 +1427,38 @@ TARGET_BUILTIN(__builtin_ia32_vcvttsd2si32, "iV2dIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_vcvttsd2usi32, "UiV2dIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_vcvttss2si32, "iV4fIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_vcvttss2usi32, "UiV4fIi", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermilpd512, "V8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermilps512, "V16fV16fIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermilvarpd512, "V8dV8dV8Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermilvarps512, "V16fV16fV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermilpd512, "V8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vpermilps512, "V16fV16fIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vpermilvarpd512, "V8dV8dV8Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_vpermilvarps512, "V16fV16fV16i", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_rndscalesd_round_mask, "V2dV2dV2dV2dUcIiIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_rndscaless_round_mask, "V4fV4fV4fV4fUcIiIi", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scalefpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scalefps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scalefpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_scalefps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_scalefsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_scalefss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psradi512, "V16iV16ii", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psraqi512, "V8OiV8Oii", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psradi512, "V16iV16ii", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psraqi512, "V8OiV8Oii", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_psraq128, "V2OiV2OiV2Oi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_psraq256, "V4OiV4OiV2Oi", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_psraqi128, "V2OiV2Oii", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_psraqi256, "V4OiV4Oii", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pslld512, "V16iV16iV4i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psllq512, "V8OiV8OiV2Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psllv16si, "V16iV16iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psllv8di, "V8OiV8OiV8Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrad512, "V16iV16iV4i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psraq512, "V8OiV8OiV2Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrav16si, "V16iV16iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrav8di, "V8OiV8OiV8Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrld512, "V16iV16iV4i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlq512, "V8OiV8OiV2Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlv16si, "V16iV16iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlv8di, "V8OiV8OiV8Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogd512_mask, "V16iV16iV16iV16iIiUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogd512_maskz, "V16iV16iV16iV16iIiUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogq512_mask, "V8OiV8OiV8OiV8OiIiUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogq512_maskz, "V8OiV8OiV8OiV8OiIiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pslld512, "V16iV16iV4i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psllq512, "V8OiV8OiV2Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psllv16si, "V16iV16iV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psllv8di, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrad512, "V16iV16iV4i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psraq512, "V8OiV8OiV2Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrav16si, "V16iV16iV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrav8di, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrld512, "V16iV16iV4i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrlq512, "V8OiV8OiV2Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrlv16si, "V16iV16iV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_psrlv8di, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pternlogd512_mask, "V16iV16iV16iV16iIiUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pternlogd512_maskz, "V16iV16iV16iV16iIiUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pternlogq512_mask, "V8OiV8OiV8OiV8OiIiUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pternlogq512_maskz, "V8OiV8OiV8OiV8OiIiUc", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_pternlogd128_mask, "V4iV4iV4iV4iIiUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pternlogd128_maskz, "V4iV4iV4iV4iIiUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pternlogd256_mask, "V8iV8iV8iV8iIiUc", "ncV:256:", "avx512vl") @@ -1467,12 +1467,12 @@ TARGET_BUILTIN(__builtin_ia32_pternlogq128_mask, "V2OiV2OiV2OiV2OiIiUc", "ncV:12 TARGET_BUILTIN(__builtin_ia32_pternlogq128_maskz, "V2OiV2OiV2OiV2OiIiUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pternlogq256_mask, "V4OiV4OiV4OiV4OiIiUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pternlogq256_maskz, "V4OiV4OiV4OiV4OiIiUc", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_f32x4, "V16fV16fV16fIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_f64x2, "V8dV8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_i32x4, "V16iV16iV16iIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_i64x2, "V8OiV8OiV8OiIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shufpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_shufps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_shuf_f32x4, "V16fV16fV16fIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_shuf_f64x2, "V8dV8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_shuf_i32x4, "V16iV16iV16iIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_shuf_i64x2, "V8OiV8OiV8OiIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_shufpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_shufps512, "V16fV16fV16fIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_shuf_f32x4_256, "V8fV8fV8fIi", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_shuf_f64x2_256, "V4dV4dV4dIi", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_shuf_i32x4_256, "V8iV8iV8iIi", "ncV:256:", "avx512vl") @@ -1483,13 +1483,13 @@ TARGET_BUILTIN(__builtin_ia32_rsqrt14pd128_mask, "V2dV2dV2dUc", "ncV:128:", "avx TARGET_BUILTIN(__builtin_ia32_rsqrt14pd256_mask, "V4dV4dV4dUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_rsqrt14ps128_mask, "V4fV4fV4fUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_rsqrt14ps256_mask, "V8fV8fV8fUc", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtb2mask512, "UOiV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtmask2b512, "V64cUOi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtmask2w512, "V32sUi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtd2mask512, "UsV16i", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtmask2d512, "V16iUs", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtmask2q512, "V8OiUc", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtq2mask512, "UcV8Oi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtb2mask512, "UOiV64c", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtmask2b512, "V64cUOi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtmask2w512, "V32sUi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtd2mask512, "UsV16i", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtmask2d512, "V16iUs", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtmask2q512, "V8OiUc", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtq2mask512, "UcV8Oi", "ncV:512:", "avx512dq,evex512") TARGET_BUILTIN(__builtin_ia32_cvtb2mask128, "UsV16c", "ncV:128:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_cvtb2mask256, "UiV32c", "ncV:256:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_cvtmask2b128, "V16cUs", "ncV:128:", "avx512bw,avx512vl") @@ -1504,17 +1504,17 @@ TARGET_BUILTIN(__builtin_ia32_cvtmask2q128, "V2OiUc", "ncV:128:", "avx512dq,avx5 TARGET_BUILTIN(__builtin_ia32_cvtmask2q256, "V4OiUc", "ncV:256:", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_cvtq2mask128, "UcV2Oi", "ncV:128:", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_cvtq2mask256, "UcV4Oi", "ncV:256:", "avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovswb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovsdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqb512_mask, "V16cV8OiV16cUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqb512mem_mask, "vV16c*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqd512_mask, "V8iV8OiV8iUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqd512mem_mask, "vV8i*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqw512_mask, "V8sV8OiV8sUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqw512mem_mask, "vV8s*V8OiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovswb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsqb512_mask, "V16cV8OiV16cUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsqb512mem_mask, "vV16c*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsqd512_mask, "V8iV8OiV8iUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsqd512mem_mask, "vV8i*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsqw512_mask, "V8sV8OiV8sUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovsqw512mem_mask, "vV8s*V8OiUc", "nV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_pmovsdb128_mask, "V16cV4iV16cUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovsdb128mem_mask, "vV16c*V4iUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovswb128mem_mask, "vV16c*V8sUc", "nV:128:", "avx512vl,avx512bw") @@ -1537,17 +1537,17 @@ TARGET_BUILTIN(__builtin_ia32_pmovsqw128_mask, "V8sV2OiV8sUc", "ncV:128:", "avx5 TARGET_BUILTIN(__builtin_ia32_pmovsqw128mem_mask, "vV8s*V2OiUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovsqw256_mask, "V8sV4OiV8sUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovsqw256mem_mask, "vV8s*V4OiUc", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovuswb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovusdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqb512_mask, "V16cV8OiV16cUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqb512mem_mask, "vV16c*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqd512_mask, "V8iV8OiV8iUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqd512mem_mask, "vV8i*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqw512_mask, "V8sV8OiV8sUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqw512mem_mask, "vV8s*V8OiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovuswb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusqb512_mask, "V16cV8OiV16cUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusqb512mem_mask, "vV16c*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusqd512_mask, "V8iV8OiV8iUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusqd512mem_mask, "vV8i*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusqw512_mask, "V8sV8OiV8sUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovusqw512mem_mask, "vV8s*V8OiUc", "nV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_pmovusdb128_mask, "V16cV4iV16cUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovusdb128mem_mask, "vV16c*V4iUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovuswb128mem_mask, "vV16c*V8sUc", "nV:128:", "avx512vl,avx512bw") @@ -1570,17 +1570,17 @@ TARGET_BUILTIN(__builtin_ia32_pmovusqw128_mask, "V8sV2OiV8sUc", "ncV:128:", "avx TARGET_BUILTIN(__builtin_ia32_pmovusqw128mem_mask, "vV8s*V2OiUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovusqw256_mask, "V8sV4OiV8sUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovusqw256mem_mask, "vV8s*V4OiUc", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovwb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqb512_mask, "V16cV8OiV16cUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqb512mem_mask, "vV16c*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqd512_mask, "V8iV8OiV8iUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqd512mem_mask, "vV8i*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqw512_mask, "V8sV8OiV8sUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqw512mem_mask, "vV8s*V8OiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovwb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovqb512_mask, "V16cV8OiV16cUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovqb512mem_mask, "vV16c*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovqd512_mask, "V8iV8OiV8iUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovqd512mem_mask, "vV8i*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovqw512_mask, "V8sV8OiV8sUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_pmovqw512mem_mask, "vV8s*V8OiUc", "nV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_pmovdb128_mask, "V16cV4iV16cUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovwb128mem_mask, "vV16c*V8sUc", "nV:128:", "avx512vl,avx512bw") TARGET_BUILTIN(__builtin_ia32_pmovdb128mem_mask, "vV16c*V4iUc", "nV:128:", "avx512vl") @@ -1602,36 +1602,36 @@ TARGET_BUILTIN(__builtin_ia32_pmovqw128_mask, "V8sV2OiV8sUc", "ncV:128:", "avx51 TARGET_BUILTIN(__builtin_ia32_pmovqw128mem_mask, "vV8s*V2OiUc", "nV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovqw256_mask, "V8sV4OiV8sUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovqw256mem_mask, "vV8s*V4OiUc", "nV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_extractf32x8_mask, "V8fV16fIiV8fUc", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_extractf64x2_512_mask, "V2dV8dIiV2dUc", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_extracti32x8_mask, "V8iV16iIiV8iUc", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_extracti64x2_512_mask, "V2OiV8OiIiV2OiUc", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_extracti32x4_mask, "V4iV16iIiV4iUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_extracti64x4_mask, "V4OiV8OiIiV4OiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_extractf32x8_mask, "V8fV16fIiV8fUc", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_extractf64x2_512_mask, "V2dV8dIiV2dUc", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_extracti32x8_mask, "V8iV16iIiV8iUc", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_extracti64x2_512_mask, "V2OiV8OiIiV2OiUc", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_extracti32x4_mask, "V4iV16iIiV4iUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_extracti64x4_mask, "V4OiV8OiIiV4OiUc", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_extractf64x2_256_mask, "V2dV4dIiV2dUc", "ncV:256:", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_extracti64x2_256_mask, "V2OiV4OiIiV2OiUc", "ncV:256:", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_extractf32x4_256_mask, "V4fV8fIiV4fUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_extracti32x4_256_mask, "V4iV8iIiV4iUc", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_insertf32x8, "V16fV16fV8fIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_insertf64x2_512, "V8dV8dV2dIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_inserti32x8, "V16iV16iV8iIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_inserti64x2_512, "V8OiV8OiV2OiIi", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_insertf64x4, "V8dV8dV4dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_inserti64x4, "V8OiV8OiV4OiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_insertf32x8, "V16fV16fV8fIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_insertf64x2_512, "V8dV8dV2dIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_inserti32x8, "V16iV16iV8iIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_inserti64x2_512, "V8OiV8OiV2OiIi", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_insertf64x4, "V8dV8dV4dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_inserti64x4, "V8OiV8OiV4OiIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_insertf64x2_256, "V4dV4dV2dIi", "ncV:256:", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_inserti64x2_256, "V4OiV4OiV2OiIi", "ncV:256:", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_insertf32x4_256, "V8fV8fV4fIi", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_inserti32x4_256, "V8iV8iV4iIi", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_insertf32x4, "V16fV16fV4fIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_inserti32x4, "V16iV16iV4iIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_insertf32x4, "V16fV16fV4fIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_inserti32x4, "V16iV16iV4iIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_getmantpd128_mask, "V2dV2dIiV2dUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_getmantpd256_mask, "V4dV4dIiV4dUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_getmantps128_mask, "V4fV4fIiV4fUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_getmantps256_mask, "V8fV8fIiV8fUc", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getmantpd512_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_getmantps512_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_getexppd512_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_getexpps512_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getmantpd512_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_getmantps512_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_getexppd512_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_getexpps512_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_vfmaddss3_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_vfmaddss3_maskz, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_vfmaddss3_mask3, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") @@ -1640,14 +1640,14 @@ TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_maskz, "V2dV2dV2dV2dUcIi", "ncV:128:", " TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask3, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_vfmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_vfmsubss3_mask3, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permdf512, "V8dV8dIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permdi512, "V8OiV8OiIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarhi512, "V32sV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_permvardf512, "V8dV8dV8Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvardi512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarsf512, "V16fV16fV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarsi512, "V16iV16iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarqi512, "V64cV64cV64c", "ncV:512:", "avx512vbmi") +TARGET_BUILTIN(__builtin_ia32_permdf512, "V8dV8dIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_permdi512, "V8OiV8OiIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_permvarhi512, "V32sV32sV32s", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_permvardf512, "V8dV8dV8Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_permvardi512, "V8OiV8OiV8Oi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_permvarsf512, "V16fV16fV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_permvarsi512, "V16iV16iV16i", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_permvarqi512, "V64cV64cV64c", "ncV:512:", "avx512vbmi,evex512") TARGET_BUILTIN(__builtin_ia32_permvarqi128, "V16cV16cV16c", "ncV:128:", "avx512vbmi,avx512vl") TARGET_BUILTIN(__builtin_ia32_permvarqi256, "V32cV32cV32c", "ncV:256:", "avx512vbmi,avx512vl") TARGET_BUILTIN(__builtin_ia32_permvarhi128, "V8sV8sV8s", "ncV:128:", "avx512bw,avx512vl") @@ -1658,8 +1658,8 @@ TARGET_BUILTIN(__builtin_ia32_fpclasspd128_mask, "UcV2dIiUc", "ncV:128:", "avx51 TARGET_BUILTIN(__builtin_ia32_fpclasspd256_mask, "UcV4dIiUc", "ncV:256:", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_fpclassps128_mask, "UcV4fIiUc", "ncV:128:", "avx512dq,avx512vl") TARGET_BUILTIN(__builtin_ia32_fpclassps256_mask, "UcV8fIiUc", "ncV:256:", "avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_fpclassps512_mask, "UsV16fIiUs", "ncV:512:", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_fpclasspd512_mask, "UcV8dIiUc", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_fpclassps512_mask, "UsV16fIiUs", "ncV:512:", "avx512dq,evex512") +TARGET_BUILTIN(__builtin_ia32_fpclasspd512_mask, "UcV8dIiUc", "ncV:512:", "avx512dq,evex512") TARGET_BUILTIN(__builtin_ia32_fpclasssd_mask, "UcV2dIiUc", "ncV:128:", "avx512dq") TARGET_BUILTIN(__builtin_ia32_fpclassss_mask, "UcV4fIiUc", "ncV:128:", "avx512dq") TARGET_BUILTIN(__builtin_ia32_kaddqi, "UcUcUc", "nc", "avx512dq") @@ -1715,81 +1715,81 @@ TARGET_BUILTIN(__builtin_ia32_kmovb, "UcUc", "nc", "avx512dq") TARGET_BUILTIN(__builtin_ia32_kmovw, "UsUs", "nc", "avx512f") TARGET_BUILTIN(__builtin_ia32_kmovd, "UiUi", "nc", "avx512bw") TARGET_BUILTIN(__builtin_ia32_kmovq, "UOiUOi", "nc", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_palignr512, "V64cV64cV64cIi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_palignr512, "V64cV64cV64cIi", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_dbpsadbw128, "V8sV16cV16cIi", "ncV:128:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_dbpsadbw256, "V16sV32cV32cIi", "ncV:256:", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_dbpsadbw512, "V32sV64cV64cIi", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psadbw512, "V8OiV64cV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_compressdf512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_compressdi512_mask, "V8OiV8OiV8OiUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_compresshi512_mask, "V32sV32sV32sUi", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressqi512_mask, "V64cV64cV64cUOi", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compresssf512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_compresssi512_mask, "V16iV16iV16iUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_dbpsadbw512, "V32sV64cV64cIi", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_psadbw512, "V8OiV64cV64c", "ncV:512:", "avx512bw,evex512") +TARGET_BUILTIN(__builtin_ia32_compressdf512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_compressdi512_mask, "V8OiV8OiV8OiUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_compresshi512_mask, "V32sV32sV32sUi", "ncV:512:", "avx512vbmi2,evex512") +TARGET_BUILTIN(__builtin_ia32_compressqi512_mask, "V64cV64cV64cUOi", "ncV:512:", "avx512vbmi2,evex512") +TARGET_BUILTIN(__builtin_ia32_compresssf512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_compresssi512_mask, "V16iV16iV16iUs", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_cmpsd_mask, "UcV2dV2dIiUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_cmpss_mask, "UcV4fV4fIiUcIi", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pshufd512, "V16iV16iIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_expanddf512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_expanddi512_mask, "V8OiV8OiV8OiUc", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_expandhi512_mask, "V32sV32sV32sUi", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandqi512_mask, "V64cV64cV64cUOi", "ncV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloaddf512_mask, "V8dV8dC*V8dUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_expandloaddi512_mask, "V8OiV8OiC*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_expandloadhi512_mask, "V32sV32sC*V32sUi", "nV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloadqi512_mask, "V64cV64cC*V64cUOi", "nV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloadsf512_mask, "V16fV16fC*V16fUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_expandloadsi512_mask, "V16iV16iC*V16iUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_expandsf512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_expandsi512_mask, "V16iV16iV16iUs", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtps2pd512_mask, "V8dV8fV8dUcIi", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_compressstoredf512_mask, "vV8d*V8dUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_compressstoredi512_mask, "vV8Oi*V8OiUc", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_compressstorehi512_mask, "vV32s*V32sUi", "nV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressstoreqi512_mask, "vV64c*V64cUOi", "nV:512:", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressstoresf512_mask, "vV16f*V16fUs", "nV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_compressstoresi512_mask, "vV16i*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pshufd512, "V16iV16iIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_expanddf512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_expanddi512_mask, "V8OiV8OiV8OiUc", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_expandhi512_mask, "V32sV32sV32sUi", "ncV:512:", "avx512vbmi2,evex512") +TARGET_BUILTIN(__builtin_ia32_expandqi512_mask, "V64cV64cV64cUOi", "ncV:512:", "avx512vbmi2,evex512") +TARGET_BUILTIN(__builtin_ia32_expandloaddf512_mask, "V8dV8dC*V8dUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_expandloaddi512_mask, "V8OiV8OiC*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_expandloadhi512_mask, "V32sV32sC*V32sUi", "nV:512:", "avx512vbmi2,evex512") +TARGET_BUILTIN(__builtin_ia32_expandloadqi512_mask, "V64cV64cC*V64cUOi", "nV:512:", "avx512vbmi2,evex512") +TARGET_BUILTIN(__builtin_ia32_expandloadsf512_mask, "V16fV16fC*V16fUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_expandloadsi512_mask, "V16iV16iC*V16iUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_expandsf512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_expandsi512_mask, "V16iV16iV16iUs", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_cvtps2pd512_mask, "V8dV8fV8dUcIi", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_compressstoredf512_mask, "vV8d*V8dUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_compressstoredi512_mask, "vV8Oi*V8OiUc", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_compressstorehi512_mask, "vV32s*V32sUi", "nV:512:", "avx512vbmi2,evex512") +TARGET_BUILTIN(__builtin_ia32_compressstoreqi512_mask, "vV64c*V64cUOi", "nV:512:", "avx512vbmi2,evex512") +TARGET_BUILTIN(__builtin_ia32_compressstoresf512_mask, "vV16f*V16fUs", "nV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_compressstoresi512_mask, "vV16i*V16iUs", "nV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtph2ps_mask, "V4fV8sV4fUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2ps256_mask, "V8fV8sV8fUc", "ncV:256:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtps2ph_mask, "V8sV4fIiV8sUc", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtps2ph256_mask, "V8sV8fIiV8sUc", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtw2mask512, "UiV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_cvtw2mask512, "UiV32s", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_cvtw2mask128, "UcV8s", "ncV:128:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_cvtw2mask256, "UsV16s", "ncV:256:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_cvtsd2ss_round_mask, "V4fV4fV2dV4fUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_cvtsi2ss32, "V4fV4fiIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_cvtss2sd_round_mask, "V2dV2dV4fV2dUcIi", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_cvtusi2ss32, "V4fV4fUiIi", "ncV:128:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512, "V64cV64cV64c", "ncV:512:", "avx512vbmi") +TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512, "V64cV64cV64c", "ncV:512:", "avx512vbmi,evex512") TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb128, "V16cV16cV16c", "ncV:128:", "avx512vbmi,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb256, "V32cV32cV32c", "ncV:256:", "avx512vbmi,avx512vl") // bf16 intrinsics TARGET_BUILTIN(__builtin_ia32_cvtne2ps2bf16_128, "V8yV4fV4f", "ncV:128:", "avx512bf16,avx512vl") TARGET_BUILTIN(__builtin_ia32_cvtne2ps2bf16_256, "V16yV8fV8f", "ncV:256:", "avx512bf16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtne2ps2bf16_512, "V32yV16fV16f", "ncV:512:", "avx512bf16") +TARGET_BUILTIN(__builtin_ia32_cvtne2ps2bf16_512, "V32yV16fV16f", "ncV:512:", "avx512bf16,evex512") TARGET_BUILTIN(__builtin_ia32_cvtneps2bf16_128_mask, "V8yV4fV8yUc", "ncV:128:", "avx512bf16,avx512vl") TARGET_BUILTIN(__builtin_ia32_cvtneps2bf16_256_mask, "V8yV8fV8yUc", "ncV:256:", "avx512bf16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtneps2bf16_512_mask, "V16yV16fV16yUs", "ncV:512:", "avx512bf16") +TARGET_BUILTIN(__builtin_ia32_cvtneps2bf16_512_mask, "V16yV16fV16yUs", "ncV:512:", "avx512bf16,evex512") TARGET_BUILTIN(__builtin_ia32_dpbf16ps_128, "V4fV4fV8yV8y", "ncV:128:", "avx512bf16,avx512vl") TARGET_BUILTIN(__builtin_ia32_dpbf16ps_256, "V8fV8fV16yV16y", "ncV:256:", "avx512bf16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_dpbf16ps_512, "V16fV16fV32yV32y", "ncV:512:", "avx512bf16") +TARGET_BUILTIN(__builtin_ia32_dpbf16ps_512, "V16fV16fV32yV32y", "ncV:512:", "avx512bf16,evex512") TARGET_BUILTIN(__builtin_ia32_cvtsbf162ss_32, "fy", "nc", "avx512bf16") -TARGET_BUILTIN(__builtin_ia32_vp2intersect_q_512, "vV8OiV8OiUc*Uc*", "nV:512:", "avx512vp2intersect") +TARGET_BUILTIN(__builtin_ia32_vp2intersect_q_512, "vV8OiV8OiUc*Uc*", "nV:512:", "avx512vp2intersect,evex512") TARGET_BUILTIN(__builtin_ia32_vp2intersect_q_256, "vV4OiV4OiUc*Uc*", "nV:256:", "avx512vp2intersect,avx512vl") TARGET_BUILTIN(__builtin_ia32_vp2intersect_q_128, "vV2OiV2OiUc*Uc*", "nV:128:", "avx512vp2intersect,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vp2intersect_d_512, "vV16iV16iUs*Us*", "nV:512:", "avx512vp2intersect") +TARGET_BUILTIN(__builtin_ia32_vp2intersect_d_512, "vV16iV16iUs*Us*", "nV:512:", "avx512vp2intersect,evex512") TARGET_BUILTIN(__builtin_ia32_vp2intersect_d_256, "vV8iV8iUc*Uc*", "nV:256:", "avx512vp2intersect,avx512vl") TARGET_BUILTIN(__builtin_ia32_vp2intersect_d_128, "vV4iV4iUc*Uc*", "nV:128:", "avx512vp2intersect,avx512vl") // AVX512 fp16 intrinsics TARGET_BUILTIN(__builtin_ia32_vcomish, "iV8xV8xIiIi", "ncV:128:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_addph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_subph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_mulph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_divph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_maxph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_minph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_addph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_subph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_mulph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_divph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_maxph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_minph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_minph256, "V16xV16xV16x", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_minph128, "V8xV8xV8x", "ncV:128:", "avx512fp16,avx512vl") @@ -1802,7 +1802,7 @@ TARGET_BUILTIN(__builtin_ia32_mulsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", TARGET_BUILTIN(__builtin_ia32_subsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_maxsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_minsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_cmpph512_mask, "UiV32xV32xIiUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_cmpph512_mask, "UiV32xV32xIiUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_cmpph256_mask, "UsV16xV16xIiUs", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_cmpph128_mask, "UcV8xV8xIiUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_cmpsh_mask, "UcV8xV8xIiUcIi", "ncV:128:", "avx512fp16") @@ -1811,28 +1811,28 @@ TARGET_BUILTIN(__builtin_ia32_storesh128_mask, "vV8x*V8xUc", "nV:128:", "avx512f TARGET_BUILTIN(__builtin_ia32_rcpph128_mask, "V8xV8xV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_rcpph256_mask, "V16xV16xV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_rcpph512_mask, "V32xV32xV32xUi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_rcpph512_mask, "V32xV32xV32xUi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_rsqrtph128_mask, "V8xV8xV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_rsqrtph256_mask, "V16xV16xV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_rsqrtph512_mask, "V32xV32xV32xUi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_rsqrtph512_mask, "V32xV32xV32xUi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_getmantph128_mask, "V8xV8xIiV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_getmantph256_mask, "V16xV16xIiV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_getmantph512_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_getmantph512_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_getexpph128_mask, "V8xV8xV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_getexpph256_mask, "V16xV16xV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexpph512_mask, "V32xV32xV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_getexpph512_mask, "V32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_scalefph128_mask, "V8xV8xV8xV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_scalefph256_mask, "V16xV16xV16xV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_scalefph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_rndscaleph_128_mask, "V8xV8xIiV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_rndscaleph_256_mask, "V16xV16xIiV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscaleph_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_rndscaleph_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_reduceph128_mask, "V8xV8xIiV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_reduceph256_mask, "V16xV16xIiV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_reduceph512_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_reduceph512_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_rcpsh_mask, "V8xV8xV8xV8xUc", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_rsqrtsh_mask, "V8xV8xV8xV8xUc", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_getmantsh_round_mask, "V8xV8xV8xIiV8xUcIi", "ncV:128:", "avx512fp16") @@ -1843,77 +1843,77 @@ TARGET_BUILTIN(__builtin_ia32_reducesh_mask, "V8xV8xV8xV8xUcIiIi", "ncV:128:", " TARGET_BUILTIN(__builtin_ia32_sqrtph, "V8xV8x", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_sqrtph256, "V16xV16x", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_sqrtph512, "V32xV32xIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_sqrtph512, "V32xV32xIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_sqrtsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_fpclassph128_mask, "UcV8xIiUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_fpclassph256_mask, "UsV16xIiUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_fpclassph512_mask, "UiV32xIiUi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_fpclassph512_mask, "UiV32xIiUi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_fpclasssh_mask, "UcV8xIiUc", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vcvtpd2ph128_mask, "V8xV2dV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtpd2ph256_mask, "V8xV4dV8xUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtpd2ph512_mask, "V8xV8dV8xUcIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtpd2ph512_mask, "V8xV8dV8xUcIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtph2pd128_mask, "V2dV8xV2dUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2pd256_mask, "V4dV8xV4dUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2pd512_mask, "V8dV8xV8dUcIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtph2pd512_mask, "V8dV8xV8dUcIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtsh2ss_round_mask, "V4fV4fV8xV4fUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vcvtss2sh_round_mask, "V8xV8xV4fV8xUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vcvtsd2sh_round_mask, "V8xV8xV2dV8xUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vcvtsh2sd_round_mask, "V2dV2dV8xV2dUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vcvtph2w128_mask, "V8sV8xV8sUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2w256_mask, "V16sV16xV16sUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2w512_mask, "V32sV32xV32sUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtph2w512_mask, "V32sV32xV32sUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvttph2w128_mask, "V8sV8xV8sUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvttph2w256_mask, "V16sV16xV16sUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvttph2w512_mask, "V32sV32xV32sUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvttph2w512_mask, "V32sV32xV32sUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtw2ph128_mask, "V8xV8sV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtw2ph256_mask, "V16xV16sV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtw2ph512_mask, "V32xV32sV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtw2ph512_mask, "V32xV32sV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtph2uw128_mask, "V8UsV8xV8UsUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2uw256_mask, "V16UsV16xV16UsUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2uw512_mask, "V32UsV32xV32UsUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtph2uw512_mask, "V32UsV32xV32UsUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvttph2uw128_mask, "V8UsV8xV8UsUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvttph2uw256_mask, "V16UsV16xV16UsUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvttph2uw512_mask, "V32UsV32xV32UsUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvttph2uw512_mask, "V32UsV32xV32UsUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtuw2ph128_mask, "V8xV8UsV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtuw2ph256_mask, "V16xV16UsV16xUs", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtuw2ph512_mask, "V32xV32UsV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtuw2ph512_mask, "V32xV32UsV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtph2dq128_mask, "V4iV8xV4iUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2dq256_mask, "V8iV8xV8iUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2dq512_mask, "V16iV16xV16iUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtph2dq512_mask, "V16iV16xV16iUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtph2udq128_mask, "V4UiV8xV4UiUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2udq256_mask, "V8UiV8xV8UiUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2udq512_mask, "V16UiV16xV16UiUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtph2udq512_mask, "V16UiV16xV16UiUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtdq2ph128_mask, "V8xV4iV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtdq2ph256_mask, "V8xV8iV8xUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtdq2ph512_mask, "V16xV16iV16xUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtdq2ph512_mask, "V16xV16iV16xUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtudq2ph128_mask, "V8xV4UiV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtudq2ph256_mask, "V8xV8UiV8xUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtudq2ph512_mask, "V16xV16UiV16xUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtudq2ph512_mask, "V16xV16UiV16xUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvttph2dq128_mask, "V4iV8xV4iUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvttph2dq256_mask, "V8iV8xV8iUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvttph2dq512_mask, "V16iV16xV16iUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvttph2dq512_mask, "V16iV16xV16iUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvttph2udq128_mask, "V4UiV8xV4UiUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvttph2udq256_mask, "V8UiV8xV8UiUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvttph2udq512_mask, "V16UiV16xV16UiUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvttph2udq512_mask, "V16UiV16xV16UiUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtqq2ph128_mask, "V8xV2OiV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtqq2ph256_mask, "V8xV4OiV8xUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtqq2ph512_mask, "V8xV8OiV8xUcIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtqq2ph512_mask, "V8xV8OiV8xUcIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtph2qq128_mask, "V2OiV8xV2OiUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2qq256_mask, "V4OiV8xV4OiUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2qq512_mask, "V8OiV8xV8OiUcIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtph2qq512_mask, "V8OiV8xV8OiUcIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtuqq2ph128_mask, "V8xV2UOiV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtuqq2ph256_mask, "V8xV4UOiV8xUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtuqq2ph512_mask, "V8xV8UOiV8xUcIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtuqq2ph512_mask, "V8xV8UOiV8xUcIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtph2uqq128_mask, "V2UOiV8xV2UOiUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2uqq256_mask, "V4UOiV8xV4UOiUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2uqq512_mask, "V8UOiV8xV8UOiUcIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtph2uqq512_mask, "V8UOiV8xV8UOiUcIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvttph2qq128_mask, "V2OiV8xV2OiUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvttph2qq256_mask, "V4OiV8xV4OiUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvttph2qq512_mask, "V8OiV8xV8OiUcIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvttph2qq512_mask, "V8OiV8xV8OiUcIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvttph2uqq128_mask, "V2UOiV8xV2UOiUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvttph2uqq256_mask, "V4UOiV8xV4UOiUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvttph2uqq512_mask, "V8UOiV8xV8UOiUcIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvttph2uqq512_mask, "V8UOiV8xV8UOiUcIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtsh2si32, "iV8xIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vcvtsh2usi32, "UiV8xIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vcvtusi2sh, "V8xV8xUiIi", "ncV:128:", "avx512fp16") @@ -1923,24 +1923,24 @@ TARGET_BUILTIN(__builtin_ia32_vcvttsh2usi32, "UiV8xIi", "ncV:128:", "avx512fp16" TARGET_BUILTIN(__builtin_ia32_vcvtph2psx128_mask, "V4fV8xV4fUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtph2psx256_mask, "V8fV8xV8fUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2psx512_mask, "V16fV16xV16fUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtph2psx512_mask, "V16fV16xV16fUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vcvtps2phx128_mask, "V8xV4fV8xUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vcvtps2phx256_mask, "V8xV8fV8xUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtps2phx512_mask, "V16xV16fV16xUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vcvtps2phx512_mask, "V16xV16fV16xUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vfmaddph, "V8xV8xV8xV8x", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfmaddph256, "V16xV16xV16xV16x", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfmaddph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfmaddph512_maskz, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vfmaddph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddph512_maskz, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vfmaddsubph, "V8xV8xV8xV8x", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfmaddsubph256, "V16xV16xV16xV16x", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_maskz, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_maskz, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfmsubph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vfmsubaddph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmsubph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vfmaddsh3_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vfmaddsh3_maskz, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16") @@ -1951,16 +1951,16 @@ TARGET_BUILTIN(__builtin_ia32_vfmaddcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", TARGET_BUILTIN(__builtin_ia32_vfmaddcph128_maskz, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfmaddcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfmaddcph256_maskz, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vfcmaddcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfcmaddcph128_maskz, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfcmaddcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfcmaddcph256_maskz, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16") -TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16,evex512") +TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vfmaddcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vfmaddcsh_maskz, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vfcmaddcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16") @@ -1974,60 +1974,60 @@ TARGET_BUILTIN(__builtin_ia32_vfmulcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", " TARGET_BUILTIN(__builtin_ia32_vfcmulcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_vfmulcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfmulcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmulcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vfmulcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_vfcmulcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_vfcmulcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfcmulcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_vfcmulcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16,evex512") // generic select intrinsics TARGET_BUILTIN(__builtin_ia32_selectb_128, "V16cUsV16cV16c", "ncV:128:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_selectb_256, "V32cUiV32cV32c", "ncV:256:", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_selectb_512, "V64cUOiV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_selectb_512, "V64cUOiV64cV64c", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_selectw_128, "V8sUcV8sV8s", "ncV:128:", "avx512bw,avx512vl") TARGET_BUILTIN(__builtin_ia32_selectw_256, "V16sUsV16sV16s", "ncV:256:", "avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_selectw_512, "V32sUiV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_selectw_512, "V32sUiV32sV32s", "ncV:512:", "avx512bw,evex512") TARGET_BUILTIN(__builtin_ia32_selectd_128, "V4iUcV4iV4i", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_selectd_256, "V8iUcV8iV8i", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_selectd_512, "V16iUsV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectd_512, "V16iUsV16iV16i", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_selectph_128, "V8xUcV8xV8x", "ncV:128:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_selectph_256, "V16xUsV16xV16x", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_selectph_512, "V32xUiV32xV32x", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_selectph_512, "V32xUiV32xV32x", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_selectpbf_128, "V8yUcV8yV8y", "ncV:128:", "avx512bf16,avx512vl") TARGET_BUILTIN(__builtin_ia32_selectpbf_256, "V16yUsV16yV16y", "ncV:256:", "avx512bf16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_selectpbf_512, "V32yUiV32yV32y", "ncV:512:", "avx512bf16") +TARGET_BUILTIN(__builtin_ia32_selectpbf_512, "V32yUiV32yV32y", "ncV:512:", "avx512bf16,evex512") TARGET_BUILTIN(__builtin_ia32_selectq_128, "V2OiUcV2OiV2Oi", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_selectq_256, "V4OiUcV4OiV4Oi", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_selectq_512, "V8OiUcV8OiV8Oi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectq_512, "V8OiUcV8OiV8Oi", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_selectps_128, "V4fUcV4fV4f", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_selectps_256, "V8fUcV8fV8f", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_selectps_512, "V16fUsV16fV16f", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectps_512, "V16fUsV16fV16f", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_selectpd_128, "V2dUcV2dV2d", "ncV:128:", "avx512vl") TARGET_BUILTIN(__builtin_ia32_selectpd_256, "V4dUcV4dV4d", "ncV:256:", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_selectpd_512, "V8dUcV8dV8d", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectpd_512, "V8dUcV8dV8d", "ncV:512:", "avx512f,evex512") TARGET_BUILTIN(__builtin_ia32_selectsh_128, "V8xUcV8xV8x", "ncV:128:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_selectsbf_128, "V8yUcV8yV8y", "ncV:128:", "avx512bf16") TARGET_BUILTIN(__builtin_ia32_selectss_128, "V4fUcV4fV4f", "ncV:128:", "avx512f") TARGET_BUILTIN(__builtin_ia32_selectsd_128, "V2dUcV2dV2d", "ncV:128:", "avx512f") // generic reduction intrinsics -TARGET_BUILTIN(__builtin_ia32_reduce_fadd_pd512, "ddV8d", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ps512, "ffV16f", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ph512, "xxV32x", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_reduce_fadd_pd512, "ddV8d", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ps512, "ffV16f", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ph512, "xxV32x", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ph256, "xxV16x", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ph128, "xxV8x", "ncV:128:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_reduce_fmax_pd512, "dV8d", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ps512, "fV16f", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ph512, "xV32x", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_reduce_fmax_pd512, "dV8d", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ps512, "fV16f", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ph512, "xV32x", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ph256, "xV16x", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ph128, "xV8x", "ncV:128:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_reduce_fmin_pd512, "dV8d", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ps512, "fV16f", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ph512, "xV32x", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_reduce_fmin_pd512, "dV8d", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ps512, "fV16f", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ph512, "xV32x", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ph256, "xV16x", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ph128, "xV8x", "ncV:128:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_reduce_fmul_pd512, "ddV8d", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ps512, "ffV16f", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph512, "xxV32x", "ncV:512:", "avx512fp16") +TARGET_BUILTIN(__builtin_ia32_reduce_fmul_pd512, "ddV8d", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ps512, "ffV16f", "ncV:512:", "avx512f,evex512") +TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph512, "xxV32x", "ncV:512:", "avx512fp16,evex512") TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph256, "xxV16x", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph128, "xxV8x", "ncV:128:", "avx512fp16,avx512vl") diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsX86_64.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsX86_64.def index e5c1fe8b3192..5e00916d4b25 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsX86_64.def +++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsX86_64.def @@ -104,6 +104,9 @@ TARGET_BUILTIN(__builtin_ia32_clui, "v", "n", "uintr") TARGET_BUILTIN(__builtin_ia32_stui, "v", "n", "uintr") TARGET_BUILTIN(__builtin_ia32_testui, "Uc", "n", "uintr") TARGET_BUILTIN(__builtin_ia32_senduipi, "vUWi", "n", "uintr") +// USERMSR +TARGET_BUILTIN(__builtin_ia32_urdmsr, "ULLiULLi", "n", "usermsr") +TARGET_BUILTIN(__builtin_ia32_uwrmsr, "vULLiULLi", "n", "usermsr") // AMX internal builtin TARGET_BUILTIN(__builtin_ia32_tile_loadconfig_internal, "vvC*", "n", "amx-tile") diff --git a/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def b/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def index d492b8681c5d..0acb5ae134ea 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def +++ b/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def @@ -28,16 +28,13 @@ CODEGENOPT(Name, Bits, Default) #endif CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as -ENUM_CODEGENOPT(CompressDebugSections, llvm::DebugCompressionType, 2, - llvm::DebugCompressionType::None) CODEGENOPT(RelaxELFRelocations, 1, 1) ///< -Wa,-mrelax-relocations={yes,no} CODEGENOPT(AsmVerbose , 1, 0) ///< -dA, -fverbose-asm. -CODEGENOPT(Dwarf64 , 1, 0) ///< -gdwarf64. -CODEGENOPT(Dwarf32 , 1, 1) ///< -gdwarf32. CODEGENOPT(PreserveAsmComments, 1, 1) ///< -dA, -fno-preserve-as-comments. CODEGENOPT(AssumeSaneOperatorNew , 1, 1) ///< implicit __attribute__((malloc)) operator new CODEGENOPT(AssumeUniqueVTables , 1, 1) ///< Assume a class has only one vtable. CODEGENOPT(Autolink , 1, 1) ///< -fno-autolink +CODEGENOPT(AutoImport , 1, 1) ///< -fno-auto-import CODEGENOPT(ObjCAutoRefCountExceptions , 1, 0) ///< Whether ARC should be EH-safe. CODEGENOPT(Backchain , 1, 0) ///< -mbackchain CODEGENOPT(ControlFlowGuardNoChecks , 1, 0) ///< -cfguard-no-checks @@ -72,10 +69,6 @@ CODEGENOPT(DebugPassManager, 1, 0) ///< Prints debug information for the new CODEGENOPT(DisableRedZone , 1, 0) ///< Set when -mno-red-zone is enabled. CODEGENOPT(EmitCallSiteInfo, 1, 0) ///< Emit call site info only in the case of ///< '-g' + 'O>0' level. -CODEGENOPT(EnableDIPreservationVerify, 1, 0) ///< Enable di preservation verify - ///< each (it means check - ///< the original debug info - ///< metadata preservation). CODEGENOPT(IndirectTlsSegRefs, 1, 0) ///< Set when -mno-tls-direct-seg-refs ///< is specified. CODEGENOPT(DisableTailCalls , 1, 0) ///< Do not emit tail calls. @@ -112,16 +105,10 @@ CODEGENOPT(IndirectBranchCSPrefix, 1, 0) ///< if -mindirect-branch-cs-prefix CODEGENOPT(XRayInstrumentFunctions , 1, 0) ///< Set when -fxray-instrument is ///< enabled. CODEGENOPT(StackSizeSection , 1, 0) ///< Set when -fstack-size-section is enabled. -CODEGENOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame is - ///< enabled. ///< Set when -femit-compact-unwind-non-canonical is enabled. CODEGENOPT(EmitCompactUnwindNonCanonical, 1, 0) -///< Set when -femit-dwarf-unwind is passed. -ENUM_CODEGENOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2, - llvm::EmitDwarfUnwindType::Default) - ///< Set when -fxray-always-emit-customevents is enabled. CODEGENOPT(XRayAlwaysEmitCustomEvents , 1, 0) @@ -165,6 +152,7 @@ CODEGENOPT(PrepareForThinLTO , 1, 0) ///< Set when -flto=thin is enabled on the ///< compile step. CODEGENOPT(LTOUnit, 1, 0) ///< Emit IR to support LTO unit features (CFI, whole ///< program vtable opt). +CODEGENOPT(FatLTO, 1, 0) ///< Set when -ffat-lto-objects is enabled. CODEGENOPT(EnableSplitLTOUnit, 1, 0) ///< Enable LTO unit splitting to support /// CFI and traditional whole program /// devirtualization that require whole @@ -176,8 +164,6 @@ CODEGENOPT(IncrementalLinkerCompatible, 1, 0) ///< Emit an object file which can CODEGENOPT(MergeAllConstants , 1, 1) ///< Merge identical constants. CODEGENOPT(MergeFunctions , 1, 0) ///< Set when -fmerge-functions is enabled. CODEGENOPT(NoCommon , 1, 0) ///< Set when -fno-common or C++ is enabled. -CODEGENOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm is - ///< enabled. CODEGENOPT(NoExecStack , 1, 0) ///< Set when -Wa,--noexecstack is enabled. CODEGENOPT(FatalWarnings , 1, 0) ///< Set when -Wa,--fatal-warnings is ///< enabled. @@ -185,8 +171,6 @@ CODEGENOPT(NoWarn , 1, 0) ///< Set when -Wa,--no-warn is enabled. CODEGENOPT(NoTypeCheck , 1, 0) ///< Set when -Wa,--no-type-check is enabled. CODEGENOPT(MisExpect , 1, 0) ///< Set when -Wmisexpect is enabled CODEGENOPT(EnableSegmentedStacks , 1, 0) ///< Set when -fsplit-stack is enabled. -CODEGENOPT(NoInlineLineTables, 1, 0) ///< Whether debug info should contain - ///< inline line tables. CODEGENOPT(StackClashProtector, 1, 0) ///< Set when -fstack-clash-protection is enabled. CODEGENOPT(NoImplicitFloat , 1, 0) ///< Set when -mno-implicit-float is enabled. CODEGENOPT(NullPointerIsValid , 1, 0) ///< Assume Null pointer deference is defined. @@ -195,13 +179,13 @@ CODEGENOPT(HIPCorrectlyRoundedDivSqrt, 1, 1) ///< -fno-hip-fp32-correctly-rounde CODEGENOPT(HIPSaveKernelArgName, 1, 0) ///< Set when -fhip-kernel-arg-name is enabled. CODEGENOPT(UniqueInternalLinkageNames, 1, 0) ///< Internal Linkage symbols get unique names. CODEGENOPT(SplitMachineFunctions, 1, 0) ///< Split machine functions using profile information. +CODEGENOPT(PPCUseFullRegisterNames, 1, 0) ///< Print full register names in assembly /// When false, this attempts to generate code as if the result of an /// overflowing conversion matches the overflowing behavior of a target's native /// float-to-int conversion instructions. CODEGENOPT(StrictFloatCastOverflow, 1, 1) -CODEGENOPT(UniformWGSize , 1, 0) ///< -cl-uniform-work-group-size CODEGENOPT(NoZeroInitializedInBSS , 1, 0) ///< -fno-zero-initialized-in-bss. /// Method of Objective-C dispatch to use. ENUM_CODEGENOPT(ObjCDispatchMethod, ObjCDispatchMethodKind, 2, Legacy) @@ -339,37 +323,6 @@ VALUE_CODEGENOPT(StackProbeSize , 32, 4096) ///< Overrides default stack ///< probe size, even if 0. VALUE_CODEGENOPT(WarnStackSize , 32, UINT_MAX) ///< Set via -fwarn-stack-size. CODEGENOPT(NoStackArgProbe, 1, 0) ///< Set when -mno-stack-arg-probe is used -CODEGENOPT(DebugStrictDwarf, 1, 1) ///< Whether or not to use strict DWARF info. - -/// Control the Assignment Tracking debug info feature. -ENUM_CODEGENOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2, AssignmentTrackingOpts::Disabled) - -CODEGENOPT(DebugColumnInfo, 1, 0) ///< Whether or not to use column information - ///< in debug info. - -CODEGENOPT(DebugTypeExtRefs, 1, 0) ///< Whether or not debug info should contain - ///< external references to a PCH or module. - -CODEGENOPT(DebugExplicitImport, 1, 0) ///< Whether or not debug info should - ///< contain explicit imports for - ///< anonymous namespaces - -/// Set debug info source file hashing algorithm. -ENUM_CODEGENOPT(DebugSrcHash, DebugSrcHashKind, 2, DSH_MD5) - -CODEGENOPT(SplitDwarfInlining, 1, 1) ///< Whether to include inlining info in the - ///< skeleton CU to allow for symbolication - ///< of inline stack frames without .dwo files. -CODEGENOPT(DebugFwdTemplateParams, 1, 0) ///< Whether to emit complete - ///< template parameter descriptions in - ///< forward declarations (versus just - ///< including them in the name). -ENUM_CODEGENOPT(DebugSimpleTemplateNames, llvm::codegenoptions::DebugTemplateNamesKind, 2, llvm::codegenoptions::DebugTemplateNamesKind::Full) ///< Whether to emit template parameters - ///< in the textual names of template - ///< specializations. - ///< Implies DebugFwdTemplateNames to - ///< allow decorated names to be - ///< reconstructed when needed. CODEGENOPT(EmitLLVMUseLists, 1, 0) ///< Control whether to serialize use-lists. CODEGENOPT(WholeProgramVTables, 1, 0) ///< Whether to apply whole-program @@ -393,30 +346,6 @@ VALUE_CODEGENOPT(SmallDataLimit, 32, 0) /// The lower bound for a buffer to be considered for stack protection. VALUE_CODEGENOPT(SSPBufferSize, 32, 0) -/// The kind of generated debug info. -ENUM_CODEGENOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, llvm::codegenoptions::NoDebugInfo) - -/// Whether to generate macro debug info. -CODEGENOPT(MacroDebugInfo, 1, 0) - -/// Tune the debug info for this debugger. -ENUM_CODEGENOPT(DebuggerTuning, llvm::DebuggerKind, 3, - llvm::DebuggerKind::Default) - -/// Dwarf version. Version zero indicates to LLVM that no DWARF should be -/// emitted. -VALUE_CODEGENOPT(DwarfVersion, 3, 0) - -/// Whether we should emit CodeView debug information. It's possible to emit -/// CodeView and DWARF into the same object. -CODEGENOPT(EmitCodeView, 1, 0) - -/// Whether to emit the .debug$H section containing hashes of CodeView types. -CODEGENOPT(CodeViewGHash, 1, 0) - -/// Whether to emit the compiler path and command line into the CodeView debug information. -CODEGENOPT(CodeViewCommandLine, 1, 0) - /// The kind of inlining to perform. ENUM_CODEGENOPT(Inlining, InliningMethod, 2, NormalInlining) @@ -424,7 +353,7 @@ ENUM_CODEGENOPT(Inlining, InliningMethod, 2, NormalInlining) VALUE_CODEGENOPT(InlineMaxStackSize, 32, UINT_MAX) // Vector functions library to use. -ENUM_CODEGENOPT(VecLib, VectorLibrary, 3, NoLibrary) +ENUM_CODEGENOPT(VecLib, llvm::driver::VectorLibrary, 3, llvm::driver::VectorLibrary::NoLibrary) /// The default TLS model to use. ENUM_CODEGENOPT(DefaultTLSModel, TLSModel, 2, GeneralDynamicTLSModel) @@ -449,26 +378,14 @@ CODEGENOPT(DirectAccessExternalData, 1, 0) /// paths that reach the end of a function without executing a required return. CODEGENOPT(StrictReturn, 1, 1) -/// Whether emit extra debug info for sample pgo profile collection. -CODEGENOPT(DebugInfoForProfiling, 1, 0) - /// Whether emit pseudo probes for sample pgo profile collection. CODEGENOPT(PseudoProbeForProfiling, 1, 0) /// Whether 3-component vector type is preserved. CODEGENOPT(PreserveVec3Type, 1, 0) -/// Whether to emit .debug_gnu_pubnames section instead of .debug_pubnames. -CODEGENOPT(DebugNameTable, 2, 0) - -/// Whether to use DWARF base address specifiers in .debug_ranges. -CODEGENOPT(DebugRangesBaseAddress, 1, 0) - CODEGENOPT(NoPLT, 1, 0) -/// Whether to embed source in DWARF debug line section. -CODEGENOPT(EmbedSource, 1, 0) - /// Whether to emit all vtables CODEGENOPT(ForceEmitVTables, 1, 0) @@ -513,6 +430,9 @@ ENUM_CODEGENOPT(ZeroCallUsedRegs, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind, /// non-deleting destructors. (No effect on Microsoft ABI.) CODEGENOPT(CtorDtorReturnThis, 1, 0) +/// FIXME: Make DebugOptions its own top-level .def file. +#include "DebugOptions.def" + #undef CODEGENOPT #undef ENUM_CODEGENOPT #undef VALUE_CODEGENOPT diff --git a/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.h b/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.h index 14fc94fe27f9..6952b48e898a 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.h +++ b/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.h @@ -17,6 +17,7 @@ #include "clang/Basic/XRayInstr.h" #include "llvm/ADT/FloatingPointMode.h" #include "llvm/Frontend/Debug/Options.h" +#include "llvm/Frontend/Driver/CodeGenOptions.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/Regex.h" #include "llvm/Target/TargetOptions.h" @@ -26,12 +27,16 @@ #include #include +namespace llvm { +class PassBuilder; +} namespace clang { /// Bitfields of CodeGenOptions, split out from CodeGenOptions to ensure /// that this large collection of bitfields is a trivial class type. class CodeGenOptionsBase { friend class CompilerInvocation; + friend class CompilerInvocationBase; public: #define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits; @@ -54,17 +59,6 @@ public: OnlyAlwaysInlining // Only run the always inlining pass. }; - enum VectorLibrary { - NoLibrary, // Don't use any vector library. - Accelerate, // Use the Accelerate framework. - LIBMVEC, // GLIBC vector math library. - MASSV, // IBM MASS vector library. - SVML, // Intel short vector math library. - SLEEF, // SLEEF SIMD Library for Evaluating Elementary Functions. - Darwin_libsystem_m, // Use Darwin's libsytem_m vector functions. - ArmPL // Arm Performance Libraries. - }; - enum ObjCDispatchMethodKind { Legacy = 0, NonLegacy = 1, @@ -173,6 +167,10 @@ public: /// The code model to use (-mcmodel). std::string CodeModel; + /// The code model-specific large data threshold to use + /// (-mlarge-data-threshold). + uint64_t LargeDataThreshold; + /// The filename with path we use for coverage data files. The runtime /// allows further manipulation with the GCOV_PREFIX and GCOV_PREFIX_STRIP /// environment variables. @@ -403,6 +401,9 @@ public: /// List of dynamic shared object files to be loaded as pass plugins. std::vector PassPlugins; + /// List of pass builder callbacks. + std::vector> PassBuilderCallbacks; + /// Path to allowlist file specifying which objects /// (files, functions) should exclusively be instrumented /// by sanitizer coverage pass. @@ -529,6 +530,10 @@ public: return SanitizeBinaryMetadataCovered || SanitizeBinaryMetadataAtomics || SanitizeBinaryMetadataUAR; } + + /// Reset all of the options that are not considered when building a + /// module. + void resetNonModularOptions(StringRef ModuleFormat); }; } // end namespace clang diff --git a/contrib/llvm-project/clang/include/clang/Basic/Cuda.h b/contrib/llvm-project/clang/include/clang/Basic/Cuda.h index 7f65d711bb32..916cb4b7ef34 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Cuda.h +++ b/contrib/llvm-project/clang/include/clang/Basic/Cuda.h @@ -39,9 +39,11 @@ enum class CudaVersion { CUDA_118, CUDA_120, CUDA_121, - FULLY_SUPPORTED = CUDA_118, + CUDA_122, + CUDA_123, + FULLY_SUPPORTED = CUDA_123, PARTIALLY_SUPPORTED = - CUDA_121, // Partially supported. Proceed with a warning. + CUDA_123, // Partially supported. Proceed with a warning. NEW = 10000, // Too new. Issue a warning, but allow using it. }; const char *CudaVersionToString(CudaVersion V); @@ -71,6 +73,7 @@ enum class CudaArch { SM_87, SM_89, SM_90, + SM_90a, GFX600, GFX601, GFX602, @@ -113,11 +116,13 @@ enum class CudaArch { GFX1103, GFX1150, GFX1151, + GFX1200, + GFX1201, Generic, // A processor model named 'generic' if the target backend defines a // public one. LAST, - CudaDefault = CudaArch::SM_35, + CudaDefault = CudaArch::SM_52, HIPDefault = CudaArch::GFX803, }; diff --git a/contrib/llvm-project/clang/include/clang/Basic/DebugOptions.def b/contrib/llvm-project/clang/include/clang/Basic/DebugOptions.def new file mode 100644 index 000000000000..7cd3edf08a17 --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/Basic/DebugOptions.def @@ -0,0 +1,146 @@ +//===--- DebugOptions.def - Debug option database ----------------- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +// This file defines debug-specific codegen options. Users of this file +// must define the CODEGENOPT macro to make use of this information. +// Optionally, the user may also define DEBUGOPT (for flags), ENUM_DEBUGOPT (for +// options that have enumeration type), and VALUE_DEBUGOPT (is a debug option +// that describes a value rather than a flag). +// +// BENIGN_ variants of the macros are used to describe options that do not +// affect the generated PCM. +// +//===----------------------------------------------------------------------===// +#ifndef DEBUGOPT +#define DEBUGOPT(Name, Bits, Default) \ +CODEGENOPT(Name, Bits, Default) +#endif + +#ifndef VALUE_DEBUGOPT +# define VALUE_DEBUGOPT(Name, Bits, Default) \ +VALUE_CODEGENOPT(Name, Bits, Default) +#endif + +#ifndef ENUM_DEBUGOPT +# define ENUM_DEBUGOPT(Name, Type, Bits, Default) \ +ENUM_CODEGENOPT(Name, Type, Bits, Default) +#endif + +#ifndef BENIGN_DEBUGOPT +#define BENIGN_DEBUGOPT(Name, Bits, Default) \ +DEBUGOPT(Name, Bits, Default) +#endif + +#ifndef BENIGN_VALUE_DEBUGOPT +# define BENIGN_VALUE_DEBUGOPT(Name, Bits, Default) \ +VALUE_DEBUGOPT(Name, Bits, Default) +#endif + +#ifndef BENIGN_ENUM_DEBUGOPT +# define BENIGN_ENUM_DEBUGOPT(Name, Type, Bits, Default) \ +ENUM_DEBUGOPT(Name, Type, Bits, Default) +#endif + +BENIGN_ENUM_DEBUGOPT(CompressDebugSections, llvm::DebugCompressionType, 2, + llvm::DebugCompressionType::None) +DEBUGOPT(Dwarf64, 1, 0) ///< -gdwarf64. +BENIGN_DEBUGOPT(EnableDIPreservationVerify, 1, 0) ///< Enable di preservation + ///< verify each (it means + ///< check the original debug + ///< info metadata + ///< preservation). +BENIGN_DEBUGOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame + ///< is enabled. + +///< Set when -femit-dwarf-unwind is passed. +BENIGN_ENUM_DEBUGOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2, + llvm::EmitDwarfUnwindType::Default) + +BENIGN_DEBUGOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm + ///< is enabled. + +BENIGN_DEBUGOPT(NoInlineLineTables, 1, 0) ///< Whether debug info should contain + ///< inline line tables. + +DEBUGOPT(DebugStrictDwarf, 1, 1) ///< Whether or not to use strict DWARF info. + +/// Control the Assignment Tracking debug info feature. +BENIGN_ENUM_DEBUGOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2, + AssignmentTrackingOpts::Disabled) + +DEBUGOPT(DebugColumnInfo, 1, 0) ///< Whether or not to use column information + ///< in debug info. + +DEBUGOPT(DebugTypeExtRefs, 1, 0) ///< Whether or not debug info should contain + ///< external references to a PCH or module. + +DEBUGOPT(DebugExplicitImport, 1, 0) ///< Whether or not debug info should + ///< contain explicit imports for + ///< anonymous namespaces + +/// Set debug info source file hashing algorithm. +ENUM_DEBUGOPT(DebugSrcHash, DebugSrcHashKind, 2, DSH_MD5) + +DEBUGOPT(SplitDwarfInlining, 1, 1) ///< Whether to include inlining info in the + ///< skeleton CU to allow for symbolication + ///< of inline stack frames without .dwo files. +DEBUGOPT(DebugFwdTemplateParams, 1, 0) ///< Whether to emit complete + ///< template parameter descriptions in + ///< forward declarations (versus just + ///< including them in the name). +ENUM_DEBUGOPT(DebugSimpleTemplateNames, + llvm::codegenoptions::DebugTemplateNamesKind, 2, + llvm::codegenoptions::DebugTemplateNamesKind::Full) + ///< Whether to emit template parameters in the textual names of + ///< template specializations. + ///< Implies DebugFwdTemplateNames to allow decorated names to be + ///< reconstructed when needed. + +/// The kind of generated debug info. +ENUM_DEBUGOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, + llvm::codegenoptions::NoDebugInfo) + +/// Whether to generate macro debug info. +DEBUGOPT(MacroDebugInfo, 1, 0) + +/// Tune the debug info for this debugger. +ENUM_DEBUGOPT(DebuggerTuning, llvm::DebuggerKind, 3, + llvm::DebuggerKind::Default) + +/// Dwarf version. Version zero indicates to LLVM that no DWARF should be +/// emitted. +VALUE_DEBUGOPT(DwarfVersion, 3, 0) + +/// Whether we should emit CodeView debug information. It's possible to emit +/// CodeView and DWARF into the same object. +DEBUGOPT(EmitCodeView, 1, 0) + +/// Whether to emit the .debug$H section containing hashes of CodeView types. +DEBUGOPT(CodeViewGHash, 1, 0) + +/// Whether to emit the compiler path and command line into the CodeView debug information. +DEBUGOPT(CodeViewCommandLine, 1, 0) + +/// Whether emit extra debug info for sample pgo profile collection. +DEBUGOPT(DebugInfoForProfiling, 1, 0) + +/// Whether to emit .debug_gnu_pubnames section instead of .debug_pubnames. +DEBUGOPT(DebugNameTable, 2, 0) + +/// Whether to use DWARF base address specifiers in .debug_ranges. +DEBUGOPT(DebugRangesBaseAddress, 1, 0) + +/// Whether to embed source in DWARF debug line section. +DEBUGOPT(EmbedSource, 1, 0) + +#undef DEBUGOPT +#undef ENUM_DEBUGOPT +#undef VALUE_DEBUGOPT +#undef BENIGN_DEBUGOPT +#undef BENIGN_ENUM_DEBUGOPT +#undef BENIGN_VALUE_DEBUGOPT diff --git a/contrib/llvm-project/clang/include/clang/Basic/DeclNodes.td b/contrib/llvm-project/clang/include/clang/Basic/DeclNodes.td index 5e726c1bdf8f..8b1f415dd5fe 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DeclNodes.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DeclNodes.td @@ -102,7 +102,6 @@ def FriendTemplate : DeclNode; def StaticAssert : DeclNode; def Block : DeclNode, DeclContext; def Captured : DeclNode, DeclContext; -def ClassScopeFunctionSpecialization : DeclNode; def Import : DeclNode; def OMPThreadPrivate : DeclNode; def OMPAllocate : DeclNode; diff --git a/contrib/llvm-project/clang/include/clang/Basic/Diagnostic.h b/contrib/llvm-project/clang/include/clang/Basic/Diagnostic.h index 5606a22fe9d6..0c7836c2ea56 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Diagnostic.h +++ b/contrib/llvm-project/clang/include/clang/Basic/Diagnostic.h @@ -314,18 +314,23 @@ private: // "Global" configuration state that can actually vary between modules. // Ignore all warnings: -w + LLVM_PREFERRED_TYPE(bool) unsigned IgnoreAllWarnings : 1; // Enable all warnings. + LLVM_PREFERRED_TYPE(bool) unsigned EnableAllWarnings : 1; // Treat warnings like errors. + LLVM_PREFERRED_TYPE(bool) unsigned WarningsAsErrors : 1; // Treat errors like fatal errors. + LLVM_PREFERRED_TYPE(bool) unsigned ErrorsAsFatal : 1; // Suppress warnings in system headers. + LLVM_PREFERRED_TYPE(bool) unsigned SuppressSystemWarnings : 1; // Map extensions to warnings or errors? @@ -1822,12 +1827,17 @@ public: struct TemplateDiffTypes { intptr_t FromType; intptr_t ToType; + LLVM_PREFERRED_TYPE(bool) unsigned PrintTree : 1; + LLVM_PREFERRED_TYPE(bool) unsigned PrintFromType : 1; + LLVM_PREFERRED_TYPE(bool) unsigned ElideType : 1; + LLVM_PREFERRED_TYPE(bool) unsigned ShowColors : 1; // The printer sets this variable to true if the template diff was used. + LLVM_PREFERRED_TYPE(bool) unsigned TemplateDiffUsed : 1; }; @@ -1840,7 +1850,7 @@ const char ToggleHighlight = 127; void ProcessWarningOptions(DiagnosticsEngine &Diags, const DiagnosticOptions &Opts, bool ReportDiags = true); - +void EscapeStringForDiagnostic(StringRef Str, SmallVectorImpl &OutStr); } // namespace clang #endif // LLVM_CLANG_BASIC_DIAGNOSTIC_H diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td index 694e6a5840bc..c81d17ed6410 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td @@ -317,7 +317,7 @@ def note_constexpr_memcpy_unsupported : Note< "source is not a contiguous array of at least %4 elements of type %3|" "destination is not a contiguous array of at least %4 elements of type %3}2">; def note_constexpr_bit_cast_unsupported_type : Note< - "constexpr bit_cast involving type %0 is not yet supported">; + "constexpr bit cast involving type %0 is not yet supported">; def note_constexpr_bit_cast_unsupported_bitfield : Note< "constexpr bit_cast involving bit-field is not yet supported">; def note_constexpr_bit_cast_invalid_type : Note< @@ -326,6 +326,9 @@ def note_constexpr_bit_cast_invalid_type : Note< "%select{type|member}1 is not allowed in a constant expression">; def note_constexpr_bit_cast_invalid_subtype : Note< "invalid type %0 is a %select{member|base}1 of %2">; +def note_constexpr_bit_cast_invalid_vector : Note< + "bit_cast involving type %0 is not allowed in a constant expression; " + "element size %1 * element count %2 is not a multiple of the byte size %3">; def note_constexpr_bit_cast_indet_dest : Note< "indeterminate value can only initialize an object of type 'unsigned char'" "%select{, 'char',|}1 or 'std::byte'; %0 is invalid">; @@ -353,6 +356,9 @@ def note_constexpr_new_negative : Note< "cannot allocate array; evaluated array bound %0 is negative">; def note_constexpr_new_too_large : Note< "cannot allocate array; evaluated array bound %0 is too large">; +def note_constexpr_new_exceeds_limits : Note< + "cannot allocate array; evaluated array bound %0 exceeds the limit (%1); " + "use '-fconstexpr-steps' to increase this limit">; def note_constexpr_new_too_small : Note< "cannot allocate array; evaluated array bound %0 is too small to hold " "%1 explicitly initialized elements">; @@ -391,6 +397,8 @@ def note_constexpr_unsupported_layout : Note< "type %0 has unexpected layout">; def note_constexpr_unsupported_flexible_array : Note< "flexible array initialization is not yet supported">; +def note_constexpr_non_const_vectorelements : Note< + "cannot determine number of elements for sizeless vectors in a constant expression">; def err_experimental_clang_interp_failed : Error< "the experimental clang interpreter failed to evaluate an expression">; @@ -402,7 +410,8 @@ def warn_fixedpoint_constant_overflow : Warning< InGroup>; def warn_constexpr_unscoped_enum_out_of_range : Warning< "integer value %0 is outside the valid range of values [%1, %2] for the " - "enumeration type %3">, DefaultError, InGroup>; + "enumeration type %3">, DefaultError, ShowInSystemHeader, ShowInSystemMacro, + InGroup>; // This is a temporary diagnostic, and shall be removed once our // implementation is complete, and like the preceding constexpr notes belongs @@ -989,6 +998,16 @@ def warn_npot_ms_struct : Warning< "data types with sizes that aren't a power of two">, DefaultError, InGroup; +// -Wpadded-bitfield +def warn_padded_struct_bitfield : Warning< + "padding %select{struct|interface|class}0 %1 with %2 " + "%select{byte|bit}3%s2 to align %4">, + InGroup, DefaultIgnore; +def warn_padded_struct_anon_bitfield : Warning< + "padding %select{struct|interface|class}0 %1 with %2 " + "%select{byte|bit}3%s2 to align anonymous bit-field">, + InGroup, DefaultIgnore; + // -Wpadded, -Wpacked def warn_padded_struct_field : Warning< "padding %select{struct|interface|class}0 %1 with %2 " @@ -996,7 +1015,7 @@ def warn_padded_struct_field : Warning< InGroup, DefaultIgnore; def warn_padded_struct_anon_field : Warning< "padding %select{struct|interface|class}0 %1 with %2 " - "%select{byte|bit}3%s2 to align anonymous bit-field">, + "%select{byte|bit}3%s2 to align anonymous field">, InGroup, DefaultIgnore; def warn_padded_struct_size : Warning< "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">, diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td index ee994e765e09..65a33f61a694 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -56,7 +56,9 @@ def err_expected_string_literal : Error<"expected string literal " "%select{in %1|for diagnostic message in static_assert|" "for optional message in 'availability' attribute|" "for %select{language name|source container name|USR}1 in " - "'external_source_symbol' attribute}0">; + "'external_source_symbol' attribute|" + "as argument of '%1' attribute}0">; + def err_invalid_string_udl : Error< "string literal with user-defined suffix cannot be used here">; def err_invalid_character_udl : Error< @@ -132,10 +134,10 @@ def warn_missing_type_specifier : Warning< InGroup, DefaultIgnore; def ext_c_empty_initializer : Extension< - "use of an empty initializer is a C2x extension">, InGroup; -def warn_c2x_compat_empty_initializer : Warning< - "use of an empty initializer is incompatible with C standards before C2x">, - InGroup, DefaultIgnore; + "use of an empty initializer is a C23 extension">, InGroup; +def warn_c23_compat_empty_initializer : Warning< + "use of an empty initializer is incompatible with C standards before C23">, + InGroup, DefaultIgnore; } let CategoryName = "Nullability Issue" in { @@ -223,12 +225,12 @@ def err_cxx23_size_t_suffix: Error< def err_size_t_literal_too_large: Error< "%select{signed |}0'size_t' literal is out of range of possible " "%select{signed |}0'size_t' values">; -def ext_c2x_bitint_suffix : ExtWarn< - "'_BitInt' suffix for literals is a C2x extension">, - InGroup; -def warn_c2x_compat_bitint_suffix : Warning< - "'_BitInt' suffix for literals is incompatible with C standards before C2x">, - InGroup, DefaultIgnore; +def ext_c23_bitint_suffix : ExtWarn< + "'_BitInt' suffix for literals is a C23 extension">, + InGroup; +def warn_c23_compat_bitint_suffix : Warning< + "'_BitInt' suffix for literals is incompatible with C standards before C23">, + InGroup, DefaultIgnore; def err_integer_literal_too_large : Error< "integer literal is too large to be represented in any %select{signed |}0" "integer type">; @@ -258,8 +260,6 @@ def ext_clang_diagnose_if : Extension<"'diagnose_if' is a clang extension">, InGroup; def err_too_large_for_fixed_point : Error< "this value is too large for this fixed point type">; -def err_fixed_point_not_enabled : Error<"compile with " - "'-ffixed-point' to enable fixed point types">; def err_unimplemented_conversion_with_fixed_point_type : Error< "conversion between fixed point and %0 is not yet supported">; @@ -336,12 +336,16 @@ def err_target_unsupported_mcmse : Error< "-mcmse is not supported for %0">; def err_opt_not_valid_with_opt : Error< "option '%0' cannot be specified with '%1'">; +def err_opt_not_valid_with_opt_on_target : Error< + "option '%0' cannot be specified with '%1' for the %2 sub-architecture">; def err_opt_not_valid_without_opt : Error< "option '%0' cannot be specified without '%1'">; def err_opt_not_valid_on_target : Error< "option '%0' cannot be specified on this target">; def err_invalid_feature_combination : Error< "invalid feature combination: %0">; +def warn_invalid_feature_combination : Warning< + "invalid feature combination: %0">, InGroup>; def warn_target_unrecognized_env : Warning< "mismatch between architecture and environment in target triple '%0'; did you mean '%1'?">, InGroup; @@ -352,9 +356,8 @@ def err_file_modified : Error< "file '%0' modified since it was first processed">, DefaultFatal; def err_file_too_large : Error< "sorry, unsupported: file '%0' is too large for Clang to process">; -def err_include_too_large : Error< - "sorry, this include generates a translation unit too large for" - " Clang to process.">, DefaultFatal; +def err_sloc_space_too_large : Error< + "sorry, the translation unit is too large for Clang to process: ran out of source locations">, DefaultFatal; def err_unsupported_bom : Error<"%0 byte order mark detected in '%1', but " "encoding is not supported">, DefaultFatal; def err_unable_to_rename_temp : Error< @@ -387,6 +390,19 @@ def note_mt_message : Note<"[rewriter] %0">; def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">; def err_arcmt_nsinvocation_ownership : Error<"NSInvocation's %0 is not safe to be used with an object with ownership other than __unsafe_unretained">; +// API notes +def err_apinotes_message : Error<"%0">; +def warn_apinotes_message : Warning<"%0">, InGroup>; +def note_apinotes_message : Note<"%0">; + +class NonportablePrivateAPINotesPath : Warning< + "private API notes file for module '%0' should be named " + "'%0_private.apinotes', not '%1'">; +def warn_apinotes_private_case : NonportablePrivateAPINotesPath, + InGroup>; +def warn_apinotes_private_case_system : NonportablePrivateAPINotesPath, + DefaultIgnore, InGroup>; + // C++ for OpenCL. def err_openclcxx_not_supported : Error< "'%0' is not supported in C++ for OpenCL">; @@ -421,4 +437,13 @@ def err_opencl_extension_and_feature_differs : Error< "options %0 and %1 are set to different values">; def err_opencl_feature_requires : Error< "feature %0 requires support of %1 feature">; + +def warn_throw_not_valid_on_target : Warning< + "target '%0' does not support exception handling;" + " 'throw' is assumed to be never reached">, + InGroup; +def warn_try_not_valid_on_target : Warning< + "target '%0' does not support exception handling;" + " 'catch' block is ignored">, + InGroup; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticDriverKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticDriverKinds.td index 1b69324d073a..676f1a62b49d 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -20,6 +20,8 @@ def err_drv_unsupported_opt_for_language_mode : Error< "unsupported option '%0' for language mode '%1'">; def err_drv_unsupported_option_argument : Error< "unsupported argument '%1' to option '%0'">; +def err_drv_unsupported_option_argument_for_target : Error< + "unsupported argument '%1' to option '%0' for target '%2'">; def err_drv_unknown_stdin_type : Error< "-E or -x required when input is from standard input">; def err_drv_unknown_stdin_type_clang_cl : Error< @@ -70,6 +72,16 @@ def err_drv_no_rocm_device_lib : Error< def err_drv_no_hip_runtime : Error< "cannot find HIP runtime; provide its path via '--rocm-path', or pass " "'-nogpuinc' to build without HIP runtime">; +def err_drv_no_hipstdpar_lib : Error< + "cannot find HIP Standard Parallelism Acceleration library; provide it via " + "'--hipstdpar-path'">; +def err_drv_no_hipstdpar_thrust_lib : Error< + "cannot find rocThrust, which is required by the HIP Standard Parallelism " + "Acceleration library; provide it via " + "'--hipstdpar-thrust-path'">; +def err_drv_no_hipstdpar_prim_lib : Error< + "cannot find rocPrim, which is required by the HIP Standard Parallelism " + "Acceleration library; provide it via '--hipstdpar-prim-path'">; def err_drv_no_hipspv_device_lib : Error< "cannot find HIP device library%select{| for %1}0; provide its path via " @@ -172,8 +184,8 @@ def err_drv_invalid_Xopenmp_target_with_args : Error< "invalid -Xopenmp-target argument: '%0', options requiring arguments are unsupported">; def err_drv_argument_only_allowed_with : Error< "invalid argument '%0' only allowed with '%1'">; -def err_drv_minws_unsupported_input_type : Error< - "'-fminimize-whitespace' invalid for input of type %0">; +def err_drv_opt_unsupported_input_type : Error< + "'%0' invalid for input of type %1">; def err_drv_amdgpu_ieee_without_no_honor_nans : Error< "invalid argument '-mno-amdgpu-ieee' only allowed with relaxed NaN handling">; def err_drv_argument_not_allowed_with : Error< @@ -425,14 +437,20 @@ def warn_drv_no_floating_point_registers: Warning< InGroup; def warn_ignoring_ftabstop_value : Warning< "ignoring invalid -ftabstop value '%0', using default value %1">; -def warn_drv_overriding_flag_option : Warning< +def warn_drv_overriding_option : Warning< "overriding '%0' option with '%1'">, - InGroup>; + InGroup>; def warn_drv_treating_input_as_cxx : Warning< "treating '%0' input as '%1' when in C++ mode, this behavior is deprecated">, InGroup; def warn_drv_pch_not_first_include : Warning< "precompiled header '%0' was ignored because '%1' is not first '-include'">; +def warn_drv_pch_ignoring_gch_file : Warning< + "precompiled header '%0' was ignored because it is not a clang PCH file">, + InGroup; +def warn_drv_pch_ignoring_gch_dir : Warning< + "precompiled header directory '%0' was ignored because it contains no clang PCH files">, + InGroup; def warn_missing_sysroot : Warning<"no such sysroot directory: '%0'">, InGroup>; def warn_incompatible_sysroot : Warning<"using sysroot for '%0' but targeting '%1'">, @@ -453,6 +471,9 @@ def warn_unsupported_branch_protection: Warning < "invalid branch protection option '%0' in '%1'">, InGroup; def err_sls_hardening_arm_not_supported : Error< "-mharden-sls is only supported on armv7-a or later">; +def warn_drv_large_data_threshold_invalid_code_model: Warning< + "'%0' only applies to medium code model">, + InGroup; def note_drv_command_failed_diag_msg : Note< "diagnostic msg: %0">; @@ -511,6 +532,10 @@ def err_test_module_file_extension_format : Error< def err_drv_module_output_with_multiple_arch : Error< "option '-fmodule-output' can't be used with multiple arch options">; +def warn_drv_delayed_template_parsing_after_cxx20 : Warning< + "-fdelayed-template-parsing is deprecated after C++20">, + InGroup>; + def err_drv_extract_api_wrong_kind : Error< "header file '%0' input '%1' does not match the type of prior input " "in api extraction; use '-x %2' to override">; @@ -674,6 +699,9 @@ def err_cc1_round_trip_mismatch : Error< def err_cc1_unbounded_vscale_min : Error< "minimum vscale must be an unsigned integer greater than 0">; +def err_drv_using_omit_rtti_component_without_no_rtti : Error< + "-fexperimental-omit-vtable-rtti call only be used with -fno-rtti">; + def err_drv_ssp_missing_offset_argument : Error< "'%0' is used without '-mstack-protector-guard-offset', and there is no default">; @@ -706,6 +734,11 @@ def err_drv_dxc_missing_target_profile : Error< "target profile option (-T) is missing">; def err_drv_hlsl_unsupported_target : Error< "HLSL code generation is unsupported for target '%0'">; +def err_drv_hlsl_bad_shader_required_in_target : Error< + "shader %select{model|stage}0 is required in target '%1' for HLSL code generation">; + +def err_drv_hlsl_bad_shader_unsupported : Error< + "shader %select{model|stage}0 '%1' in target '%2' is invalid for HLSL code generation">; def warn_drv_dxc_missing_dxv : Warning<"dxv not found. " "Resulting DXIL will not be validated or signed for use in release environments.">, InGroup; @@ -732,6 +765,12 @@ def warn_drv_loongarch_conflicting_implied_val : Warning< InGroup; def err_drv_loongarch_invalid_mfpu_EQ : Error< "invalid argument '%0' to -mfpu=; must be one of: 64, 32, none, 0 (alias for none)">; +def err_drv_loongarch_wrong_fpu_width_for_lsx : Error< + "wrong fpu width; LSX depends on 64-bit FPU.">; +def err_drv_loongarch_wrong_fpu_width_for_lasx : Error< + "wrong fpu width; LASX depends on 64-bit FPU.">; +def err_drv_loongarch_invalid_simd_option_combination : Error< + "invalid option combination; LASX depends on LSX.">; def err_drv_expand_response_file : Error< "failed to expand response file: %0">; @@ -741,4 +780,10 @@ def warn_drv_missing_multilib : Warning< InGroup>; def note_drv_available_multilibs : Note< "available multilibs are:%0">; + +def warn_android_unversioned_fallback : Warning< + "Using unversioned Android target directory %0 for target %1. Unversioned" + " directories will not be used in Clang 19. Provide a versioned directory" + " for the target version or lower instead.">, + InGroup>; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticFrontendKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticFrontendKinds.td index 9ed9a88fa3d6..568000106a84 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticFrontendKinds.td @@ -80,6 +80,7 @@ def remark_fe_backend_optimization_remark_analysis_aliasing : Remark<"%0; " "the '__restrict__' qualifier with the independent array arguments. " "Erroneous results will occur if these options are incorrectly applied!">, BackendInfo, InGroup; + def warn_fe_backend_optimization_failure : Warning<"%0">, BackendInfo, InGroup, DefaultWarn; def note_fe_backend_invalid_loc : Note<"could " @@ -261,6 +262,11 @@ def err_test_module_file_extension_version : Error< "test module file extension '%0' has different version (%1.%2) than expected " "(%3.%4)">; +def warn_eagerly_load_for_standard_cplusplus_modules : Warning< + "the form '-fmodule-file=' is deprecated for standard C++ named modules;" + "consider to use '-fmodule-file==' instead">, + InGroup>; + def err_missing_vfs_overlay_file : Error< "virtual filesystem overlay file '%0' not found">, DefaultFatal; def err_invalid_vfs_overlay : Error< @@ -283,6 +289,8 @@ def err_avx_calling_convention : Error; def err_alias_to_undefined : Error< "%select{alias|ifunc}0 must point to a defined " "%select{variable or |}1function">; +def err_alias_to_common : Error< + "alias to a variable in a common section is not allowed">; def note_alias_requires_mangled_name : Note< "the %select{function or variable|function}0 specified in an %select{alias|ifunc}1 must refer to its mangled name">; def note_alias_mangled_name_alternative: Note< diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticGroups.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticGroups.td index 26bc88a980e4..80b5680b94f6 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticGroups.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticGroups.td @@ -40,6 +40,7 @@ def : DiagGroup<"auto-import">; def FrameworkHdrQuotedInclude : DiagGroup<"quoted-include-in-framework-header">; def FrameworkIncludePrivateFromPublic : DiagGroup<"framework-include-private-from-public">; +def DeprecatedModuleDotMap : DiagGroup<"deprecated-module-dot-map">; def FrameworkHdrAtImport : DiagGroup<"atimport-in-framework-header">; def CXX14BinaryLiteral : DiagGroup<"c++14-binary-literal">; def CXXPre14CompatBinaryLiteral : DiagGroup<"c++98-c++11-compat-binary-literal">; @@ -144,7 +145,9 @@ def MacroRedefined : DiagGroup<"macro-redefined">; def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">; def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">; def C99Compat : DiagGroup<"c99-compat">; -def C2xCompat : DiagGroup<"c2x-compat">; +def C23Compat : DiagGroup<"c23-compat">; +def : DiagGroup<"c2x-compat", [C23Compat]>; + def CXXCompat: DiagGroup<"c++-compat">; def ExternCCompat : DiagGroup<"extern-c-compat">; def KeywordCompat : DiagGroup<"keyword-compat">; @@ -229,7 +232,7 @@ def Deprecated : DiagGroup<"deprecated", [DeprecatedAnonEnumEnumConversion, DeprecatedType, DeprecatedVolatile, DeprecatedWritableStr, - DeprecatedRedundantConstexprStaticDef, + DeprecatedRedundantConstexprStaticDef ]>, DiagCategory<"Deprecations">; @@ -287,9 +290,11 @@ def : DiagGroup<"c++1z-compat-mangling", [CXX17CompatMangling]>; def NoexceptType : DiagGroup<"noexcept-type", [CXX17CompatMangling]>; // Warnings for C code which is not compatible with previous C standards. -def CPre2xCompat : DiagGroup<"pre-c2x-compat">; -def CPre2xCompatPedantic : DiagGroup<"pre-c2x-compat-pedantic", - [CPre2xCompat]>; +def CPre23Compat : DiagGroup<"pre-c23-compat">; +def CPre23CompatPedantic : DiagGroup<"pre-c23-compat-pedantic", + [CPre23Compat]>; +def : DiagGroup<"pre-c2x-compat", [CPre23Compat]>; +def : DiagGroup<"pre-c2x-compat-pedantic", [CPre23CompatPedantic]>; // Warnings for C++ code which is not compatible with previous C++ standards. def CXXPre14Compat : DiagGroup<"pre-c++14-compat">; @@ -410,7 +415,11 @@ def : DiagGroup<"c++2a-compat-pedantic", [CXX20CompatPedantic]>; def ExitTimeDestructors : DiagGroup<"exit-time-destructors">; def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">; def FourByteMultiChar : DiagGroup<"four-char-constants">; -def GlobalConstructors : DiagGroup<"global-constructors">; +def GlobalConstructors : DiagGroup<"global-constructors"> { + code Documentation = [{ +Emit a warning for each variable declaration that generates code run at startup. + }]; +} def BitwiseConditionalParentheses: DiagGroup<"bitwise-conditional-parentheses">; def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">; def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">; @@ -437,11 +446,13 @@ def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; def InfiniteRecursion : DiagGroup<"infinite-recursion">; def PureVirtualCallFromCtorDtor: DiagGroup<"call-to-pure-virtual-from-ctor-dtor">; def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">; +def IgnoredGCH : DiagGroup<"ignored-gch">; def IgnoredReferenceQualifiers : DiagGroup<"ignored-reference-qualifiers">; def IgnoredQualifiers : DiagGroup<"ignored-qualifiers", [IgnoredReferenceQualifiers]>; def : DiagGroup<"import">; def GNUIncludeNext : DiagGroup<"gnu-include-next">; def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">; +def IncompatibleMSPragmaSection : DiagGroup<"incompatible-ms-pragma-section">; def IncompatiblePointerTypesDiscardsQualifiers : DiagGroup<"incompatible-pointer-types-discards-qualifiers">; def IncompatibleFunctionPointerTypes @@ -575,7 +586,8 @@ def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">; def OrderedCompareFunctionPointers : DiagGroup<"ordered-compare-function-pointers">; def PackedNonPod : DiagGroup<"packed-non-pod">; def Packed : DiagGroup<"packed", [PackedNonPod]>; -def Padded : DiagGroup<"padded">; +def PaddedBitField : DiagGroup<"padded-bitfield">; +def Padded : DiagGroup<"padded", [PaddedBitField]>; def UnalignedAccess : DiagGroup<"unaligned-access">; def PessimizingMove : DiagGroup<"pessimizing-move">; @@ -621,7 +633,7 @@ def ShadowAll : DiagGroup<"shadow-all", [Shadow, ShadowFieldInConstructor, def Shorten64To32 : DiagGroup<"shorten-64-to-32">; def : DiagGroup<"sign-promo">; def SignCompare : DiagGroup<"sign-compare">; -def : DiagGroup<"switch-default">; +def SwitchDefault : DiagGroup<"switch-default">; def : DiagGroup<"synth">; def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">; def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">; @@ -673,13 +685,15 @@ def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">; def TautologicalBitwiseCompare : DiagGroup<"tautological-bitwise-compare">; def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">; def TautologicalObjCBoolCompare : DiagGroup<"tautological-objc-bool-compare">; +def TautologicalNegationCompare : DiagGroup<"tautological-negation-compare">; def TautologicalCompare : DiagGroup<"tautological-compare", [TautologicalConstantCompare, TautologicalPointerCompare, TautologicalOverlapCompare, TautologicalBitwiseCompare, TautologicalUndefinedCompare, - TautologicalObjCBoolCompare]>; + TautologicalObjCBoolCompare, + TautologicalNegationCompare]>; def HeaderHygiene : DiagGroup<"header-hygiene">; def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">; def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">; @@ -838,7 +852,9 @@ def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">; def VariadicMacros : DiagGroup<"variadic-macros">; def VectorConversion : DiagGroup<"vector-conversion">; // clang specific def VexingParse : DiagGroup<"vexing-parse">; -def VLAExtension : DiagGroup<"vla-extension">; +def VLAUseStaticAssert : DiagGroup<"vla-extension-static-assert">; +def VLACxxExtension : DiagGroup<"vla-cxx-extension", [VLAUseStaticAssert]>; +def VLAExtension : DiagGroup<"vla-extension", [VLACxxExtension]>; def VLA : DiagGroup<"vla", [VLAExtension]>; def VolatileRegisterVar : DiagGroup<"volatile-register-var">; def Visibility : DiagGroup<"visibility">; @@ -954,10 +970,16 @@ def FormatNonStandard : DiagGroup<"format-non-iso">; def FormatY2K : DiagGroup<"format-y2k">; def FormatPedantic : DiagGroup<"format-pedantic">; def FormatTypeConfusion : DiagGroup<"format-type-confusion">; + +def FormatOverflowNonKprintf: DiagGroup<"format-overflow-non-kprintf">; +def FormatOverflow: DiagGroup<"format-overflow", [FormatOverflowNonKprintf]>; +def FormatTruncationNonKprintf: DiagGroup<"format-truncation-non-kprintf">; +def FormatTruncation: DiagGroup<"format-truncation", [FormatTruncationNonKprintf]>; + def Format : DiagGroup<"format", [FormatExtraArgs, FormatZeroLength, NonNull, FormatSecurity, FormatY2K, FormatInvalidSpecifier, - FormatInsufficientArgs]>, + FormatInsufficientArgs, FormatOverflow, FormatTruncation]>, DiagCategory<"Format String Issue">; def FormatNonLiteral : DiagGroup<"format-nonliteral">; def Format2 : DiagGroup<"format=2", @@ -1049,7 +1071,9 @@ def Most : DiagGroup<"most", [ def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">; def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">; def ThreadSafetyPrecise : DiagGroup<"thread-safety-precise">; -def ThreadSafetyReference : DiagGroup<"thread-safety-reference">; +def ThreadSafetyReferenceReturn : DiagGroup<"thread-safety-reference-return">; +def ThreadSafetyReference : DiagGroup<"thread-safety-reference", + [ThreadSafetyReferenceReturn]>; def ThreadSafetyNegative : DiagGroup<"thread-safety-negative">; def ThreadSafety : DiagGroup<"thread-safety", [ThreadSafetyAttributes, @@ -1066,7 +1090,8 @@ def Consumed : DiagGroup<"consumed">; // warning should be active _only_ when -Wall is passed in, mark it as // DefaultIgnore in addition to putting it here. def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool, - MisleadingIndentation, PackedNonPod]>; + MisleadingIndentation, PackedNonPod, + VLACxxExtension]>; // Warnings that should be in clang-cl /w4. def : DiagGroup<"CL4", [All, Extra]>; @@ -1102,6 +1127,8 @@ def FutureAttrs : DiagGroup<"future-attribute-extensions", [CXX14Attrs, CXX17Attrs, CXX20Attrs]>; +def CXX23AttrsOnLambda : DiagGroup<"c++23-lambda-attributes">; + // A warning group for warnings about using C++11 features as extensions in // earlier C++ versions. def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11InlineNamespace, @@ -1121,7 +1148,7 @@ def CXX20 : DiagGroup<"c++20-extensions", [CXX20Designator, CXX20Attrs]>; // A warning group for warnings about using C++23 features as extensions in // earlier C++ versions. -def CXX23 : DiagGroup<"c++23-extensions">; +def CXX23 : DiagGroup<"c++23-extensions", [CXX23AttrsOnLambda]>; // A warning group for warnings about using C++26 features as extensions in // earlier C++ versions. @@ -1143,8 +1170,10 @@ def C11 : DiagGroup<"c11-extensions">; // A warning group for warnings about using C99 features as extensions. def C99 : DiagGroup<"c99-extensions", [C99Designator]>; -// A warning group for warnings about using C2x features as extensions. -def C2x : DiagGroup<"c2x-extensions">; +// A warning group for warnings about using C23 features as extensions. +def C23 : DiagGroup<"c23-extensions">; + +def : DiagGroup<"c2x-extensions", [C23]>; // A warning group for warnings about GCC extensions. def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct, @@ -1208,6 +1237,8 @@ def MicrosoftEndOfFile : DiagGroup<"microsoft-end-of-file">; def MicrosoftInaccessibleBase : DiagGroup<"microsoft-inaccessible-base">; def MicrosoftStaticAssert : DiagGroup<"microsoft-static-assert">; def MicrosoftInitFromPredefined : DiagGroup<"microsoft-init-from-predefined">; +def MicrosoftStringLiteralFromPredefined : DiagGroup< + "microsoft-string-literal-from-predefined">; // Aliases. def : DiagGroup<"msvc-include", [MicrosoftInclude]>; @@ -1225,7 +1256,8 @@ def Microsoft : DiagGroup<"microsoft", MicrosoftFlexibleArray, MicrosoftExtraQualification, MicrosoftCast, MicrosoftConstInit, MicrosoftVoidPseudoDtor, MicrosoftAnonTag, MicrosoftCommentPaste, MicrosoftEndOfFile, MicrosoftStaticAssert, - MicrosoftInitFromPredefined, MicrosoftInconsistentDllImport]>; + MicrosoftInitFromPredefined, MicrosoftStringLiteralFromPredefined, + MicrosoftInconsistentDllImport]>; def ClangClPch : DiagGroup<"clang-cl-pch">; @@ -1279,11 +1311,17 @@ def OpenMPMapping : DiagGroup<"openmp-mapping">; def OpenMPTarget : DiagGroup<"openmp-target", [OpenMPMapping]>; def OpenMPPre51Compat : DiagGroup<"pre-openmp-51-compat">; def OpenMP51Ext : DiagGroup<"openmp-51-extensions">; +def OpenMPExtensions : DiagGroup<"openmp-extensions">; +def OpenMPTargetException : DiagGroup<"openmp-target-exception">; def OpenMP : DiagGroup<"openmp", [ SourceUsesOpenMP, OpenMPClauses, OpenMPLoopForm, OpenMPTarget, - OpenMPMapping, OpenMP51Ext + OpenMPMapping, OpenMP51Ext, OpenMPExtensions, OpenMPTargetException ]>; +// OpenACC warnings. +def SourceUsesOpenACC : DiagGroup<"source-uses-openacc">; +def OpenACC : DiagGroup<"openacc", [SourceUsesOpenACC]>; + // Backend warnings. def BackendInlineAsm : DiagGroup<"inline-asm">; def BackendSourceMgr : DiagGroup<"source-mgr">; @@ -1299,10 +1337,12 @@ like YAML by adding the `-foptimization-record-file=` command-line flag. Results can be filtered by function name by passing `-mllvm -filter-print-funcs=foo`, where `foo` is the target function's name. - .. code-block: console + .. code-block:: console + clang -c a.cpp -Rpass-analysis=stack-frame-layout -mllvm -filter-print-funcs=foo - .. code-block: console + .. code-block:: console + clang -c a.cpp -Rpass-analysis=stack-frame-layout -foptimization-record-file= }]; } @@ -1384,7 +1424,7 @@ def CrossTU : DiagGroup<"ctu">; def CTADMaybeUnsupported : DiagGroup<"ctad-maybe-unsupported">; -def FortifySource : DiagGroup<"fortify-source">; +def FortifySource : DiagGroup<"fortify-source", [FormatOverflow, FormatTruncation]>; def MaxTokens : DiagGroup<"max-tokens"> { code Documentation = [{ @@ -1394,19 +1434,22 @@ the token limit, which can be set in three ways: 1. As a limit at a specific point in a file, using the ``clang max_tokens_here`` pragma: - .. code-block: c++ + .. code-block:: c++ + #pragma clang max_tokens_here 1234 2. As a per-translation unit limit, using the ``-fmax-tokens=`` command-line flag: - .. code-block: console + .. code-block:: console + clang -c a.cpp -fmax-tokens=1234 3. As a per-translation unit limit using the ``clang max_tokens_total`` pragma, which works like and overrides the ``-fmax-tokens=`` flag: - .. code-block: c++ + .. code-block:: c++ + #pragma clang max_tokens_total 1234 These limits can be helpful in limiting code growth through included files. diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticIDs.h b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticIDs.h index bf4995175ef1..0cdda42793f6 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticIDs.h +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticIDs.h @@ -31,7 +31,7 @@ namespace clang { // Size of each of the diagnostic categories. enum { DIAG_SIZE_COMMON = 300, - DIAG_SIZE_DRIVER = 300, + DIAG_SIZE_DRIVER = 400, DIAG_SIZE_FRONTEND = 150, DIAG_SIZE_SERIALIZATION = 120, DIAG_SIZE_LEX = 400, @@ -100,11 +100,17 @@ namespace clang { } class DiagnosticMapping { + LLVM_PREFERRED_TYPE(diag::Severity) unsigned Severity : 3; + LLVM_PREFERRED_TYPE(bool) unsigned IsUser : 1; + LLVM_PREFERRED_TYPE(bool) unsigned IsPragma : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HasNoWarningAsError : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HasNoErrorAsFatal : 1; + LLVM_PREFERRED_TYPE(bool) unsigned WasUpgradedFromWarning : 1; public: diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticLexKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticLexKinds.td index 6ad691975bd5..75ca2fa16d34 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticLexKinds.td @@ -82,8 +82,8 @@ def warn_cxx20_keyword : Warning<"'%0' is a keyword in C++20">, InGroup, DefaultIgnore; def warn_c99_keyword : Warning<"'%0' is a keyword in C99">, InGroup, DefaultIgnore; -def warn_c2x_keyword : Warning<"'%0' is a keyword in C2x">, - InGroup, DefaultIgnore; +def warn_c23_keyword : Warning<"'%0' is a keyword in C23">, + InGroup, DefaultIgnore; def ext_unterminated_char_or_string : ExtWarn< "missing terminating %select{'|'\"'}0 character">, InGroup; @@ -197,14 +197,14 @@ def warn_cxx98_compat_literal_ucn_escape_basic_scs : Warning< def warn_cxx98_compat_literal_ucn_control_character : Warning< "universal character name referring to a control character " "is incompatible with C++98">, InGroup, DefaultIgnore; -def warn_c2x_compat_literal_ucn_escape_basic_scs : Warning< +def warn_c23_compat_literal_ucn_escape_basic_scs : Warning< "specifying character '%0' with a universal character name is " - "incompatible with C standards before C2x">, - InGroup, DefaultIgnore; -def warn_c2x_compat_literal_ucn_control_character : Warning< + "incompatible with C standards before C23">, + InGroup, DefaultIgnore; +def warn_c23_compat_literal_ucn_control_character : Warning< "universal character name referring to a control character " - "is incompatible with C standards before C2x">, - InGroup, DefaultIgnore; + "is incompatible with C standards before C23">, + InGroup, DefaultIgnore; def warn_ucn_not_valid_in_c89 : Warning< "universal character names are only valid in C99 or C++; " "treating as '\\' followed by identifier">, InGroup; @@ -224,9 +224,9 @@ def err_invalid_suffix_constant : Error< def warn_cxx11_compat_digit_separator : Warning< "digit separators are incompatible with C++ standards before C++14">, InGroup, DefaultIgnore; -def warn_c2x_compat_digit_separator : Warning< - "digit separators are incompatible with C standards before C2x">, - InGroup, DefaultIgnore; +def warn_c23_compat_digit_separator : Warning< + "digit separators are incompatible with C standards before C23">, + InGroup, DefaultIgnore; def err_digit_separator_not_between_digits : Error< "digit separator cannot appear at %select{start|end}0 of digit sequence">; def warn_char_constant_too_large : Warning< @@ -415,13 +415,13 @@ def ext_pp_include_next_directive : Extension< "#include_next is a language extension">, InGroup; def ext_pp_warning_directive : Extension< - "#warning is a %select{C2x|C++23}0 extension">; + "#warning is a %select{C23|C++23}0 extension">; def warn_cxx23_compat_warning_directive : Warning< "#warning is incompatible with C++ standards before C++23">, InGroup, DefaultIgnore; -def warn_c2x_compat_warning_directive : Warning< - "#warning is incompatible with C standards before C2x">, - InGroup, DefaultIgnore; +def warn_c23_compat_warning_directive : Warning< + "#warning is incompatible with C standards before C23">, + InGroup, DefaultIgnore; def ext_pp_extra_tokens_at_eol : ExtWarn< "extra tokens at end of #%0 directive">, InGroup; @@ -750,14 +750,14 @@ def warn_cxx98_compat_pp_line_too_big : Warning< "#line number greater than 32767 is incompatible with C++98">, InGroup, DefaultIgnore; -def warn_c2x_compat_pp_directive : Warning< +def warn_c23_compat_pp_directive : Warning< "use of a '#%select{|elifdef|elifndef}0' directive " - "is incompatible with C standards before C2x">, - InGroup, DefaultIgnore; -def ext_c2x_pp_directive : ExtWarn< + "is incompatible with C standards before C23">, + InGroup, DefaultIgnore; +def ext_c23_pp_directive : ExtWarn< "use of a '#%select{|elifdef|elifndef}0' directive " - "is a C2x extension">, - InGroup; + "is a C23 extension">, + InGroup; def warn_cxx23_compat_pp_directive : Warning< "use of a '#%select{|elifdef|elifndef}0' directive " "is incompatible with C++ standards before C++23">, @@ -884,6 +884,9 @@ def warn_quoted_include_in_framework_header : Warning< def warn_framework_include_private_from_public : Warning< "public framework header includes private framework header '%0'" >, InGroup; +def warn_deprecated_module_dot_map : Warning< + "'%0' as a module map name is deprecated, rename it to %select{module.modulemap|module.private.modulemap}1%select{| in the 'Modules' directory of the framework}2">, + InGroup; def remark_pp_include_directive_modular_translation : Remark< "treating #%select{include|import|include_next|__include_macros}0 as an " @@ -922,6 +925,11 @@ def err_header_import_semi_in_macro : Error< def err_header_import_not_header_unit : Error< "header file %0 (aka '%1') cannot be imported because " "it is not known to be a header unit">; +def warn_pp_include_angled_in_module_purview : Warning< + "'#include ' attaches the declarations to the named module '%0'" + ", which is not usually intended; consider moving that directive before " + "the module declaration">, + InGroup>; def warn_header_guard : Warning< "%0 is used as a header guard here, followed by #define of a different macro">, diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticOptions.h b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticOptions.h index 7e218b9c71e6..099982c3bdd5 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticOptions.h +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticOptions.h @@ -72,6 +72,7 @@ class DiagnosticOptions : public RefCountedBase{ clang::DiagnosticsEngine *, bool); friend class CompilerInvocation; + friend class CompilerInvocationBase; public: enum TextDiagnosticFormat { Clang, MSVC, Vi, SARIF }; @@ -123,6 +124,10 @@ public: /// default). std::vector VerifyPrefixes; + /// The list of -Wsystem-header-in-module=... options used to override + /// whether -Wsystem-headers is enabled on a per-module basis. + std::vector SystemHeaderWarningsModules; + public: // Define accessors/mutators for diagnostic options of enumeration type. #define DIAGOPT(Name, Bits, Default) diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticParseKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticParseKinds.td index 8d729c31641e..6150fc36430a 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -165,9 +165,9 @@ def ext_c99_feature : Extension< "'%0' is a C99 extension">, InGroup; def ext_c11_feature : Extension< "'%0' is a C11 extension">, InGroup; -def warn_c2x_compat_keyword : Warning< - "'%0' is incompatible with C standards before C2x">, - InGroup, DefaultIgnore; +def warn_c23_compat_keyword : Warning< + "'%0' is incompatible with C standards before C23">, + InGroup, DefaultIgnore; def err_c11_noreturn_misplaced : Error< "'_Noreturn' keyword must precede function declarator">; @@ -299,15 +299,21 @@ def note_missing_selector_name : Note< def note_force_empty_selector_name : Note< "or insert whitespace before ':' to use %0 as parameter name " "and have an empty entry in the selector">; +def ext_c_label_followed_by_declaration : ExtWarn< + "label followed by a declaration is a C23 extension">, + InGroup; +def warn_c23_compat_label_followed_by_declaration : Warning< + "label followed by a declaration is incompatible with C standards before " + "C23">, InGroup, DefaultIgnore; def ext_c_label_end_of_compound_statement : ExtWarn< - "label at end of compound statement is a C2x extension">, - InGroup; + "label at end of compound statement is a C23 extension">, + InGroup; def ext_cxx_label_end_of_compound_statement : ExtWarn< "label at end of compound statement is a C++23 extension">, InGroup; -def warn_c2x_compat_label_end_of_compound_statement : Warning< - "label at end of compound statement is incompatible with C standards before C2x">, - InGroup, DefaultIgnore; +def warn_c23_compat_label_end_of_compound_statement : Warning< + "label at end of compound statement is incompatible with C standards before C23">, + InGroup, DefaultIgnore; def warn_cxx20_compat_label_end_of_compound_statement : Warning< "label at end of compound statement is incompatible with C++ standards before C++23">, InGroup, DefaultIgnore; @@ -447,15 +453,15 @@ def ext_ms_static_assert : ExtWarn< def ext_cxx_static_assert_no_message : ExtWarn< "'static_assert' with no message is a C++17 extension">, InGroup; def ext_c_static_assert_no_message : ExtWarn< - "'_Static_assert' with no message is a C2x extension">, InGroup; + "'_Static_assert' with no message is a C23 extension">, InGroup; def warn_cxx14_compat_static_assert_no_message : Warning< "'static_assert' with no message is incompatible with C++ standards before " "C++17">, DefaultIgnore, InGroup; def warn_c17_compat_static_assert_no_message : Warning< "'_Static_assert' with no message is incompatible with C standards before " - "C2x">, - DefaultIgnore, InGroup; + "C23">, + DefaultIgnore, InGroup; def err_function_definition_not_allowed : Error< "function definition is not allowed here">; def err_expected_end_of_enumerator : Error< @@ -704,7 +710,7 @@ def warn_cxx98_compat_noexcept_expr : Warning< def warn_cxx98_compat_nullptr : Warning< "'nullptr' is incompatible with C++98">, InGroup, DefaultIgnore; def ext_c_nullptr : Extension< - "'nullptr' is a C2x extension">, InGroup; + "'nullptr' is a C23 extension">, InGroup; def warn_wrong_clang_attr_namespace : Warning< "'__clang__' is a predefined macro name, not an attribute scope specifier; " @@ -724,12 +730,12 @@ def warn_cxx98_compat_attribute : Warning< def warn_ext_cxx11_attributes : Extension< "[[]] attributes are a C++11 extension">, InGroup; -def warn_pre_c2x_compat_attributes : Warning< - "[[]] attributes are incompatible with C standards before C2x">, - DefaultIgnore, InGroup; -def warn_ext_c2x_attributes : Extension< - "[[]] attributes are a C2x extension">, - InGroup; +def warn_pre_c23_compat_attributes : Warning< + "[[]] attributes are incompatible with C standards before C23">, + DefaultIgnore, InGroup; +def warn_ext_c23_attributes : Extension< + "[[]] attributes are a C23 extension">, + InGroup; def err_cxx11_attribute_forbids_arguments : Error< "attribute %0 cannot have an argument list">; def err_attribute_requires_arguments : Error< @@ -1029,7 +1035,7 @@ def err_capture_default_first : Error< "capture default must be first">; def ext_decl_attrs_on_lambda : ExtWarn< "%select{an attribute specifier sequence|%0}1 in this position " - "is a C++23 extension">, InGroup; + "is a C++23 extension">, InGroup; def ext_lambda_missing_parens : ExtWarn< "lambda without a parameter clause is a C++23 extension">, InGroup; @@ -1342,12 +1348,35 @@ def err_opencl_logical_exclusive_or : Error< def err_openclcxx_virtual_function : Error< "virtual functions are not supported in C++ for OpenCL">; +// OpenACC Support. +def warn_pragma_acc_ignored + : Warning<"unexpected '#pragma acc ...' in program">, + InGroup, + DefaultIgnore; +def err_acc_unexpected_directive + : Error<"unexpected OpenACC directive %select{|'#pragma acc %1'}0">; +def warn_pragma_acc_unimplemented + : Warning<"OpenACC directives not yet implemented, pragma ignored">, + InGroup; +def warn_pragma_acc_unimplemented_clause_parsing + : Warning<"OpenACC clause parsing not yet implemented">, + InGroup; +def err_acc_invalid_directive + : Error<"invalid OpenACC directive %select{%1|'%1 %2'}0">; +def err_acc_missing_directive : Error<"expected OpenACC directive">; +def err_acc_invalid_open_paren + : Error<"expected clause-list or newline in OpenACC directive">; + // OpenMP support. def warn_pragma_omp_ignored : Warning< "unexpected '#pragma omp ...' in program">, InGroup, DefaultIgnore; def warn_omp_extra_tokens_at_eol : Warning< "extra tokens at the end of '#pragma omp %0' are ignored">, InGroup; +def err_omp_multiple_step_or_linear_modifier : Error< + "multiple %select{'step size'|'linear modifier'}0 found in linear clause">; +def err_omp_deprecate_old_syntax: Error< + "old syntax '%0' on '%1' clause was deprecated, use new syntax '%2'">; def warn_pragma_expected_colon_r_paren : Warning< "missing ':' or ')' after %0 - ignoring">, InGroup; def err_omp_unknown_directive : Error< @@ -1360,6 +1389,8 @@ def warn_clause_expected_string : Warning< "expected string literal in 'clause %0' - ignoring">, InGroup; def err_omp_unexpected_clause : Error< "unexpected OpenMP clause '%0' in directive '#pragma omp %1'">; +def err_omp_unexpected_clause_extension_only : Error< + "OpenMP clause '%0' is only available as extension, use '-fopenmp-extensions'">; def err_omp_immediate_directive : Error< "'#pragma omp %0' %select{|with '%2' clause }1cannot be an immediate substatement">; def err_omp_expected_identifier_for_critical : Error< @@ -1452,6 +1483,8 @@ def warn_unknown_declare_variant_isa_trait "spelling or consider restricting the context selector with the " "'arch' selector further">, InGroup; +def note_ompx_bare_clause : Note< + "OpenMP extension clause '%0' only allowed with '#pragma omp %1'">; def note_omp_declare_variant_ctx_options : Note<"context %select{set|selector|property}0 options are: %1">; def warn_omp_declare_variant_expected @@ -1530,6 +1563,7 @@ def warn_omp51_compat_attributes : Warning< "standards before OpenMP 5.1">, InGroup, DefaultIgnore; def err_omp_expected_colon : Error<"missing ':' in %0">; +def err_omp_missing_comma : Error< "missing ',' after %0">; def err_omp_expected_context_selector : Error<"expected valid context selector in %0">; def err_omp_requires_out_inout_depend_type : Error< @@ -1540,6 +1574,9 @@ def warn_omp_more_one_omp_all_memory : Warning< InGroup; def warn_omp_depend_in_ordered_deprecated : Warning<"'depend' clause for" " 'ordered' is deprecated; use 'doacross' instead">, InGroup; +def warn_omp_invalid_attribute_for_ompx_attributes : Warning<"'ompx_attribute' clause only allows " + "'amdgpu_flat_work_group_size', 'amdgpu_waves_per_eu', and 'launch_bounds'; " + "%0 is ignored">, InGroup; // Pragma loop support. def err_pragma_loop_missing_argument : Error< @@ -1557,12 +1594,13 @@ def note_pragma_loop_invalid_vectorize_option : Note< "vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')">; def err_pragma_fp_invalid_option : Error< - "%select{invalid|missing}0 option%select{ %1|}0; expected 'contract', 'reassociate' or 'exceptions'">; + "%select{invalid|missing}0 option%select{ %1|}0; expected 'contract', 'reassociate', 'reciprocal', or 'exceptions'">; def err_pragma_fp_invalid_argument : Error< "unexpected argument '%0' to '#pragma clang fp %1'; expected " "%select{" "'fast' or 'on' or 'off'|" "'on' or 'off'|" + "'on' or 'off'|" "'ignore', 'maytrap' or 'strict'|" "'source', 'double' or 'extended'}2">; diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td index 0c0530f8a11d..f572b6f861fd 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -115,6 +115,9 @@ def ext_predef_outside_function : Warning< def ext_init_from_predefined : ExtWarn< "initializing an array from a '%0' predefined identifier is a Microsoft extension">, InGroup; +def ext_string_literal_from_predefined : ExtWarn< + "expansion of predefined identifier '%0' to a string literal is a Microsoft extension">, + InGroup; def warn_float_overflow : Warning< "magnitude of floating-point constant too large for type %0; maximum is %1">, InGroup; @@ -134,6 +137,18 @@ def err_half_const_requires_fp16 : Error< // C99 variable-length arrays def ext_vla : Extension<"variable length arrays are a C99 feature">, InGroup; +// In C++ language modes, we warn by default as an extension, while in GNU++ +// language modes, we warn as an extension but add the warning group to -Wall. +def ext_vla_cxx : ExtWarn< + "variable length arrays in C++ are a Clang extension">, + InGroup; +def ext_vla_cxx_in_gnu_mode : Extension, + InGroup; +def ext_vla_cxx_static_assert : ExtWarn< + "variable length arrays in C++ are a Clang extension; did you mean to use " + "'static_assert'?">, InGroup; +def ext_vla_cxx_in_gnu_mode_static_assert : Extension< + ext_vla_cxx_static_assert.Summary>, InGroup; def warn_vla_used : Warning<"variable length array used">, InGroup, DefaultIgnore; def err_vla_in_sfinae : Error< @@ -151,6 +166,8 @@ def ext_vla_folded_to_constant : ExtWarn< InGroup; def err_vla_unsupported : Error< "variable length arrays are not supported for %select{the current target|'%1'}0">; +def err_vla_in_coroutine_unsupported : Error< + "variable length arrays in a coroutine are not supported">; def note_vla_unsupported : Note< "variable length arrays are not supported for the current target">; @@ -237,6 +254,10 @@ def ext_imaginary_constant : Extension< "imaginary constants are a GNU extension">, InGroup; def ext_integer_complex : Extension< "complex integer types are a GNU extension">, InGroup; +def ext_c23_auto_non_plain_identifier : Extension< + "type inference of a declaration other than a plain identifier with optional " + "trailing attributes is a Clang extension">, + InGroup>; def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on " "'_Fract' or '_Accum', not '%0'">; @@ -297,9 +318,9 @@ def err_bad_parameter_name : Error< "%0 cannot be the name of a parameter">; def err_bad_parameter_name_template_id : Error< "parameter name cannot have template arguments">; -def ext_parameter_name_omitted_c2x : ExtWarn< - "omitting the parameter name in a function definition is a C2x extension">, - InGroup; +def ext_parameter_name_omitted_c23 : ExtWarn< + "omitting the parameter name in a function definition is a C23 extension">, + InGroup; def err_anyx86_interrupt_attribute : Error< "%select{x86|x86-64}0 'interrupt' attribute only applies to functions that " "have %select{a 'void' return type|" @@ -307,10 +328,12 @@ def err_anyx86_interrupt_attribute : Error< "a pointer as the first parameter|a %2 type as the second parameter}1">; def err_anyx86_interrupt_called : Error< "interrupt service routine cannot be called directly">; -def warn_anyx86_interrupt_regsave : Warning< - "interrupt service routine should only call a function" - " with attribute 'no_caller_saved_registers'">, - InGroup>; +def warn_anyx86_excessive_regsave : Warning< + "%select{interrupt service routine|function with attribute" + " 'no_caller_saved_registers'}0 should only call a function" + " with attribute 'no_caller_saved_registers'" + " or be compiled with '-mgeneral-regs-only'">, + InGroup>; def warn_arm_interrupt_calling_convention : Warning< "call to function without interrupt attribute could clobber interruptee's VFP registers">, InGroup; @@ -849,10 +872,29 @@ def warn_fortify_strlen_overflow: Warning< " but the source string has length %2 (including NUL byte)">, InGroup; -def warn_fortify_source_format_overflow : Warning< +def subst_format_overflow : TextSubstitution< "'%0' will always overflow; destination buffer has size %1," - " but format string expands to at least %2">, - InGroup; + " but format string expands to at least %2">; + +def warn_format_overflow : Warning< + "%sub{subst_format_overflow}0,1,2">, + InGroup; + +def warn_format_overflow_non_kprintf : Warning< + "%sub{subst_format_overflow}0,1,2">, + InGroup; + +def subst_format_truncation: TextSubstitution< + "'%0' will always be truncated; specified size is %1," + " but format string expands to at least %2">; + +def warn_format_truncation: Warning< + "%sub{subst_format_truncation}0,1,2">, + InGroup; + +def warn_format_truncation_non_kprintf: Warning< + "%sub{subst_format_truncation}0,1,2">, + InGroup; def warn_fortify_scanf_overflow : Warning< "'%0' may overflow; destination buffer in argument %1 has size " @@ -993,6 +1035,9 @@ def warn_cxx_ms_struct : def err_pragma_pack_identifer_not_supported : Error< "specifying an identifier within `#pragma pack` is not supported on this target">; def err_section_conflict : Error<"%0 causes a section type conflict with %1">; +def warn_section_msvc_compat : Warning<"`#pragma const_seg` for section %1 will" + " not apply to %0 due to the presence of a %select{mutable field||non-trivial constructor|non-trivial destructor}2">, + InGroup; def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">; def err_invalid_super_scope : Error<"invalid use of '__super', " "this keyword can only be used inside class or member function scope">; @@ -1624,6 +1669,8 @@ def err_qualified_friend_def : Error< "friend function definition cannot be qualified with '%0'">; def err_friend_def_in_local_class : Error< "friend function cannot be defined in a local class">; +def err_friend_specialization_def : Error< + "friend function specialization cannot be defined">; def err_friend_not_first_in_declaration : Error< "'friend' must appear first in a non-function declaration">; def err_using_decl_friend : Error< @@ -2035,6 +2082,10 @@ def err_different_return_type_for_overriding_virtual_function : Error< "than the function it overrides}1,2">; def note_overridden_virtual_function : Note< "overridden virtual function is here">; +def err_conflicting_overriding_attributes : Error< + "virtual function %0 has different attributes " + "%diff{($) than the function it overrides (which has $)|" + "than the function it overrides}1,2">; def err_conflicting_overriding_cc_attributes : Error< "virtual function %0 has different calling convention attributes " "%diff{($) than the function it overrides (which has calling convention $)|" @@ -2357,7 +2408,8 @@ def err_auto_not_allowed : Error< "|in conversion function type|here|in lambda parameter" "|in type allocated by 'new'|in K&R-style function parameter" "|in template parameter|in friend declaration|in function prototype that is " - "not a function declaration|in requires expression parameter}1">; + "not a function declaration|in requires expression parameter" + "|in array declaration}1">; def err_dependent_deduced_tst : Error< "typename specifier refers to " "%select{class template|function template|variable template|alias template|" @@ -2430,7 +2482,8 @@ def err_implied_std_initializer_list_not_found : Error< def err_malformed_std_initializer_list : Error< "std::initializer_list must be a class template with a single type parameter">; def err_auto_init_list_from_c : Error< - "cannot use __auto_type with initializer list in C">; + "cannot use %select{'auto'||'__auto_type'}0 with " + "%select{initializer list|array}1 in C">; def err_auto_bitfield : Error< "cannot pass bit-field as __auto_type initializer in C">; @@ -2576,7 +2629,7 @@ def err_final_function_overridden : Error< // C++11 scoped enumerations def err_enum_invalid_underlying : Error< - "non-integral type %0 is an invalid underlying type">; + "%select{non-integral type %0|%0}1 is an invalid underlying type">; def err_enumerator_too_large : Error< "enumerator value is not representable in the underlying type %0">; def ext_enumerator_too_large : Extension< @@ -2833,6 +2886,8 @@ def warn_cxx11_compat_constexpr_body_multiple_return : Warning< InGroup, DefaultIgnore; def note_constexpr_body_previous_return : Note< "previous return statement is here">; +def err_ms_constexpr_cannot_be_applied : Error< + "attribute 'msvc::constexpr' cannot be applied to the %select{constexpr|consteval|virtual}0 function %1">; // C++20 function try blocks in constexpr def ext_constexpr_function_try_block_cxx20 : ExtWarn< @@ -3097,6 +3152,9 @@ def err_attribute_bad_sve_vector_size : Error< def err_attribute_arm_feature_sve_bits_unsupported : Error< "%0 is only supported when '-msve-vector-bits=' is specified with a " "value of 128, 256, 512, 1024 or 2048.">; +def warn_attribute_arm_sm_incompat_builtin : Warning< + "builtin call has undefined behaviour when called from a %0 function">, + InGroup>; def err_sve_vector_in_non_sve_target : Error< "SVE vector type %0 cannot be used in a target without sve">; def err_attribute_riscv_rvv_bits_unsupported : Error< @@ -3126,6 +3184,10 @@ def warn_unsupported_target_attribute def err_attribute_unsupported : Error<"%0 attribute is not supported on targets missing %1;" " specify an appropriate -march= or -mcpu=">; +def err_duplicate_target_attribute + : Error<"%select{unsupported|duplicate|unknown}0%select{| CPU|" + " tune CPU}1 '%2' in the '%select{target|target_clones|target_version}3' " + "attribute string; ">; // The err_*_attribute_argument_not_int are separate because they're used by // VerifyIntegerConstantExpression. def err_aligned_attribute_argument_not_int : Error< @@ -3621,6 +3683,16 @@ def err_attribute_vecreturn_only_vector_member : Error< "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">; def err_attribute_vecreturn_only_pod_record : Error< "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">; +def err_sme_attr_mismatch : Error< + "function declared %0 was previously declared %1, which has different SME function attributes">; +def err_sme_call_in_non_sme_target : Error< + "call to a streaming function requires 'sme'">; +def err_sme_za_call_no_za_state : Error< + "call to a shared ZA function requires the caller to have ZA state">; +def err_sme_definition_using_sm_in_non_sme_target : Error< + "function executed in streaming-SVE mode requires 'sme'">; +def err_sme_definition_using_za_in_non_sme_target : Error< + "function using ZA state requires 'sme'">; def err_cconv_change : Error< "function declared '%0' here was previously declared " "%select{'%2'|without calling convention}1">; @@ -3817,7 +3889,7 @@ def warn_fun_requires_negative_cap : Warning< "calling function %0 requires negative capability '%1'">, InGroup, DefaultIgnore; -// Thread safety warnings on pass by reference +// Thread safety warnings on pass/return by reference def warn_guarded_pass_by_reference : Warning< "passing variable %1 by reference requires holding %0 " "%select{'%2'|'%2' exclusively}3">, @@ -3826,6 +3898,14 @@ def warn_pt_guarded_pass_by_reference : Warning< "passing the value that %1 points to by reference requires holding %0 " "%select{'%2'|'%2' exclusively}3">, InGroup, DefaultIgnore; +def warn_guarded_return_by_reference : Warning< + "returning variable %1 by reference requires holding %0 " + "%select{'%2'|'%2' exclusively}3">, + InGroup, DefaultIgnore; +def warn_pt_guarded_return_by_reference : Warning< + "returning the value that %1 points to by reference requires holding %0 " + "%select{'%2'|'%2' exclusively}3">, + InGroup, DefaultIgnore; // Imprecise thread safety warnings def warn_variable_requires_lock : Warning< @@ -4165,7 +4245,7 @@ def warn_vector_mode_deprecated : Warning< "use the 'vector_size' attribute instead">, InGroup; def warn_deprecated_noreturn_spelling : Warning< - "the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use " + "the '[[_Noreturn]]' attribute spelling is deprecated in C23; use " "'[[noreturn]]' instead">, InGroup; def err_complex_mode_vector_type : Error< "type of machine mode does not support base vector types">; @@ -4640,12 +4720,14 @@ def note_ovl_candidate_non_deduced_mismatch_qualified : Note< // Note that we don't treat templates differently for this diagnostic. def note_ovl_candidate_arity : Note<"candidate " "%sub{select_ovl_candidate_kind}0,1,2 not viable: " - "requires%select{ at least| at most|}3 %4 argument%s4, but %5 " + "requires%select{ at least| at most|}3 %4 " + "%select{|non-object }6argument%s4, but %5 " "%plural{1:was|:were}5 provided">; def note_ovl_candidate_arity_one : Note<"candidate " "%sub{select_ovl_candidate_kind}0,1,2 not viable: " "%select{requires at least|allows at most single|requires single}3 " + "%select{|non-object }6" "argument %4, but %plural{0:no|:%5}5 arguments were provided">; def note_ovl_candidate_deleted : Note< @@ -4828,7 +4910,7 @@ def err_ovl_deleted_object_call : Error< "call to deleted function call operator in type %0">; def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">; def err_member_call_without_object : Error< - "call to non-static member function without an object argument">; + "call to %select{non-static|explicit}0 member function without an object argument">; // C++ Address of Overloaded Function def err_addr_ovl_no_viable : Error< @@ -4855,6 +4937,8 @@ def err_template_param_shadow : Error< def ext_template_param_shadow : ExtWarn< err_template_param_shadow.Summary>, InGroup; def note_template_param_here : Note<"template parameter is declared here">; +def note_template_param_external : Note< + "template parameter from hidden source: %0">; def warn_template_export_unsupported : Warning< "exported templates are unsupported">; def err_template_outside_namespace_or_class_scope : Error< @@ -4983,6 +5067,8 @@ def err_template_arg_list_different_arity : Error< "%select{class template|function template|variable template|alias template|" "template template parameter|concept|template}1 %2">; def note_template_decl_here : Note<"template is declared here">; +def note_template_decl_external : Note< + "template declaration from hidden source: %0">; def err_template_arg_must_be_type : Error< "template argument for template type parameter must be a type">; def err_template_arg_must_be_type_suggest : Error< @@ -5183,11 +5269,11 @@ def err_explicit_specialization_inconsistent_storage_class : Error< "'%select{none|extern|static|__private_extern__|auto|register}0'">; def err_dependent_function_template_spec_no_match : Error< "no candidate function template was found for dependent" - " friend function template specialization">; + " %select{member|friend}0 function template specialization">; def note_dependent_function_template_spec_discard_reason : Note< - "candidate ignored: %select{not a function template" - "|not a member of the enclosing namespace;" - " did you mean to explicitly qualify the specialization?}0">; + "candidate ignored: %select{not a function template|" + "not a member of the enclosing %select{class template|" + "namespace; did you mean to explicitly qualify the specialization?}1}0">; // C++ class template specializations and out-of-line definitions def err_template_spec_needs_header : Error< @@ -5373,6 +5459,8 @@ def note_constraint_normalization_here : Note< def note_parameter_mapping_substitution_here : Note< "while substituting into concept arguments here; substitution failures not " "allowed in concept arguments">; +def note_building_deduction_guide_here : Note< + "while building implicit deduction guide first needed here">; def note_lambda_substitution_here : Note< "while substituting into a lambda expression here">; def note_instantiation_contexts_suppressed : Note< @@ -5582,9 +5670,9 @@ def err_unexpanded_parameter_pack : Error< "%select{expression|base type|declaration type|data member type|bit-field " "size|static assertion|fixed underlying type|enumerator value|" "using declaration|friend declaration|qualifier|initializer|default argument|" - "non-type template parameter type|exception type|partial specialization|" - "__if_exists name|__if_not_exists name|lambda|block|type constraint|" - "requirement|requires clause}0 " + "non-type template parameter type|exception type|explicit specialization|" + "partial specialization|__if_exists name|__if_not_exists name|lambda|block|" + "type constraint|requirement|requires clause}0 " "contains%plural{0: an|:}1 unexpanded parameter pack" "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">; @@ -5698,7 +5786,7 @@ def note_sentinel_here : Note< "%select{function|method|block}0 has been explicitly marked sentinel here">; def warn_strict_uses_without_prototype : Warning< "passing arguments to %select{a function|%1}0 without a prototype is " - "deprecated in all versions of C and is not supported in C2x">, + "deprecated in all versions of C and is not supported in C23">, InGroup; def warn_missing_prototype : Warning< "no previous prototype for function %0">, @@ -5713,8 +5801,8 @@ def warn_strict_prototypes : Extension< "%select{in all versions of C|}0">, InGroup; def warn_non_prototype_changes_behavior : Warning< "a function %select{declaration|definition}0 without a prototype is " - "deprecated in all versions of C %select{and is not supported in C2x|and is " - "treated as a zero-parameter prototype in C2x, conflicting with a " + "deprecated in all versions of C %select{and is not supported in C23|and is " + "treated as a zero-parameter prototype in C23, conflicting with a " "%select{previous|subsequent}2 %select{declaration|definition}3}1">, InGroup; def note_conflicting_prototype : Note<"conflicting prototype is here">; @@ -6338,6 +6426,17 @@ def warn_superclass_variable_sized_type_not_at_end : Warning< "field %0 can overwrite instance variable %1 with variable sized type %2" " in superclass %3">, InGroup; +def err_counted_by_attr_not_on_flexible_array_member : Error< + "'counted_by' only applies to C99 flexible array members">; +def err_counted_by_attr_refers_to_flexible_array : Error< + "'counted_by' cannot refer to the flexible array %0">; +def err_counted_by_must_be_in_structure : Error< + "field %0 in 'counted_by' not inside structure">; +def err_flexible_array_counted_by_attr_field_not_integer : Error< + "field %0 in 'counted_by' must be a non-boolean integer type">; +def note_flexible_array_counted_by_attr_field : Note< + "field %0 declared here">; + let CategoryName = "ARC Semantic Issue" in { // ARC-mode diagnostics. @@ -6604,13 +6703,23 @@ def err_func_def_incomplete_result : Error< def err_atomic_specifier_bad_type : Error<"_Atomic cannot be applied to " "%select{incomplete |array |function |reference |atomic |qualified " - "|sizeless ||integer }0type " - "%1 %select{|||||||which is not trivially copyable|}0">; + "|sizeless ||integer |}0type " + "%1 %select{|||||||which is not trivially copyable||in C23}0">; def warn_atomic_member_access : Warning< "accessing a member of an atomic structure or union is undefined behavior">, InGroup>, DefaultError; // Expressions. +def err_using_placeholder_variable : Error< + "ambiguous reference to placeholder '_', which is defined multiple times">; +def note_reference_placeholder : Note< + "placeholder declared here">; +def ext_placeholder_var_definition : ExtWarn< + "placeholder variables are a C++2c extension">, InGroup; +def warn_cxx23_placeholder_var_definition : Warning< + "placeholder variables are incompatible with C++ standards before C++2c">, + DefaultIgnore, InGroup; + def ext_sizeof_alignof_function_type : Extension< "invalid application of '%0' to a function type">, InGroup; def ext_sizeof_alignof_void_type : Extension< @@ -6661,7 +6770,7 @@ def warn_floatingpoint_eq : Warning< def err_setting_eval_method_used_in_unsafe_context : Error < "%select{'#pragma clang fp eval_method'|option 'ffp-eval-method'}0 cannot be used with " - "%select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'}1">; + "%select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'|'#pragma clang fp reciprocal'}1">; def warn_remainder_division_by_zero : Warning< "%select{remainder|division}0 by zero is undefined">, @@ -7122,6 +7231,11 @@ def warn_arith_conv_enum_float_cxx20 : Warning< "%plural{2:with|4:from|:and}0 " "%select{enumeration|floating-point}1 type %3 is deprecated">, InGroup; +def err_arith_conv_enum_float_cxx26 : Error< + "invalid %sub{select_arith_conv_kind}0 " + "%select{floating-point|enumeration}1 type %2 " + "%plural{2:with|4:from|:and}0 " + "%select{enumeration|floating-point}1 type %3">; def warn_arith_conv_mixed_enum_types : Warning< "%sub{select_arith_conv_kind}0 " "different enumeration types%diff{ ($ and $)|}1,2">, @@ -7130,6 +7244,10 @@ def warn_arith_conv_mixed_enum_types_cxx20 : Warning< "%sub{select_arith_conv_kind}0 " "different enumeration types%diff{ ($ and $)|}1,2 is deprecated">, InGroup; +def err_conv_mixed_enum_types_cxx26 : Error< + "invalid %sub{select_arith_conv_kind}0 " + "different enumeration types%diff{ ($ and $)|}1,2">; + def warn_arith_conv_mixed_anon_enum_types : Warning< warn_arith_conv_mixed_enum_types.Summary>, InGroup, DefaultIgnore; @@ -7238,14 +7356,16 @@ def note_logical_not_silence_with_parens : Note< "add parentheses around left hand side expression to silence this warning">; def err_invalid_this_use : Error< - "invalid use of 'this' outside of a non-static member function">; + "invalid use of 'this' %select{outside of a non-static member function" + "|in a function with an explicit object parameter}0">; def err_this_static_member_func : Error< "'this' cannot be%select{| implicitly}0 used in a static member function " "declaration">; -def err_invalid_member_use_in_static_method : Error< - "invalid use of member %0 in static member function">; +def err_invalid_member_use_in_method : Error< + "invalid use of member %0 in %select{static|explicit object}1 member function">; + def err_invalid_qualified_function_type : Error< - "%select{non-member function|static member function|deduction guide}0 " + "%select{non-member function|static member function|explicit object member function|deduction guide}0 " "%select{of type %2 |}1cannot have '%3' qualifier">; def err_compound_qualified_function_type : Error< "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1" @@ -7253,6 +7373,26 @@ def err_compound_qualified_function_type : Error< def err_qualified_function_typeid : Error< "type operand %0 of 'typeid' cannot have '%1' qualifier">; +def err_cxx20_deducing_this : Error< + "explicit object parameters are incompatible with C++ standards before C++2b">; +def err_explicit_object_default_arg: Error< + "the explicit object parameter cannot have a default argument">; +def err_explicit_object_parameter_pack: Error< + "the explicit object parameter cannot be a function parameter pack">; +def err_explicit_object_parameter_must_be_first: Error< + "an explicit object parameter can only appear as the first parameter " + "of the %select{function|lambda}0">; +def err_explicit_object_parameter_nonmember: Error< + "an explicit object parameter cannot appear in a " + "%select{static|virtual|non-member}0 %select{function|lambda}1">; +def err_explicit_object_parameter_constructor: Error< + "an explicit object parameter cannot appear in a %select{constructor|destructor}0">; +def err_explicit_object_parameter_mutable: Error< + "a lambda with an explicit object parameter cannot be mutable">; +def err_invalid_explicit_object_type_in_lambda: Error< + "invalid explicit object parameter type %0 in lambda with capture; " + "the type must be the same as, or derived from, the lambda">; + def err_ref_qualifier_overload : Error< "cannot overload a member function %select{without a ref-qualifier|with " "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{" @@ -7861,6 +8001,8 @@ def err_return_in_constructor_handler : Error< def warn_cdtor_function_try_handler_mem_expr : Warning< "cannot refer to a non-static member from the handler of a " "%select{constructor|destructor}0 function try block">, InGroup; +def err_throw_object_throwing_dtor : Error< + "cannot throw object of type %0 with a potentially-throwing destructor">; let CategoryName = "Lambda Issue" in { def err_capture_more_than_once : Error< @@ -8474,53 +8616,65 @@ def err_call_function_incomplete_return : Error< def err_call_incomplete_argument : Error< "argument type %0 is incomplete">; def err_typecheck_call_too_few_args : Error< - "too few %select{|||execution configuration }0arguments to " + "too few %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " "expected %1, have %2">; def err_typecheck_call_too_few_args_one : Error< - "too few %select{|||execution configuration }0arguments to " + "too few %select{|||execution configuration }0" + "%select{|non-object }2arguments to " "%select{function|block|method|kernel function}0 call, " "single argument %1 was not specified">; def err_typecheck_call_too_few_args_at_least : Error< - "too few %select{|||execution configuration }0arguments to " + "too few %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " "expected at least %1, have %2">; def err_typecheck_call_too_few_args_at_least_one : Error< - "too few %select{|||execution configuration }0arguments to " + "too few %select{|||execution configuration }0" + "%select{|non-object }2arguments to " "%select{function|block|method|kernel function}0 call, " "at least argument %1 must be specified">; def err_typecheck_call_too_few_args_suggest : Error< - "too few %select{|||execution configuration }0arguments to " + "too few %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " - "expected %1, have %2; did you mean %3?">; + "expected %1, have %2; did you mean %4?">; def err_typecheck_call_too_few_args_at_least_suggest : Error< - "too few %select{|||execution configuration }0arguments to " + "too few %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " - "expected at least %1, have %2; did you mean %3?">; + "expected at least %1, have %2; did you mean %4?">; def err_typecheck_call_too_many_args : Error< - "too many %select{|||execution configuration }0arguments to " + "too many %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " "expected %1, have %2">; def err_typecheck_call_too_many_args_one : Error< - "too many %select{|||execution configuration }0arguments to " + "too many %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " "expected single argument %1, have %2 arguments">; def err_typecheck_call_too_many_args_at_most : Error< - "too many %select{|||execution configuration }0arguments to " + "too many %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " "expected at most %1, have %2">; def err_typecheck_call_too_many_args_at_most_one : Error< "too many %select{|||execution configuration }0arguments to " "%select{function|block|method|kernel function}0 call, " - "expected at most single argument %1, have %2 arguments">; + "expected at most single %select{|non-object }3argument %1, " + "have %2%select{|non-object}3 arguments">; def err_typecheck_call_too_many_args_suggest : Error< - "too many %select{|||execution configuration }0arguments to " + "too many %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " - "expected %1, have %2; did you mean %3?">; + "expected %1, have %2; did you mean %4?">; def err_typecheck_call_too_many_args_at_most_suggest : Error< - "too many %select{|||execution configuration }0arguments to " + "too many %select{|||execution configuration }0" + "%select{|non-object }3arguments to " "%select{function|block|method|kernel function}0 call, " - "expected at most %1, have %2; did you mean %3?">; + "expected at most %1, have %2; did you mean %4?">; def err_arc_typecheck_convert_incompatible_pointer : Error< "incompatible pointer types passing retainable parameter of type %0" @@ -8575,7 +8729,7 @@ def err_atomic_op_needs_atomic_int : Error< "address argument to atomic operation must be a pointer to " "%select{|atomic }0integer (%1 invalid)">; def warn_atomic_op_has_invalid_memory_order : Warning< - "memory order argument to atomic operation is invalid">, + "%select{|success |failure }0memory order argument to atomic operation is invalid">, InGroup>; def err_atomic_op_has_invalid_synch_scope : Error< "synchronization scope argument to atomic operation is invalid">; @@ -8584,10 +8738,13 @@ def warn_atomic_implicit_seq_cst : Warning< InGroup>, DefaultIgnore; def err_overflow_builtin_must_be_int : Error< - "operand argument to overflow builtin must be an integer (%0 invalid)">; + "operand argument to %select{overflow builtin|checked integer operation}0 " + "must be an integer type %select{|other than plain 'char', 'bool', bit-precise, " + "or an enumeration }0(%1 invalid)">; def err_overflow_builtin_must_be_ptr_int : Error< - "result argument to overflow builtin must be a pointer " - "to a non-const integer (%0 invalid)">; + "result argument to %select{overflow builtin|checked integer operation}0 " + "must be a pointer to a non-const integer type %select{|other than plain 'char', " + "'bool', bit-precise, or an enumeration }0(%1 invalid)">; def err_overflow_builtin_bit_int_max_size : Error< "__builtin_mul_overflow does not support 'signed _BitInt' operands of more " "than %0 bits">; @@ -8648,8 +8805,8 @@ def warn_kern_is_inline : Warning< def err_variadic_device_fn : Error< "CUDA device code does not support variadic functions">; def err_va_arg_in_device : Error< - "CUDA device code does not support va_arg">; -def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">; +"CUDA device code does not support va_arg">; +def err_alias_not_supported_on_nvptx : Error<"CUDA older than 10.0 does not support .alias">; def err_cuda_unattributed_constexpr_cannot_overload_device : Error< "constexpr function %0 without __host__ or __device__ attributes cannot " "overload __device__ function with same signature. Add a __host__ " @@ -9338,10 +9495,10 @@ def warn_cxx98_compat_explicit_conversion_functions : Warning< // C++11 defaulted functions def err_defaulted_special_member_params : Error< - "an explicitly-defaulted %select{|copy |move }0constructor cannot " + "an explicitly-defaulted %sub{select_special_member_kind}0 cannot " "have default arguments">; def err_defaulted_special_member_variadic : Error< - "an explicitly-defaulted %select{|copy |move }0constructor cannot " + "an explicitly-defaulted %sub{select_special_member_kind}0 cannot " "be variadic">; def err_defaulted_special_member_return_type : Error< "explicitly-defaulted %select{copy|move}0 assignment operator must " @@ -9349,6 +9506,9 @@ def err_defaulted_special_member_return_type : Error< def err_defaulted_special_member_quals : Error< "an explicitly-defaulted %select{copy|move}0 assignment operator may not " "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">; +def err_defaulted_special_member_explicit_object_mismatch : Error< + "the type of the explicit object parameter of an explicitly-defaulted " + "%select{copy|move}0 assignment operator should match the type of the class %1">; def err_defaulted_special_member_volatile_param : Error< "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 " "may not be volatile">; @@ -9365,6 +9525,8 @@ def err_defaulted_copy_assign_not_ref : Error< def err_incorrect_defaulted_constexpr : Error< "defaulted definition of %sub{select_special_member_kind}0 " "is not constexpr">; +def err_incorrect_defaulted_constexpr_with_vb: Error< + "%sub{select_special_member_kind}0 cannot be 'constexpr' in a class with virtual base class">; def err_incorrect_defaulted_consteval : Error< "defaulted declaration of %sub{select_special_member_kind}0 " "cannot be consteval because implicit definition is not constexpr">; @@ -9404,7 +9566,7 @@ def err_defaulted_comparison_template : Error< "comparison operator template cannot be defaulted">; def err_defaulted_comparison_num_args : Error< "%select{non-member|member}0 %sub{select_defaulted_comparison_kind}1" - " comparison operator must have %select{2|1}0 parameters">; + " must have %select{2|1}0 parameters">; def err_defaulted_comparison_param : Error< "invalid parameter type for defaulted %sub{select_defaulted_comparison_kind}0" "; found %1, expected %2%select{| or %4}3">; @@ -9766,6 +9928,12 @@ def warn_comparison_bitwise_always : Warning< def warn_comparison_bitwise_or : Warning< "bitwise or with non-zero value always evaluates to true">, InGroup, DefaultIgnore; +def warn_tautological_negation_and_compare: Warning< + "'&&' of a value and its negation always evaluates to false">, + InGroup, DefaultIgnore; +def warn_tautological_negation_or_compare: Warning< + "'||' of a value and its negation always evaluates to true">, + InGroup, DefaultIgnore; def warn_tautological_overlap_comparison : Warning< "overlapping comparisons always evaluate to %select{false|true}0">, InGroup, DefaultIgnore; @@ -9859,6 +10027,11 @@ def err_break_not_in_loop_or_switch : Error< def warn_loop_ctrl_binds_to_inner : Warning< "'%0' is bound to current loop, GCC binds it to the enclosing loop">, InGroup; +def err_omp_bind_required_on_loop : Error< + "expected 'bind' clause for 'loop' construct without an enclosing OpenMP " + "construct">; +def err_omp_loop_reduction_clause : Error< + "'reduction' clause not allowed with '#pragma omp loop bind(teams)'">; def warn_break_binds_to_switch : Warning< "'break' is bound to loop, GCC binds it to switch">, InGroup; @@ -9876,6 +10049,11 @@ def err_duplicate_case_differing_expr : Error< def warn_case_empty_range : Warning<"empty case range specified">; def warn_missing_case_for_condition : Warning<"no case matching constant switch condition '%0'">; +def err_loop_attr_conflict : Error< + "conflicting loop attribute %0">; +def err_attribute_power_of_two_in_range : Error< + "%0 attribute requires an integer argument which is a constant power of two " + "between %1 and %2 inclusive; provided argument was %3">; def warn_def_missing_case : Warning<"%plural{" "1:enumeration value %1 not explicitly handled in switch|" @@ -9890,6 +10068,8 @@ def warn_missing_case : Warning<"%plural{" "3:enumeration values %1, %2, and %3 not handled in switch|" ":%0 enumeration values not handled in switch: %1, %2, %3...}0">, InGroup; +def warn_switch_default : Warning<"'switch' missing 'default' label">, + InGroup, DefaultIgnore; def warn_unannotated_fallthrough : Warning< "unannotated fall-through between switch labels">, @@ -9960,7 +10140,7 @@ def warn_second_arg_of_va_start_not_last_named_param : Warning< InGroup; def warn_c17_compat_ellipsis_only_parameter : Warning< "'...' as the only parameter of a function is incompatible with C standards " - "before C2x">, DefaultIgnore, InGroup; + "before C23">, DefaultIgnore, InGroup; def warn_va_start_type_is_undefined : Warning< "passing %select{an object that undergoes default argument promotion|" "an object of reference type|a parameter declared with the 'register' " @@ -10036,8 +10216,8 @@ def err_shufflevector_argument_too_large : Error< def err_convertvector_non_vector : Error< "first argument to __builtin_convertvector must be a vector">; -def err_convertvector_non_vector_type : Error< - "second argument to __builtin_convertvector must be a vector type">; +def err_builtin_non_vector_type : Error< + "%0 argument to %1 must be of vector type">; def err_convertvector_incompatible_vector : Error< "first two arguments to __builtin_convertvector must have the same number of elements">; @@ -10813,6 +10993,8 @@ def note_omp_atomic_compare: Note< "expect binary operator in conditional expression|expect '<', '>' or '==' as order operator|expect comparison in a form of 'x == e', 'e == x', 'x ordop expr', or 'expr ordop x'|" "expect lvalue for result value|expect scalar value|expect integer value|unexpected 'else' statement|expect '==' operator|expect an assignment statement 'v = x'|" "expect a 'if' statement|expect no more than two statements|expect a compound statement|expect 'else' statement|expect a form 'r = x == e; if (r) ...'}0">; +def err_omp_atomic_fail_wrong_or_no_clauses : Error<"expected a memory order clause">; +def err_omp_atomic_fail_no_compare : Error<"expected 'compare' clause with the 'fail' modifier">; def err_omp_atomic_several_clauses : Error< "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update', 'capture', or 'compare' clause">; def err_omp_several_mem_order_clauses : Error< @@ -10883,6 +11065,8 @@ def err_omp_wrong_linear_modifier : Error< "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">; def err_omp_wrong_linear_modifier_non_reference : Error< "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">; +def err_omp_step_simple_modifier_exclusive : Error< + "step simple modifier is exclusive and can't be use with 'val', 'uval' or 'ref' modifier">; def err_omp_wrong_simdlen_safelen_values : Error< "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">; def err_omp_wrong_if_directive_name_modifier : Error< @@ -11283,6 +11467,8 @@ def err_module_import_in_implementation : Error< "@import of module '%0' in implementation of '%1'; use #import">; // C++ Modules +def err_module_import_non_interface_nor_parition : Error< + "import of module '%0' imported non C++20 importable modules">; def err_module_decl_not_at_start : Error< "module declaration must occur at the start of the translation unit">; def note_global_module_introducer_missing : Note< @@ -11438,6 +11624,10 @@ def err_conflicting_aligned_options : Error < def err_coro_invalid_addr_of_label : Error< "the GNU address of label extension is not allowed in coroutines." >; +def err_coroutine_return_type : Error< + "function returns a type %0 marked with [[clang::coro_return_type]] but is neither a coroutine nor a coroutine wrapper; " + "non-coroutines should be marked with [[clang::coro_wrapper]] to allow returning coroutine return type" +>; } // end of coroutines issue category let CategoryName = "Documentation Issue" in { @@ -11786,6 +11976,10 @@ def err_sycl_special_type_num_init_method : Error< "types with 'sycl_special_class' attribute must have one and only one '__init' " "method defined">; +def warn_cuda_maxclusterrank_sm_90 : Warning< + "maxclusterrank requires sm_90 or higher, CUDA arch provided: %0, ignoring " + "%1 attribute">, InGroup; + def err_bit_int_bad_size : Error<"%select{signed|unsigned}0 _BitInt must " "have a bit size of at least %select{2|1}0">; def err_bit_int_max_size : Error<"%select{signed|unsigned}0 _BitInt of bit " @@ -11808,7 +12002,7 @@ def warn_tcb_enforcement_violation : Warning< // RISC-V builtin required extension warning def err_riscv_builtin_requires_extension : Error< - "builtin requires%select{| at least one of the following extensions to be enabled}0: %1">; + "builtin requires%select{| at least one of the following extensions}0: %1">; def err_riscv_builtin_invalid_lmul : Error< "LMUL argument must be in the range [0,3] or [5,7]">; def err_riscv_type_requires_extension : Error< @@ -11821,17 +12015,18 @@ def err_std_source_location_impl_malformed : Error< "'std::source_location::__impl' must be standard-layout and have only two 'const char *' fields '_M_file_name' and '_M_function_name', and two integral fields '_M_line' and '_M_column'">; // HLSL Diagnostics -def err_hlsl_attr_unsupported_in_stage : Error<"attribute %0 is unsupported in %select{Pixel|Vertex|Geometry|Hull|Domain|Compute|Library|RayGeneration|Intersection|AnyHit|ClosestHit|Miss|Callable|Mesh|Amplification|Invalid}1 shaders, requires %2">; +def err_hlsl_attr_unsupported_in_stage : Error<"attribute %0 is unsupported in '%1' shaders, requires %select{|one of the following: }2%3">; def err_hlsl_attr_invalid_type : Error< "attribute %0 only applies to a field or parameter of type '%1'">; def err_hlsl_attr_invalid_ast_node : Error< "attribute %0 only applies to %1">; def err_hlsl_entry_shader_attr_mismatch : Error< - "%0 attribute on entry function does not match the pipeline stage">; + "%0 attribute on entry function does not match the target profile">; def err_hlsl_numthreads_argument_oor : Error<"argument '%select{X|Y|Z}0' to numthreads attribute cannot exceed %1">; def err_hlsl_numthreads_invalid : Error<"total number of threads cannot exceed %0">; def err_hlsl_missing_numthreads : Error<"missing numthreads attribute for %0 shader entry">; def err_hlsl_attribute_param_mismatch : Error<"%0 attribute parameters do not match the previous declaration">; +def err_hlsl_duplicate_parameter_modifier : Error<"duplicate parameter modifier %0">; def err_hlsl_missing_semantic_annotation : Error< "semantic annotations must be present for all parameters of an entry " "function or patch constant function">; @@ -11847,16 +12042,15 @@ def err_hlsl_pointers_unsupported : Error< def err_hlsl_operator_unsupported : Error< "the '%select{&|*|->}0' operator is unsupported in HLSL">; +def err_hlsl_param_qualifier_mismatch : + Error<"conflicting parameter qualifier %0 on parameter %1">; + // Layout randomization diagnostics. def err_non_designated_init_used : Error< "a randomized struct can only be initialized with a designated initializer">; def err_cast_from_randomized_struct : Error< "casting from randomized structure pointer type %0 to %1">; -// LoongArch-specific Diagnostics -def err_loongarch_builtin_requires_la64 : Error< - "this builtin requires target: loongarch64">; - // Unsafe buffer usage diagnostics. def warn_unsafe_buffer_variable : Warning< "%0 is an %select{unsafe pointer used for buffer access|unsafe buffer that " @@ -11870,10 +12064,16 @@ def note_unsafe_buffer_operation : Note< "used%select{| in pointer arithmetic| in buffer access}0 here">; def note_unsafe_buffer_variable_fixit_group : Note< "change type of %0 to '%select{std::span|std::array|std::span::iterator}1' to preserve bounds information%select{|, and change %2 to '%select{std::span|std::array|std::span::iterator}1' to propagate bounds information between them}3">; +def note_unsafe_buffer_variable_fixit_together : Note< + "change type of %0 to '%select{std::span|std::array|std::span::iterator}1' to preserve bounds information" + "%select{|, and change %2 to safe types to make function %4 bounds-safe}3">; def note_safe_buffer_usage_suggestions_disabled : Note< "pass -fsafe-buffer-usage-suggestions to receive code hardening suggestions">; -def err_loongarch_builtin_requires_la32 : Error< - "this builtin requires target: loongarch32">; +#ifndef NDEBUG +// Not a user-facing diagnostic. Useful for debugging false negatives in +// -fsafe-buffer-usage-suggestions (i.e. lack of -Wunsafe-buffer-usage fixits). +def note_safe_buffer_debug_mode : Note<"safe buffers debug: %0">; +#endif def err_builtin_pass_in_regs_non_class : Error< "argument %0 is not an unqualified class type">; diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSerializationKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSerializationKinds.td index 5197aa16c4ae..3cb2cd32cf6d 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSerializationKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSerializationKinds.td @@ -62,7 +62,7 @@ def err_ast_file_out_of_date : Error< "%select{PCH|module|AST}0 file '%1' is out of date and " "needs to be rebuilt%select{|: %3}2">, DefaultFatal; def err_ast_file_invalid : Error< - "file '%1' is not a valid precompiled %select{PCH|module|AST}0 file">, DefaultFatal; + "file '%1' is not a valid precompiled %select{PCH|module|AST}0 file: %2">, DefaultFatal; def note_module_file_imported_by : Note< "imported by %select{|module '%2' in }1'%0'">; def err_module_file_not_module : Error< @@ -129,11 +129,6 @@ def warn_module_system_bit_conflict : Warning< "as a non-system module; any difference in diagnostic options will be ignored">, InGroup; -def warn_eagerly_load_for_standard_cplusplus_modules : Warning< - "the form '-fmodule-file=' is deprecated for standard C++ named modules;" - "consider to use '-fmodule-file==' instead">, - InGroup>; - def warn_reading_std_cxx_module_by_implicit_paths : Warning< "it is deprecated to read module '%0' implicitly; it is going to be removed in clang 18; " "consider to specify the dependencies explicitly">, diff --git a/contrib/llvm-project/clang/include/clang/Basic/DirectoryEntry.h b/contrib/llvm-project/clang/include/clang/Basic/DirectoryEntry.h index 5d083e68facd..906c2e9af23b 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DirectoryEntry.h +++ b/contrib/llvm-project/clang/include/clang/Basic/DirectoryEntry.h @@ -245,78 +245,4 @@ template <> struct DenseMapInfo { } // end namespace llvm -namespace clang { - -/// Wrapper around OptionalDirectoryEntryRef that degrades to 'const -/// DirectoryEntry*', facilitating incremental patches to propagate -/// DirectoryEntryRef. -/// -/// This class can be used as return value or field where it's convenient for -/// an OptionalDirectoryEntryRef to degrade to a 'const DirectoryEntry*'. The -/// purpose is to avoid code churn due to dances like the following: -/// \code -/// // Old code. -/// lvalue = rvalue; -/// -/// // Temporary code from an incremental patch. -/// OptionalDirectoryEntryRef MaybeF = rvalue; -/// lvalue = MaybeF ? &MaybeF.getDirectoryEntry() : nullptr; -/// -/// // Final code. -/// lvalue = rvalue; -/// \endcode -/// -/// FIXME: Once DirectoryEntryRef is "everywhere" and DirectoryEntry::LastRef -/// and DirectoryEntry::getName have been deleted, delete this class and -/// replace instances with OptionalDirectoryEntryRef. -class OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr - : public OptionalDirectoryEntryRef { -public: - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr() = default; - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr( - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &&) = default; - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr( - const OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &) = default; - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & - operator=(OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &&) = default; - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & - operator=(const OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &) = default; - - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr(std::nullopt_t) {} - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr(DirectoryEntryRef Ref) - : OptionalDirectoryEntryRef(Ref) {} - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr( - OptionalDirectoryEntryRef MaybeRef) - : OptionalDirectoryEntryRef(MaybeRef) {} - - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & - operator=(std::nullopt_t) { - OptionalDirectoryEntryRef::operator=(std::nullopt); - return *this; - } - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr &operator=(DirectoryEntryRef Ref) { - OptionalDirectoryEntryRef::operator=(Ref); - return *this; - } - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr & - operator=(OptionalDirectoryEntryRef MaybeRef) { - OptionalDirectoryEntryRef::operator=(MaybeRef); - return *this; - } - - /// Degrade to 'const DirectoryEntry *' to allow DirectoryEntry::LastRef and - /// DirectoryEntry::getName have been deleted, delete this class and replace - /// instances with OptionalDirectoryEntryRef - operator const DirectoryEntry *() const { - return has_value() ? &(*this)->getDirEntry() : nullptr; - } -}; - -static_assert(std::is_trivially_copyable< - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr>::value, - "OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr should be " - "trivially copyable"); - -} // end namespace clang - #endif // LLVM_CLANG_BASIC_DIRECTORYENTRY_H diff --git a/contrib/llvm-project/clang/include/clang/Basic/FPOptions.def b/contrib/llvm-project/clang/include/clang/Basic/FPOptions.def index 4517be6f178d..79f04c89c9fe 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/FPOptions.def +++ b/contrib/llvm-project/clang/include/clang/Basic/FPOptions.def @@ -26,5 +26,7 @@ OPTION(AllowReciprocal, bool, 1, NoSignedZero) OPTION(AllowApproxFunc, bool, 1, AllowReciprocal) OPTION(FPEvalMethod, LangOptions::FPEvalMethodKind, 2, AllowApproxFunc) OPTION(Float16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, FPEvalMethod) -OPTION(BFloat16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, FPEvalMethod) +OPTION(BFloat16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, Float16ExcessPrecision) +OPTION(MathErrno, bool, 1, BFloat16ExcessPrecision) +OPTION(ComplexRange, LangOptions::ComplexRangeKind, 2, MathErrno) #undef OPTION diff --git a/contrib/llvm-project/clang/include/clang/Basic/Features.def b/contrib/llvm-project/clang/include/clang/Basic/Features.def index e05ac4625827..06efac0cf1ab 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Features.def +++ b/contrib/llvm-project/clang/include/clang/Basic/Features.def @@ -89,6 +89,8 @@ FEATURE(blocks, LangOpts.Blocks) FEATURE(c_thread_safety_attributes, true) FEATURE(cxx_exceptions, LangOpts.CXXExceptions) FEATURE(cxx_rtti, LangOpts.RTTI &&LangOpts.RTTIData) +EXTENSION(define_target_os_macros, + PP.getPreprocessorOpts().DefineTargetOSMacros) FEATURE(enumerator_attributes, true) FEATURE(nullability, true) FEATURE(nullability_on_arrays, true) @@ -102,6 +104,7 @@ FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo)) FEATURE(swiftasynccc, PP.getTargetInfo().checkCallingConvention(CC_SwiftAsync) == clang::TargetInfo::CCCR_OK) +FEATURE(pragma_stdc_cx_limited_range, true) // Objective-C features FEATURE(objc_arr, LangOpts.ObjCAutoRefCount) // FIXME: REMOVE? FEATURE(objc_arc, LangOpts.ObjCAutoRefCount) @@ -245,7 +248,7 @@ EXTENSION(c_generic_selections, true) EXTENSION(c_generic_selection_with_controlling_type, true) EXTENSION(c_static_assert, true) EXTENSION(c_thread_local, PP.getTargetInfo().isTLSSupported()) -// C2x features supported by other languages as extensions +// C23 features supported by other languages as extensions EXTENSION(c_attributes, true) // C++11 features supported by other languages as extensions. EXTENSION(cxx_atomic, LangOpts.CPlusPlus) @@ -277,11 +280,13 @@ EXTENSION(gnu_asm_goto_with_outputs_full, LangOpts.GNUAsm) EXTENSION(matrix_types, LangOpts.MatrixTypes) EXTENSION(matrix_types_scalar_division, true) EXTENSION(cxx_attributes_on_using_declarations, LangOpts.CPlusPlus11) +EXTENSION(datasizeof, LangOpts.CPlusPlus) FEATURE(cxx_abi_relative_vtable, LangOpts.CPlusPlus && LangOpts.RelativeCXXABIVTables) // CUDA/HIP Features FEATURE(cuda_noinline_keyword, LangOpts.CUDA) +EXTENSION(cuda_implicit_host_device_templates, LangOpts.CUDA && LangOpts.OffloadImplicitHostDeviceTemplates) #undef EXTENSION #undef FEATURE diff --git a/contrib/llvm-project/clang/include/clang/Basic/FileEntry.h b/contrib/llvm-project/clang/include/clang/Basic/FileEntry.h index 50110b8572ef..35efa147950f 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/FileEntry.h +++ b/contrib/llvm-project/clang/include/clang/Basic/FileEntry.h @@ -235,20 +235,6 @@ static_assert(std::is_trivially_copyable::value, namespace llvm { -template <> struct PointerLikeTypeTraits { - static inline void *getAsVoidPointer(clang::FileEntryRef File) { - return const_cast(&File.getMapEntry()); - } - - static inline clang::FileEntryRef getFromVoidPointer(void *Ptr) { - return clang::FileEntryRef( - *reinterpret_cast(Ptr)); - } - - static constexpr int NumLowBitsAvailable = PointerLikeTypeTraits< - const clang::FileEntryRef::MapEntry *>::NumLowBitsAvailable; -}; - /// Specialisation of DenseMapInfo for FileEntryRef. template <> struct DenseMapInfo { static inline clang::FileEntryRef getEmptyKey() { @@ -275,78 +261,24 @@ template <> struct DenseMapInfo { // It's safe to use operator==. return LHS == RHS; } + + /// Support for finding `const FileEntry *` in a `DenseMap`. + /// @{ + static unsigned getHashValue(const clang::FileEntry *Val) { + return llvm::hash_value(Val); + } + static bool isEqual(const clang::FileEntry *LHS, clang::FileEntryRef RHS) { + if (RHS.isSpecialDenseMapKey()) + return false; + return LHS == RHS; + } + /// @} }; } // end namespace llvm namespace clang { -/// Wrapper around OptionalFileEntryRef that degrades to 'const FileEntry*', -/// facilitating incremental patches to propagate FileEntryRef. -/// -/// This class can be used as return value or field where it's convenient for -/// an OptionalFileEntryRef to degrade to a 'const FileEntry*'. The purpose -/// is to avoid code churn due to dances like the following: -/// \code -/// // Old code. -/// lvalue = rvalue; -/// -/// // Temporary code from an incremental patch. -/// OptionalFileEntryRef MaybeF = rvalue; -/// lvalue = MaybeF ? &MaybeF.getFileEntry() : nullptr; -/// -/// // Final code. -/// lvalue = rvalue; -/// \endcode -/// -/// FIXME: Once FileEntryRef is "everywhere" and FileEntry::LastRef and -/// FileEntry::getName have been deleted, delete this class and replace -/// instances with OptionalFileEntryRef. -class OptionalFileEntryRefDegradesToFileEntryPtr : public OptionalFileEntryRef { -public: - OptionalFileEntryRefDegradesToFileEntryPtr() = default; - OptionalFileEntryRefDegradesToFileEntryPtr( - OptionalFileEntryRefDegradesToFileEntryPtr &&) = default; - OptionalFileEntryRefDegradesToFileEntryPtr( - const OptionalFileEntryRefDegradesToFileEntryPtr &) = default; - OptionalFileEntryRefDegradesToFileEntryPtr & - operator=(OptionalFileEntryRefDegradesToFileEntryPtr &&) = default; - OptionalFileEntryRefDegradesToFileEntryPtr & - operator=(const OptionalFileEntryRefDegradesToFileEntryPtr &) = default; - - OptionalFileEntryRefDegradesToFileEntryPtr(std::nullopt_t) {} - OptionalFileEntryRefDegradesToFileEntryPtr(FileEntryRef Ref) - : OptionalFileEntryRef(Ref) {} - OptionalFileEntryRefDegradesToFileEntryPtr(OptionalFileEntryRef MaybeRef) - : OptionalFileEntryRef(MaybeRef) {} - - OptionalFileEntryRefDegradesToFileEntryPtr &operator=(std::nullopt_t) { - OptionalFileEntryRef::operator=(std::nullopt); - return *this; - } - OptionalFileEntryRefDegradesToFileEntryPtr &operator=(FileEntryRef Ref) { - OptionalFileEntryRef::operator=(Ref); - return *this; - } - OptionalFileEntryRefDegradesToFileEntryPtr & - operator=(OptionalFileEntryRef MaybeRef) { - OptionalFileEntryRef::operator=(MaybeRef); - return *this; - } - - /// Degrade to 'const FileEntry *' to allow FileEntry::LastRef and - /// FileEntry::getName have been deleted, delete this class and replace - /// instances with OptionalFileEntryRef - operator const FileEntry *() const { - return has_value() ? &(*this)->getFileEntry() : nullptr; - } -}; - -static_assert( - std::is_trivially_copyable< - OptionalFileEntryRefDegradesToFileEntryPtr>::value, - "OptionalFileEntryRefDegradesToFileEntryPtr should be trivially copyable"); - inline bool operator==(const FileEntry *LHS, const OptionalFileEntryRef &RHS) { return LHS == (RHS ? &RHS->getFileEntry() : nullptr); } @@ -396,8 +328,8 @@ class FileEntry { public: ~FileEntry(); + LLVM_DEPRECATED("Use FileEntryRef::getName() instead.", "") StringRef getName() const { return LastRef->getName(); } - FileEntryRef getLastRef() const { return *LastRef; } StringRef tryGetRealPathName() const { return RealPathName; } off_t getSize() const { return Size; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/FileManager.h b/contrib/llvm-project/clang/include/clang/Basic/FileManager.h index 502b69c3b41b..56cb093dd8c3 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/FileManager.h +++ b/contrib/llvm-project/clang/include/clang/Basic/FileManager.h @@ -275,7 +275,7 @@ public: /// Open the specified file as a MemoryBuffer, returning a new /// MemoryBuffer if successful, otherwise returning null. llvm::ErrorOr> - getBufferForFile(const FileEntry *Entry, bool isVolatile = false, + getBufferForFile(FileEntryRef Entry, bool isVolatile = false, bool RequiresNullTerminator = true); llvm::ErrorOr> getBufferForFile(StringRef Filename, bool isVolatile = false, @@ -311,9 +311,9 @@ public: bool makeAbsolutePath(SmallVectorImpl &Path) const; /// Produce an array mapping from the unique IDs assigned to each - /// file to the corresponding FileEntry pointer. - void GetUniqueIDMapping( - SmallVectorImpl &UIDToFiles) const; + /// file to the corresponding FileEntryRef. + void + GetUniqueIDMapping(SmallVectorImpl &UIDToFiles) const; /// Retrieve the canonical name for a given directory. /// @@ -327,8 +327,15 @@ public: /// This is a very expensive operation, despite its results being cached, /// and should only be used when the physical layout of the file system is /// required, which is (almost) never. - StringRef getCanonicalName(const FileEntry *File); + StringRef getCanonicalName(FileEntryRef File); +private: + /// Retrieve the canonical name for a given file or directory. + /// + /// The first param is a key in the CanonicalNames array. + StringRef getCanonicalName(const void *Entry, StringRef Name); + +public: void PrintStats() const; }; diff --git a/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h b/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h index f87f76714815..1ac182d4fce2 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h +++ b/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h @@ -19,6 +19,9 @@ #include "clang/Basic/LLVM.h" #include "clang/Basic/TokenKinds.h" #include "llvm/ADT/DenseMapInfo.h" +#include "llvm/ADT/FoldingSet.h" +#include "llvm/ADT/PointerIntPair.h" +#include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" @@ -107,6 +110,7 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo { friend class IdentifierTable; // Front-end token ID or tok::identifier. + LLVM_PREFERRED_TYPE(tok::TokenKind) unsigned TokenID : 9; // ObjC keyword ('protocol' in '@protocol') or builtin (__builtin_inf). @@ -115,58 +119,75 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo { unsigned ObjCOrBuiltinID : ObjCOrBuiltinIDBits; // True if there is a #define for this. + LLVM_PREFERRED_TYPE(bool) unsigned HasMacro : 1; // True if there was a #define for this. + LLVM_PREFERRED_TYPE(bool) unsigned HadMacro : 1; // True if the identifier is a language extension. + LLVM_PREFERRED_TYPE(bool) unsigned IsExtension : 1; // True if the identifier is a keyword in a newer or proposed Standard. + LLVM_PREFERRED_TYPE(bool) unsigned IsFutureCompatKeyword : 1; // True if the identifier is poisoned. + LLVM_PREFERRED_TYPE(bool) unsigned IsPoisoned : 1; // True if the identifier is a C++ operator keyword. + LLVM_PREFERRED_TYPE(bool) unsigned IsCPPOperatorKeyword : 1; // Internal bit set by the member function RecomputeNeedsHandleIdentifier. // See comment about RecomputeNeedsHandleIdentifier for more info. + LLVM_PREFERRED_TYPE(bool) unsigned NeedsHandleIdentifier : 1; // True if the identifier was loaded (at least partially) from an AST file. + LLVM_PREFERRED_TYPE(bool) unsigned IsFromAST : 1; // True if the identifier has changed from the definition // loaded from an AST file. + LLVM_PREFERRED_TYPE(bool) unsigned ChangedAfterLoad : 1; // True if the identifier's frontend information has changed from the // definition loaded from an AST file. + LLVM_PREFERRED_TYPE(bool) unsigned FEChangedAfterLoad : 1; // True if revertTokenIDToIdentifier was called. + LLVM_PREFERRED_TYPE(bool) unsigned RevertedTokenID : 1; // True if there may be additional information about // this identifier stored externally. + LLVM_PREFERRED_TYPE(bool) unsigned OutOfDate : 1; // True if this is the 'import' contextual keyword. + LLVM_PREFERRED_TYPE(bool) unsigned IsModulesImport : 1; // True if this is a mangled OpenMP variant name. + LLVM_PREFERRED_TYPE(bool) unsigned IsMangledOpenMPVariantName : 1; // True if this is a deprecated macro. + LLVM_PREFERRED_TYPE(bool) unsigned IsDeprecatedMacro : 1; // True if this macro is unsafe in headers. + LLVM_PREFERRED_TYPE(bool) unsigned IsRestrictExpansion : 1; // True if this macro is final. + LLVM_PREFERRED_TYPE(bool) unsigned IsFinal : 1; // 22 bits left in a 64-bit word. @@ -490,7 +511,7 @@ public: /// function(<#int x#>); /// \endcode bool isEditorPlaceholder() const { - return getName().startswith("<#") && getName().endswith("#>"); + return getName().starts_with("<#") && getName().ends_with("#>"); } /// Determine whether \p this is a name reserved for the implementation (C99 @@ -504,6 +525,9 @@ public: /// If the identifier is an "uglified" reserved name, return a cleaned form. /// e.g. _Foo => Foo. Otherwise, just returns the name. StringRef deuglifiedName() const; + bool isPlaceholder() const { + return getLength() == 1 && getNameStart()[0] == '_'; + } /// Provide less than operator for lexicographical sorting. bool operator<(const IdentifierInfo &RHS) const { @@ -791,6 +815,121 @@ enum ObjCStringFormatFamily { SFF_CFString }; +namespace detail { + +/// DeclarationNameExtra is used as a base of various uncommon special names. +/// This class is needed since DeclarationName has not enough space to store +/// the kind of every possible names. Therefore the kind of common names is +/// stored directly in DeclarationName, and the kind of uncommon names is +/// stored in DeclarationNameExtra. It is aligned to 8 bytes because +/// DeclarationName needs the lower 3 bits to store the kind of common names. +/// DeclarationNameExtra is tightly coupled to DeclarationName and any change +/// here is very likely to require changes in DeclarationName(Table). +class alignas(IdentifierInfoAlignment) DeclarationNameExtra { + friend class clang::DeclarationName; + friend class clang::DeclarationNameTable; + +protected: + /// The kind of "extra" information stored in the DeclarationName. See + /// @c ExtraKindOrNumArgs for an explanation of how these enumerator values + /// are used. Note that DeclarationName depends on the numerical values + /// of the enumerators in this enum. See DeclarationName::StoredNameKind + /// for more info. + enum ExtraKind { + CXXDeductionGuideName, + CXXLiteralOperatorName, + CXXUsingDirective, + ObjCMultiArgSelector + }; + + /// ExtraKindOrNumArgs has one of the following meaning: + /// * The kind of an uncommon C++ special name. This DeclarationNameExtra + /// is in this case in fact either a CXXDeductionGuideNameExtra or + /// a CXXLiteralOperatorIdName. + /// + /// * It may be also name common to C++ using-directives (CXXUsingDirective), + /// + /// * Otherwise it is ObjCMultiArgSelector+NumArgs, where NumArgs is + /// the number of arguments in the Objective-C selector, in which + /// case the DeclarationNameExtra is also a MultiKeywordSelector. + unsigned ExtraKindOrNumArgs; + + DeclarationNameExtra(ExtraKind Kind) : ExtraKindOrNumArgs(Kind) {} + DeclarationNameExtra(unsigned NumArgs) + : ExtraKindOrNumArgs(ObjCMultiArgSelector + NumArgs) {} + + /// Return the corresponding ExtraKind. + ExtraKind getKind() const { + return static_cast(ExtraKindOrNumArgs > + (unsigned)ObjCMultiArgSelector + ? (unsigned)ObjCMultiArgSelector + : ExtraKindOrNumArgs); + } + + /// Return the number of arguments in an ObjC selector. Only valid when this + /// is indeed an ObjCMultiArgSelector. + unsigned getNumArgs() const { + assert(ExtraKindOrNumArgs >= (unsigned)ObjCMultiArgSelector && + "getNumArgs called but this is not an ObjC selector!"); + return ExtraKindOrNumArgs - (unsigned)ObjCMultiArgSelector; + } +}; + +} // namespace detail + +/// One of these variable length records is kept for each +/// selector containing more than one keyword. We use a folding set +/// to unique aggregate names (keyword selectors in ObjC parlance). Access to +/// this class is provided strictly through Selector. +class alignas(IdentifierInfoAlignment) MultiKeywordSelector + : public detail::DeclarationNameExtra, + public llvm::FoldingSetNode { + MultiKeywordSelector(unsigned nKeys) : DeclarationNameExtra(nKeys) {} + +public: + // Constructor for keyword selectors. + MultiKeywordSelector(unsigned nKeys, IdentifierInfo **IIV) + : DeclarationNameExtra(nKeys) { + assert((nKeys > 1) && "not a multi-keyword selector"); + + // Fill in the trailing keyword array. + IdentifierInfo **KeyInfo = reinterpret_cast(this + 1); + for (unsigned i = 0; i != nKeys; ++i) + KeyInfo[i] = IIV[i]; + } + + // getName - Derive the full selector name and return it. + std::string getName() const; + + using DeclarationNameExtra::getNumArgs; + + using keyword_iterator = IdentifierInfo *const *; + + keyword_iterator keyword_begin() const { + return reinterpret_cast(this + 1); + } + + keyword_iterator keyword_end() const { + return keyword_begin() + getNumArgs(); + } + + IdentifierInfo *getIdentifierInfoForSlot(unsigned i) const { + assert(i < getNumArgs() && "getIdentifierInfoForSlot(): illegal index"); + return keyword_begin()[i]; + } + + static void Profile(llvm::FoldingSetNodeID &ID, keyword_iterator ArgTys, + unsigned NumArgs) { + ID.AddInteger(NumArgs); + for (unsigned i = 0; i != NumArgs; ++i) + ID.AddPointer(ArgTys[i]); + } + + void Profile(llvm::FoldingSetNodeID &ID) { + Profile(ID, keyword_begin(), getNumArgs()); + } +}; + /// Smart pointer class that efficiently represents Objective-C method /// names. /// @@ -806,43 +945,58 @@ class Selector { enum IdentifierInfoFlag { // Empty selector = 0. Note that these enumeration values must // correspond to the enumeration values of DeclarationName::StoredNameKind - ZeroArg = 0x01, - OneArg = 0x02, + ZeroArg = 0x01, + OneArg = 0x02, + // IMPORTANT NOTE: see comments in InfoPtr (below) about this enumerator + // value. MultiArg = 0x07, - ArgFlags = 0x07 }; - /// A pointer to the MultiKeywordSelector or IdentifierInfo. We use the low - /// three bits of InfoPtr to store an IdentifierInfoFlag. Note that in any - /// case IdentifierInfo and MultiKeywordSelector are already aligned to - /// 8 bytes even on 32 bits archs because of DeclarationName. - uintptr_t InfoPtr = 0; + /// IMPORTANT NOTE: the order of the types in this PointerUnion are + /// important! The DeclarationName class has bidirectional conversion + /// to/from Selector through an opaque pointer (void *) which corresponds + /// to this PointerIntPair. The discriminator bit from the PointerUnion + /// corresponds to the high bit in the MultiArg enumerator. So while this + /// PointerIntPair only has two bits for the integer (and we mask off the + /// high bit in `MultiArg` when it is used), that discrimator bit is + /// still necessary for the opaque conversion. The discriminator bit + /// from the PointerUnion and the two integer bits from the + /// PointerIntPair are also exposed via the DeclarationName::StoredNameKind + /// enumeration; see the comments in DeclarationName.h for more details. + /// Do not reorder or add any arguments to this template + /// without thoroughly understanding how tightly coupled these classes are. + llvm::PointerIntPair< + llvm::PointerUnion, 2> + InfoPtr; Selector(IdentifierInfo *II, unsigned nArgs) { - InfoPtr = reinterpret_cast(II); - assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo"); assert(nArgs < 2 && "nArgs not equal to 0/1"); - InfoPtr |= nArgs+1; + InfoPtr.setPointerAndInt(II, nArgs + 1); } Selector(MultiKeywordSelector *SI) { - InfoPtr = reinterpret_cast(SI); - assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo"); - InfoPtr |= MultiArg; + // IMPORTANT NOTE: we mask off the upper bit of this value because we only + // reserve two bits for the integer in the PointerIntPair. See the comments + // in `InfoPtr` for more details. + InfoPtr.setPointerAndInt(SI, MultiArg & 0b11); } IdentifierInfo *getAsIdentifierInfo() const { - if (getIdentifierInfoFlag() < MultiArg) - return reinterpret_cast(InfoPtr & ~ArgFlags); - return nullptr; + return InfoPtr.getPointer().dyn_cast(); } MultiKeywordSelector *getMultiKeywordSelector() const { - return reinterpret_cast(InfoPtr & ~ArgFlags); + return InfoPtr.getPointer().get(); } unsigned getIdentifierInfoFlag() const { - return InfoPtr & ArgFlags; + unsigned new_flags = InfoPtr.getInt(); + // IMPORTANT NOTE: We have to reconstitute this data rather than use the + // value directly from the PointerIntPair. See the comments in `InfoPtr` + // for more details. + if (InfoPtr.getPointer().is()) + new_flags |= MultiArg; + return new_flags; } static ObjCMethodFamily getMethodFamilyImpl(Selector sel); @@ -853,31 +1007,27 @@ public: /// The default ctor should only be used when creating data structures that /// will contain selectors. Selector() = default; - explicit Selector(uintptr_t V) : InfoPtr(V) {} + explicit Selector(uintptr_t V) { + InfoPtr.setFromOpaqueValue(reinterpret_cast(V)); + } /// operator==/!= - Indicate whether the specified selectors are identical. bool operator==(Selector RHS) const { - return InfoPtr == RHS.InfoPtr; + return InfoPtr.getOpaqueValue() == RHS.InfoPtr.getOpaqueValue(); } bool operator!=(Selector RHS) const { - return InfoPtr != RHS.InfoPtr; + return InfoPtr.getOpaqueValue() != RHS.InfoPtr.getOpaqueValue(); } - void *getAsOpaquePtr() const { - return reinterpret_cast(InfoPtr); - } + void *getAsOpaquePtr() const { return InfoPtr.getOpaqueValue(); } /// Determine whether this is the empty selector. - bool isNull() const { return InfoPtr == 0; } + bool isNull() const { return InfoPtr.getOpaqueValue() == nullptr; } // Predicates to identify the selector type. - bool isKeywordSelector() const { - return getIdentifierInfoFlag() != ZeroArg; - } + bool isKeywordSelector() const { return InfoPtr.getInt() != ZeroArg; } - bool isUnarySelector() const { - return getIdentifierInfoFlag() == ZeroArg; - } + bool isUnarySelector() const { return InfoPtr.getInt() == ZeroArg; } /// If this selector is the specific keyword selector described by Names. bool isKeywordSelector(ArrayRef Names) const; @@ -988,68 +1138,6 @@ public: static std::string getPropertyNameFromSetterSelector(Selector Sel); }; -namespace detail { - -/// DeclarationNameExtra is used as a base of various uncommon special names. -/// This class is needed since DeclarationName has not enough space to store -/// the kind of every possible names. Therefore the kind of common names is -/// stored directly in DeclarationName, and the kind of uncommon names is -/// stored in DeclarationNameExtra. It is aligned to 8 bytes because -/// DeclarationName needs the lower 3 bits to store the kind of common names. -/// DeclarationNameExtra is tightly coupled to DeclarationName and any change -/// here is very likely to require changes in DeclarationName(Table). -class alignas(IdentifierInfoAlignment) DeclarationNameExtra { - friend class clang::DeclarationName; - friend class clang::DeclarationNameTable; - -protected: - /// The kind of "extra" information stored in the DeclarationName. See - /// @c ExtraKindOrNumArgs for an explanation of how these enumerator values - /// are used. Note that DeclarationName depends on the numerical values - /// of the enumerators in this enum. See DeclarationName::StoredNameKind - /// for more info. - enum ExtraKind { - CXXDeductionGuideName, - CXXLiteralOperatorName, - CXXUsingDirective, - ObjCMultiArgSelector - }; - - /// ExtraKindOrNumArgs has one of the following meaning: - /// * The kind of an uncommon C++ special name. This DeclarationNameExtra - /// is in this case in fact either a CXXDeductionGuideNameExtra or - /// a CXXLiteralOperatorIdName. - /// - /// * It may be also name common to C++ using-directives (CXXUsingDirective), - /// - /// * Otherwise it is ObjCMultiArgSelector+NumArgs, where NumArgs is - /// the number of arguments in the Objective-C selector, in which - /// case the DeclarationNameExtra is also a MultiKeywordSelector. - unsigned ExtraKindOrNumArgs; - - DeclarationNameExtra(ExtraKind Kind) : ExtraKindOrNumArgs(Kind) {} - DeclarationNameExtra(unsigned NumArgs) - : ExtraKindOrNumArgs(ObjCMultiArgSelector + NumArgs) {} - - /// Return the corresponding ExtraKind. - ExtraKind getKind() const { - return static_cast(ExtraKindOrNumArgs > - (unsigned)ObjCMultiArgSelector - ? (unsigned)ObjCMultiArgSelector - : ExtraKindOrNumArgs); - } - - /// Return the number of arguments in an ObjC selector. Only valid when this - /// is indeed an ObjCMultiArgSelector. - unsigned getNumArgs() const { - assert(ExtraKindOrNumArgs >= (unsigned)ObjCMultiArgSelector && - "getNumArgs called but this is not an ObjC selector!"); - return ExtraKindOrNumArgs - (unsigned)ObjCMultiArgSelector; - } -}; - -} // namespace detail - } // namespace clang namespace llvm { @@ -1086,34 +1174,6 @@ struct PointerLikeTypeTraits { static constexpr int NumLowBitsAvailable = 0; }; -// Provide PointerLikeTypeTraits for IdentifierInfo pointers, which -// are not guaranteed to be 8-byte aligned. -template<> -struct PointerLikeTypeTraits { - static void *getAsVoidPointer(clang::IdentifierInfo* P) { - return P; - } - - static clang::IdentifierInfo *getFromVoidPointer(void *P) { - return static_cast(P); - } - - static constexpr int NumLowBitsAvailable = 1; -}; - -template<> -struct PointerLikeTypeTraits { - static const void *getAsVoidPointer(const clang::IdentifierInfo* P) { - return P; - } - - static const clang::IdentifierInfo *getFromVoidPointer(const void *P) { - return static_cast(P); - } - - static constexpr int NumLowBitsAvailable = 1; -}; - } // namespace llvm #endif // LLVM_CLANG_BASIC_IDENTIFIERTABLE_H diff --git a/contrib/llvm-project/clang/include/clang/Basic/JsonSupport.h b/contrib/llvm-project/clang/include/clang/Basic/JsonSupport.h index 37f66ab63eb1..bcaa3d364444 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/JsonSupport.h +++ b/contrib/llvm-project/clang/include/clang/Basic/JsonSupport.h @@ -71,7 +71,7 @@ inline std::string JsonFormat(StringRef RawSR, bool AddQuotes) { } // Remove new-lines. - llvm::erase_value(Str, '\n'); + llvm::erase(Str, '\n'); if (!AddQuotes) return Str; diff --git a/contrib/llvm-project/clang/include/clang/Basic/LangOptions.def b/contrib/llvm-project/clang/include/clang/Basic/LangOptions.def index f7ec0406f33e..152d9f65f86d 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/LangOptions.def +++ b/contrib/llvm-project/clang/include/clang/Basic/LangOptions.def @@ -86,7 +86,7 @@ LANGOPT(C99 , 1, 0, "C99") LANGOPT(C11 , 1, 0, "C11") LANGOPT(C17 , 1, 0, "C17") -LANGOPT(C2x , 1, 0, "C2x") +LANGOPT(C23 , 1, 0, "C23") LANGOPT(MSVCCompat , 1, 0, "Microsoft Visual C++ full compatibility mode") LANGOPT(Kernel , 1, 0, "Kernel mode") LANGOPT(MicrosoftExt , 1, 0, "Microsoft C++ extensions") @@ -145,6 +145,7 @@ ENUM_LANGOPT(ExceptionHandling, ExceptionHandlingKind, 3, ExceptionHandlingKind::None, "exception handling") LANGOPT(IgnoreExceptions , 1, 0, "ignore exceptions") LANGOPT(ExternCNoUnwind , 1, 0, "Assume extern C functions don't unwind") +LANGOPT(AssumeNothrowExceptionDtor , 1, 0, "Assume exception object's destructor is nothrow") LANGOPT(TraditionalCPP , 1, 0, "traditional CPP emulation") LANGOPT(RTTI , 1, 1, "run-time type information") LANGOPT(RTTIData , 1, 1, "emit run-time type information data") @@ -173,6 +174,7 @@ LANGOPT(MathErrno , 1, 1, "errno in math functions") BENIGN_LANGOPT(HeinousExtensions , 1, 0, "extensions that we really don't like and may be ripped out at any time") LANGOPT(Modules , 1, 0, "modules semantics") COMPATIBLE_LANGOPT(CPlusPlusModules, 1, 0, "C++ modules syntax") +LANGOPT(BuiltinHeadersInSystemModules, 1, 0, "builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers") BENIGN_ENUM_LANGOPT(CompilingModule, CompilingModuleKind, 3, CMK_None, "compiling a module interface") BENIGN_LANGOPT(CompilingPCH, 1, 0, "building a pch") @@ -218,6 +220,8 @@ BENIGN_LANGOPT(NoSignedZero , 1, 0, "Permit Floating Point optimization wit BENIGN_LANGOPT(AllowRecip , 1, 0, "Permit Floating Point reciprocal") BENIGN_LANGOPT(ApproxFunc , 1, 0, "Permit Floating Point approximation") +ENUM_LANGOPT(ComplexRange, ComplexRangeKind, 2, CX_Full, "Enable use of range reduction for complex arithmetics.") + BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars") BENIGN_LANGOPT(AccessControl , 1, 1, "C++ access control") @@ -265,8 +269,9 @@ ENUM_LANGOPT(HLSLVersion, HLSLLangStd, 16, HLSL_Unset, "HLSL Version") LANGOPT(CUDAIsDevice , 1, 0, "compiling for CUDA device") LANGOPT(CUDAAllowVariadicFunctions, 1, 0, "allowing variadic functions in CUDA device code") LANGOPT(CUDAHostDeviceConstexpr, 1, 1, "treating unattributed constexpr functions as __host__ __device__") -LANGOPT(CUDADeviceApproxTranscendentals, 1, 0, "using approximate transcendental functions") +LANGOPT(GPUDeviceApproxTranscendentals, 1, 0, "using approximate transcendental functions") LANGOPT(GPURelocatableDeviceCode, 1, 0, "generate relocatable device code") +LANGOPT(OffloadImplicitHostDeviceTemplates, 1, 0, "assume template functions to be implicitly host device by default for CUDA/HIP") LANGOPT(GPUAllowDeviceInit, 1, 0, "allowing device side global init functions for HIP") LANGOPT(GPUMaxThreadsPerBlock, 32, 1024, "default max threads per block for kernel launch bounds for HIP") LANGOPT(GPUDeferDiag, 1, 0, "defer host/device related diagnostic messages for CUDA/HIP") @@ -278,6 +283,11 @@ LANGOPT(SYCLIsHost , 1, 0, "SYCL host compilation") ENUM_LANGOPT(SYCLVersion , SYCLMajorVersion, 2, SYCL_None, "Version of the SYCL standard used") LANGOPT(HIPUseNewLaunchAPI, 1, 0, "Use new kernel launching API for HIP") +LANGOPT(OffloadUniformBlock, 1, 0, "Assume that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)") +LANGOPT(HIPStdPar, 1, 0, "Enable Standard Parallel Algorithm Acceleration for HIP (experimental)") +LANGOPT(HIPStdParInterposeAlloc, 1, 0, "Replace allocations / deallocations with HIP RT calls when Standard Parallel Algorithm Acceleration for HIP is enabled (Experimental)") + +LANGOPT(OpenACC , 1, 0, "OpenACC Enabled") LANGOPT(SizedDeallocation , 1, 0, "sized deallocation") LANGOPT(AlignedAllocation , 1, 0, "aligned allocation") @@ -343,9 +353,9 @@ LANGOPT( "type's inheritance model would be determined under the Microsoft ABI") ENUM_LANGOPT(GC, GCMode, 2, NonGC, "Objective-C Garbage Collection mode") -ENUM_LANGOPT(ValueVisibilityMode, Visibility, 3, DefaultVisibility, +BENIGN_ENUM_LANGOPT(ValueVisibilityMode, Visibility, 3, DefaultVisibility, "default visibility for functions and variables [-fvisibility]") -ENUM_LANGOPT(TypeVisibilityMode, Visibility, 3, DefaultVisibility, +BENIGN_ENUM_LANGOPT(TypeVisibilityMode, Visibility, 3, DefaultVisibility, "default visibility for types [-ftype-visibility]") LANGOPT(SetVisibilityForExternDecls, 1, 0, "apply global symbol visibility to external declarations without an explicit visibility") @@ -396,6 +406,9 @@ LANGOPT(XLPragmaPack, 1, 0, "IBM XL #pragma pack handling") LANGOPT(RetainCommentsFromSystemHeaders, 1, 0, "retain documentation comments from system headers in the AST") +LANGOPT(APINotes, 1, 0, "use external API notes") +LANGOPT(APINotesModules, 1, 0, "use module-based external API notes") + LANGOPT(SanitizeAddressFieldPadding, 2, 0, "controls how aggressive is ASan " "field padding (0: none, 1:least " "aggressive, 2: more aggressive)") @@ -428,6 +441,8 @@ LANGOPT(PaddingOnUnsignedFixedPoint, 1, 0, LANGOPT(RegisterStaticDestructors, 1, 1, "Register C++ static destructors") +LANGOPT(RegCall4, 1, 0, "Set __regcall4 as a default calling convention to respect __regcall ABI v.4") + LANGOPT(MatrixTypes, 1, 0, "Enable or disable the builtin matrix type") ENUM_LANGOPT(StrictFlexArraysLevel, StrictFlexArraysLevelKind, 2, @@ -447,6 +462,9 @@ LANGOPT(SpeculativeLoadHardening, 1, 0, "Speculative load hardening enabled") LANGOPT(RelativeCXXABIVTables, 1, 0, "Use an ABI-incompatible v-table layout that uses relative references") +LANGOPT(OmitVTableRTTI, 1, 0, + "Use an ABI-incompatible v-table layout that omits the RTTI component") + LANGOPT(VScaleMin, 32, 0, "Minimum vscale value") LANGOPT(VScaleMax, 32, 0, "Maximum vscale value") diff --git a/contrib/llvm-project/clang/include/clang/Basic/LangOptions.h b/contrib/llvm-project/clang/include/clang/Basic/LangOptions.h index 3ef68ca8af66..9f986fce2d44 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/LangOptions.h +++ b/contrib/llvm-project/clang/include/clang/Basic/LangOptions.h @@ -34,6 +34,7 @@ namespace clang { /// this large collection of bitfields is a trivial class type. class LangOptionsBase { friend class CompilerInvocation; + friend class CompilerInvocationBase; public: // Define simple language options (with no accessors). @@ -133,7 +134,8 @@ public: DCC_FastCall, DCC_StdCall, DCC_VectorCall, - DCC_RegCall + DCC_RegCall, + DCC_RtdCall }; enum AddrSpaceMapMangling { ASMM_Target, ASMM_On, ASMM_Off }; @@ -150,6 +152,7 @@ public: MSVC2019 = 1920, MSVC2019_5 = 1925, MSVC2019_8 = 1928, + MSVC2022_3 = 1933, }; enum SYCLMajorVersion { @@ -230,6 +233,15 @@ public: /// - consider classes with defaulted special member functions non-pod. Ver15, + /// Attempt to be ABI-compatible with code generated by Clang 17.0.x. + /// This causes clang to revert some fixes to its implementation of the + /// Itanium name mangling scheme, with the consequence that overloaded + /// function templates are mangled the same if they differ only by: + /// - constraints + /// - whether a non-type template parameter has a deduced type + /// - the parameter list of a template template parameter + Ver17, + /// Conform to the underlying platform's C and C++ ABIs as closely /// as we can. Latest @@ -380,6 +392,8 @@ public: IncompleteOnly = 3, }; + enum ComplexRangeKind { CX_Full, CX_Limited, CX_Fortran }; + public: /// The used language standard. LangStandard::Kind LangStd; @@ -491,6 +505,11 @@ public: // received as a result of a standard operator new (-fcheck-new) bool CheckNew = false; + // In OpenACC mode, contains a user provided override for the _OPENACC macro. + // This exists so that we can override the macro value and test our incomplete + // implementation on real-world examples. + std::string OpenACCMacroOverride; + LangOptions(); /// Set language defaults for the given input language and @@ -577,7 +596,7 @@ public: /// Returns true if functions without prototypes or functions with an /// identifier list (aka K&R C functions) are not allowed. bool requiresStrictPrototypes() const { - return CPlusPlus || C2x || DisableKNRFunctions; + return CPlusPlus || C23 || DisableKNRFunctions; } /// Returns true if implicit function declarations are allowed in the current @@ -586,11 +605,14 @@ public: return !requiresStrictPrototypes() && !OpenCL; } + /// Returns true if the language supports calling the 'atexit' function. + bool hasAtExit() const { return !(OpenMP && OpenMPIsTargetDevice); } + /// Returns true if implicit int is part of the language requirements. bool isImplicitIntRequired() const { return !CPlusPlus && !C99; } /// Returns true if implicit int is supported at all. - bool isImplicitIntAllowed() const { return !CPlusPlus && !C2x; } + bool isImplicitIntAllowed() const { return !CPlusPlus && !C23; } /// Check if return address signing is enabled. bool hasSignReturnAddress() const { @@ -721,6 +743,7 @@ public: setAllowFEnvAccess(true); else setAllowFEnvAccess(LangOptions::FPM_Off); + setComplexRange(LO.getComplexRange()); } bool allowFPContractWithinStatement() const { @@ -746,7 +769,7 @@ public: RoundingMode getRoundingMode() const { RoundingMode RM = getConstRoundingMode(); if (RM == RoundingMode::Dynamic) { - // C2x: 7.6.2p3 If the FE_DYNAMIC mode is specified and FENV_ACCESS is + // C23: 7.6.2p3 If the FE_DYNAMIC mode is specified and FENV_ACCESS is // "off", the translator may assume that the default rounding mode is in // effect. if (!getAllowFEnvAccess() && !getRoundingMath()) @@ -854,6 +877,7 @@ public: setNoSignedZeroOverride(!Value); setAllowReciprocalOverride(!Value); setAllowApproxFuncOverride(!Value); + setMathErrnoOverride(Value); if (Value) /* Precise mode implies fp_contract=on and disables ffast-math */ setAllowFPContractWithinStatement(); diff --git a/contrib/llvm-project/clang/include/clang/Basic/LangStandard.h b/contrib/llvm-project/clang/include/clang/Basic/LangStandard.h index fd949bcd6855..bc49669a82ad 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/LangStandard.h +++ b/contrib/llvm-project/clang/include/clang/Basic/LangStandard.h @@ -43,13 +43,14 @@ enum class Language : uint8_t { HLSL, ///@} }; +StringRef languageToString(Language L); enum LangFeatures { LineComment = (1 << 0), C99 = (1 << 1), C11 = (1 << 2), C17 = (1 << 3), - C2x = (1 << 4), + C23 = (1 << 4), CPlusPlus = (1 << 5), CPlusPlus11 = (1 << 6), CPlusPlus14 = (1 << 7), @@ -101,8 +102,8 @@ public: /// isC17 - Language is a superset of C17. bool isC17() const { return Flags & C17; } - /// isC2x - Language is a superset of C2x. - bool isC2x() const { return Flags & C2x; } + /// isC23 - Language is a superset of C23. + bool isC23() const { return Flags & C23; } /// isCPlusPlus - Language is a C++ variant. bool isCPlusPlus() const { return Flags & CPlusPlus; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/LangStandards.def b/contrib/llvm-project/clang/include/clang/Basic/LangStandards.def index 5c28bdd28ef2..b6192e48efc1 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/LangStandards.def +++ b/contrib/llvm-project/clang/include/clang/Basic/LangStandards.def @@ -87,13 +87,17 @@ LANGSTANDARD(gnu17, "gnu17", LineComment | C99 | C11 | C17 | Digraphs | GNUMode | HexFloat) LANGSTANDARD_ALIAS(gnu17, "gnu18") -// C2x modes -LANGSTANDARD(c2x, "c2x", - C, "Working Draft for ISO C2x", - LineComment | C99 | C11 | C17 | C2x | Digraphs | HexFloat) -LANGSTANDARD(gnu2x, "gnu2x", - C, "Working Draft for ISO C2x with GNU extensions", - LineComment | C99 | C11 | C17 | C2x | Digraphs | GNUMode | HexFloat) +// C23 modes +LANGSTANDARD(c23, "c23", + C, "Working Draft for ISO C23", + LineComment | C99 | C11 | C17 | C23 | Digraphs | HexFloat) +LANGSTANDARD_ALIAS_DEPR(c23, "c2x") +LANGSTANDARD(gnu23, "gnu23", + C, "Working Draft for ISO C23 with GNU extensions", + LineComment | C99 | C11 | C17 | C23 | Digraphs | GNUMode | HexFloat) +LANGSTANDARD_ALIAS_DEPR(gnu23, "gnu2x") +// FIXME: Add the alias for iso9899:202* once we know the year ISO publishes +// the document (expected to be 2024). // C++ modes LANGSTANDARD(cxx98, "c++98", diff --git a/contrib/llvm-project/clang/include/clang/Basic/Linkage.h b/contrib/llvm-project/clang/include/clang/Basic/Linkage.h index 0b7b61954a07..fcf56b93b978 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Linkage.h +++ b/contrib/llvm-project/clang/include/clang/Basic/Linkage.h @@ -14,21 +14,25 @@ #ifndef LLVM_CLANG_BASIC_LINKAGE_H #define LLVM_CLANG_BASIC_LINKAGE_H +#include "llvm/Support/ErrorHandling.h" #include namespace clang { /// Describes the different kinds of linkage /// (C++ [basic.link], C99 6.2.2) that an entity may have. -enum Linkage : unsigned char { +enum class Linkage : unsigned char { + // Linkage hasn't been computed. + Invalid = 0, + /// No linkage, which means that the entity is unique and /// can only be referred to from within its scope. - NoLinkage = 0, + None, /// Internal linkage, which indicates that the entity can /// be referred to from within the translation unit (but not other /// translation units). - InternalLinkage, + Internal, /// External linkage within a unique namespace. /// @@ -37,21 +41,21 @@ enum Linkage : unsigned char { /// their names are unique to this translation unit, which is /// equivalent to having internal linkage from the code-generation /// point of view. - UniqueExternalLinkage, + UniqueExternal, /// No linkage according to the standard, but is visible from other /// translation units because of types defined in a inline function. - VisibleNoLinkage, + VisibleNone, /// Module linkage, which indicates that the entity can be referred /// to from other translation units within the same module, and indirectly /// from arbitrary other translation units through inline functions and /// templates in the module interface. - ModuleLinkage, + Module, /// External linkage, which indicates that the entity can /// be referred to from other translation units. - ExternalLinkage + External }; /// Describes the different kinds of language linkage @@ -84,22 +88,34 @@ inline bool isUniqueGVALinkage(GVALinkage L) { } inline bool isExternallyVisible(Linkage L) { - return L >= VisibleNoLinkage; + switch (L) { + case Linkage::Invalid: + llvm_unreachable("Linkage hasn't been computed!"); + case Linkage::None: + case Linkage::Internal: + case Linkage::UniqueExternal: + return false; + case Linkage::VisibleNone: + case Linkage::Module: + case Linkage::External: + return true; + } + llvm_unreachable("Unhandled Linkage enum"); } inline Linkage getFormalLinkage(Linkage L) { switch (L) { - case UniqueExternalLinkage: - return ExternalLinkage; - case VisibleNoLinkage: - return NoLinkage; + case Linkage::UniqueExternal: + return Linkage::External; + case Linkage::VisibleNone: + return Linkage::None; default: return L; } } inline bool isExternalFormalLinkage(Linkage L) { - return getFormalLinkage(L) == ExternalLinkage; + return getFormalLinkage(L) == Linkage::External; } /// Compute the minimum linkage given two linkages. @@ -111,13 +127,13 @@ inline bool isExternalFormalLinkage(Linkage L) { /// special cases for when VisibleNoLinkage would lose the visible bit and /// become NoLinkage. inline Linkage minLinkage(Linkage L1, Linkage L2) { - if (L2 == VisibleNoLinkage) + if (L2 == Linkage::VisibleNone) std::swap(L1, L2); - if (L1 == VisibleNoLinkage) { - if (L2 == InternalLinkage) - return NoLinkage; - if (L2 == UniqueExternalLinkage) - return NoLinkage; + if (L1 == Linkage::VisibleNone) { + if (L2 == Linkage::Internal) + return Linkage::None; + if (L2 == Linkage::UniqueExternal) + return Linkage::None; } return L1 < L2 ? L1 : L2; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/Module.h b/contrib/llvm-project/clang/include/clang/Basic/Module.h index a4ad8ad2f768..62786e3ac865 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Module.h +++ b/contrib/llvm-project/clang/include/clang/Basic/Module.h @@ -35,6 +35,7 @@ #include #include #include +#include #include namespace llvm { @@ -81,6 +82,12 @@ struct ASTFileSignature : std::array { return Sentinel; } + static ASTFileSignature createDummy() { + ASTFileSignature Dummy; + Dummy.fill(0x00); + return Dummy; + } + template static ASTFileSignature create(InputIt First, InputIt Last) { assert(std::distance(First, Last) == size && @@ -149,14 +156,14 @@ public: /// The build directory of this module. This is the directory in /// which the module is notionally built, and relative to which its headers /// are found. - OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr Directory; + OptionalDirectoryEntryRef Directory; /// The presumed file name for the module map defining this module. /// Only non-empty when building from preprocessed source. std::string PresumedModuleMapFile; /// The umbrella header or directory. - llvm::PointerUnion Umbrella; + std::variant Umbrella; /// The module signature. ASTFileSignature Signature; @@ -171,9 +178,11 @@ public: /// eventually be exposed, for use in "private" modules. std::string ExportAsModule; - /// Does this Module scope describe part of the purview of a standard named - /// C++ module? - bool isModulePurview() const { + /// For the debug info, the path to this module's .apinotes file, if any. + std::string APINotesFile; + + /// Does this Module is a named module of a standard named module? + bool isNamedModule() const { switch (Kind) { case ModuleInterfaceUnit: case ModuleImplementationUnit: @@ -291,50 +300,62 @@ public: /// Whether this module has declared itself unimportable, either because /// it's missing a requirement from \p Requirements or because it's been /// shadowed by another module. + LLVM_PREFERRED_TYPE(bool) unsigned IsUnimportable : 1; /// Whether we tried and failed to load a module file for this module. + LLVM_PREFERRED_TYPE(bool) unsigned HasIncompatibleModuleFile : 1; /// Whether this module is available in the current translation unit. /// /// If the module is missing headers or does not meet all requirements then /// this bit will be 0. + LLVM_PREFERRED_TYPE(bool) unsigned IsAvailable : 1; /// Whether this module was loaded from a module file. + LLVM_PREFERRED_TYPE(bool) unsigned IsFromModuleFile : 1; /// Whether this is a framework module. + LLVM_PREFERRED_TYPE(bool) unsigned IsFramework : 1; /// Whether this is an explicit submodule. + LLVM_PREFERRED_TYPE(bool) unsigned IsExplicit : 1; /// Whether this is a "system" module (which assumes that all /// headers in it are system headers). + LLVM_PREFERRED_TYPE(bool) unsigned IsSystem : 1; /// Whether this is an 'extern "C"' module (which implicitly puts all /// headers in it within an 'extern "C"' block, and allows the module to be /// imported within such a block). + LLVM_PREFERRED_TYPE(bool) unsigned IsExternC : 1; /// Whether this is an inferred submodule (module * { ... }). + LLVM_PREFERRED_TYPE(bool) unsigned IsInferred : 1; /// Whether we should infer submodules for this module based on /// the headers. /// /// Submodules can only be inferred for modules with an umbrella header. + LLVM_PREFERRED_TYPE(bool) unsigned InferSubmodules : 1; /// Whether, when inferring submodules, the inferred submodules /// should be explicit. + LLVM_PREFERRED_TYPE(bool) unsigned InferExplicitSubmodules : 1; /// Whether, when inferring submodules, the inferr submodules should /// export all modules they import (e.g., the equivalent of "export *"). + LLVM_PREFERRED_TYPE(bool) unsigned InferExportWildcard : 1; /// Whether the set of configuration macros is exhaustive. @@ -342,16 +363,24 @@ public: /// When the set of configuration macros is exhaustive, meaning /// that no identifier not in this list should affect how the module is /// built. + LLVM_PREFERRED_TYPE(bool) unsigned ConfigMacrosExhaustive : 1; /// Whether files in this module can only include non-modular headers /// and headers from used modules. + LLVM_PREFERRED_TYPE(bool) unsigned NoUndeclaredIncludes : 1; /// Whether this module came from a "private" module map, found next /// to a regular (public) module map. + LLVM_PREFERRED_TYPE(bool) unsigned ModuleMapIsPrivate : 1; + /// Whether this C++20 named modules doesn't need an initializer. + /// This is only meaningful for C++20 modules. + LLVM_PREFERRED_TYPE(bool) + unsigned NamedModuleHasInit : 1; + /// Describes the visibility of the various names within a /// particular module. enum NameVisibilityKind { @@ -581,10 +610,17 @@ public: return Kind == ModuleInterfaceUnit || isModulePartition(); } + /// Is this a C++20 named module unit. + bool isNamedModuleUnit() const { + return isInterfaceOrPartition() || isModuleImplementation(); + } + bool isModuleInterfaceUnit() const { return Kind == ModuleInterfaceUnit || Kind == ModulePartitionInterface; } + bool isNamedModuleInterfaceHasInit() const { return NamedModuleHasInit; } + /// Get the primary module interface name from a partition. StringRef getPrimaryModuleInterfaceName() const { // Technically, global module fragment belongs to global module. And global @@ -636,7 +672,7 @@ public: } /// The serialized AST file for this module, if one was created. - OptionalFileEntryRefDegradesToFileEntryPtr getASTFile() const { + OptionalFileEntryRef getASTFile() const { return getTopLevelModule()->ASTFile; } @@ -648,18 +684,17 @@ public: /// Retrieve the umbrella directory as written. std::optional getUmbrellaDirAsWritten() const { - if (Umbrella && Umbrella.is()) + if (const auto *Dir = std::get_if(&Umbrella)) return DirectoryName{UmbrellaAsWritten, - UmbrellaRelativeToRootModuleDirectory, - Umbrella.get()}; + UmbrellaRelativeToRootModuleDirectory, *Dir}; return std::nullopt; } /// Retrieve the umbrella header as written. std::optional
getUmbrellaHeaderAsWritten() const { - if (Umbrella && Umbrella.is()) + if (const auto *Hdr = std::get_if(&Umbrella)) return Header{UmbrellaAsWritten, UmbrellaRelativeToRootModuleDirectory, - Umbrella.get()}; + *Hdr}; return std::nullopt; } @@ -714,13 +749,13 @@ public: /// one. /// /// \returns The GMF sub-module if found, or NULL otherwise. - Module *getGlobalModuleFragment() { return findSubmodule(""); } + Module *getGlobalModuleFragment() const; /// Get the Private Module Fragment (sub-module) for this module, it there is /// one. /// /// \returns The PMF sub-module if found, or NULL otherwise. - Module *getPrivateModuleFragment() { return findSubmodule(""); } + Module *getPrivateModuleFragment() const; /// Determine whether the specified module would be visible to /// a lookup at the end of this module. diff --git a/contrib/llvm-project/clang/include/clang/Basic/ObjCRuntime.h b/contrib/llvm-project/clang/include/clang/Basic/ObjCRuntime.h index 0f714ed3ad60..500b2462f007 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/ObjCRuntime.h +++ b/contrib/llvm-project/clang/include/clang/Basic/ObjCRuntime.h @@ -482,8 +482,8 @@ public: return llvm::hash_combine(OCR.getKind(), OCR.getVersion()); } - template - friend void addHash(llvm::HashBuilderImpl &HBuilder, + template + friend void addHash(llvm::HashBuilder &HBuilder, const ObjCRuntime &OCR) { HBuilder.add(OCR.getKind(), OCR.getVersion()); } diff --git a/contrib/llvm-project/clang/include/clang/Basic/OpenACCKinds.h b/contrib/llvm-project/clang/include/clang/Basic/OpenACCKinds.h new file mode 100644 index 000000000000..62c0a4c1a9de --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/Basic/OpenACCKinds.h @@ -0,0 +1,74 @@ +//===--- OpenACCKinds.h - OpenACC Enums -------------------------*- C++ -*-===// +// +// 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 +/// Defines some OpenACC-specific enums and functions. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_BASIC_OPENACCKINDS_H +#define LLVM_CLANG_BASIC_OPENACCKINDS_H + +namespace clang { +// Represents the Construct/Directive kind of a pragma directive. Note the +// OpenACC standard is inconsistent between calling these Construct vs +// Directive, but we're calling it a Directive to be consistent with OpenMP. +enum class OpenACCDirectiveKind { + // Compute Constructs. + Parallel, + Serial, + Kernels, + + // Data Environment. "enter data" and "exit data" are also referred to in the + // Executable Directives section, but just as a back reference to the Data + // Environment. + Data, + EnterData, + ExitData, + HostData, + + // Misc. + Loop, + Cache, + + // Combined Constructs. + ParallelLoop, + SerialLoop, + KernelsLoop, + + // Atomic Construct. + Atomic, + + // Declare Directive. + Declare, + + // Executable Directives. "wait" is first referred to here, but ends up being + // in its own section after "routine". + Init, + Shutdown, + Set, + Update, + Wait, + + // Procedure Calls in Compute Regions. + Routine, + + // Invalid. + Invalid, +}; + +enum class OpenACCAtomicKind { + Read, + Write, + Update, + Capture, + Invalid, +}; +} // namespace clang + +#endif // LLVM_CLANG_BASIC_OPENACCKINDS_H diff --git a/contrib/llvm-project/clang/include/clang/Basic/OpenMPKinds.def b/contrib/llvm-project/clang/include/clang/Basic/OpenMPKinds.def index c999b8b9c4ff..f46a92d5ecfd 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/OpenMPKinds.def +++ b/contrib/llvm-project/clang/include/clang/Basic/OpenMPKinds.def @@ -41,6 +41,9 @@ #ifndef OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND #define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) #endif +#ifndef OPENMP_ATOMIC_FAIL_MODIFIER +#define OPENMP_ATOMIC_FAIL_MODIFIER(Name) +#endif #ifndef OPENMP_AT_KIND #define OPENMP_AT_KIND(Name) #endif @@ -131,12 +134,18 @@ OPENMP_DEPEND_KIND(inoutallmemory) OPENMP_LINEAR_KIND(val) OPENMP_LINEAR_KIND(ref) OPENMP_LINEAR_KIND(uval) +OPENMP_LINEAR_KIND(step) // Modifiers for 'atomic_default_mem_order' clause. OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(seq_cst) OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(acq_rel) OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(relaxed) +// Modifiers for atomic 'fail' clause. +OPENMP_ATOMIC_FAIL_MODIFIER(seq_cst) +OPENMP_ATOMIC_FAIL_MODIFIER(acquire) +OPENMP_ATOMIC_FAIL_MODIFIER(relaxed) + // Modifiers for 'at' clause. OPENMP_AT_KIND(compilation) OPENMP_AT_KIND(execution) @@ -225,6 +234,7 @@ OPENMP_DOACROSS_MODIFIER(source_omp_cur_iteration) #undef OPENMP_SCHEDULE_MODIFIER #undef OPENMP_SCHEDULE_KIND #undef OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND +#undef OPENMP_ATOMIC_FAIL_MODIFIER #undef OPENMP_AT_KIND #undef OPENMP_SEVERITY_KIND #undef OPENMP_MAP_KIND diff --git a/contrib/llvm-project/clang/include/clang/Basic/OpenMPKinds.h b/contrib/llvm-project/clang/include/clang/Basic/OpenMPKinds.h index f5fc7a8ce5bb..d127498774c7 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/OpenMPKinds.h +++ b/contrib/llvm-project/clang/include/clang/Basic/OpenMPKinds.h @@ -356,6 +356,18 @@ void getOpenMPCaptureRegions( /// \return true - if the above condition is met for this directive /// otherwise - false. bool isOpenMPCombinedParallelADirective(OpenMPDirectiveKind DKind); + +/// Checks if the specified target directive, combined or not, needs task based +/// thread_limit +/// \param DKind Specified directive. +/// \return true - if the above condition is met for this directive +/// otherwise - false. +bool needsTaskBasedThreadLimit(OpenMPDirectiveKind DKind); + +/// Checks if the parameter to the fail clause in "#pragma atomic compare fail" +/// is restricted only to memory order clauses of "OMPC_acquire", +/// "OMPC_relaxed" and "OMPC_seq_cst". +bool checkFailClauseParameter(OpenMPClauseKind FailClauseParameter); } #endif diff --git a/contrib/llvm-project/clang/include/clang/Basic/ParsedAttrInfo.h b/contrib/llvm-project/clang/include/clang/Basic/ParsedAttrInfo.h index 4444f12de9ce..537d8f3391d5 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/ParsedAttrInfo.h +++ b/contrib/llvm-project/clang/include/clang/Basic/ParsedAttrInfo.h @@ -33,6 +33,7 @@ class TargetInfo; struct ParsedAttrInfo { /// Corresponds to the Kind enum. + LLVM_PREFERRED_TYPE(AttributeCommonInfo::Kind) unsigned AttrKind : 16; /// The number of required arguments of this attribute. unsigned NumArgs : 4; @@ -41,18 +42,25 @@ struct ParsedAttrInfo { /// The number of non-fake arguments specified in the attribute definition. unsigned NumArgMembers : 4; /// True if the parsing does not match the semantic content. + LLVM_PREFERRED_TYPE(bool) unsigned HasCustomParsing : 1; // True if this attribute accepts expression parameter pack expansions. + LLVM_PREFERRED_TYPE(bool) unsigned AcceptsExprPack : 1; /// True if this attribute is only available for certain targets. + LLVM_PREFERRED_TYPE(bool) unsigned IsTargetSpecific : 1; /// True if this attribute applies to types. + LLVM_PREFERRED_TYPE(bool) unsigned IsType : 1; /// True if this attribute applies to statements. + LLVM_PREFERRED_TYPE(bool) unsigned IsStmt : 1; /// True if this attribute has any spellings that are known to gcc. + LLVM_PREFERRED_TYPE(bool) unsigned IsKnownToGCC : 1; /// True if this attribute is supported by #pragma clang attribute. + LLVM_PREFERRED_TYPE(bool) unsigned IsSupportedByPragmaAttribute : 1; /// The syntaxes supported by this attribute and how they're spelled. struct Spelling { @@ -116,6 +124,14 @@ public: /// Check if this attribute is allowed when compiling for the given target. virtual bool existsInTarget(const TargetInfo &Target) const { return true; } + + /// Check if this attribute's spelling is allowed when compiling for the given + /// target. + virtual bool spellingExistsInTarget(const TargetInfo &Target, + const unsigned SpellingListIndex) const { + return true; + } + /// Convert the spelling index of Attr to a semantic spelling enum value. virtual unsigned spellingIndexToSemanticSpelling(const ParsedAttr &Attr) const { diff --git a/contrib/llvm-project/clang/include/clang/Basic/PragmaKinds.h b/contrib/llvm-project/clang/include/clang/Basic/PragmaKinds.h index 176bbc9ac7ca..42f049f7323d 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/PragmaKinds.h +++ b/contrib/llvm-project/clang/include/clang/Basic/PragmaKinds.h @@ -34,6 +34,14 @@ enum PragmaFloatControlKind { PFC_Push, // #pragma float_control(push) PFC_Pop // #pragma float_control(pop) }; + +enum PragmaFPKind { + PFK_Contract, // #pragma clang fp contract + PFK_Reassociate, // #pragma clang fp reassociate + PFK_Reciprocal, // #pragma clang fp reciprocal + PFK_Exceptions, // #pragma clang fp exceptions + PFK_EvalMethod // #pragma clang fp eval_method +}; } #endif diff --git a/contrib/llvm-project/clang/include/clang/Basic/RISCVVTypes.def b/contrib/llvm-project/clang/include/clang/Basic/RISCVVTypes.def index 575bca58b51e..6620de8ad50e 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/RISCVVTypes.def +++ b/contrib/llvm-project/clang/include/clang/Basic/RISCVVTypes.def @@ -12,7 +12,8 @@ // A builtin type that has not been covered by any other #define // Defining this macro covers all the builtins. // -// - RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, IsSigned, IsFP) +// - RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, IsSigned, IsFP, +// IsBF) // A RISC-V V scalable vector. // // - RVV_PREDICATE_TYPE(Name, Id, SingletonId, NumEls) @@ -45,7 +46,8 @@ #endif #ifndef RVV_VECTOR_TYPE -#define RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, IsFP)\ +#define RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, \ + IsFP, IsBF) \ RVV_TYPE(Name, Id, SingletonId) #endif @@ -55,13 +57,20 @@ #endif #ifndef RVV_VECTOR_TYPE_INT -#define RVV_VECTOR_TYPE_INT(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned) \ - RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, false) +#define RVV_VECTOR_TYPE_INT(Name, Id, SingletonId, NumEls, ElBits, NF, \ + IsSigned) \ + RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, false, \ + false) #endif #ifndef RVV_VECTOR_TYPE_FLOAT -#define RVV_VECTOR_TYPE_FLOAT(Name, Id, SingletonId, NumEls, ElBits, NF) \ - RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, false, true) +#define RVV_VECTOR_TYPE_FLOAT(Name, Id, SingletonId, NumEls, ElBits, NF) \ + RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, false, true, false) +#endif + +#ifndef RVV_VECTOR_TYPE_BFLOAT +#define RVV_VECTOR_TYPE_BFLOAT(Name, Id, SingletonId, NumEls, ElBits, NF) \ + RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, false, false, true) #endif //===- Vector types -------------------------------------------------------===// @@ -125,6 +134,19 @@ RVV_VECTOR_TYPE_FLOAT("__rvv_float16m2_t", RvvFloat16m2, RvvFloat16m2Ty, 8, 16, RVV_VECTOR_TYPE_FLOAT("__rvv_float16m4_t", RvvFloat16m4, RvvFloat16m4Ty, 16, 16, 1) RVV_VECTOR_TYPE_FLOAT("__rvv_float16m8_t", RvvFloat16m8, RvvFloat16m8Ty, 32, 16, 1) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4_t", RvvBFloat16mf4, RvvBFloat16mf4Ty, + 1, 16, 1) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2_t", RvvBFloat16mf2, RvvBFloat16mf2Ty, + 2, 16, 1) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1_t", RvvBFloat16m1, RvvBFloat16m1Ty, 4, + 16, 1) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m2_t", RvvBFloat16m2, RvvBFloat16m2Ty, 8, + 16, 1) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m4_t", RvvBFloat16m4, RvvBFloat16m4Ty, 16, + 16, 1) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m8_t", RvvBFloat16m8, RvvBFloat16m8Ty, 32, + 16, 1) + RVV_VECTOR_TYPE_FLOAT("__rvv_float32mf2_t",RvvFloat32mf2,RvvFloat32mf2Ty,1, 32, 1) RVV_VECTOR_TYPE_FLOAT("__rvv_float32m1_t", RvvFloat32m1, RvvFloat32m1Ty, 2, 32, 1) RVV_VECTOR_TYPE_FLOAT("__rvv_float32m2_t", RvvFloat32m2, RvvFloat32m2Ty, 4, 32, 1) @@ -430,6 +452,63 @@ RVV_VECTOR_TYPE_FLOAT("__rvv_float64m2x4_t", RvvFloat64m2x4, RvvFloat64m2x4Ty, 2 RVV_VECTOR_TYPE_FLOAT("__rvv_float64m4x2_t", RvvFloat64m4x2, RvvFloat64m4x2Ty, 4, 64, 2) +//===- BFloat16 tuple types -------------------------------------------------===// +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x2_t", RvvBFloat16mf4x2, RvvBFloat16mf4x2Ty, + 1, 16, 2) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x3_t", RvvBFloat16mf4x3, RvvBFloat16mf4x3Ty, + 1, 16, 3) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x4_t", RvvBFloat16mf4x4, RvvBFloat16mf4x4Ty, + 1, 16, 4) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x5_t", RvvBFloat16mf4x5, RvvBFloat16mf4x5Ty, + 1, 16, 5) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x6_t", RvvBFloat16mf4x6, RvvBFloat16mf4x6Ty, + 1, 16, 6) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x7_t", RvvBFloat16mf4x7, RvvBFloat16mf4x7Ty, + 1, 16, 7) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x8_t", RvvBFloat16mf4x8, RvvBFloat16mf4x8Ty, + 1, 16, 8) + +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x2_t", RvvBFloat16mf2x2, RvvBFloat16mf2x2Ty, + 2, 16, 2) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x3_t", RvvBFloat16mf2x3, RvvBFloat16mf2x3Ty, + 2, 16, 3) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x4_t", RvvBFloat16mf2x4, RvvBFloat16mf2x4Ty, + 2, 16, 4) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x5_t", RvvBFloat16mf2x5, RvvBFloat16mf2x5Ty, + 2, 16, 5) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x6_t", RvvBFloat16mf2x6, RvvBFloat16mf2x6Ty, + 2, 16, 6) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x7_t", RvvBFloat16mf2x7, RvvBFloat16mf2x7Ty, + 2, 16, 7) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x8_t", RvvBFloat16mf2x8, RvvBFloat16mf2x8Ty, + 2, 16, 8) + +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x2_t", RvvBFloat16m1x2, RvvBFloat16m1x2Ty, + 4, 16, 2) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x3_t", RvvBFloat16m1x3, RvvBFloat16m1x3Ty, + 4, 16, 3) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x4_t", RvvBFloat16m1x4, RvvBFloat16m1x4Ty, + 4, 16, 4) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x5_t", RvvBFloat16m1x5, RvvBFloat16m1x5Ty, + 4, 16, 5) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x6_t", RvvBFloat16m1x6, RvvBFloat16m1x6Ty, + 4, 16, 6) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x7_t", RvvBFloat16m1x7, RvvBFloat16m1x7Ty, + 4, 16, 7) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x8_t", RvvBFloat16m1x8, RvvBFloat16m1x8Ty, + 4, 16, 8) + +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m2x2_t", RvvBFloat16m2x2, RvvBFloat16m2x2Ty, + 8, 16, 2) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m2x3_t", RvvBFloat16m2x3, RvvBFloat16m2x3Ty, + 8, 16, 3) +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m2x4_t", RvvBFloat16m2x4, RvvBFloat16m2x4Ty, + 8, 16, 4) + +RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m4x2_t", RvvBFloat16m4x2, RvvBFloat16m4x2Ty, + 16, 16, 2) + +#undef RVV_VECTOR_TYPE_BFLOAT #undef RVV_VECTOR_TYPE_FLOAT #undef RVV_VECTOR_TYPE_INT #undef RVV_VECTOR_TYPE diff --git a/contrib/llvm-project/clang/include/clang/Basic/Sanitizers.h b/contrib/llvm-project/clang/include/clang/Basic/Sanitizers.h index 4659e45c7883..c890242269b3 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Sanitizers.h +++ b/contrib/llvm-project/clang/include/clang/Basic/Sanitizers.h @@ -77,8 +77,8 @@ public: llvm::hash_code hash_value() const; - template - friend void addHash(llvm::HashBuilderImpl &HBuilder, + template + friend void addHash(llvm::HashBuilder &HBuilder, const SanitizerMask &SM) { HBuilder.addRange(&SM.maskLoToHigh[0], &SM.maskLoToHigh[kNumElem]); } @@ -170,6 +170,8 @@ struct SanitizerSet { Mask = Value ? (Mask | K) : (Mask & ~K); } + void set(SanitizerMask K) { Mask = K; } + /// Disable the sanitizers specified in \p K. void clear(SanitizerMask K = SanitizerKind::All) { Mask &= ~K; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/SourceLocation.h b/contrib/llvm-project/clang/include/clang/Basic/SourceLocation.h index c709c1102834..00b1e0fa855b 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/SourceLocation.h +++ b/contrib/llvm-project/clang/include/clang/Basic/SourceLocation.h @@ -14,6 +14,7 @@ #ifndef LLVM_CLANG_BASIC_SOURCELOCATION_H #define LLVM_CLANG_BASIC_SOURCELOCATION_H +#include "clang/Basic/FileEntry.h" #include "clang/Basic/LLVM.h" #include "llvm/ADT/StringRef.h" #include @@ -58,6 +59,7 @@ private: friend class ASTWriter; friend class ASTReader; friend class SourceManager; + friend class SourceManagerTestHelper; static FileID get(int V) { FileID F; @@ -356,8 +358,6 @@ public: } }; -class FileEntry; - /// A SourceLocation and its associated SourceManager. /// /// This is useful for argument passing to functions that expect both objects. @@ -413,6 +413,7 @@ public: unsigned getColumnNumber(bool *Invalid = nullptr) const; const FileEntry *getFileEntry() const; + OptionalFileEntryRef getFileEntryRef() const; /// Return a StringRef to the source buffer data for the /// specified FileID. diff --git a/contrib/llvm-project/clang/include/clang/Basic/SourceManager.h b/contrib/llvm-project/clang/include/clang/Basic/SourceManager.h index 48c6b6611219..d2ece14da0b1 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/SourceManager.h +++ b/contrib/llvm-project/clang/include/clang/Basic/SourceManager.h @@ -43,6 +43,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/PagedVector.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -142,13 +143,13 @@ public: /// /// FIXME: Make non-optional using a virtual file as needed, remove \c /// Filename and use \c OrigEntry.getNameAsRequested() instead. - OptionalFileEntryRefDegradesToFileEntryPtr OrigEntry; + OptionalFileEntryRef OrigEntry; /// References the file which the contents were actually loaded from. /// /// Can be different from 'Entry' if we overridden the contents of one file /// with the contents of another file. - const FileEntry *ContentsEntry; + OptionalFileEntryRef ContentsEntry; /// The filename that is used to access OrigEntry. /// @@ -166,27 +167,31 @@ public: /// /// When true, the original entry may be a virtual file that does not /// exist. + LLVM_PREFERRED_TYPE(bool) unsigned BufferOverridden : 1; /// True if this content cache was initially created for a source file /// considered to be volatile (likely to change between stat and open). + LLVM_PREFERRED_TYPE(bool) unsigned IsFileVolatile : 1; /// True if this file may be transient, that is, if it might not /// exist at some later point in time when this content entry is used, /// after serialization and deserialization. + LLVM_PREFERRED_TYPE(bool) unsigned IsTransient : 1; + LLVM_PREFERRED_TYPE(bool) mutable unsigned IsBufferInvalid : 1; ContentCache() - : OrigEntry(std::nullopt), ContentsEntry(nullptr), + : OrigEntry(std::nullopt), ContentsEntry(std::nullopt), BufferOverridden(false), IsFileVolatile(false), IsTransient(false), IsBufferInvalid(false) {} ContentCache(FileEntryRef Ent) : ContentCache(Ent, Ent) {} - ContentCache(FileEntryRef Ent, const FileEntry *contentEnt) + ContentCache(FileEntryRef Ent, FileEntryRef contentEnt) : OrigEntry(Ent), ContentsEntry(contentEnt), BufferOverridden(false), IsFileVolatile(false), IsTransient(false), IsBufferInvalid(false) {} @@ -304,6 +309,7 @@ class FileInfo { unsigned NumCreatedFIDs : 31; /// Whether this FileInfo has any \#line directives. + LLVM_PREFERRED_TYPE(bool) unsigned HasLineDirectives : 1; /// The content cache and the characteristic of the file. @@ -475,6 +481,7 @@ static_assert(sizeof(FileInfo) <= sizeof(ExpansionInfo), class SLocEntry { static constexpr int OffsetBits = 8 * sizeof(SourceLocation::UIntTy) - 1; SourceLocation::UIntTy Offset : OffsetBits; + LLVM_PREFERRED_TYPE(bool) SourceLocation::UIntTy IsExpansion : 1; union { FileInfo File; @@ -499,6 +506,14 @@ public: return Expansion; } + /// Creates an incomplete SLocEntry that is only able to report its offset. + static SLocEntry getOffsetOnly(SourceLocation::UIntTy Offset) { + assert(!(Offset & (1ULL << OffsetBits)) && "Offset is too large"); + SLocEntry E; + E.Offset = Offset; + return E; + } + static SLocEntry get(SourceLocation::UIntTy Offset, const FileInfo &FI) { assert(!(Offset & (1ULL << OffsetBits)) && "Offset is too large"); SLocEntry E; @@ -533,6 +548,12 @@ public: /// entry from being loaded. virtual bool ReadSLocEntry(int ID) = 0; + /// Get the index ID for the loaded SourceLocation offset. + /// + /// \returns Invalid index ID (0) if an error occurred that prevented the + /// SLocEntry from being loaded. + virtual int getSLocEntryID(SourceLocation::UIntTy SLocOffset) = 0; + /// Retrieve the module import location and name for the given ID, if /// in fact it was loaded from a module (rather than, say, a precompiled /// header). @@ -649,7 +670,7 @@ class SourceManager : public RefCountedBase { /// This map allows us to merge ContentCache entries based /// on their FileEntry*. All ContentCache objects will thus have unique, /// non-null, FileEntry pointers. - llvm::DenseMap FileInfos; + llvm::DenseMap FileInfos; /// True if the ContentCache for files that are overridden by other /// files, should report the original file name. Defaults to true. @@ -699,7 +720,12 @@ class SourceManager : public RefCountedBase { /// /// Negative FileIDs are indexes into this table. To get from ID to an index, /// use (-ID - 2). - SmallVector LoadedSLocEntryTable; + llvm::PagedVector LoadedSLocEntryTable; + + /// For each allocation in LoadedSLocEntryTable, we keep the first FileID. + /// We assume exactly one allocation per AST file, and use that to determine + /// whether two FileIDs come from the same AST file. + SmallVector LoadedSLocEntryAllocBegin; /// The starting offset of the next local SLocEntry. /// @@ -723,6 +749,12 @@ class SourceManager : public RefCountedBase { /// Same indexing as LoadedSLocEntryTable. llvm::BitVector SLocEntryLoaded; + /// A bitmap that indicates whether the entries of LoadedSLocEntryTable + /// have already had their offset loaded from the external source. + /// + /// Superset of SLocEntryLoaded. Same indexing as SLocEntryLoaded. + llvm::BitVector SLocEntryOffsetLoaded; + /// An external source for source location entries. ExternalSLocEntrySource *ExternalSLocEntries = nullptr; @@ -876,13 +908,6 @@ public: /// Create a new FileID that represents the specified file /// being \#included from the specified IncludePosition. - /// - /// This translates NULL into standard input. - FileID createFileID(const FileEntry *SourceFile, SourceLocation IncludePos, - SrcMgr::CharacteristicKind FileCharacter, - int LoadedID = 0, - SourceLocation::UIntTy LoadedOffset = 0); - FileID createFileID(FileEntryRef SourceFile, SourceLocation IncludePos, SrcMgr::CharacteristicKind FileCharacter, int LoadedID = 0, @@ -908,7 +933,7 @@ public: /// Get the FileID for \p SourceFile if it exists. Otherwise, create a /// new FileID for the \p SourceFile. - FileID getOrCreateFileID(const FileEntry *SourceFile, + FileID getOrCreateFileID(FileEntryRef SourceFile, SrcMgr::CharacteristicKind FileCharacter); /// Creates an expansion SLocEntry for the substitution of an argument into a @@ -942,12 +967,12 @@ public: /// /// Returns std::nullopt if the buffer is not valid. std::optional - getMemoryBufferForFileOrNone(const FileEntry *File); + getMemoryBufferForFileOrNone(FileEntryRef File); /// Retrieve the memory buffer associated with the given file. /// /// Returns a fake buffer if there isn't a real one. - llvm::MemoryBufferRef getMemoryBufferForFileOrFake(const FileEntry *File) { + llvm::MemoryBufferRef getMemoryBufferForFileOrFake(FileEntryRef File) { if (auto B = getMemoryBufferForFileOrNone(File)) return *B; return getFakeBufferForRecovery(); @@ -960,7 +985,7 @@ public: /// /// \param Buffer the memory buffer whose contents will be used as the /// data in the given source file. - void overrideFileContents(const FileEntry *SourceFile, + void overrideFileContents(FileEntryRef SourceFile, const llvm::MemoryBufferRef &Buffer) { overrideFileContents(SourceFile, llvm::MemoryBuffer::getMemBuffer(Buffer)); } @@ -972,12 +997,8 @@ public: /// /// \param Buffer the memory buffer whose contents will be used as the /// data in the given source file. - void overrideFileContents(const FileEntry *SourceFile, - std::unique_ptr Buffer); void overrideFileContents(FileEntryRef SourceFile, - std::unique_ptr Buffer) { - overrideFileContents(&SourceFile.getFileEntry(), std::move(Buffer)); - } + std::unique_ptr Buffer); /// Override the given source file with another one. /// @@ -1006,7 +1027,7 @@ public: OptionalFileEntryRef bypassFileContentsOverride(FileEntryRef File); /// Specify that a file is transient. - void setFileIsTransient(const FileEntry *SourceFile); + void setFileIsTransient(FileEntryRef SourceFile); /// Specify that all files that are read during this compilation are /// transient. @@ -1043,8 +1064,8 @@ public: /// Returns the FileEntry record for the provided FileID. const FileEntry *getFileEntryForID(FileID FID) const { - if (auto *Entry = getSLocEntryForFile(FID)) - return Entry->getFile().getContentCache().OrigEntry; + if (auto FE = getFileEntryRefForID(FID)) + return *FE; return nullptr; } @@ -1062,9 +1083,11 @@ public: std::optional getNonBuiltinFilenameForID(FileID FID) const; /// Returns the FileEntry record for the provided SLocEntry. - const FileEntry *getFileEntryForSLocEntry(const SrcMgr::SLocEntry &sloc) const - { - return sloc.getFile().getContentCache().OrigEntry; + const FileEntry * + getFileEntryForSLocEntry(const SrcMgr::SLocEntry &SLocEntry) const { + if (auto FE = SLocEntry.getFile().getContentCache().OrigEntry) + return *FE; + return nullptr; } /// Return a StringRef to the source buffer data for the @@ -1649,6 +1672,11 @@ public: isInTheSameTranslationUnit(std::pair &LOffs, std::pair &ROffs) const; + /// Determines whether the two decomposed source location is in the same TU. + bool isInTheSameTranslationUnitImpl( + const std::pair &LOffs, + const std::pair &ROffs) const; + /// Determines the order of 2 source locations in the "source location /// address space". bool isBeforeInSLocAddrSpace(SourceLocation LHS, SourceLocation RHS) const { @@ -1680,12 +1708,12 @@ public: // Iterators over FileInfos. using fileinfo_iterator = - llvm::DenseMap::const_iterator; + llvm::DenseMap::const_iterator; fileinfo_iterator fileinfo_begin() const { return FileInfos.begin(); } fileinfo_iterator fileinfo_end() const { return FileInfos.end(); } bool hasFileInfo(const FileEntry *File) const { - return FileInfos.contains(File); + return FileInfos.find_as(File) != FileInfos.end(); } /// Print statistics to stderr. diff --git a/contrib/llvm-project/clang/include/clang/Basic/SourceMgrAdapter.h b/contrib/llvm-project/clang/include/clang/Basic/SourceMgrAdapter.h new file mode 100644 index 000000000000..be7f9d5051fb --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/Basic/SourceMgrAdapter.h @@ -0,0 +1,85 @@ +//=== SourceMgrAdapter.h - SourceMgr to SourceManager Adapter ---*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +// This file provides an adapter that maps diagnostics from llvm::SourceMgr +// to Clang's SourceManager. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_SOURCEMGRADAPTER_H +#define LLVM_CLANG_SOURCEMGRADAPTER_H + +#include "clang/Basic/SourceManager.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/Support/SourceMgr.h" +#include +#include + +namespace clang { + +class DiagnosticsEngine; +class FileEntry; + +/// An adapter that can be used to translate diagnostics from one or more +/// llvm::SourceMgr instances to a , +class SourceMgrAdapter { + /// Clang source manager. + SourceManager &SrcMgr; + + /// Clang diagnostics engine. + DiagnosticsEngine &Diagnostics; + + /// Diagnostic IDs for errors, warnings, and notes. + unsigned ErrorDiagID, WarningDiagID, NoteDiagID; + + /// The default file to use when mapping buffers. + OptionalFileEntryRef DefaultFile; + + /// A mapping from (LLVM source manager, buffer ID) pairs to the + /// corresponding file ID within the Clang source manager. + llvm::DenseMap, FileID> + FileIDMapping; + + /// Diagnostic handler. + static void handleDiag(const llvm::SMDiagnostic &Diag, void *Context); + +public: + /// Create a new \c SourceMgr adaptor that maps to the given source + /// manager and diagnostics engine. + SourceMgrAdapter(SourceManager &SM, DiagnosticsEngine &Diagnostics, + unsigned ErrorDiagID, unsigned WarningDiagID, + unsigned NoteDiagID, + OptionalFileEntryRef DefaultFile = std::nullopt); + + ~SourceMgrAdapter(); + + /// Map a source location in the given LLVM source manager to its + /// corresponding location in the Clang source manager. + SourceLocation mapLocation(const llvm::SourceMgr &LLVMSrcMgr, + llvm::SMLoc Loc); + + /// Map a source range in the given LLVM source manager to its corresponding + /// range in the Clang source manager. + SourceRange mapRange(const llvm::SourceMgr &LLVMSrcMgr, llvm::SMRange Range); + + /// Handle the given diagnostic from an LLVM source manager. + void handleDiag(const llvm::SMDiagnostic &Diag); + + /// Retrieve the diagnostic handler to use with the underlying SourceMgr. + llvm::SourceMgr::DiagHandlerTy getDiagHandler() { + return &SourceMgrAdapter::handleDiag; + } + + /// Retrieve the context to use with the diagnostic handler produced by + /// \c getDiagHandler(). + void *getDiagContext() { return this; } +}; + +} // end namespace clang + +#endif diff --git a/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h b/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h index 06279a016a50..87f29c8ae10b 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h +++ b/contrib/llvm-project/clang/include/clang/Basic/Specifiers.h @@ -82,10 +82,10 @@ namespace clang { TST_class, // C++ class type TST_interface, // C++ (Microsoft-specific) __interface type TST_typename, // Typedef, C++ class-name or enum name, etc. - TST_typeofType, // C2x (and GNU extension) typeof(type-name) - TST_typeofExpr, // C2x (and GNU extension) typeof(expression) - TST_typeof_unqualType, // C2x typeof_unqual(type-name) - TST_typeof_unqualExpr, // C2x typeof_unqual(expression) + TST_typeofType, // C23 (and GNU extension) typeof(type-name) + TST_typeofExpr, // C23 (and GNU extension) typeof(expression) + TST_typeof_unqualType, // C23 typeof_unqual(type-name) + TST_typeof_unqualExpr, // C23 typeof_unqual(expression) TST_decltype, // C++11 decltype #define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) TST_##Trait, #include "clang/Basic/TransformTypeTraits.def" @@ -103,9 +103,13 @@ namespace clang { /// were written in a particular type specifier sequence. struct WrittenBuiltinSpecs { static_assert(TST_error < 1 << 7, "Type bitfield not wide enough for TST"); - /*DeclSpec::TST*/ unsigned Type : 7; - /*DeclSpec::TSS*/ unsigned Sign : 2; - /*TypeSpecifierWidth*/ unsigned Width : 2; + LLVM_PREFERRED_TYPE(TypeSpecifierType) + unsigned Type : 7; + LLVM_PREFERRED_TYPE(TypeSpecifierSign) + unsigned Sign : 2; + LLVM_PREFERRED_TYPE(TypeSpecifierWidth) + unsigned Width : 2; + LLVM_PREFERRED_TYPE(bool) unsigned ModeAttr : 1; }; @@ -288,6 +292,7 @@ namespace clang { CC_AArch64VectorCall, // __attribute__((aarch64_vector_pcs)) CC_AArch64SVEPCS, // __attribute__((aarch64_sve_pcs)) CC_AMDGPUKernelCall, // __attribute__((amdgpu_kernel)) + CC_M68kRTD, // __attribute__((m68k_rtd)) }; /// Checks whether the given calling convention supports variadic @@ -304,6 +309,7 @@ namespace clang { case CC_OpenCLKernel: case CC_Swift: case CC_SwiftAsync: + case CC_M68kRTD: return false; default: return true; diff --git a/contrib/llvm-project/clang/include/clang/Basic/StmtNodes.td b/contrib/llvm-project/clang/include/clang/Basic/StmtNodes.td index 4b31e06eb2cd..cec301dfca28 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/StmtNodes.td +++ b/contrib/llvm-project/clang/include/clang/Basic/StmtNodes.td @@ -259,6 +259,7 @@ def OMPTargetUpdateDirective : StmtNode; def OMPTeamsDirective : StmtNode; def OMPCancellationPointDirective : StmtNode; def OMPCancelDirective : StmtNode; +def OMPScopeDirective : StmtNode; def OMPTaskLoopDirective : StmtNode; def OMPTaskLoopSimdDirective : StmtNode; def OMPMasterTaskLoopDirective : StmtNode; diff --git a/contrib/llvm-project/clang/include/clang/Basic/SyncScope.h b/contrib/llvm-project/clang/include/clang/Basic/SyncScope.h index 7919f64c6daf..bc7ec7b5cf77 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/SyncScope.h +++ b/contrib/llvm-project/clang/include/clang/Basic/SyncScope.h @@ -40,6 +40,11 @@ namespace clang { /// Update getAsString. /// enum class SyncScope { + SystemScope, + DeviceScope, + WorkgroupScope, + WavefrontScope, + SingleScope, HIPSingleThread, HIPWavefront, HIPWorkgroup, @@ -54,6 +59,16 @@ enum class SyncScope { inline llvm::StringRef getAsString(SyncScope S) { switch (S) { + case SyncScope::SystemScope: + return "system_scope"; + case SyncScope::DeviceScope: + return "device_scope"; + case SyncScope::WorkgroupScope: + return "workgroup_scope"; + case SyncScope::WavefrontScope: + return "wavefront_scope"; + case SyncScope::SingleScope: + return "single_scope"; case SyncScope::HIPSingleThread: return "hip_singlethread"; case SyncScope::HIPWavefront: @@ -77,7 +92,7 @@ inline llvm::StringRef getAsString(SyncScope S) { } /// Defines the kind of atomic scope models. -enum class AtomicScopeModelKind { None, OpenCL, HIP }; +enum class AtomicScopeModelKind { None, OpenCL, HIP, Generic }; /// Defines the interface for synch scope model. class AtomicScopeModel { @@ -205,6 +220,56 @@ public: } }; +/// Defines the generic atomic scope model. +class AtomicScopeGenericModel : public AtomicScopeModel { +public: + /// The enum values match predefined built-in macros __ATOMIC_SCOPE_*. + enum ID { + System = 0, + Device = 1, + Workgroup = 2, + Wavefront = 3, + Single = 4, + Last = Single + }; + + AtomicScopeGenericModel() = default; + + SyncScope map(unsigned S) const override { + switch (static_cast(S)) { + case Device: + return SyncScope::DeviceScope; + case System: + return SyncScope::SystemScope; + case Workgroup: + return SyncScope::WorkgroupScope; + case Wavefront: + return SyncScope::WavefrontScope; + case Single: + return SyncScope::SingleScope; + } + llvm_unreachable("Invalid language sync scope value"); + } + + bool isValid(unsigned S) const override { + return S >= static_cast(System) && + S <= static_cast(Last); + } + + ArrayRef getRuntimeValues() const override { + static_assert(Last == Single, "Does not include all sync scopes"); + static const unsigned Scopes[] = { + static_cast(Device), static_cast(System), + static_cast(Workgroup), static_cast(Wavefront), + static_cast(Single)}; + return llvm::ArrayRef(Scopes); + } + + unsigned getFallBackValue() const override { + return static_cast(System); + } +}; + inline std::unique_ptr AtomicScopeModel::create(AtomicScopeModelKind K) { switch (K) { @@ -214,6 +279,8 @@ AtomicScopeModel::create(AtomicScopeModelKind K) { return std::make_unique(); case AtomicScopeModelKind::HIP: return std::make_unique(); + case AtomicScopeModelKind::Generic: + return std::make_unique(); } llvm_unreachable("Invalid atomic scope model kind"); } diff --git a/contrib/llvm-project/clang/include/clang/Basic/TargetBuiltins.h b/contrib/llvm-project/clang/include/clang/Basic/TargetBuiltins.h index 8f7881abf26f..c9f9cbec7493 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/TargetBuiltins.h +++ b/contrib/llvm-project/clang/include/clang/Basic/TargetBuiltins.h @@ -309,7 +309,7 @@ namespace clang { bool isTupleSet() const { return Flags & IsTupleSet; } bool isReadZA() const { return Flags & IsReadZA; } bool isWriteZA() const { return Flags & IsWriteZA; } - + bool isReductionQV() const { return Flags & IsReductionQV; } uint64_t getBits() const { return Flags; } bool isFlagSet(uint64_t Flag) const { return Flags & Flag; } }; diff --git a/contrib/llvm-project/clang/include/clang/Basic/TargetInfo.h b/contrib/llvm-project/clang/include/clang/Basic/TargetInfo.h index 61be52149341..aa0f5023104a 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/TargetInfo.h +++ b/contrib/llvm-project/clang/include/clang/Basic/TargetInfo.h @@ -156,6 +156,7 @@ protected: /// /// Otherwise, when this flag is not set, the normal built-in boolean type is /// used. + LLVM_PREFERRED_TYPE(bool) unsigned UseSignedCharForObjCBool : 1; /// Control whether the alignment of bit-field types is respected when laying @@ -163,6 +164,7 @@ protected: /// used to (a) impact the alignment of the containing structure, and (b) /// ensure that the individual bit-field will not straddle an alignment /// boundary. + LLVM_PREFERRED_TYPE(bool) unsigned UseBitFieldTypeAlignment : 1; /// Whether zero length bitfields (e.g., int : 0;) force alignment of @@ -171,13 +173,16 @@ protected: /// If the alignment of the zero length bitfield is greater than the member /// that follows it, `bar', `bar' will be aligned as the type of the /// zero-length bitfield. + LLVM_PREFERRED_TYPE(bool) unsigned UseZeroLengthBitfieldAlignment : 1; /// Whether zero length bitfield alignment is respected if they are the /// leading members. + LLVM_PREFERRED_TYPE(bool) unsigned UseLeadingZeroLengthBitfield : 1; /// Whether explicit bit field alignment attributes are honored. + LLVM_PREFERRED_TYPE(bool) unsigned UseExplicitBitFieldAlignment : 1; /// If non-zero, specifies a fixed alignment value for bitfields that follow @@ -239,18 +244,26 @@ protected: mutable StringRef PlatformName; mutable VersionTuple PlatformMinVersion; + LLVM_PREFERRED_TYPE(bool) unsigned HasAlignMac68kSupport : 1; + LLVM_PREFERRED_TYPE(FloatModeKind) unsigned RealTypeUsesObjCFPRetMask : llvm::BitWidth; + LLVM_PREFERRED_TYPE(bool) unsigned ComplexLongDoubleUsesFP2Ret : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HasBuiltinMSVaList : 1; + LLVM_PREFERRED_TYPE(bool) unsigned IsRenderScriptTarget : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HasAArch64SVETypes : 1; + LLVM_PREFERRED_TYPE(bool) unsigned HasRISCVVTypes : 1; + LLVM_PREFERRED_TYPE(bool) unsigned AllowAMDGPUUnsafeFPAtomics : 1; unsigned ARMCDECoprocMask : 8; @@ -1260,10 +1273,6 @@ public: /// the language based on the target options where applicable. virtual void adjust(DiagnosticsEngine &Diags, LangOptions &Opts); - /// Adjust target options based on codegen options. - virtual void adjustTargetOptions(const CodeGenOptions &CGOpts, - TargetOptions &TargetOpts) const {} - /// Initialize the map with the default set of target features for the /// CPU this should include all legal feature strings on the target. /// @@ -1295,20 +1304,20 @@ public: fillValidCPUList(Values); } - /// brief Determine whether this TargetInfo supports the given CPU name. + /// Determine whether this TargetInfo supports the given CPU name. virtual bool isValidCPUName(StringRef Name) const { return true; } - /// brief Determine whether this TargetInfo supports the given CPU name for - // tuning. + /// Determine whether this TargetInfo supports the given CPU name for + /// tuning. virtual bool isValidTuneCPUName(StringRef Name) const { return isValidCPUName(Name); } virtual ParsedTargetAttr parseTargetAttr(StringRef Str) const; - /// brief Determine whether this TargetInfo supports tune in target attribute. + /// Determine whether this TargetInfo supports tune in target attribute. virtual bool supportsTargetAttributeTune() const { return false; } @@ -1414,6 +1423,8 @@ public: /// Identify whether this target supports IFuncs. bool supportsIFunc() const { + if (getTriple().isOSBinFormatMachO()) + return true; return getTriple().isOSBinFormatELF() && ((getTriple().isOSLinux() && !getTriple().isMusl()) || getTriple().isOSFreeBSD()); diff --git a/contrib/llvm-project/clang/include/clang/Basic/TargetOSMacros.def b/contrib/llvm-project/clang/include/clang/Basic/TargetOSMacros.def new file mode 100644 index 000000000000..dfc2e033f6fd --- /dev/null +++ b/contrib/llvm-project/clang/include/clang/Basic/TargetOSMacros.def @@ -0,0 +1,55 @@ +//===--- TargetOSMacros.def - Target OS macros ------------------*- C++ -*-===// +// +// 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 +// +//===----------------------------------------------------------------------===// +// +// This file specifies the predefined TARGET_OS_* conditional macros. +// A target macro `Name` should be defined if `Predicate` evaluates to true. +// The macro expects `const llvm::Triple &Triple` and the class `llvm::Triple` +// to be available for the predicate. +// +//===----------------------------------------------------------------------===// + +#ifndef TARGET_OS +#define TARGET_OS(Name, Predicate) +#endif + +// Windows targets. +TARGET_OS(TARGET_OS_WIN32, Triple.isOSWindows()) +TARGET_OS(TARGET_OS_WINDOWS, Triple.isOSWindows()) + +// Linux target. +TARGET_OS(TARGET_OS_LINUX, Triple.isOSLinux()) + +// Unix target. +TARGET_OS(TARGET_OS_UNIX, Triple.isOSNetBSD() || + Triple.isOSFreeBSD() || + Triple.isOSOpenBSD() || + Triple.isOSSolaris()) + +// Apple (Mac) targets. +TARGET_OS(TARGET_OS_MAC, Triple.isOSDarwin()) +TARGET_OS(TARGET_OS_OSX, Triple.isMacOSX()) +TARGET_OS(TARGET_OS_IPHONE, Triple.isiOS() || Triple.isTvOS() || + Triple.isWatchOS()) +// Triple::isiOS() also includes tvOS +TARGET_OS(TARGET_OS_IOS, Triple.getOS() == llvm::Triple::IOS) +TARGET_OS(TARGET_OS_TV, Triple.isTvOS()) +TARGET_OS(TARGET_OS_WATCH, Triple.isWatchOS()) +TARGET_OS(TARGET_OS_DRIVERKIT, Triple.isDriverKit()) +TARGET_OS(TARGET_OS_MACCATALYST, Triple.isMacCatalystEnvironment()) +TARGET_OS(TARGET_OS_SIMULATOR, Triple.isSimulatorEnvironment()) + +// Deprecated Apple target conditionals. +TARGET_OS(TARGET_OS_EMBEDDED, (Triple.isiOS() || Triple.isTvOS() \ + || Triple.isWatchOS()) \ + && !Triple.isMacCatalystEnvironment() \ + && !Triple.isSimulatorEnvironment()) +TARGET_OS(TARGET_OS_NANO, Triple.isWatchOS()) +TARGET_OS(TARGET_IPHONE_SIMULATOR, Triple.isSimulatorEnvironment()) +TARGET_OS(TARGET_OS_UIKITFORMAC, Triple.isMacCatalystEnvironment()) + +#undef TARGET_OS diff --git a/contrib/llvm-project/clang/include/clang/Basic/TargetOptions.h b/contrib/llvm-project/clang/include/clang/Basic/TargetOptions.h index b192c856384b..2049f03b2889 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/TargetOptions.h +++ b/contrib/llvm-project/clang/include/clang/Basic/TargetOptions.h @@ -78,17 +78,9 @@ public: /// \brief If enabled, allow AMDGPU unsafe floating point atomics. bool AllowAMDGPUUnsafeFPAtomics = false; - /// \brief Enumeration value for AMDGPU code object version, which is the - /// code object version times 100. - enum CodeObjectVersionKind { - COV_None, - COV_2 = 200, - COV_3 = 300, - COV_4 = 400, - COV_5 = 500, - }; /// \brief Code object version for AMDGPU. - CodeObjectVersionKind CodeObjectVersion = CodeObjectVersionKind::COV_None; + llvm::CodeObjectVersionKind CodeObjectVersion = + llvm::CodeObjectVersionKind::COV_None; /// \brief Enumeration values for AMDGPU printf lowering scheme enum class AMDGPUPrintfKind { @@ -109,6 +101,10 @@ public: // code model. std::string CodeModel; + // The large data threshold used for certain code models on certain + // architectures. + uint64_t LargeDataThreshold; + /// The version of the SDK which was used during the compilation. /// The option is used for two different purposes: /// * on darwin the version is propagated to LLVM where it's used diff --git a/contrib/llvm-project/clang/include/clang/Basic/TokenKinds.def b/contrib/llvm-project/clang/include/clang/Basic/TokenKinds.def index ef0dad0f2dcd..3f0e1e1a7d45 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/TokenKinds.def +++ b/contrib/llvm-project/clang/include/clang/Basic/TokenKinds.def @@ -31,8 +31,8 @@ #ifndef C99_KEYWORD #define C99_KEYWORD(X,Y) KEYWORD(X,KEYC99|(Y)) #endif -#ifndef C2X_KEYWORD -#define C2X_KEYWORD(X,Y) KEYWORD(X,KEYC2X|(Y)) +#ifndef C23_KEYWORD +#define C23_KEYWORD(X,Y) KEYWORD(X,KEYC23|(Y)) #endif #ifndef COROUTINES_KEYWORD #define COROUTINES_KEYWORD(X) CXX20_KEYWORD(X,KEYCOROUTINES) @@ -259,7 +259,7 @@ PUNCTUATOR(caretcaret, "^^") // always be treated as a keyword // KEYC99 - This is a keyword introduced to C in C99 // KEYC11 - This is a keyword introduced to C in C11 -// KEYC2X - This is a keyword introduced to C in C2x +// KEYC23 - This is a keyword introduced to C in C23 // KEYCXX - This is a C++ keyword, or a C++-specific keyword in the // implementation namespace // KEYNOCXX - This is a keyword in every non-C++ dialect. @@ -284,6 +284,8 @@ PUNCTUATOR(caretcaret, "^^") // HALFSUPPORT - This is a keyword if 'half' is a built-in type // WCHARSUPPORT - This is a keyword if 'wchar_t' is a built-in type // CHAR8SUPPORT - This is a keyword if 'char8_t' is a built-in type +// KEYFIXEDPOINT - This is a keyword according to the N1169 fixed point +// extension. // KEYWORD(auto , KEYALL) KEYWORD(break , KEYALL) @@ -310,6 +312,7 @@ KEYWORD(return , KEYALL) KEYWORD(short , KEYALL) KEYWORD(signed , KEYALL) UNARY_EXPR_OR_TYPE_TRAIT(sizeof, SizeOf, KEYALL) +UNARY_EXPR_OR_TYPE_TRAIT(__datasizeof, DataSizeOf, KEYCXX) KEYWORD(static , KEYALL) KEYWORD(struct , KEYALL) KEYWORD(switch , KEYALL) @@ -336,7 +339,7 @@ KEYWORD(__objc_no , KEYALL) // C++ 2.11p1: Keywords. KEYWORD(asm , KEYCXX|KEYGNU) -KEYWORD(bool , BOOLSUPPORT|KEYC2X) +KEYWORD(bool , BOOLSUPPORT|KEYC23) KEYWORD(catch , KEYCXX) KEYWORD(class , KEYCXX) KEYWORD(const_cast , KEYCXX) @@ -344,7 +347,7 @@ KEYWORD(delete , KEYCXX) KEYWORD(dynamic_cast , KEYCXX) KEYWORD(explicit , KEYCXX) KEYWORD(export , KEYCXX) -KEYWORD(false , BOOLSUPPORT|KEYC2X) +KEYWORD(false , BOOLSUPPORT|KEYC23) KEYWORD(friend , KEYCXX) KEYWORD(mutable , KEYCXX) KEYWORD(namespace , KEYCXX) @@ -358,7 +361,7 @@ KEYWORD(static_cast , KEYCXX) KEYWORD(template , KEYCXX) KEYWORD(this , KEYCXX) KEYWORD(throw , KEYCXX) -KEYWORD(true , BOOLSUPPORT|KEYC2X) +KEYWORD(true , BOOLSUPPORT|KEYC23) KEYWORD(try , KEYCXX) KEYWORD(typename , KEYCXX) KEYWORD(typeid , KEYCXX) @@ -385,17 +388,17 @@ C99_KEYWORD(inline , KEYCXX|KEYGNU) // C++11 keywords -CXX11_KEYWORD(alignas , KEYC2X) +CXX11_KEYWORD(alignas , KEYC23) // alignof and _Alignof return the required ABI alignment -CXX11_UNARY_EXPR_OR_TYPE_TRAIT(alignof, AlignOf, KEYC2X) +CXX11_UNARY_EXPR_OR_TYPE_TRAIT(alignof, AlignOf, KEYC23) CXX11_KEYWORD(char16_t , KEYNOMS18) CXX11_KEYWORD(char32_t , KEYNOMS18) CXX11_KEYWORD(constexpr , 0) CXX11_KEYWORD(decltype , 0) CXX11_KEYWORD(noexcept , 0) -CXX11_KEYWORD(nullptr , KEYC2X) -CXX11_KEYWORD(static_assert , KEYMSCOMPAT|KEYC2X) -CXX11_KEYWORD(thread_local , KEYC2X) +CXX11_KEYWORD(nullptr , KEYC23) +CXX11_KEYWORD(static_assert , KEYMSCOMPAT|KEYC23) +CXX11_KEYWORD(thread_local , KEYC23) // C++20 / coroutines keywords COROUTINES_KEYWORD(co_await) @@ -418,14 +421,14 @@ KEYWORD(char8_t , CHAR8SUPPORT) // C11 Extension KEYWORD(_Float16 , KEYALL) -// C2x keywords -C2X_KEYWORD(typeof , KEYGNU) -C2X_KEYWORD(typeof_unqual , 0) +// C23 keywords +C23_KEYWORD(typeof , KEYGNU) +C23_KEYWORD(typeof_unqual , 0) // ISO/IEC JTC1 SC22 WG14 N1169 Extension -KEYWORD(_Accum , KEYNOCXX) -KEYWORD(_Fract , KEYNOCXX) -KEYWORD(_Sat , KEYNOCXX) +KEYWORD(_Accum , KEYFIXEDPOINT) +KEYWORD(_Fract , KEYFIXEDPOINT) +KEYWORD(_Sat , KEYFIXEDPOINT) // GNU Extensions (in impl-reserved namespace) KEYWORD(_Decimal32 , KEYALL) @@ -531,6 +534,7 @@ TYPE_TRAIT_1(__is_scoped_enum, IsScopedEnum, KEYCXX) TYPE_TRAIT_1(__is_referenceable, IsReferenceable, KEYCXX) TYPE_TRAIT_1(__can_pass_in_regs, CanPassInRegs, KEYCXX) TYPE_TRAIT_2(__reference_binds_to_temporary, ReferenceBindsToTemporary, KEYCXX) +TYPE_TRAIT_2(__reference_constructs_from_temporary, ReferenceConstructsFromTemporary, KEYCXX) // Embarcadero Expression Traits EXPRESSION_TRAIT(__is_lvalue_expr, IsLValueExpr, KEYCXX) @@ -624,6 +628,9 @@ KEYWORD(__noinline__ , KEYCUDA) KEYWORD(cbuffer , KEYHLSL) KEYWORD(tbuffer , KEYHLSL) KEYWORD(groupshared , KEYHLSL) +KEYWORD(in , KEYHLSL) +KEYWORD(inout , KEYHLSL) +KEYWORD(out , KEYHLSL) // OpenMP Type Traits UNARY_EXPR_OR_TYPE_TRAIT(__builtin_omp_required_simd_align, OpenMPRequiredSimdAlign, KEYALL) @@ -745,6 +752,7 @@ ALIAS("_pascal" , __pascal , KEYBORLAND) // Clang Extensions. KEYWORD(__builtin_convertvector , KEYALL) +UNARY_EXPR_OR_TYPE_TRAIT(__builtin_vectorelements, VectorElements, KEYALL) ALIAS("__char16_t" , char16_t , KEYCXX) ALIAS("__char32_t" , char32_t , KEYCXX) KEYWORD(__builtin_bit_cast , KEYALL) @@ -903,6 +911,11 @@ PRAGMA_ANNOTATION(pragma_fenv_access_ms) // handles them. PRAGMA_ANNOTATION(pragma_fenv_round) +// Annotation for #pragma STDC CX_LIMITED_RANGE +// The lexer produces these so that they only take effect when the parser +// handles them. +PRAGMA_ANNOTATION(pragma_cx_limited_range) + // Annotation for #pragma float_control // The lexer produces these so that they only take effect when the parser // handles them. @@ -941,6 +954,12 @@ ANNOTATION(attr_openmp) PRAGMA_ANNOTATION(pragma_openmp) PRAGMA_ANNOTATION(pragma_openmp_end) +// Annotations for OpenACC pragma directives - #pragma acc. +// Like with OpenMP, these are produced by the lexer when it parses a +// #pragma acc directive so it can be handled during parsing of the directives. +PRAGMA_ANNOTATION(pragma_openacc) +PRAGMA_ANNOTATION(pragma_openacc_end) + // Annotations for loop pragma directives #pragma clang loop ... // The lexer produces these so that they only take effect when the parser // handles #pragma loop ... directives. @@ -987,5 +1006,5 @@ ANNOTATION(repl_input_end) #undef PUNCTUATOR #undef TOK #undef C99_KEYWORD -#undef C2X_KEYWORD +#undef C23_KEYWORD #undef INTERESTING_IDENTIFIER diff --git a/contrib/llvm-project/clang/include/clang/Basic/Visibility.h b/contrib/llvm-project/clang/include/clang/Basic/Visibility.h index 57d9754ae4a9..1e196300be42 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/Visibility.h +++ b/contrib/llvm-project/clang/include/clang/Basic/Visibility.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_BASIC_VISIBILITY_H #include "clang/Basic/Linkage.h" +#include "llvm/ADT/STLForwardCompat.h" #include #include @@ -56,10 +57,11 @@ class LinkageInfo { void setVisibility(Visibility V, bool E) { visibility_ = V; explicit_ = E; } public: - LinkageInfo() : linkage_(ExternalLinkage), visibility_(DefaultVisibility), - explicit_(false) {} + LinkageInfo() + : linkage_(llvm::to_underlying(Linkage::External)), + visibility_(DefaultVisibility), explicit_(false) {} LinkageInfo(Linkage L, Visibility V, bool E) - : linkage_(L), visibility_(V), explicit_(E) { + : linkage_(llvm::to_underlying(L)), visibility_(V), explicit_(E) { assert(getLinkage() == L && getVisibility() == V && isVisibilityExplicit() == E && "Enum truncated!"); } @@ -68,23 +70,23 @@ public: return LinkageInfo(); } static LinkageInfo internal() { - return LinkageInfo(InternalLinkage, DefaultVisibility, false); + return LinkageInfo(Linkage::Internal, DefaultVisibility, false); } static LinkageInfo uniqueExternal() { - return LinkageInfo(UniqueExternalLinkage, DefaultVisibility, false); + return LinkageInfo(Linkage::UniqueExternal, DefaultVisibility, false); } static LinkageInfo none() { - return LinkageInfo(NoLinkage, DefaultVisibility, false); + return LinkageInfo(Linkage::None, DefaultVisibility, false); } static LinkageInfo visible_none() { - return LinkageInfo(VisibleNoLinkage, DefaultVisibility, false); + return LinkageInfo(Linkage::VisibleNone, DefaultVisibility, false); } - Linkage getLinkage() const { return (Linkage)linkage_; } + Linkage getLinkage() const { return static_cast(linkage_); } Visibility getVisibility() const { return (Visibility)visibility_; } bool isVisibilityExplicit() const { return explicit_; } - void setLinkage(Linkage L) { linkage_ = L; } + void setLinkage(Linkage L) { linkage_ = llvm::to_underlying(L); } void mergeLinkage(Linkage L) { setLinkage(minLinkage(getLinkage(), L)); @@ -96,10 +98,10 @@ public: void mergeExternalVisibility(Linkage L) { Linkage ThisL = getLinkage(); if (!isExternallyVisible(L)) { - if (ThisL == VisibleNoLinkage) - ThisL = NoLinkage; - else if (ThisL == ExternalLinkage) - ThisL = UniqueExternalLinkage; + if (ThisL == Linkage::VisibleNone) + ThisL = Linkage::None; + else if (ThisL == Linkage::External) + ThisL = Linkage::UniqueExternal; } setLinkage(ThisL); } diff --git a/contrib/llvm-project/clang/include/clang/Basic/arm_neon.td b/contrib/llvm-project/clang/include/clang/Basic/arm_neon.td index ba3764d2f778..9cb7e0981384 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/arm_neon.td +++ b/contrib/llvm-project/clang/include/clang/Basic/arm_neon.td @@ -1232,6 +1232,11 @@ def FRINT32X_S32 : SInst<"vrnd32x", "..", "fQf">; def FRINT32Z_S32 : SInst<"vrnd32z", "..", "fQf">; def FRINT64X_S32 : SInst<"vrnd64x", "..", "fQf">; def FRINT64Z_S32 : SInst<"vrnd64z", "..", "fQf">; + +def FRINT32X_S64 : SInst<"vrnd32x", "..", "dQd">; +def FRINT32Z_S64 : SInst<"vrnd32z", "..", "dQd">; +def FRINT64X_S64 : SInst<"vrnd64x", "..", "dQd">; +def FRINT64Z_S64 : SInst<"vrnd64z", "..", "dQd">; } //////////////////////////////////////////////////////////////////////////////// diff --git a/contrib/llvm-project/clang/include/clang/Basic/arm_sme.td b/contrib/llvm-project/clang/include/clang/Basic/arm_sme.td index b950f5cb8acc..fcff6fe35b7b 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/arm_sme.td +++ b/contrib/llvm-project/clang/include/clang/Basic/arm_sme.td @@ -20,110 +20,116 @@ include "arm_sve_sme_incl.td" multiclass ZALoad ch> { let TargetGuard = "sme" in { - def NAME # _H : MInst<"svld1_hor_" # n_suffix, "vimiPQ", t, + def NAME # _H : MInst<"svld1_hor_" # n_suffix, "vimPQ", t, [IsLoad, IsOverloadNone, IsStreaming, IsSharedZA], MemEltTyDefault, i_prefix # "_horiz", ch>; - def NAME # _H_VNUM : MInst<"svld1_hor_vnum_" # n_suffix, "vimiPQl", t, + def NAME # _H_VNUM : MInst<"svld1_hor_vnum_" # n_suffix, "vimPQl", t, [IsLoad, IsOverloadNone, IsStreaming, IsSharedZA], MemEltTyDefault, i_prefix # "_horiz", ch>; - def NAME # _V : MInst<"svld1_ver_" # n_suffix, "vimiPQ", t, + def NAME # _V : MInst<"svld1_ver_" # n_suffix, "vimPQ", t, [IsLoad, IsOverloadNone, IsStreaming, IsSharedZA], MemEltTyDefault, i_prefix # "_vert", ch>; - def NAME # _V_VNUM : MInst<"svld1_ver_vnum_" # n_suffix, "vimiPQl", t, + def NAME # _V_VNUM : MInst<"svld1_ver_vnum_" # n_suffix, "vimPQl", t, [IsLoad, IsOverloadNone, IsStreaming, IsSharedZA], MemEltTyDefault, i_prefix # "_vert", ch>; } } -defm SVLD1_ZA8 : ZALoad<"za8", "c", "aarch64_sme_ld1b", [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_15>]>; -defm SVLD1_ZA16 : ZALoad<"za16", "s", "aarch64_sme_ld1h", [ImmCheck<0, ImmCheck0_1>, ImmCheck<2, ImmCheck0_7>]>; -defm SVLD1_ZA32 : ZALoad<"za32", "i", "aarch64_sme_ld1w", [ImmCheck<0, ImmCheck0_3>, ImmCheck<2, ImmCheck0_3>]>; -defm SVLD1_ZA64 : ZALoad<"za64", "l", "aarch64_sme_ld1d", [ImmCheck<0, ImmCheck0_7>, ImmCheck<2, ImmCheck0_1>]>; -defm SVLD1_ZA128 : ZALoad<"za128", "q", "aarch64_sme_ld1q", [ImmCheck<0, ImmCheck0_15>, ImmCheck<2, ImmCheck0_0>]>; +defm SVLD1_ZA8 : ZALoad<"za8", "c", "aarch64_sme_ld1b", [ImmCheck<0, ImmCheck0_0>]>; +defm SVLD1_ZA16 : ZALoad<"za16", "s", "aarch64_sme_ld1h", [ImmCheck<0, ImmCheck0_1>]>; +defm SVLD1_ZA32 : ZALoad<"za32", "i", "aarch64_sme_ld1w", [ImmCheck<0, ImmCheck0_3>]>; +defm SVLD1_ZA64 : ZALoad<"za64", "l", "aarch64_sme_ld1d", [ImmCheck<0, ImmCheck0_7>]>; +defm SVLD1_ZA128 : ZALoad<"za128", "q", "aarch64_sme_ld1q", [ImmCheck<0, ImmCheck0_15>]>; -def SVLDR_VNUM_ZA : MInst<"svldr_vnum_za", "vmiQ", "", +def SVLDR_VNUM_ZA : MInst<"svldr_vnum_za", "vmQl", "", [IsOverloadNone, IsStreamingCompatible, IsSharedZA], - MemEltTyDefault, "aarch64_sme_ldr", - [ImmCheck<1, ImmCheck0_15>]>; + MemEltTyDefault, "aarch64_sme_ldr">; + +def SVLDR_ZA : MInst<"svldr_za", "vmQ", "", + [IsOverloadNone, IsStreamingCompatible, IsSharedZA], + MemEltTyDefault, "aarch64_sme_ldr", []>; //////////////////////////////////////////////////////////////////////////////// // Stores multiclass ZAStore ch> { let TargetGuard = "sme" in { - def NAME # _H : MInst<"svst1_hor_" # n_suffix, "vimiP%", t, + def NAME # _H : MInst<"svst1_hor_" # n_suffix, "vimP%", t, [IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA], MemEltTyDefault, i_prefix # "_horiz", ch>; - def NAME # _H_VNUM : MInst<"svst1_hor_vnum_" # n_suffix, "vimiP%l", t, + def NAME # _H_VNUM : MInst<"svst1_hor_vnum_" # n_suffix, "vimP%l", t, [IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA], MemEltTyDefault, i_prefix # "_horiz", ch>; - def NAME # _V : MInst<"svst1_ver_" # n_suffix, "vimiP%", t, + def NAME # _V : MInst<"svst1_ver_" # n_suffix, "vimP%", t, [IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA], MemEltTyDefault, i_prefix # "_vert", ch>; - def NAME # _V_VNUM : MInst<"svst1_ver_vnum_" # n_suffix, "vimiP%l", t, + def NAME # _V_VNUM : MInst<"svst1_ver_vnum_" # n_suffix, "vimP%l", t, [IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA], MemEltTyDefault, i_prefix # "_vert", ch>; } } -defm SVST1_ZA8 : ZAStore<"za8", "c", "aarch64_sme_st1b", [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_15>]>; -defm SVST1_ZA16 : ZAStore<"za16", "s", "aarch64_sme_st1h", [ImmCheck<0, ImmCheck0_1>, ImmCheck<2, ImmCheck0_7>]>; -defm SVST1_ZA32 : ZAStore<"za32", "i", "aarch64_sme_st1w", [ImmCheck<0, ImmCheck0_3>, ImmCheck<2, ImmCheck0_3>]>; -defm SVST1_ZA64 : ZAStore<"za64", "l", "aarch64_sme_st1d", [ImmCheck<0, ImmCheck0_7>, ImmCheck<2, ImmCheck0_1>]>; -defm SVST1_ZA128 : ZAStore<"za128", "q", "aarch64_sme_st1q", [ImmCheck<0, ImmCheck0_15>, ImmCheck<2, ImmCheck0_0>]>; +defm SVST1_ZA8 : ZAStore<"za8", "c", "aarch64_sme_st1b", [ImmCheck<0, ImmCheck0_0>]>; +defm SVST1_ZA16 : ZAStore<"za16", "s", "aarch64_sme_st1h", [ImmCheck<0, ImmCheck0_1>]>; +defm SVST1_ZA32 : ZAStore<"za32", "i", "aarch64_sme_st1w", [ImmCheck<0, ImmCheck0_3>]>; +defm SVST1_ZA64 : ZAStore<"za64", "l", "aarch64_sme_st1d", [ImmCheck<0, ImmCheck0_7>]>; +defm SVST1_ZA128 : ZAStore<"za128", "q", "aarch64_sme_st1q", [ImmCheck<0, ImmCheck0_15>]>; -def SVSTR_VNUM_ZA : MInst<"svstr_vnum_za", "vmi%", "", +def SVSTR_VNUM_ZA : MInst<"svstr_vnum_za", "vm%l", "", [IsOverloadNone, IsStreamingCompatible, IsSharedZA, IsPreservesZA], - MemEltTyDefault, "aarch64_sme_str", - [ImmCheck<1, ImmCheck0_15>]>; + MemEltTyDefault, "aarch64_sme_str">; + +def SVSTR_ZA : MInst<"svstr_za", "vm%", "", + [IsOverloadNone, IsStreamingCompatible, IsSharedZA, IsPreservesZA], + MemEltTyDefault, "aarch64_sme_str", []>; //////////////////////////////////////////////////////////////////////////////// // Read horizontal/vertical ZA slices multiclass ZARead ch> { let TargetGuard = "sme" in { - def NAME # _H : SInst<"svread_hor_" # n_suffix # "[_{d}]", "ddPimi", t, + def NAME # _H : SInst<"svread_hor_" # n_suffix # "[_{d}]", "ddPim", t, MergeOp1, i_prefix # "_horiz", [IsReadZA, IsStreaming, IsSharedZA, IsPreservesZA], ch>; - def NAME # _V : SInst<"svread_ver_" # n_suffix # "[_{d}]", "ddPimi", t, + def NAME # _V : SInst<"svread_ver_" # n_suffix # "[_{d}]", "ddPim", t, MergeOp1, i_prefix # "_vert", [IsReadZA, IsStreaming, IsSharedZA, IsPreservesZA], ch>; } } -defm SVREAD_ZA8 : ZARead<"za8", "cUc", "aarch64_sme_read", [ImmCheck<2, ImmCheck0_0>, ImmCheck<4, ImmCheck0_15>]>; -defm SVREAD_ZA16 : ZARead<"za16", "sUshb", "aarch64_sme_read", [ImmCheck<2, ImmCheck0_1>, ImmCheck<4, ImmCheck0_7>]>; -defm SVREAD_ZA32 : ZARead<"za32", "iUif", "aarch64_sme_read", [ImmCheck<2, ImmCheck0_3>, ImmCheck<4, ImmCheck0_3>]>; -defm SVREAD_ZA64 : ZARead<"za64", "lUld", "aarch64_sme_read", [ImmCheck<2, ImmCheck0_7>, ImmCheck<4, ImmCheck0_1>]>; -defm SVREAD_ZA128 : ZARead<"za128", "csilUcUsUiUlhbfd", "aarch64_sme_readq", [ImmCheck<2, ImmCheck0_15>, ImmCheck<4, ImmCheck0_0>]>; +defm SVREAD_ZA8 : ZARead<"za8", "cUc", "aarch64_sme_read", [ImmCheck<2, ImmCheck0_0>]>; +defm SVREAD_ZA16 : ZARead<"za16", "sUshb", "aarch64_sme_read", [ImmCheck<2, ImmCheck0_1>]>; +defm SVREAD_ZA32 : ZARead<"za32", "iUif", "aarch64_sme_read", [ImmCheck<2, ImmCheck0_3>]>; +defm SVREAD_ZA64 : ZARead<"za64", "lUld", "aarch64_sme_read", [ImmCheck<2, ImmCheck0_7>]>; +defm SVREAD_ZA128 : ZARead<"za128", "csilUcUsUiUlhbfd", "aarch64_sme_readq", [ImmCheck<2, ImmCheck0_15>]>; //////////////////////////////////////////////////////////////////////////////// // Write horizontal/vertical ZA slices multiclass ZAWrite ch> { let TargetGuard = "sme" in { - def NAME # _H : SInst<"svwrite_hor_" # n_suffix # "[_{d}]", "vimiPd", t, + def NAME # _H : SInst<"svwrite_hor_" # n_suffix # "[_{d}]", "vimPd", t, MergeOp1, i_prefix # "_horiz", [IsWriteZA, IsStreaming, IsSharedZA], ch>; - def NAME # _V : SInst<"svwrite_ver_" # n_suffix # "[_{d}]", "vimiPd", t, + def NAME # _V : SInst<"svwrite_ver_" # n_suffix # "[_{d}]", "vimPd", t, MergeOp1, i_prefix # "_vert", [IsWriteZA, IsStreaming, IsSharedZA], ch>; } } -defm SVWRITE_ZA8 : ZAWrite<"za8", "cUc", "aarch64_sme_write", [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_15>]>; -defm SVWRITE_ZA16 : ZAWrite<"za16", "sUshb", "aarch64_sme_write", [ImmCheck<0, ImmCheck0_1>, ImmCheck<2, ImmCheck0_7>]>; -defm SVWRITE_ZA32 : ZAWrite<"za32", "iUif", "aarch64_sme_write", [ImmCheck<0, ImmCheck0_3>, ImmCheck<2, ImmCheck0_3>]>; -defm SVWRITE_ZA64 : ZAWrite<"za64", "lUld", "aarch64_sme_write", [ImmCheck<0, ImmCheck0_7>, ImmCheck<2, ImmCheck0_1>]>; -defm SVWRITE_ZA128 : ZAWrite<"za128", "csilUcUsUiUlhbfd", "aarch64_sme_writeq", [ImmCheck<0, ImmCheck0_15>, ImmCheck<2, ImmCheck0_0>]>; +defm SVWRITE_ZA8 : ZAWrite<"za8", "cUc", "aarch64_sme_write", [ImmCheck<0, ImmCheck0_0>]>; +defm SVWRITE_ZA16 : ZAWrite<"za16", "sUshb", "aarch64_sme_write", [ImmCheck<0, ImmCheck0_1>]>; +defm SVWRITE_ZA32 : ZAWrite<"za32", "iUif", "aarch64_sme_write", [ImmCheck<0, ImmCheck0_3>]>; +defm SVWRITE_ZA64 : ZAWrite<"za64", "lUld", "aarch64_sme_write", [ImmCheck<0, ImmCheck0_7>]>; +defm SVWRITE_ZA128 : ZAWrite<"za128", "csilUcUsUiUlhbfd", "aarch64_sme_writeq", [ImmCheck<0, ImmCheck0_15>]>; //////////////////////////////////////////////////////////////////////////////// // SME - Zero @@ -251,9 +257,99 @@ multiclass ZAFPOuterProd { def NAME # _ZA64_D: SInst<"sv" # n_suffix # "_za64[_{d}]", "viPPdd", "d", MergeOp1, "aarch64_sme_" # n_suffix, [IsStreaming, IsSharedZA], - [ImmCheck<0, ImmCheck0_3>]>; + [ImmCheck<0, ImmCheck0_7>]>; } } defm SVMOPA : ZAFPOuterProd<"mopa">; defm SVMOPS : ZAFPOuterProd<"mops">; + +//////////////////////////////////////////////////////////////////////////////// +// SME2 - ADD, SUB + +multiclass ZAAddSub { + let TargetGuard = "sme2" in { + def NAME # _WRITE_SINGLE_ZA32_VG1X2_I32 : Inst<"sv" # n_suffix # "_write[_single]_za32[_{d}]_vg1x2", "vm2d", "iUi", MergeNone, "aarch64_sme_" # n_suffix # "_write_single_za_vg1x2", [IsStreaming, IsSharedZA], []>; + def NAME # _WRITE_SINGLE_ZA32_VG1X4_I32 : Inst<"sv" # n_suffix # "_write[_single]_za32[_{d}]_vg1x4", "vm4d", "iUi", MergeNone, "aarch64_sme_" # n_suffix # "_write_single_za_vg1x4", [IsStreaming, IsSharedZA], []>; + + def NAME # _WRITE_ZA32_VG1X2_I32 : Inst<"sv" # n_suffix # "_write_za32[_{d}]_vg1x2", "vm22", "iUi", MergeNone, "aarch64_sme_" # n_suffix # "_write_za_vg1x2", [IsStreaming, IsSharedZA], []>; + def NAME # _WRITE_ZA32_VG1X4_I32 : Inst<"sv" # n_suffix # "_write_za32[_{d}]_vg1x4", "vm44", "iUi", MergeNone, "aarch64_sme_" # n_suffix # "_write_za_vg1x4", [IsStreaming, IsSharedZA], []>; + + def NAME # _ZA32_VG1x2_I32 : Inst<"sv" # n_suffix # "_za32[_{d}]_vg1x2", "vm2", "iUif", MergeNone, "aarch64_sme_" # n_suffix # "_za32_vg1x2", [IsStreaming, IsSharedZA], []>; + def NAME # _ZA32_VG1X4_I32 : Inst<"sv" # n_suffix # "_za32[_{d}]_vg1x4", "vm4", "iUif", MergeNone, "aarch64_sme_" # n_suffix # "_za32_vg1x4", [IsStreaming, IsSharedZA], []>; + + let TargetGuard = "sme-i16i64" in { + def NAME # _WRITE_SINGLE_ZA64_VG1X2_I64 : Inst<"sv" # n_suffix # "_write[_single]_za64[_{d}]_vg1x2", "vm2d", "lUl", MergeNone, "aarch64_sme_" # n_suffix # "_write_single_za_vg1x2", [IsStreaming, IsSharedZA], []>; + def NAME # _WRITE_SINGLE_ZA64_VG1X4_I64 : Inst<"sv" # n_suffix # "_write[_single]_za64[_{d}]_vg1x4", "vm4d", "lUl", MergeNone, "aarch64_sme_" # n_suffix # "_write_single_za_vg1x4", [IsStreaming, IsSharedZA], []>; + + def NAME # _WRITE_ZA64_VG1x2_I64 : Inst<"sv" # n_suffix # "_write_za64[_{d}]_vg1x2", "vm22", "lUl", MergeNone, "aarch64_sme_" # n_suffix # "_write_za_vg1x2", [IsStreaming, IsSharedZA], []>; + def NAME # _WRITE_ZA64_VG1x4_I64 : Inst<"sv" # n_suffix # "_write_za64[_{d}]_vg1x4", "vm44", "lUl", MergeNone, "aarch64_sme_" # n_suffix # "_write_za_vg1x4", [IsStreaming, IsSharedZA], []>; + + def NAME # _ZA64_VG1X2_I64 : Inst<"sv" # n_suffix # "_za64[_{d}]_vg1x2", "vm2", "lUl", MergeNone, "aarch64_sme_" # n_suffix # "_za64_vg1x2", [IsStreaming, IsSharedZA], []>; + def NAME # _ZA64_VG1X4_I64 : Inst<"sv" # n_suffix # "_za64[_{d}]_vg1x4", "vm4", "lUl", MergeNone, "aarch64_sme_" # n_suffix # "_za64_vg1x4", [IsStreaming, IsSharedZA], []>; + } + + let TargetGuard = "sme-f64f64" in { + def NAME # _ZA64_VG1X2_F64 : Inst<"sv" # n_suffix # "_za64[_{d}]_vg1x2", "vm2", "d", MergeNone, "aarch64_sme_" # n_suffix # "_za64_vg1x2", [IsStreaming, IsSharedZA], []>; + def NAME # _ZA64_VG1X4_F64 : Inst<"sv" # n_suffix # "_za64[_{d}]_vg1x4", "vm4", "d", MergeNone, "aarch64_sme_" # n_suffix # "_za64_vg1x4", [IsStreaming, IsSharedZA], []>; + } + } +} + +defm SVADD : ZAAddSub<"add">; +defm SVSUB : ZAAddSub<"sub">; + +// +// Outer product and accumulate/subtract +// + +let TargetGuard = "sme2" in { + def SVSMOPA : Inst<"svmopa_za32[_{d}]_m", "viPPdd", "s", MergeNone, "aarch64_sme_smopa_za32", [IsSharedZA, IsStreaming], [ImmCheck<0, ImmCheck0_3>]>; + def SVUSMOPA : Inst<"svmopa_za32[_{d}]_m", "viPPdd", "Us", MergeNone, "aarch64_sme_umopa_za32", [IsSharedZA, IsStreaming], [ImmCheck<0, ImmCheck0_3>]>; + + def SVSMOPS : Inst<"svmops_za32[_{d}]_m", "viPPdd", "s", MergeNone, "aarch64_sme_smops_za32", [IsSharedZA, IsStreaming], [ImmCheck<0, ImmCheck0_3>]>; + def SVUSMOPS : Inst<"svmops_za32[_{d}]_m", "viPPdd", "Us", MergeNone, "aarch64_sme_umops_za32", [IsSharedZA, IsStreaming], [ImmCheck<0, ImmCheck0_3>]>; + + def SVBMOPA : Inst<"svbmopa_za32[_{d}]_m", "viPPdd", "iUi", MergeNone, "aarch64_sme_bmopa_za32", [IsSharedZA, IsStreaming], [ImmCheck<0, ImmCheck0_3>]>; + + def SVBMOPS : Inst<"svbmops_za32[_{d}]_m", "viPPdd", "iUi", MergeNone, "aarch64_sme_bmops_za32", [IsSharedZA, IsStreaming], [ImmCheck<0, ImmCheck0_3>]>; +} + +// +// Spill and fill of ZT0 +// +let TargetGuard = "sme2" in { + def SVLDR_ZT : Inst<"svldr_zt", "viQ", "", MergeNone, "aarch64_sme_ldr_zt", [IsOverloadNone, IsStreamingCompatible, IsSharedZA], [ImmCheck<0, ImmCheck0_0>]>; + def SVSTR_ZT : Inst<"svstr_zt", "vi%", "", MergeNone, "aarch64_sme_str_zt", [IsOverloadNone, IsStreamingCompatible, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>]>; +} + +// +// Zero ZT0 +// +let TargetGuard = "sme2" in { + def SVZERO_ZT : Inst<"svzero_zt", "vi", "", MergeNone, "aarch64_sme_zero_zt", [IsOverloadNone, IsStreamingCompatible, IsSharedZA], [ImmCheck<0, ImmCheck0_0>]>; +} + +// +// lookup table expand four contiguous registers +// +let TargetGuard = "sme2" in { + def SVLUTI2_LANE_ZT_X4 : Inst<"svluti2_lane_zt_{d}_x4", "4.di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti2_lane_zt_x4", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_3>]>; + def SVLUTI4_LANE_ZT_X4 : Inst<"svluti4_lane_zt_{d}_x4", "4.di[i", "sUsiUibhf", MergeNone, "aarch64_sme_luti4_lane_zt_x4", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_1>]>; +} + +// +// lookup table expand one register +// +let TargetGuard = "sme2" in { + def SVLUTI2_LANE_ZT : Inst<"svluti2_lane_zt_{d}", "di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti2_lane_zt", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_15>]>; + def SVLUTI4_LANE_ZT : Inst<"svluti4_lane_zt_{d}", "di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti4_lane_zt", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_7>]>; +} + +// +// lookup table expand two contiguous registers +// +let TargetGuard = "sme2" in { + def SVLUTI2_LANE_ZT_X2 : Inst<"svluti2_lane_zt_{d}_x2", "2.di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti2_lane_zt_x2", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_7>]>; + def SVLUTI4_LANE_ZT_X2 : Inst<"svluti4_lane_zt_{d}_x2", "2.di[i", "cUcsUsiUibhf", MergeNone, "aarch64_sme_luti4_lane_zt_x2", [IsStreaming, IsSharedZA, IsPreservesZA], [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_3>]>; +} diff --git a/contrib/llvm-project/clang/include/clang/Basic/arm_sve.td b/contrib/llvm-project/clang/include/clang/Basic/arm_sve.td index 894a0a1296b0..55fd35c3b6c2 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/arm_sve.td +++ b/contrib/llvm-project/clang/include/clang/Basic/arm_sve.td @@ -298,6 +298,38 @@ let TargetGuard = "sve,bf16" in { def SVBFMLALT_LANE : SInst<"svbfmlalt_lane[_{0}]", "MMddi", "b", MergeNone, "aarch64_sve_bfmlalt_lane_v2", [IsOverloadNone], [ImmCheck<3, ImmCheck0_7>]>; } +let TargetGuard = "sve2p1" in { + // Contiguous zero-extending load to quadword (single vector). + def SVLD1UWQ : MInst<"svld1uwq[_{d}]", "dPc", "iUif", [IsLoad], MemEltTyInt32, "aarch64_sve_ld1uwq">; + def SVLD1UWQ_VNUM : MInst<"svld1uwq_vnum[_{d}]", "dPcl", "iUif", [IsLoad], MemEltTyInt32, "aarch64_sve_ld1uwq">; + + def SVLD1UDQ : MInst<"svld1udq[_{d}]", "dPc", "lUld", [IsLoad], MemEltTyInt64, "aarch64_sve_ld1udq">; + def SVLD1UDQ_VNUM : MInst<"svld1udq_vnum[_{d}]", "dPcl", "lUld", [IsLoad], MemEltTyInt64, "aarch64_sve_ld1udq">; + + // Load one vector (vector base + scalar offset) + def SVLD1Q_GATHER_U64BASE_OFFSET : MInst<"svld1q_gather[_{2}base]_offset_{d}", "dPgl", "cUcsUsiUilUlfhdb", [IsGatherLoad, IsByteIndexed], MemEltTyDefault, "aarch64_sve_ld1q_gather_scalar_offset">; + def SVLD1Q_GATHER_U64BASE : MInst<"svld1q_gather[_{2}base]_{d}", "dPg", "cUcsUsiUilUlfhdb", [IsGatherLoad, IsByteIndexed], MemEltTyDefault, "aarch64_sve_ld1q_gather_scalar_offset">; + + // Load one vector (scalar base + vector offset) + def SVLD1Q_GATHER_U64OFFSET : MInst<"svld1q_gather_[{3}]offset[_{d}]", "dPcg", "cUcsUsiUilUlfhdb", [IsGatherLoad, IsByteIndexed], MemEltTyDefault, "aarch64_sve_ld1q_gather_vector_offset">; + + // Load N-element structure into N vectors (scalar base) + defm SVLD2Q : StructLoad<"svld2q[_{2}]", "2Pc", "aarch64_sve_ld2q_sret">; + defm SVLD3Q : StructLoad<"svld3q[_{2}]", "3Pc", "aarch64_sve_ld3q_sret">; + defm SVLD4Q : StructLoad<"svld4q[_{2}]", "4Pc", "aarch64_sve_ld4q_sret">; + + // Load N-element structure into N vectors (scalar base, VL displacement) + defm SVLD2Q_VNUM : StructLoad<"svld2q_vnum[_{2}]", "2Pcl", "aarch64_sve_ld2q_sret">; + defm SVLD3Q_VNUM : StructLoad<"svld3q_vnum[_{2}]", "3Pcl", "aarch64_sve_ld3q_sret">; + defm SVLD4Q_VNUM : StructLoad<"svld4q_vnum[_{2}]", "4Pcl", "aarch64_sve_ld4q_sret">; + + // Load quadwords (scalar base + vector index) + def SVLD1Q_GATHER_INDICES_U : MInst<"svld1q_gather_[{3}]index[_{d}]", "dPcg", "sUsiUilUlbhfd", [IsGatherLoad], MemEltTyDefault, "aarch64_sve_ld1q_gather_index">; + + // Load quadwords (vector base + scalar index) + def SVLD1Q_GATHER_INDEX_S : MInst<"svld1q_gather[_{2}base]_index_{d}", "dPgl", "sUsiUilUlbhfd", [IsGatherLoad], MemEltTyDefault, "aarch64_sve_ld1q_gather_scalar_offset">; +} + //////////////////////////////////////////////////////////////////////////////// // Stores @@ -420,6 +452,38 @@ let TargetGuard = "sve,bf16" in { def SVSTNT1_VNUM_BF : MInst<"svstnt1_vnum[_{d}]", "vPpld", "b", [IsStore], MemEltTyDefault, "aarch64_sve_stnt1">; } +let TargetGuard = "sve2p1" in { + // Contiguous truncating store from quadword (single vector). + def SVST1UWQ : MInst<"svst1uwq[_{d}]", "vPcd", "iUif", [IsStore], MemEltTyInt32, "aarch64_sve_st1uwq">; + def SVST1UWQ_VNUM : MInst<"svst1uwq_vnum[_{d}]", "vPcld", "iUif", [IsStore], MemEltTyInt32, "aarch64_sve_st1uwq">; + + def SVST1UDQ : MInst<"svst1udq[_{d}]", "vPcd", "lUld", [IsStore], MemEltTyInt64, "aarch64_sve_st1udq">; + def SVST1UDQ_VNUM : MInst<"svst1udq_vnum[_{d}]", "vPcld", "lUld", [IsStore], MemEltTyInt64, "aarch64_sve_st1udq">; + + // Store one vector (vector base + scalar offset) + def SVST1Q_SCATTER_U64BASE_OFFSET : MInst<"svst1q_scatter[_{2}base]_offset[_{d}]", "vPgld", "cUcsUsiUilUlfhdb", [IsScatterStore, IsByteIndexed], MemEltTyDefault, "aarch64_sve_st1q_scatter_scalar_offset">; + def SVST1Q_SCATTER_U64BASE : MInst<"svst1q_scatter[_{2}base][_{d}]", "vPgd", "cUcsUsiUilUlfhdb", [IsScatterStore, IsByteIndexed], MemEltTyDefault, "aarch64_sve_st1q_scatter_scalar_offset">; + + // Store one vector (scalar base + vector offset) + def SVST1Q_SCATTER_U64OFFSET : MInst<"svst1q_scatter_[{3}]offset[_{d}]", "vPpgd", "cUcsUsiUilUlfhdb", [IsScatterStore, IsByteIndexed], MemEltTyDefault, "aarch64_sve_st1q_scatter_vector_offset">; + + // Store N vectors into N-element structure (scalar base) + defm SVST2Q : StructStore<"svst2q[_{d}]", "vPc2", "aarch64_sve_st2q">; + defm SVST3Q : StructStore<"svst3q[_{d}]", "vPc3", "aarch64_sve_st3q">; + defm SVST4Q : StructStore<"svst4q[_{d}]", "vPc4", "aarch64_sve_st4q">; + + // Store N vectors into N-element structure (scalar base, VL displacement) + defm SVST2Q_VNUM : StructStore<"svst2q_vnum[_{d}]", "vPcl2", "aarch64_sve_st2q">; + defm SVST3Q_VNUM : StructStore<"svst3q_vnum[_{d}]", "vPcl3", "aarch64_sve_st3q">; + defm SVST4Q_VNUM : StructStore<"svst4q_vnum[_{d}]", "vPcl4", "aarch64_sve_st4q">; + + // Scatter store quadwords (scalar base + vector index) + def SVST1Q_SCATTER_INDICES_U : MInst<"svst1q_scatter_[{3}]index[_{d}]", "vPpgd", "sUsiUilUlbhfd", [IsScatterStore], MemEltTyDefault, "aarch64_sve_st1q_scatter_index">; + + // Scatter store quadwords (vector base + scalar index) + def SVST1Q_SCATTER_INDEX_S : MInst<"svst1q_scatter[_{2}base]_index[_{d}]", "vPgld", "sUsiUilUlbhfd", [IsScatterStore], MemEltTyDefault, "aarch64_sve_st1q_scatter_scalar_offset">; +} + //////////////////////////////////////////////////////////////////////////////// // Prefetches @@ -1232,6 +1296,11 @@ def SVCREATE_3_BF16 : SInst<"svcreate3[_{d}]", "3ddd", "b", MergeNone, "", [IsT def SVCREATE_4_BF16 : SInst<"svcreate4[_{d}]", "4dddd", "b", MergeNone, "", [IsTupleCreate]>; } +let TargetGuard = "sve2p1" in { + def SVCREATE_2_B : SInst<"svcreate2[_{d}]", "2dd", "Pc", MergeNone, "", [IsTupleCreate]>; + def SVCREATE_4_B : SInst<"svcreate4[_{d}]", "4dddd", "Pc", MergeNone, "", [IsTupleCreate]>; +} + //////////////////////////////////////////////////////////////////////////////// // Vector insertion and extraction def SVGET_2 : SInst<"svget2[_{d}]", "d2i", "csilUcUsUiUlhfd", MergeNone, "", [IsTupleGet], [ImmCheck<1, ImmCheck0_1>]>; @@ -1252,6 +1321,13 @@ def SVSET_3_BF16 : SInst<"svset3[_{d}]", "33id", "b", MergeNone, "", [IsTupleSet def SVSET_4_BF16 : SInst<"svset4[_{d}]", "44id", "b", MergeNone, "", [IsTupleSet], [ImmCheck<1, ImmCheck0_3>]>; } +let TargetGuard = "sve2p1" in { + def SVGET_2_B : SInst<"svget2[_{d}]", "d2i", "Pc", MergeNone, "", [IsTupleGet], [ImmCheck<1, ImmCheck0_1>]>; + def SVGET_4_B : SInst<"svget4[_{d}]", "d4i", "Pc", MergeNone, "", [IsTupleGet], [ImmCheck<1, ImmCheck0_3>]>; + + def SVSET_2_B : SInst<"svset2[_{d}]", "22id", "Pc", MergeNone, "", [IsTupleSet], [ImmCheck<1, ImmCheck0_1>]>; + def SVSET_4_B : SInst<"svset4[_{d}]", "44id", "Pc", MergeNone, "", [IsTupleSet], [ImmCheck<1, ImmCheck0_3>]>; +} //////////////////////////////////////////////////////////////////////////////// // SVE2 WhileGE/GT let TargetGuard = "sve2" in { @@ -1859,12 +1935,374 @@ def SVBGRP : SInst<"svbgrp[_{d}]", "ddd", "UcUsUiUl", MergeNone, "aarch64_sv def SVBGRP_N : SInst<"svbgrp[_n_{d}]", "dda", "UcUsUiUl", MergeNone, "aarch64_sve_bgrp_x">; } +let TargetGuard = "sve2p1|sme" in { +def SVPSEL_B : SInst<"svpsel_lane_b8", "PPPm", "Pc", MergeNone, "", [IsStreamingCompatible], []>; +def SVPSEL_H : SInst<"svpsel_lane_b16", "PPPm", "Ps", MergeNone, "", [IsStreamingCompatible], []>; +def SVPSEL_S : SInst<"svpsel_lane_b32", "PPPm", "Pi", MergeNone, "", [IsStreamingCompatible], []>; +def SVPSEL_D : SInst<"svpsel_lane_b64", "PPPm", "Pl", MergeNone, "", [IsStreamingCompatible], []>; +def SVPSEL_COUNT_ALIAS_B : SInst<"svpsel_lane_c8", "}}Pm", "Pc", MergeNone, "", [IsStreamingCompatible], []>; +def SVPSEL_COUNT_ALIAS_H : SInst<"svpsel_lane_c16", "}}Pm", "Ps", MergeNone, "", [IsStreamingCompatible], []>; +def SVPSEL_COUNT_ALIAS_S : SInst<"svpsel_lane_c32", "}}Pm", "Pi", MergeNone, "", [IsStreamingCompatible], []>; +def SVPSEL_COUNT_ALIAS_D : SInst<"svpsel_lane_c64", "}}Pm", "Pl", MergeNone, "", [IsStreamingCompatible], []>; +} + +// Standalone sve2.1 builtins let TargetGuard = "sve2p1" in { -def SVFCLAMP : SInst<"svclamp[_{d}]", "dddd", "hfd", MergeNone, "aarch64_sve_fclamp", [], []>; -def SVPTRUE_COUNT : SInst<"svptrue_{d}", "}v", "QcQsQiQl", MergeNone, "aarch64_sve_ptrue_{d}", [IsOverloadNone], []>; +def SVORQV : SInst<"svorqv[_{d}]", "{Pd", "csilUcUsUiUl", MergeNone, "aarch64_sve_orqv", [IsReductionQV]>; +def SVEORQV : SInst<"sveorqv[_{d}]", "{Pd", "csilUcUsUiUl", MergeNone, "aarch64_sve_eorqv", [IsReductionQV]>; +def SVADDQV : SInst<"svaddqv[_{d}]", "{Pd", "hfdcsilUcUsUiUl", MergeNone, "aarch64_sve_addqv", [IsReductionQV]>; +def SVANDQV : SInst<"svandqv[_{d}]", "{Pd", "csilUcUsUiUl", MergeNone, "aarch64_sve_andqv", [IsReductionQV]>; +def SVSMAXQV : SInst<"svmaxqv[_{d}]", "{Pd", "csil", MergeNone, "aarch64_sve_smaxqv", [IsReductionQV]>; +def SVUMAXQV : SInst<"svmaxqv[_{d}]", "{Pd", "UcUsUiUl", MergeNone, "aarch64_sve_umaxqv", [IsReductionQV]>; +def SVSMINQV : SInst<"svminqv[_{d}]", "{Pd", "csil", MergeNone, "aarch64_sve_sminqv", [IsReductionQV]>; +def SVUMINQV : SInst<"svminqv[_{d}]", "{Pd", "UcUsUiUl", MergeNone, "aarch64_sve_uminqv", [IsReductionQV]>; + +def SVFMAXNMQV: SInst<"svmaxnmqv[_{d}]", "{Pd", "hfd", MergeNone, "aarch64_sve_fmaxnmqv", [IsReductionQV]>; +def SVFMINNMQV: SInst<"svminnmqv[_{d}]", "{Pd", "hfd", MergeNone, "aarch64_sve_fminnmqv", [IsReductionQV]>; +def SVFMAXQV: SInst<"svmaxqv[_{d}]", "{Pd", "hfd", MergeNone, "aarch64_sve_fmaxqv", [IsReductionQV]>; +def SVFMINQV: SInst<"svminqv[_{d}]", "{Pd", "hfd", MergeNone, "aarch64_sve_fminqv", [IsReductionQV]>; +} + +let TargetGuard = "sve2p1|sme2" in { +//FIXME: Replace IsStreamingCompatible with IsStreamingOrHasSVE2p1 when available +def SVPEXT_SINGLE : SInst<"svpext_lane_{d}", "P}i", "QcQsQiQl", MergeNone, "aarch64_sve_pext", [IsStreamingCompatible], [ImmCheck<1, ImmCheck0_3>]>; +def SVPEXT_X2 : SInst<"svpext_lane_{d}_x2", "2.P}i", "QcQsQiQl", MergeNone, "aarch64_sve_pext_x2", [IsStreamingCompatible], [ImmCheck<1, ImmCheck0_1>]>; +} + +let TargetGuard = "sve2p1" in { +def SVWHILEGE_COUNT : SInst<"svwhilege_{d}", "}lli", "QcQsQiQl", MergeNone, "aarch64_sve_whilege_{d}", [IsOverloadNone], [ImmCheck<2, ImmCheck2_4_Mul2>]>; +def SVWHILEGT_COUNT : SInst<"svwhilegt_{d}", "}lli", "QcQsQiQl", MergeNone, "aarch64_sve_whilegt_{d}", [IsOverloadNone], [ImmCheck<2, ImmCheck2_4_Mul2>]>; +def SVWHILELE_COUNT : SInst<"svwhilele_{d}", "}lli", "QcQsQiQl", MergeNone, "aarch64_sve_whilele_{d}", [IsOverloadNone], [ImmCheck<2, ImmCheck2_4_Mul2>]>; +def SVWHILELT_COUNT : SInst<"svwhilelt_{d}", "}lli", "QcQsQiQl", MergeNone, "aarch64_sve_whilelt_{d}", [IsOverloadNone], [ImmCheck<2, ImmCheck2_4_Mul2>]>; +def SVWHILELO_COUNT : SInst<"svwhilelo_{d}", "}nni", "QcQsQiQl", MergeNone, "aarch64_sve_whilelo_{d}", [IsOverloadNone], [ImmCheck<2, ImmCheck2_4_Mul2>]>; +def SVWHILELS_COUNT : SInst<"svwhilels_{d}", "}nni", "QcQsQiQl", MergeNone, "aarch64_sve_whilels_{d}", [IsOverloadNone], [ImmCheck<2, ImmCheck2_4_Mul2>]>; +def SVWHILEHI_COUNT : SInst<"svwhilehi_{d}", "}nni", "QcQsQiQl", MergeNone, "aarch64_sve_whilehi_{d}", [IsOverloadNone], [ImmCheck<2, ImmCheck2_4_Mul2>]>; +def SVWHILEHS_COUNT : SInst<"svwhilehs_{d}", "}nni", "QcQsQiQl", MergeNone, "aarch64_sve_whilehs_{d}", [IsOverloadNone], [ImmCheck<2, ImmCheck2_4_Mul2>]>; + +def SVLD1B_X2 : MInst<"svld1[_{2}]_x2", "2}c", "cUc", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x2">; +def SVLD1H_X2 : MInst<"svld1[_{2}]_x2", "2}c", "sUshb", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x2">; +def SVLD1W_X2 : MInst<"svld1[_{2}]_x2", "2}c", "iUif", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x2">; +def SVLD1D_X2 : MInst<"svld1[_{2}]_x2", "2}c", "lUld", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x2">; +def SVLD1B_X4 : MInst<"svld1[_{2}]_x4", "4}c", "cUc", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x4">; +def SVLD1H_X4 : MInst<"svld1[_{2}]_x4", "4}c", "sUshb", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x4">; +def SVLD1W_X4 : MInst<"svld1[_{2}]_x4", "4}c", "iUif", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x4">; +def SVLD1D_X4 : MInst<"svld1[_{2}]_x4", "4}c", "lUld", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x4">; + +def SVLDNT1B_X2 : MInst<"svldnt1[_{2}]_x2", "2}c", "cUc", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x2">; +def SVLDNT1H_X2 : MInst<"svldnt1[_{2}]_x2", "2}c", "sUshb", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x2">; +def SVLDNT1W_X2 : MInst<"svldnt1[_{2}]_x2", "2}c", "iUif", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x2">; +def SVLDNT1D_X2 : MInst<"svldnt1[_{2}]_x2", "2}c", "lUld", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x2">; +def SVLDNT1B_X4 : MInst<"svldnt1[_{2}]_x4", "4}c", "cUc", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x4">; +def SVLDNT1H_X4 : MInst<"svldnt1[_{2}]_x4", "4}c", "sUshb", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x4">; +def SVLDNT1W_X4 : MInst<"svldnt1[_{2}]_x4", "4}c", "iUif", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x4">; +def SVLDNT1D_X4 : MInst<"svldnt1[_{2}]_x4", "4}c", "lUld", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x4">; + +def SVLD1B_VNUM_X2 : MInst<"svld1_vnum[_{2}]_x2", "2}cl", "cUc", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x2">; +def SVLD1H_VNUM_X2 : MInst<"svld1_vnum[_{2}]_x2", "2}cl", "sUshb", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x2">; +def SVLD1W_VNUM_X2 : MInst<"svld1_vnum[_{2}]_x2", "2}cl", "iUif", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x2">; +def SVLD1D_VNUM_X2 : MInst<"svld1_vnum[_{2}]_x2", "2}cl", "lUld", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x2">; +def SVLD1B_VNUM_X4 : MInst<"svld1_vnum[_{2}]_x4", "4}cl", "cUc", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x4">; +def SVLD1H_VNUM_X4 : MInst<"svld1_vnum[_{2}]_x4", "4}cl", "sUshb", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x4">; +def SVLD1W_VNUM_X4 : MInst<"svld1_vnum[_{2}]_x4", "4}cl", "iUif", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x4">; +def SVLD1D_VNUM_X4 : MInst<"svld1_vnum[_{2}]_x4", "4}cl", "lUld", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ld1_pn_x4">; + +def SVLDNT1B_VNUM_X2 : MInst<"svldnt1_vnum[_{2}]_x2", "2}cl", "cUc", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x2">; +def SVLDNT1H_VNUM_X2 : MInst<"svldnt1_vnum[_{2}]_x2", "2}cl", "sUshb", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x2">; +def SVLDNT1W_VNUM_X2 : MInst<"svldnt1_vnum[_{2}]_x2", "2}cl", "iUif", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x2">; +def SVLDNT1D_VNUM_X2 : MInst<"svldnt1_vnum[_{2}]_x2", "2}cl", "lUld", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x2">; +def SVLDNT1B_VNUM_X4 : MInst<"svldnt1_vnum[_{2}]_x4", "4}cl", "cUc", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x4">; +def SVLDNT1H_VNUM_X4 : MInst<"svldnt1_vnum[_{2}]_x4", "4}cl", "sUshb", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x4">; +def SVLDNT1W_VNUM_X4 : MInst<"svldnt1_vnum[_{2}]_x4", "4}cl", "iUif", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x4">; +def SVLDNT1D_VNUM_X4 : MInst<"svldnt1_vnum[_{2}]_x4", "4}cl", "lUld", [IsStructLoad], MemEltTyDefault, "aarch64_sve_ldnt1_pn_x4">; + +def SVST1B_X2 : MInst<"svst1[_{2}_x2]", "v}p2", "cUc", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x2">; +def SVST1H_X2 : MInst<"svst1[_{2}_x2]", "v}p2", "sUshb", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x2">; +def SVST1W_X2 : MInst<"svst1[_{2}_x2]", "v}p2", "iUif", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x2">; +def SVST1D_X2 : MInst<"svst1[_{2}_x2]", "v}p2", "lUld", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x2">; +def SVST1B_X4 : MInst<"svst1[_{2}_x4]", "v}p4", "cUc", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x4">; +def SVST1H_X4 : MInst<"svst1[_{2}_x4]", "v}p4", "sUshb", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x4">; +def SVST1W_X4 : MInst<"svst1[_{2}_x4]", "v}p4", "iUif", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x4">; +def SVST1D_X4 : MInst<"svst1[_{2}_x4]", "v}p4", "lUld", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x4">; + +def SVST1B_VNUM_X2 : MInst<"svst1_vnum[_{2}_x2]", "v}pl2", "cUc", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x2">; +def SVST1H_VNUM_X2 : MInst<"svst1_vnum[_{2}_x2]", "v}pl2", "sUshb", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x2">; +def SVST1W_VNUM_X2 : MInst<"svst1_vnum[_{2}_x2]", "v}pl2", "iUif", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x2">; +def SVST1D_VNUM_X2 : MInst<"svst1_vnum[_{2}_x2]", "v}pl2", "lUld", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x2">; +def SVST1B_VNUM_X4 : MInst<"svst1_vnum[_{2}_x4]", "v}pl4", "cUc", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x4">; +def SVST1H_VNUM_X4 : MInst<"svst1_vnum[_{2}_x4]", "v}pl4", "sUshb", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x4">; +def SVST1W_VNUM_X4 : MInst<"svst1_vnum[_{2}_x4]", "v}pl4", "iUif", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x4">; +def SVST1D_VNUM_X4 : MInst<"svst1_vnum[_{2}_x4]", "v}pl4", "lUld", [IsStructStore], MemEltTyDefault, "aarch64_sve_st1_pn_x4">; + +def SVSTNT1B_X2 : MInst<"svstnt1[_{2}_x2]", "v}p2", "cUc", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x2">; +def SVSTNT1H_X2 : MInst<"svstnt1[_{2}_x2]", "v}p2", "sUshb", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x2">; +def SVSTNT1W_X2 : MInst<"svstnt1[_{2}_x2]", "v}p2", "iUif", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x2">; +def SVSTNT1D_X2 : MInst<"svstnt1[_{2}_x2]", "v}p2", "lUld", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x2">; +def SVSTNT1B_X4 : MInst<"svstnt1[_{2}_x4]", "v}p4", "cUc", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x4">; +def SVSTNT1H_X4 : MInst<"svstnt1[_{2}_x4]", "v}p4", "sUshb", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x4">; +def SVSTNT1W_X4 : MInst<"svstnt1[_{2}_x4]", "v}p4", "iUif", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x4">; +def SVSTNT1D_X4 : MInst<"svstnt1[_{2}_x4]", "v}p4", "lUld", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x4">; + +def SVSTNT1B_VNUM_X2 : MInst<"svstnt1_vnum[_{2}_x2]", "v}pl2", "cUc", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x2">; +def SVSTNT1H_VNUM_X2 : MInst<"svstnt1_vnum[_{2}_x2]", "v}pl2", "sUshb", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x2">; +def SVSTNT1W_VNUM_X2 : MInst<"svstnt1_vnum[_{2}_x2]", "v}pl2", "iUif", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x2">; +def SVSTNT1D_VNUM_X2 : MInst<"svstnt1_vnum[_{2}_x2]", "v}pl2", "lUld", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x2">; +def SVSTNT1B_VNUM_X4 : MInst<"svstnt1_vnum[_{2}_x4]", "v}pl4", "cUc", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x4">; +def SVSTNT1H_VNUM_X4 : MInst<"svstnt1_vnum[_{2}_x4]", "v}pl4", "sUshb", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x4">; +def SVSTNT1W_VNUM_X4 : MInst<"svstnt1_vnum[_{2}_x4]", "v}pl4", "iUif", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x4">; +def SVSTNT1D_VNUM_X4 : MInst<"svstnt1_vnum[_{2}_x4]", "v}pl4", "lUld", [IsStructStore], MemEltTyDefault, "aarch64_sve_stnt1_pn_x4">; + +def SVDOT_X2_S : SInst<"svdot[_{d}_{2}_{3}]", "ddhh", "i", MergeNone, "aarch64_sve_sdot_x2", [], []>; +def SVDOT_X2_U : SInst<"svdot[_{d}_{2}_{3}]", "ddhh", "Ui", MergeNone, "aarch64_sve_udot_x2", [], []>; +def SVDOT_X2_F : SInst<"svdot[_{d}_{2}_{3}]", "ddhh", "f", MergeNone, "aarch64_sve_fdot_x2", [], []>; +def SVDOT_LANE_X2_S : SInst<"svdot_lane[_{d}_{2}_{3}]", "ddhhi", "i", MergeNone, "aarch64_sve_sdot_lane_x2", [], [ImmCheck<3, ImmCheck0_3>]>; +def SVDOT_LANE_X2_U : SInst<"svdot_lane[_{d}_{2}_{3}]", "ddhhi", "Ui", MergeNone, "aarch64_sve_udot_lane_x2", [], [ImmCheck<3, ImmCheck0_3>]>; +def SVDOT_LANE_X2_F : SInst<"svdot_lane[_{d}_{2}_{3}]", "ddhhi", "f", MergeNone, "aarch64_sve_fdot_lane_x2", [], [ImmCheck<3, ImmCheck0_3>]>; + +def SVBFMLSLB : SInst<"svbfmlslb[_{d}]", "dd$$", "f", MergeNone, "aarch64_sve_bfmlslb", [IsOverloadNone], []>; +def SVBFMLSLT : SInst<"svbfmlslt[_{d}]", "dd$$", "f", MergeNone, "aarch64_sve_bfmlslt", [IsOverloadNone], []>; + +def SVBFMLSLB_LANE : SInst<"svbfmlslb_lane[_{d}]", "dd$$i", "f", MergeNone, "aarch64_sve_bfmlslb_lane", [IsOverloadNone], [ImmCheck<3, ImmCheck0_7>]>; +def SVBFMLSLT_LANE : SInst<"svbfmlslt_lane[_{d}]", "dd$$i", "f", MergeNone, "aarch64_sve_bfmlslt_lane", [IsOverloadNone], [ImmCheck<3, ImmCheck0_7>]>; } let TargetGuard = "sve2p1" in { def SVSCLAMP : SInst<"svclamp[_{d}]", "dddd", "csil", MergeNone, "aarch64_sve_sclamp", [], []>; def SVUCLAMP : SInst<"svclamp[_{d}]", "dddd", "UcUsUiUl", MergeNone, "aarch64_sve_uclamp", [], []>; + +defm SVREVD : SInstZPZ<"svrevd", "csilUcUsUiUl", "aarch64_sve_revd">; +} + +let TargetGuard = "sve2p1|sme2" in { + //FIXME: Replace IsStreamingCompatible with IsStreamingOrHasSVE2p1 when available + def SVPTRUE_COUNT : SInst<"svptrue_{d}", "}v", "QcQsQiQl", MergeNone, "aarch64_sve_ptrue_{d}", [IsOverloadNone, IsStreamingCompatible], []>; + + def SVPFALSE_COUNT_ALIAS : SInst<"svpfalse_c", "}v", "", MergeNone, "", [IsOverloadNone, IsStreamingCompatible]>; + + def SVFCLAMP : SInst<"svclamp[_{d}]", "dddd", "hfd", MergeNone, "aarch64_sve_fclamp", [IsStreamingCompatible], []>; + def SVCNTP_COUNT : SInst<"svcntp_{d}", "n}i", "QcQsQiQl", MergeNone, "aarch64_sve_cntp_{d}", [IsOverloadNone, IsStreamingCompatible], [ImmCheck<1, ImmCheck2_4_Mul2>]>; +} + +let TargetGuard = "sve2p1,b16b16" in { +defm SVMUL_BF : SInstZPZZ<"svmul", "b", "aarch64_sve_fmul", "aarch64_sve_fmul_u">; +defm SVADD_BF : SInstZPZZ<"svadd", "b", "aarch64_sve_fadd", "aarch64_sve_fadd_u">; +defm SVSUB_BF : SInstZPZZ<"svsub", "b", "aarch64_sve_fsub", "aarch64_sve_fsub_u">; +defm SVMAXNM_BF : SInstZPZZ<"svmaxnm","b", "aarch64_sve_fmaxnm", "aarch64_sve_fmaxnm_u">; +defm SVMINNM_BF : SInstZPZZ<"svminnm","b", "aarch64_sve_fminnm", "aarch64_sve_fminnm_u">; +defm SVMAX_BF : SInstZPZZ<"svmax", "b", "aarch64_sve_fmax", "aarch64_sve_fmax_u">; +defm SVMIN_BF : SInstZPZZ<"svmin", "b", "aarch64_sve_fmin", "aarch64_sve_fmin_u">; +defm SVMLA_BF : SInstZPZZZ<"svmla", "b", "aarch64_sve_fmla", "aarch64_sve_fmla_u", []>; +defm SVMLS_BF : SInstZPZZZ<"svmls", "b", "aarch64_sve_fmls", "aarch64_sve_fmls_u", []>; +def SVMLA_LANE_BF : SInst<"svmla_lane[_{d}]", "ddddi", "b", MergeNone, "aarch64_sve_fmla_lane", [], [ImmCheck<3, ImmCheckLaneIndex, 2>]>; +def SVMLS_LANE_BF : SInst<"svmls_lane[_{d}]", "ddddi", "b", MergeNone, "aarch64_sve_fmls_lane", [], [ImmCheck<3, ImmCheckLaneIndex, 2>]>; +def SVMUL_LANE_BF : SInst<"svmul_lane[_{d}]", "dddi", "b", MergeNone, "aarch64_sve_fmul_lane", [], [ImmCheck<2, ImmCheckLaneIndex, 1>]>; +def SVFCLAMP_BF : SInst<"svclamp[_{d}]", "dddd", "b", MergeNone, "aarch64_sve_fclamp", [], []>; +} //sve2p1,b16b16 + +// SME2 + +// SME intrinsics which operate only on vectors and do not require ZA should be added here, +// as they could possibly become SVE instructions in the future. + +multiclass MinMaxIntr { + def SVS # NAME : SInst<"sv" # i # "[" # zm # "_{d}_" # mul # "]", t, "csil", MergeNone, "aarch64_sve_s" # i # zm # "_" # mul, [IsStreaming], []>; + def SVU # NAME : SInst<"sv" # i # "[" # zm # "_{d}_" # mul # "]", t, "UcUsUiUl", MergeNone, "aarch64_sve_u" # i # zm # "_" # mul, [IsStreaming], []>; + def SVF # NAME : SInst<"sv" # i # "[" # zm # "_{d}_" # mul # "]", t, "hfd", MergeNone, "aarch64_sve_f" # i # zm # "_" # mul, [IsStreaming], []>; +} + +let TargetGuard = "sme2" in { +// == SMAX / UMAX / FMAX == + defm MAX_SINGLE_X2 : MinMaxIntr<"max", "_single", "x2", "22d">; + defm MAX_MULTI_X2 : MinMaxIntr<"max", "", "x2", "222">; + defm MAX_SINGLE_X4 : MinMaxIntr<"max", "_single", "x4", "44d">; + defm MAX_MULTI_X4 : MinMaxIntr<"max", "", "x4", "444">; + +// == SMIN / UMIN / FMIN == + defm MIN_SINGLE_X2 : MinMaxIntr<"min", "_single", "x2", "22d">; + defm MIN_MULTI_X2 : MinMaxIntr<"min", "", "x2", "222">; + defm MIN_SINGLE_X4 : MinMaxIntr<"min", "_single", "x4", "44d">; + defm MIN_MULTI_X4 : MinMaxIntr<"min", "", "x4", "444">; +} + +multiclass SInstMinMaxByVector { + def NAME # _SINGLE_X2 : SInst<"sv" # name # "nm[_single_{d}_x2]", "22d", "hfd", MergeNone, "aarch64_sve_f" # name # "nm_single_x2", [IsStreaming], []>; + def NAME # _SINGLE_X4 : SInst<"sv" # name # "nm[_single_{d}_x4]", "44d", "hfd", MergeNone, "aarch64_sve_f" # name # "nm_single_x4", [IsStreaming], []>; + + def NAME # _X2 : SInst<"sv" # name # "nm[_{d}_x2]", "222", "hfd", MergeNone, "aarch64_sve_f" # name # "nm_x2", [IsStreaming], []>; + def NAME # _X4 : SInst<"sv" # name # "nm[_{d}_x4]", "444", "hfd", MergeNone, "aarch64_sve_f" # name # "nm_x4", [IsStreaming], []>; +} + +let TargetGuard = "sme2" in { +// == FMINNM / FMAXNM == + defm SVMINNM : SInstMinMaxByVector<"min">; + defm SVMAXNM : SInstMinMaxByVector<"max">; +} + +let TargetGuard = "sme2" in { + def SVSCLAMP_X2 : SInst<"svclamp[_single_{d}_x2]", "22dd", "csil", MergeNone, "aarch64_sve_sclamp_single_x2", [IsStreaming], []>; + def SVUCLAMP_X2 : SInst<"svclamp[_single_{d}_x2]", "22dd", "UcUsUiUl", MergeNone, "aarch64_sve_uclamp_single_x2", [IsStreaming], []>; + def SVFCLAMP_X2 : SInst<"svclamp[_single_{d}_x2]", "22dd", "hfd", MergeNone, "aarch64_sve_fclamp_single_x2", [IsStreaming], []>; + + def SVSCLAMP_X4 : SInst<"svclamp[_single_{d}_x4]", "44dd", "csil", MergeNone, "aarch64_sve_sclamp_single_x4", [IsStreaming], []>; + def SVUCLAMP_X4 : SInst<"svclamp[_single_{d}_x4]", "44dd", "UcUsUiUl", MergeNone, "aarch64_sve_uclamp_single_x4", [IsStreaming], []>; + def SVFCLAMP_X4 : SInst<"svclamp[_single_{d}_x4]", "44dd", "hfd", MergeNone, "aarch64_sve_fclamp_single_x4", [IsStreaming], []>; +} + +let TargetGuard = "sme2" in { +// == ADD (vectors) == + def SVADD_SINGLE_X2 : SInst<"svadd[_single_{d}_x2]", "22d", "cUcsUsiUilUl", MergeNone, "aarch64_sve_add_single_x2", [IsStreaming], []>; + def SVADD_SINGLE_X4 : SInst<"svadd[_single_{d}_x4]", "44d", "cUcsUsiUilUl", MergeNone, "aarch64_sve_add_single_x4", [IsStreaming], []>; + + // 2-way and 4-way selects + def SVSEL_X2 : SInst<"svsel[_{d}_x2]", "2}22", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_sel_x2", [IsStreaming], []>; + def SVSEL_X4 : SInst<"svsel[_{d}_x4]", "4}44", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_sel_x4", [IsStreaming], []>; + + // SRSHL / URSHL + def SVSRSHL_SINGLE_X2 : SInst<"svrshl[_single_{d}_x2]", "22d", "csil", MergeNone, "aarch64_sve_srshl_single_x2", [IsStreaming], []>; + def SVURSHL_SINGLE_X2 : SInst<"svrshl[_single_{d}_x2]", "22d", "UcUsUiUl", MergeNone, "aarch64_sve_urshl_single_x2", [IsStreaming], []>; + def SVSRSHL_SINGLE_X4 : SInst<"svrshl[_single_{d}_x4]", "44d", "csil", MergeNone, "aarch64_sve_srshl_single_x4", [IsStreaming], []>; + def SVURSHL_SINGLE_X4 : SInst<"svrshl[_single_{d}_x4]", "44d", "UcUsUiUl", MergeNone, "aarch64_sve_urshl_single_x4", [IsStreaming], []>; + + def SVSRSHL_X2 : SInst<"svrshl[_{d}_x2]", "222", "csil", MergeNone, "aarch64_sve_srshl_x2", [IsStreaming], []>; + def SVURSHL_X2 : SInst<"svrshl[_{d}_x2]", "222", "UcUsUiUl", MergeNone, "aarch64_sve_urshl_x2", [IsStreaming], []>; + def SVSRSHL_X4 : SInst<"svrshl[_{d}_x4]", "444", "csil", MergeNone, "aarch64_sve_srshl_x4", [IsStreaming], []>; + def SVURSHL_X4 : SInst<"svrshl[_{d}_x4]", "444", "UcUsUiUl", MergeNone, "aarch64_sve_urshl_x4", [IsStreaming], []>; + + def SVQRSHRN_X4 : SInst<"svqrshrn[_n]_{0}[_{d}_x4]", "q4i", "il", MergeNone, "aarch64_sve_sqrshrn_x4", [IsStreaming], [ImmCheck<1, ImmCheckShiftRight, 0>]>; + def SVUQRSHRN_X4 : SInst<"svqrshrn[_n]_{0}[_{d}_x4]", "b4i", "UiUl", MergeNone, "aarch64_sve_uqrshrn_x4", [IsStreaming], [ImmCheck<1, ImmCheckShiftRight, 0>]>; + + // SQRSHR / UQRSHR + def SVQRSHR_X2 : SInst<"svqrshr[_n]_{0}[_{d}_x2]", "h2i", "i", MergeNone, "aarch64_sve_sqrshr_x2", [IsStreaming], [ImmCheck<1, ImmCheck1_16>]>; + def SVUQRSHR_X2 : SInst<"svqrshr[_n]_{0}[_{d}_x2]", "e2i", "Ui", MergeNone, "aarch64_sve_uqrshr_x2", [IsStreaming], [ImmCheck<1, ImmCheck1_16>]>; + def SVQRSHR_X4 : SInst<"svqrshr[_n]_{0}[_{d}_x4]", "q4i", "il", MergeNone, "aarch64_sve_sqrshr_x4", [IsStreaming], [ImmCheck<1, ImmCheckShiftRight, 0>]>; + def SVUQRSHR_X4 : SInst<"svqrshr[_n]_{0}[_{d}_x4]", "b4i", "UiUl", MergeNone, "aarch64_sve_uqrshr_x4", [IsStreaming], [ImmCheck<1, ImmCheckShiftRight, 0>]>; + + // SQRSHRU + def SVSQRSHRU_X2 : SInst<"svqrshru[_n]_{0}[_{d}_x2]", "e2i", "i", MergeNone, "aarch64_sve_sqrshru_x2", [IsStreaming], [ImmCheck<1, ImmCheck1_16>]>; + def SVSQRSHRU_X4 : SInst<"svqrshru[_n]_{0}[_{d}_x4]", "b4i", "il", MergeNone, "aarch64_sve_sqrshru_x4", [IsStreaming], [ImmCheck<1, ImmCheckShiftRight, 0>]>; + + def SVSQRSHRUN_X4 : SInst<"svqrshrun[_n]_{0}[_{d}_x4]", "b4i", "il", MergeNone, "aarch64_sve_sqrshrun_x4", [IsStreaming], [ImmCheck<1, ImmCheckShiftRight, 0>]>; + + def REINTERPRET_SVBOOL_TO_SVCOUNT : Inst<"svreinterpret[_c]", "}P", "Pc", MergeNone, "", [IsStreamingCompatible], []>; + def REINTERPRET_SVCOUNT_TO_SVBOOL : Inst<"svreinterpret[_b]", "P}", "Pc", MergeNone, "", [IsStreamingCompatible], []>; + + // SQDMULH + def SVSQDMULH_SINGLE_X2 : SInst<"svqdmulh[_single_{d}_x2]", "22d", "csil", MergeNone, "aarch64_sve_sqdmulh_single_vgx2", [IsStreaming], []>; + def SVSQDMULH_SINGLE_X4 : SInst<"svqdmulh[_single_{d}_x4]", "44d", "csil", MergeNone, "aarch64_sve_sqdmulh_single_vgx4", [IsStreaming], []>; + def SVSQDMULH_X2 : SInst<"svqdmulh[_{d}_x2]", "222", "csil", MergeNone, "aarch64_sve_sqdmulh_vgx2", [IsStreaming], []>; + def SVSQDMULH_X4 : SInst<"svqdmulh[_{d}_x4]", "444", "csil", MergeNone, "aarch64_sve_sqdmulh_vgx4", [IsStreaming], []>; +} + +let TargetGuard = "sve2p1|sme2" in { + // SQRSHRN / UQRSHRN + def SVQRSHRN_X2 : SInst<"svqrshrn[_n]_{0}[_{d}_x2]", "h2i", "i", MergeNone, "aarch64_sve_sqrshrn_x2", [IsStreamingCompatible], [ImmCheck<1, ImmCheck1_16>]>; + def SVUQRSHRN_X2 : SInst<"svqrshrn[_n]_{0}[_{d}_x2]", "e2i", "Ui", MergeNone, "aarch64_sve_uqrshrn_x2", [IsStreamingCompatible], [ImmCheck<1, ImmCheck1_16>]>; + + // SQRSHRUN + def SVSQRSHRUN_X2 : SInst<"svqrshrun[_n]_{0}[_{d}_x2]", "e2i", "i", MergeNone, "aarch64_sve_sqrshrun_x2", [IsStreamingCompatible], [ImmCheck<1, ImmCheck1_16>]>; +} + +let TargetGuard = "sve2p1" in { + // ZIPQ1, ZIPQ2, UZPQ1, UZPQ2 + def SVZIPQ1 : SInst<"svzipq1[_{d}]", "ddd", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_zipq1", [], []>; + def SVZIPQ2 : SInst<"svzipq2[_{d}]", "ddd", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_zipq2", [], []>; + def SVUZPQ1 : SInst<"svuzpq1[_{d}]", "ddd", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_uzpq1", [], []>; + def SVUZPQ2 : SInst<"svuzpq2[_{d}]", "ddd", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_uzpq2", [], []>; + // TBLQ, TBXQ + def SVTBLQ : SInst<"svtblq[_{d}]", "ddu", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_tblq">; + def SVTBXQ : SInst<"svtbxq[_{d}]", "dddu", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_tbxq">; + // EXTQ + def EXTQ : SInst<"svextq_lane[_{d}]", "dddk", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_extq_lane", [], [ImmCheck<2, ImmCheck0_15>]>; + // PMOV + // Move to Pred + multiclass PMOV_TO_PRED flags=[], ImmCheckType immCh > { + def _LANE : Inst]>; + def _LANE_ZERO : SInst; + } + defm SVPMOV_B_TO_PRED : PMOV_TO_PRED<"svpmov", "cUc", "aarch64_sve_pmov_to_pred_lane", [], ImmCheck0_0>; + defm SVPMOV_H_TO_PRED : PMOV_TO_PRED<"svpmov", "sUs", "aarch64_sve_pmov_to_pred_lane", [], ImmCheck0_1>; + defm SVPMOV_S_TO_PRED : PMOV_TO_PRED<"svpmov", "iUi", "aarch64_sve_pmov_to_pred_lane", [], ImmCheck0_3>; + defm SVPMOV_D_TO_PRED : PMOV_TO_PRED<"svpmov", "lUl", "aarch64_sve_pmov_to_pred_lane", [], ImmCheck0_7>; + + // Move to Vector + multiclass PMOV_TO_VEC flags=[], ImmCheckType immCh > { + def _M : SInst]>; + def _Z : SInst; + } + def SVPMOV_TO_VEC_LANE_B : SInst<"svpmov_{d}_z", "dP", "cUc", MergeNone, "aarch64_sve_pmov_to_vector_lane_zeroing", [], []>; + defm SVPMOV_TO_VEC_LANE_H : PMOV_TO_VEC<"svpmov", "sUs", "aarch64_sve_pmov_to_vector_lane", [], ImmCheck1_1>; + defm SVPMOV_TO_VEC_LANE_S : PMOV_TO_VEC<"svpmov", "iUi", "aarch64_sve_pmov_to_vector_lane", [], ImmCheck1_3>; + defm SVPMOV_TO_VEC_LANE_D : PMOV_TO_VEC<"svpmov", "lUl", "aarch64_sve_pmov_to_vector_lane" ,[], ImmCheck1_7>; +} + +// +// Multi-vector convert to/from floating-point. +// +let TargetGuard = "sme2" in { + def SVCVT_F16_X2 : SInst<"svcvt_f16[_f32_x2]", "e2", "f", MergeNone, "aarch64_sve_fcvt_x2", [IsStreaming],[]>; + def SVCVT_BF16_X2 : SInst<"svcvt_bf16[_f32_x2]", "$2", "f", MergeNone, "aarch64_sve_bfcvt_x2", [IsOverloadNone, IsStreaming],[]>; + + def SVCVT_F32_U32_X2 : SInst<"svcvt_{d}[_u32_x2]", "2.d2.u", "f", MergeNone, "aarch64_sve_fcvtu_x2", [IsStreaming], []>; + def SVCVT_U32_F32_X2 : SInst<"svcvt_u32[_{d}_x2]", "2.u2.d", "f", MergeNone, "aarch64_sve_ucvtf_x2", [IsStreaming], []>; + def SVCVT_F32_S32_X2 : SInst<"svcvt_{d}[_s32_x2]", "2.d2.x", "f", MergeNone, "aarch64_sve_fcvts_x2", [IsStreaming], []>; + def SVCVT_S32_F32_X2 : SInst<"svcvt_s32[_{d}_x2]", "2.x2.d", "f", MergeNone, "aarch64_sve_scvtf_x2", [IsStreaming], []>; + + def SVCVT_F32_U32_X4 : SInst<"svcvt_{d}[_u32_x4]", "4.d4.u", "f", MergeNone, "aarch64_sve_fcvtu_x4", [IsStreaming], []>; + def SVCVT_U32_F32_X4 : SInst<"svcvt_u32[_{d}_x4]", "4.u4.d", "f", MergeNone, "aarch64_sve_ucvtf_x4", [IsStreaming], []>; + def SVCVT_F32_S32_X4 : SInst<"svcvt_{d}[_s32_x4]", "4.d4.x", "f", MergeNone, "aarch64_sve_fcvts_x4", [IsStreaming], []>; + def SVCVT_S32_F32_X4 : SInst<"svcvt_s32[_{d}_x4]", "4.x4.d", "f", MergeNone, "aarch64_sve_scvtf_x4", [IsStreaming], []>; +} + +// +// Multi-vector floating-point convert from single-precision to interleaved half-precision/BFloat16 +// +let TargetGuard = "sme2" in { + def SVCVTN_F16_X2 : SInst<"svcvtn_f16[_f32_x2]", "e2", "f", MergeNone, "aarch64_sve_fcvtn_x2", [IsStreaming],[]>; + def SVCVTN_BF16_X2 : SInst<"svcvtn_bf16[_f32_x2]", "$2", "f", MergeNone, "aarch64_sve_bfcvtn_x2", [IsOverloadNone, IsStreaming],[]>; +} + +// +// Multi-vector saturating extract narrow +// +let TargetGuard = "sme2" in { + def SVQCVT_S16_S32_X2 : SInst<"svqcvt_s16[_{d}_x2]", "h2.d", "i", MergeNone, "aarch64_sve_sqcvt_x2", [IsStreaming], []>; + def SVQCVT_U16_U32_X2 : SInst<"svqcvt_u16[_{d}_x2]", "e2.d", "Ui", MergeNone, "aarch64_sve_uqcvt_x2", [IsStreaming], []>; + def SVQCVT_U16_S32_X2 : SInst<"svqcvt_u16[_{d}_x2]", "e2.d", "i", MergeNone, "aarch64_sve_sqcvtu_x2", [IsStreaming], []>; + + def SVQCVT_S8_S32_X4 : SInst<"svqcvt_s8[_{d}_x4]", "q4.d", "i", MergeNone, "aarch64_sve_sqcvt_x4", [IsStreaming], []>; + def SVQCVT_U8_U32_X4 : SInst<"svqcvt_u8[_{d}_x4]", "b4.d", "Ui", MergeNone, "aarch64_sve_uqcvt_x4", [IsStreaming], []>; + def SVQCVT_U8_S32_X4 : SInst<"svqcvt_u8[_{d}_x4]", "b4.d", "i", MergeNone, "aarch64_sve_sqcvtu_x4", [IsStreaming], []>; + + def SVQCVT_S16_S64_X4 : SInst<"svqcvt_s16[_{d}_x4]", "q4.d", "l", MergeNone, "aarch64_sve_sqcvt_x4", [IsStreaming], []>; + def SVQCVT_U16_U64_X4 : SInst<"svqcvt_u16[_{d}_x4]", "b4.d", "Ul", MergeNone, "aarch64_sve_uqcvt_x4", [IsStreaming], []>; + def SVQCVT_U16_S64_X4 : SInst<"svqcvt_u16[_{d}_x4]", "b4.d", "l", MergeNone, "aarch64_sve_sqcvtu_x4", [IsStreaming], []>; +} + +// +// Multi-vector saturating extract narrow and interleave +// +let TargetGuard = "sme2|sve2p1" in { + def SVQCVTN_S16_S32_X2 : SInst<"svqcvtn_s16[_{d}_x2]", "h2.d", "i", MergeNone, "aarch64_sve_sqcvtn_x2", [IsStreamingCompatible], []>; + def SVQCVTN_U16_U32_X2 : SInst<"svqcvtn_u16[_{d}_x2]", "e2.d", "Ui", MergeNone, "aarch64_sve_uqcvtn_x2", [IsStreamingCompatible], []>; + def SVQCVTN_U16_S32_X2 : SInst<"svqcvtn_u16[_{d}_x2]", "e2.d", "i", MergeNone, "aarch64_sve_sqcvtun_x2", [IsStreamingCompatible], []>; +} + +let TargetGuard = "sme2" in { + def SVQCVTN_S8_S32_X4 : SInst<"svqcvtn_s8[_{d}_x4]", "q4.d", "i", MergeNone, "aarch64_sve_sqcvtn_x4", [IsStreaming], []>; + def SVQCVTN_U8_U32_X4 : SInst<"svqcvtn_u8[_{d}_x4]", "b4.d", "Ui", MergeNone, "aarch64_sve_uqcvtn_x4", [IsStreaming], []>; + def SVQCVTN_U8_S32_X4 : SInst<"svqcvtn_u8[_{d}_x4]", "b4.d", "i", MergeNone, "aarch64_sve_sqcvtun_x4", [IsStreaming], []>; + + def SVQCVTN_S16_S64_X4 : SInst<"svqcvtn_s16[_{d}_x4]", "q4.d", "l", MergeNone, "aarch64_sve_sqcvtn_x4", [IsStreaming], []>; + def SVQCVTN_U16_U64_X4 : SInst<"svqcvtn_u16[_{d}_x4]", "b4.d", "Ul", MergeNone, "aarch64_sve_uqcvtn_x4", [IsStreaming], []>; + def SVQCVTN_U16_S64_X4 : SInst<"svqcvtn_u16[_{d}_x4]", "b4.d", "l", MergeNone, "aarch64_sve_sqcvtun_x4", [IsStreaming], []>; +} + +// +// Multi-vector unpack +// + +let TargetGuard = "sme2" in { + def SVSUNPK_X2 : SInst<"svunpk_{d}[_{1}_x2]", "2h", "sil", MergeNone, "aarch64_sve_sunpk_x2", [IsStreaming], []>; + def SVUUNPK_X2 : SInst<"svunpk_{d}[_{1}_x2]", "2h", "UsUiUl", MergeNone, "aarch64_sve_uunpk_x2", [IsStreaming], []>; + def SVSUNPK_X4 : SInst<"svunpk_{d}[_{3}_x4]", "42.h", "sil", MergeNone, "aarch64_sve_sunpk_x4", [IsStreaming], []>; + def SVUUNPK_X4 : SInst<"svunpk_{d}[_{3}_x4]", "42.h", "UsUiUl", MergeNone, "aarch64_sve_uunpk_x4", [IsStreaming], []>; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/arm_sve_sme_incl.td b/contrib/llvm-project/clang/include/clang/Basic/arm_sve_sme_incl.td index 74c9b9266771..0dba8493bad2 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/arm_sve_sme_incl.td +++ b/contrib/llvm-project/clang/include/clang/Basic/arm_sve_sme_incl.td @@ -61,7 +61,8 @@ // ------------------- // prototype: return (arg, arg, ...) // -// 2,3,4: array of default vectors +// 2,3,4: array of vectors +// .: indicator for multi-vector modifier that will follow (e.g. 2.x) // v: void // x: vector of signed integers // u: vector of unsigned integers @@ -92,12 +93,14 @@ // m: uint32_t // n: uint64_t +// [: svuint8_t // t: svint32_t // z: svuint32_t // g: svuint64_t // O: svfloat16_t // M: svfloat32_t // N: svfloat64_t +// $: svbfloat16_t // J: Prefetch type (sv_prfop) @@ -126,6 +129,7 @@ // Z: const pointer to uint64_t // Prototype modifiers added for SVE2p1 +// {: 128b vector // }: svcount_t class MergeType { @@ -222,6 +226,7 @@ def IsSharedZA : FlagType<0x8000000000>; def IsPreservesZA : FlagType<0x10000000000>; def IsReadZA : FlagType<0x20000000000>; def IsWriteZA : FlagType<0x40000000000>; +def IsReductionQV : FlagType<0x80000000000>; // These must be kept in sync with the flags in include/clang/Basic/TargetBuiltins.h class ImmCheckType { @@ -246,6 +251,10 @@ def ImmCheck0_3 : ImmCheckType<15>; // 0..3 def ImmCheck0_0 : ImmCheckType<16>; // 0..0 def ImmCheck0_15 : ImmCheckType<17>; // 0..15 def ImmCheck0_255 : ImmCheckType<18>; // 0..255 +def ImmCheck2_4_Mul2 : ImmCheckType<19>; // 2, 4 +def ImmCheck1_1 : ImmCheckType<20>; // 1..1 +def ImmCheck1_3 : ImmCheckType<21>; // 1..3 +def ImmCheck1_7 : ImmCheckType<22>; // 1..7 class ImmCheck { int Arg = arg; @@ -254,7 +263,7 @@ class ImmCheck { } class Inst ft, list ch, MemEltType met> { + list ft, list ch, MemEltType met = MemEltTyDefault> { string Name = n; string Prototype = p; string Types = t; diff --git a/contrib/llvm-project/clang/include/clang/Basic/riscv_sifive_vector.td b/contrib/llvm-project/clang/include/clang/Basic/riscv_sifive_vector.td index 0d390be711c8..bb54e2664186 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/riscv_sifive_vector.td +++ b/contrib/llvm-project/clang/include/clang/Basic/riscv_sifive_vector.td @@ -72,34 +72,132 @@ multiclass RVVVCIXBuiltinSetWVType range, string prototype, } let SupportOverloading = false in { - defm sf_vc_x_se : RVVVCIXBuiltinSetWVType<["c", "s", "i", "l"], "0KzKzKzUe", [0, 3], /*UseGPR*/1>; - defm sf_vc_i_se : RVVVCIXBuiltinSetWVType<["c", "s", "i", "l"], "0KzKzKzKz", [2, 3], /*UseGPR*/0>; - defm sf_vc_xv : RVVVCIXBuiltinSet<["csi", "l"], "0KzKzUvUe", [0, 2, 3], /*UseGPR*/1>; - defm sf_vc_iv : RVVVCIXBuiltinSet<["csi", "l"], "0KzKzUvKz", [0, 2, 3], /*UseGPR*/0>; - defm sf_vc_vv : RVVVCIXBuiltinSet<["csi", "l"], "0KzKzUvUv", [0, 2, 3], /*UseGPR*/0>; - defm sf_vc_fv : RVVVCIXBuiltinSet<["si", "l"], "0KzKzUvFe", [0, 2, 3], /*UseGPR*/0>; - defm sf_vc_xvv : RVVVCIXBuiltinSet<["csi", "l"], "0KzUvUvUe", [0, 1, 3], /*UseGPR*/1>; - defm sf_vc_ivv : RVVVCIXBuiltinSet<["csi", "l"], "0KzUvUvKz", [0, 1, 3], /*UseGPR*/0>; - defm sf_vc_vvv : RVVVCIXBuiltinSet<["csi", "l"], "0KzUvUvUv", [0, 1, 3], /*UseGPR*/0>; - defm sf_vc_fvv : RVVVCIXBuiltinSet<["si", "l"], "0KzUvUvFe", [0, 1, 3], /*UseGPR*/0>; - defm sf_vc_v_x : RVVVCIXBuiltinSet<["csi", "l"], "UvKzKzUe", [-1, 1, 2], /*UseGPR*/1>; - defm sf_vc_v_i : RVVVCIXBuiltinSet<["csi", "l"], "UvKzKzKz", [-1, 1, 2], /*UseGPR*/0>; - defm sf_vc_v_xv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUe", [-1, 0, 2], /*UseGPR*/1>; - defm sf_vc_v_iv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvKz", [-1, 0, 2], /*UseGPR*/0>; - defm sf_vc_v_vv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUv", [-1, 0, 2], /*UseGPR*/0>; - defm sf_vc_v_fv : RVVVCIXBuiltinSet<["si", "l"], "UvKzUvFe", [-1, 0, 2], /*UseGPR*/0>; - defm sf_vc_v_xvv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUvUe", [-1, 0, 3], /*UseGPR*/1>; - defm sf_vc_v_ivv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUvKz", [-1, 0, 3], /*UseGPR*/0>; - defm sf_vc_v_vvv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUvUv", [-1, 0, 3], /*UseGPR*/0>; - defm sf_vc_v_fvv : RVVVCIXBuiltinSet<["si", "l"], "UvKzUvUvFe", [-1, 0, 3], /*UseGPR*/0>; + defm sf_vc_x_se : RVVVCIXBuiltinSetWVType<["c", "s", "i", "l"], "0KzKzKzUe", [0, 3], UseGPR=1>; + defm sf_vc_i_se : RVVVCIXBuiltinSetWVType<["c", "s", "i", "l"], "0KzKzKzKz", [2, 3], UseGPR=0>; + defm sf_vc_xv : RVVVCIXBuiltinSet<["csi", "l"], "0KzKzUvUe", [0, 2, 3], UseGPR=1>; + defm sf_vc_iv : RVVVCIXBuiltinSet<["csi", "l"], "0KzKzUvKz", [0, 2, 3], UseGPR=0>; + defm sf_vc_vv : RVVVCIXBuiltinSet<["csi", "l"], "0KzKzUvUv", [0, 2, 3], UseGPR=0>; + defm sf_vc_fv : RVVVCIXBuiltinSet<["si", "l"], "0KzKzUvFe", [0, 2, 3], UseGPR=0>; + defm sf_vc_xvv : RVVVCIXBuiltinSet<["csi", "l"], "0KzUvUvUe", [0, 1, 2, 3], UseGPR=1>; + defm sf_vc_ivv : RVVVCIXBuiltinSet<["csi", "l"], "0KzUvUvKz", [0, 1, 2, 3], UseGPR=0>; + defm sf_vc_vvv : RVVVCIXBuiltinSet<["csi", "l"], "0KzUvUvUv", [0, 1, 2, 3], UseGPR=0>; + defm sf_vc_fvv : RVVVCIXBuiltinSet<["si", "l"], "0KzUvUvFe", [0, 1, 2, 3], UseGPR=0>; + defm sf_vc_v_x : RVVVCIXBuiltinSet<["csi", "l"], "UvKzKzUe", [-1, 1, 2], UseGPR=1>; + defm sf_vc_v_i : RVVVCIXBuiltinSet<["csi", "l"], "UvKzKzKz", [-1, 1, 2], UseGPR=0>; + defm sf_vc_v_xv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUe", [-1, 0, 1, 2], UseGPR=1>; + defm sf_vc_v_iv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvKz", [-1, 0, 1, 2], UseGPR=0>; + defm sf_vc_v_vv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUv", [-1, 0, 1, 2], UseGPR=0>; + defm sf_vc_v_fv : RVVVCIXBuiltinSet<["si", "l"], "UvKzUvFe", [-1, 0, 1, 2], UseGPR=0>; + defm sf_vc_v_xvv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUvUe", [-1, 0, 1, 2, 3], UseGPR=1>; + defm sf_vc_v_ivv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUvKz", [-1, 0, 1, 2, 3], UseGPR=0>; + defm sf_vc_v_vvv : RVVVCIXBuiltinSet<["csi", "l"], "UvKzUvUvUv", [-1, 0, 1, 2, 3], UseGPR=0>; + defm sf_vc_v_fvv : RVVVCIXBuiltinSet<["si", "l"], "UvKzUvUvFe", [-1, 0, 1, 2, 3], UseGPR=0>; let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { - defm sf_vc_xvw : RVVVCIXBuiltinSet<["csi"], "0KzUwUvUe", [0, 1, 2, 3], /*UseGPR*/1>; - defm sf_vc_ivw : RVVVCIXBuiltinSet<["csi"], "0KzUwUvKz", [0, 1, 2, 3], /*UseGPR*/0>; - defm sf_vc_vvw : RVVVCIXBuiltinSet<["csi"], "0KzUwUvUv", [0, 1, 2, 3], /*UseGPR*/0>; - defm sf_vc_fvw : RVVVCIXBuiltinSet<["si"], "0KzUwUvFe", [0, 1, 2, 3], /*UseGPR*/0>; - defm sf_vc_v_xvw : RVVVCIXBuiltinSet<["csi"], "UwKzUwUvUe", [-1, 0, 2, 3], /*UseGPR*/1>; - defm sf_vc_v_ivw : RVVVCIXBuiltinSet<["csi"], "UwKzUwUvKz", [-1, 0, 2, 3], /*UseGPR*/0>; - defm sf_vc_v_vvw : RVVVCIXBuiltinSet<["csi"], "UwKzUwUvUv", [-1, 0, 2, 3], /*UseGPR*/0>; - defm sf_vc_v_fvw : RVVVCIXBuiltinSet<["si"], "UwKzUwUvFe", [-1, 0, 2, 3], /*UseGPR*/0>; + defm sf_vc_xvw : RVVVCIXBuiltinSet<["csi"], "0KzUwUvUe", [0, 1, 2, 3], UseGPR=1>; + defm sf_vc_ivw : RVVVCIXBuiltinSet<["csi"], "0KzUwUvKz", [0, 1, 2, 3], UseGPR=0>; + defm sf_vc_vvw : RVVVCIXBuiltinSet<["csi"], "0KzUwUvUv", [0, 1, 2, 3], UseGPR=0>; + defm sf_vc_fvw : RVVVCIXBuiltinSet<["si"], "0KzUwUvFe", [0, 1, 2, 3], UseGPR=0>; + defm sf_vc_v_xvw : RVVVCIXBuiltinSet<["csi"], "UwKzUwUvUe", [-1, 0, 1, 2, 3], UseGPR=1>; + defm sf_vc_v_ivw : RVVVCIXBuiltinSet<["csi"], "UwKzUwUvKz", [-1, 0, 1, 2, 3], UseGPR=0>; + defm sf_vc_v_vvw : RVVVCIXBuiltinSet<["csi"], "UwKzUwUvUv", [-1, 0, 1, 2, 3], UseGPR=0>; + defm sf_vc_v_fvw : RVVVCIXBuiltinSet<["si"], "UwKzUwUvFe", [-1, 0, 1, 2, 3], UseGPR=0>; } } + +multiclass RVVVFWMACCBuiltinSet> suffixes_prototypes> { + let OverloadedName = NAME, + Name = NAME, + HasMasked = false, + Log2LMUL = [-2, -1, 0, 1, 2] in + defm NAME : RVVOutOp1Op2BuiltinSet; +} + +multiclass RVVVQMACCBuiltinSet> suffixes_prototypes> { + let OverloadedName = NAME, + Name = NAME, + HasMasked = false, + Log2LMUL = [0, 1, 2, 3] in + defm NAME : RVVOutOp1Op2BuiltinSet; +} + +multiclass RVVVFNRCLIPBuiltinSet { + let Log2LMUL = [-3, -2, -1, 0, 1, 2], + Name = NAME, + IRName = NAME, + MaskedIRName = NAME # "_mask" in + def : RVVConvBuiltin; +} + +let UnMaskedPolicyScheme = HasPolicyOperand in + let RequiredFeatures = ["Xsfvqmaccdod"] in { + defm sf_vqmaccu_2x8x2 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)SUv(FixedSEW:8)Uv"]]>; + defm sf_vqmacc_2x8x2 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)Sv(FixedSEW:8)v"]]>; + defm sf_vqmaccus_2x8x2 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)SUv(FixedSEW:8)v"]]>; + defm sf_vqmaccsu_2x8x2 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)Sv(FixedSEW:8)Uv"]]>; + } + +let UnMaskedPolicyScheme = HasPolicyOperand in + let RequiredFeatures = ["Xsfvqmaccqoq"] in { + defm sf_vqmaccu_4x8x4 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)SUv(FixedSEW:8)Uv"]]>; + defm sf_vqmacc_4x8x4 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)Sv(FixedSEW:8)v"]]>; + defm sf_vqmaccus_4x8x4 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)SUv(FixedSEW:8)v"]]>; + defm sf_vqmaccsu_4x8x4 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)Sv(FixedSEW:8)Uv"]]>; + } + +let UnMaskedPolicyScheme = HasPolicyOperand in + let RequiredFeatures = ["Xsfvfwmaccqqq"] in + defm sf_vfwmacc_4x4x4 : RVVVFWMACCBuiltinSet<[["", "Fw", "FwFwSvv"]]>; + +let UnMaskedPolicyScheme = HasPassthruOperand, RequiredFeatures = ["Xsfvfnrclipxfqf"] in { +let ManualCodegen = [{ + { + // LLVM intrinsic + // Unmasked: (passthru, vector_in, scalar_in, frm, vl) + // Masked: (passthru, vector_in, scalar_in, mask, frm, vl, policy) + + SmallVector Operands; + bool HasMaskedOff = !( + (IsMasked && (PolicyAttrs & RVV_VTA) && (PolicyAttrs & RVV_VMA)) || + (!IsMasked && PolicyAttrs & RVV_VTA)); + bool HasRoundModeOp = IsMasked ? + (HasMaskedOff ? Ops.size() == 6 : Ops.size() == 5) : + (HasMaskedOff ? Ops.size() == 5 : Ops.size() == 4); + + unsigned Offset = IsMasked ? + (HasMaskedOff ? 2 : 1) : (HasMaskedOff ? 1 : 0); + + if (!HasMaskedOff) + Operands.push_back(llvm::PoisonValue::get(ResultType)); + else + Operands.push_back(Ops[IsMasked ? 1 : 0]); + + Operands.push_back(Ops[Offset]); // op0 + Operands.push_back(Ops[Offset + 1]); // op1 + + if (IsMasked) + Operands.push_back(Ops[0]); // mask + + if (HasRoundModeOp) { + Operands.push_back(Ops[Offset + 2]); // frm + Operands.push_back(Ops[Offset + 3]); // vl + } else { + Operands.push_back(ConstantInt::get(Ops[Offset + 2]->getType(), 7)); // frm + Operands.push_back(Ops[Offset + 2]); // vl + } + + if (IsMasked) + Operands.push_back(ConstantInt::get(Ops.back()->getType(), PolicyAttrs)); + + IntrinsicTypes = {ResultType, Ops[Offset]->getType(), Operands.back()->getType()}; + llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); + return Builder.CreateCall(F, Operands, ""); + } +}] in { + let HasFRMRoundModeOp = true in { + defm sf_vfnrclip_x_f_qf : RVVVFNRCLIPBuiltinSet<"v", "vFqfu", "c">; + defm sf_vfnrclip_xu_f_qf : RVVVFNRCLIPBuiltinSet<"Uv", "UvFqfu", "c">; + } + defm sf_vfnrclip_x_f_qf : RVVVFNRCLIPBuiltinSet<"v", "vFqf", "c">; + defm sf_vfnrclip_xu_f_qf : RVVVFNRCLIPBuiltinSet<"Uv", "UvFqf", "c">; +} +} diff --git a/contrib/llvm-project/clang/include/clang/Basic/riscv_vector.td b/contrib/llvm-project/clang/include/clang/Basic/riscv_vector.td index 6adc60031341..682f1d5c8af6 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/riscv_vector.td +++ b/contrib/llvm-project/clang/include/clang/Basic/riscv_vector.td @@ -14,453 +14,6 @@ include "riscv_vector_common.td" -//===----------------------------------------------------------------------===// -// Basic classes with automatic codegen. -//===----------------------------------------------------------------------===// - -class RVVOutBuiltin - : RVVBuiltin { - let IntrinsicTypes = [-1]; -} - -class RVVOp0Builtin - : RVVBuiltin { - let IntrinsicTypes = [0]; -} - -class RVVOutOp1Builtin - : RVVBuiltin { - let IntrinsicTypes = [-1, 1]; -} - -class RVVOutOp0Op1Builtin - : RVVBuiltin { - let IntrinsicTypes = [-1, 0, 1]; -} - -multiclass RVVBuiltinSet> suffixes_prototypes, - list intrinsic_types> { - let IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask", - IntrinsicTypes = intrinsic_types in { - foreach s_p = suffixes_prototypes in { - let Name = NAME # "_" # s_p[0] in { - defvar suffix = s_p[1]; - defvar prototype = s_p[2]; - def : RVVBuiltin; - } - } - } -} - -// IntrinsicTypes is output, op0, op1 [-1, 0, 1] -multiclass RVVOutOp0Op1BuiltinSet> suffixes_prototypes> - : RVVBuiltinSet; - -multiclass RVVOutBuiltinSet> suffixes_prototypes> - : RVVBuiltinSet; - -multiclass RVVOp0BuiltinSet> suffixes_prototypes> - : RVVBuiltinSet; - -// IntrinsicTypes is output, op1 [-1, 0] -multiclass RVVOutOp0BuiltinSet> suffixes_prototypes> - : RVVBuiltinSet; - -// IntrinsicTypes is output, op1 [-1, 1] -multiclass RVVOutOp1BuiltinSet> suffixes_prototypes> - : RVVBuiltinSet; - -multiclass RVVOp0Op1BuiltinSet> suffixes_prototypes> - : RVVBuiltinSet; - -multiclass RVVOutOp1Op2BuiltinSet> suffixes_prototypes> - : RVVBuiltinSet; - -multiclass RVVSignedBinBuiltinSet - : RVVOutOp1BuiltinSet; - -multiclass RVVSignedBinBuiltinSetRoundingMode - : RVVOutOp1BuiltinSet; - -multiclass RVVUnsignedBinBuiltinSet - : RVVOutOp1BuiltinSet; - -multiclass RVVUnsignedBinBuiltinSetRoundingMode - : RVVOutOp1BuiltinSet; - -multiclass RVVIntBinBuiltinSet - : RVVSignedBinBuiltinSet, - RVVUnsignedBinBuiltinSet; - -multiclass RVVSlideOneBuiltinSet - : RVVOutOp1BuiltinSet; - -multiclass RVVSignedShiftBuiltinSet - : RVVOutOp1BuiltinSet; - -multiclass RVVSignedShiftBuiltinSetRoundingMode - : RVVOutOp1BuiltinSet; - -multiclass RVVUnsignedShiftBuiltinSet - : RVVOutOp1BuiltinSet; - -multiclass RVVUnsignedShiftBuiltinSetRoundingMode - : RVVOutOp1BuiltinSet; - -multiclass RVVShiftBuiltinSet - : RVVSignedShiftBuiltinSet, - RVVUnsignedShiftBuiltinSet; - -let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { - multiclass RVVSignedNShiftBuiltinSet - : RVVOutOp0Op1BuiltinSet; - - multiclass RVVSignedNShiftBuiltinSetRoundingMode - : RVVOutOp0Op1BuiltinSet; - - multiclass RVVUnsignedNShiftBuiltinSet - : RVVOutOp0Op1BuiltinSet; - - multiclass RVVUnsignedNShiftBuiltinSetRoundingMode - : RVVOutOp0Op1BuiltinSet; - -} - -multiclass RVVCarryinBuiltinSet - : RVVOutOp1BuiltinSet; - -multiclass RVVCarryOutInBuiltinSet - : RVVOp0Op1BuiltinSet; - -multiclass RVVSignedMaskOutBuiltinSet - : RVVOp0Op1BuiltinSet; - -multiclass RVVUnsignedMaskOutBuiltinSet - : RVVOp0Op1BuiltinSet; - -multiclass RVVIntMaskOutBuiltinSet - : RVVSignedMaskOutBuiltinSet, - RVVUnsignedMaskOutBuiltinSet; - -class RVVIntExt - : RVVBuiltin { - let IRName = intrinsic_name; - let MaskedIRName = intrinsic_name # "_mask"; - let OverloadedName = NAME; - let IntrinsicTypes = [-1, 0]; -} - -let HasMaskedOffOperand = false in { - multiclass RVVIntTerBuiltinSet { - defm "" : RVVOutOp1BuiltinSet; - } - multiclass RVVFloatingTerBuiltinSet { - defm "" : RVVOutOp1BuiltinSet; - } - multiclass RVVFloatingTerBuiltinSetRoundingMode { - defm "" : RVVOutOp1BuiltinSet; - } -} - -let HasMaskedOffOperand = false, Log2LMUL = [-2, -1, 0, 1, 2] in { - multiclass RVVFloatingWidenTerBuiltinSet { - defm "" : RVVOutOp1Op2BuiltinSet; - } - multiclass RVVFloatingWidenTerBuiltinSetRoundingMode { - defm "" : RVVOutOp1Op2BuiltinSet; - } -} - -multiclass RVVFloatingBinBuiltinSet - : RVVOutOp1BuiltinSet; - -multiclass RVVFloatingBinBuiltinSetRoundingMode - : RVVOutOp1BuiltinSet; - -multiclass RVVFloatingBinVFBuiltinSet - : RVVOutOp1BuiltinSet; - -multiclass RVVFloatingBinVFBuiltinSetRoundingMode - : RVVOutOp1BuiltinSet; - -multiclass RVVFloatingMaskOutBuiltinSet - : RVVOp0Op1BuiltinSet; - -multiclass RVVFloatingMaskOutVFBuiltinSet - : RVVOp0Op1BuiltinSet; - -multiclass RVVConvBuiltinSet> suffixes_prototypes> { -let Name = intrinsic_name, - IRName = intrinsic_name, - MaskedIRName = intrinsic_name # "_mask", - IntrinsicTypes = [-1, 0] in { - foreach s_p = suffixes_prototypes in { - defvar suffix = s_p[0]; - defvar prototype = s_p[1]; - def : RVVBuiltin; - } - } -} - - -class RVVMaskBinBuiltin : RVVOutBuiltin<"m", "mmm", "c"> { - let Name = NAME # "_mm"; - let HasMasked = false; -} - -class RVVMaskUnaryBuiltin : RVVOutBuiltin<"m", "mm", "c"> { - let Name = NAME # "_m"; -} - -class RVVMaskNullaryBuiltin : RVVOutBuiltin<"m", "m", "c"> { - let Name = NAME # "_m"; - let HasMasked = false; - let SupportOverloading = false; -} - -class RVVMaskOp0Builtin : RVVOp0Builtin<"m", prototype, "c"> { - let Name = NAME # "_m"; - let HasMaskedOffOperand = false; -} - -let UnMaskedPolicyScheme = HasPolicyOperand, - HasMaskedOffOperand = false in { - multiclass RVVSlideUpBuiltinSet { - defm "" : RVVOutBuiltinSet; - defm "" : RVVOutBuiltinSet; - } -} - -let UnMaskedPolicyScheme = HasPassthruOperand, - ManualCodegen = [{ - if (IsMasked) { - std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); - if ((PolicyAttrs & RVV_VTA) && (PolicyAttrs & RVV_VMA)) - Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); - } else { - if (PolicyAttrs & RVV_VTA) - Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); - } - - Ops.push_back(ConstantInt::get(Ops.back()->getType(), PolicyAttrs)); - IntrinsicTypes = {ResultType, Ops.back()->getType()}; - }] in { - multiclass RVVSlideDownBuiltinSet { - defm "" : RVVOutBuiltinSet; - defm "" : RVVOutBuiltinSet; - } -} - -class RVVFloatingUnaryBuiltin - : RVVOutBuiltin { - let Name = NAME # "_" # builtin_suffix; -} - -class RVVFloatingUnaryVVBuiltin : RVVFloatingUnaryBuiltin<"v", "v", "vv">; - -class RVVConvBuiltin - : RVVBuiltin { - let IntrinsicTypes = [-1, 0]; - let OverloadedName = overloaded_name; -} - -class RVVConvToSignedBuiltin - : RVVConvBuiltin<"Iv", "Ivv", "xfd", overloaded_name>; - -class RVVConvToUnsignedBuiltin - : RVVConvBuiltin<"Uv", "Uvv", "xfd", overloaded_name>; - -class RVVConvToWidenSignedBuiltin - : RVVConvBuiltin<"Iw", "Iwv", "xf", overloaded_name>; - -class RVVConvToWidenUnsignedBuiltin - : RVVConvBuiltin<"Uw", "Uwv", "xf", overloaded_name>; - -class RVVConvToNarrowingSignedBuiltin - : RVVConvBuiltin<"Iv", "IvFw", "csi", overloaded_name>; - -class RVVConvToNarrowingUnsignedBuiltin - : RVVConvBuiltin<"Uv", "UvFw", "csi", overloaded_name>; - -let HasMaskedOffOperand = true in { - multiclass RVVSignedReductionBuiltin { - defm "" : RVVOutOp0BuiltinSet; - } - multiclass RVVUnsignedReductionBuiltin { - defm "" : RVVOutOp0BuiltinSet; - } - multiclass RVVFloatingReductionBuiltin { - defm "" : RVVOutOp0BuiltinSet; - } - multiclass RVVFloatingReductionBuiltinRoundingMode { - defm "" : RVVOutOp0BuiltinSet; - } - multiclass RVVFloatingWidenReductionBuiltin { - defm "" : RVVOutOp0BuiltinSet; - } - multiclass RVVFloatingWidenReductionBuiltinRoundingMode { - defm "" : RVVOutOp0BuiltinSet; - } -} - -multiclass RVVIntReductionBuiltinSet - : RVVSignedReductionBuiltin, - RVVUnsignedReductionBuiltin; - -// For widen operation which has different mangling name. -multiclass RVVWidenBuiltinSet> suffixes_prototypes> { - let Log2LMUL = [-3, -2, -1, 0, 1, 2], - IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask" in { - foreach s_p = suffixes_prototypes in { - let Name = NAME # "_" # s_p[0], - OverloadedName = NAME # "_" # s_p[0] in { - defvar suffix = s_p[1]; - defvar prototype = s_p[2]; - def : RVVOutOp0Op1Builtin; - } - } - } -} - -// For widen operation with widen operand which has different mangling name. -multiclass RVVWidenWOp0BuiltinSet> suffixes_prototypes> { - let Log2LMUL = [-3, -2, -1, 0, 1, 2], - IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask" in { - foreach s_p = suffixes_prototypes in { - let Name = NAME # "_" # s_p[0], - OverloadedName = NAME # "_" # s_p[0] in { - defvar suffix = s_p[1]; - defvar prototype = s_p[2]; - def : RVVOutOp1Builtin; - } - } - } -} - -multiclass RVVSignedWidenBinBuiltinSet - : RVVWidenBuiltinSet; - -multiclass RVVSignedWidenOp0BinBuiltinSet - : RVVWidenWOp0BuiltinSet; - -multiclass RVVUnsignedWidenBinBuiltinSet - : RVVWidenBuiltinSet; - -multiclass RVVUnsignedWidenOp0BinBuiltinSet - : RVVWidenWOp0BuiltinSet; - -multiclass RVVFloatingWidenBinBuiltinSet - : RVVWidenBuiltinSet; - -multiclass RVVFloatingWidenBinBuiltinSetRoundingMode - : RVVWidenBuiltinSet; - -multiclass RVVFloatingWidenOp0BinBuiltinSet - : RVVWidenWOp0BuiltinSet; - -multiclass RVVFloatingWidenOp0BinBuiltinSetRoundingMode - : RVVWidenWOp0BuiltinSet; - defvar TypeList = ["c","s","i","l","x","f","d"]; defvar EEWList = [["8", "(Log2EEW:3)"], ["16", "(Log2EEW:4)"], @@ -516,7 +69,6 @@ multiclass RVVVLEFFBuiltin types> { Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); IntrinsicTypes = {ResultType, Ops[3]->getType()}; } - Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); Value *NewVL = Ops[2]; Ops.erase(Ops.begin() + 2); llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); @@ -564,7 +116,9 @@ multiclass RVVIndexedLoad { foreach eew_list = EEWList[0-2] in { defvar eew = eew_list[0]; defvar eew_type = eew_list[1]; - let Name = op # eew # "_v", IRName = op, MaskedIRName = op # "_mask" in { + let Name = op # eew # "_v", IRName = op, MaskedIRName = op # "_mask", + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []) in { def: RVVOutOp1Builtin<"v", "vPCe" # eew_type # "Uv", type>; if !not(IsFloat.val) then { def: RVVOutOp1Builtin<"Uv", "UvPCUe" # eew_type # "Uv", type>; @@ -574,7 +128,8 @@ multiclass RVVIndexedLoad { defvar eew64 = "64"; defvar eew64_type = "(Log2EEW:6)"; let Name = op # eew64 # "_v", IRName = op, MaskedIRName = op # "_mask", - RequiredFeatures = ["RV64"] in { + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh", "RV64"], + ["RV64"]) in { def: RVVOutOp1Builtin<"v", "vPCe" # eew64_type # "Uv", type>; if !not(IsFloat.val) then { def: RVVOutOp1Builtin<"Uv", "UvPCUe" # eew64_type # "Uv", type>; @@ -594,7 +149,6 @@ let HasMaskedOffOperand = false, // Builtin: (ptr, value, vl). Intrinsic: (value, ptr, vl) std::swap(Ops[0], Ops[1]); } - Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); if (IsMasked) IntrinsicTypes = {Ops[0]->getType(), Ops[3]->getType()}; else @@ -633,7 +187,6 @@ multiclass RVVVSSEBuiltin types> { // Builtin: (ptr, stride, value, vl). Intrinsic: (value, ptr, stride, vl) std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3); } - Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); if (IsMasked) IntrinsicTypes = {Ops[0]->getType(), Ops[4]->getType()}; else @@ -659,7 +212,6 @@ multiclass RVVIndexedStore { // Builtin: (ptr, index, value, vl). Intrinsic: (value, ptr, index, vl) std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3); } - Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); if (IsMasked) IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType(), Ops[4]->getType()}; else @@ -669,7 +221,9 @@ multiclass RVVIndexedStore { foreach eew_list = EEWList[0-2] in { defvar eew = eew_list[0]; defvar eew_type = eew_list[1]; - let Name = op # eew # "_v", IRName = op, MaskedIRName = op # "_mask" in { + let Name = op # eew # "_v", IRName = op, MaskedIRName = op # "_mask", + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []) in { def : RVVBuiltin<"v", "0Pe" # eew_type # "Uvv", type>; if !not(IsFloat.val) then { def : RVVBuiltin<"Uv", "0PUe" # eew_type # "UvUv", type>; @@ -679,7 +233,8 @@ multiclass RVVIndexedStore { defvar eew64 = "64"; defvar eew64_type = "(Log2EEW:6)"; let Name = op # eew64 # "_v", IRName = op, MaskedIRName = op # "_mask", - RequiredFeatures = ["RV64"] in { + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh", "RV64"], + ["RV64"]) in { def : RVVBuiltin<"v", "0Pe" # eew64_type # "Uvv", type>; if !not(IsFloat.val) then { def : RVVBuiltin<"Uv", "0PUe" # eew64_type # "UvUv", type>; @@ -786,6 +341,32 @@ class VString { !eq(nf, 8): !if(signed, "vvvvvvvv", "UvUvUvUvUvUvUvUv")); } + +class FixedVString { + string V = "(LFixedLog2LMUL:" # fixed_lmul # ")" # vec; + string S = !interleave(!listsplat(V, num), ""); +} + +multiclass RVVNonTupleVCreateBuiltin src_lmul_list> { + defvar dst_v = FixedVString.V; + defvar dst_uv = FixedVString.V; + foreach src_lmul = src_lmul_list in { + defvar num = !shl(1, !sub(dst_lmul, src_lmul)); + + defvar src_v = FixedVString.V; + defvar src_s = FixedVString.S; + def vcreate # src_v # dst_v : RVVBuiltin; + + defvar src_uv = FixedVString.V; + defvar src_us = FixedVString.S; + def vcreate_u # src_uv # dst_uv : RVVBuiltin; + } +} + multiclass RVVPseudoUnaryBuiltin { let Name = NAME, IRName = IR, @@ -1099,24 +680,32 @@ let HasBuiltinAlias = false, // 7.4. Vector Unit-Stride Instructions def vlm: RVVVLEMaskBuiltin; defm vle8: RVVVLEBuiltin<["c"]>; -defm vle16: RVVVLEBuiltin<["s","x"]>; +defm vle16: RVVVLEBuiltin<["s"]>; +let Name = "vle16_v", RequiredFeatures = ["ZvfhminOrZvfh"] in + defm vle16_h: RVVVLEBuiltin<["x"]>; defm vle32: RVVVLEBuiltin<["i","f"]>; defm vle64: RVVVLEBuiltin<["l","d"]>; def vsm : RVVVSEMaskBuiltin; defm vse8 : RVVVSEBuiltin<["c"]>; -defm vse16: RVVVSEBuiltin<["s","x"]>; +defm vse16: RVVVSEBuiltin<["s"]>; +let Name = "vse16_v", RequiredFeatures = ["ZvfhminOrZvfh"] in + defm vse16_h: RVVVSEBuiltin<["x"]>; defm vse32: RVVVSEBuiltin<["i","f"]>; defm vse64: RVVVSEBuiltin<["l","d"]>; // 7.5. Vector Strided Instructions defm vlse8: RVVVLSEBuiltin<["c"]>; -defm vlse16: RVVVLSEBuiltin<["s","x"]>; +defm vlse16: RVVVLSEBuiltin<["s"]>; +let Name = "vlse16_v", RequiredFeatures = ["ZvfhminOrZvfh"] in + defm vlse16_h: RVVVLSEBuiltin<["x"]>; defm vlse32: RVVVLSEBuiltin<["i","f"]>; defm vlse64: RVVVLSEBuiltin<["l","d"]>; defm vsse8 : RVVVSSEBuiltin<["c"]>; -defm vsse16: RVVVSSEBuiltin<["s","x"]>; +defm vsse16: RVVVSSEBuiltin<["s"]>; +let Name = "vsse16_v", RequiredFeatures = ["ZvfhminOrZvfh"] in + defm vsse16_h: RVVVSSEBuiltin<["x"]>; defm vsse32: RVVVSSEBuiltin<["i","f"]>; defm vsse64: RVVVSSEBuiltin<["l","d"]>; @@ -1129,7 +718,9 @@ defm : RVVIndexedStore<"vsoxei">; // 7.7. Unit-stride Fault-Only-First Loads defm vle8ff: RVVVLEFFBuiltin<["c"]>; -defm vle16ff: RVVVLEFFBuiltin<["s","x"]>; +defm vle16ff: RVVVLEFFBuiltin<["s"]>; +let Name = "vle16ff_v", RequiredFeatures = ["ZvfhminOrZvfh"] in + defm vle16ff: RVVVLEFFBuiltin<["x"]>; defm vle32ff: RVVVLEFFBuiltin<["i", "f"]>; defm vle64ff: RVVVLEFFBuiltin<["l", "d"]>; @@ -1147,6 +738,8 @@ multiclass RVVUnitStridedSegLoadTuple { IRName = op # nf, MaskedIRName = op # nf # "_mask", NF = nf, + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []), ManualCodegen = [{ { llvm::Type *ElementVectorType = cast(ResultType)->elements()[0]; @@ -1207,6 +800,8 @@ multiclass RVVUnitStridedSegStoreTuple { MaskedIRName = op # nf # "_mask", NF = nf, HasMaskedOffOperand = false, + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []), ManualCodegen = [{ { // Masked @@ -1257,6 +852,8 @@ multiclass RVVUnitStridedSegLoadFFTuple { IRName = op # nf # "ff", MaskedIRName = op # nf # "ff_mask", NF = nf, + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []), ManualCodegen = [{ { llvm::Type *ElementVectorType = cast(ResultType)->elements()[0]; @@ -1330,6 +927,8 @@ multiclass RVVStridedSegLoadTuple { IRName = op # nf, MaskedIRName = op # nf # "_mask", NF = nf, + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []), ManualCodegen = [{ { llvm::Type *ElementVectorType = cast(ResultType)->elements()[0]; @@ -1392,6 +991,8 @@ multiclass RVVStridedSegStoreTuple { NF = nf, HasMaskedOffOperand = false, MaskedPolicyScheme = NonePolicy, + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []), ManualCodegen = [{ { // Masked @@ -1439,6 +1040,8 @@ multiclass RVVIndexedSegLoadTuple { IRName = op # nf, MaskedIRName = op # nf # "_mask", NF = nf, + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []), ManualCodegen = [{ { llvm::Type *ElementVectorType = cast(ResultType)->elements()[0]; @@ -1500,6 +1103,8 @@ multiclass RVVIndexedSegStoreTuple { NF = nf, HasMaskedOffOperand = false, MaskedPolicyScheme = NonePolicy, + RequiredFeatures = !if(!eq(type, "x"), ["ZvfhminOrZvfh"], + []), ManualCodegen = [{ { // Masked @@ -1558,8 +1163,8 @@ defm : RVVIndexedSegStoreTuple<"vsuxseg">; defm : RVVIndexedSegStoreTuple<"vsoxseg">; } -// 12. Vector Integer Arithmetic Instructions -// 12.1. Vector Single-Width Integer Add and Subtract +// 11. Vector Integer Arithmetic Instructions +// 11.1. Vector Single-Width Integer Add and Subtract let UnMaskedPolicyScheme = HasPassthruOperand in { defm vadd : RVVIntBinBuiltinSet; defm vsub : RVVIntBinBuiltinSet; @@ -1569,7 +1174,7 @@ defm vrsub : RVVOutOp1BuiltinSet<"vrsub", "csil", } defm vneg_v : RVVPseudoUnaryBuiltin<"vrsub", "csil">; -// 12.2. Vector Widening Integer Add/Subtract +// 11.2. Vector Widening Integer Add/Subtract // Widening unsigned integer add/subtract, 2*SEW = SEW +/- SEW let UnMaskedPolicyScheme = HasPassthruOperand in { defm vwaddu : RVVUnsignedWidenBinBuiltinSet; @@ -1589,7 +1194,7 @@ defm vwcvtu_x_x_v : RVVPseudoVWCVTBuiltin<"vwaddu", "vwcvtu_x", "csi", defm vwcvt_x_x_v : RVVPseudoVWCVTBuiltin<"vwadd", "vwcvt_x", "csi", [["w", "wv"]]>; -// 12.3. Vector Integer Extension +// 11.3. Vector Integer Extension let UnMaskedPolicyScheme = HasPassthruOperand in { let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { def vsext_vf2 : RVVIntExt<"vsext", "w", "wv", "csi">; @@ -1605,7 +1210,7 @@ let Log2LMUL = [-3, -2, -1, 0] in { } } -// 12.4. Vector Integer Add-with-Carry / Subtract-with-Borrow Instructions +// 11.4. Vector Integer Add-with-Carry / Subtract-with-Borrow Instructions let HasMasked = false, MaskedPolicyScheme = NonePolicy in { let UnMaskedPolicyScheme = HasPassthruOperand in { defm vadc : RVVCarryinBuiltinSet; @@ -1617,7 +1222,7 @@ let HasMasked = false, MaskedPolicyScheme = NonePolicy in { defm vmsbc : RVVIntMaskOutBuiltinSet; } -// 12.5. Vector Bitwise Logical Instructions +// 11.5. Vector Bitwise Logical Instructions let UnMaskedPolicyScheme = HasPassthruOperand in { defm vand : RVVIntBinBuiltinSet; defm vxor : RVVIntBinBuiltinSet; @@ -1625,13 +1230,13 @@ defm vor : RVVIntBinBuiltinSet; } defm vnot_v : RVVPseudoVNotBuiltin<"vxor", "csil">; -// 12.6. Vector Single-Width Bit Shift Instructions +// 11.6. Vector Single-Width Shift Instructions let UnMaskedPolicyScheme = HasPassthruOperand in { defm vsll : RVVShiftBuiltinSet; defm vsrl : RVVUnsignedShiftBuiltinSet; defm vsra : RVVSignedShiftBuiltinSet; -// 12.7. Vector Narrowing Integer Right Shift Instructions +// 11.7. Vector Narrowing Integer Right Shift Instructions defm vnsrl : RVVUnsignedNShiftBuiltinSet; defm vnsra : RVVSignedNShiftBuiltinSet; } @@ -1639,7 +1244,7 @@ defm vncvt_x_x_w : RVVPseudoVNCVTBuiltin<"vnsrl", "vncvt_x", "csi", [["v", "vw"], ["Uv", "UvUw"]]>; -// 12.8. Vector Integer Comparison Instructions +// 11.8. Vector Integer Compare Instructions let MaskedPolicyScheme = HasPassthruOperand, HasTailPolicy = false in { defm vmseq : RVVIntMaskOutBuiltinSet; @@ -1654,14 +1259,14 @@ defm vmsgeu : RVVUnsignedMaskOutBuiltinSet; defm vmsge : RVVSignedMaskOutBuiltinSet; } -// 12.9. Vector Integer Min/Max Instructions +// 11.9. Vector Integer Min/Max Instructions let UnMaskedPolicyScheme = HasPassthruOperand in { defm vminu : RVVUnsignedBinBuiltinSet; defm vmin : RVVSignedBinBuiltinSet; defm vmaxu : RVVUnsignedBinBuiltinSet; defm vmax : RVVSignedBinBuiltinSet; -// 12.10. Vector Single-Width Integer Multiply Instructions +// 11.10. Vector Single-Width Integer Multiply Instructions defm vmul : RVVIntBinBuiltinSet; defm vmulh : RVVSignedBinBuiltinSet; defm vmulhu : RVVUnsignedBinBuiltinSet; @@ -1669,14 +1274,14 @@ defm vmulhsu : RVVOutOp1BuiltinSet<"vmulhsu", "csil", [["vv", "v", "vvUv"], ["vx", "v", "vvUe"]]>; -// 12.11. Vector Integer Divide Instructions +// 11.11. Vector Integer Divide Instructions defm vdivu : RVVUnsignedBinBuiltinSet; defm vdiv : RVVSignedBinBuiltinSet; defm vremu : RVVUnsignedBinBuiltinSet; defm vrem : RVVSignedBinBuiltinSet; } -// 12.12. Vector Widening Integer Multiply Instructions +// 11.12. Vector Widening Integer Multiply Instructions let Log2LMUL = [-3, -2, -1, 0, 1, 2], UnMaskedPolicyScheme = HasPassthruOperand in { defm vwmul : RVVOutOp0Op1BuiltinSet<"vwmul", "csi", [["vv", "w", "wvv"], @@ -1689,14 +1294,14 @@ defm vwmulsu : RVVOutOp0Op1BuiltinSet<"vwmulsu", "csi", ["vx", "w", "wvUe"]]>; } -// 12.13. Vector Single-Width Integer Multiply-Add Instructions +// 11.13. Vector Single-Width Integer Multiply-Add Instructions let UnMaskedPolicyScheme = HasPolicyOperand in { defm vmacc : RVVIntTerBuiltinSet; defm vnmsac : RVVIntTerBuiltinSet; defm vmadd : RVVIntTerBuiltinSet; defm vnmsub : RVVIntTerBuiltinSet; -// 12.14. Vector Widening Integer Multiply-Add Instructions +// 11.14. Vector Widening Integer Multiply-Add Instructions let HasMaskedOffOperand = false, Log2LMUL = [-3, -2, -1, 0, 1, 2] in { defm vwmaccu : RVVOutOp1Op2BuiltinSet<"vwmaccu", "csi", @@ -1713,7 +1318,7 @@ defm vwmaccus : RVVOutOp1Op2BuiltinSet<"vwmaccus", "csi", } } -// 12.15. Vector Integer Merge Instructions +// 11.15. Vector Integer Merge Instructions // C/C++ Operand: (mask, op1, op2, vl), Intrinsic: (passthru, op1, op2, mask, vl) let HasMasked = false, UnMaskedPolicyScheme = HasPassthruOperand, @@ -1731,22 +1336,25 @@ let HasMasked = false, ["vxm", "Uv", "UvUvUem"]]>; } -// 12.16. Vector Integer Move Instructions +// 11.16. Vector Integer Move Instructions let HasMasked = false, UnMaskedPolicyScheme = HasPassthruOperand, MaskedPolicyScheme = NonePolicy, OverloadedName = "vmv_v" in { defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "csil", [["v", "Uv", "UvUv"]]>; - defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "csilxfd", + defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "csilfd", [["v", "v", "vv"]]>; + let RequiredFeatures = ["ZvfhminOrZvfh"] in + defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "x", + [["v", "v", "vv"]]>; let SupportOverloading = false in defm vmv_v : RVVOutBuiltinSet<"vmv_v_x", "csil", [["x", "v", "ve"], ["x", "Uv", "UvUe"]]>; } -// 13. Vector Fixed-Point Arithmetic Instructions +// 12. Vector Fixed-Point Arithmetic Instructions let HeaderCode = [{ enum __RISCV_VXRM { @@ -1758,7 +1366,7 @@ enum __RISCV_VXRM { }] in def vxrm_enum : RVVHeader; -// 13.1. Vector Single-Width Saturating Add and Subtract +// 12.1. Vector Single-Width Saturating Add and Subtract let UnMaskedPolicyScheme = HasPassthruOperand in { defm vsaddu : RVVUnsignedBinBuiltinSet; defm vsadd : RVVSignedBinBuiltinSet; @@ -1800,16 +1408,16 @@ let ManualCodegen = [{ return Builder.CreateCall(F, Operands, ""); } }] in { - // 13.2. Vector Single-Width Averaging Add and Subtract + // 12.2. Vector Single-Width Averaging Add and Subtract defm vaaddu : RVVUnsignedBinBuiltinSetRoundingMode; defm vaadd : RVVSignedBinBuiltinSetRoundingMode; defm vasubu : RVVUnsignedBinBuiltinSetRoundingMode; defm vasub : RVVSignedBinBuiltinSetRoundingMode; - // 13.3. Vector Single-Width Fractional Multiply with Rounding and Saturation + // 12.3. Vector Single-Width Fractional Multiply with Rounding and Saturation defm vsmul : RVVSignedBinBuiltinSetRoundingMode; - // 13.4. Vector Single-Width Scaling Shift Instructions + // 12.4. Vector Single-Width Scaling Shift Instructions defm vssrl : RVVUnsignedShiftBuiltinSetRoundingMode; defm vssra : RVVSignedShiftBuiltinSetRoundingMode; } @@ -1850,13 +1458,13 @@ let ManualCodegen = [{ return Builder.CreateCall(F, Operands, ""); } }] in { - // 13.5. Vector Narrowing Fixed-Point Clip Instructions + // 12.5. Vector Narrowing Fixed-Point Clip Instructions defm vnclipu : RVVUnsignedNShiftBuiltinSetRoundingMode; defm vnclip : RVVSignedNShiftBuiltinSetRoundingMode; } } -// 14. Vector Floating-Point Instructions +// 13. Vector Floating-Point Instructions let HeaderCode = [{ enum __RISCV_FRM { @@ -1915,32 +1523,32 @@ let ManualCodegen = [{ } }] in { let HasFRMRoundModeOp = true in { - // 14.2. Vector Single-Width Floating-Point Add/Subtract Instructions + // 13.2. Vector Single-Width Floating-Point Add/Subtract Instructions defm vfadd : RVVFloatingBinBuiltinSetRoundingMode; defm vfsub : RVVFloatingBinBuiltinSetRoundingMode; defm vfrsub : RVVFloatingBinVFBuiltinSetRoundingMode; - // 14.3. Vector Widening Floating-Point Add/Subtract Instructions + // 13.3. Vector Widening Floating-Point Add/Subtract Instructions // Widening FP add/subtract, 2*SEW = 2*SEW +/- SEW defm vfwadd : RVVFloatingWidenOp0BinBuiltinSetRoundingMode; defm vfwsub : RVVFloatingWidenOp0BinBuiltinSetRoundingMode; - // 14.4. Vector Single-Width Floating-Point Multiply/Divide Instructions + // 13.4. Vector Single-Width Floating-Point Multiply/Divide Instructions defm vfmul : RVVFloatingBinBuiltinSetRoundingMode; defm vfdiv : RVVFloatingBinBuiltinSetRoundingMode; defm vfrdiv : RVVFloatingBinVFBuiltinSetRoundingMode; } - // 14.2. Vector Single-Width Floating-Point Add/Subtract Instructions + // 13.2. Vector Single-Width Floating-Point Add/Subtract Instructions defm vfadd : RVVFloatingBinBuiltinSet; defm vfsub : RVVFloatingBinBuiltinSet; defm vfrsub : RVVFloatingBinVFBuiltinSet; - // 14.3. Vector Widening Floating-Point Add/Subtract Instructions + // 13.3. Vector Widening Floating-Point Add/Subtract Instructions // Widening FP add/subtract, 2*SEW = 2*SEW +/- SEW defm vfwadd : RVVFloatingWidenOp0BinBuiltinSet; defm vfwsub : RVVFloatingWidenOp0BinBuiltinSet; - // 14.4. Vector Single-Width Floating-Point Multiply/Divide Instructions + // 13.4. Vector Single-Width Floating-Point Multiply/Divide Instructions defm vfmul : RVVFloatingBinBuiltinSet; defm vfdiv : RVVFloatingBinBuiltinSet; defm vfrdiv : RVVFloatingBinVFBuiltinSet; @@ -1992,24 +1600,24 @@ let ManualCodegen = [{ } }] in { let HasFRMRoundModeOp = true in { - // 14.3. Vector Widening Floating-Point Add/Subtract Instructions + // 13.3. Vector Widening Floating-Point Add/Subtract Instructions // Widening FP add/subtract, 2*SEW = SEW +/- SEW defm vfwadd : RVVFloatingWidenBinBuiltinSetRoundingMode; defm vfwsub : RVVFloatingWidenBinBuiltinSetRoundingMode; - // 14.5. Vector Widening Floating-Point Multiply + // 13.5. Vector Widening Floating-Point Multiply let Log2LMUL = [-2, -1, 0, 1, 2] in { defm vfwmul : RVVOutOp0Op1BuiltinSet<"vfwmul", "xf", [["vv", "w", "wvvu"], ["vf", "w", "wveu"]]>; } } - // 14.3. Vector Widening Floating-Point Add/Subtract Instructions + // 13.3. Vector Widening Floating-Point Add/Subtract Instructions // Widening FP add/subtract, 2*SEW = SEW +/- SEW defm vfwadd : RVVFloatingWidenBinBuiltinSet; defm vfwsub : RVVFloatingWidenBinBuiltinSet; - // 14.5. Vector Widening Floating-Point Multiply + // 13.5. Vector Widening Floating-Point Multiply let Log2LMUL = [-2, -1, 0, 1, 2] in { defm vfwmul : RVVOutOp0Op1BuiltinSet<"vfwmul", "xf", [["vv", "w", "wvv"], @@ -2058,7 +1666,7 @@ let ManualCodegen = [{ } }] in { let HasFRMRoundModeOp = 1 in { - // 14.6. Vector Single-Width Floating-Point Fused Multiply-Add Instructions + // 13.6. Vector Single-Width Floating-Point Fused Multiply-Add Instructions defm vfmacc : RVVFloatingTerBuiltinSetRoundingMode; defm vfnmacc : RVVFloatingTerBuiltinSetRoundingMode; defm vfmsac : RVVFloatingTerBuiltinSetRoundingMode; @@ -2068,7 +1676,7 @@ let ManualCodegen = [{ defm vfmsub : RVVFloatingTerBuiltinSetRoundingMode; defm vfnmsub : RVVFloatingTerBuiltinSetRoundingMode; } - // 14.6. Vector Single-Width Floating-Point Fused Multiply-Add Instructions + // 13.6. Vector Single-Width Floating-Point Fused Multiply-Add Instructions defm vfmacc : RVVFloatingTerBuiltinSet; defm vfnmacc : RVVFloatingTerBuiltinSet; defm vfmsac : RVVFloatingTerBuiltinSet; @@ -2117,13 +1725,13 @@ let ManualCodegen = [{ } }] in { let HasFRMRoundModeOp = 1 in { - // 14.7. Vector Widening Floating-Point Fused Multiply-Add Instructions + // 13.7. Vector Widening Floating-Point Fused Multiply-Add Instructions defm vfwmacc : RVVFloatingWidenTerBuiltinSetRoundingMode; defm vfwnmacc : RVVFloatingWidenTerBuiltinSetRoundingMode; defm vfwmsac : RVVFloatingWidenTerBuiltinSetRoundingMode; defm vfwnmsac : RVVFloatingWidenTerBuiltinSetRoundingMode; } - // 14.7. Vector Widening Floating-Point Fused Multiply-Add Instructions + // 13.7. Vector Widening Floating-Point Fused Multiply-Add Instructions defm vfwmacc : RVVFloatingWidenTerBuiltinSet; defm vfwnmacc : RVVFloatingWidenTerBuiltinSet; defm vfwmsac : RVVFloatingWidenTerBuiltinSet; @@ -2177,27 +1785,27 @@ let ManualCodegen = [{ } }] in { let HasFRMRoundModeOp = 1 in { - // 14.8. Vector Floating-Point Square-Root Instruction + // 13.8. Vector Floating-Point Square-Root Instruction defm vfsqrt : RVVOutBuiltinSet<"vfsqrt", "xfd", [["v", "v", "vvu"]]>; - // 14.10. Vector Floating-Point Reciprocal Estimate Instruction + // 13.10. Vector Floating-Point Reciprocal Estimate Instruction defm vfrec7 : RVVOutBuiltinSet<"vfrec7", "xfd", [["v", "v", "vvu"]]>; } - // 14.8. Vector Floating-Point Square-Root Instruction + // 13.8. Vector Floating-Point Square-Root Instruction defm vfsqrt : RVVOutBuiltinSet<"vfsqrt", "xfd", [["v", "v", "vv"]]>; - // 14.10. Vector Floating-Point Reciprocal Estimate Instruction + // 13.10. Vector Floating-Point Reciprocal Estimate Instruction defm vfrec7 : RVVOutBuiltinSet<"vfrec7", "xfd", [["v", "v", "vv"]]>; } -// 14.9. Vector Floating-Point Reciprocal Square-Root Estimate Instruction +// 13.9. Vector Floating-Point Reciprocal Square-Root Estimate Instruction def vfrsqrt7 : RVVFloatingUnaryVVBuiltin; -// 14.11. Vector Floating-Point MIN/MAX Instructions +// 13.11. Vector Floating-Point MIN/MAX Instructions defm vfmin : RVVFloatingBinBuiltinSet; defm vfmax : RVVFloatingBinBuiltinSet; -// 14.12. Vector Floating-Point Sign-Injection Instructions +// 13.12. Vector Floating-Point Sign-Injection Instructions defm vfsgnj : RVVFloatingBinBuiltinSet; defm vfsgnjn : RVVFloatingBinBuiltinSet; defm vfsgnjx : RVVFloatingBinBuiltinSet; @@ -2205,7 +1813,7 @@ defm vfsgnjx : RVVFloatingBinBuiltinSet; defm vfneg_v : RVVPseudoVFUnaryBuiltin<"vfsgnjn", "xfd">; defm vfabs_v : RVVPseudoVFUnaryBuiltin<"vfsgnjx", "xfd">; -// 14.13. Vector Floating-Point Compare Instructions +// 13.13. Vector Floating-Point Compare Instructions let MaskedPolicyScheme = HasPassthruOperand, HasTailPolicy = false in { defm vmfeq : RVVFloatingMaskOutBuiltinSet; @@ -2216,11 +1824,11 @@ defm vmfgt : RVVFloatingMaskOutBuiltinSet; defm vmfge : RVVFloatingMaskOutBuiltinSet; } -// 14.14. Vector Floating-Point Classify Instruction +// 13.14. Vector Floating-Point Classify Instruction let Name = "vfclass_v", UnMaskedPolicyScheme = HasPassthruOperand in def vfclass : RVVOp0Builtin<"Uv", "Uvv", "xfd">; -// 14.15. Vector Floating-Point Merge Instructio +// 13.15. Vector Floating-Point Merge Instruction // C/C++ Operand: (mask, op1, op2, vl), Builtin: (op1, op2, mask, vl) let HasMasked = false, UnMaskedPolicyScheme = HasPassthruOperand, @@ -2231,13 +1839,16 @@ let HasMasked = false, Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; }] in { - defm vmerge : RVVOutOp1BuiltinSet<"vmerge", "xfd", + defm vmerge : RVVOutOp1BuiltinSet<"vmerge", "fd", [["vvm", "v", "vvvm"]]>; + let RequiredFeatures = ["ZvfhminOrZvfh"] in + defm vmerge : RVVOutOp1BuiltinSet<"vmerge", "x", + [["vvm", "v", "vvvm"]]>; defm vfmerge : RVVOutOp1BuiltinSet<"vfmerge", "xfd", [["vfm", "v", "vvem"]]>; } -// 14.16. Vector Floating-Point Move Instruction +// 13.16. Vector Floating-Point Move Instruction let HasMasked = false, UnMaskedPolicyScheme = HasPassthruOperand, SupportOverloading = false, @@ -2246,21 +1857,27 @@ let HasMasked = false, defm vfmv_v : RVVOutBuiltinSet<"vfmv_v_f", "xfd", [["f", "v", "ve"]]>; -// 14.17. Single-Width Floating-Point/Integer Type-Convert Instructions +// 13.17. Single-Width Floating-Point/Integer Type-Convert Instructions let UnMaskedPolicyScheme = HasPassthruOperand in { def vfcvt_rtz_xu_f_v : RVVConvToUnsignedBuiltin<"vfcvt_rtz_xu">; def vfcvt_rtz_x_f_v : RVVConvToSignedBuiltin<"vfcvt_rtz_x">; -// 14.18. Widening Floating-Point/Integer Type-Convert Instructions +// 13.18. Widening Floating-Point/Integer Type-Convert Instructions let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { def vfwcvt_rtz_xu_f_v : RVVConvToWidenUnsignedBuiltin<"vfwcvt_rtz_xu">; def vfwcvt_rtz_x_f_v : RVVConvToWidenSignedBuiltin<"vfwcvt_rtz_x">; def vfwcvt_f_xu_v : RVVConvBuiltin<"Fw", "FwUv", "csi", "vfwcvt_f">; def vfwcvt_f_x_v : RVVConvBuiltin<"Fw", "Fwv", "csi", "vfwcvt_f">; - def vfwcvt_f_f_v : RVVConvBuiltin<"w", "wv", "xf", "vfwcvt_f">; + def vfwcvt_f_f_v : RVVConvBuiltin<"w", "wv", "f", "vfwcvt_f">; + let RequiredFeatures = ["ZvfhminOrZvfh"] in + def vfwcvt_f_f_v_fp16 : RVVConvBuiltin<"w", "wv", "x", "vfwcvt_f"> { + let Name = "vfwcvt_f_f_v"; + let IRName = "vfwcvt_f_f_v"; + let MaskedIRName = "vfwcvt_f_f_v_mask"; + } } -// 14.19. Narrowing Floating-Point/Integer Type-Convert Instructions +// 13.19. Narrowing Floating-Point/Integer Type-Convert Instructions let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { def vfncvt_rtz_xu_f_w : RVVConvToNarrowingUnsignedBuiltin<"vfncvt_rtz_xu">; def vfncvt_rtz_x_f_w : RVVConvToNarrowingSignedBuiltin<"vfncvt_rtz_x">; @@ -2324,7 +1941,7 @@ let ManualCodegen = [{ RVVConvBuiltinSet<"vfcvt_f_xu_v", "sil", [["Fv", "FvUvu"]]>; } - // 14.18. Widening Floating-Point/Integer Type-Convert Instructions + // 13.18. Widening Floating-Point/Integer Type-Convert Instructions let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { let OverloadedName = "vfwcvt_x" in defm : @@ -2333,7 +1950,7 @@ let ManualCodegen = [{ defm : RVVConvBuiltinSet<"vfwcvt_xu_f_v", "xf", [["Uw", "Uwvu"]]>; } - // 14.19. Narrowing Floating-Point/Integer Type-Convert Instructions + // 13.19. Narrowing Floating-Point/Integer Type-Convert Instructions let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { let OverloadedName = "vfncvt_x" in defm : @@ -2347,13 +1964,15 @@ let ManualCodegen = [{ defm : RVVConvBuiltinSet<"vfncvt_f_xu_w", "csi", [["Fv", "FvUwu"]]>; } - let OverloadedName = "vfncvt_f" in - defm : - RVVConvBuiltinSet<"vfncvt_f_f_w", "xf", [["v", "vwu"]]>; + let OverloadedName = "vfncvt_f" in { + defm : RVVConvBuiltinSet<"vfncvt_f_f_w", "f", [["v", "vwu"]]>; + let RequiredFeatures = ["ZvfhminOrZvfh"] in + defm : RVVConvBuiltinSet<"vfncvt_f_f_w", "x", [["v", "vwu"]]>; + } } } - // 14.17. Single-Width Floating-Point/Integer Type-Convert Instructions + // 13.17. Single-Width Floating-Point/Integer Type-Convert Instructions let OverloadedName = "vfcvt_x" in defm : RVVConvBuiltinSet<"vfcvt_x_f_v", "xfd", [["Iv", "Ivv"]]>; @@ -2367,7 +1986,7 @@ let ManualCodegen = [{ RVVConvBuiltinSet<"vfcvt_f_xu_v", "sil", [["Fv", "FvUv"]]>; } - // 14.18. Widening Floating-Point/Integer Type-Convert Instructions + // 13.18. Widening Floating-Point/Integer Type-Convert Instructions let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { let OverloadedName = "vfwcvt_x" in defm : @@ -2376,7 +1995,7 @@ let ManualCodegen = [{ defm : RVVConvBuiltinSet<"vfwcvt_xu_f_v", "xf", [["Uw", "Uwv"]]>; } - // 14.19. Narrowing Floating-Point/Integer Type-Convert Instructions + // 13.19. Narrowing Floating-Point/Integer Type-Convert Instructions let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { let OverloadedName = "vfncvt_x" in defm : @@ -2390,15 +2009,17 @@ let ManualCodegen = [{ defm : RVVConvBuiltinSet<"vfncvt_f_xu_w", "csi", [["Fv", "FvUw"]]>; } - let OverloadedName = "vfncvt_f" in - defm : - RVVConvBuiltinSet<"vfncvt_f_f_w", "xf", [["v", "vw"]]>; + let OverloadedName = "vfncvt_f" in { + defm : RVVConvBuiltinSet<"vfncvt_f_f_w", "f", [["v", "vw"]]>; + let RequiredFeatures = ["ZvfhminOrZvfh"] in + defm : RVVConvBuiltinSet<"vfncvt_f_f_w", "x", [["v", "vw"]]>; + } } } } -// 15. Vector Reduction Operations -// 15.1. Vector Single-Width Integer Reduction Instructions +// 14. Vector Reduction Operations +// 14.1. Vector Single-Width Integer Reduction Instructions let UnMaskedPolicyScheme = HasPassthruOperand, MaskedPolicyScheme = HasPassthruOperand, HasMaskPolicy = false in { @@ -2411,7 +2032,7 @@ defm vredand : RVVIntReductionBuiltinSet; defm vredor : RVVIntReductionBuiltinSet; defm vredxor : RVVIntReductionBuiltinSet; -// 15.2. Vector Widening Integer Reduction Instructions +// 14.2. Vector Widening Integer Reduction Instructions // Vector Widening Integer Reduction Operations let HasMaskedOffOperand = true in { defm vwredsum : RVVOutOp0BuiltinSet<"vwredsum", "csi", @@ -2420,7 +2041,7 @@ let HasMaskedOffOperand = true in { [["vs", "UvUSw", "USwUvUSw"]]>; } -// 15.3. Vector Single-Width Floating-Point Reduction Instructions +// 14.3. Vector Single-Width Floating-Point Reduction Instructions defm vfredmax : RVVFloatingReductionBuiltin; defm vfredmin : RVVFloatingReductionBuiltin; let ManualCodegen = [{ @@ -2466,26 +2087,26 @@ let ManualCodegen = [{ } }] in { let HasFRMRoundModeOp = 1 in { - // 15.3. Vector Single-Width Floating-Point Reduction Instructions + // 14.3. Vector Single-Width Floating-Point Reduction Instructions defm vfredusum : RVVFloatingReductionBuiltinRoundingMode; defm vfredosum : RVVFloatingReductionBuiltinRoundingMode; - // 15.4. Vector Widening Floating-Point Reduction Instructions + // 14.4. Vector Widening Floating-Point Reduction Instructions defm vfwredusum : RVVFloatingWidenReductionBuiltinRoundingMode; defm vfwredosum : RVVFloatingWidenReductionBuiltinRoundingMode; } - // 15.3. Vector Single-Width Floating-Point Reduction Instructions + // 14.3. Vector Single-Width Floating-Point Reduction Instructions defm vfredusum : RVVFloatingReductionBuiltin; defm vfredosum : RVVFloatingReductionBuiltin; - // 15.4. Vector Widening Floating-Point Reduction Instructions + // 14.4. Vector Widening Floating-Point Reduction Instructions defm vfwredusum : RVVFloatingWidenReductionBuiltin; defm vfwredosum : RVVFloatingWidenReductionBuiltin; } } -// 16. Vector Mask Instructions -// 16.1. Vector Mask-Register Logical Instructions +// 15. Vector Mask Instructions +// 15.1. Vector Mask-Register Logical Instructions def vmand : RVVMaskBinBuiltin; def vmnand : RVVMaskBinBuiltin; def vmandn : RVVMaskBinBuiltin; @@ -2501,36 +2122,36 @@ defm vmmv_m : RVVPseudoMaskBuiltin<"vmand", "c">; defm vmnot_m : RVVPseudoMaskBuiltin<"vmnand", "c">; let MaskedPolicyScheme = NonePolicy in { -// 16.2. Vector count population in mask vcpop.m +// 15.2. Vector count population in mask vcpop.m def vcpop : RVVMaskOp0Builtin<"um">; -// 16.3. vfirst find-first-set mask bit +// 15.3. vfirst find-first-set mask bit def vfirst : RVVMaskOp0Builtin<"lm">; } let MaskedPolicyScheme = HasPassthruOperand, HasTailPolicy = false in { -// 16.4. vmsbf.m set-before-first mask bit +// 15.4. vmsbf.m set-before-first mask bit def vmsbf : RVVMaskUnaryBuiltin; -// 16.5. vmsif.m set-including-first mask bit +// 15.5. vmsif.m set-including-first mask bit def vmsif : RVVMaskUnaryBuiltin; -// 16.6. vmsof.m set-only-first mask bit +// 15.6. vmsof.m set-only-first mask bit def vmsof : RVVMaskUnaryBuiltin; } let UnMaskedPolicyScheme = HasPassthruOperand, SupportOverloading = false in { - // 16.8. Vector Iota Instruction + // 15.8. Vector Iota Instruction defm viota : RVVOutBuiltinSet<"viota", "csil", [["m", "Uv", "Uvm"]]>; - // 16.9. Vector Element Index Instruction + // 15.9. Vector Element Index Instruction defm vid : RVVOutBuiltinSet<"vid", "csil", [["v", "v", "v"], ["v", "Uv", "Uv"]]>; } -// 17. Vector Permutation Instructions -// 17.1. Integer Scalar Move Instructions +// 16. Vector Permutation Instructions +// 16.1. Integer Scalar Move Instructions let HasMasked = false, MaskedPolicyScheme = NonePolicy in { let HasVL = false, OverloadedName = "vmv_x" in defm vmv_x : RVVOp0BuiltinSet<"vmv_x_s", "csil", @@ -2544,7 +2165,7 @@ let HasMasked = false, MaskedPolicyScheme = NonePolicy in { ["x", "Uv", "UvUe"]]>; } -// 17.2. Floating-Point Scalar Move Instructions +// 16.2. Floating-Point Scalar Move Instructions let HasMasked = false, MaskedPolicyScheme = NonePolicy in { let HasVL = false, OverloadedName = "vfmv_f" in defm vfmv_f : RVVOp0BuiltinSet<"vfmv_f_s", "xfd", @@ -2557,22 +2178,22 @@ let HasMasked = false, MaskedPolicyScheme = NonePolicy in { ["x", "Uv", "UvUe"]]>; } -// 17.3. Vector Slide Instructions -// 17.3.1. Vector Slideup Instructions +// 16.3. Vector Slide Instructions +// 16.3.1. Vector Slideup Instructions defm vslideup : RVVSlideUpBuiltinSet; -// 17.3.2. Vector Slidedown Instructions +// 16.3.2. Vector Slidedown Instructions defm vslidedown : RVVSlideDownBuiltinSet; -// 17.3.3. Vector Slide1up Instructions +// 16.3.3. Vector Slide1up Instructions let UnMaskedPolicyScheme = HasPassthruOperand in { defm vslide1up : RVVSlideOneBuiltinSet; defm vfslide1up : RVVFloatingBinVFBuiltinSet; -// 17.3.4. Vector Slide1down Instruction +// 16.3.4. Vector Slide1down Instruction defm vslide1down : RVVSlideOneBuiltinSet; defm vfslide1down : RVVFloatingBinVFBuiltinSet; -// 17.4. Vector Register Gather Instructions +// 16.4. Vector Register Gather Instructions // signed and floating type defm vrgather : RVVOutBuiltinSet<"vrgather_vv", "csilxfd", [["vv", "v", "vvUv"]]>; @@ -2589,7 +2210,7 @@ defm vrgatherei16 : RVVOutBuiltinSet<"vrgatherei16_vv", "csil", [["vv", "Uv", "UvUv(Log2EEW:4)Uv"]]>; } -// 17.5. Vector Compress Instruction +// 16.5. Vector Compress Instruction let HasMasked = false, UnMaskedPolicyScheme = HasPassthruOperand, MaskedPolicyScheme = NonePolicy, @@ -2645,11 +2266,17 @@ let HasMasked = false, HasVL = false, IRName = "" in { }] in { // Reinterpret between different type under the same SEW and LMUL def vreinterpret_i_u : RVVBuiltin<"Uvv", "vUv", "csil", "v">; - def vreinterpret_i_f : RVVBuiltin<"Fvv", "vFv", "sil", "v">; + def vreinterpret_i_f : RVVBuiltin<"Fvv", "vFv", "il", "v">; def vreinterpret_u_i : RVVBuiltin<"vUv", "Uvv", "csil", "Uv">; - def vreinterpret_u_f : RVVBuiltin<"FvUv", "UvFv", "sil", "Uv">; - def vreinterpret_f_i : RVVBuiltin<"vFv", "Fvv", "sil", "Fv">; - def vreinterpret_f_u : RVVBuiltin<"UvFv", "FvUv", "sil", "Fv">; + def vreinterpret_u_f : RVVBuiltin<"FvUv", "UvFv", "il", "Uv">; + def vreinterpret_f_i : RVVBuiltin<"vFv", "Fvv", "il", "Fv">; + def vreinterpret_f_u : RVVBuiltin<"UvFv", "FvUv", "il", "Fv">; + let RequiredFeatures = ["ZvfhminOrZvfh"] in { + def vreinterpret_i_h : RVVBuiltin<"Fvv", "vFv", "s", "v">; + def vreinterpret_u_h : RVVBuiltin<"FvUv", "UvFv", "s", "Uv">; + def vreinterpret_h_i : RVVBuiltin<"vFv", "Fvv", "s", "Fv">; + def vreinterpret_h_u : RVVBuiltin<"UvFv", "FvUv", "s", "Fv">; + } // Reinterpret between different SEW under the same LMUL foreach dst_sew = ["(FixedSEW:8)", "(FixedSEW:16)", "(FixedSEW:32)", @@ -2715,6 +2342,15 @@ let HasMasked = false, HasVL = false, IRName = "" in { }] in { def vundefined : RVVBuiltin<"v", "v", "csilxfd">; def vundefined_u : RVVBuiltin<"Uv", "Uv", "csil">; + + foreach nf = NFList in { + let NF = nf in { + defvar T = "(Tuple:" # nf # ")"; + def : RVVBuiltin; + def : RVVBuiltin; + } + } + } // LMUL truncation @@ -2817,4 +2453,162 @@ let HasMasked = false, HasVL = false, IRName = "" in { def : RVVBuiltin<"Uv" # T # "Uv", T # "Uv" # T # "UvKzUv", "csil">; } } + + let Name = "vcreate_v", + UnMaskedPolicyScheme = NonePolicy, + MaskedPolicyScheme = NonePolicy, + SupportOverloading = false, + ManualCodegen = [{ + { + if (isa(ResultType)) { + unsigned NF = cast(ResultType)->getNumElements(); + llvm::Value *ReturnTuple = llvm::PoisonValue::get(ResultType); + for (unsigned I = 0; I < NF; ++I) { + ReturnTuple = Builder.CreateInsertValue(ReturnTuple, Ops[I], {I}); + } + return ReturnTuple; + } + llvm::Value *ReturnVector = llvm::PoisonValue::get(ResultType); + auto *VecTy = cast(Ops[0]->getType()); + for (unsigned I = 0, N = Ops.size(); I < N; ++I) { + llvm::Value *Idx = + ConstantInt::get(Builder.getInt64Ty(), + VecTy->getMinNumElements() * I); + ReturnVector = + Builder.CreateInsertVector(ResultType, ReturnVector, Ops[I], Idx); + } + return ReturnVector; + } + }] in { + + defm : RVVNonTupleVCreateBuiltin<1, [0]>; + defm : RVVNonTupleVCreateBuiltin<2, [0, 1]>; + defm : RVVNonTupleVCreateBuiltin<3, [0, 1, 2]>; + + foreach nf = NFList in { + let NF = nf in { + defvar T = "(Tuple:" # nf # ")"; + defvar V = VString.S; + defvar UV = VString.S; + def : RVVBuiltin; + def : RVVBuiltin; + } + } + } +} + +multiclass RVVOutBuiltinSetZvbb { + let OverloadedName = NAME in + defm "" : RVVOutBuiltinSet; +} + +multiclass RVVOutBuiltinSetZvk { + // vaesz only has 'vs' and vgmul only has 'vv' and they do not have ambiguous + // prototypes like other zvkned instructions (e.g. vaesdf), so we don't + // need to encode the operand mnemonics into its intrinsic function name. + if HasVV then { + defvar name = NAME # !if(!eq(NAME, "vgmul"), "", "_vv"); + let OverloadedName = name in + defm "" : RVVOutBuiltinSet; + } + + if HasVS then { + foreach vs2_lmul = ["(SEFixedLog2LMUL:-1)", "(SEFixedLog2LMUL:0)", + "(SEFixedLog2LMUL:1)", "(SEFixedLog2LMUL:2)", + "(SEFixedLog2LMUL:3)"] in { + defvar name = NAME # !if(!eq(NAME, "vaesz"), "", "_vs"); + let OverloadedName = name, IRName = NAME # "_vs", Name = NAME # "_vs", + IntrinsicTypes = [-1, 1] in + def NAME # vs2_lmul + : RVVBuiltin; + } + } +} + +multiclass RVVOutOp2BuiltinSetVVZvk + : RVVOutOp2BuiltinSet; + +multiclass RVVOutOp2BuiltinSetVIZvk + : RVVOutOp2BuiltinSet; + +multiclass RVVSignedWidenBinBuiltinSetVwsll + : RVVWidenBuiltinSet; + +let UnMaskedPolicyScheme = HasPassthruOperand in { + // zvkb + let RequiredFeatures = ["Zvkb"] in { + defm vandn : RVVUnsignedBinBuiltinSet; + defm vbrev8 : RVVOutBuiltinSetZvbb; + defm vrev8 : RVVOutBuiltinSetZvbb; + defm vrol : RVVUnsignedShiftBuiltinSet; + defm vror : RVVUnsignedShiftBuiltinSet; + } + + // zvbb + let RequiredFeatures = ["Zvbb"] in { + defm vbrev : RVVOutBuiltinSetZvbb; + defm vclz : RVVOutBuiltinSetZvbb; + defm vctz : RVVOutBuiltinSetZvbb; + defm vcpopv : RVVOutBuiltinSetZvbb; + let OverloadedName = "vwsll" in + defm vwsll : RVVSignedWidenBinBuiltinSetVwsll; + } + + // zvbc + let RequiredFeatures = ["Zvbc"] in { + defm vclmul : RVVInt64BinBuiltinSet; + defm vclmulh : RVVInt64BinBuiltinSet; + } +} + +let UnMaskedPolicyScheme = HasPolicyOperand, HasMasked = false in { + // zvkg + let RequiredFeatures = ["Zvkg"] in { + defm vghsh : RVVOutOp2BuiltinSetVVZvk; + defm vgmul : RVVOutBuiltinSetZvk; + } + + // zvkned + let RequiredFeatures = ["Zvkned"] in { + defm vaesdf : RVVOutBuiltinSetZvk; + defm vaesdm : RVVOutBuiltinSetZvk; + defm vaesef : RVVOutBuiltinSetZvk; + defm vaesem : RVVOutBuiltinSetZvk; + let UnMaskedPolicyScheme = HasPassthruOperand in + defm vaeskf1 : RVVOutOp1BuiltinSet<"vaeskf1", "i", [["vi", "Uv", "UvUvKz"]]>; + defm vaeskf2 : RVVOutOp2BuiltinSetVIZvk; + defm vaesz : RVVOutBuiltinSetZvk; + } + + // zvknha + let RequiredFeatures = ["Zvknha"] in { + defm vsha2ch : RVVOutOp2BuiltinSetVVZvk<"i">; + defm vsha2cl : RVVOutOp2BuiltinSetVVZvk<"i">; + defm vsha2ms : RVVOutOp2BuiltinSetVVZvk<"i">; + } + + // zvknhb + let RequiredFeatures = ["Zvknhb"] in { + defm vsha2ch : RVVOutOp2BuiltinSetVVZvk<"il">; + defm vsha2cl : RVVOutOp2BuiltinSetVVZvk<"il">; + defm vsha2ms : RVVOutOp2BuiltinSetVVZvk<"il">; + } + + // zvksed + let RequiredFeatures = ["Zvksed"] in { + let UnMaskedPolicyScheme = HasPassthruOperand in + defm vsm4k : RVVOutOp1BuiltinSet<"vsm4k", "i", [["vi", "Uv", "UvUvKz"]]>; + defm vsm4r : RVVOutBuiltinSetZvk; + } + + // zvksh + let RequiredFeatures = ["Zvksh"] in { + defm vsm3c : RVVOutOp2BuiltinSetVIZvk; + let UnMaskedPolicyScheme = HasPassthruOperand in + defm vsm3me : RVVOutOp1BuiltinSet<"vsm3me", "i", [["vv", "Uv", "UvUvUv"]]>; + } } diff --git a/contrib/llvm-project/clang/include/clang/Basic/riscv_vector_common.td b/contrib/llvm-project/clang/include/clang/Basic/riscv_vector_common.td index e276e4c3c409..4036ce8e6903 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/riscv_vector_common.td +++ b/contrib/llvm-project/clang/include/clang/Basic/riscv_vector_common.td @@ -41,6 +41,7 @@ // x: float16_t (half) // f: float32_t (float) // d: float64_t (double) +// b: bfloat16_t (bfloat16) // // This way, given an LMUL, a record with a TypeRange "sil" will cause the // definition of 3 builtins. Each type "t" in the TypeRange (in this example @@ -66,6 +67,7 @@ // t: ptrdiff_t, ignores "t" // u: unsigned long, ignores "t" // l: long, ignores "t" +// f: float32, ignores "t" // // So for instance if t is "i", i.e. int, then "e" will yield int again. "v" // will yield an RVV vector type (assume LMUL=1), so __rvv_int32m1_t. @@ -97,6 +99,11 @@ // and LMUL), and computes another vector type which only changed LMUL as // given value. The new LMUL should be smaller than the old one. Ignore to // define a new builtin if its equivalent type has illegal lmul. +// (SEFixedLog2LMUL:Value): Smaller or Equal Fixed Log2LMUL. Given a vector +// type (SEW and LMUL), and computes another vector type which only +// changed LMUL as given value. The new LMUL should be smaller than or +// equal to the old one. Ignore to define a new builtin if its equivalent +// type has illegal lmul. // (LFixedLog2LMUL:Value): Larger Fixed Log2LMUL. Given a vector type (SEW // and LMUL), and computes another vector type which only changed LMUL as // given value. The new LMUL should be larger than the old one. Ignore to @@ -244,3 +251,463 @@ class RVVBuiltin + : RVVBuiltin { + let IntrinsicTypes = [-1]; +} + +class RVVOp0Builtin + : RVVBuiltin { + let IntrinsicTypes = [0]; +} + +class RVVOutOp1Builtin + : RVVBuiltin { + let IntrinsicTypes = [-1, 1]; +} + +class RVVOutOp0Op1Builtin + : RVVBuiltin { + let IntrinsicTypes = [-1, 0, 1]; +} + +multiclass RVVBuiltinSet> suffixes_prototypes, + list intrinsic_types> { + let IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask", + IntrinsicTypes = intrinsic_types in { + foreach s_p = suffixes_prototypes in { + let Name = NAME # "_" # s_p[0] in { + defvar suffix = s_p[1]; + defvar prototype = s_p[2]; + def : RVVBuiltin; + } + } + } +} + +// IntrinsicTypes is output, op0, op1 [-1, 0, 1] +multiclass RVVOutOp0Op1BuiltinSet> suffixes_prototypes> + : RVVBuiltinSet; + +multiclass RVVOutBuiltinSet> suffixes_prototypes> + : RVVBuiltinSet; + +multiclass RVVOp0BuiltinSet> suffixes_prototypes> + : RVVBuiltinSet; + +// IntrinsicTypes is output, op1 [-1, 0] +multiclass RVVOutOp0BuiltinSet> suffixes_prototypes> + : RVVBuiltinSet; + +// IntrinsicTypes is output, op1 [-1, 1] +multiclass RVVOutOp1BuiltinSet> suffixes_prototypes> + : RVVBuiltinSet; + +multiclass RVVOp0Op1BuiltinSet> suffixes_prototypes> + : RVVBuiltinSet; + +multiclass RVVOutOp1Op2BuiltinSet> suffixes_prototypes> + : RVVBuiltinSet; + +// IntrinsicTypes is output, op2 [-1, 2] +multiclass RVVOutOp2BuiltinSet> suffixes_prototypes> + : RVVBuiltinSet; + +multiclass RVVSignedBinBuiltinSet + : RVVOutOp1BuiltinSet; + +multiclass RVVSignedBinBuiltinSetRoundingMode + : RVVOutOp1BuiltinSet; + +multiclass RVVUnsignedBinBuiltinSet + : RVVOutOp1BuiltinSet; + +multiclass RVVUnsignedBinBuiltinSetRoundingMode + : RVVOutOp1BuiltinSet; + +multiclass RVVIntBinBuiltinSet + : RVVSignedBinBuiltinSet, + RVVUnsignedBinBuiltinSet; + +multiclass RVVInt64BinBuiltinSet + : RVVOutOp1BuiltinSet, + RVVOutOp1BuiltinSet; + +multiclass RVVSlideOneBuiltinSet + : RVVOutOp1BuiltinSet; + +multiclass RVVSignedShiftBuiltinSet + : RVVOutOp1BuiltinSet; + +multiclass RVVSignedShiftBuiltinSetRoundingMode + : RVVOutOp1BuiltinSet; + +multiclass RVVUnsignedShiftBuiltinSet + : RVVOutOp1BuiltinSet; + +multiclass RVVUnsignedShiftBuiltinSetRoundingMode + : RVVOutOp1BuiltinSet; + +multiclass RVVShiftBuiltinSet + : RVVSignedShiftBuiltinSet, + RVVUnsignedShiftBuiltinSet; + +let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { + multiclass RVVSignedNShiftBuiltinSet + : RVVOutOp0Op1BuiltinSet; + + multiclass RVVSignedNShiftBuiltinSetRoundingMode + : RVVOutOp0Op1BuiltinSet; + + multiclass RVVUnsignedNShiftBuiltinSet + : RVVOutOp0Op1BuiltinSet; + + multiclass RVVUnsignedNShiftBuiltinSetRoundingMode + : RVVOutOp0Op1BuiltinSet; + +} + +multiclass RVVCarryinBuiltinSet + : RVVOutOp1BuiltinSet; + +multiclass RVVCarryOutInBuiltinSet + : RVVOp0Op1BuiltinSet; + +multiclass RVVSignedMaskOutBuiltinSet + : RVVOp0Op1BuiltinSet; + +multiclass RVVUnsignedMaskOutBuiltinSet + : RVVOp0Op1BuiltinSet; + +multiclass RVVIntMaskOutBuiltinSet + : RVVSignedMaskOutBuiltinSet, + RVVUnsignedMaskOutBuiltinSet; + +class RVVIntExt + : RVVBuiltin { + let IRName = intrinsic_name; + let MaskedIRName = intrinsic_name # "_mask"; + let OverloadedName = NAME; + let IntrinsicTypes = [-1, 0]; +} + +let HasMaskedOffOperand = false in { + multiclass RVVIntTerBuiltinSet { + defm "" : RVVOutOp1BuiltinSet; + } + multiclass RVVFloatingTerBuiltinSet { + defm "" : RVVOutOp1BuiltinSet; + } + multiclass RVVFloatingTerBuiltinSetRoundingMode { + defm "" : RVVOutOp1BuiltinSet; + } +} + +let HasMaskedOffOperand = false, Log2LMUL = [-2, -1, 0, 1, 2] in { + multiclass RVVFloatingWidenTerBuiltinSet { + defm "" : RVVOutOp1Op2BuiltinSet; + } + multiclass RVVFloatingWidenTerBuiltinSetRoundingMode { + defm "" : RVVOutOp1Op2BuiltinSet; + } +} + +multiclass RVVFloatingBinBuiltinSet + : RVVOutOp1BuiltinSet; + +multiclass RVVFloatingBinBuiltinSetRoundingMode + : RVVOutOp1BuiltinSet; + +multiclass RVVFloatingBinVFBuiltinSet + : RVVOutOp1BuiltinSet; + +multiclass RVVFloatingBinVFBuiltinSetRoundingMode + : RVVOutOp1BuiltinSet; + +multiclass RVVFloatingMaskOutBuiltinSet + : RVVOp0Op1BuiltinSet; + +multiclass RVVFloatingMaskOutVFBuiltinSet + : RVVOp0Op1BuiltinSet; + +multiclass RVVConvBuiltinSet> suffixes_prototypes> { +let Name = intrinsic_name, + IRName = intrinsic_name, + MaskedIRName = intrinsic_name # "_mask", + IntrinsicTypes = [-1, 0] in { + foreach s_p = suffixes_prototypes in { + defvar suffix = s_p[0]; + defvar prototype = s_p[1]; + def : RVVBuiltin; + } + } +} + + +class RVVMaskBinBuiltin : RVVOutBuiltin<"m", "mmm", "c"> { + let Name = NAME # "_mm"; + let HasMasked = false; +} + +class RVVMaskUnaryBuiltin : RVVOutBuiltin<"m", "mm", "c"> { + let Name = NAME # "_m"; +} + +class RVVMaskNullaryBuiltin : RVVOutBuiltin<"m", "m", "c"> { + let Name = NAME # "_m"; + let HasMasked = false; + let SupportOverloading = false; +} + +class RVVMaskOp0Builtin : RVVOp0Builtin<"m", prototype, "c"> { + let Name = NAME # "_m"; + let HasMaskedOffOperand = false; +} + +let UnMaskedPolicyScheme = HasPolicyOperand, + HasMaskedOffOperand = false in { + multiclass RVVSlideUpBuiltinSet { + defm "" : RVVOutBuiltinSet; + defm "" : RVVOutBuiltinSet; + } +} + +let UnMaskedPolicyScheme = HasPassthruOperand, + ManualCodegen = [{ + if (IsMasked) { + std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); + if ((PolicyAttrs & RVV_VTA) && (PolicyAttrs & RVV_VMA)) + Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); + } else { + if (PolicyAttrs & RVV_VTA) + Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); + } + + Ops.push_back(ConstantInt::get(Ops.back()->getType(), PolicyAttrs)); + IntrinsicTypes = {ResultType, Ops.back()->getType()}; + }] in { + multiclass RVVSlideDownBuiltinSet { + defm "" : RVVOutBuiltinSet; + defm "" : RVVOutBuiltinSet; + } +} + +class RVVFloatingUnaryBuiltin + : RVVOutBuiltin { + let Name = NAME # "_" # builtin_suffix; +} + +class RVVFloatingUnaryVVBuiltin : RVVFloatingUnaryBuiltin<"v", "v", "vv">; + +class RVVConvBuiltin + : RVVBuiltin { + let IntrinsicTypes = [-1, 0]; + let OverloadedName = overloaded_name; +} + +class RVVConvToSignedBuiltin + : RVVConvBuiltin<"Iv", "Ivv", "xfd", overloaded_name>; + +class RVVConvToUnsignedBuiltin + : RVVConvBuiltin<"Uv", "Uvv", "xfd", overloaded_name>; + +class RVVConvToWidenSignedBuiltin + : RVVConvBuiltin<"Iw", "Iwv", "xf", overloaded_name>; + +class RVVConvToWidenUnsignedBuiltin + : RVVConvBuiltin<"Uw", "Uwv", "xf", overloaded_name>; + +class RVVConvToNarrowingSignedBuiltin + : RVVConvBuiltin<"Iv", "IvFw", "csi", overloaded_name>; + +class RVVConvToNarrowingUnsignedBuiltin + : RVVConvBuiltin<"Uv", "UvFw", "csi", overloaded_name>; + +let HasMaskedOffOperand = true in { + multiclass RVVSignedReductionBuiltin { + defm "" : RVVOutOp0BuiltinSet; + } + multiclass RVVUnsignedReductionBuiltin { + defm "" : RVVOutOp0BuiltinSet; + } + multiclass RVVFloatingReductionBuiltin { + defm "" : RVVOutOp0BuiltinSet; + } + multiclass RVVFloatingReductionBuiltinRoundingMode { + defm "" : RVVOutOp0BuiltinSet; + } + multiclass RVVFloatingWidenReductionBuiltin { + defm "" : RVVOutOp0BuiltinSet; + } + multiclass RVVFloatingWidenReductionBuiltinRoundingMode { + defm "" : RVVOutOp0BuiltinSet; + } +} + +multiclass RVVIntReductionBuiltinSet + : RVVSignedReductionBuiltin, + RVVUnsignedReductionBuiltin; + +// For widen operation which has different mangling name. +multiclass RVVWidenBuiltinSet> suffixes_prototypes> { + let Log2LMUL = [-3, -2, -1, 0, 1, 2], + IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask" in { + foreach s_p = suffixes_prototypes in { + let Name = NAME # "_" # s_p[0], + OverloadedName = NAME # "_" # s_p[0] in { + defvar suffix = s_p[1]; + defvar prototype = s_p[2]; + def : RVVOutOp0Op1Builtin; + } + } + } +} + +// For widen operation with widen operand which has different mangling name. +multiclass RVVWidenWOp0BuiltinSet> suffixes_prototypes> { + let Log2LMUL = [-3, -2, -1, 0, 1, 2], + IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask" in { + foreach s_p = suffixes_prototypes in { + let Name = NAME # "_" # s_p[0], + OverloadedName = NAME # "_" # s_p[0] in { + defvar suffix = s_p[1]; + defvar prototype = s_p[2]; + def : RVVOutOp1Builtin; + } + } + } +} + +multiclass RVVSignedWidenBinBuiltinSet + : RVVWidenBuiltinSet; + +multiclass RVVSignedWidenOp0BinBuiltinSet + : RVVWidenWOp0BuiltinSet; + +multiclass RVVUnsignedWidenBinBuiltinSet + : RVVWidenBuiltinSet; + +multiclass RVVUnsignedWidenOp0BinBuiltinSet + : RVVWidenWOp0BuiltinSet; + +multiclass RVVFloatingWidenBinBuiltinSet + : RVVWidenBuiltinSet; + +multiclass RVVFloatingWidenBinBuiltinSetRoundingMode + : RVVWidenBuiltinSet; + +multiclass RVVFloatingWidenOp0BinBuiltinSet + : RVVWidenWOp0BuiltinSet; + +multiclass RVVFloatingWidenOp0BinBuiltinSetRoundingMode + : RVVWidenWOp0BuiltinSet; diff --git a/contrib/llvm-project/clang/include/clang/CodeGen/BackendUtil.h b/contrib/llvm-project/clang/include/clang/CodeGen/BackendUtil.h index cdbfe4ca5e65..fc8ed4f011f9 100644 --- a/contrib/llvm-project/clang/include/clang/CodeGen/BackendUtil.h +++ b/contrib/llvm-project/clang/include/clang/CodeGen/BackendUtil.h @@ -30,6 +30,7 @@ namespace clang { class CodeGenOptions; class TargetOptions; class LangOptions; + class BackendConsumer; enum BackendAction { Backend_EmitAssembly, ///< Emit native assembly files @@ -45,7 +46,8 @@ namespace clang { const TargetOptions &TOpts, const LangOptions &LOpts, StringRef TDesc, llvm::Module *M, BackendAction Action, llvm::IntrusiveRefCntPtr VFS, - std::unique_ptr OS); + std::unique_ptr OS, + BackendConsumer *BC = nullptr); void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::MemoryBufferRef Buf); diff --git a/contrib/llvm-project/clang/include/clang/CodeGen/CGFunctionInfo.h b/contrib/llvm-project/clang/include/clang/CodeGen/CGFunctionInfo.h index b8971d5793f3..e388901b8a50 100644 --- a/contrib/llvm-project/clang/include/clang/CodeGen/CGFunctionInfo.h +++ b/contrib/llvm-project/clang/include/clang/CodeGen/CGFunctionInfo.h @@ -527,6 +527,11 @@ public: return NumRequired; } + /// Return true if the argument at a given index is required. + bool isRequiredArg(unsigned argIdx) const { + return argIdx == ~0U || argIdx < NumRequired; + } + unsigned getOpaqueData() const { return NumRequired; } static RequiredArgs getFromOpaqueData(unsigned value) { if (value == ~0U) return All; diff --git a/contrib/llvm-project/clang/include/clang/CodeGen/ConstantInitBuilder.h b/contrib/llvm-project/clang/include/clang/CodeGen/ConstantInitBuilder.h index 88e357a0c29c..498acfd38013 100644 --- a/contrib/llvm-project/clang/include/clang/CodeGen/ConstantInitBuilder.h +++ b/contrib/llvm-project/clang/include/clang/CodeGen/ConstantInitBuilder.h @@ -41,7 +41,7 @@ class CodeGenModule; /// for (auto &widget : widgets) { /// auto widgetDesc = widgetArray.beginStruct(); /// widgetDesc.addInt(CGM.SizeTy, widget.getPower()); -/// widgetDesc.add(CGM.GetAddrOfConstantString(widget.getName())); +/// widgetDesc.add(CGM.GetAddrOfConstantStringFromLiteral(widget.getName())); /// widgetDesc.add(CGM.GetAddrOfGlobal(widget.getInitializerDecl())); /// widgetDesc.finishAndAddTo(widgetArray); /// } @@ -204,11 +204,6 @@ public: add(llvm::ConstantPointerNull::get(ptrTy)); } - /// Add a bitcast of a value to a specific type. - void addBitCast(llvm::Constant *value, llvm::Type *type) { - add(llvm::ConstantExpr::getBitCast(value, type)); - } - /// Add a bunch of new values to this initializer. void addAll(llvm::ArrayRef values) { assert(!Finished && "cannot add more values after finishing builder"); diff --git a/contrib/llvm-project/clang/include/clang/Driver/ClangOptionDocs.td b/contrib/llvm-project/clang/include/clang/Driver/ClangOptionDocs.td index 3f914afea735..a5ee577c5f45 100644 --- a/contrib/llvm-project/clang/include/clang/Driver/ClangOptionDocs.td +++ b/contrib/llvm-project/clang/include/clang/Driver/ClangOptionDocs.td @@ -28,8 +28,10 @@ GCC-compatible ``clang`` and ``clang++`` drivers. }]; string Program = "clang"; - list ExcludedFlags = ["HelpHidden", "NoDriverOption", - "CLOption", "Unsupported", "Ignored", "FlangOnlyOption"]; + // Note: We *must* use DefaultVis and not ClangOption, since that's + // the name of the actual TableGen record. The alias will not work. + list VisibilityMask = ["DefaultVis"]; + list IgnoreFlags = ["HelpHidden", "Unsupported", "Ignored"]; } include "Options.td" diff --git a/contrib/llvm-project/clang/include/clang/Driver/Distro.h b/contrib/llvm-project/clang/include/clang/Driver/Distro.h index 8291f6575a71..a8de94163e8b 100644 --- a/contrib/llvm-project/clang/include/clang/Driver/Distro.h +++ b/contrib/llvm-project/clang/include/clang/Driver/Distro.h @@ -78,6 +78,7 @@ public: UbuntuKinetic, UbuntuLunar, UbuntuMantic, + UbuntuNoble, UnknownDistro }; @@ -129,7 +130,7 @@ public: } bool IsUbuntu() const { - return DistroVal >= UbuntuHardy && DistroVal <= UbuntuMantic; + return DistroVal >= UbuntuHardy && DistroVal <= UbuntuNoble; } bool IsAlpineLinux() const { return DistroVal == AlpineLinux; } diff --git a/contrib/llvm-project/clang/include/clang/Driver/Driver.h b/contrib/llvm-project/clang/include/clang/Driver/Driver.h index e3e98bad9912..3ee1bcf2a69c 100644 --- a/contrib/llvm-project/clang/include/clang/Driver/Driver.h +++ b/contrib/llvm-project/clang/include/clang/Driver/Driver.h @@ -455,7 +455,7 @@ public: /// ParseArgStrings - Parse the given list of strings into an /// ArgList. llvm::opt::InputArgList ParseArgStrings(ArrayRef Args, - bool IsClCompatMode, + bool UseDriverMode, bool &ContainsError); /// BuildInputs - Construct the list of inputs and their types from @@ -759,7 +759,8 @@ private: /// Get bitmasks for which option flags to include and exclude based on /// the driver mode. - std::pair getIncludeExcludeOptionFlagMasks(bool IsClCompatMode) const; + llvm::opt::Visibility + getOptionVisibilityMask(bool UseDriverMode = true) const; /// Helper used in BuildJobsForAction. Doesn't use the cache when building /// jobs specifically for the given action, but will use the cache when diff --git a/contrib/llvm-project/clang/include/clang/Driver/Multilib.h b/contrib/llvm-project/clang/include/clang/Driver/Multilib.h index 1416559414f8..9a2cc9bb1ba1 100644 --- a/contrib/llvm-project/clang/include/clang/Driver/Multilib.h +++ b/contrib/llvm-project/clang/include/clang/Driver/Multilib.h @@ -39,13 +39,22 @@ private: std::string IncludeSuffix; flags_list Flags; + // Optionally, a multilib can be assigned a string tag indicating that it's + // part of a group of mutually exclusive possibilities. If two or more + // multilibs have the same non-empty value of ExclusiveGroup, then only the + // last matching one of them will be selected. + // + // Setting this to the empty string is a special case, indicating that the + // directory is not mutually exclusive with anything else. + std::string ExclusiveGroup; + public: /// GCCSuffix, OSSuffix & IncludeSuffix will be appended directly to the /// sysroot string so they must either be empty or begin with a '/' character. /// This is enforced with an assert in the constructor. Multilib(StringRef GCCSuffix = {}, StringRef OSSuffix = {}, - StringRef IncludeSuffix = {}, - const flags_list &Flags = flags_list()); + StringRef IncludeSuffix = {}, const flags_list &Flags = flags_list(), + StringRef ExclusiveGroup = {}); /// Get the detected GCC installation path suffix for the multi-arch /// target variant. Always starts with a '/', unless empty @@ -63,6 +72,9 @@ public: /// All elements begin with either '-' or '!' const flags_list &flags() const { return Flags; } + /// Get the exclusive group label. + const std::string &exclusiveGroup() const { return ExclusiveGroup; } + LLVM_DUMP_METHOD void dump() const; /// print summary of the Multilib void print(raw_ostream &OS) const; @@ -118,7 +130,7 @@ public: /// Select compatible variants, \returns false if none are compatible bool select(const Multilib::flags_list &Flags, - llvm::SmallVector &) const; + llvm::SmallVectorImpl &) const; unsigned size() const { return Multilibs.size(); } diff --git a/contrib/llvm-project/clang/include/clang/Driver/OffloadBundler.h b/contrib/llvm-project/clang/include/clang/Driver/OffloadBundler.h index 28473c53662d..84349abe185f 100644 --- a/contrib/llvm-project/clang/include/clang/Driver/OffloadBundler.h +++ b/contrib/llvm-project/clang/include/clang/Driver/OffloadBundler.h @@ -19,6 +19,7 @@ #include "llvm/Support/Error.h" #include "llvm/TargetParser/Triple.h" +#include #include #include @@ -26,11 +27,15 @@ namespace clang { class OffloadBundlerConfig { public: + OffloadBundlerConfig(); + bool AllowNoHost = false; bool AllowMissingBundles = false; bool CheckInputArchive = false; bool PrintExternalCommands = false; bool HipOpenmpCompatible = false; + bool Compress = false; + bool Verbose = false; unsigned BundleAlignment = 1; unsigned HostInputIndex = ~0u; @@ -61,7 +66,7 @@ public: llvm::Error UnbundleArchive(); }; -/// Obtain the offload kind, real machine triple, and an optional GPUArch +/// Obtain the offload kind, real machine triple, and an optional TargetID /// out of the target information specified by the user. /// Bundle Entry ID (or, Offload Target String) has following components: /// * Offload Kind - Host, OpenMP, or HIP @@ -84,6 +89,38 @@ struct OffloadTargetInfo { std::string str() const; }; +// CompressedOffloadBundle represents the format for the compressed offload +// bundles. +// +// The format is as follows: +// - Magic Number (4 bytes) - A constant "CCOB". +// - Version (2 bytes) +// - Compression Method (2 bytes) - Uses the values from +// llvm::compression::Format. +// - Uncompressed Size (4 bytes). +// - Truncated MD5 Hash (8 bytes). +// - Compressed Data (variable length). + +class CompressedOffloadBundle { +private: + static inline const size_t MagicSize = 4; + static inline const size_t VersionFieldSize = sizeof(uint16_t); + static inline const size_t MethodFieldSize = sizeof(uint16_t); + static inline const size_t SizeFieldSize = sizeof(uint32_t); + static inline const size_t HashFieldSize = 8; + static inline const size_t HeaderSize = MagicSize + VersionFieldSize + + MethodFieldSize + SizeFieldSize + + HashFieldSize; + static inline const llvm::StringRef MagicNumber = "CCOB"; + static inline const uint16_t Version = 1; + +public: + static llvm::Expected> + compress(const llvm::MemoryBuffer &Input, bool Verbose = false); + static llvm::Expected> + decompress(const llvm::MemoryBuffer &Input, bool Verbose = false); +}; + } // namespace clang #endif // LLVM_CLANG_DRIVER_OFFLOADBUNDLER_H diff --git a/contrib/llvm-project/clang/include/clang/Driver/Options.h b/contrib/llvm-project/clang/include/clang/Driver/Options.h index 54c6f5faa37c..0797410e9940 100644 --- a/contrib/llvm-project/clang/include/clang/Driver/Options.h +++ b/contrib/llvm-project/clang/include/clang/Driver/Options.h @@ -9,11 +9,8 @@ #ifndef LLVM_CLANG_DRIVER_OPTIONS_H #define LLVM_CLANG_DRIVER_OPTIONS_H -namespace llvm { -namespace opt { -class OptTable; -} -} +#include "llvm/Option/OptTable.h" +#include "llvm/Option/Option.h" namespace clang { namespace driver { @@ -26,26 +23,27 @@ enum ClangFlags { LinkerInput = (1 << 5), NoArgumentUnused = (1 << 6), Unsupported = (1 << 7), - CoreOption = (1 << 8), - CLOption = (1 << 9), - CC1Option = (1 << 10), - CC1AsOption = (1 << 11), - NoDriverOption = (1 << 12), - LinkOption = (1 << 13), - FlangOption = (1 << 14), - FC1Option = (1 << 15), - FlangOnlyOption = (1 << 16), - DXCOption = (1 << 17), - CLDXCOption = (1 << 18), - Ignored = (1 << 19), - TargetSpecific = (1 << 20), + LinkOption = (1 << 8), + Ignored = (1 << 9), + TargetSpecific = (1 << 10), +}; + +// Flags specifically for clang option visibility. We alias DefaultVis to +// ClangOption, because "DefaultVis" is confusing in Options.td, which is used +// for multiple drivers (clang, cl, flang, etc). +enum ClangVisibility { + ClangOption = llvm::opt::DefaultVis, + CLOption = (1 << 1), + CC1Option = (1 << 2), + CC1AsOption = (1 << 3), + FlangOption = (1 << 4), + FC1Option = (1 << 5), + DXCOption = (1 << 6), }; enum ID { OPT_INVALID = 0, // This is not an option ID. -#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \ - HELPTEXT, METAVAR, VALUES) \ - OPT_##ID, +#define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__), #include "clang/Driver/Options.inc" LastOption #undef OPTION diff --git a/contrib/llvm-project/clang/include/clang/Driver/Options.td b/contrib/llvm-project/clang/include/clang/Driver/Options.td index 37e8c56b2d29..1b02087425b7 100644 --- a/contrib/llvm-project/clang/include/clang/Driver/Options.td +++ b/contrib/llvm-project/clang/include/clang/Driver/Options.td @@ -35,50 +35,52 @@ def Unsupported : OptionFlag; // Ignored - The option is unsupported, and the driver will silently ignore it. def Ignored : OptionFlag; -// CoreOption - This is considered a "core" Clang option, available in both -// clang and clang-cl modes. -def CoreOption : OptionFlag; - -// CLOption - This is a cl.exe compatibility option. Options with this flag -// are made available when the driver is running in CL compatibility mode. -def CLOption : OptionFlag; - -// CC1Option - This option should be accepted by clang -cc1. -def CC1Option : OptionFlag; - -// CC1AsOption - This option should be accepted by clang -cc1as. -def CC1AsOption : OptionFlag; - -// DXCOption - This is a dxc.exe compatibility option. Options with this flag -// are made available when the driver is running in DXC compatibility mode. -def DXCOption : OptionFlag; - -// CLDXCOption - This is a cl.exe/dxc.exe compatibility option. Options with this flag -// are made available when the driver is running in CL/DXC compatibility mode. -def CLDXCOption : OptionFlag; - -// NoDriverOption - This option should not be accepted by the driver. -def NoDriverOption : OptionFlag; - // If an option affects linking, but has a primary group (so Link_Group cannot // be used), add this flag. def LinkOption : OptionFlag; -// FlangOption - This is considered a "core" Flang option, available in -// flang mode. -def FlangOption : OptionFlag; - -// FlangOnlyOption - This option should only be used by Flang (i.e. it is not -// available for Clang) -def FlangOnlyOption : OptionFlag; - -// FC1Option - This option should be accepted by flang -fc1. -def FC1Option : OptionFlag; - // This is a target-specific option for compilation. Using it on an unsupported // target will lead to an err_drv_unsupported_opt_for_target error. def TargetSpecific : OptionFlag; +// Indicates that this warning is ignored, but accepted with a warning for +// GCC compatibility. +class IgnoredGCCCompat : Flags<[HelpHidden]> {} + +class TargetSpecific : Flags<[TargetSpecific]> {} + +///////// +// Visibility + +// We prefer the name "ClangOption" here rather than "Default" to make +// it clear that these options will be visible in the clang driver (as +// opposed to clang -cc1, the CL driver, or the flang driver). +defvar ClangOption = DefaultVis; + +// CLOption - This is a cl.exe compatibility option. Options with this flag +// are made available when the driver is running in CL compatibility mode. +def CLOption : OptionVisibility; + +// CC1Option - This option should be accepted by clang -cc1. +def CC1Option : OptionVisibility; + +// CC1AsOption - This option should be accepted by clang -cc1as. +def CC1AsOption : OptionVisibility; + +// FlangOption - This is considered a "core" Flang option, available in +// flang mode. +def FlangOption : OptionVisibility; + +// FC1Option - This option should be accepted by flang -fc1. +def FC1Option : OptionVisibility; + +// DXCOption - This is a dxc.exe compatibility option. Options with this flag +// are made available when the driver is running in DXC compatibility mode. +def DXCOption : OptionVisibility; + +///////// +// Docs + // A short name to show in documentation. The name will be interpreted as rST. class DocName { string DocName = name; } @@ -89,12 +91,6 @@ class DocBrief { code DocBrief = descr; } // documentation. class DocFlatten { bit DocFlatten = 1; } -// Indicates that this warning is ignored, but accepted with a warning for -// GCC compatibility. -class IgnoredGCCCompat : Flags<[HelpHidden]> {} - -class TargetSpecific : Flags<[TargetSpecific]> {} - ///////// // Groups @@ -104,13 +100,13 @@ def Action_Group : OptionGroup<"">, DocName<"Actions">, // Meta-group for options which are only used for compilation, // and not linking etc. def CompileOnly_Group : OptionGroup<"">, - DocName<"Compilation flags">, DocBrief<[{ + DocName<"Compilation options">, DocBrief<[{ Flags controlling the behavior of Clang during compilation. These flags have no effect during actions that do not perform compilation.}]>; def Preprocessor_Group : OptionGroup<"">, Group, - DocName<"Preprocessor flags">, DocBrief<[{ + DocName<"Preprocessor options">, DocBrief<[{ Flags controlling the behavior of the Clang preprocessor.}]>; def IncludePath_Group : OptionGroup<"">, Group, @@ -132,7 +128,7 @@ def d_Group : OptionGroup<"">, Group, Flags allowing the state of the preprocessor to be dumped in various ways.}]>; def Diag_Group : OptionGroup<"">, Group, - DocName<"Diagnostic flags">, DocBrief<[{ + DocName<"Diagnostic options">, DocBrief<[{ Flags controlling which warnings, errors, and remarks Clang will generate. See the :doc:`full list of warning and remark flags `.}]>; @@ -150,14 +146,28 @@ def f_clang_Group : OptionGroup<"">, Group, DocFlatten; def pedantic_Group : OptionGroup<"">, Group, DocFlatten; + +def offload_Group : OptionGroup<"">, Group, + DocName<"Common Offloading options">, + Visibility<[ClangOption, CLOption]>; + def opencl_Group : OptionGroup<"">, Group, - DocName<"OpenCL flags">; + DocName<"OpenCL options">; def sycl_Group : OptionGroup<"">, Group, - DocName<"SYCL flags">; + DocName<"SYCL options">; + +def cuda_Group : OptionGroup<"">, Group, + DocName<"CUDA options">, + Visibility<[ClangOption, CLOption]>; + +def hip_Group : OptionGroup<"">, Group, + DocName<"HIP options">, + Visibility<[ClangOption, CLOption]>; def m_Group : OptionGroup<"">, Group, - DocName<"Target-dependent compilation options">; + DocName<"Target-dependent compilation options">, + Visibility<[ClangOption, CLOption]>; // Feature groups - these take command line options that correspond directly to // target specific features and can be translated directly from command line @@ -189,9 +199,17 @@ def m_wasm_Features_Group : OptionGroup<"">, def m_wasm_Features_Driver_Group : OptionGroup<"">, Group, DocName<"WebAssembly Driver">; def m_x86_Features_Group : OptionGroup<"">, - Group, Flags<[CoreOption]>, DocName<"X86">; + Group, Visibility<[ClangOption, CLOption]>, + DocName<"X86">; +def m_x86_AVX10_Features_Group : OptionGroup<"">, + Group, Visibility<[ClangOption, CLOption]>, + DocName<"X86 AVX10">; def m_riscv_Features_Group : OptionGroup<"">, Group, DocName<"RISC-V">; +def m_ve_Features_Group : OptionGroup<"">, + Group, DocName<"VE">; +def m_loongarch_Features_Group : OptionGroup<"">, + Group, DocName<"LoongArch">; def m_libc_Group : OptionGroup<"">, Group, Flags<[HelpHidden]>; @@ -213,20 +231,20 @@ def ggdbN_Group : OptionGroup<"">, Group, DocFlatten; def gTune_Group : OptionGroup<"">, Group, DocName<"Debugger to tune debug information for">; def g_flags_Group : OptionGroup<"">, Group, - DocName<"Debug information flags">; + DocName<"Debug information options">; def StaticAnalyzer_Group : OptionGroup<"">, - DocName<"Static analyzer flags">, DocBrief<[{ + DocName<"Static analyzer options">, DocBrief<[{ Flags controlling the behavior of the Clang Static Analyzer.}]>; // gfortran options that we recognize in the driver and pass along when // invoking GCC to compile Fortran code. def gfortran_Group : OptionGroup<"">, - DocName<"Fortran compilation flags">, DocBrief<[{ + DocName<"Fortran compilation options">, DocBrief<[{ Flags that will be passed onto the ``gfortran`` compiler when Clang is given a Fortran input.}]>; -def Link_Group : OptionGroup<"">, DocName<"Linker flags">, +def Link_Group : OptionGroup<"">, DocName<"Linker options">, DocBrief<[{Flags that are passed on to the linker}]>; def T_Group : OptionGroup<"">, Group, DocFlatten; def u_Group : OptionGroup<"">, Group, DocFlatten; @@ -243,7 +261,7 @@ def clang_ignored_m_Group : OptionGroup<"">, // Unsupported flang groups def flang_ignored_w_Group : OptionGroup<"">, - Group, Flags<[FlangOnlyOption, Ignored]>; + Group, Flags<[Ignored]>, Visibility<[FlangOption]>; // Group for clang options in the process of deprecation. // Please include the version that deprecated the flag as comment to allow @@ -252,7 +270,7 @@ def clang_ignored_legacy_options_Group : OptionGroup<"">, Group, Flags<[Ignored]>; def LongDouble_Group : OptionGroup<"">, Group, - DocName<"Long double flags">, + DocName<"Long double options">, DocBrief<[{Selects the long double implementation}]>; // Retired with clang-5.0 @@ -263,12 +281,6 @@ def : Flag<["-"], "fno-slp-vectorize-aggressive">, Group, Group; def mno_mpx : Flag<["-"], "mno-mpx">, Group; -// Retired with clang-16.0, to provide a deprecation period; it should -// be removed in Clang 18 or later. -def enable_trivial_var_init_zero : Flag<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">, - Flags<[CC1Option, CoreOption, NoArgumentUnused]>, - Group; - // Group that ignores all gcc optimizations that won't be implemented def clang_ignored_gcc_optimization_f_Group : OptionGroup< "">, Group, Flags<[Ignored]>; @@ -303,10 +315,11 @@ class MigratorOpts // This is useful if the option is usually disabled. // Use this only when the option cannot be declared via BoolFOption. multiclass OptInCC1FFlag flags=[]> { - def f#NAME : Flag<["-"], "f"#name>, Flags<[CC1Option] # flags>, + string help="", + list vis=[ClangOption]> { + def f#NAME : Flag<["-"], "f"#name>, Visibility<[CC1Option] # vis>, Group, HelpText; - def fno_#NAME : Flag<["-"], "fno-"#name>, Flags, + def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility, Group, HelpText; } @@ -314,10 +327,11 @@ multiclass OptInCC1FFlag flags=[]> { - def f#NAME : Flag<["-"], "f"#name>, Flags, + string help="", + list vis=[ClangOption]> { + def f#NAME : Flag<["-"], "f"#name>, Visibility, Group, HelpText; - def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[CC1Option] # flags>, + def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<[CC1Option] # vis>, Group, HelpText; } @@ -325,20 +339,22 @@ multiclass OptOutCC1FFlag flags=[]> { - def f#NAME : Flag<["-"], "f"#name>, Flags<[FC1Option] # flags>, + string help="", + list vis=[ClangOption]> { + def f#NAME : Flag<["-"], "f"#name>, Visibility<[FC1Option] # vis>, Group, HelpText; - def fno_#NAME : Flag<["-"], "fno-"#name>, Flags, + def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility, Group, HelpText; } // A boolean option which is opt-out in FC1. The negative option exists in FC1 and // Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled. multiclass OptOutFC1FFlag flags=[]> { - def f#NAME : Flag<["-"], "f"#name>, Flags, + string help="", + list vis=[ClangOption]> { + def f#NAME : Flag<["-"], "f"#name>, Visibility, Group, HelpText; - def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[FC1Option] # flags>, + def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<[FC1Option] # vis>, Group, HelpText; } @@ -371,7 +387,8 @@ def SetFalse : Set {} // Definition of single command line flag. This is an implementation detail, use // SetTrueBy or SetFalseBy instead. -class FlagDef option_flags, +class FlagDef option_flags, list option_vis, string help, list implied_by_expressions = []> { // The polarity. Besides spelling, this also decides whether the TableGen // record will be prefixed with "no_". @@ -380,9 +397,12 @@ class FlagDef option_flags, // The value assigned to key path when the flag is present on command line. bit Value = value; - // OptionFlags that control visibility of the flag in different tools. + // OptionFlags in different tools. list OptionFlags = option_flags; + // OptionVisibility flags for different tools. + list OptionVisibility = option_vis; + // The help text associated with the flag. string Help = help; @@ -391,8 +411,11 @@ class FlagDef option_flags, } // Additional information to be appended to both positive and negative flag. -class BothFlags option_flags, string help = ""> { +class BothFlags option_flags, + list option_vis = [ClangOption], + string help = ""> { list OptionFlags = option_flags; + list OptionVisibility = option_vis; string Help = help; } @@ -401,23 +424,26 @@ class ApplySuffix { FlagDef Result = FlagDef; } // Definition of the command line flag with positive spelling, e.g. "-ffoo". -class PosFlag flags = [], string help = "", - list implied_by_expressions = []> - : FlagDef {} +class PosFlag flags = [], list vis = [], + string help = "", list implied_by_expressions = []> + : FlagDef {} // Definition of the command line flag with negative spelling, e.g. "-fno-foo". -class NegFlag flags = [], string help = "", - list implied_by_expressions = []> - : FlagDef {} +class NegFlag flags = [], list vis = [], + string help = "", list implied_by_expressions = []> + : FlagDef {} // Expanded FlagDef that's convenient for creation of TableGen records. class FlagDefExpanded - : FlagDef { + : FlagDef { // Name of the TableGen record. string RecordName = prefix # !if(flag.Polarity, "", "no_") # name; @@ -435,7 +461,8 @@ class FlagDefExpanded class MarshalledFlagRec - : Flag<["-"], flag.Spelling>, Flags, HelpText, + : Flag<["-"], flag.Spelling>, Flags, + Visibility, HelpText, MarshallingInfoBooleanFlag, ImpliedByAnyOf {} @@ -449,7 +476,7 @@ class MarshalledFlagRec> { + BothFlags suffix = BothFlags<[]>> { defvar flag1 = FlagDefExpanded.Result, prefix, NAME, spelling_base>; @@ -480,7 +507,7 @@ multiclass BoolOption> { + BothFlags both = BothFlags<[]>> { defm NAME : BoolOption<"f", flag_base, kpm, default, flag1, flag2, both>, Group; } @@ -491,7 +518,7 @@ multiclass BoolFOption> { + BothFlags both = BothFlags<[]>> { defm NAME : BoolOption<"g", flag_base, kpm, default, flag1, flag2, both>, Group; } @@ -499,7 +526,7 @@ multiclass BoolGOption> { + BothFlags suffix = BothFlags<[]>> { defvar flag1 = FlagDefExpanded.Result, prefix, NAME, spelling_base>; @@ -521,10 +548,12 @@ multiclass BoolOptionWithoutMarshalling, Flags, + Visibility, HelpText, ImpliedByAnyOf {} def flag2.RecordName : Flag<["-"], flag2.Spelling>, Flags, + Visibility, HelpText, ImpliedByAnyOf {} @@ -543,7 +572,7 @@ defvar cpp11 = LangOpts<"CPlusPlus11">; defvar cpp17 = LangOpts<"CPlusPlus17">; defvar cpp20 = LangOpts<"CPlusPlus20">; defvar c99 = LangOpts<"C99">; -defvar c2x = LangOpts<"C2x">; +defvar c23 = LangOpts<"C23">; defvar lang_std = LangOpts<"LangStd">; defvar open_cl = LangOpts<"OpenCL">; defvar cuda = LangOpts<"CUDA">; @@ -579,7 +608,8 @@ defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPat // Developer Driver Options -def internal_Group : OptionGroup<"">, Flags<[HelpHidden]>; +def internal_Group : OptionGroup<"">, + Flags<[HelpHidden]>; def internal_driver_Group : OptionGroup<"">, Group, HelpText<"DRIVER OPTIONS">; def internal_debug_Group : @@ -589,20 +619,25 @@ def internal_debug_Group : class InternalDriverOpt : Group, Flags<[NoXarchOption, HelpHidden]>; def driver_mode : Joined<["--"], "driver-mode=">, Group, - Flags<[CoreOption, NoXarchOption, HelpHidden]>, - HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', or 'cl'">; + Flags<[NoXarchOption, HelpHidden]>, + Visibility<[ClangOption, FlangOption, CLOption, DXCOption]>, + HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', 'cl' or 'flang'">; def rsp_quoting : Joined<["--"], "rsp-quoting=">, Group, - Flags<[CoreOption, NoXarchOption, HelpHidden]>, + Flags<[NoXarchOption, HelpHidden]>, + Visibility<[ClangOption, CLOption, DXCOption]>, HelpText<"Set the rsp quoting to either 'posix', or 'windows'">; def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, InternalDriverOpt, HelpText<"Name for native GCC compiler">, MetaVarName<"">; class InternalDebugOpt : Group, - Flags<[NoXarchOption, HelpHidden, CoreOption]>; + Flags<[NoXarchOption, HelpHidden]>, + Visibility<[ClangOption, CLOption, DXCOption]>; def ccc_install_dir : Separate<["-"], "ccc-install-dir">, InternalDebugOpt, HelpText<"Simulate installation in the given directory">; -def ccc_print_phases : Flag<["-"], "ccc-print-phases">, InternalDebugOpt, +def ccc_print_phases : Flag<["-"], "ccc-print-phases">, + Flags<[NoXarchOption, HelpHidden]>, Visibility<[ClangOption, CLOption, DXCOption, + FlangOption]>, HelpText<"Dump list of actions to perform">; def ccc_print_bindings : Flag<["-"], "ccc-print-bindings">, InternalDebugOpt, HelpText<"Show bindings of tools to actions">; @@ -614,12 +649,15 @@ def ccc_arcmt_modify : Flag<["-"], "ccc-arcmt-modify">, InternalDriverOpt, def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, InternalDriverOpt, HelpText<"Apply modifications and produces temporary files that conform to ARC">; def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">, - HelpText<"Output path for the plist report">, Flags<[CC1Option]>, + HelpText<"Output path for the plist report">, + Visibility<[ClangOption, CC1Option]>, MarshallingInfoString>; def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">, - HelpText<"Emit ARC errors even if the migrator can fix them">, Flags<[CC1Option]>, + HelpText<"Emit ARC errors even if the migrator can fix them">, + Visibility<[ClangOption, CC1Option]>, MarshallingInfoFlag>; -def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">, Flags<[NoArgumentUnused, CoreOption]>, +def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">, + Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>, HelpText<"Emit reproducer on (option: off, crash (default), error, always)">; def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt, Alias, AliasArgs<["always"]>, @@ -627,9 +665,10 @@ def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt, def gen_cdb_fragment_path: Separate<["-"], "gen-cdb-fragment-path">, InternalDebugOpt, HelpText<"Emit a compilation database fragment to the specified directory">; -def round_trip_args : Flag<["-"], "round-trip-args">, Flags<[CC1Option, NoDriverOption]>, +def round_trip_args : Flag<["-"], "round-trip-args">, Visibility<[CC1Option]>, HelpText<"Enable command line arguments round-trip.">; -def no_round_trip_args : Flag<["-"], "no-round-trip-args">, Flags<[CC1Option, NoDriverOption]>, +def no_round_trip_args : Flag<["-"], "no-round-trip-args">, + Visibility<[CC1Option]>, HelpText<"Disable command line arguments round-trip.">; def _migrate : Flag<["--"], "migrate">, Flags<[NoXarchOption]>, @@ -639,60 +678,78 @@ def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">, HelpText<"Apply modifications and produces temporary files to migrate to " "modern ObjC syntax">; -def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">, Flags<[CC1Option]>, +def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to modern ObjC literals">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Literals">; -def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">, Flags<[CC1Option]>, +def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to modern ObjC subscripting">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Subscripting">; -def objcmt_migrate_property : Flag<["-"], "objcmt-migrate-property">, Flags<[CC1Option]>, +def objcmt_migrate_property : Flag<["-"], "objcmt-migrate-property">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to modern ObjC property">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Property">; -def objcmt_migrate_all : Flag<["-"], "objcmt-migrate-all">, Flags<[CC1Option]>, +def objcmt_migrate_all : Flag<["-"], "objcmt-migrate-all">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to modern ObjC">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_MigrateDecls">; -def objcmt_migrate_readonly_property : Flag<["-"], "objcmt-migrate-readonly-property">, Flags<[CC1Option]>, +def objcmt_migrate_readonly_property : Flag<["-"], "objcmt-migrate-readonly-property">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to modern ObjC readonly property">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_ReadonlyProperty">; -def objcmt_migrate_readwrite_property : Flag<["-"], "objcmt-migrate-readwrite-property">, Flags<[CC1Option]>, +def objcmt_migrate_readwrite_property : Flag<["-"], "objcmt-migrate-readwrite-property">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to modern ObjC readwrite property">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_ReadwriteProperty">; -def objcmt_migrate_property_dot_syntax : Flag<["-"], "objcmt-migrate-property-dot-syntax">, Flags<[CC1Option]>, +def objcmt_migrate_property_dot_syntax : Flag<["-"], "objcmt-migrate-property-dot-syntax">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration of setter/getter messages to property-dot syntax">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_PropertyDotSyntax">; -def objcmt_migrate_annotation : Flag<["-"], "objcmt-migrate-annotation">, Flags<[CC1Option]>, +def objcmt_migrate_annotation : Flag<["-"], "objcmt-migrate-annotation">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to property and method annotations">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Annotation">; -def objcmt_migrate_instancetype : Flag<["-"], "objcmt-migrate-instancetype">, Flags<[CC1Option]>, +def objcmt_migrate_instancetype : Flag<["-"], "objcmt-migrate-instancetype">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to infer instancetype for method result type">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Instancetype">; -def objcmt_migrate_nsmacros : Flag<["-"], "objcmt-migrate-ns-macros">, Flags<[CC1Option]>, +def objcmt_migrate_nsmacros : Flag<["-"], "objcmt-migrate-ns-macros">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to NS_ENUM/NS_OPTIONS macros">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_NsMacros">; -def objcmt_migrate_protocol_conformance : Flag<["-"], "objcmt-migrate-protocol-conformance">, Flags<[CC1Option]>, +def objcmt_migrate_protocol_conformance : Flag<["-"], "objcmt-migrate-protocol-conformance">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to add protocol conformance on classes">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_ProtocolConformance">; -def objcmt_atomic_property : Flag<["-"], "objcmt-atomic-property">, Flags<[CC1Option]>, +def objcmt_atomic_property : Flag<["-"], "objcmt-atomic-property">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Make migration to 'atomic' properties">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_AtomicProperty">; -def objcmt_returns_innerpointer_property : Flag<["-"], "objcmt-returns-innerpointer-property">, Flags<[CC1Option]>, +def objcmt_returns_innerpointer_property : Flag<["-"], "objcmt-returns-innerpointer-property">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to annotate property with NS_RETURNS_INNER_POINTER">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_ReturnsInnerPointerProperty">; -def objcmt_ns_nonatomic_iosonly: Flag<["-"], "objcmt-ns-nonatomic-iosonly">, Flags<[CC1Option]>, +def objcmt_ns_nonatomic_iosonly: Flag<["-"], "objcmt-ns-nonatomic-iosonly">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to use NS_NONATOMIC_IOSONLY macro for setting property's 'atomic' attribute">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_NsAtomicIOSOnlyProperty">; -def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init">, Flags<[CC1Option]>, +def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_DesignatedInitializer">; -def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">, Flags<[CC1Option]>, +def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Only modify files with a filename contained in the provided directory path">, MarshallingInfoString>; -def : Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>, +def : Joined<["-"], "objcmt-whitelist-dir-path=">, + Visibility<[ClangOption, CC1Option]>, HelpText<"Alias for -objcmt-allowlist-dir-path">, Alias; // The misspelt "white-list" [sic] alias is due for removal. -def : Joined<["-"], "objcmt-white-list-dir-path=">, Flags<[CC1Option]>, +def : Joined<["-"], "objcmt-white-list-dir-path=">, + Visibility<[ClangOption, CC1Option]>, Alias; // Make sure all other -ccc- options are rejected. @@ -700,11 +757,13 @@ def ccc_ : Joined<["-"], "ccc-">, Group, Flags<[Unsupported]>; // Standard Options -def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption, CoreOption, FlangOption]>, +def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption]>, + Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, HelpText<"Print (but do not run) the commands to run for this compilation">; def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>, - Flags<[NoXarchOption, CoreOption]>; -def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, Group; + Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>; +def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, + Group; def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"">, HelpText<"Search $prefix$file for executables, libraries, and data files. " "If $prefix is a directory, search $prefix/$file">; @@ -714,28 +773,38 @@ def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">, def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>, HelpText<"Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. " "Clang will use the GCC installation with the largest version">; -def CC : Flag<["-"], "CC">, Flags<[CC1Option]>, Group, +def CC : Flag<["-"], "CC">, Visibility<[ClangOption, CC1Option]>, + Group, HelpText<"Include comments from within macros in preprocessed output">, MarshallingInfoFlag>; -def C : Flag<["-"], "C">, Flags<[CC1Option]>, Group, +def C : Flag<["-"], "C">, Visibility<[ClangOption, CC1Option]>, + Group, HelpText<"Include comments in preprocessed output">, MarshallingInfoFlag>; def D : JoinedOrSeparate<["-"], "D">, Group, - Flags<[CC1Option, FlangOption, FC1Option]>, MetaVarName<"=">, + Visibility<[ClangOption, CC1Option, FlangOption, FC1Option, DXCOption]>, + MetaVarName<"=">, HelpText<"Define to (or 1 if omitted)">; -def E : Flag<["-"], "E">, Flags<[NoXarchOption,CC1Option, FlangOption, FC1Option]>, Group, +def E : Flag<["-"], "E">, Flags<[NoXarchOption]>, + Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, + Group, HelpText<"Only run the preprocessor">; -def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined,CC1Option]>, +def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined]>, + Visibility<[ClangOption, CC1Option]>, HelpText<"Add directory to framework include search path">; -def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption,TargetSpecific]>, Group, +def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption, TargetSpecific]>, + Group, MetaVarName<"">, HelpText<"Put objects of at most bytes " "into small data section (MIPS / Hexagon)">; -def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>, Group, Alias; -def H : Flag<["-"], "H">, Flags<[CC1Option]>, Group, +def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>, + Group, Alias; +def H : Flag<["-"], "H">, Visibility<[ClangOption, CC1Option]>, + Group, HelpText<"Show header includes and nesting depth">, MarshallingInfoFlag>; def fshow_skipped_includes : Flag<["-"], "fshow-skipped-includes">, - Flags<[CC1Option]>, HelpText<"Show skipped includes in -H output.">, + Visibility<[ClangOption, CC1Option]>, + HelpText<"Show skipped includes in -H output.">, DocBrief<[{#include files may be "skipped" due to include guard optimization or #pragma once. This flag makes -H show also such includes.}]>, MarshallingInfoFlag>; @@ -744,7 +813,8 @@ def I_ : Flag<["-"], "I-">, Group, HelpText<"Restrict all prior -I flags to double-quoted inclusion and " "remove current directory from include path">; def I : JoinedOrSeparate<["-"], "I">, Group, - Flags<[CC1Option,CC1AsOption,FlangOption,FC1Option]>, MetaVarName<"">, + Visibility<[ClangOption, CC1Option, CC1AsOption, FlangOption, FC1Option]>, + MetaVarName<"">, HelpText<"Add directory to the end of the list of include search paths">, DocBrief<[{Add directory to include search path. For C++ inputs, if there are multiple -I options, these directories are searched @@ -753,6 +823,7 @@ are searched. If the same directory is in the SYSTEM include search paths, for example if also specified with -isystem, the -I option will be ignored}]>; def L : JoinedOrSeparate<["-"], "L">, Flags<[RenderJoined]>, Group, + Visibility<[ClangOption, FlangOption]>, MetaVarName<"">, HelpText<"Add directory to library search path">; def MD : Flag<["-"], "MD">, Group, HelpText<"Write a depfile containing user and system headers">; @@ -765,95 +836,112 @@ def MM : Flag<["-"], "MM">, Group, def MF : JoinedOrSeparate<["-"], "MF">, Group, HelpText<"Write depfile output from -MMD, -MD, -MM, or -M to ">, MetaVarName<"">; -def MG : Flag<["-"], "MG">, Group, Flags<[CC1Option]>, +def MG : Flag<["-"], "MG">, Group, Visibility<[ClangOption, CC1Option]>, HelpText<"Add missing headers to depfile">, MarshallingInfoFlag>; def MJ : JoinedOrSeparate<["-"], "MJ">, Group, HelpText<"Write a compilation database entry per input">; -def MP : Flag<["-"], "MP">, Group, Flags<[CC1Option]>, +def MP : Flag<["-"], "MP">, Group, Visibility<[ClangOption, CC1Option]>, HelpText<"Create phony target for each dependency (other than main file)">, MarshallingInfoFlag>; -def MQ : JoinedOrSeparate<["-"], "MQ">, Group, Flags<[CC1Option]>, +def MQ : JoinedOrSeparate<["-"], "MQ">, Group, + Visibility<[ClangOption, CC1Option]>, HelpText<"Specify name of main file output to quote in depfile">; -def MT : JoinedOrSeparate<["-"], "MT">, Group, Flags<[CC1Option]>, +def MT : JoinedOrSeparate<["-"], "MT">, Group, + Visibility<[ClangOption, CC1Option]>, HelpText<"Specify name of main file output in depfile">, MarshallingInfoStringVector>; -def MV : Flag<["-"], "MV">, Group, Flags<[CC1Option]>, +def MV : Flag<["-"], "MV">, Group, Visibility<[ClangOption, CC1Option]>, HelpText<"Use NMake/Jom format for the depfile">, MarshallingInfoFlag, "DependencyOutputFormat::Make">, Normalizer<"makeFlagToValueNormalizer(DependencyOutputFormat::NMake)">; def Mach : Flag<["-"], "Mach">, Group; -def O0 : Flag<["-"], "O0">, Group, Flags<[CC1Option, FC1Option, HelpHidden]>; -def O4 : Flag<["-"], "O4">, Group, Flags<[CC1Option, FC1Option, HelpHidden]>; +def O0 : Flag<["-"], "O0">, Group, Flags<[HelpHidden]>, + Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>; +def O4 : Flag<["-"], "O4">, Group, Flags<[HelpHidden]>, + Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>; def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C++ inputs">; def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C inputs">; -def O : Joined<["-"], "O">, Group, Flags<[CC1Option,FC1Option]>; -def O_flag : Flag<["-"], "O">, Flags<[CC1Option,FC1Option]>, Alias, AliasArgs<["1"]>; -def Ofast : Joined<["-"], "Ofast">, Group, Flags<[CC1Option, FlangOption]>; -def P : Flag<["-"], "P">, Flags<[CC1Option,FlangOption,FC1Option]>, Group, +def O : Joined<["-"], "O">, Group, + Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>; +def O_flag : Flag<["-"], "O">, Visibility<[ClangOption, CC1Option, FC1Option]>, + Alias, AliasArgs<["1"]>; +def Ofast : Joined<["-"], "Ofast">, Group, + Visibility<[ClangOption, CC1Option, FlangOption]>; +def P : Flag<["-"], "P">, + Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, + Group, HelpText<"Disable linemarker output in -E mode">, MarshallingInfoNegativeFlag>; -def Qy : Flag<["-"], "Qy">, Flags<[CC1Option]>, +def Qy : Flag<["-"], "Qy">, Visibility<[ClangOption, CC1Option]>, HelpText<"Emit metadata containing compiler name and version">; -def Qn : Flag<["-"], "Qn">, Flags<[CC1Option]>, +def Qn : Flag<["-"], "Qn">, Visibility<[ClangOption, CC1Option]>, HelpText<"Do not emit metadata containing compiler name and version">; def : Flag<["-"], "fident">, Group, Alias, - Flags<[CoreOption, CC1Option]>; + Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>; def : Flag<["-"], "fno-ident">, Group, Alias, - Flags<[CoreOption, CC1Option]>; -def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[NoXarchOption, CoreOption]>, + Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>; +def Qunused_arguments : Flag<["-"], "Qunused-arguments">, + Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>, HelpText<"Don't emit warning for unused driver arguments">; def Q : Flag<["-"], "Q">, IgnoredGCCCompat; -def Rpass_EQ : Joined<["-"], "Rpass=">, Group, Flags<[CC1Option]>, - HelpText<"Report transformations performed by optimization passes whose " - "name matches the given POSIX regular expression">; -def Rpass_missed_EQ : Joined<["-"], "Rpass-missed=">, Group, - Flags<[CC1Option]>, - HelpText<"Report missed transformations by optimization passes whose " - "name matches the given POSIX regular expression">; -def Rpass_analysis_EQ : Joined<["-"], "Rpass-analysis=">, Group, - Flags<[CC1Option]>, - HelpText<"Report transformation analysis from optimization passes whose " - "name matches the given POSIX regular expression">; -def R_Joined : Joined<["-"], "R">, Group, Flags<[CC1Option, CoreOption]>, - MetaVarName<"">, HelpText<"Enable the specified remark">; -def S : Flag<["-"], "S">, Flags<[NoXarchOption,CC1Option,FlangOption,FC1Option]>, Group, +def S : Flag<["-"], "S">, Flags<[NoXarchOption]>, + Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>, + Group, HelpText<"Only run preprocess and compilation steps">; def T : JoinedOrSeparate<["-"], "T">, Group, MetaVarName<"\n"; @@ -202,8 +208,10 @@ public: JOS->attributeArray("timeline", [&] { for (const auto &E : Iters) { JOS->object([&] { - JOS->attribute("block", blockID(E.first->getBlockID())); - JOS->attribute("iter", E.second); + JOS->attribute("block", blockID(E.Block->getBlockID())); + JOS->attribute("iter", E.Iter); + JOS->attribute("post_visit", E.PostVisit); + JOS->attribute("converged", E.Converged); }); } }); @@ -218,8 +226,11 @@ public: *OS << llvm::StringRef(HTMLLogger_html).split("").second; } - void enterBlock(const CFGBlock &B) override { - Iters.emplace_back(&B, ++BlockIters[&B]); + void enterBlock(const CFGBlock &B, bool PostVisit) override { + llvm::SmallVector &BIter = BlockIters[&B]; + unsigned IterNum = BIter.size() + 1; + BIter.push_back(Iters.size()); + Iters.push_back({&B, IterNum, PostVisit, /*Converged=*/false}); ElementIndex = 0; } void enterElement(const CFGElement &E) override { @@ -247,21 +258,30 @@ public: // - meaningful names for values // - which boolean values are implied true/false by the flow condition void recordState(TypeErasedDataflowAnalysisState &State) override { - unsigned Block = Iters.back().first->getBlockID(); - unsigned Iter = Iters.back().second; + unsigned Block = Iters.back().Block->getBlockID(); + unsigned Iter = Iters.back().Iter; + bool PostVisit = Iters.back().PostVisit; JOS->attributeObject(elementIterID(Block, Iter, ElementIndex), [&] { JOS->attribute("block", blockID(Block)); JOS->attribute("iter", Iter); + JOS->attribute("post_visit", PostVisit); JOS->attribute("element", ElementIndex); // If this state immediately follows an Expr, show its built-in model. if (ElementIndex > 0) { auto S = - Iters.back().first->Elements[ElementIndex - 1].getAs(); - if (const Expr *E = S ? llvm::dyn_cast(S->getStmt()) : nullptr) - if (auto *Loc = State.Env.getStorageLocation(*E, SkipPast::None)) - JOS->attributeObject( - "value", [&] { ModelDumper(*JOS, State.Env).dump(*Loc); }); + Iters.back().Block->Elements[ElementIndex - 1].getAs(); + if (const Expr *E = S ? llvm::dyn_cast(S->getStmt()) : nullptr) { + if (E->isPRValue()) { + if (auto *V = State.Env.getValue(*E)) + JOS->attributeObject( + "value", [&] { ModelDumper(*JOS, State.Env).dump(*V); }); + } else { + if (auto *Loc = State.Env.getStorageLocation(*E)) + JOS->attributeObject( + "value", [&] { ModelDumper(*JOS, State.Env).dump(*Loc); }); + } + } } if (!ContextLogs.empty()) { JOS->attribute("logs", ContextLogs); @@ -275,7 +295,7 @@ public: } }); } - void blockConverged() override { logText("Block converged"); } + void blockConverged() override { Iters.back().Converged = true; } void logText(llvm::StringRef S) override { ContextLogs.append(S.begin(), S.end()); @@ -286,9 +306,18 @@ private: // Write the CFG block details. // Currently this is just the list of elements in execution order. // FIXME: an AST dump would be a useful view, too. - void writeBlock(const CFGBlock &B, unsigned Iters) { + void writeBlock(const CFGBlock &B, llvm::ArrayRef ItersForB) { JOS->attributeObject(blockID(B.getBlockID()), [&] { - JOS->attribute("iters", Iters); + JOS->attributeArray("iters", [&] { + for (size_t IterIdx : ItersForB) { + const Iteration &Iter = Iters[IterIdx]; + JOS->object([&] { + JOS->attribute("iter", Iter.Iter); + JOS->attribute("post_visit", Iter.PostVisit); + JOS->attribute("converged", Iter.Converged); + }); + } + }); JOS->attributeArray("elements", [&] { for (const auto &Elt : B.Elements) { std::string Dump; @@ -305,9 +334,7 @@ private: // tokens are associated with, and even which BB element (so that clicking // can select the right element). void writeCode() { - if (!CFG->getDecl()) - return; - const auto &AST = CFG->getDecl()->getASTContext(); + const auto &AST = CFG->getDecl().getASTContext(); bool Invalid = false; // Extract the source code from the original file. @@ -315,7 +342,7 @@ private: // indentation to worry about), but we need the boundaries of particular // AST nodes and the printer doesn't provide this. auto Range = clang::Lexer::makeFileCharRange( - CharSourceRange::getTokenRange(CFG->getDecl()->getSourceRange()), + CharSourceRange::getTokenRange(CFG->getDecl().getSourceRange()), AST.getSourceManager(), AST.getLangOpts()); if (Range.isInvalid()) return; @@ -324,9 +351,10 @@ private: if (Invalid) return; - static constexpr unsigned Missing = -1; // TokenInfo stores the BB and set of elements that a token is part of. struct TokenInfo { + enum : unsigned { Missing = static_cast(-1) }; + // The basic block this is part of. // This is the BB of the stmt with the smallest containing range. unsigned BB = Missing; @@ -462,8 +490,9 @@ private: GraphS << " " << blockID(I) << " [id=" << blockID(I) << "]\n"; for (const auto *Block : CFG) { for (const auto &Succ : Block->succs()) { - GraphS << " " << blockID(Block->getBlockID()) << " -> " - << blockID(Succ.getReachableBlock()->getBlockID()) << "\n"; + if (Succ.getReachableBlock()) + GraphS << " " << blockID(Block->getBlockID()) << " -> " + << blockID(Succ.getReachableBlock()->getBlockID()) << "\n"; } } GraphS << "}\n"; diff --git a/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.css b/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.css index c8212df1f94b..5da8db8fa87b 100644 --- a/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.css +++ b/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.css @@ -19,6 +19,7 @@ section header { color: white; font-weight: bold; font-size: large; + padding-right: 0.5em; } section h2 { font-size: medium; @@ -27,7 +28,7 @@ section h2 { border-top: 1px solid #aaa; } #timeline { - min-width: 0; + min-width: max-content; } #timeline .entry.hover { background-color: #aaa; @@ -62,17 +63,22 @@ section h2 { #iterations .chooser { flex-grow: 1; text-align: center; + padding-left: 0.2em; +} +#iterations .chooser :last-child { + padding-right: 0.2em; } #iterations .chooser:not(.iter-select).hover { - background-color: #aaa; + background-color: #ddd; } #iterations .iter-select { font-weight: bold; - background-color: #ccc; } #iterations .chooser:not(.iter-select) { text-decoration: underline; color: blue; + cursor: pointer; + background-color: #ccc; } code.filename { @@ -122,10 +128,21 @@ code.line:has(.bb-select):before { font-size: x-small; flex-grow: 1; } -.value summary { +.value > summary { background-color: #ace; display: flex; - justify-content: space-between; + cursor: pointer; +} +.value > summary::before { + content: '\25ba'; /* Black Right-Pointing Pointer */ + margin-right: 0.5em; + font-size: 0.9em; +} +.value[open] > summary::before { + content: '\25bc'; /* Black Down-Pointing Triangle */ +} +.value > summary > .location { + margin-left: auto; } .value .address { font-size: xx-small; diff --git a/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.html b/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.html index a60259a99cce..b9f76c5074c7 100644 --- a/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.html +++ b/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.html @@ -18,7 +18,7 @@