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
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target triple = "aarch64-arm-none-eabi" %struct.arm_matrix_instance_q15 = type { i16, i16, ptr } define i32 @arm_mat_add_q15(ptr nocapture noundef readonly %pSrcA, ptr nocapture noundef readonly %pSrcB, ptr nocapture noundef readonly %pDst) { entry: %pData = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pSrcA, i64 0, i32 2 %0 = load ptr, ptr %pData, align 8 %pData1 = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pSrcB, i64 0, i32 2 %1 = load ptr, ptr %pData1, align 8 %pData2 = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pDst, i64 0, i32 2 %2 = load ptr, ptr %pData2, align 8 %3 = load i16, ptr %pSrcA, align 8 %conv = zext i16 %3 to i32 %numCols = getelementptr inbounds %struct.arm_matrix_instance_q15, ptr %pSrcA, i64 0, i32 1 %4 = load i16, ptr %numCols, align 2 %conv3 = zext i16 %4 to i32 %mul = mul nuw i32 %conv3, %conv %cmp.not66 = icmp ult i32 %mul, 4 br i1 %cmp.not66, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %shr = lshr i32 %mul, 2 %5 = add nsw i32 %shr, -1 %6 = zext i32 %5 to i64 %7 = add nuw nsw i64 %6, 1 %min.iters.check = icmp ult i32 %5, 7 br i1 %min.iters.check, label %while.body, label %vector.memcheck vector.memcheck: ; preds = %while.body.preheader %8 = add nsw i32 %shr, -1 %9 = zext i32 %8 to i64 %10 = shl nuw nsw i64 %9, 3 %11 = add nuw nsw i64 %10, 8 %uglygep = getelementptr i8, ptr %2, i64 %11 %uglygep78 = getelementptr i8, ptr %0, i64 %11 %uglygep79 = getelementptr i8, ptr %1, i64 %11 %bound0 = icmp ult ptr %2, %uglygep78 %bound1 = icmp ult ptr %0, %uglygep %found.conflict = and i1 %bound0, %bound1 %bound080 = icmp ult ptr %2, %uglygep79 %bound181 = icmp ult ptr %1, %uglygep %found.conflict82 = and i1 %bound080, %bound181 %conflict.rdx = or i1 %found.conflict, %found.conflict82 br i1 %conflict.rdx, label %while.body, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %7, 8589934584 %12 = shl nuw nsw i64 %n.vec, 3 %ind.end = getelementptr i8, ptr %0, i64 %12 %cast.crd = trunc i64 %n.vec to i32 %ind.end84 = sub i32 %shr, %cast.crd %13 = shl nuw nsw i64 %n.vec, 3 %ind.end86 = getelementptr i8, ptr %1, i64 %13 %14 = shl nuw nsw i64 %n.vec, 3 %ind.end88 = getelementptr i8, ptr %2, i64 %14 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %15 = shl i64 %index, 3 %next.gep = getelementptr i8, ptr %0, i64 %15 %16 = shl i64 %index, 3 %next.gep89 = getelementptr i8, ptr %1, i64 %16 %17 = shl i64 %index, 3 %next.gep90 = getelementptr i8, ptr %2, i64 %17 %wide.vec = load <32 x i16>, ptr %next.gep, align 2 %strided.vec = shufflevector <32 x i16> %wide.vec, <32 x i16> poison, <8 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28> %strided.vec91 = shufflevector <32 x i16> %wide.vec, <32 x i16> poison, <8 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29> %strided.vec92 = shufflevector <32 x i16> %wide.vec, <32 x i16> poison, <8 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30> %strided.vec93 = shufflevector <32 x i16> %wide.vec, <32 x i16> poison, <8 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31> %wide.vec94 = load <32 x i16>, ptr %next.gep89, align 2 %strided.vec95 = shufflevector <32 x i16> %wide.vec94, <32 x i16> poison, <8 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28> %strided.vec96 = shufflevector <32 x i16> %wide.vec94, <32 x i16> poison, <8 x i32> <i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29> %strided.vec97 = shufflevector <32 x i16> %wide.vec94, <32 x i16> poison, <8 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30> %strided.vec98 = shufflevector <32 x i16> %wide.vec94, <32 x i16> poison, <8 x i32> <i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31> %18 = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> %strided.vec, <8 x i16> %strided.vec95) %19 = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> %strided.vec91, <8 x i16> %strided.vec96) %20 = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> %strided.vec92, <8 x i16> %strided.vec97) %21 = getelementptr inbounds i16, ptr %next.gep90, i64 3 %22 = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> %strided.vec93, <8 x i16> %strided.vec98) %23 = getelementptr inbounds i16, ptr %21, i64 -3 %24 = shufflevector <8 x i16> %18, <8 x i16> %19, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> %25 = shufflevector <8 x i16> %20, <8 x i16> %22, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> %interleaved.vec = shufflevector <16 x i16> %24, <16 x i16> %25, <32 x i32> <i32 0, i32 8, i32 16, i32 24, i32 1, i32 9, i32 17, i32 25, i32 2, i32 10, i32 18, i32 26, i32 3, i32 11, i32 19, i32 27, i32 4, i32 12, i32 20, i32 28, i32 5, i32 13, i32 21, i32 29, i32 6, i32 14, i32 22, i32 30, i32 7, i32 15, i32 23, i32 31> store <32 x i16> %interleaved.vec, ptr %23, align 2 %index.next = add nuw i64 %index, 8 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %7, %n.vec br i1 %cmp.n, label %while.end, label %while.body while.body: ; preds = %middle.block, %while.body.preheader, %vector.memcheck, %while.body %pInA.070 = phi ptr [ %incdec.ptr26, %while.body ], [ %ind.end, %middle.block ], [ %0, %while.body.preheader ], [ %0, %vector.memcheck ] %blkCnt.069 = phi i32 [ %dec, %while.body ], [ %ind.end84, %middle.block ], [ %shr, %while.body.preheader ], [ %shr, %vector.memcheck ] %pInB.068 = phi ptr [ %incdec.ptr28, %while.body ], [ %ind.end86, %middle.block ], [ %1, %while.body.preheader ], [ %1, %vector.memcheck ] %pOut.067 = phi ptr [ %incdec.ptr33, %while.body ], [ %ind.end88, %middle.block ], [ %2, %while.body.preheader ], [ %2, %vector.memcheck ] %incdec.ptr = getelementptr inbounds i16, ptr %pInA.070, i64 1 %27 = load i16, ptr %pInA.070, align 2 %incdec.ptr6 = getelementptr inbounds i16, ptr %pInB.068, i64 1 %28 = load i16, ptr %pInB.068, align 2 %29 = tail call i16 @llvm.sadd.sat.i16(i16 %27, i16 %28) %incdec.ptr9 = getelementptr inbounds i16, ptr %pOut.067, i64 1 store i16 %29, ptr %pOut.067, align 2 %incdec.ptr10 = getelementptr inbounds i16, ptr %pInA.070, i64 2 %30 = load i16, ptr %incdec.ptr, align 2 %incdec.ptr12 = getelementptr inbounds i16, ptr %pInB.068, i64 2 %31 = load i16, ptr %incdec.ptr6, align 2 %32 = tail call i16 @llvm.sadd.sat.i16(i16 %30, i16 %31) %incdec.ptr17 = getelementptr inbounds i16, ptr %pOut.067, i64 2 store i16 %32, ptr %incdec.ptr9, align 2 %incdec.ptr18 = getelementptr inbounds i16, ptr %pInA.070, i64 3 %33 = load i16, ptr %incdec.ptr10, align 2 %incdec.ptr20 = getelementptr inbounds i16, ptr %pInB.068, i64 3 %34 = load i16, ptr %incdec.ptr12, align 2 %35 = tail call i16 @llvm.sadd.sat.i16(i16 %33, i16 %34) %incdec.ptr25 = getelementptr inbounds i16, ptr %pOut.067, i64 3 store i16 %35, ptr %incdec.ptr17, align 2 %incdec.ptr26 = getelementptr inbounds i16, ptr %pInA.070, i64 4 %36 = load i16, ptr %incdec.ptr18, align 2 %incdec.ptr28 = getelementptr inbounds i16, ptr %pInB.068, i64 4 %37 = load i16, ptr %incdec.ptr20, align 2 %38 = tail call i16 @llvm.sadd.sat.i16(i16 %36, i16 %37) %incdec.ptr33 = getelementptr inbounds i16, ptr %pOut.067, i64 4 store i16 %38, ptr %incdec.ptr25, align 2 %dec = add i32 %blkCnt.069, -1 %cmp.not = icmp eq i32 %dec, 0 br i1 %cmp.not, label %while.end, label %while.body while.end: ; preds = %middle.block, %while.body, %entry %pOut.0.lcssa = phi ptr [ %2, %entry ], [ %ind.end88, %middle.block ], [ %incdec.ptr33, %while.body ] %pInB.0.lcssa = phi ptr [ %1, %entry ], [ %ind.end86, %middle.block ], [ %incdec.ptr28, %while.body ] %pInA.0.lcssa = phi ptr [ %0, %entry ], [ %ind.end, %middle.block ], [ %incdec.ptr26, %while.body ] %rem = and i32 %mul, 3 %cmp35.not73 = icmp eq i32 %rem, 0 br i1 %cmp35.not73, label %while.end47, label %while.body37 while.body37: ; preds = %while.end, %while.body37 %pInA.177 = phi ptr [ %incdec.ptr38, %while.body37 ], [ %pInA.0.lcssa, %while.end ] %blkCnt.176 = phi i32 [ %dec46, %while.body37 ], [ %rem, %while.end ] %pInB.175 = phi ptr [ %incdec.ptr40, %while.body37 ], [ %pInB.0.lcssa, %while.end ] %pOut.174 = phi ptr [ %incdec.ptr45, %while.body37 ], [ %pOut.0.lcssa, %while.end ] %incdec.ptr38 = getelementptr inbounds i16, ptr %pInA.177, i64 1 %39 = load i16, ptr %pInA.177, align 2 %incdec.ptr40 = getelementptr inbounds i16, ptr %pInB.175, i64 1 %40 = load i16, ptr %pInB.175, align 2 %41 = tail call i16 @llvm.sadd.sat.i16(i16 %39, i16 %40) %incdec.ptr45 = getelementptr inbounds i16, ptr %pOut.174, i64 1 store i16 %41, ptr %pOut.174, align 2 %dec46 = add nsw i32 %blkCnt.176, -1 %cmp35.not = icmp eq i32 %dec46, 0 br i1 %cmp35.not, label %while.end47, label %while.body37 while.end47: ; preds = %while.body37, %while.end ret i32 0 } declare i16 @llvm.sadd.sat.i16(i16, i16) #1 declare <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16>, <8 x i16>) #1
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