[llvm-commits] [llvm] r140249 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp test/CodeGen/X86/2011-09-21-setcc-bug.ll
Duncan Sands
baldrick at free.fr
Wed Sep 21 10:37:35 PDT 2011
Hi Nadav,
>> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Wed Sep 21 09:34:38 2011
>> @@ -500,6 +500,8 @@
>>
>> SDValue DAGTypeLegalizer::PromoteIntRes_SETCC(SDNode *N) {
>> EVT SVT = TLI.getSetCCResultType(N->getOperand(0).getValueType());
>> + // Vector setcc result types need to be leglized.
>> + SVT = TLI.getTypeToTransformTo(*DAG.getContext(), SVT);
>
>> I think this is obviously wrong. Consider a SETCC with operand type<256 x i8>
>
> Well, it was not obvious to me :)
OK :)
I think the thing to do is to only use the result of getSetCCResultType if
it is legal, and otherwise just use the usual promoted type (NVT).
> PromoteIntRes is called only when the return type needs to be IntPromoted.
Since the result type is a vector of i1 (isn't it?), this always happens.
> So the type,<256 x i8> would be split before getting to this code. Right ?
In my example, that's the operand type not the result type.
>
> I will try to write an exhaustive test with many types and check if I can make this fail.
Thanks!
Ciao, Duncan.
>
> Thanks,
> Nadav
>
>
>> and return type<256 x i1>. Then SVT will be<256 x i8> on x86, but this will
>> then be turned into<128 x i8> by your change, resulting in an invalid SETCC.
>
>> Ciao, Duncan.
> _______________________________________________
> 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