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 = 'malloc.c' source_filename = "malloc.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.ident_t = type { i32, i32, i32, i32, ptr } %struct.__tgt_offload_entry = type { ptr, ptr, i64, i32, i32 } %struct.anon = type { i32, i32, i32, i32 } @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2050, i32 0, i32 22, ptr @0 }, align 8 @2 = private unnamed_addr constant %struct.ident_t { i32 0, i32 514, i32 0, i32 22, ptr @0 }, align 8 @.str = private unnamed_addr constant [12 x i8] c"Teams == 10\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"malloc.c\00", align 1 @__PRETTY_FUNCTION__.__omp_offloading_10302_adc9471_main_l10.omp_outlined.omp_outlined = private unnamed_addr constant [11 x i8] c"int main()\00", align 1 @3 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @0 }, align 8 @.offloading.entry_name = internal unnamed_addr constant [40 x i8] c"__omp_offloading_10302_adc9471_main_l10\00" @.offloading.entry.__omp_offloading_10302_adc9471_main_l10 = weak constant %struct.__tgt_offload_entry { ptr @__omp_offloading_10302_adc9471_main_l10, ptr @.offloading.entry_name, i64 0, i32 0, i32 0 }, section "omp_offloading_entries", align 1 ; Function Attrs: convergent noinline norecurse nounwind optnone uwtable define weak_odr protected void @__omp_offloading_10302_adc9471_main_l10(ptr noalias noundef %dyn_ptr, ptr noalias noundef %__context) #0 { entry: %dyn_ptr.addr = alloca ptr, align 8 %__context.addr = alloca ptr, align 8 %Teams = alloca i32, align 4 %Threads = alloca i32, align 4 %.capture_expr. = alloca i32, align 4 %.capture_expr.1 = alloca i32, align 4 %Teams.casted = alloca i64, align 8 %Threads.casted = alloca i64, align 8 %0 = call i32 @__kmpc_global_thread_num(ptr @3) store ptr %dyn_ptr, ptr %dyn_ptr.addr, align 8 store ptr %__context, ptr %__context.addr, align 8 %1 = load ptr, ptr %__context.addr, align 8 %2 = getelementptr inbounds %struct.anon, ptr %1, i32 0, i32 0 %3 = load i32, ptr %2, align 4 store i32 %3, ptr %Teams, align 4 %4 = getelementptr inbounds %struct.anon, ptr %1, i32 0, i32 1 %5 = load i32, ptr %4, align 4 store i32 %5, ptr %Threads, align 4 %6 = getelementptr inbounds %struct.anon, ptr %1, i32 0, i32 2 %7 = load i32, ptr %6, align 4 store i32 %7, ptr %.capture_expr., align 4 %8 = getelementptr inbounds %struct.anon, ptr %1, i32 0, i32 3 %9 = load i32, ptr %8, align 4 store i32 %9, ptr %.capture_expr.1, align 4 %10 = load i32, ptr %.capture_expr., align 4 %11 = load i32, ptr %.capture_expr.1, align 4 call void @__kmpc_push_num_teams(ptr @3, i32 %0, i32 %10, i32 %11) %12 = load i32, ptr %Teams, align 4 store i32 %12, ptr %Teams.casted, align 4 %13 = load i64, ptr %Teams.casted, align 8 %14 = load i32, ptr %Threads, align 4 store i32 %14, ptr %Threads.casted, align 4 %15 = load i64, ptr %Threads.casted, align 8 call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @3, i32 2, ptr @__omp_offloading_10302_adc9471_main_l10.omp_outlined, i64 %13, i64 %15) ret void } ; Function Attrs: convergent noinline norecurse nounwind optnone uwtable define internal void @__omp_offloading_10302_adc9471_main_l10.omp_outlined(ptr noalias noundef %.global_tid., ptr noalias noundef %.bound_tid., i64 noundef %Teams, i64 noundef %Threads) #0 { entry: %.global_tid..addr = alloca ptr, align 8 %.bound_tid..addr = alloca ptr, align 8 %Teams.addr = alloca i64, align 8 %Threads.addr = alloca i64, align 8 %.omp.iv = alloca i32, align 4 %tmp = alloca i32, align 4 %.capture_expr. = alloca i32, align 4 %.capture_expr.1 = alloca i32, align 4 %i = alloca i32, align 4 %.omp.comb.lb = alloca i32, align 4 %.omp.comb.ub = alloca i32, align 4 %.omp.stride = alloca i32, align 4 %.omp.is_last = alloca i32, align 4 %i3 = alloca i32, align 4 %Teams.casted = alloca i64, align 8 %Threads.casted = alloca i64, align 8 store ptr %.global_tid., ptr %.global_tid..addr, align 8 store ptr %.bound_tid., ptr %.bound_tid..addr, align 8 store i64 %Teams, ptr %Teams.addr, align 8 store i64 %Threads, ptr %Threads.addr, align 8 %0 = load i32, ptr %Threads.addr, align 4 %1 = load i32, ptr %Teams.addr, align 4 %mul = mul nsw i32 %0, %1 store i32 %mul, ptr %.capture_expr., align 4 %2 = load i32, ptr %.capture_expr., align 4 %sub = sub nsw i32 %2, 0 %div = sdiv i32 %sub, 1 %sub2 = sub nsw i32 %div, 1 store i32 %sub2, ptr %.capture_expr.1, align 4 store i32 0, ptr %i, align 4 %3 = load i32, ptr %.capture_expr., align 4 %cmp = icmp slt i32 0, %3 br i1 %cmp, label %omp.precond.then, label %omp.precond.end omp.precond.then: ; preds = %entry store i32 0, ptr %.omp.comb.lb, align 4 %4 = load i32, ptr %.capture_expr.1, align 4 store i32 %4, ptr %.omp.comb.ub, align 4 store i32 1, ptr %.omp.stride, align 4 store i32 0, ptr %.omp.is_last, align 4 %5 = load ptr, ptr %.global_tid..addr, align 8 %6 = load i32, ptr %5, align 4 call void @__kmpc_for_static_init_4(ptr @1, i32 %6, i32 92, ptr %.omp.is_last, ptr %.omp.comb.lb, ptr %.omp.comb.ub, ptr %.omp.stride, i32 1, i32 1) %7 = load i32, ptr %.omp.comb.ub, align 4 %8 = load i32, ptr %.capture_expr.1, align 4 %cmp4 = icmp sgt i32 %7, %8 br i1 %cmp4, label %cond.true, label %cond.false cond.true: ; preds = %omp.precond.then %9 = load i32, ptr %.capture_expr.1, align 4 br label %cond.end cond.false: ; preds = %omp.precond.then %10 = load i32, ptr %.omp.comb.ub, align 4 br label %cond.end cond.end: ; preds = %cond.false, %cond.true %cond = phi i32 [ %9, %cond.true ], [ %10, %cond.false ] store i32 %cond, ptr %.omp.comb.ub, align 4 %11 = load i32, ptr %.omp.comb.lb, align 4 store i32 %11, ptr %.omp.iv, align 4 br label %omp.inner.for.cond omp.inner.for.cond: ; preds = %omp.inner.for.inc, %cond.end %12 = load i32, ptr %.omp.iv, align 4 %13 = load i32, ptr %.omp.comb.ub, align 4 %cmp5 = icmp sle i32 %12, %13 br i1 %cmp5, label %omp.inner.for.body, label %omp.inner.for.end omp.inner.for.body: ; preds = %omp.inner.for.cond %14 = load i32, ptr %.omp.comb.lb, align 4 %15 = zext i32 %14 to i64 %16 = load i32, ptr %.omp.comb.ub, align 4 %17 = zext i32 %16 to i64 %18 = load i32, ptr %Teams.addr, align 4 store i32 %18, ptr %Teams.casted, align 4 %19 = load i64, ptr %Teams.casted, align 8 %20 = load i32, ptr %Threads.addr, align 4 store i32 %20, ptr %Threads.casted, align 4 %21 = load i64, ptr %Threads.casted, align 8 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @3, i32 4, ptr @__omp_offloading_10302_adc9471_main_l10.omp_outlined.omp_outlined, i64 %15, i64 %17, i64 %19, i64 %21) br label %omp.inner.for.inc omp.inner.for.inc: ; preds = %omp.inner.for.body %22 = load i32, ptr %.omp.iv, align 4 %23 = load i32, ptr %.omp.stride, align 4 %add = add nsw i32 %22, %23 store i32 %add, ptr %.omp.iv, align 4 br label %omp.inner.for.cond omp.inner.for.end: ; preds = %omp.inner.for.cond br label %omp.loop.exit omp.loop.exit: ; preds = %omp.inner.for.end %24 = load ptr, ptr %.global_tid..addr, align 8 %25 = load i32, ptr %24, align 4 call void @__kmpc_for_static_fini(ptr @1, i32 %25) br label %omp.precond.end omp.precond.end: ; preds = %omp.loop.exit, %entry ret void } ; Function Attrs: nounwind declare void @__kmpc_for_static_init_4(ptr, i32, i32, ptr, ptr, ptr, ptr, i32, i32) #1 ; Function Attrs: convergent noinline norecurse nounwind optnone uwtable define internal void @__omp_offloading_10302_adc9471_main_l10.omp_outlined.omp_outlined(ptr noalias noundef %.global_tid., ptr noalias noundef %.bound_tid., i64 noundef %.previous.lb., i64 noundef %.previous.ub., i64 noundef %Teams, i64 noundef %Threads) #0 { entry: %.global_tid..addr = alloca ptr, align 8 %.bound_tid..addr = alloca ptr, align 8 %.previous.lb..addr = alloca i64, align 8 %.previous.ub..addr = alloca i64, align 8 %Teams.addr = alloca i64, align 8 %Threads.addr = alloca i64, align 8 %.omp.iv = alloca i32, align 4 %tmp = alloca i32, align 4 %.capture_expr. = alloca i32, align 4 %.capture_expr.1 = alloca i32, align 4 %i = alloca i32, align 4 %.omp.lb = alloca i32, align 4 %.omp.ub = alloca i32, align 4 %.omp.stride = alloca i32, align 4 %.omp.is_last = alloca i32, align 4 %i4 = alloca i32, align 4 store ptr %.global_tid., ptr %.global_tid..addr, align 8 store ptr %.bound_tid., ptr %.bound_tid..addr, align 8 store i64 %.previous.lb., ptr %.previous.lb..addr, align 8 store i64 %.previous.ub., ptr %.previous.ub..addr, align 8 store i64 %Teams, ptr %Teams.addr, align 8 store i64 %Threads, ptr %Threads.addr, align 8 %0 = load i32, ptr %Threads.addr, align 4 %1 = load i32, ptr %Teams.addr, align 4 %mul = mul nsw i32 %0, %1 store i32 %mul, ptr %.capture_expr., align 4 %2 = load i32, ptr %.capture_expr., align 4 %sub = sub nsw i32 %2, 0 %div = sdiv i32 %sub, 1 %sub2 = sub nsw i32 %div, 1 store i32 %sub2, ptr %.capture_expr.1, align 4 store i32 0, ptr %i, align 4 %3 = load i32, ptr %.capture_expr., align 4 %cmp = icmp slt i32 0, %3 br i1 %cmp, label %omp.precond.then, label %omp.precond.end omp.precond.then: ; preds = %entry store i32 0, ptr %.omp.lb, align 4 %4 = load i32, ptr %.capture_expr.1, align 4 store i32 %4, ptr %.omp.ub, align 4 %5 = load i64, ptr %.previous.lb..addr, align 8 %conv = trunc i64 %5 to i32 %6 = load i64, ptr %.previous.ub..addr, align 8 %conv3 = trunc i64 %6 to i32 store i32 %conv, ptr %.omp.lb, align 4 store i32 %conv3, ptr %.omp.ub, align 4 store i32 1, ptr %.omp.stride, align 4 store i32 0, ptr %.omp.is_last, align 4 %7 = load ptr, ptr %.global_tid..addr, align 8 %8 = load i32, ptr %7, align 4 call void @__kmpc_for_static_init_4(ptr @2, i32 %8, i32 34, ptr %.omp.is_last, ptr %.omp.lb, ptr %.omp.ub, ptr %.omp.stride, i32 1, i32 1) %9 = load i32, ptr %.omp.ub, align 4 %10 = load i32, ptr %.capture_expr.1, align 4 %cmp5 = icmp sgt i32 %9, %10 br i1 %cmp5, label %cond.true, label %cond.false cond.true: ; preds = %omp.precond.then %11 = load i32, ptr %.capture_expr.1, align 4 br label %cond.end cond.false: ; preds = %omp.precond.then %12 = load i32, ptr %.omp.ub, align 4 br label %cond.end cond.end: ; preds = %cond.false, %cond.true %cond = phi i32 [ %11, %cond.true ], [ %12, %cond.false ] store i32 %cond, ptr %.omp.ub, align 4 %13 = load i32, ptr %.omp.lb, align 4 store i32 %13, ptr %.omp.iv, align 4 br label %omp.inner.for.cond omp.inner.for.cond: ; preds = %omp.inner.for.inc, %cond.end %14 = load i32, ptr %.omp.iv, align 4 %15 = load i32, ptr %.omp.ub, align 4 %cmp7 = icmp sle i32 %14, %15 br i1 %cmp7, label %omp.inner.for.body, label %omp.inner.for.end omp.inner.for.body: ; preds = %omp.inner.for.cond %16 = load i32, ptr %.omp.iv, align 4 %mul9 = mul nsw i32 %16, 1 %add = add nsw i32 0, %mul9 store i32 %add, ptr %i4, align 4 %17 = load i32, ptr %Teams.addr, align 4 %cmp10 = icmp eq i32 %17, 10 br i1 %cmp10, label %if.then, label %if.else if.then: ; preds = %omp.inner.for.body br label %if.end if.else: ; preds = %omp.inner.for.body call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 13, ptr noundef @__PRETTY_FUNCTION__.__omp_offloading_10302_adc9471_main_l10.omp_outlined.omp_outlined) #3 unreachable if.end: ; preds = %if.then br label %omp.body.continue omp.body.continue: ; preds = %if.end br label %omp.inner.for.inc omp.inner.for.inc: ; preds = %omp.body.continue %18 = load i32, ptr %.omp.iv, align 4 %add12 = add nsw i32 %18, 1 store i32 %add12, ptr %.omp.iv, align 4 br label %omp.inner.for.cond omp.inner.for.end: ; preds = %omp.inner.for.cond br label %omp.loop.exit omp.loop.exit: ; preds = %omp.inner.for.end %19 = load ptr, ptr %.global_tid..addr, align 8 %20 = load i32, ptr %19, align 4 call void @__kmpc_for_static_fini(ptr @2, i32 %20) br label %omp.precond.end omp.precond.end: ; preds = %omp.loop.exit, %entry ret void } ; Function Attrs: convergent noreturn nounwind declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2 ; Function Attrs: nounwind declare void @__kmpc_for_static_fini(ptr, i32) #1 ; Function Attrs: nounwind declare !callback !8 void @__kmpc_fork_call(ptr, i32, ptr, ...) #1 ; Function Attrs: nounwind declare i32 @__kmpc_global_thread_num(ptr) #1 ; Function Attrs: nounwind declare void @__kmpc_push_num_teams(ptr, i32, i32, i32) #1 ; Function Attrs: nounwind declare !callback !8 void @__kmpc_fork_teams(ptr, i32, ptr, ...) #1 attributes #0 = { convergent noinline norecurse nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nounwind } attributes #2 = { convergent noreturn nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { convergent noreturn nounwind } !omp_offload.info = !{!0} !llvm.module.flags = !{!1, !2, !3, !4, !5, !6} !llvm.ident = !{!7} !0 = !{i32 0, i32 66306, i32 182228081, !"main", i32 10, i32 0, i32 0} !1 = !{i32 1, !"wchar_size", i32 4} !2 = !{i32 7, !"openmp", i32 51} !3 = !{i32 7, !"openmp-device", i32 51} !4 = !{i32 8, !"PIC Level", i32 2} !5 = !{i32 7, !"uwtable", i32 2} !6 = !{i32 7, !"frame-pointer", i32 2} !7 = !{!"clang version 19.0.0git"} !8 = !{!9} !9 = !{i64 2, i64 -1, i64 -1, i1 true}
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