Thanks for using Compiler Explorer
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
AArch64 (Morello compiler)
AArch64 (Morello compiler)
AArch64 (Morello compiler)
Hybrid CHERI-MIPS
Hybrid CHERI-MIPS
Hybrid CHERI-MIPS
Hybrid CHERI-RISCV64
Hybrid CHERI-RISCV64
Hybrid CHERI-RISCV64
Hybrid Morello
Hybrid Morello
Hybrid Morello
MIPS (without CHERI)
MIPS (without CHERI)
MIPS (without CHERI)
Purecap CHERI-MIPS
Purecap CHERI-MIPS
Purecap CHERI-MIPS
Purecap CHERI-RISCV64
Purecap CHERI-RISCV64
Purecap CHERI-RISCV64
Purecap Morello
Purecap Morello
Purecap Morello
RISCV64 (without CHERI)
RISCV64 (without CHERI)
RISCV64 (without CHERI)
Options
Source code
define i8 addrspace(200)* @foo(i8 addrspace(200)* %p, i64 %a) { %p.a = call i64 @llvm.cheri.cap.address.get.i64(i8 addrspace(200)* %p) %o = sub i64 %a, %p.a %p.q = getelementptr i8, i8 addrspace(200)* %p, i64 %o ret i8 addrspace(200)* %p.q } define i8 addrspace(200)* @bar(i8 addrspace(200)* %p, i8 addrspace(200)* %q) { %o = call i64 @llvm.cheri.cap.diff.i64(i8 addrspace(200)* %p, i8 addrspace(200)* %q) %p.q = getelementptr i8, i8 addrspace(200)* %p, i64 %o ret i8 addrspace(200)* %p.q } declare i64 @llvm.cheri.cap.address.get.i64(i8 addrspace(200)*) declare i64 @llvm.cheri.cap.diff.i64(i8 addrspace(200)*, i8 addrspace(200)*)
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