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 = 'store.c' source_filename = "store.c" target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target triple = "aarch64" %struct.state_t = type { i32, i32, i32, i32 } %struct.entry_t = type { [4 x %struct.bucket_t] } %struct.bucket_t = type { i32, i32, i8, i8 } @size = dso_local local_unnamed_addr constant i32 15000000, align 4 @s = dso_local local_unnamed_addr global %struct.state_t zeroinitializer, align 4 @table = dso_local local_unnamed_addr global %struct.entry_t* null, align 8 @a = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: nounwind uwtable define dso_local void @store() local_unnamed_addr #0 { entry: %0 = load i32, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 0), align 4, !tbaa !8 %tobool.not = icmp eq i32 %0, 0 %1 = load i32, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 1), align 4 %add = zext i1 %tobool.not to i32 %h.0 = add i32 %1, %add %2 = load %struct.entry_t*, %struct.entry_t** @table, align 8, !tbaa !13 %rem = urem i32 %h.0, 15000000 %idxprom = zext i32 %rem to i64 %3 = load i32, i32* @a, align 4 %h3 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 0, i32 0 %4 = load i32, i32* %h3, align 4, !tbaa !15 %cmp4 = icmp eq i32 %4, %h.0 %.pre = load i32, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 2), align 4, !tbaa !17 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %entry, %if.end15.2, %if.end15.1, %if.end15 %5 = phi i32 [ %inc7, %if.end15 ], [ %inc7.1, %if.end15.1 ], [ %inc7.2, %if.end15.2 ], [ %.pre, %entry ] %i.060.lcssa.wide = phi i64 [ 1, %if.end15 ], [ 2, %if.end15.1 ], [ 3, %if.end15.2 ], [ 0, %entry ] %inc = add i32 %5, 1 %temp = getelementptr inbounds %struct.state_t, %struct.state_t* @s, i64 0, i32 2 store i32 %inc, i32* %temp, align 4, !tbaa !17;i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 2), align 4, !tbaa !17 br label %for.end if.end6: ; preds = %entry %inc7 = add i32 %.pre, 1 %a = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 0, i32 3 %6 = load i8, i8* %a, align 1, !tbaa !18 %conv = zext i8 %6 to i32 %cmp11 = icmp eq i32 %3, %conv br i1 %cmp11, label %if.then13, label %if.end15 if.then13: ; preds = %if.end6 %7 = load i32, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 3), align 4, !tbaa !19 %inc14 = add i32 %7, 1 store i32 %inc14, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 3), align 4, !tbaa !19 br label %if.end15 if.end15: ; preds = %if.then13, %if.end6 %d19 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 0, i32 2 %8 = load i8, i8* %d19, align 4, !tbaa !20 %conv20 = zext i8 %8 to i32 %sub = sub i32 %conv, %3 %9 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true) %mul.neg = mul i32 %9, -1024 %sub26 = or i32 %mul.neg, %conv20 %cmp27 = icmp slt i32 %sub26, 65535 %spec.select = select i1 %cmp27, i32 %sub26, i32 65535 %h3.1 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 1, i32 0 %10 = load i32, i32* %h3.1, align 4, !tbaa !15 %cmp4.1 = icmp eq i32 %10, %h.0 br i1 %cmp4.1, label %if.then5, label %if.end6.1 for.end: ; preds = %if.end15.3, %if.then5 %mi.2 = phi i64 [ %i.060.lcssa.wide, %if.then5 ], [ %spec.select55.3, %if.end15.3 ] %arrayidx34 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 %mi.2 %11 = bitcast %struct.bucket_t* %arrayidx34 to i8* tail call void @use(i8* %11) #3 ret void if.end6.1: ; preds = %if.end15 %inc7.1 = add i32 %.pre, 2 %a.1 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 1, i32 3 %12 = load i8, i8* %a.1, align 1, !tbaa !18 %conv.1 = zext i8 %12 to i32 %cmp11.1 = icmp eq i32 %3, %conv.1 br i1 %cmp11.1, label %if.then13.1, label %if.end15.1 if.then13.1: ; preds = %if.end6.1 %13 = load i32, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 3), align 4, !tbaa !19 %inc14.1 = add i32 %13, 1 store i32 %inc14.1, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 3), align 4, !tbaa !19 br label %if.end15.1 if.end15.1: ; preds = %if.then13.1, %if.end6.1 %d19.1 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 1, i32 2 %14 = load i8, i8* %d19.1, align 4, !tbaa !20 %conv20.1 = zext i8 %14 to i32 %sub.1 = sub i32 %conv.1, %3 %15 = tail call i32 @llvm.abs.i32(i32 %sub.1, i1 true) %mul.neg.1 = mul i32 %15, -1024 %sub26.1 = or i32 %mul.neg.1, %conv20.1 %cmp27.1 = icmp slt i32 %sub26.1, %spec.select %spec.select.1 = select i1 %cmp27.1, i32 %sub26.1, i32 %spec.select %spec.select55.1 = zext i1 %cmp27.1 to i64 %h3.2 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 2, i32 0 %16 = load i32, i32* %h3.2, align 4, !tbaa !15 %cmp4.2 = icmp eq i32 %16, %h.0 br i1 %cmp4.2, label %if.then5, label %if.end6.2 if.end6.2: ; preds = %if.end15.1 %inc7.2 = add i32 %.pre, 3 %a.2 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 2, i32 3 %17 = load i8, i8* %a.2, align 1, !tbaa !18 %conv.2 = zext i8 %17 to i32 %cmp11.2 = icmp eq i32 %3, %conv.2 br i1 %cmp11.2, label %if.then13.2, label %if.end15.2 if.then13.2: ; preds = %if.end6.2 %18 = load i32, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 3), align 4, !tbaa !19 %inc14.2 = add i32 %18, 1 store i32 %inc14.2, i32* getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 3), align 4, !tbaa !19 br label %if.end15.2 if.end15.2: ; preds = %if.then13.2, %if.end6.2 %d19.2 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 2, i32 2 %19 = load i8, i8* %d19.2, align 4, !tbaa !20 %conv20.2 = zext i8 %19 to i32 %sub.2 = sub i32 %conv.2, %3 %20 = tail call i32 @llvm.abs.i32(i32 %sub.2, i1 true) %mul.neg.2 = mul i32 %20, -1024 %sub26.2 = or i32 %mul.neg.2, %conv20.2 %cmp27.2 = icmp slt i32 %sub26.2, %spec.select.1 %spec.select.2 = select i1 %cmp27.2, i32 %sub26.2, i32 %spec.select.1 %spec.select55.2 = select i1 %cmp27.2, i64 2, i64 %spec.select55.1 %h3.3 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 3, i32 0 %21 = load i32, i32* %h3.3, align 4, !tbaa !15 %cmp4.3 = icmp eq i32 %21, %h.0 br i1 %cmp4.3, label %if.then5, label %if.end6.3 if.end6.3: ; preds = %if.end15.2 %inc7.3 = add i32 %.pre, 4 %temp2 = getelementptr inbounds %struct.state_t, %struct.state_t* @s, i64 0, i32 2 store i32 %inc7.3, i32* %temp2;getelementptr inbounds (%struct.state_t, %struct.state_t* @s, i64 0, i32 2), align 4, !tbaa !17 %a.3 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 3, i32 3 %22 = load i8, i8* %a.3, align 1, !tbaa !18 %conv.3 = zext i8 %22 to i32 %cmp11.3 = icmp eq i32 %3, %conv.3 br label %if.end15.3 if.end15.3: ; preds = %if.then13.3, %if.end6.3 %23 = add i32 3, 4 %d19.3 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64 %idxprom, i32 0, i64 3, i32 2 %24 = load i8, i8* %d19.3, align 4, !tbaa !20 %conv20.3 = zext i8 %24 to i32 %sub.3 = sub i32 %conv.3, %3 %25 = tail call i32 @llvm.abs.i32(i32 %sub.3, i1 true) %mul.neg.3 = mul i32 %25, -1024 %sub26.3 = or i32 %mul.neg.3, %conv20.3 %cmp27.3 = icmp slt i32 %sub26.3, %spec.select.2 %spec.select55.3 = select i1 %cmp27.3, i64 3, i64 %spec.select55.2 br label %for.end } declare dso_local void @use(i8*) local_unnamed_addr #1 ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn declare i32 @llvm.abs.i32(i32, i1 immarg) #2 attributes #0 = { nounwind uwtable "frame-pointer"="non-leaf" "min-legal-vector-width"="0" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon" "unsafe-fp-math"="true" } attributes #1 = { "frame-pointer"="non-leaf" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon" "unsafe-fp-math"="true" } attributes #2 = { nofree nosync nounwind readnone speculatable willreturn } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6} !llvm.ident = !{!7} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 1, !"branch-target-enforcement", i32 0} !2 = !{i32 1, !"sign-return-address", i32 0} !3 = !{i32 1, !"sign-return-address-all", i32 0} !4 = !{i32 1, !"sign-return-address-with-bkey", i32 0} !5 = !{i32 7, !"uwtable", i32 1} !6 = !{i32 7, !"frame-pointer", i32 1} !7 = !{!"clang version 13.0.0 (/home/momvel01/llvm-dsg d9cdcfb069e97b106474f11ace9193ca24323006)"} !8 = !{!9, !10, i64 0} !9 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12} !10 = !{!"int", !11, i64 0} !11 = !{!"omnipotent char", !12, i64 0} !12 = !{!"Simple C/C++ TBAA"} !13 = !{!14, !14, i64 0} !14 = !{!"any pointer", !11, i64 0} !15 = !{!16, !10, i64 0} !16 = !{!"", !10, i64 0, !11, i64 8, !11, i64 9} !17 = !{!9, !10, i64 8} !18 = !{!16, !11, i64 9} !19 = !{!9, !10, i64 12} !20 = !{!16, !11, i64 8}
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