Skip to content

Triton: tl.where conditional select #78

@Zaneham

Description

@Zaneham

tl.where is the standard conditional-select intrinsic, used heavily for masking-as-arithmetic and for clamping patterns. Sema already lists it in the intrinsic table (TN_TLI_WHERE) but the lowerer falls through to the not-yet-lowered diagnostic. The natural BIR target is BIR_SELECT, which takes a predicate, a true value, and a false value, and which the existing optimisation passes already understand. The only mild complication is type promotion when the two values have different element types, which can defer to a later sitting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TritonTriton frontend (Python subset, tl.* intrinsics)enhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions