[llvm-dev] RFC: make calls "convergent" by default

Sameer Sahasrabuddhe via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 17 20:02:17 PDT 2021


Sameer Sahasrabuddhe writes:

> CC'ing some more people who got dropped when sending the previous mail.
>
> Sameer.
>
> Sameer Sahasrabuddhe via llvm-dev writes:
>
>> TL;DR
>> =====
>>
>> We propose the following changes to LLVM IR in order to better support
>> operations that are sensitive to the set of threads that execute them
>> together:
>>
>> - Redefine "convergent" in terms of thread divergence in a
>>   multi-threaded execution.
>> - Fix all optimizations that examine the "convergent" attribute to also
>>   depend on divergence analysis. This avoids any impact on CPU
>>   compilation since control flow is always uniform on CPUs.
>> - Make all function calls "convergent" by default (D69498). Introduce a
>>   new "noconvergent" attribute, and make "convergent" a nop.
>> - Update the "convergence tokens" proposal to take into account this new
>>   default property (D85603).

Here's an RFC designed to look like an incremental change over Nicolai's
original spec for convergence control intrinsics (Phabricator is pretty
awesome that way).

RFC: Update token semantics with default convergent attribute
https://reviews.llvm.org/D104504

This RFC has two parts:

LangRef:

    Define the "convergent" property in LLVM IR and introduce the
    "noconvergent" attribute. This is independent of convergence control
    intrinsics and tokens.  This part is intended to be submitted first
    and replaces D69498 (IR: Invert convergent attribute handling)

    https://reviews.llvm.org/D69498

ConvergentOperations:

    Updates the semantics of convergence control intrinsics and tokens
    to account for the new default convergent property. This part is
    intended to be merged into D85603 (IR: Add convergence control
    operand bundle and intrinsics)

    https://reviews.llvm.org/D85603

Sameer.


More information about the llvm-dev mailing list