[LLVMdev] Ideas for representing vector gather/scatter and masks in LLVM IR

Dan Gohman gohman at apple.com
Mon Aug 4 13:58:10 PDT 2008


On Aug 3, 2008, at 3:39 AM, Duncan Sands wrote:

> Hi,
>
>> The set of instructions requiring mask legalization would be found by
>> recursively traversing the uses of all applymask instructions.
>
> what if the applymask is in one function, but the use of it is in  
> another?


I think we could just disallow this.

If we get to the point of wanting mask-aware library routines, it might
make sense to introduce an unmask instruction, which would be a sort of
inverse to applymask that would return the original value, with any
masked-out portion set to undef. Front-ends would then explicitly
pass the mask along with the unmasked arguments to library routines,
which would reapply the mask as needed. It's conceivable that we might
want something even fancier than that in the future, but we can figure
that out later.

Thanks,

Dan




More information about the llvm-dev mailing list