[llvm-commits] Patch review for bug 9190

Duncan Sands baldrick at free.fr
Thu Feb 10 23:37:26 PST 2011


Hi Nadav, this makes sense to me.

Ciao, Duncan.

> http://llvm.org/bugs/show_bug.cgi?id=9190
>
> The bug happens when the DAGCombiner attempts to optimize one of the patterns of
> the SUB opcode. It tries to create a zero of type v2i64. This type is legal on
> 32bit machines, but the initializer is target dependent. Currently, the
> initializer attempts to create an i64 zero constant, which fails.
>
> Added a flag to tell the DAGCombiner to create a legal zero, if we require that
> the pass would generate legal types.
>
> Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp
>
> ===================================================================
>
> --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp (revision 124985)
>
> +++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp (working copy)
>
> @@ -1533,7 +1533,7 @@
>
> // fold (sub x, x) -> 0
>
> if (N0 == N1)
>
> - return DAG.getConstant(0, N->getValueType(0));
>
> + return DAG.getConstant(0, N->getValueType(0), LegalTypes);
>
> // fold (sub c1, c2) -> c1-c2
>
> if (N0C && N1C)
>
> return DAG.FoldConstantArithmetic(ISD::SUB, VT, N0C, N1C);
>
> Cheers,
>
> Nadav
>
> ---------------------------------------------------------------------
> 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.
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list