On Fri, Nov 28, 2008 at 11:31 AM, Eli Friedman <eli.friedman at gmail.com> wrote:> That said, it's probably not worth bothering; if > the point is to teach the students to write optimizers, it doesn't > really make a difference whether the code starts off slightly > optimized.It matters if the optimisations the students have to implement are the optimisations done implicitly by LLVM. -- . ..: Lucian
> It matters if the optimisations the students have to implement are the > optimisations done implicitly by LLVM.They are not really done by LLVM, because no optimizations are done on the LLVM IR. They are done by llvm-gcc, a front-end to LLVM: (1) gcc does constant folding all over the place (nothing can be done about this) (2) the llvm-gcc to LLVM converter also does constant folding (this can be turned off easily enough) (3) it seems that unused code can also be eliminated during the conversion to LLVM IR. Presumably the code is simply never converted to IR in the first place. I'm not sure how this happens. Perhaps it is possible to ensure that everything gets converted. Ciao, Duncan.
Wouldn't Clang be a good option to generating unoptimized LLVM IR? Dan On Nov 28, 2008, at 6:13 AM, Duncan Sands wrote:>> It matters if the optimisations the students have to implement are >> the >> optimisations done implicitly by LLVM. > > They are not really done by LLVM, because no optimizations are done > on the > LLVM IR. They are done by llvm-gcc, a front-end to LLVM: > (1) gcc does constant folding all over the place (nothing can be > done about > this) > (2) the llvm-gcc to LLVM converter also does constant folding (this > can > be turned off easily enough) > (3) it seems that unused code can also be eliminated during the > conversion > to LLVM IR. Presumably the code is simply never converted to IR in > the > first place. I'm not sure how this happens. Perhaps it is possible > to > ensure that everything gets converted. > > Ciao, > > Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev