Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plug point for treating arguments as locals #315

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

frabert
Copy link
Collaborator

@frabert frabert commented Jan 4, 2023

Also additional method for changing variable type for allocas

@github-actions
Copy link

github-actions bot commented Jan 4, 2023

See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/3836932737

fizzbuzz.bc

--- /dev/fd/63	2023-01-04 09:58:05.445872322 +0000
+++ /dev/fd/62	2023-01-04 09:58:05.445872322 +0000
@@ -11,15 +11,14 @@
     var1 = 0U;
     while ((int)var1 < 30)
         {
-            if ((int)var1 % 3 != 0U || !((int)var1 % 5 == 0U || (int)var1 % 3 != 0U)) {
-                if ((int)var1 % 3 != 0U && ((int)var1 % 3 != 0U || (int)var1 % 5 != 0U)) {
+            if (!((int)var1 % 3 != 0U || (int)var1 % 5 == 0U) || (int)var1 % 3 != 0U) {
+                if ((int)var1 % 3 != 0U) {
                     if ((int)var1 % 5 != 0U) {
                         printf("%d\n", var1);
                     } else {
                         printf("buzz\n");
                     }
-                }
-                if ((int)var1 % 3 == 0U && ((int)var1 % 3 != 0U || (int)var1 % 5 != 0U)) {
+                } else {
                     printf("fizz\n");
                 }
             } else {

typedefs_of_typedefs.bc

switch_loop.bc

func_cond_zero_arg.bc

fcmp.bc

conflicting_names.bc

struct.bc

issue_183_literal_structs.bc

zeroinit.bc

struct_swap.bc

init_list.bc

ret0.bc

bool.bc

bitops.bc

cast.bc

nullptr.bc

conflicting_global.bc

array_swap.bc

bitmask.bc

binops.bc

float.bc

reg_test_structure_fields.bc

vectors.bc

funcptr.bc

goto_loop.bc

short.bc

trunc.bc

inttoptr.bc

issue_4.bc

issue_127_uint128_t_lit.bc

issue_123_uint128_t.bc

fizzbuzz_stateful.bc

issue_94_strncmp.bc

nested_struct.bc

global_using_function_decl.bc

byval_struct.bc

nested_while.bc

func_cond_two_arg.bc

zext.bc

assert.bc

loop.bc

switch.bc

branch.bc

template_parameter_pack.bc

byval_tail_nogep.ll

byval_tail_gep.ll

@frabert frabert marked this pull request as draft January 23, 2023 15:00
@github-actions
Copy link

See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/3987629702

fizzbuzz.bc

typedefs_of_typedefs.bc

switch_loop.bc

func_cond_zero_arg.bc

fcmp.bc

conflicting_names.bc

struct.bc

issue_183_literal_structs.bc

zeroinit.bc

global_using_function_decl.bc

init_list.bc

ret0.bc

goto_loop.bc

bool.bc

bitops.bc

cast.bc

nullptr.bc

conflicting_global.bc

array_swap.bc

bitmask.bc

binops.bc

float.bc

reg_test_structure_fields.bc

vectors.bc

funcptr.bc

struct_swap.bc

short.bc

trunc.bc

inttoptr.bc

issue_4.bc

issue_127_uint128_t_lit.bc

issue_123_uint128_t.bc

fizzbuzz_stateful.bc

issue_94_strncmp.bc

nested_struct.bc

zext.bc

byval_struct.bc

nested_while.bc

--- /dev/fd/63	2023-01-23 15:07:11.963468951 +0000
+++ /dev/fd/62	2023-01-23 15:07:11.963468951 +0000
@@ -25,7 +25,7 @@
                 printf("loop2 x: %d\n", var1);
             }
     }
-    if (((int)var1 >= 20 || (int)var1 <= 10) && (int)var1 >= 20) {
+    if ((int)var1 >= 20 && ((int)var1 >= 20 || (int)var1 <= 10)) {
         return var0;
     }
 }

func_cond_two_arg.bc

assert.bc

loop.bc

switch.bc

branch.bc

template_parameter_pack.bc

byval_tail_gep.ll

byval_tail_nogep.ll

@github-actions
Copy link

See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/4007072893

fizzbuzz.bc

typedefs_of_typedefs.bc

switch_loop.bc

func_cond_zero_arg.bc

fcmp.bc

conflicting_names.bc

struct.bc

issue_183_literal_structs.bc

zeroinit.bc

global_using_function_decl.bc

init_list.bc

ret0.bc

goto_loop.bc

bool.bc

bitops.bc

cast.bc

nullptr.bc

conflicting_global.bc

array_swap.bc

bitmask.bc

binops.bc

float.bc

reg_test_structure_fields.bc

vectors.bc

funcptr.bc

struct_swap.bc

short.bc

trunc.bc

inttoptr.bc

issue_4.bc

issue_127_uint128_t_lit.bc

issue_123_uint128_t.bc

fizzbuzz_stateful.bc

issue_94_strncmp.bc

nested_struct.bc

zext.bc

byval_struct.bc

nested_while.bc

func_cond_two_arg.bc

assert.bc

loop.bc

switch.bc

branch.bc

template_parameter_pack.bc

byval_tail_gep.ll

byval_tail_nogep.ll

@github-actions
Copy link

See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/4015340181

fizzbuzz.bc

typedefs_of_typedefs.bc

switch_loop.bc

func_cond_zero_arg.bc

fcmp.bc

conflicting_names.bc

struct.bc

issue_183_literal_structs.bc

zeroinit.bc

global_using_function_decl.bc

init_list.bc

ret0.bc

goto_loop.bc

bool.bc

bitops.bc

cast.bc

nullptr.bc

conflicting_global.bc

array_swap.bc

bitmask.bc

binops.bc

float.bc

reg_test_structure_fields.bc

vectors.bc

funcptr.bc

struct_swap.bc

short.bc

trunc.bc

inttoptr.bc

issue_4.bc

issue_127_uint128_t_lit.bc

issue_123_uint128_t.bc

fizzbuzz_stateful.bc

issue_94_strncmp.bc

nested_struct.bc

zext.bc

byval_struct.bc

nested_while.bc

--- /dev/fd/63	2023-01-26 13:04:54.503194856 +0000
+++ /dev/fd/62	2023-01-26 13:04:54.503194856 +0000
@@ -25,7 +25,7 @@
                 printf("loop2 x: %d\n", var1);
             }
     }
-    if (((int)var1 >= 20 || (int)var1 <= 10) && (int)var1 >= 20) {
+    if ((int)var1 >= 20 && ((int)var1 >= 20 || (int)var1 <= 10)) {
         return var0;
     }
 }

func_cond_two_arg.bc

assert.bc

loop.bc

switch.bc

branch.bc

template_parameter_pack.bc

byval_tail_gep.ll

byval_tail_nogep.ll

@github-actions
Copy link

See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/4015452164

fizzbuzz.bc

typedefs_of_typedefs.bc

switch_loop.bc

func_cond_zero_arg.bc

fcmp.bc

conflicting_names.bc

struct.bc

issue_183_literal_structs.bc

zeroinit.bc

global_using_function_decl.bc

init_list.bc

ret0.bc

goto_loop.bc

bool.bc

bitops.bc

cast.bc

nullptr.bc

conflicting_global.bc

array_swap.bc

bitmask.bc

binops.bc

float.bc

reg_test_structure_fields.bc

vectors.bc

funcptr.bc

struct_swap.bc

short.bc

trunc.bc

inttoptr.bc

issue_4.bc

issue_127_uint128_t_lit.bc

issue_123_uint128_t.bc

fizzbuzz_stateful.bc

issue_94_strncmp.bc

nested_struct.bc

zext.bc

byval_struct.bc

nested_while.bc

func_cond_two_arg.bc

assert.bc

loop.bc

switch.bc

branch.bc

template_parameter_pack.bc

byval_tail_gep.ll

byval_tail_nogep.ll

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/4105996780

fizzbuzz.bc

typedefs_of_typedefs.bc

switch_loop.bc

func_cond_zero_arg.bc

fcmp.bc

conflicting_names.bc

struct.bc

issue_183_literal_structs.bc

zeroinit.bc

global_using_function_decl.bc

init_list.bc

ret0.bc

goto_loop.bc

bool.bc

bitops.bc

cast.bc

nullptr.bc

conflicting_global.bc

array_swap.bc

bitmask.bc

binops.bc

float.bc

reg_test_structure_fields.bc

vectors.bc

funcptr.bc

struct_swap.bc

short.bc

trunc.bc

inttoptr.bc

issue_4.bc

issue_127_uint128_t_lit.bc

issue_123_uint128_t.bc

fizzbuzz_stateful.bc

issue_94_strncmp.bc

nested_struct.bc

zext.bc

byval_struct.bc

nested_while.bc

--- /dev/fd/63	2023-02-06 17:11:06.315041757 +0000
+++ /dev/fd/62	2023-02-06 17:11:06.315041757 +0000
@@ -25,7 +25,7 @@
                 printf("loop2 x: %d\n", var1);
             }
     }
-    if ((int)var1 >= 20 && ((int)var1 >= 20 || (int)var1 <= 10)) {
+    if (((int)var1 >= 20 || (int)var1 <= 10) && (int)var1 >= 20) {
         return var0;
     }
 }

func_cond_two_arg.bc

assert.bc

loop.bc

switch.bc

branch.bc

template_parameter_pack.bc

byval_tail_gep.ll

byval_tail_nogep.ll

@github-actions
Copy link

See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/4244868052

fizzbuzz.bc

typedefs_of_typedefs.bc

switch_loop.bc

func_cond_zero_arg.bc

conflicting_names.bc

struct.bc

issue_183_literal_structs.bc

struct_swap.bc

short.bc

init_list.bc

ret0.bc

goto_loop.bc

bool.bc

bitops.bc

cast.bc

nullptr.bc

nested_struct.bc

array_swap.bc

bitmask.bc

binops.bc

float.bc

reg_test_structure_fields.bc

zeroinit.bc

conflicting_global.bc

inttoptr.bc

branch.bc

funcptr.bc

trunc.bc

vectors.bc

issue_4.bc

issue_127_uint128_t_lit.bc

issue_123_uint128_t.bc

fizzbuzz_stateful.bc

issue_94_strncmp.bc

global_using_function_decl.bc

fcmp.bc

byval_struct.bc

nested_while.bc

func_cond_two_arg.bc

zext.bc

assert.bc

loop.bc

switch.bc

template_parameter_pack.bc

byval_tail_nogep.ll

byval_tail_gep.ll

* use zero for undef floats

* fix format
@github-actions
Copy link

github-actions bot commented Jul 6, 2023

See the diff generated by this PR for the tests here: https://github.com/lifting-bits/rellic/actions/runs/5475823810

fizzbuzz.bc

typedefs_of_typedefs.bc

switch_loop.bc

func_cond_zero_arg.bc

fcmp.bc

conflicting_names.bc

struct.bc

issue_183_literal_structs.bc

init_list.bc

ret0.bc

goto_loop.bc

bool.bc

short.bc

cast.bc

nullptr.bc

conflicting_global.bc

array_swap.bc

bitmask.bc

binops.bc

float.bc

reg_test_structure_fields.bc

nested_while.bc

zeroinit.bc

funcptr.bc

struct_swap.bc

branch.bc

vectors.bc

bitops.bc

trunc.bc

inttoptr.bc

issue_4.bc

issue_127_uint128_t_lit.bc

issue_123_uint128_t.bc

fizzbuzz_stateful.bc

issue_94_strncmp.bc

nested_struct.bc

global_using_function_decl.bc

byval_struct.bc

func_cond_two_arg.bc

zext.bc

assert.bc

loop.bc

switch.bc

template_parameter_pack.bc

byval_tail_nogep.ll

byval_tail_gep.ll

2over12 and others added 2 commits October 6, 2023 17:51
* llvm 17 fixes

* Update CI

---------

Co-authored-by: Francesco Bertolaccini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants