[SelectionDAG][DAGCombiner] Reuse exist node by reassociate
authorchenglin.bi <chenglin.bi@cixcomputing.com>
Fri, 24 Jun 2022 15:14:20 +0000 (23:14 +0800)
committerchenglin.bi <chenglin.bi@cixcomputing.com>
Fri, 24 Jun 2022 15:15:06 +0000 (23:15 +0800)
commit8c7420564264af5913fa8e699e2795d0f2cd48ac
treee834401c1fec93017656791028a1eef106e6133d
parent186bea3750d6b349de0e71044d95e2a42e087b4c
[SelectionDAG][DAGCombiner] Reuse exist node by reassociate

When already have (op N0, N2), reassociate (op (op N0, N1), N2) to (op (op N0, N2), N1) to reuse the exist (op N0, N2)

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D122539
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/xor3-i1-const.ll
llvm/test/CodeGen/WebAssembly/xor_reassociate.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/2009-03-23-MultiUseSched.ll
llvm/test/CodeGen/X86/ctpop-combine.ll
llvm/test/CodeGen/X86/pr56170.ll [new file with mode: 0644]