Prevent visitSIGN_EXTEND from generating ISD::SELECT for vectors

Nadav Rotem nrotem at apple.com
Tue Mar 12 10:40:31 PDT 2013


LGTM. 

On Mar 12, 2013, at 9:15 AM, "Relph, Richard" <Richard.Relph at amd.com> wrote:

> Per discussion on LLVMDev, implement Nadav's suggested fix to DAGCombiner::visitSIGN_EXTEND() to prevent 'optimization' of SIGN_EXTEND to SELECT if we are sign-extending a vector…
> 
> Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp
> ===================================================================
> --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp	(revision 176837)
> +++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp	(working copy)
> @@ -4496,8 +4496,8 @@
>                        NegOne, DAG.getConstant(0, VT),
>                        cast<CondCodeSDNode>(N0.getOperand(2))->get(), true);
>     if (SCC.getNode()) return SCC;
> -    if (!LegalOperations ||
> -        TLI.isOperationLegal(ISD::SETCC, TLI.getSetCCResultType(VT)))
> +    if (!VT.isVector() && (!LegalOperations ||
> +        TLI.isOperationLegal(ISD::SETCC, TLI.getSetCCResultType(VT))))
>       return DAG.getNode(ISD::SELECT, N->getDebugLoc(), VT,
>                          DAG.getSetCC(N->getDebugLoc(),
>                                       TLI.getSetCCResultType(VT),
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130312/77861209/attachment.html>


More information about the llvm-commits mailing list