diff options
author | Asaf Badouh <asaf.badouh@intel.com> | 2016-11-15 07:55:22 +0000 |
---|---|---|
committer | Asaf Badouh <asaf.badouh@intel.com> | 2016-11-15 07:55:22 +0000 |
commit | b573553424cd1700cc1128eb8431de8cdfc3b04c (patch) | |
tree | 4874f84402010ec567823ce2b6ec64840df930e9 /llvm/lib/CodeGen | |
parent | 029d730bade89fa97b0c4f910975f91f16682283 (diff) | |
download | bcm5719-llvm-b573553424cd1700cc1128eb8431de8cdfc3b04c.tar.gz bcm5719-llvm-b573553424cd1700cc1128eb8431de8cdfc3b04c.zip |
DAGCombiner: fix combine of trunc and select
bugzilla:
https://llvm.org/bugs/show_bug.cgi?id=29002
pr29002
Differential Revision: https://reviews.llvm.org/D26449
llvm-svn: 286938
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 63da11659ed..dd640db7010 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -7304,7 +7304,7 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) { } // trunc (select c, a, b) -> select c, (trunc a), (trunc b) - if (N0.getOpcode() == ISD::SELECT) { + if (N0.getOpcode() == ISD::SELECT && N0.hasOneUse()) { EVT SrcVT = N0.getValueType(); if ((!LegalOperations || TLI.isOperationLegal(ISD::SELECT, SrcVT)) && TLI.isTruncateFree(SrcVT, VT)) { |