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#
Go
Haskell
HLSL
Hook
Hylo
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
Swift
LLVM TableGen
Toit
TypeScript Native
V
Vala
Visual Basic
Zig
Javascript
GIMPLE
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 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 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 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 = 'input.cpp' source_filename = "input.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" %class.e = type { i8 } %"class.std::initializer_list" = type { i32*, i64 } $_ZN1e1fILi3ELi2ELi2EEEvv = comdat any $_ZNSt16initializer_listIiE5beginEv = comdat any $_ZNSt16initializer_listIiE3endEv = comdat any @d = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: uwtable define dso_local void @_ZN1e1hEv(%class.e* %this) local_unnamed_addr #0 align 2 { entry: call void @_ZN1e1fILi3ELi2ELi2EEEvv(%class.e* %this) ret void } ; Function Attrs: uwtable define linkonce_odr dso_local void @_ZN1e1fILi3ELi2ELi2EEEvv(%class.e* %this) local_unnamed_addr #0 comdat align 2 { entry: %ref.tmp6 = alloca [1 x i32], align 4 br label %for.cond for.cond: ; preds = %for.cond2, %entry %ref.tmp.apc.retyped.0 = phi <16 x i8> [ undef, %entry ], [ %ref.tmp.apc.retyped.1, %for.cond2 ] %g.0 = phi i32 [ undef, %entry ], [ %g.1, %for.cond2 ] br label %for.cond2 for.cond2: ; preds = %for.cond3, %for.cond %ref.tmp.apc.retyped.1 = phi <16 x i8> [ %ref.tmp.apc.retyped.0, %for.cond ], [ %ref.tmp.apc.retyped.2, %for.cond3 ] %g.1 = phi i32 [ %g.0, %for.cond ], [ 0, %for.cond3 ] %0 = load i32, i32* @d, align 4, !tbaa !2 %tobool.not = icmp eq i32 %0, 0 br i1 %tobool.not, label %for.cond, label %for.cond3 for.cond3: ; preds = %for.cond2, %for.cond.cleanup9 %ref.tmp.apc.retyped.2 = phi <16 x i8> [ %ref.tmp.apc.retyped.1, %for.cond2 ], [ %8, %for.cond.cleanup9 ] %g.2 = phi i32 [ %inc, %for.cond.cleanup9 ], [ %g.1, %for.cond2 ] %tobool4.not = icmp eq i32 %g.2, 0 br i1 %tobool4.not, label %for.cond2, label %for.body5 for.body5: ; preds = %for.cond3 %1 = bitcast [1 x i32]* %ref.tmp6 to i8* call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %1) #3 %arrayinit.begin = getelementptr inbounds [1 x i32], [1 x i32]* %ref.tmp6, i64 0, i64 0 store i32 2, i32* %arrayinit.begin, align 4, !tbaa !2 %2 = bitcast <16 x i8> %ref.tmp.apc.retyped.2 to <2 x i64> %3 = inttoptr <2 x i64> %2 to <2 x i32*> %4 = insertelement <2 x i32*> %3, i32* %arrayinit.begin, i64 0 %5 = ptrtoint <2 x i32*> %4 to <2 x i64> %6 = bitcast <2 x i64> %5 to <16 x i8> %7 = insertelement <2 x i64> %5, i64 1, i64 1 %8 = bitcast <2 x i64> %7 to <16 x i8> %9 = inttoptr <2 x i64> %7 to <2 x i32*> %10 = extractelement <2 x i32*> %9, i64 0 br label %for.cond8 for.cond8: ; preds = %for.body10, %for.body5 %__begin4.0 = phi i32* [ %10, %for.body5 ], [ %incdec.ptr, %for.body10 ] %cmp.not = icmp eq i32* %__begin4.0, null br i1 %cmp.not, label %for.cond.cleanup9, label %for.body10 for.cond.cleanup9: ; preds = %for.cond8 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %1) #3 %inc = add nsw i32 %g.2, 1 br label %for.cond3 for.body10: ; preds = %for.cond8 %incdec.ptr = getelementptr inbounds i32, i32* %__begin4.0, i64 1 br label %for.cond8 } ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1 ; Function Attrs: nounwind uwtable define linkonce_odr dso_local i32* @_ZNSt16initializer_listIiE5beginEv(%"class.std::initializer_list"* %this) local_unnamed_addr #2 comdat align 2 { entry: %a = getelementptr inbounds %"class.std::initializer_list", %"class.std::initializer_list"* %this, i64 0, i32 0 %0 = load i32*, i32** %a, align 8, !tbaa !6 ret i32* %0 } ; Function Attrs: nounwind uwtable define linkonce_odr dso_local i32* @_ZNSt16initializer_listIiE3endEv(%"class.std::initializer_list"* %this) local_unnamed_addr #2 comdat align 2 { entry: ret i32* null } ; Function Attrs: argmemonly nounwind willreturn declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1 attributes #0 = { uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #1 = { argmemonly nounwind willreturn } attributes #2 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } attributes #3 = { nounwind } !llvm.module.flags = !{!0} !llvm.ident = !{!1} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{!"clang version 12.0.0 (git@github.com:LebedevRI/llvm-project.git db504ba6613d6d0aaf0fe2e804de51bdce809b4c)"} !2 = !{!3, !3, i64 0} !3 = !{!"int", !4, i64 0} !4 = !{!"omnipotent char", !5, i64 0} !5 = !{!"Simple C++ TBAA"} !6 = !{!7, !8, i64 0} !7 = !{!"_ZTSSt16initializer_listIiE", !8, i64 0, !9, i64 8} !8 = !{!"any pointer", !4, i64 0} !9 = !{!"long", !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
About the author
Statistics
Changelog
Version tree