[DAGCombine] Fix ReduceLoadWidth for shifted offsets

ReduceLoadWidth can trigger using a shifted mask is used and this
requires that the function return a shl node to correct for the
offset. However, the way that this was implemented meant that the
returned result could be an existing node, which would be incorrect.
This fixes the method of inserting the new node and replacing uses.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351310 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed