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
@b = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @c = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @d = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @e = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @f = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @g = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @h = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @j = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @p = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @a = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @k = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @l = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @m = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @o = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 define dso_local void @foo() local_unnamed_addr #0 { entry: br label %vector.body vector.body: ; preds = %vector.body, %entry %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ] %0 = getelementptr inbounds [1024 x double], ptr @b, i64 0, i64 %index %wide.load = load <2 x double>, ptr %0, align 8 %1 = getelementptr inbounds [1024 x double], ptr @c, i64 0, i64 %index %wide.load34 = load <2 x double>, ptr %1, align 8 %2 = getelementptr inbounds [1024 x double], ptr @d, i64 0, i64 %index %wide.load35 = load <2 x double>, ptr %2, align 8 %3 = getelementptr inbounds [1024 x double], ptr @e, i64 0, i64 %index %wide.load36 = load <2 x double>, ptr %3, align 8 %4 = fmul <2 x double> %wide.load35, %wide.load36 %5 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load, <2 x double> %wide.load34, <2 x double> %4) %6 = getelementptr inbounds [1024 x double], ptr @f, i64 0, i64 %index %wide.load37 = load <2 x double>, ptr %6, align 8 %7 = getelementptr inbounds [1024 x double], ptr @g, i64 0, i64 %index %wide.load38 = load <2 x double>, ptr %7, align 8 %8 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load37, <2 x double> %wide.load38, <2 x double> %5) %9 = getelementptr inbounds [1024 x double], ptr @h, i64 0, i64 %index %wide.load39 = load <2 x double>, ptr %9, align 8 %10 = getelementptr inbounds [1024 x double], ptr @j, i64 0, i64 %index %wide.load40 = load <2 x double>, ptr %10, align 8 %11 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load39, <2 x double> %wide.load40, <2 x double> %8) %12 = getelementptr inbounds [1024 x double], ptr @p, i64 0, i64 %index %wide.load41 = load <2 x double>, ptr %12, align 8 %13 = fadd <2 x double> %11, %wide.load41 %14 = getelementptr inbounds [1024 x double], ptr @a, i64 0, i64 %index %wide.load42 = load <2 x double>, ptr %14, align 8 %15 = fadd <2 x double> %wide.load42, %13 store <2 x double> %15, ptr %14, align 8 %index.next = add nuw i64 %index, 2 %16 = icmp eq i64 %index.next, 1024 br i1 %16, label %for.cond.cleanup, label %vector.body for.cond.cleanup: ; preds = %vector.body ret void } declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #1 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a,-fmv" } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = '/app/example.c' source_filename = "/app/example.c" target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target triple = "aarch64-unknown-linux-gnu" @b = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @c = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @d = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @e = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @f = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @g = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @h = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @j = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @p = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @a = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @k = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @l = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @m = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 @o = dso_local local_unnamed_addr global [1024 x double] zeroinitializer, align 8 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local float @foo() local_unnamed_addr #0 { br label %1 1: ; preds = %1, %0 %2 = phi i64 [ 0, %0 ], [ %29, %1 ] %3 = getelementptr inbounds [1024 x double], ptr @b, i64 0, i64 %2 %4 = load <2 x double>, ptr %3, align 8, !tbaa !7 %5 = getelementptr inbounds [1024 x double], ptr @c, i64 0, i64 %2 %6 = load <2 x double>, ptr %5, align 8, !tbaa !7 %7 = getelementptr inbounds [1024 x double], ptr @d, i64 0, i64 %2 %8 = load <2 x double>, ptr %7, align 8, !tbaa !7 %9 = getelementptr inbounds [1024 x double], ptr @e, i64 0, i64 %2 %10 = load <2 x double>, ptr %9, align 8, !tbaa !7 %11 = fmul <2 x double> %8, %10 %12 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %4, <2 x double> %6, <2 x double> %11) %13 = getelementptr inbounds [1024 x double], ptr @f, i64 0, i64 %2 %14 = load <2 x double>, ptr %13, align 8, !tbaa !7 %15 = getelementptr inbounds [1024 x double], ptr @g, i64 0, i64 %2 %16 = load <2 x double>, ptr %15, align 8, !tbaa !7 %17 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %16, <2 x double> %12) %18 = getelementptr inbounds [1024 x double], ptr @h, i64 0, i64 %2 %19 = load <2 x double>, ptr %18, align 8, !tbaa !7 %20 = getelementptr inbounds [1024 x double], ptr @j, i64 0, i64 %2 %21 = load <2 x double>, ptr %20, align 8, !tbaa !7 %22 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %19, <2 x double> %21, <2 x double> %17) %23 = getelementptr inbounds [1024 x double], ptr @p, i64 0, i64 %2 %24 = load <2 x double>, ptr %23, align 8, !tbaa !7 %25 = fadd <2 x double> %22, %24 %26 = getelementptr inbounds [1024 x double], ptr @a, i64 0, i64 %2 %27 = load <2 x double>, ptr %26, align 8, !tbaa !7 %28 = fadd <2 x double> %27, %25 store <2 x double> %28, ptr %26, align 8, !tbaa !7 %29 = add nuw i64 %2, 2 %30 = icmp eq i64 %29, 1024 br i1 %30, label %31, label %1, !llvm.loop !11 31: ; preds = %1 ret float undef } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #1 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a,-fmv" } attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3, !4, !5} !llvm.ident = !{!6} !0 = !{i32 7, !"Dwarf Version", i32 4} !1 = !{i32 1, !"wchar_size", i32 4} !2 = !{i32 8, !"PIC Level", i32 2} !3 = !{i32 7, !"PIE Level", i32 2} !4 = !{i32 7, !"uwtable", i32 2} !5 = !{i32 7, !"frame-pointer", i32 1} !6 = !{!"clang version 17.0.0 (https://github.com/llvm/llvm-project.git 8826cd57825d829121ad7fb73fab0a6cf30f29f6)"} !7 = !{!8, !8, i64 0} !8 = !{!"double", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !12, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"}
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