[llvm] [SDAG] Fix CSE for ADDRSPACECAST nodes (PR #122912)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 22:46:29 PST 2025
arsenm wrote:
> Yea, I agree it is not ideal, but I've spent some time on it and this is the best I can come up with at the moment. #121710 does rely on this change to ensure load elimination occurs for byval arguments, so once this lands we'll have much better non-debug coverage.
The 2 casts appear in the DAG if you just use -O0 for a more straightforward example:
```
define void @foo(ptr %p) {
%a1 = addrspacecast ptr %p to ptr addrspace(5)
%a2 = addrspacecast ptr %p to ptr addrspace(5)
store i32 0, ptr addrspace(5) %a1
store i32 0, ptr addrspace(5) %a2
ret void
}
```
https://github.com/llvm/llvm-project/pull/122912
More information about the llvm-commits
mailing list