summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2019-01-05 19:20:00 +0000
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2019-01-05 19:20:00 +0000
commit35a3a3bd11ac5736fed1a9de052f172c37d989d9 (patch)
treef34123da70dcd794264098370dfe11fb92433fd5 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent27406e1f9eb9e3c691a90f8ea20718f144ac65e9 (diff)
downloadbcm5719-llvm-35a3a3bd11ac5736fed1a9de052f172c37d989d9.tar.gz
bcm5719-llvm-35a3a3bd11ac5736fed1a9de052f172c37d989d9.zip
Added single use check to ShrinkDemandedConstant
Fixes cvt_f32_ubyte combine. performCvtF32UByteNCombine() could shrink source node to demanded bits only even if there are other uses. Differential Revision: https://reviews.llvm.org/D56289 llvm-svn: 350475
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index c006bd9c5e5..2e21f57c560 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -350,6 +350,9 @@ bool TargetLowering::ShrinkDemandedConstant(SDValue Op, const APInt &Demanded,
SDLoc DL(Op);
unsigned Opcode = Op.getOpcode();
+ if (!Op.hasOneUse())
+ return false;
+
// Do target-specific constant optimization.
if (targetShrinkDemandedConstant(Op, Demanded, TLO))
return TLO.New.getNode();
OpenPOWER on IntegriCloud