diff options
| author | Craig Topper <craig.topper@intel.com> | 2019-02-22 06:18:33 +0000 | 
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2019-02-22 06:18:33 +0000 | 
| commit | 069cf05e87325a145a4941e5959ed814600cd5a4 (patch) | |
| tree | b1727ac806dccea9e737274ee20621820ec421a4 | |
| parent | 0ca023b3b7c93266b03e8a7929fd65ccb2271ee2 (diff) | |
| download | bcm5719-llvm-069cf05e87325a145a4941e5959ed814600cd5a4.tar.gz bcm5719-llvm-069cf05e87325a145a4941e5959ed814600cd5a4.zip  | |
[LegalizeVectorOps] Simplify the non-byte sized load handling VectorLegalizer::ExpandLoad. NFCI
Remove an if that should always be true. Merge the body of another into the only block that could make the if true.
llvm-svn: 354654
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 19 | 
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index 511bff484c7..f022d2405ae 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -663,14 +663,12 @@ SDValue VectorLegalizer::ExpandLoad(SDValue Op) {      unsigned WideBits = WideVT.getSizeInBits();      for (unsigned Idx = 0; Idx != NumElem; ++Idx) { -      SDValue Lo, Hi, ShAmt; +      assert(BitOffset < WideBits && "Unexpected offset!"); -      if (BitOffset < WideBits) { -        ShAmt = DAG.getConstant( -            BitOffset, dl, TLI.getShiftAmountTy(WideVT, DAG.getDataLayout())); -        Lo = DAG.getNode(ISD::SRL, dl, WideVT, LoadVals[WideIdx], ShAmt); -        Lo = DAG.getNode(ISD::AND, dl, WideVT, Lo, SrcEltBitMask); -      } +      SDValue ShAmt = DAG.getConstant( +          BitOffset, dl, TLI.getShiftAmountTy(WideVT, DAG.getDataLayout())); +      SDValue Lo = DAG.getNode(ISD::SRL, dl, WideVT, LoadVals[WideIdx], ShAmt); +      Lo = DAG.getNode(ISD::AND, dl, WideVT, Lo, SrcEltBitMask);        BitOffset += SrcEltBits;        if (BitOffset >= WideBits) { @@ -680,14 +678,13 @@ SDValue VectorLegalizer::ExpandLoad(SDValue Op) {            ShAmt = DAG.getConstant(                SrcEltBits - BitOffset, dl,                TLI.getShiftAmountTy(WideVT, DAG.getDataLayout())); -          Hi = DAG.getNode(ISD::SHL, dl, WideVT, LoadVals[WideIdx], ShAmt); +          SDValue Hi = +              DAG.getNode(ISD::SHL, dl, WideVT, LoadVals[WideIdx], ShAmt);            Hi = DAG.getNode(ISD::AND, dl, WideVT, Hi, SrcEltBitMask); +          Lo = DAG.getNode(ISD::OR, dl, WideVT, Lo, Hi);          }        } -      if (Hi.getNode()) -        Lo = DAG.getNode(ISD::OR, dl, WideVT, Lo, Hi); -        switch (ExtType) {        default: llvm_unreachable("Unknown extended-load op!");        case ISD::EXTLOAD:  | 

