[llvm-commits] Patch review for bug 9190
Rotem, Nadav
nadav.rotem at intel.com
Thu Feb 10 14:27:05 PST 2011
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110211/67917b5c/attachment.html>
More information about the llvm-commits
mailing list