Skip to content

Commit

Permalink
[AArch64] Minor refactoring. NFC.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269963 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Chad Rosier committed May 18, 2016
1 parent 7d1364e commit de2a437
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1987,13 +1987,12 @@ static bool tryBitfieldInsertOpFromOr(SDNode *N, const APInt &UsefulBits,
SelectionDAG *CurDAG) {
assert(N->getOpcode() == ISD::OR && "Expect a OR operation");

SDValue Dst, Src;
unsigned ImmR, ImmS;

EVT VT = N->getValueType(0);
if (VT != MVT::i32 && VT != MVT::i64)
return false;

unsigned BitWidth = VT.getSizeInBits();

// Because of simplify-demanded-bits in DAGCombine, involved masks may not
// have the expected shape. Try to undo that.

Expand All @@ -2011,6 +2010,8 @@ static bool tryBitfieldInsertOpFromOr(SDNode *N, const APInt &UsefulBits,
// and/or inserting fewer extra instructions.
for (int I = 0; I < 4; ++I) {

SDValue Dst, Src;
unsigned ImmR, ImmS;
bool BiggerPattern = I / 2;
SDNode *OrOpd0 = N->getOperand(I % 2).getNode();
SDValue OrOpd1Val = N->getOperand((I + 1) % 2);
Expand Down Expand Up @@ -2040,7 +2041,7 @@ static bool tryBitfieldInsertOpFromOr(SDNode *N, const APInt &UsefulBits,
} else if (isBitfieldPositioningOp(CurDAG, SDValue(OrOpd0, 0),
BiggerPattern,
Src, DstLSB, Width)) {
ImmR = (VT.getSizeInBits() - DstLSB) % VT.getSizeInBits();
ImmR = (BitWidth - DstLSB) % BitWidth;
ImmS = Width - 1;
} else
continue;
Expand Down

0 comments on commit de2a437

Please sign in to comment.