[llvm-commits] [PATCH] Fix assert in x86 Extract_vec_EltCombine

Rotem, Nadav nadav.rotem at intel.com
Tue May 17 00:19:34 PDT 2011


This patch fixes a bug in PerformEXTRACT_VECTOR_ELTCombine on 64bit systems.  Sorry, no test. I can only reproduce it on LLVM2.8, but the fix is still valid for the trunk.

In this code we create an ADD SDNode with two different types. Sometimes  the IDX value is not of the same type as the pointer type.

May I commit ?

Index: lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- lib/Target/X86/X86ISelLowering.cpp  (revision 131179)
+++ lib/Target/X86/X86ISelLowering.cpp  (working copy)
@@ -11059,7 +11059,7 @@
     uint64_t Offset = EltSize * cast<ConstantSDNode>(Idx)->getZExtValue();
     SDValue OffsetVal = DAG.getConstant(Offset, TLI.getPointerTy());

-    SDValue ScalarAddr = DAG.getNode(ISD::ADD, dl, Idx.getValueType(),
+    SDValue ScalarAddr = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(),
                                      StackPtr, OffsetVal);

     // Load the scalar.
---------------------------------------------------------------------
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/20110517/3d6ee608/attachment.html>


More information about the llvm-commits mailing list