[llvm-commits] [llvm] r143177 - in /llvm/trunk: lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/X86/ lib/Target/XCore/ test/CodeGen/CellSPU/ test/CodeGen/Mips/ test/CodeGen/Thumb/ test/CodeGen/X86/

Rotem, Nadav nadav.rotem at intel.com
Fri Oct 28 00:04:40 PDT 2011


I added the discussed code when I worked on the type-legalizer because I legalized SIGN_EXTEND_INREG incorrectly. I think that this code is redundant now and can be removed. 

Thanks,
Nadav

-----Original Message-----
From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Dan Gohman
Sent: Friday, October 28, 2011 04:02
To: Eli Friedman
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] [llvm] r143177 - in /llvm/trunk: lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/X86/ lib/Target/XCore/ test/CodeGen/CellSPU/ test/CodeGen/Mips/ test/CodeGen/Thumb/ test/CodeGen/X86/


On Oct 27, 2011, at 6:56 PM, Eli Friedman wrote:

> On Thu, Oct 27, 2011 at 6:29 PM, Dan Gohman <gohman at apple.com> wrote:
>> @@ -3628,6 +3351,35 @@
>>     Results.push_back(Tmp1);
>>     break;
>>   }
>> +  case ISD::BUILD_VECTOR:
>> +    Results.push_back(ExpandBUILD_VECTOR(Node));
>> +    break;
>> +  case ISD::SRA:
>> +  case ISD::SRL:
>> +  case ISD::SHL: {
>> +    // Scalarize vector SRA/SRL/SHL.
>> +    EVT VT = Node->getValueType(0);
>> +    assert(VT.isVector() && "Unable to legalize non-vector shift");
>> +    assert(TLI.isTypeLegal(VT.getScalarType())&& "Element type must be legal");
>> +    unsigned NumElem = VT.getVectorNumElements();
>> +
>> +    SmallVector<SDValue, 8> Scalars;
>> +    for (unsigned Idx = 0; Idx < NumElem; Idx++) {
>> +      SDValue Ex = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl,
>> +                               VT.getScalarType(),
>> +                               Node->getOperand(0), DAG.getIntPtrConstant(Idx));
>> +      SDValue Sh = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl,
>> +                               VT.getScalarType(),
>> +                               Node->getOperand(1), DAG.getIntPtrConstant(Idx));
>> +      Scalars.push_back(DAG.getNode(Node->getOpcode(), dl,
>> +                                    VT.getScalarType(), Ex, Sh));
>> +    }
>> +    SDValue Result =
>> +      DAG.getNode(ISD::BUILD_VECTOR, dl, Node->getValueType(0),
>> +                  &Scalars[0], Scalars.size());
>> +    DAG.ReplaceAllUsesWith(SDValue(Node, 0), Result, this);
>> +    break;
>> +  }
> 
> We ought to be scalarizing vector shifts in LegalizeVectorOps; is
> there some case where that is not sufficient?

That code predates this patch. It may be a leftover from pre-LegalizeTypes days.

Dan

_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.





More information about the llvm-commits mailing list