[llvm-dev] Generating SSA using llvm

Craig Topper via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 12 23:21:39 PDT 2021


You need to pass -Xclang -disable-O0-optnone By default clang adds an
optnone function attribute at -O0. Most passes exist immediately if they
see that attribute.

~Craig


On Mon, Apr 12, 2021 at 11:05 PM Sudakshina Dutta via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Dear all,
>
> Greetings.
> I have been trying to generate SSA form using llvm. Note that I have
> subjected the following program (prog1.c) to llvm.
>
> int fact(int b);
> int main()
> {
>     int a, b;
>     a = 6;
>     if(a > 5)
>     {
>         b = 7;
>     }
>     else
>     {
>         b = 5;
>     }
>     fact(b);
>     return 0;
> }
> Also I have executed the following commands.
> clang -S -emit-llvm prog1.c -o prog1.ll
> clang -c -emit-llvm prog1.c -o prog1.bc
> opt -mem2reg prog1.bc -o prog1.opt.bc
> llvm-dis prog1.opt.bc
>
> The last step generates prog1.opt.ll. I did not find any difference
> between prog1.ll and prog1.opt.ll other than the names of the files.
>
> Kindly help me in generating SSA using llvm.
>
> Thanks,
> Sudakshina
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210412/1e5368a4/attachment.html>


More information about the llvm-dev mailing list