[LLVMdev] Adding masked vector load and store intrinsics

dag at cray.com dag at cray.com
Fri Oct 24 15:12:48 PDT 2014

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


More information about the llvm-dev mailing list