Skip to content

Commit

Permalink
[DAG] SimplifyDemandedBits - pull out repeated getValueType() calls. …
Browse files Browse the repository at this point in the history
…NFC.
  • Loading branch information
RKSimon committed Jul 23, 2022
1 parent 2421a5a commit 6aff1b7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Expand Up @@ -1056,13 +1056,13 @@ bool TargetLowering::SimplifyDemandedBits(
// TODO: We can probably do more work on calculating the known bits and
// simplifying the operations for scalable vectors, but for now we just
// bail out.
if (Op.getValueType().isScalableVector())
EVT VT = Op.getValueType();
if (VT.isScalableVector())
return false;

bool IsLE = TLO.DAG.getDataLayout().isLittleEndian();
unsigned NumElts = OriginalDemandedElts.getBitWidth();
assert((!Op.getValueType().isVector() ||
NumElts == Op.getValueType().getVectorNumElements()) &&
assert((!VT.isVector() || NumElts == VT.getVectorNumElements()) &&
"Unexpected vector size");

APInt DemandedBits = OriginalDemandedBits;
Expand All @@ -1088,7 +1088,6 @@ bool TargetLowering::SimplifyDemandedBits(
}

// Other users may use these bits.
EVT VT = Op.getValueType();
if (!Op.getNode()->hasOneUse() && !AssumeSingleUse) {
if (Depth != 0) {
// If not at the root, Just compute the Known bits to
Expand Down

0 comments on commit 6aff1b7

Please sign in to comment.