ssa

Is my construction of SSA correct? (Renaming)

 ̄綄美尐妖づ 提交于 2020-08-10 18:55:54
问题 I've been learning about ssa (static single assignment form), and I was given the following graph with phi functions inserted, but the graph hasn't been renamed: I had to rename the variables, and this is what I got: I am very unsure that this is correct. Did I rename the variables correctly? Is this minimal ssa? I am using this algorithm from here (Cytron, et. al's paper) to rename the variables. Please help! :) 回答1: No, your graph is not correct. The phi-functions and renaming for x and y

Is my construction of SSA correct? (Renaming)

吃可爱长大的小学妹 提交于 2020-08-10 18:54:52
问题 I've been learning about ssa (static single assignment form), and I was given the following graph with phi functions inserted, but the graph hasn't been renamed: I had to rename the variables, and this is what I got: I am very unsure that this is correct. Did I rename the variables correctly? Is this minimal ssa? I am using this algorithm from here (Cytron, et. al's paper) to rename the variables. Please help! :) 回答1: No, your graph is not correct. The phi-functions and renaming for x and y

LLVM opt mem2reg has no effect

走远了吗. 提交于 2019-12-05 00:51:51
问题 I am currently playing around with LLVM and am trying to write a few optimizers to familiarize myself with opt and clang. I wrote a test.c file that is as follow: int foo(int aa, int bb, int cc){ int sum = aa + bb; return sum/cc; } I compiled the source code and generated 2 .ll files, one unoptimized and one with mem2reg optimizer pass: clang -emit-llvm -O0 -c test.c -o test.bc llvm-dis test.bc opt -mem2reg -S test.ll -o test-mem2reg.ll Both .ll files gave me the following output: ModuleID =

LLVM opt mem2reg has no effect

余生长醉 提交于 2019-12-03 19:32:49
I am currently playing around with LLVM and am trying to write a few optimizers to familiarize myself with opt and clang. I wrote a test.c file that is as follow: int foo(int aa, int bb, int cc){ int sum = aa + bb; return sum/cc; } I compiled the source code and generated 2 .ll files, one unoptimized and one with mem2reg optimizer pass: clang -emit-llvm -O0 -c test.c -o test.bc llvm-dis test.bc opt -mem2reg -S test.ll -o test-mem2reg.ll Both .ll files gave me the following output: ModuleID = 'test.bc' source_filename = "test.c" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target