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
; ModuleID = '/tmp/file.c' source_filename = "/tmp/file.c" target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "thumbv8.1m.main-arm-none-eabi" ; Function Attrs: nofree norecurse nounwind define dso_local void @arm_abs_q15(i16* nocapture readonly %pSrc, i16* nocapture %pDst, i32 %blockSize) local_unnamed_addr #0 { entry: %cmp19 = icmp eq i32 %blockSize, 0 br i1 %cmp19, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %blockSize, 8 br i1 %min.iters.check, label %while.body.preheader33, label %vector.memcheck vector.memcheck: ; preds = %while.body.preheader %scevgep = getelementptr i16, i16* %pDst, i32 %blockSize %scevgep26 = getelementptr i16, i16* %pSrc, i32 %blockSize %bound0 = icmp ugt i16* %scevgep26, %pDst %bound1 = icmp ugt i16* %scevgep, %pSrc %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %while.body.preheader33, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i32 %blockSize, -8 %ind.end = getelementptr i16, i16* %pSrc, i32 %n.vec %ind.end29 = sub i32 %blockSize, %n.vec %ind.end31 = getelementptr i16, i16* %pDst, i32 %n.vec br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %next.gep = getelementptr i16, i16* %pSrc, i32 %index %next.gep32 = getelementptr i16, i16* %pDst, i32 %index %0 = bitcast i16* %next.gep to <8 x i16>* %wide.load = load <8 x i16>, <8 x i16>* %0, align 2, !tbaa !3, !alias.scope !7 %1 = icmp sgt <8 x i16> %wide.load, zeroinitializer %2 = icmp eq <8 x i16> %wide.load, <i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768> %3 = sub <8 x i16> zeroinitializer, %wide.load %4 = select <8 x i1> %2, <8 x i16> <i16 32767, i16 32767, i16 32767, i16 32767, i16 32767, i16 32767, i16 32767, i16 32767>, <8 x i16> %3 %5 = select <8 x i1> %1, <8 x i16> %wide.load, <8 x i16> %4 %6 = bitcast i16* %next.gep32 to <8 x i16>* store <8 x i16> %5, <8 x i16>* %6, align 2, !tbaa !3, !alias.scope !10, !noalias !7 %index.next = add i32 %index, 8 %7 = icmp eq i32 %index.next, %n.vec br i1 %7, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i32 %n.vec, %blockSize br i1 %cmp.n, label %while.end, label %while.body.preheader33 while.body.preheader33: ; preds = %middle.block, %vector.memcheck, %while.body.preheader %pSrc.addr.022.ph = phi i16* [ %pSrc, %vector.memcheck ], [ %pSrc, %while.body.preheader ], [ %ind.end, %middle.block ] %blkCnt.021.ph = phi i32 [ %blockSize, %vector.memcheck ], [ %blockSize, %while.body.preheader ], [ %ind.end29, %middle.block ] %pDst.addr.020.ph = phi i16* [ %pDst, %vector.memcheck ], [ %pDst, %while.body.preheader ], [ %ind.end31, %middle.block ] br label %while.body while.body: ; preds = %while.body.preheader33, %while.body %pSrc.addr.022 = phi i16* [ %incdec.ptr, %while.body ], [ %pSrc.addr.022.ph, %while.body.preheader33 ] %blkCnt.021 = phi i32 [ %dec, %while.body ], [ %blkCnt.021.ph, %while.body.preheader33 ] %pDst.addr.020 = phi i16* [ %incdec.ptr13, %while.body ], [ %pDst.addr.020.ph, %while.body.preheader33 ] %incdec.ptr = getelementptr inbounds i16, i16* %pSrc.addr.022, i32 1 %8 = load i16, i16* %pSrc.addr.022, align 2, !tbaa !3 %cmp1 = icmp sgt i16 %8, 0 %cmp5 = icmp eq i16 %8, -32768 %sub = sub i16 0, %8 %cond = select i1 %cmp5, i16 32767, i16 %sub %cond11 = select i1 %cmp1, i16 %8, i16 %cond %incdec.ptr13 = getelementptr inbounds i16, i16* %pDst.addr.020, i32 1 store i16 %cond11, i16* %pDst.addr.020, align 2, !tbaa !3 %dec = add i32 %blkCnt.021, -1 %cmp = icmp eq i32 %dec, 0 br i1 %cmp, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %middle.block, %entry ret void } attributes #0 = { nofree norecurse nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "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"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+armv8.1-m.main,+dsp,+fp-armv8d16sp,+fp16,+fullfp16,+hwdiv,+lob,+mve,+mve.fp,+ras,+strict-align,+thumb-mode,+vfp2sp,+vfp3d16sp,+vfp4d16sp" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 1, !"min_enum_size", i32 4} !2 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project 9d1dbd2e16e21c01933739f16e988239d5dcca04)"} !3 = !{!4, !4, i64 0} !4 = !{!"short", !5, i64 0} !5 = !{!"omnipotent char", !6, i64 0} !6 = !{!"Simple C/C++ TBAA"} !7 = !{!8} !8 = distinct !{!8, !9} !9 = distinct !{!9, !"LVerDomain"} !10 = !{!11} !11 = distinct !{!11, !9} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = distinct !{!14, !13}
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/input.c' source_filename = "/tmp/input.c" target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "thumbv8.1m.main-arm-none-eabi" ; Function Attrs: nofree norecurse nounwind define dso_local void @arm_abs_q15(i16* nocapture readonly %pSrc, i16* nocapture %pDst, i32 %blockSize) local_unnamed_addr #0 { entry: %cmp19 = icmp eq i32 %blockSize, 0 br i1 %cmp19, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %blockSize, 8 br i1 %min.iters.check, label %while.body.preheader33, label %vector.memcheck vector.memcheck: ; preds = %while.body.preheader %scevgep = getelementptr i16, i16* %pDst, i32 %blockSize %scevgep26 = getelementptr i16, i16* %pSrc, i32 %blockSize %bound0 = icmp ugt i16* %scevgep26, %pDst %bound1 = icmp ugt i16* %scevgep, %pSrc %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %while.body.preheader33, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.mod.vf = and i32 %blockSize, 7 %n.vec = and i32 %blockSize, -8 %ind.end = getelementptr i16, i16* %pSrc, i32 %n.vec %ind.end31 = getelementptr i16, i16* %pDst, i32 %n.vec br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %next.gep = getelementptr i16, i16* %pSrc, i32 %index %next.gep32 = getelementptr i16, i16* %pDst, i32 %index %0 = bitcast i16* %next.gep to <8 x i16>* %wide.load = load <8 x i16>, <8 x i16>* %0, align 2, !tbaa !3, !alias.scope !7 %1 = icmp sgt <8 x i16> %wide.load, zeroinitializer %2 = icmp eq <8 x i16> %wide.load, <i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768> %3 = sub <8 x i16> zeroinitializer, %wide.load %4 = select <8 x i1> %2, <8 x i16> <i16 32767, i16 32767, i16 32767, i16 32767, i16 32767, i16 32767, i16 32767, i16 32767>, <8 x i16> %3 %5 = select <8 x i1> %1, <8 x i16> %wide.load, <8 x i16> %4 %6 = bitcast i16* %next.gep32 to <8 x i16>* store <8 x i16> %5, <8 x i16>* %6, align 2, !tbaa !3, !alias.scope !10, !noalias !7 %index.next = add i32 %index, 8 %7 = icmp eq i32 %index.next, %n.vec br i1 %7, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i32 %n.vec, %blockSize br i1 %cmp.n, label %while.end, label %while.body.preheader33 while.body.preheader33: ; preds = %middle.block, %vector.memcheck, %while.body.preheader %pSrc.addr.022.ph = phi i16* [ %pSrc, %vector.memcheck ], [ %pSrc, %while.body.preheader ], [ %ind.end, %middle.block ] %blkCnt.021.ph = phi i32 [ %blockSize, %vector.memcheck ], [ %blockSize, %while.body.preheader ], [ %n.mod.vf, %middle.block ] %pDst.addr.020.ph = phi i16* [ %pDst, %vector.memcheck ], [ %pDst, %while.body.preheader ], [ %ind.end31, %middle.block ] br label %while.body while.body: ; preds = %while.body.preheader33, %while.body %pSrc.addr.022 = phi i16* [ %incdec.ptr, %while.body ], [ %pSrc.addr.022.ph, %while.body.preheader33 ] %blkCnt.021 = phi i32 [ %dec, %while.body ], [ %blkCnt.021.ph, %while.body.preheader33 ] %pDst.addr.020 = phi i16* [ %incdec.ptr13, %while.body ], [ %pDst.addr.020.ph, %while.body.preheader33 ] %incdec.ptr = getelementptr inbounds i16, i16* %pSrc.addr.022, i32 1 %8 = load i16, i16* %pSrc.addr.022, align 2, !tbaa !3 %cmp1 = icmp sgt i16 %8, 0 %cmp5 = icmp eq i16 %8, -32768 %sub = sub i16 0, %8 %cond = select i1 %cmp5, i16 32767, i16 %sub %cond11 = select i1 %cmp1, i16 %8, i16 %cond %incdec.ptr13 = getelementptr inbounds i16, i16* %pDst.addr.020, i32 1 store i16 %cond11, i16* %pDst.addr.020, align 2, !tbaa !3 %dec = add i32 %blkCnt.021, -1 %cmp = icmp eq i32 %dec, 0 br i1 %cmp, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %middle.block, %entry ret void } attributes #0 = { nofree norecurse nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "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"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+armv8.1-m.main,+dsp,+fp-armv8d16sp,+fp16,+fullfp16,+hwdiv,+lob,+mve,+mve.fp,+ras,+strict-align,+thumb-mode,+vfp2sp,+vfp3d16sp,+vfp4d16sp" "unsafe-fp-math"="false" "use-soft-float"="false" } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 1, !"min_enum_size", i32 4} !2 = !{!"clang version 11.0.0 (git@github.com:LebedevRI/llvm-project.git ef16891f01771dbbcf7968cf226b76daf9aa5c5f)"} !3 = !{!4, !4, i64 0} !4 = !{!"short", !5, i64 0} !5 = !{!"omnipotent char", !6, i64 0} !6 = !{!"Simple C/C++ TBAA"} !7 = !{!8} !8 = distinct !{!8, !9} !9 = distinct !{!9, !"LVerDomain"} !10 = !{!11} !11 = distinct !{!11, !9} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = distinct !{!14, !13}
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