[llvm-commits] [llvm] r74964 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp test/CodeGen/X86/vec_compare.ll

Dan Gohman gohman at apple.com
Thu Jul 9 13:03:53 PDT 2009


On Jul 9, 2009, at 11:39 AM, Eli Friedman wrote:


> On Thu, Jul 9, 2009 at 11:21 AM, Dan Gohman<gohman at apple.com> wrote:
>
>> though that doesn't sound
>>
>> correct here, since i1 values promoted to i8 are usually required to
>>
>> be zero-extended. Would it make sense to define EXTRACT_VECTOR_ELT as
>>
>> explicitly using zero-extension?
>>
>
> There is no such guarantee in general; promoted values are in general
> any-extended by legalization.  I think there are some narrow
> guarantees for loads and stores, but that isn't really relevant here.

Hmm, I may be mistaken here. At any rate, the code that your patch
replaces also uses ANY_EXTEND, so the patch doesn't actually
change anything in this regard.

>
>
>> For the ARM target, we could then define a separate
>>
>> EXTRACT_VECTOR_ELT_SEXT, as it needs both.
>>
>
> That isn't really necessary either way: you can just pattern-match a
> sext_in_reg of an extract_vector_elt to the appropriate instruction.

Ah, right. Zero-extend can be handled this way as well then. So it makes
sense to have EXTRACT_VECTOR_ELT just do an any-extend.

Dan




More information about the llvm-commits mailing list