Does any real code benefit from dead code eliminating read-only functions?
Tom
I'd imagine every get method in any C++ program would benefit from that sort of dead-code elimination. Although simply inlining it might might be all that's really needed.
From: Thomas B. Jablin <tjablin@cs.princeton.edu>
To: LLVM Developers Mailing List <llvmdev@cs.uiuc.edu>
Sent: Mon, May 10, 2010 9:01:09 PM
Subject: Re: [LLVMdev] All CallInsts mayHaveSideEffectsDoes any real code benefit from dead code eliminating read-only
functions?
Tom
<
href="mailto:rnk@mit.edu">rnk@mit.edu>
ymailto="mailto:tjablin@CS.Princeton.EDU"
href="mailto:tjablin@CS.Princeton.EDU">tjablin@CS.Princeton.EDU>
Cc:
"LLVM Developers Mailing List" <
href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu>
Sent: Monday,
May 10, 2010 9:38:47 PM GMT -05:00 US/Canada Eastern
All CallInsts mayHaveSideEffects
This is a known
bug:
http://llvm.org/bugs/show_bug.cgi?id=965
There has been some
discussion about it and similar problems, and the
desire is to perform some
analysis on functions to determine if they
are known to halt trivially, ie
they have no loops and call no other
functions that are not known to
halt.
LLVM still wants to be able to delete calls to trivial read-only
functions.
Reid