[all-commits] [llvm/llvm-project] 568185: [clang] Redefine `noconvergent` and generate conve...

Sameer Sahasrabuddhe via All-commits all-commits at lists.llvm.org
Fri Apr 18 01:19:23 PDT 2025


  Branch: refs/heads/users/ssahasra/clang-generate-tokens
  Home:   https://github.com/llvm/llvm-project
  Commit: 5681859e308283628da481c0ddc09a39345b3d46
      https://github.com/llvm/llvm-project/commit/5681859e308283628da481c0ddc09a39345b3d46
  Author: Sameer Sahasrabuddhe <sameer.sahasrabuddhe at amd.com>
  Date:   2025-04-18 (Fri, 18 Apr 2025)

  Changed paths:
    M clang/docs/ThreadConvergence.rst
    M clang/include/clang/Analysis/Analyses/ConvergenceCheck.h
    M clang/include/clang/Basic/AttrDocs.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/Analysis/ConvergenceCheck.cpp
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGStmt.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    A clang/test/CodeGenHIP/convergence-tokens.hip
    A clang/test/CodeGenHIP/noconvergent-statement.hip
    A clang/test/SemaHIP/noconvergent-errors/backwards_jump.hip
    A clang/test/SemaHIP/noconvergent-errors/jump-into-nest.hip
    A clang/test/SemaHIP/noconvergent-errors/no-errors.hip
    A clang/test/SemaHIP/noconvergent-errors/simple_jump.hip
    M llvm/include/llvm/IR/InstrTypes.h
    M llvm/include/llvm/IR/IntrinsicInst.h
    A llvm/include/llvm/Transforms/Utils/FixConvergenceControl.h
    M llvm/lib/IR/Instructions.cpp
    M llvm/lib/IR/IntrinsicInst.cpp
    M llvm/lib/Transforms/Utils/CMakeLists.txt
    A llvm/lib/Transforms/Utils/FixConvergenceControl.cpp

  Log Message:
  -----------
  [clang] Redefine `noconvergent` and generate convergence control tokens

This introduces the `-fconvergence-control` flag that emits convergence control
intrinsics which are then used as the `convergencectrl` operand bundle on
convergent calls.

This also redefines the `noconvergent` attribute in Clang. The existing simple
interpretation is that if a statement is marked `noconvergent`, then every asm
call is treated as a non-convergent operation in the emitted LLVM IR.

The new semantics introduces a more powerful notion that a `noconvergent`
statement may contain convergent operations, but the resulting convergence
constraints are limited to the scope of that statement. As a whole the statement
itself does not place any convergence constraints on the control flow reaching
it. When emitting convergence tokens, this attribute results in a call to the
`anchor` intrinsic that determines convergence within the statement.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list