Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Nim
Objective-C
Objective-C++
OCaml
OpenCL C
Pascal
Pony
Python
Racket
Ruby
Rust
Snowball
Scala
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
TypeScript Native
V
Vala
Visual Basic
WASM
Zig
Javascript
GIMPLE
Ygen
llvm source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
clang (assertions trunk)
clang (trunk)
clang 10.0.0
clang 10.0.1
clang 11.0.0
clang 11.0.1
clang 12.0.0
clang 12.0.1
clang 13.0.0
clang 14.0.0
clang 15.0.0
clang 16.0.0
clang 17.0.1
clang 18.1.0
clang 19.1.0
clang 4.0.1
clang 5.0.0
clang 6.0.0
clang 7.0.0
clang 8.0.0
clang 9.0.0
llc (assertions trunk)
llc (trunk)
llc 10.0.0
llc 10.0.1
llc 11.0.0
llc 11.0.1
llc 12.0.0
llc 12.0.1
llc 13.0.0
llc 14.0.0
llc 15.0.0
llc 16.0.0
llc 17.0.1
llc 18.1.0
llc 19.1.0
llc 3.2
llc 3.3
llc 3.9.1
llc 4.0.0
llc 4.0.1
llc 5.0.0
llc 6.0.0
llc 7.0.0
llc 8.0.0
llc 9.0.0
opt (assertions trunk)
opt (trunk)
opt 10.0.0
opt 10.0.1
opt 11.0.0
opt 11.0.1
opt 12.0.0
opt 12.0.1
opt 13.0.0
opt 14.0.0
opt 15.0.0
opt 16.0.0
opt 17.0.1
opt 18.1.0
opt 19.1.0
opt 3.2
opt 3.3
opt 3.9.1
opt 4.0.0
opt 4.0.1
opt 5.0.0
opt 6.0.0
opt 7.0.0
opt 8.0.0
opt 9.0.0
Options
Source code
define amdgpu_kernel void @add_i64_varying(ptr addrspace(1) %out, ptr addrspace(1) %inout) #0 { entry: %lane = call i32 @llvm.amdgcn.workitem.id.x() %zext = zext i32 %lane to i64 %0 = call i64 @llvm.amdgcn.ballot.i64(i1 true) %1 = trunc i64 %0 to i32 %2 = lshr i64 %0, 32 %3 = trunc i64 %2 to i32 %4 = call i32 @llvm.amdgcn.mbcnt.lo(i32 %1, i32 0) %5 = call i32 @llvm.amdgcn.mbcnt.hi(i32 %3, i32 %4) %6 = call i64 @llvm.amdgcn.set.inactive.i64(i64 %zext, i64 0) %7 = call i64 @llvm.amdgcn.update.dpp.i64(i64 0, i64 %6, i32 273, i32 15, i32 15, i1 false) %8 = add i64 %6, %7 %9 = call i64 @llvm.amdgcn.update.dpp.i64(i64 0, i64 %8, i32 274, i32 15, i32 15, i1 false) %10 = add i64 %8, %9 %11 = call i64 @llvm.amdgcn.update.dpp.i64(i64 0, i64 %10, i32 276, i32 15, i32 15, i1 false) %12 = add i64 %10, %11 %13 = call i64 @llvm.amdgcn.update.dpp.i64(i64 0, i64 %12, i32 280, i32 15, i32 15, i1 false) %14 = add i64 %12, %13 %15 = call i64 @llvm.amdgcn.permlanex16.i64(i64 %14, i64 %14, i32 -1, i32 -1, i1 false, i1 false) %16 = call i64 @llvm.amdgcn.update.dpp.i64(i64 0, i64 %15, i32 228, i32 10, i32 15, i1 false) %17 = add i64 %14, %16 %18 = call i64 @llvm.amdgcn.readlane.i64(i64 %17, i32 31) %19 = call i64 @llvm.amdgcn.update.dpp.i64(i64 0, i64 %18, i32 228, i32 12, i32 15, i1 false) %20 = add i64 %17, %19 %21 = call i64 @llvm.amdgcn.update.dpp.i64(i64 0, i64 %20, i32 273, i32 15, i32 15, i1 false) %22 = call i64 @llvm.amdgcn.readlane.i64(i64 %20, i32 15) %23 = call i64 @llvm.amdgcn.writelane.i64(i64 %22, i32 16, i64 %21) %24 = call i64 @llvm.amdgcn.readlane.i64(i64 %20, i32 31) %25 = call i64 @llvm.amdgcn.writelane.i64(i64 %24, i32 32, i64 %23) %26 = call i64 @llvm.amdgcn.readlane.i64(i64 %20, i32 47) %27 = call i64 @llvm.amdgcn.writelane.i64(i64 %26, i32 48, i64 %25) %28 = call i64 @llvm.amdgcn.readlane.i64(i64 %20, i32 63) %29 = call i64 @llvm.amdgcn.strict.wwm.i64(i64 %28) %30 = icmp eq i32 %5, 0 br i1 %30, label %31, label %33 31: ; preds = %entry %32 = atomicrmw add ptr addrspace(1) %inout, i64 %29 syncscope("agent") acq_rel, align 8 br label %33 33: ; preds = %entry, %31 %34 = phi i64 [ poison, %entry ], [ %32, %31 ] %35 = call i64 @llvm.amdgcn.readfirstlane.i64(i64 %34) %36 = call i64 @llvm.amdgcn.strict.wwm.i64(i64 %27) %37 = add i64 %35, %36 store i64 %37, ptr addrspace(1) %out, align 8 ret void }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
About the author
Statistics
Changelog
Version tree