[DAGCombiner] handle more store value forwarding
authorChen Zheng <czhengsz@cn.ibm.com>
Fri, 9 Dec 2022 05:27:14 +0000 (00:27 -0500)
committerChen Zheng <czhengsz@cn.ibm.com>
Thu, 2 Feb 2023 02:06:17 +0000 (21:06 -0500)
commitf35a09daebd0a90daa536432e62a2476f708150d
tree5e5149994dca1ee61b9fd4ff5a9d22bde644f38a
parent0a32e693e31f1a7d6de2701655a4555555f8d4f9
[DAGCombiner] handle more store value forwarding

When lowering calls on target like PPC, some stack loads
will be generated for by value parameters. Node CALLSEQ_START
prevents such loads from being combined.

Suggested by @RolandF, this patch removes the unnecessary
loads for the byval parameter by extending ForwardStoreValueToDirectLoad

Reviewed By: nemanjai, RolandF

Differential Revision: https://reviews.llvm.org/D138899
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/ctpop16.ll
llvm/test/CodeGen/AMDGPU/load-constant-i16.ll
llvm/test/CodeGen/AMDGPU/load-global-i16.ll
llvm/test/CodeGen/AMDGPU/shl.ll
llvm/test/CodeGen/AMDGPU/sra.ll
llvm/test/CodeGen/Mips/o32_cc_byval.ll
llvm/test/CodeGen/PowerPC/aix-cc-byval.ll
llvm/test/CodeGen/PowerPC/byval-lhs.ll
llvm/test/CodeGen/PowerPC/ppc64-byval-larger-struct.ll
llvm/test/CodeGen/X86/fastcc-byval.ll