Alec Taylor | 30 Jun 03:52 2015
Picon

LLVM parsers for popular languages? - Python, Rust, Go

IIRC when LLVM came out a bunch of community-contributed parsers were available on your website.

Essentially I want to read in a programming language, prune the AST until it contains only what I define as a "summary", then convert that AST to that of another language, before finally outputting [code-generating] a compilable/interpretable source [think boilerplate].

Would be good to have Python, Rust and Go.

Are there any LLVM parsers around for these popular languages? - I can write my own, but then I'd need to maintain them against the latest language specs >.<

Thanks for all suggestions
_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
HEITZMANN Frédéric 218168 | 29 Jun 15:00 2015
Picon

Hwo to guess PC-relative offset

Dear LLVM crew,

I have been writing a new LLVM backend with a very simple instruction set.
moving a constant value to a register is selected as a load of  the constant, with a PC-relative positive offset.
Thus, the constant should be stored in .text section, after the load instruction, and offset should be
computed at compile time (not link time).

I struggle to find out :
- how llvm handle constant pool
- where I should compute the offset (MCCodeEmitter ? MCInstLowering ? ... ?)
ARM has a specific pass for this (ARMConstantIslandPass.cpp), but I wonder if such a processing is really
needed, at least for simple case (i.e. small enough offset).
Handling this with relocations and linker-hacking seems odd, I'd prefer to avoid it.

Thanks for you help, either with some advice on the implementation strategy, or with and example in an
existing backend.

--
Frederic Heitzmann
zet | 29 Jun 13:47 2015
Picon

Need a translator from English to Chinese_求翻译

hello, every Chinese LLVM fans.

Just like the email's title, the translation subject is the book <LLVM Cookbook> wrote by Mayur Pandey & Suyog Sarda
/// --------------------------------------------------------------------------------------
有兴趣的可以发邮件给: zsprain(at)gmail.com
这个邮箱的主人是电子工业出版社的张春雨.
然后跟他说在maillist里看到的消息就行了.
/// --------------------------------------------------------------------------------------
hf

--
业精于勤,荒于嬉..
_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Alex Bradbury | 29 Jun 12:47 2015

LLVM Weekly - #78, June 29th 2015

LLVM Weekly - #78, June 29th 2015
================================

If you prefer, you can read a HTML version of this email at
<http://llvmweekly.org/issue/78>.

Welcome to the seventy-eighth issue of LLVM Weekly, a weekly newsletter
(published every Monday) covering developments in LLVM, Clang, and related
projects. LLVM Weekly is brought to you by [Alex
Bradbury](http://asbradbury.org). Subscribe to future issues at
<http://llvmweekly.org> and pass it on to anyone else you think may be
interested. Please send any tips or feedback to <asb <at> asbradbury.org>, or
 <at> llvmweekly or  <at> asbradbury on Twitter.

I'm in the Bay Area this week for the [second RISC-V
workshop](http://riscv.org/workshop-jun2015.html) where my colleague and I
will of course be talking about [lowRISC](http://www.lowrisc.org). If you're
not able to make it, keep an eye on the lowRISC blog which I intend to keep
updating semi-live with notes from the talks and presentations.

## News and articles from around the web

Hans Wennborg has shared the [release plan for LLVM/Clang
3.7](http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/087060.html). This
would see the release branch created on 14th July, with a final release
targeted for 21st August.

A [detailed
analysis](http://www.cl.cam.ac.uk/~pes20/cerberus/notes50-2015-05-24-survey-discussion.html)
of the results of the "What is C in practice" survey has now been posted. The
survey gained around 300 responses, and aims to help guide the definition of a
formal model for the de facto standard of C (i.e. C as it is used rather than
purely as specified in the ISO standard).

The 3.6.2-rc1 LLVM/Clang release [has been
tagged](http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/087111.html). As
always, testing is encouraged.

## On the mailing lists

Unfortunately at the time of writing GMANE seems to be having some problems,
so for this week I'll be using links to the pipermail archives of the relevant
mailing list posts.

* Adrian Prantl has a proposal for [improving the quality of debug locations
and of
DbgValueHistoryCalculator](http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/087109.html).
This will involve adding new heuristics so DbgValueHistoryCalculator is
smarter at creating ranges.

* Sanjoy Patel kicked off a discussion about [conversion between bitwise AND
and short-circuit evaluation for
booleans](http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/087225.html).
In particularly, he's wanting to ensure that short circuit evaluation is not
used (though as is pointed out in the thread, the benefit of saving the branch
is highly microarchitecture dependent).

* Dan Liew has posted an RFC on [improving the testing of exported LLVM CMake
targets](http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/087246.html). He
has produced a [toy project](https://github.com/delcypher/llvmCMakeImportDemo)
making use of these targets, which could be used to help ensure they stay in
working shape.

* Bjarke Roune is proposing [functionality to determine when a posion value is
guaranteed to produce undefined
behaviour](http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/087234.html),
with the aim of improving handling of nsw/inbounds and similar in LLVM passes
such as scalar evolution.

* Philip Reames has responded to a question from Chandler Carruth with a good
summary of the [motivation for supporting inlining through statepoints and
patchpoints](http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/087222.html).

## LLVM commits

* The InterleavedAccess pass has been introduced to identify interleaved
memory accesses so they can be transformed into target-specific intrinsics.
[r240751](http://reviews.llvm.org/rL240751).

* Initial serialisation of machine instructions has been added, representing
MachineInstructions in YAML. [r240295](http://reviews.llvm.org/rL240295),
[r240425](http://reviews.llvm.org/rL240425), and more.

* The CaptureTracking pass has been optimised to improve performance on very
large basic blocks. [r240560](http://reviews.llvm.org/rL240560).

* A parser for LLVM stackmap sections has been added and made available
through llvm-readobj. [r240860](http://reviews.llvm.org/rL240860).

## Clang commits

* The recently added nullability attributes have been extensively documented.
[r240296](http://reviews.llvm.org/rL240296).

* constexpr can now be specified in condition declarations.
[r240707](http://reviews.llvm.org/rL240707).

## Other project commits

* The README for the COFF linker in LLD has been updated with new performance
numbers. It's now 3.5 seconds to self-host (was previously 5 seconds), and
this compared 7 seconds with the MSVC linker and 30 seconds with the old LLD.
[r240759](http://reviews.llvm.org/rL240759).

* The safestack TODO list in compiler-rt has been updated.
[r240473](http://reviews.llvm.org/rL240473).

* LLD gained support for thread-local storage in MachO objects.
[r240454](http://reviews.llvm.org/rL240454).

* Polly has had a meaningful improvement in compile time through enabling the
small integer optimisation of the ISL (Integer Set Library). Polybench
benchmarks on average take 20% less time to compile.
[r240689](http://reviews.llvm.org/rL240689).
Anirudh Sivaraman | 29 Jun 08:24 2015
Picon

Inferring dependencies in phi instructions

I am trying to infer data dependencies using LLVM's def-use chains and
I am having trouble dealing with 'phi' instructions. Specifically,

If I am given the code snippet:

int foo() {
  int y = 1;
  int x;
  if (y) {
    x = 2;
  } else {
    x = 3;
  }
  return x;
}

Here, x has a data dependence on y (not control because x is assigned
in both halves), but LLVM expresses 'x' as: %x.0 = phi i32 [ 2, %2 ],
[ 3, %3 ] using phi-nodes, omitting the dependence on y.

If I write the function as:

int foo() {
  int y = 1;
  int x = y ? 2 : 3;
  return x;
},

the dependencies work out alright because LLVM now uses a select
instruction, where the dependence on y is explicit:

%y = select i1 %x, i32 2, i32 3

In general, I don't think I can convert phi nodes into select
statements (because a phi node can refer to values from more than two
paths in general, while select statements permit only two options, one
each for a true and a false branch). Any thoughts on how this is
handled in practice would be very helpful.

Anirudh
Mehdi Amini | 29 Jun 07:47 2015
Picon

Re: Function "llvm::PassManager::run" not defined.

Hi,

At this point your debugger is running and you were able to break into LLVM at the place you wanted. I’m not sure what you are trying to accomplish now, can you clarify?
if you need help with gdb itself I think you are not on the right mailing list.

— 
Mehdi

On Jun 28, 2015, at 10:28 PM, Manideepa Mukherjee <manideepa.mukherjee <at> gmail.com> wrote:

Hi,

Sorry to bug you. It was my mistake.

So now it is giving the following output. Why this warning is coming. I tried to upgrade libc6-dbg but it showed libc6-dbg is already the newest version. 


(gdb) run /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load ../lib/loop_graph_analysis.so -loop-graph-analysis
Starting program: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load ../lib/loop_graph_analysis.so -loop-graph-analysis
warning: the debug information found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch).

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.


Breakpoint 1, llvm::legacy::PassManager::run (this=0x7fffffffd9a0, M=...) at LegacyPassManager.cpp:1746
1746      return PM->run(M);
(gdb) 


On Mon, Jun 29, 2015 at 10:28 AM, Mehdi Amini <mehdi.amini <at> apple.com> wrote:
Hi,

The break command I gave you solve your problem. But now you are not running the right “run” command, it seems to me that you missed the -load option.

— 
Mehdi

On Jun 28, 2015, at 9:55 PM, Manideepa Mukherjee <manideepa.mukherjee <at> gmail.com> wrote:

Hi,

I tried with this command you suggested and I am getting the following output. 
I have followed the command given on the tutorial exactly. 

Reading symbols from opt...done.
(gdb) break llvm::legacy::PassManager::run
Breakpoint 1 at 0x1899ac4: file LegacyPassManager.cpp, line 1746.
(gdb) run /home/manideepa/Desktop/research/compiler/testing/matmul.bc ../lib/loop_graph_analysis.so -loop-graph-analysis
Starting program: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt /home/manideepa/Desktop/research/compiler/testing/matmul.bc ../lib/loop_graph_analysis.so -loop-graph-analysis
warning: the debug information found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch).

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
opt: Unknown command line argument '-loop-graph-analysis'.  Try: '/home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt -help'
opt: Did you mean '-combiner-alias-analysis'?
opt: Too many positional arguments specified!
Can specify at most 1 positional arguments: See: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt -help
[Inferior 1 (process 4282) exited with code 01]



On Sat, Jun 27, 2015 at 2:23 AM, Mehdi Amini <mehdi.amini <at> apple.com> wrote:
I wonder if it is not linked to the work on the new PassManager.

Can you try: break llvm::legacy::PassManager::run


— 
Mehdi





On Jun 26, 2015, at 3:54 AM, Manideepa Mukherjee <manideepa.mukherjee <at> gmail.com> wrote:

Hi,

I am trying to use GDB for debugging my llvm pass. I am following the documentation http://llvm.org/docs/WritingAnLLVMPass.html. When i am doing this the following error and warning messages I am getting. I tried to remove the warning by apt-get install libc6-dbg:i386 command for updating the libc6 but still getting the same.


Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from opt...done.
(gdb) break llvm::PassManager::run
Function "llvm::PassManager::run" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (llvm::PassManager::run) pending.
(gdb) run /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load ../lib/loop_graph_analysis.so -loop-graph-analysis
Starting program: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load ../lib/loop_graph_analysis.so -loop-graph-analysis
warning: the debug information found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch).

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

opt: loop_graph_new.cpp:245: void <anonymous namespace>::LoopGraphAnalysisPass::AddDataEdges(llvm::Loop *, unsigned int): Assertion `loopGraph != graphs.end()' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff69c7cc9 in __GI_raise (sig=sig <at> entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Please help.



-- 
Thanks & Regards,
Manideepa

_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




-- 
Thanks & Regards,
Manideepa Mukherjee
Contact No:- +91-7428062726




-- 
Thanks & Regards,
Manideepa Mukherjee
Contact No:- +91-7428062726

_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Mehdi Amini | 29 Jun 06:58 2015
Picon

Re: Function "llvm::PassManager::run" not defined.

Hi,

The break command I gave you solve your problem. But now you are not running the right “run” command, it seems to me that you missed the -load option.

— 
Mehdi

On Jun 28, 2015, at 9:55 PM, Manideepa Mukherjee <manideepa.mukherjee <at> gmail.com> wrote:

Hi,

I tried with this command you suggested and I am getting the following output.
I have followed the command given on the tutorial exactly.

Reading symbols from opt...done.
(gdb) break llvm::legacy::PassManager::run
Breakpoint 1 at 0x1899ac4: file LegacyPassManager.cpp, line 1746.
(gdb) run /home/manideepa/Desktop/research/compiler/testing/matmul.bc ../lib/loop_graph_analysis.so -loop-graph-analysis
Starting program: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt /home/manideepa/Desktop/research/compiler/testing/matmul.bc ../lib/loop_graph_analysis.so -loop-graph-analysis
warning: the debug information found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch).

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
opt: Unknown command line argument '-loop-graph-analysis'.  Try: '/home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt -help'
opt: Did you mean '-combiner-alias-analysis'?
opt: Too many positional arguments specified!
Can specify at most 1 positional arguments: See: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt -help
[Inferior 1 (process 4282) exited with code 01]



On Sat, Jun 27, 2015 at 2:23 AM, Mehdi Amini <mehdi.amini <at> apple.com> wrote:
I wonder if it is not linked to the work on the new PassManager.

Can you try: break llvm::legacy::PassManager::run


— 
Mehdi





On Jun 26, 2015, at 3:54 AM, Manideepa Mukherjee <manideepa.mukherjee <at> gmail.com> wrote:

Hi,

I am trying to use GDB for debugging my llvm pass. I am following the documentation http://llvm.org/docs/WritingAnLLVMPass.html. When i am doing this the following error and warning messages I am getting. I tried to remove the warning by apt-get install libc6-dbg:i386 command for updating the libc6 but still getting the same.


Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from opt...done.
(gdb) break llvm::PassManager::run
Function "llvm::PassManager::run" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (llvm::PassManager::run) pending.
(gdb) run /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load ../lib/loop_graph_analysis.so -loop-graph-analysis
Starting program: /home/manideepa/Desktop/research/compiler/llvm-3.4/Debug+Asserts/bin/opt /home/manideepa/Desktop/research/compiler/testing/matmul.bc -load ../lib/loop_graph_analysis.so -loop-graph-analysis
warning: the debug information found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch).

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

opt: loop_graph_new.cpp:245: void <anonymous namespace>::LoopGraphAnalysisPass::AddDataEdges(llvm::Loop *, unsigned int): Assertion `loopGraph != graphs.end()' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff69c7cc9 in __GI_raise (sig=sig <at> entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Please help.



--
Thanks & Regards,
Manideepa

_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




--
Thanks & Regards,
Manideepa Mukherjee
Contact No:- +91-7428062726

_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Kayona Getten | 27 Jun 20:51 2015
Picon

Cross-Compiler Service provided by LLVM

Good Afternoon LLVM Team,

I am currently doing a research paper on LLVM and I need to understand how the infrastructure takes different front-end codes and cross compile them. Are there any papers explaining how exactly this service works please.

Regards,
Chevounne Getten
University of Technology Jamaica
chevkay <at> gmail.com
chevounneg <at> yahoo.com

_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Eugeny G. | 28 Jun 08:59 2015
Picon

Probably iterator invalidation during foreach

Please check line 512 in llvm\lib\CodeGen\AtomicExpandPass.cpp
(Most of code populate uses before doing any replacement)
--
WBR,
Eugeny Grishul
_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Demikhovsky, Elena | 28 Jun 09:07 2015
Picon

Intrinsic parameters verification

Hi,
 
I have target specific intrinsics (X86 in my case) with special constant parameters.
Rounding mode constant, or scale value in gather/scatter. The scale, for example, may be 0, 1, 2, 4, or 8 only.
How do I verify the values on IR level ?
 
I’m looking at Verifier::visitIntrinsicFunctionCall()
but I see only common intrinsics here, not target specific.
 
Thank you.
 
  • Elena
 
 
 

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
LLVM Developers mailing list
LLVMdev <at> cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Sanjoy Das | 27 Jun 22:29 2015

readonly and infinite loops

Running -early-cse on

declare void  <at> rn() readnone nounwind

define void  <at> f() {
 entry:
  call void  <at> rn()
  ret void
}

removes the call to  <at> rn().  But  <at> rn() could have had an infinite loop
in it in which case  <at> f() went from being a non-terminating
program to an terminating no-op.  Is this intentional?

The only way I can see this transform being legal is if infinite loops
are declared to have undefined behavior, but I could not find anything
in the LLVM specification that mentions this.

-- Sanjoy

Gmane