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
Vyper
WASM
Zig
Javascript
GIMPLE
Ygen
llvm source #2
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 = '/tmp/test.ll' source_filename = "/app/example.cpp" 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" %struct.foo = type { [10 x [10 x float]], [10 x float] } ; Function Attrs: mustprogress nofree norecurse nosync nounwind uwtable define dso_local void @_Z7computeP3foo(%struct.foo* nocapture %p) local_unnamed_addr #0 { entry: br label %for.cond for.cond: ; preds = %for.cond.cleanup3, %entry %i.0 = phi i32 [ 0, %entry ], [ %inc10, %for.cond.cleanup3 ] %cmp = icmp ult i32 %i.0, 10 br i1 %cmp, label %for.cond1.preheader, label %for.cond.cleanup for.cond1.preheader: ; preds = %for.cond br label %for.cond1 for.cond.cleanup: ; preds = %for.cond ret void for.cond1: ; preds = %for.cond1.preheader, %for.body4 %j.0 = phi i32 [ %inc, %for.body4 ], [ 0, %for.cond1.preheader ] %cmp2 = icmp ult i32 %j.0, 10 br i1 %cmp2, label %for.body4, label %for.cond.cleanup3 for.cond.cleanup3: ; preds = %for.cond1 %inc10 = add nuw nsw i32 %i.0, 1 br label %for.cond, !llvm.loop !3 for.body4: ; preds = %for.cond1 %idxprom = zext i32 %i.0 to i64 %arrayidx = getelementptr inbounds %struct.foo, %struct.foo* %p, i64 0, i32 1, i64 %idxprom %0 = load float, float* %arrayidx, align 4, !tbaa !6 %mul = fmul float %0, 0x3FB99999A0000000 %idxprom7 = zext i32 %j.0 to i64 %arrayidx8 = getelementptr inbounds %struct.foo, %struct.foo* %p, i64 0, i32 0, i64 %idxprom, i64 %idxprom7 %1 = load float, float* %arrayidx8, align 4, !tbaa !6 %add = fadd float %1, %mul store float %add, float* %arrayidx8, align 4, !tbaa !6 %inc = add nuw nsw i32 %j.0, 1 br label %for.cond1, !llvm.loop !10 } attributes #0 = { mustprogress nofree norecurse nosync nounwind uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="znver3" "target-features"="+adx,+aes,+avx,+avx2,+bmi,+bmi2,+clflushopt,+clwb,+clzero,+cx16,+cx8,+f16c,+fma,+fsgsbase,+fxsr,+invpcid,+lzcnt,+mmx,+movbe,+mwaitx,+pclmul,+pku,+popcnt,+prfchw,+rdpid,+rdrnd,+rdseed,+sahf,+sha,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+sse4a,+ssse3,+vaes,+vpclmulqdq,+wbnoinvd,+x87,+xsave,+xsavec,+xsaveopt,+xsaves" } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 7, !"uwtable", i32 1} !2 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git 090f007e3481863430e4443765769e73f8f40e5f)"} !3 = distinct !{!3, !4, !5} !4 = !{!"llvm.loop.mustprogress"} !5 = !{!"llvm.loop.unroll.disable"} !6 = !{!7, !7, i64 0} !7 = !{!"float", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C++ TBAA"} !10 = distinct !{!10, !4, !5}
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