[DAGCombiner] Factor out duplicated logic for an extload combine, NFC (5/N)
authorVedant Kumar <vsk@apple.com>
Fri, 11 May 2018 18:40:02 +0000 (18:40 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 11 May 2018 18:40:02 +0000 (18:40 +0000)
commitf0e5f7c45e940c80623c60b89b28b8806a899841
tree6a177fc510cb9558d29c345993c9a32857111469
parentd1386a88dd1654f79544e93b03985b8700a3dbea
[DAGCombiner] Factor out duplicated logic for an extload combine, NFC (5/N)

Part of the logic for combining (zext (load ...)) and (sext (load ...))
is duplicated. This creates problems because bugs in one version have to
be fixed again in the other version.

To address this, as a first step, I've extracted the duplicate logic
into a helper. I'll fix the debug location bug in the helper and
eliminate the copy of its logic in a followup.

Part of: llvm.org/PR37262

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

llvm-svn: 332117
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp