[all-commits] [llvm/llvm-project] 9606c9: Reapply "[clang] remove lots of "innocuous" addrsp...
Jameson Nash via All-commits
all-commits at lists.llvm.org
Wed Jun 3 07:41:47 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9606c9ff18f0d90a639b132a7f69ebc8a8f61c99
https://github.com/llvm/llvm-project/commit/9606c9ff18f0d90a639b132a7f69ebc8a8f61c99
Author: Jameson Nash <vtjnash at gmail.com>
Date: 2026-06-03 (Wed, 03 Jun 2026)
Changed paths:
M clang/lib/CodeGen/ABIInfoImpl.cpp
M clang/lib/CodeGen/CGAtomic.cpp
M clang/lib/CodeGen/CGBlocks.cpp
M clang/lib/CodeGen/CGBuiltin.cpp
M clang/lib/CodeGen/CGCUDANV.cpp
M clang/lib/CodeGen/CGCall.cpp
M clang/lib/CodeGen/CGClass.cpp
M clang/lib/CodeGen/CGDecl.cpp
M clang/lib/CodeGen/CGException.cpp
M clang/lib/CodeGen/CGExpr.cpp
M clang/lib/CodeGen/CGExprAgg.cpp
M clang/lib/CodeGen/CGHLSLRuntime.cpp
M clang/lib/CodeGen/CGOpenMPRuntime.cpp
M clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
M clang/lib/CodeGen/CGStmt.cpp
M clang/lib/CodeGen/CGStmtOpenMP.cpp
M clang/lib/CodeGen/CodeGenFunction.h
M clang/lib/CodeGen/MicrosoftCXXABI.cpp
M clang/lib/CodeGen/TargetBuiltins/ARM.cpp
M clang/lib/CodeGen/TargetBuiltins/X86.cpp
M clang/lib/CodeGen/Targets/X86.cpp
M clang/test/CodeGen/scoped-atomic-ops.c
M clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu
M clang/test/CodeGenCUDA/atomic-options.hip
M clang/test/CodeGenCUDA/builtins-amdgcn.cu
M clang/test/CodeGenCUDA/builtins-spirv-amdgcn.cu
M clang/test/CodeGenCUDA/record-layout.cu
M clang/test/CodeGenCXX/amdgcn-func-arg.cpp
M clang/test/CodeGenHIP/placement-new-addrspace.hip
M clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
M clang/test/CodeGenOpenCL/amdgpu-abi-struct-arg-byref.cl
M clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
M clang/test/CodeGenOpenCL/atomic-ops.cl
M clang/test/CodeGenSYCL/kernel-caller-entry-point.cpp
M clang/test/OpenMP/amdgcn_target_device_vla.cpp
M clang/test/OpenMP/amdgpu_target_with_aligned_attribute.c
M clang/test/OpenMP/target_teams_generic_loop_codegen.cpp
M clang/test/OpenMP/target_teams_generic_loop_codegen_as_distribute.cpp
M clang/test/OpenMP/target_teams_generic_loop_codegen_as_parallel_for.cpp
Log Message:
-----------
Reapply "[clang] remove lots of "innocuous" addrspacecasts" (#200427)
Reapply #197745, with an additional commit to undo a small part of the
first commit, pending further analysis of alternatives to that part of it.
In particular, make the `agg.tmp` (CreateAggTemp) values keep using the
declared expression type of the RValue. This is indeed probably
sensible, since it lets Sema influence this via the expression type,
though it runs into some issues where some expression types (notably for
any load) haven't had one of the equivalent functions
getNonLValueExprType/DeduceAutoType/getUnqualifiedType called on them,
so they are bringing along additional annotation baggage which doesn't
apply the the rvalue when turned into a temporary (see comments in
getNonLValueExprType for relevant part of C++ standard). This in turn is
also rarely relevant, since inventing temporaries aren't often allowed
in this part of the pipeline (it'd require a move constructor) so the
LValue Dest already provides the type and the RValue type is ignored.
However, it does affect a single test (which loads a global but ignores
the result) and so this adds an extra `getUnqualifiedType` call to
`CodeGenFunction::EmitAnyExpr` so that load doesn't propagate the
qualifiers from source to temporary. This might be a common issue with
load-like expressions (for example, there's a `getUnqualifiedType` in
AtomicExpr code when computing the appropriate codegen for the result,
so it also didn't trust Sema to have created this correctly--and indeed
it seems that Sema expects CG to wait until after
DefaultLvalueConversion before it is does anything with the result type)
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list