Merging r311623:
authorHans Wennborg <hans@hanshq.net>
Thu, 24 Aug 2017 16:16:07 +0000 (16:16 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 24 Aug 2017 16:16:07 +0000 (16:16 +0000)
commitdef6ebbd31d8a974704616f4fd275a6bdc330608
tree60839b9c2a4207ebf710aa57963853260b211e25
parent2d30972995d07a49b04560f76470274822009af3
Merging r311623:
------------------------------------------------------------------------
r311623 | hans | 2017-08-23 18:08:27 -0700 (Wed, 23 Aug 2017) | 11 lines

[DAG] Fix Node Replacement in PromoteIntBinOp

When one operand is a user of another in a promoted binary operation
we may replace and delete the returned value before returning
triggering an assertion. Reorder node replacements to prevent this.

Fixes PR34137.

Landing on behalf of Nirav.

Differential Revision: https://reviews.llvm.org/D36581
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@311670 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/pr34137.ll [new file with mode: 0644]