diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-10-24 20:56:52 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-10-24 20:56:52 +0000 |
commit | d8ec09c74f8096946df4680d3aed878c472c97a4 (patch) | |
tree | ed2c322e5ab3c4e7bd19d10c8c0defb40ea8ef7e /llvm/lib | |
parent | 26f89df41f8d125d10f6fb85fe82c569ded0708f (diff) | |
download | bcm5719-llvm-d8ec09c74f8096946df4680d3aed878c472c97a4.tar.gz bcm5719-llvm-d8ec09c74f8096946df4680d3aed878c472c97a4.zip |
Use SDValue::getConstantOperandVal() helper. NFCI.
llvm-svn: 285025
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index aaced6cab6b..28c3f7a9e96 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2423,8 +2423,7 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero, } case ISD::EXTRACT_ELEMENT: { computeKnownBits(Op.getOperand(0), KnownZero, KnownOne, Depth+1); - const unsigned Index = - cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue(); + const unsigned Index = Op.getConstantOperandVal(1); const unsigned BitWidth = Op.getValueSizeInBits(); // Remove low part of known bits mask @@ -2716,8 +2715,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const { // Get reverse index (starting from 1), Op1 value indexes elements from // little end. Sign starts at big end. - const int rIndex = Items - 1 - - cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue(); + const int rIndex = Items - 1 - Op.getConstantOperandVal(1); // If the sign portion ends in our element the subtraction gives correct // result. Otherwise it gives either negative or > bitwidth result |