[CGCall] Make findDominatingStoreToReturnValue() more robust
authorNikita Popov <npopov@redhat.com>
Fri, 8 Apr 2022 13:16:03 +0000 (15:16 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 8 Apr 2022 13:18:12 +0000 (15:18 +0200)
commit692a147bf4339380ccfea7418cbedcea540cfaef
tree3fea30e82e230946f3546153f935077ec7d70eca
parent0e0b0feff194358e5e68bf36f5a563d269fa8e88
[CGCall] Make findDominatingStoreToReturnValue() more robust

This was skipping specific lifetime + bitcast patterns, but with
opaque pointers the bitcast will not be present, and we did not
perform this fold.

Instead skip over lifetime.end and bitcasts generally, without
trying to correlate them.
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGen/dominating-store-to-return.c [new file with mode: 0644]