llvm-project
c8f70d72 - [clang][CodeGen] Additional fixes for #114062 (#128166)

Commit
193 days ago
[clang][CodeGen] Additional fixes for #114062 (#128166) This addresses two issues introduced by moving indirect args into an explicit AS (please see <https://github.com/llvm/llvm-project/pull/114062#issuecomment-2659829790> and <https://github.com/llvm/llvm-project/pull/114062#issuecomment-2661158477>): 1. Unconditionally stripping casts from a pre-allocated return slot was incorrect / insufficient (this is illustrated by the `amdgcn_sret_ctor.cpp` test); 2. Putting compiler manufactured sret args in a non default AS can lead to a C-cast (surprisingly) requiring an AS cast (this is illustrated by the `sret_cast_with_nonzero_alloca_as.cpp test). The way we handle (2), by subverting CK_BitCast emission iff a sret arg is involved, is quite naff, but I couldn't think of any other way to use a non default indirect AS and make this case work (hopefully this is a failure of imagination on my part).
Author
Parents
Loading