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
Odin
OpenCL C
Pascal
Pony
Python
Racket
Ruby
Rust
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
TypeScript Native
V
Vala
Visual Basic
Vyper
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
; ModuleID = '41105.bc' source_filename = "41105.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" @a = dso_local global i32 0, align 4 ; Function Attrs: nounwind uwtable define dso_local i32 @b() #0 { entry: %c = alloca i32, align 4 %d = alloca i32*, align 8 %e = alloca i32*, align 8 %0 = bitcast i32* %c to i8* call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #3 %1 = bitcast i32** %d to i8* call void @llvm.lifetime.start.p0i8(i64 8, i8* %1) #3 %2 = bitcast i32** %e to i8* call void @llvm.lifetime.start.p0i8(i64 8, i8* %2) #3 %cmp = icmp uge i32** %d, null %conv = zext i1 %cmp to i32 %conv1 = sext i32 %conv to i64 %3 = inttoptr i64 %conv1 to i32* store i32* %3, i32** %e, align 8, !tbaa !2 br label %for.cond for.cond: ; preds = %for.inc, %entry %4 = load i32*, i32** %d, align 8, !tbaa !2 %5 = load i32, i32* %4, align 4, !tbaa !6 %tobool = icmp ne i32 %5, 0 br i1 %tobool, label %if.then, label %if.end if.then: ; preds = %for.cond %6 = load i32, i32* %c, align 4, !tbaa !6 %7 = load i32*, i32** %e, align 8, !tbaa !2 store i32 %6, i32* %7, align 4, !tbaa !6 %conv2 = sext i32 %6 to i64 %8 = inttoptr i64 %conv2 to i32* %9 = load i32*, i32** %d, align 8, !tbaa !2 %cmp3 = icmp uge i32* %8, %9 %conv4 = zext i1 %cmp3 to i32 %call = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 %conv4) br label %if.end if.end: ; preds = %if.then, %for.cond br label %for.inc for.inc: ; preds = %if.end %10 = load i32, i32* @a, align 4, !tbaa !6 %inc = add nsw i32 %10, 1 store i32 %inc, i32* @a, align 4, !tbaa !6 br label %for.cond } ; Function Attrs: argmemonly nofree nosync nounwind willreturn declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1 declare dso_local i32 @f(...) #2 attributes #0 = { nounwind uwtable "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { argmemonly nofree nosync nounwind willreturn } attributes #2 = { "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git 77394c12a48822bb7a9183408f922d90c1d563cd)"} !2 = !{!3, !3, i64 0} !3 = !{!"any pointer", !4, i64 0} !4 = !{!"omnipotent char", !5, i64 0} !5 = !{!"Simple C/C++ TBAA"} !6 = !{!7, !7, i64 0} !7 = !{!"int", !4, i64 0}
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
CE on Bluesky
About the author
Statistics
Changelog
Version tree