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

Duncan Sands baldrick at free.fr
Tue May 17 00:28:31 PDT 2011


Hi Nadav,

> 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 ?

this looks fine to me - please go ahead.

Ciao, Duncan.

>
> 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.
>
>
>
> _______________________________________________
> 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