[all-commits] [llvm/llvm-project] 158d72: [Clang] Set writable and dead_on_unwind attributes...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Jan 11 00:47:06 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 158d72d728261c1e54dc77931372b2322c52849f
      https://github.com/llvm/llvm-project/commit/158d72d728261c1e54dc77931372b2322c52849f
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-01-11 (Thu, 11 Jan 2024)

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp
    M clang/test/CodeGen/2006-05-19-SingleEltReturn.c
    M clang/test/CodeGen/64bit-swiftcall.c
    M clang/test/CodeGen/CSKY/csky-abi.c
    M clang/test/CodeGen/CSKY/csky-hard-abi.c
    M clang/test/CodeGen/CSKY/csky-soft-abi.c
    M clang/test/CodeGen/PowerPC/aix-alignment.c
    M clang/test/CodeGen/PowerPC/powerpc-c99complex.c
    M clang/test/CodeGen/PowerPC/ppc-aggregate-abi.cpp
    M clang/test/CodeGen/PowerPC/ppc32-and-aix-struct-return.c
    M clang/test/CodeGen/PowerPC/ppc64-align-struct.c
    M clang/test/CodeGen/PowerPC/ppc64-elf-abi.c
    M clang/test/CodeGen/PowerPC/ppc64-soft-float.c
    M clang/test/CodeGen/PowerPC/ppc64-vector.c
    M clang/test/CodeGen/PowerPC/ppc64le-aggregates.c
    M clang/test/CodeGen/PowerPC/ppc64le-f128Aggregates.c
    M clang/test/CodeGen/RISCV/bfloat-abi.c
    M clang/test/CodeGen/RISCV/riscv-abi.cpp
    M clang/test/CodeGen/RISCV/riscv32-abi.c
    M clang/test/CodeGen/RISCV/riscv64-abi.c
    M clang/test/CodeGen/SystemZ/gnu-atomic-builtins-i128-8Al.c
    M clang/test/CodeGen/SystemZ/systemz-abi-vector.c
    M clang/test/CodeGen/SystemZ/systemz-abi.c
    M clang/test/CodeGen/SystemZ/systemz-abi.cpp
    M clang/test/CodeGen/SystemZ/systemz-inline-asm.c
    M clang/test/CodeGen/WebAssembly/wasm-arguments.c
    M clang/test/CodeGen/WebAssembly/wasm-varargs.c
    M clang/test/CodeGen/X86/x86_32-arguments-darwin.c
    M clang/test/CodeGen/X86/x86_32-arguments-iamcu.c
    M clang/test/CodeGen/X86/x86_64-arguments-nacl.c
    M clang/test/CodeGen/X86/x86_64-arguments-win32.c
    M clang/test/CodeGen/X86/x86_64-arguments.c
    M clang/test/CodeGen/aarch64-sve-acle-__ARM_FEATURE_SVE_VECTOR_OPERATORS.c
    M clang/test/CodeGen/aarch64-varargs.c
    M clang/test/CodeGen/aggregate-assign-call.c
    M clang/test/CodeGen/aligned-sret.c
    M clang/test/CodeGen/arc/arguments.c
    M clang/test/CodeGen/arm-aapcs-vfp.c
    M clang/test/CodeGen/arm-arguments.c
    M clang/test/CodeGen/arm-homogenous.c
    M clang/test/CodeGen/arm-neon-vld.c
    M clang/test/CodeGen/arm-swiftcall.c
    M clang/test/CodeGen/arm-varargs.c
    M clang/test/CodeGen/arm-vector-arguments.c
    M clang/test/CodeGen/arm-vfp16-arguments.c
    M clang/test/CodeGen/arm-vfp16-arguments2.cpp
    M clang/test/CodeGen/arm64-arguments.c
    M clang/test/CodeGen/arm64-microsoft-arguments.cpp
    M clang/test/CodeGen/arm64_32.c
    M clang/test/CodeGen/armv7k-abi.c
    M clang/test/CodeGen/attr-noundef.cpp
    M clang/test/CodeGen/blocks.c
    M clang/test/CodeGen/c11atomics-ios.c
    M clang/test/CodeGen/c11atomics.c
    M clang/test/CodeGen/ext-int-cc.c
    M clang/test/CodeGen/isfpclass.c
    M clang/test/CodeGen/lanai-arguments.c
    M clang/test/CodeGen/mcu-struct-return.c
    M clang/test/CodeGen/mingw-long-double.c
    M clang/test/CodeGen/mips-vector-return.c
    M clang/test/CodeGen/mips-zero-sized-struct.c
    M clang/test/CodeGen/mips64-nontrivial-return.cpp
    M clang/test/CodeGen/mips64-padding-arg.c
    M clang/test/CodeGen/ms_abi.c
    M clang/test/CodeGen/paren-list-agg-init.cpp
    M clang/test/CodeGen/regcall2.c
    M clang/test/CodeGen/regparm-struct.c
    M clang/test/CodeGen/renderscript.c
    M clang/test/CodeGen/sparcv9-abi.c
    M clang/test/CodeGen/sret.c
    M clang/test/CodeGen/vectorcall.c
    M clang/test/CodeGen/windows-struct-abi.c
    M clang/test/CodeGen/windows-swiftcall.c
    M clang/test/CodeGenCXX/aix-alignment.cpp
    M clang/test/CodeGenCXX/arm-cc.cpp
    M clang/test/CodeGenCXX/arm-swiftcall.cpp
    M clang/test/CodeGenCXX/attr-musttail.cpp
    M clang/test/CodeGenCXX/call-with-static-chain.cpp
    M clang/test/CodeGenCXX/conditional-gnu-ext.cpp
    M clang/test/CodeGenCXX/cxx1z-copy-omission.cpp
    M clang/test/CodeGenCXX/cxx1z-lambda-star-this.cpp
    M clang/test/CodeGenCXX/exceptions.cpp
    M clang/test/CodeGenCXX/homogeneous-aggregates.cpp
    M clang/test/CodeGenCXX/lambda-expressions.cpp
    M clang/test/CodeGenCXX/matrix-casts.cpp
    M clang/test/CodeGenCXX/matrix-type-builtins.cpp
    M clang/test/CodeGenCXX/matrix-type.cpp
    M clang/test/CodeGenCXX/microsoft-abi-byval-sret.cpp
    M clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp
    M clang/test/CodeGenCXX/microsoft-abi-cdecl-method-sret.cpp
    M clang/test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp
    M clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
    M clang/test/CodeGenCXX/microsoft-abi-unknown-arch.cpp
    M clang/test/CodeGenCXX/microsoft-abi-vmemptr-conflicts.cpp
    M clang/test/CodeGenCXX/ms-thread_local.cpp
    M clang/test/CodeGenCXX/nrvo.cpp
    M clang/test/CodeGenCXX/pass-by-value-noalias.cpp
    M clang/test/CodeGenCXX/regcall.cpp
    M clang/test/CodeGenCXX/regcall4.cpp
    M clang/test/CodeGenCXX/stack-reuse-miscompile.cpp
    M clang/test/CodeGenCXX/stack-reuse.cpp
    M clang/test/CodeGenCXX/temporaries.cpp
    M clang/test/CodeGenCXX/thiscall-struct-return.cpp
    M clang/test/CodeGenCXX/thunk-returning-memptr.cpp
    M clang/test/CodeGenCXX/trivial_abi.cpp
    M clang/test/CodeGenCXX/unknown-anytype.cpp
    M clang/test/CodeGenCXX/wasm-args-returns.cpp
    M clang/test/CodeGenCXX/x86_32-arguments.cpp
    M clang/test/CodeGenCXX/x86_64-arguments.cpp
    M clang/test/CodeGenCoroutines/coro-await.cpp
    M clang/test/CodeGenCoroutines/coro-gro2.cpp
    M clang/test/CodeGenHLSL/sret_output.hlsl
    M clang/test/CodeGenObjC/arc.m
    M clang/test/CodeGenObjC/direct-method.m
    M clang/test/CodeGenObjC/nontrivial-c-struct-exception.m
    M clang/test/CodeGenObjC/objc-non-trivial-struct-nrvo.m
    M clang/test/CodeGenObjC/stret-1.m
    M clang/test/CodeGenObjC/stret_lookup.m
    M clang/test/CodeGenObjC/weak-in-c-struct.m
    M clang/test/CodeGenObjC/x86_64-struct-return-gc.m
    M clang/test/CodeGenObjCXX/objc-struct-cxx-abi.mm
    M clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
    M clang/test/CodeGenOpenCL/amdgpu-abi-struct-arg-byref.cl
    M clang/test/CodeGenOpenCL/amdgpu-abi-struct-coerce.cl
    M clang/test/CodeGenOpenCLCXX/addrspace-of-this.clcpp
    M clang/test/Modules/templates.mm
    M clang/test/OpenMP/irbuilder_for_iterator.cpp
    M clang/test/OpenMP/irbuilder_for_rangefor.cpp
    M clang/test/OpenMP/master_taskloop_in_reduction_codegen.cpp
    M clang/test/OpenMP/master_taskloop_simd_in_reduction_codegen.cpp
    M clang/test/OpenMP/target_in_reduction_codegen.cpp
    M clang/test/OpenMP/task_in_reduction_codegen.cpp
    M clang/test/OpenMP/taskloop_in_reduction_codegen.cpp
    M clang/test/OpenMP/taskloop_simd_in_reduction_codegen.cpp

  Log Message:
  -----------
  [Clang] Set writable and dead_on_unwind attributes on sret arguments (#77116)

Set the writable and dead_on_unwind attributes for sret arguments. These
indicate that the argument points to writable memory (and it's legal to
introduce spurious writes to it on entry to the function) and that the
argument memory will not be used if the call unwinds.

This enables additional MemCpyOpt/DSE/LICM optimizations.




More information about the All-commits mailing list