From 88cd80cbfaa23271447239b3b5f0c2084cef2184 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 3 May 2019 14:38:24 +0000 Subject: [PATCH] [TargetLowering] ShrinkDemandedConstant - reduce scope of TLO.DAG variable. NFCI. Only ever used in one block git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359890 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/TargetLowering.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 3515048c7f8..73fda1b7608 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -448,7 +448,6 @@ TargetLowering::isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const { /// return true. bool TargetLowering::ShrinkDemandedConstant(SDValue Op, const APInt &Demanded, TargetLoweringOpt &TLO) const { - SelectionDAG &DAG = TLO.DAG; SDLoc DL(Op); unsigned Opcode = Op.getOpcode(); @@ -474,8 +473,8 @@ bool TargetLowering::ShrinkDemandedConstant(SDValue Op, const APInt &Demanded, if (!C.isSubsetOf(Demanded)) { EVT VT = Op.getValueType(); - SDValue NewC = DAG.getConstant(Demanded & C, DL, VT); - SDValue NewOp = DAG.getNode(Opcode, DL, VT, Op.getOperand(0), NewC); + SDValue NewC = TLO.DAG.getConstant(Demanded & C, DL, VT); + SDValue NewOp = TLO.DAG.getNode(Opcode, DL, VT, Op.getOperand(0), NewC); return TLO.CombineTo(Op, NewOp); } -- 2.50.1