From 3ae5d6c4c4894b681fe2e454cd362e294c2a1d52 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 7 Apr 2019 11:49:33 +0000 Subject: [PATCH] [DAG] Pull out ComputeNumSignBits call to make debugging easier. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357861 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 8796888c7e5..5b89aceb9d4 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1130,8 +1130,8 @@ bool TargetLowering::SimplifyDemandedBits( // If we only care about the highest bit, don't bother shifting right. if (DemandedBits.isSignMask()) { - bool AlreadySignExtended = - TLO.DAG.ComputeNumSignBits(Op0) >= BitWidth - ExVTBits + 1; + unsigned NumSignBits = TLO.DAG.ComputeNumSignBits(Op0); + bool AlreadySignExtended = NumSignBits >= BitWidth - ExVTBits + 1; // However if the input is already sign extended we expect the sign // extension to be dropped altogether later and do not simplify. if (!AlreadySignExtended) { -- 2.40.0