From 4059d22315da8fa31fafafb59a78ba28b3225fe8 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 17 Jan 2022 17:08:28 +0100 Subject: [PATCH] Remove unnecessary load in LLVM statement lowering. Added more tests from Clang. --- src/compiler/llvm_codegen_stmt.c | 3 +- .../bitstruct/bitstruct_access_signed.c3t | 67 ++++--- .../bitstruct/bitstruct_intcontainer.c3t | 73 ++++---- test/test_suite/clang/2002-03.c3t | 7 +- test/test_suite/clang/2002-04.c3t | 174 ++++++++++++++++++ test/test_suite/errors/rethrow.c3t | 39 ++-- test/test_suite/errors/rethrow_mingw.c3t | 1 - .../from_docs/examples_if_catch.c3t | 4 +- test/test_suite/macros/macro_common.c3t | 14 +- test/test_suite/struct/struct_codegen_fam.c3t | 1 - 10 files changed, 280 insertions(+), 103 deletions(-) create mode 100644 test/test_suite/clang/2002-04.c3t diff --git a/src/compiler/llvm_codegen_stmt.c b/src/compiler/llvm_codegen_stmt.c index d1eb1e828..cdb329374 100644 --- a/src/compiler/llvm_codegen_stmt.c +++ b/src/compiler/llvm_codegen_stmt.c @@ -1052,7 +1052,7 @@ void gencontext_emit_expr_stmt(GenContext *c, Ast *ast) c->catch_block = discard_fail; c->error_var = NULL; llvm_emit_expr(c, &value, ast->expr_stmt); - llvm_value_rvalue(c, &value); + llvm_value_fold_failable(c, &value); EMIT_LOC(c, ast); llvm_emit_br(c, discard_fail); llvm_emit_block(c, discard_fail); @@ -1060,7 +1060,6 @@ void gencontext_emit_expr_stmt(GenContext *c, Ast *ast) return; } llvm_emit_expr(c, &value, ast->expr_stmt); - llvm_value_rvalue(c, &value); } static LLVMValueRef llvm_emit_string(GenContext *c, const char *str) diff --git a/test/test_suite/bitstruct/bitstruct_access_signed.c3t b/test/test_suite/bitstruct/bitstruct_access_signed.c3t index 0b7a7f054..ab0e162d5 100644 --- a/test/test_suite/bitstruct/bitstruct_access_signed.c3t +++ b/test/test_suite/bitstruct/bitstruct_access_signed.c3t @@ -53,40 +53,39 @@ entry: %15 = ashr i32 %14, 14 call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %15) store [3 x i8] c"\FF\FD\FF", [3 x i8]* %xx, align 1 - %16 = load [3 x i8], [3 x i8]* %xx, align 1 - %17 = getelementptr inbounds [3 x i8], [3 x i8]* %xx, i64 0, i64 0 - %18 = load i8, i8* %17, align 1 - %19 = zext i8 %18 to i32 - %20 = lshr i32 %19, 5 - %21 = getelementptr inbounds [3 x i8], [3 x i8]* %xx, i64 0, i64 1 - %22 = load i8, i8* %21, align 1 - %23 = zext i8 %22 to i32 - %24 = shl i32 %23, 3 - %25 = or i32 %24, %20 - %26 = getelementptr inbounds [3 x i8], [3 x i8]* %xx, i64 0, i64 2 - %27 = load i8, i8* %26, align 1 - %28 = zext i8 %27 to i32 - %29 = shl i32 %28, 11 - %30 = or i32 %29, %25 - %31 = shl i32 %30, 14 - %32 = ashr i32 %31, 14 - call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 %32) + %16 = getelementptr inbounds [3 x i8], [3 x i8]* %xx, i64 0, i64 0 + %17 = load i8, i8* %16, align 1 + %18 = zext i8 %17 to i32 + %19 = lshr i32 %18, 5 + %20 = getelementptr inbounds [3 x i8], [3 x i8]* %xx, i64 0, i64 1 + %21 = load i8, i8* %20, align 1 + %22 = zext i8 %21 to i32 + %23 = shl i32 %22, 3 + %24 = or i32 %23, %19 + %25 = getelementptr inbounds [3 x i8], [3 x i8]* %xx, i64 0, i64 2 + %26 = load i8, i8* %25, align 1 + %27 = zext i8 %26 to i32 + %28 = shl i32 %27, 11 + %29 = or i32 %28, %24 + %30 = shl i32 %29, 14 + %31 = ashr i32 %30, 14 + call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 %31) store [3 x i8] c"\1F\CF\AA", [3 x i8]* %xxu, align 1 - %33 = getelementptr inbounds [3 x i8], [3 x i8]* %xxu, i64 0, i64 0 - %34 = load i8, i8* %33, align 1 - %35 = zext i8 %34 to i32 - %36 = lshr i32 %35, 5 - %37 = getelementptr inbounds [3 x i8], [3 x i8]* %xxu, i64 0, i64 1 - %38 = load i8, i8* %37, align 1 - %39 = zext i8 %38 to i32 - %40 = shl i32 %39, 3 - %41 = or i32 %40, %36 - %42 = getelementptr inbounds [3 x i8], [3 x i8]* %xxu, i64 0, i64 2 - %43 = load i8, i8* %42, align 1 - %44 = zext i8 %43 to i32 - %45 = shl i32 %44, 11 - %46 = or i32 %45, %41 - %47 = and i32 262143, %46 - call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 %47) + %32 = getelementptr inbounds [3 x i8], [3 x i8]* %xxu, i64 0, i64 0 + %33 = load i8, i8* %32, align 1 + %34 = zext i8 %33 to i32 + %35 = lshr i32 %34, 5 + %36 = getelementptr inbounds [3 x i8], [3 x i8]* %xxu, i64 0, i64 1 + %37 = load i8, i8* %36, align 1 + %38 = zext i8 %37 to i32 + %39 = shl i32 %38, 3 + %40 = or i32 %39, %35 + %41 = getelementptr inbounds [3 x i8], [3 x i8]* %xxu, i64 0, i64 2 + %42 = load i8, i8* %41, align 1 + %43 = zext i8 %42 to i32 + %44 = shl i32 %43, 11 + %45 = or i32 %44, %40 + %46 = and i32 262143, %45 + call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 %46) ret void } diff --git a/test/test_suite/bitstruct/bitstruct_intcontainer.c3t b/test/test_suite/bitstruct/bitstruct_intcontainer.c3t index 99eacab4a..8ae876433 100644 --- a/test/test_suite/bitstruct/bitstruct_intcontainer.c3t +++ b/test/test_suite/bitstruct/bitstruct_intcontainer.c3t @@ -62,45 +62,44 @@ entry: call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %2) store i32 1073741375, i32* %xx, align 4 %3 = load i32, i32* %xx, align 4 - %4 = load i32, i32* %xx, align 4 - %5 = shl i32 %4, 9 - %6 = ashr i32 %5, 14 - call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 %6) + %4 = shl i32 %3, 9 + %5 = ashr i32 %4, 14 + call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i32 %5) store i32 -3485921, i32* %xxu, align 4 - %7 = load i32, i32* %xxu, align 4 - %8 = lshr i32 %7, 5 - %9 = and i32 262143, %8 - call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 %9) + %6 = load i32, i32* %xxu, align 4 + %7 = lshr i32 %6, 5 + %8 = and i32 262143, %7 + call void (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 %8) store i64 1525363991714123551, i64* %xxy, align 8 - %10 = load i64, i64* %xxy, align 8 - %11 = lshr i64 %10, 5 - %12 = and i64 262143, %11 - %13 = trunc i64 %12 to i32 - %14 = load i64, i64* %xxy, align 8 - %15 = lshr i64 %14, 23 - %16 = and i64 262143, %15 - %17 = trunc i64 %16 to i32 - %18 = load i64, i64* %xxy, align 8 - %19 = lshr i64 %18, 41 - %20 = and i64 2097151, %19 - %21 = trunc i64 %20 to i32 - call void (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i32 0, i32 0), i32 %13, i32 %17, i32 %21) + %9 = load i64, i64* %xxy, align 8 + %10 = lshr i64 %9, 5 + %11 = and i64 262143, %10 + %12 = trunc i64 %11 to i32 + %13 = load i64, i64* %xxy, align 8 + %14 = lshr i64 %13, 23 + %15 = and i64 262143, %14 + %16 = trunc i64 %15 to i32 + %17 = load i64, i64* %xxy, align 8 + %18 = lshr i64 %17, 41 + %19 = and i64 2097151, %18 + %20 = trunc i64 %19 to i32 + call void (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i32 0, i32 0), i32 %12, i32 %16, i32 %20) store i64 2292133196431502101, i64* %xxybe, align 8 - %22 = load i64, i64* %xxybe, align 8 - %23 = call i64 @llvm.bswap.i64(i64 %22) - %24 = lshr i64 %23, 5 - %25 = and i64 262143, %24 - %26 = trunc i64 %25 to i32 - %27 = load i64, i64* %xxybe, align 8 - %28 = call i64 @llvm.bswap.i64(i64 %27) - %29 = lshr i64 %28, 23 - %30 = and i64 262143, %29 - %31 = trunc i64 %30 to i32 - %32 = load i64, i64* %xxybe, align 8 - %33 = call i64 @llvm.bswap.i64(i64 %32) - %34 = lshr i64 %33, 41 - %35 = and i64 2097151, %34 - %36 = trunc i64 %35 to i32 - call void (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i32 0, i32 0), i32 %26, i32 %31, i32 %36) + %21 = load i64, i64* %xxybe, align 8 + %22 = call i64 @llvm.bswap.i64(i64 %21) + %23 = lshr i64 %22, 5 + %24 = and i64 262143, %23 + %25 = trunc i64 %24 to i32 + %26 = load i64, i64* %xxybe, align 8 + %27 = call i64 @llvm.bswap.i64(i64 %26) + %28 = lshr i64 %27, 23 + %29 = and i64 262143, %28 + %30 = trunc i64 %29 to i32 + %31 = load i64, i64* %xxybe, align 8 + %32 = call i64 @llvm.bswap.i64(i64 %31) + %33 = lshr i64 %32, 41 + %34 = and i64 2097151, %33 + %35 = trunc i64 %34 to i32 + call void (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i32 0, i32 0), i32 %25, i32 %30, i32 %35) ret void } \ No newline at end of file diff --git a/test/test_suite/clang/2002-03.c3t b/test/test_suite/clang/2002-03.c3t index ecf8fbc31..951347612 100644 --- a/test/test_suite/clang/2002-03.c3t +++ b/test/test_suite/clang/2002-03.c3t @@ -47,6 +47,10 @@ fn int trys(char *s, int x) return asa+(int)(val); } +fn char* foo() { + return "*** Word \"%s\" on line %d is not"; +} + /* #expect: test.ll @test.a = local_unnamed_addr global { i32, i32, [8 x i32] } { i32 0, i32 2, [8 x i32] zeroinitializer }, align 16 @@ -57,6 +61,7 @@ fn int trys(char *s, int x) @test.b = local_unnamed_addr global { [4 x i32], { i32, i32, i32, i32 }, { i32, i32, [2 x i32] }, [4 x i32] } { [4 x i32] [i32 1, i32 2, i32 3, i32 4], { i32, i32, i32, i32 } { i32 5, i32 6, i32 7, i32 0 }, { i32, i32, [2 x i32] } { i32 8, i32 9, [2 x i32] zeroinitializer }, [4 x i32] zeroinitializer }, align 16 @test.link = local_unnamed_addr global [3 x %Connection] [%Connection { i64 1, [10 x i8] c"link1\00\00\00\00\00", i64 10 }, %Connection { i64 2, [10 x i8] c"link2\00\00\00\00\00", i64 20 }, %Connection { i64 3, [10 x i8] c"link3\00\00\00\00\00", i64 30 }], align 16 @.str = private unnamed_addr constant [4 x i8] c"\1F\C2\8B\00", align 1 +@.str.7 = private unnamed_addr constant [32 x i8] c"*** Word \22%s\22 on line %d is not\00", align 1 declare i32 @test.strcmp(i8*, i8*) #0 @@ -90,4 +95,4 @@ if.exit: ; preds = %if.then, %entry %fpsi = fptosi double %5 to i32 %add1 = add i32 %4, %fpsi ret i32 %add1 -} \ No newline at end of file +} diff --git a/test/test_suite/clang/2002-04.c3t b/test/test_suite/clang/2002-04.c3t new file mode 100644 index 000000000..039337bb6 --- /dev/null +++ b/test/test_suite/clang/2002-04.c3t @@ -0,0 +1,174 @@ +// #target: x64-darwin +module test; +extern fn int printf(char *, ...); +extern fn int foo(); + +fn int main2() { + while (foo()) { + switch (foo()) { + case 0: + case 1: + case 2: + case 3: + printf("3"); + nextcase; + case 4: printf("4"); nextcase; + case 5: + case 6: + default: + } + } + return 0; +} + +fn double test(uint x) +{ + double[30] student_t={0.0 , 12.706 , 4.303 , 3.182 , 2.776 , 2.571 , + 2.447 , 2.365 , 2.306 , 2.262 , 2.228 , + 2.201 , 2.179 , 2.160 , 2.145 , 2.131 , + 2.120 , 2.110 , 2.101 , 2.093 , 2.086 , + 2.080 , 2.074 , 2.069 , 2.064 , 2.060 , + 2.056 , 2.052 , 2.048 , 2.045 }; + return student_t[x]; +} + +struct St { + int i; + short s1, s2; +} + +extern fn St func_returning_struct(); + +fn void loop(void) { + func_returning_struct(); +} + +struct FooSt { + char p; + short q; + char r; + int x; + short y, z; + int q2; +} + +extern fn int testF(FooSt x, float); +extern fn int testE(char,short,char,int,int,float); +fn void test3(FooSt *x) { + x.q = 1; +} + +fn void test2(FooSt y) { + testE(y.p, y.q, y.r, y.x, y.y, 0.1f); + testF(y, 0.1f); + test2(y); + test3(&y); +} + +/* #expect: test.ll + + +define i32 @test.main2() #0 { +entry: + %switch = alloca i32, align 4 + br label %loop.cond + +loop.cond: ; preds = %switch.exit, %entry + %0 = call i32 @foo() + %intbool = icmp ne i32 %0, 0 + br i1 %intbool, label %loop.body, label %loop.exit + +loop.body: ; preds = %loop.cond + %1 = call i32 @foo() + store i32 %1, i32* %switch, align 4 + br label %switch.entry + +switch.entry: ; preds = %loop.body + %2 = load i32, i32* %switch, align 4 + switch i32 %2, label %switch.exit [ + i32 0, label %switch.case + i32 1, label %switch.case + i32 2, label %switch.case + i32 3, label %switch.case + i32 4, label %switch.case1 + i32 5, label %switch.exit + i32 6, label %switch.exit + ] + +switch.case: ; preds = %switch.entry, %switch.entry, %switch.entry, %switch.entry + %3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0)) + br label %switch.case1 + +switch.case1: ; preds = %switch.entry, %switch.case + %4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0)) + br label %switch.exit + +switch.exit: ; preds = %switch.entry, %switch.entry, %switch.case1, %switch.entry + br label %loop.cond + +loop.exit: ; preds = %loop.cond + ret i32 0 +} + +define double @test.test(i32 %0) #0 { +entry: + %student_t = alloca [30 x double], align 16 + %1 = bitcast [30 x double]* %student_t to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 16 %1, i8* align 16 bitcast ([30 x double]* @.__const to i8*), i32 240, i1 false) + %uiuiext = zext i32 %0 to i64 + %2 = getelementptr inbounds [30 x double], [30 x double]* %student_t, i64 0, i64 %uiuiext + %3 = load double, double* %2, align 8 + ret double %3 +} + +define void @test.loop() #0 { +entry: + %result = alloca %St, align 4 + %0 = call i64 @func_returning_struct() + %1 = bitcast %St* %result to i64* + store i64 %0, i64* %1, align 4 + ret void +} + +declare i32 @testF(%FooSt* byval(%FooSt) align 8, float) #0 + +declare i32 @testE(i8 zeroext, i16 signext, i8 zeroext, i32, i32, float) #0 + +define void @test.test3(%FooSt* %0) #0 { +entry: + %1 = getelementptr inbounds %FooSt, %FooSt* %0, i32 0, i32 1 + store i16 1, i16* %1, align 2 + ret void +} + +define void @test.test2(%FooSt* byval(%FooSt) align 8 %0) #0 { +entry: + %y = alloca %FooSt, align 4 + %indirectarg = alloca %FooSt, align 8 + %indirectarg1 = alloca %FooSt, align 8 + %1 = bitcast %FooSt* %y to i8* + %2 = bitcast %FooSt* %0 to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %1, i8* align 8 %2, i32 20, i1 false) + %3 = getelementptr inbounds %FooSt, %FooSt* %y, i32 0, i32 0 + %4 = load i8, i8* %3, align 4 + %5 = getelementptr inbounds %FooSt, %FooSt* %y, i32 0, i32 1 + %6 = load i16, i16* %5, align 2 + %7 = getelementptr inbounds %FooSt, %FooSt* %y, i32 0, i32 2 + %8 = load i8, i8* %7, align 4 + %9 = getelementptr inbounds %FooSt, %FooSt* %y, i32 0, i32 3 + %10 = load i32, i32* %9, align 4 + %11 = getelementptr inbounds %FooSt, %FooSt* %y, i32 0, i32 4 + %12 = load i16, i16* %11, align 4 + %sisiext = sext i16 %12 to i32 + %13 = call i32 @testE(i8 %4, i16 %6, i8 %8, i32 %10, i32 %sisiext, float 0x3FB99999A0000000) + %14 = bitcast %FooSt* %indirectarg to i8* + %15 = bitcast %FooSt* %y to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %14, i8* align 4 %15, i32 20, i1 false) + %16 = call i32 @testF(%FooSt* byval(%FooSt) align 8 %indirectarg, float 0x3FB99999A0000000) + %17 = bitcast %FooSt* %indirectarg1 to i8* + %18 = bitcast %FooSt* %y to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %17, i8* align 4 %18, i32 20, i1 false) + call void @test.test2(%FooSt* byval(%FooSt) align 8 %indirectarg1) + call void @test.test3(%FooSt* %y) + ret void +} diff --git a/test/test_suite/errors/rethrow.c3t b/test/test_suite/errors/rethrow.c3t index d3ceb814c..402e92e19 100644 --- a/test/test_suite/errors/rethrow.c3t +++ b/test/test_suite/errors/rethrow.c3t @@ -8,27 +8,26 @@ fn void! test() // #expect: rethrow.ll - %i = alloca i32, align 4 - %i.f = alloca i64, align 8 - %error_var = alloca i64, align 8 - store i64 0, i64* %i.f, align 8 - store i32 0, i32* %i, align 4 - %0 = load i64, i64* %i.f, align 8 - %not_err = icmp eq i64 %0, 0 - br i1 %not_err, label %after_check, label %error + %i = alloca i32, align 4 + %i.f = alloca i64, align 8 + %error_var = alloca i64, align 8 + store i64 0, i64* %i.f, align 8 + store i32 0, i32* %i, align 4 + %0 = load i64, i64* %i.f, align 8 + %not_err = icmp eq i64 %0, 0 + br i1 %not_err, label %after_check, label %error - error: ; preds = %entry - store i64 %0, i64* %error_var, align 8 - br label %guard_block +error: ; preds = %entry + store i64 %0, i64* %error_var, align 8 + br label %guard_block - after_check: ; preds = %entry - br label %noerr_block +after_check: ; preds = %entry + br label %noerr_block - guard_block: ; preds = %error - %1 = load i64, i64* %error_var, align 8 - ret i64 %1 +guard_block: ; preds = %error + %1 = load i64, i64* %error_var, align 8 + ret i64 %1 - noerr_block: ; preds = %after_check - %2 = load i32, i32* %i, align 4 - ret i64 0 - } +noerr_block: ; preds = %after_check + ret i64 0 +} diff --git a/test/test_suite/errors/rethrow_mingw.c3t b/test/test_suite/errors/rethrow_mingw.c3t index 5f488430f..07fc77680 100644 --- a/test/test_suite/errors/rethrow_mingw.c3t +++ b/test/test_suite/errors/rethrow_mingw.c3t @@ -33,7 +33,6 @@ guard_block: ; preds = %error ret i64 %1 noerr_block: ; preds = %after_check - %2 = load i32, i32* %i, align 4 ret i64 0 } diff --git a/test/test_suite/from_docs/examples_if_catch.c3t b/test/test_suite/from_docs/examples_if_catch.c3t index e7d941dd3..4045ead10 100644 --- a/test/test_suite/from_docs/examples_if_catch.c3t +++ b/test/test_suite/from_docs/examples_if_catch.c3t @@ -43,7 +43,8 @@ fn void main() io::printf("Ratio was %f\n", ratio); } -// #expect: demo.ll +/* #expect: demo.ll + define i64 @demo.divide(double* %0, i32 %1, i32 %2) #0 { entry: @@ -94,7 +95,6 @@ guard_block: ; preds = %error ret i64 %3 noerr_block: ; preds = %after.errcheck - %4 = load double, double* %retparam, align 8 ret i64 0 } diff --git a/test/test_suite/macros/macro_common.c3t b/test/test_suite/macros/macro_common.c3t index 1e7bd6c58..8a2b8b836 100644 --- a/test/test_suite/macros/macro_common.c3t +++ b/test/test_suite/macros/macro_common.c3t @@ -12,7 +12,7 @@ fn void test2() @frab(0); } -// #expect: test.ll +/* #expect: test.ll define void @test.test2() #0 { entry: @@ -24,25 +24,29 @@ entry: %0 = load i32, i32* %x, align 4 %not = icmp eq i32 %0, 0 br i1 %not, label %if.then, label %if.exit + if.then: ; preds = %entry store double 0.000000e+00, double* %blockret, align 8 br label %expr_block.exit + if.exit: ; preds = %entry store double 0.000000e+00, double* %blockret, align 8 br label %expr_block.exit + expr_block.exit: ; preds = %if.exit, %if.then - %1 = load double, double* %blockret, align 8 store i32 0, i32* %x1, align 4 - %2 = load i32, i32* %x1, align 4 - %not3 = icmp eq i32 %2, 0 + %1 = load i32, i32* %x1, align 4 + %not3 = icmp eq i32 %1, 0 br i1 %not3, label %if.then4, label %if.exit5 + if.then4: ; preds = %expr_block.exit store double 0.000000e+00, double* %blockret2, align 8 br label %expr_block.exit6 + if.exit5: ; preds = %expr_block.exit store double 0.000000e+00, double* %blockret2, align 8 br label %expr_block.exit6 + expr_block.exit6: ; preds = %if.exit5, %if.then4 - %3 = load double, double* %blockret2, align 8 ret void } \ No newline at end of file diff --git a/test/test_suite/struct/struct_codegen_fam.c3t b/test/test_suite/struct/struct_codegen_fam.c3t index 6ab354811..d94446ce0 100644 --- a/test/test_suite/struct/struct_codegen_fam.c3t +++ b/test/test_suite/struct/struct_codegen_fam.c3t @@ -30,6 +30,5 @@ entry: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %1, i8* align 8 %2, i32 8, i1 false) %3 = getelementptr inbounds %Bar, %Bar* %b, i32 0, i32 2 %4 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 1 - %5 = load i32, i32* %4, align 4 ret void } \ No newline at end of file