[LLVMdev] Adding masked vector load and store intrinsics

Smith, Kevin B kevin.b.smith at intel.com
Fri Oct 24 15:30:48 PDT 2014


Yes, IMO that has to be the direction in order for SSA form to work properly for masked operations.

Kevin B. Smith

-----Original Message-----
From: dag at cray.com [mailto:dag at cray.com] 
Sent: Friday, October 24, 2014 3:13 PM
To: Smith, Kevin B
Cc: dag at cray.com; Demikhovsky, Elena; llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Adding masked vector load and store intrinsics

"Smith, Kevin B" <kevin.b.smith at intel.com> writes:

>> How would one express such semantics in LLVM IR with this intrinsic?
>> By definition, %data anmd %passthrough are different IR virtual
>> registers and there are no copy instructions in LLVM IR.
>
> You never need to express this semantic in LLVM IR, because in SSA
> form they are always different SSA defs for the result of the
> operation versus the inputs to the operation.  Someplace late in the
> CG needs to handle this, in exactly an analogous fashion as it already
> has to handle this for mapping to regular X86 two address code.

Following up, doing it this way will require that additional intrinsics
(for exmaple, all FP operations) each have an additional passthrough
register operand:

%result = llvm.masked.fadd(%a, %b, %mask, %passthrough)

Otherwise we would need some implicit specification that either %a or %b
is the passthrough which seems very wrong for a general intrinsic.

Is this how you see this going?

                               -David




More information about the llvm-dev mailing list