[X86] Fix collectLeaves for adds used by phi that forms loop
authorHaohai Wen <haohai.wen@intel.com>
Fri, 8 Jul 2022 02:27:02 +0000 (10:27 +0800)
committerHaohai Wen <haohai.wen@intel.com>
Fri, 8 Jul 2022 02:39:02 +0000 (10:39 +0800)
commit18a1085e02a8cb3be7d826b32cd47203a91fd358
tree75aa1b5fe316e196a64a0a8ed80a4af587f5c043
parent99da3115d1f505457884faa78415b39c11469e0a
[X86] Fix collectLeaves for adds used by phi that forms loop

When add has additional users, we should indentify whether add's
user is phi that forms loop rather than root's.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D129169
llvm/lib/Target/X86/X86PartialReduction.cpp
llvm/test/CodeGen/X86/madd.ll