[llvm-commits] [llvm] r140249 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp test/CodeGen/X86/2011-09-21-setcc-bug.ll

Rotem, Nadav nadav.rotem at intel.com
Wed Sep 21 09:34:54 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 :) 

PromoteIntRes is called only when the return type needs to be IntPromoted. 
So the type, <256 x i8> would be split before getting to this code. Right ?

I will try to write an exhaustive test with many types and check if I can make this fail. 

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