double produce(void);
void consume(double);
static double x = 3;
double y = 4;
void myEntry(void)
{
x = produce();
consume(y);
}
; ModuleID = '/tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c'
source_filename = "/tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@y = dso_local global double 4.000000e+00, align 8
@x = internal global double 3.000000e+00, align 8
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @myEntry() #0 {
%1 = call double @produce()
store double %1, double* @x, align 8
%2 = load double, double* @y, align 8
call void @consume(double %2)
ret void
}
declare dso_local double @produce() #1
declare dso_local void @consume(double) #1
attributes #0 = { noinline nounwind optnone uwtable "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"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"Debian clang version 11.0.1-2"}
; ModuleID = '/tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c'
source_filename = "/tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@y = dso_local global double 4.000000e+00, align 8, !dbg !0
@x = internal global double 3.000000e+00, align 8, !dbg !6
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @myEntry() #0 !dbg !14 {
%1 = call double @produce(), !dbg !17
store double %1, double* @x, align 8, !dbg !18
%2 = load double, double* @y, align 8, !dbg !19
call void @consume(double %2), !dbg !20
ret void, !dbg !21
}
declare dso_local double @produce() #1
declare dso_local void @consume(double) #1
attributes #0 = { noinline nounwind optnone uwtable "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"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!10, !11, !12}
!llvm.ident = !{!13}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "y", scope: !2, file: !8, line: 4, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "Debian clang version 11.0.1-2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, splitDebugInlining: false, nameTableKind: None)
!3 = !DIFile(filename: "/tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c", directory: "/__w/semicompiled/semicompiled")
!4 = !{}
!5 = !{!0, !6}
!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!7 = distinct !DIGlobalVariable(name: "x", scope: !2, file: !8, line: 3, type: !9, isLocal: true, isDefinition: true)
!8 = !DIFile(filename: "/tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c", directory: "")
!9 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
!10 = !{i32 7, !"Dwarf Version", i32 4}
!11 = !{i32 2, !"Debug Info Version", i32 3}
!12 = !{i32 1, !"wchar_size", i32 4}
!13 = !{!"Debian clang version 11.0.1-2"}
!14 = distinct !DISubprogram(name: "myEntry", scope: !8, file: !8, line: 5, type: !15, scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
!15 = !DISubroutineType(types: !16)
!16 = !{null}
!17 = !DILocation(line: 7, column: 9, scope: !14)
!18 = !DILocation(line: 7, column: 7, scope: !14)
!19 = !DILocation(line: 8, column: 13, scope: !14)
!20 = !DILocation(line: 8, column: 5, scope: !14)
!21 = !DILocation(line: 9, column: 1, scope: !14)
(module
(type (;0;) (func))
(type (;1;) (func (param f64)))
(type (;2;) (func (result f64)))
(import "env" "produce" (func (;0;) (type 2)))
(import "env" "consume" (func (;1;) (type 1)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "__table_base" (global (;2;) i32))
(import "GOT.mem" "y" (global (;3;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(import "env" "__indirect_function_table" (table (;0;) 0 funcref))
(func (;2;) (type 0)
call 3)
(func (;3;) (type 0))
(func (;4;) (type 0)
(local i32 i32 i32 i32 f64 f64)
call 0
local.set 4
i32.const 8
local.set 0
global.get 1
local.set 1
local.get 1
local.get 0
i32.add
local.set 2
local.get 2
local.get 4
f64.store
global.get 3
local.set 3
local.get 3
f64.load
local.set 5
local.get 5
call 1
return)
(global (;4;) i32 (i32.const 0))
(global (;5;) i32 (i32.const 0))
(export "__post_instantiate" (func 2))
(export "__wasm_apply_relocs" (func 3))
(export "myEntry" (func 4))
(export "y" (global 4))
(export "__dso_handle" (global 5))
(data (;0;) (global.get 1) "\00\00\00\00\00\00\10@\00\00\00\00\00\00\08@"))
/tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.o: file format elf64-bpf
Disassembly of section .text:
0000000000000000 <myEntry>:
; myEntry():
; /tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c:7
; x = produce();
0: call -1
1: r1 = 8 ll
3: *(u64 *)(r1 + 0) = r0
; /tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c:8
; consume(y);
4: r1 = 0 ll
6: r1 = *(u64 *)(r1 + 0)
7: call -1
; /tmp/semicompiled-JYjtNyBX2HtCueYu-6856794673843132014/source.c:9
; }
8: exit
Join the thriving social scene at github.com/andrewbaxter/semicompiled.