[DAG] Refactor DAGCombiner::ReassociateOps
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 29 Apr 2019 17:50:10 +0000 (17:50 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 29 Apr 2019 17:50:10 +0000 (17:50 +0000)
commit820994572c636c5817488f7e9ef5074b0b2a7ed0
tree7636e4473daae26056006cd3f3c835b89846de75
parent15cb1f1501047ac4fb4ae142a9b4570a3cb74741
[DAG] Refactor DAGCombiner::ReassociateOps

Summary:
Extract the logic for doing reassociations
from DAGCombiner::reassociateOps into a helper
function DAGCombiner::reassociateOpsCommutative,
and use that helper to trigger reassociation
on the original operand order, or the commuted
operand order.

Codegen is not identical since the operand order will
be different when doing the reassociations for the
commuted case. That causes some unfortunate churn in
some test cases. Apart from that this should be NFC.

Reviewers: spatel, craig.topper, tstellar

Reviewed By: spatel

Subscribers: dmgreen, dschuff, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, hiraditya, aheejin, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61199

llvm-svn: 359476
19 files changed:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/arm64-addr-type-promotion.ll
llvm/test/CodeGen/AMDGPU/calling-conventions.ll
llvm/test/CodeGen/AMDGPU/cvt_f32_ubyte.ll
llvm/test/CodeGen/AMDGPU/shl_add_constant.ll
llvm/test/CodeGen/AMDGPU/widen-smrd-loads.ll
llvm/test/CodeGen/ARM/and-load-combine.ll
llvm/test/CodeGen/ARM/load-combine-big-endian.ll
llvm/test/CodeGen/ARM/load-combine.ll
llvm/test/CodeGen/SystemZ/buildvector-00.ll
llvm/test/CodeGen/Thumb2/constant-hoisting.ll
llvm/test/CodeGen/WebAssembly/address-offsets.ll
llvm/test/CodeGen/X86/add-ext.ll
llvm/test/CodeGen/X86/combine-multiplies.ll
llvm/test/CodeGen/X86/load-combine.ll
llvm/test/CodeGen/X86/lsr-loop-exit-cond.ll
llvm/test/CodeGen/X86/merge_store.ll
llvm/test/CodeGen/X86/sad.ll
llvm/test/CodeGen/X86/vector-ext-logic.ll