diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-02-06 20:49:28 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-02-06 20:49:28 +0000 |
commit | e96a9014ab3217f18e7d2646efe764cebbb3f7cd (patch) | |
tree | 98fd0ba3a164e88bf88bd4bac966ee3295abc15f /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | dc797c0b555aa6ea8497aa9d6e54f1b3fb6b3df2 (diff) | |
download | bcm5719-llvm-e96a9014ab3217f18e7d2646efe764cebbb3f7cd.tar.gz bcm5719-llvm-e96a9014ab3217f18e7d2646efe764cebbb3f7cd.zip |
[TargetLowering] use local variables to reduce duplication; NFCI
llvm-svn: 324397
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 1b04ab8cfc9..becc5b3dc41 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1232,10 +1232,11 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, case ISD::SUB: { // Add, Sub, and Mul don't demand any bits in positions beyond that // of the highest bit demanded of them. - APInt LoMask = APInt::getLowBitsSet(BitWidth, - BitWidth - NewMask.countLeadingZeros()); - if (SimplifyDemandedBits(Op.getOperand(0), LoMask, Known2, TLO, Depth+1) || - SimplifyDemandedBits(Op.getOperand(1), LoMask, Known2, TLO, Depth+1) || + SDValue Op0 = Op.getOperand(0), Op1 = Op.getOperand(1); + unsigned NewMaskLZ = NewMask.countLeadingZeros(); + APInt LoMask = APInt::getLowBitsSet(BitWidth, BitWidth - NewMaskLZ); + if (SimplifyDemandedBits(Op0, LoMask, Known2, TLO, Depth + 1) || + SimplifyDemandedBits(Op1, LoMask, Known2, TLO, Depth + 1) || // See if the operation should be performed at a smaller bit width. ShrinkDemandedOp(Op, BitWidth, NewMask, TLO)) { SDNodeFlags Flags = Op.getNode()->getFlags(); @@ -1245,8 +1246,7 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, Flags.setNoSignedWrap(false); Flags.setNoUnsignedWrap(false); SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), dl, Op.getValueType(), - Op.getOperand(0), Op.getOperand(1), - Flags); + Op0, Op1, Flags); return TLO.CombineTo(Op, NewOp); } return true; |