int produce(void);
void myEntry(void)
{
int x[3] = {1, 2, 3};
int y[3] = {4, 5, 6};
if (produce())
{
x[1] = y[2];
}
}
; ModuleID = '/tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c'
source_filename = "/tmp/semicompiled-yzgYdi5h-5140996200582647869/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"
@__const.myEntry.x = private unnamed_addr constant [3 x i32] [i32 1, i32 2, i32 3], align 4
@__const.myEntry.y = private unnamed_addr constant [3 x i32] [i32 4, i32 5, i32 6], align 4
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @myEntry() #0 {
%1 = alloca [3 x i32], align 4
%2 = alloca [3 x i32], align 4
%3 = bitcast [3 x i32]* %1 to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %3, i8* align 4 bitcast ([3 x i32]* @__const.myEntry.x to i8*), i64 12, i1 false)
%4 = bitcast [3 x i32]* %2 to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %4, i8* align 4 bitcast ([3 x i32]* @__const.myEntry.y to i8*), i64 12, i1 false)
%5 = call i32 @produce()
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%9 = load i32, i32* %8, align 4
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
store i32 %9, i32* %10, align 4
br label %11
11: ; preds = %7, %0
ret void
}
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1
declare dso_local i32 @produce() #2
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 = { argmemonly nounwind willreturn }
attributes #2 = { "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-yzgYdi5h-5140996200582647869/source.c'
source_filename = "/tmp/semicompiled-yzgYdi5h-5140996200582647869/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"
@__const.myEntry.x = private unnamed_addr constant [3 x i32] [i32 1, i32 2, i32 3], align 4
@__const.myEntry.y = private unnamed_addr constant [3 x i32] [i32 4, i32 5, i32 6], align 4
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @myEntry() #0 !dbg !7 {
%1 = alloca [3 x i32], align 4
%2 = alloca [3 x i32], align 4
call void @llvm.dbg.declare(metadata [3 x i32]* %1, metadata !11, metadata !DIExpression()), !dbg !16
%3 = bitcast [3 x i32]* %1 to i8*, !dbg !16
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %3, i8* align 4 bitcast ([3 x i32]* @__const.myEntry.x to i8*), i64 12, i1 false), !dbg !16
call void @llvm.dbg.declare(metadata [3 x i32]* %2, metadata !17, metadata !DIExpression()), !dbg !18
%4 = bitcast [3 x i32]* %2 to i8*, !dbg !18
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %4, i8* align 4 bitcast ([3 x i32]* @__const.myEntry.y to i8*), i64 12, i1 false), !dbg !18
%5 = call i32 @produce(), !dbg !19
%6 = icmp ne i32 %5, 0, !dbg !19
br i1 %6, label %7, label %11, !dbg !21
7: ; preds = %0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2, !dbg !22
%9 = load i32, i32* %8, align 4, !dbg !22
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1, !dbg !24
store i32 %9, i32* %10, align 4, !dbg !25
br label %11, !dbg !26
11: ; preds = %7, %0
ret void, !dbg !27
}
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #2
declare dso_local i32 @produce() #3
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 = { nounwind readnone speculatable willreturn }
attributes #2 = { argmemonly nounwind willreturn }
attributes #3 = { "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 = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "Debian clang version 11.0.1-2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
!1 = !DIFile(filename: "/tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c", directory: "/__w/semicompiled/semicompiled")
!2 = !{}
!3 = !{i32 7, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{!"Debian clang version 11.0.1-2"}
!7 = distinct !DISubprogram(name: "myEntry", scope: !8, file: !8, line: 2, type: !9, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
!8 = !DIFile(filename: "/tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c", directory: "")
!9 = !DISubroutineType(types: !10)
!10 = !{null}
!11 = !DILocalVariable(name: "x", scope: !7, file: !8, line: 4, type: !12)
!12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 96, elements: !14)
!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!14 = !{!15}
!15 = !DISubrange(count: 3)
!16 = !DILocation(line: 4, column: 9, scope: !7)
!17 = !DILocalVariable(name: "y", scope: !7, file: !8, line: 5, type: !12)
!18 = !DILocation(line: 5, column: 9, scope: !7)
!19 = !DILocation(line: 6, column: 9, scope: !20)
!20 = distinct !DILexicalBlock(scope: !7, file: !8, line: 6, column: 9)
!21 = !DILocation(line: 6, column: 9, scope: !7)
!22 = !DILocation(line: 8, column: 16, scope: !23)
!23 = distinct !DILexicalBlock(scope: !20, file: !8, line: 7, column: 5)
!24 = !DILocation(line: 8, column: 9, scope: !23)
!25 = !DILocation(line: 8, column: 14, scope: !23)
!26 = !DILocation(line: 9, column: 5, scope: !23)
!27 = !DILocation(line: 10, column: 1, scope: !7)
(module
(type (;0;) (func))
(type (;1;) (func (result i32)))
(import "env" "produce" (func (;0;) (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 "env" "memory" (memory (;0;) 0))
(import "env" "__indirect_function_table" (table (;0;) 0 funcref))
(func (;1;) (type 0)
call 2)
(func (;2;) (type 0))
(func (;3;) (type 0)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i64 i64)
global.get 0
local.set 0
i32.const 32
local.set 1
local.get 0
local.get 1
i32.sub
local.set 2
local.get 2
global.set 0
i32.const 8
local.set 3
local.get 2
local.get 3
i32.add
local.set 4
local.get 4
local.set 5
i32.const 20
local.set 6
local.get 2
local.get 6
i32.add
local.set 7
local.get 7
local.set 8
i32.const 0
local.set 9
global.get 1
local.set 10
local.get 10
local.get 9
i32.add
local.set 11
local.get 11
i64.load align=4
local.set 27
local.get 8
local.get 27
i64.store align=4
i32.const 8
local.set 12
local.get 8
local.get 12
i32.add
local.set 13
local.get 11
local.get 12
i32.add
local.set 14
local.get 14
i32.load
local.set 15
local.get 13
local.get 15
i32.store
i32.const 12
local.set 16
global.get 1
local.set 17
local.get 17
local.get 16
i32.add
local.set 18
local.get 18
i64.load align=4
local.set 28
local.get 5
local.get 28
i64.store align=4
i32.const 8
local.set 19
local.get 5
local.get 19
i32.add
local.set 20
local.get 18
local.get 19
i32.add
local.set 21
local.get 21
i32.load
local.set 22
local.get 20
local.get 22
i32.store
call 0
local.set 23
block ;; label = @1
local.get 23
i32.eqz
br_if 0 (;@1;)
local.get 2
i32.load offset=16
local.set 24
local.get 2
local.get 24
i32.store offset=24
end
i32.const 32
local.set 25
local.get 2
local.get 25
i32.add
local.set 26
local.get 26
global.set 0
return)
(global (;3;) i32 (i32.const 0))
(export "__post_instantiate" (func 1))
(export "__wasm_apply_relocs" (func 2))
(export "myEntry" (func 3))
(export "__dso_handle" (global 3))
(data (;0;) (global.get 1) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00"))
/tmp/semicompiled-yzgYdi5h-5140996200582647869/source.o: file format elf64-bpf
Disassembly of section .text:
0000000000000000 <myEntry>:
; myEntry():
; /tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c:4
; int x[3] = {1, 2, 3};
0: r1 = 0 ll
2: r2 = *(u32 *)(r1 + 8)
3: *(u32 *)(r10 - 8) = r2
4: r2 = *(u32 *)(r1 + 0)
5: r1 = *(u32 *)(r1 + 4)
6: r1 <<= 32
7: r1 |= r2
8: *(u64 *)(r10 - 16) = r1
; /tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c:5
; int y[3] = {4, 5, 6};
9: r1 = 12 ll
11: r2 = *(u32 *)(r1 + 8)
12: *(u32 *)(r10 - 24) = r2
13: r2 = *(u32 *)(r1 + 0)
14: r1 = *(u32 *)(r1 + 4)
15: r1 <<= 32
16: r1 |= r2
17: *(u64 *)(r10 - 32) = r1
; /tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c:6
; if (produce())
18: call -1
19: r0 <<= 32
20: r0 >>= 32
21: if r0 == 0 goto +4 <LBB0_2>
22: goto +0 <LBB0_1>
00000000000000b8 <LBB0_1>:
; /tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c:8
; x[1] = y[2];
23: r1 = *(u32 *)(r10 - 24)
24: *(u32 *)(r10 - 12) = r1
; /tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c:9
; }
25: goto +0 <LBB0_2>
00000000000000d0 <LBB0_2>:
; /tmp/semicompiled-yzgYdi5h-5140996200582647869/source.c:10
; }
26: exit
Disassembly of section .rodata:
0000000000000000 <.rodata>:
0: <unknown>
1: <unknown>
2: goto +0 <.rodata+0x18>
Join the thriving social scene at github.com/andrewbaxter/semicompiled.