]> granicus.if.org Git - llvm/commitdiff
Remove check for single use in ShrinkDemandedConstant
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Wed, 9 Jan 2019 02:24:22 +0000 (02:24 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Wed, 9 Jan 2019 02:24:22 +0000 (02:24 +0000)
This removes check for single use from general ShrinkDemandedConstant
to the BE because of the AArch64 regression after D56289/rL350475.

After several hours of experiments I did not come up with a testcase
failing on any other targets if check is not performed.

Moreover, direct call to ShrinkDemandedConstant is not really needed
and superceed by SimplifyDemandedBits.

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

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

lib/CodeGen/SelectionDAG/TargetLowering.cpp
lib/Target/AMDGPU/SIISelLowering.cpp

index 2851dbb21e850ae5f63cdca943b925c81a4b585f..ca0db5cd0ab73fc4c099510703547e7f7f017509 100644 (file)
@@ -350,9 +350,6 @@ 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();
index 894806b9faad057fc4aebe9ca0f0d735a0027b7b..0e2e3b04d87fd3c3a3166ef498ccedea38c31f34 100644 (file)
@@ -8586,8 +8586,7 @@ SDValue SITargetLowering::performCvtF32UByteNCombine(SDNode *N,
   TargetLowering::TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(),
                                         !DCI.isBeforeLegalizeOps());
   const TargetLowering &TLI = DAG.getTargetLoweringInfo();
-  if (TLI.ShrinkDemandedConstant(Src, Demanded, TLO) ||
-      TLI.SimplifyDemandedBits(Src, Demanded, Known, TLO)) {
+  if (TLI.SimplifyDemandedBits(Src, Demanded, Known, TLO)) {
     DCI.CommitTargetLoweringOpt(TLO);
   }