OSDN Git Service

[DAG] Fix Node Replacement in PromoteIntBinOp
authorHans Wennborg <hans@hanshq.net>
Thu, 24 Aug 2017 01:08:27 +0000 (01:08 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 24 Aug 2017 01:08:27 +0000 (01:08 +0000)
commit6d2214fde6366a5a1693ddbdf676421aa45f56fc
treeab3faaa95fb8981da7b8a84cb25ce5f6555028c5
parente42da35bfc2779a2518818a4735c0f5b460e598f
[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/trunk@311623 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/pr34137.ll [new file with mode: 0644]