Skip to content

Commit ed0d6c6

Browse files
committed
Remove check for single use in ShrinkDemandedConstant
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 llvm-svn: 350684
1 parent fdef020 commit ed0d6c6

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@ bool TargetLowering::ShrinkDemandedConstant(SDValue Op, const APInt &Demanded,
350350
SDLoc DL(Op);
351351
unsigned Opcode = Op.getOpcode();
352352

353-
if (!Op.hasOneUse())
354-
return false;
355-
356353
// Do target-specific constant optimization.
357354
if (targetShrinkDemandedConstant(Op, Demanded, TLO))
358355
return TLO.New.getNode();

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8586,8 +8586,7 @@ SDValue SITargetLowering::performCvtF32UByteNCombine(SDNode *N,
85868586
TargetLowering::TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(),
85878587
!DCI.isBeforeLegalizeOps());
85888588
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
8589-
if (TLI.ShrinkDemandedConstant(Src, Demanded, TLO) ||
8590-
TLI.SimplifyDemandedBits(Src, Demanded, Known, TLO)) {
8589+
if (TLI.SimplifyDemandedBits(Src, Demanded, Known, TLO)) {
85918590
DCI.CommitTargetLoweringOpt(TLO);
85928591
}
85938592

0 commit comments

Comments
 (0)