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
Daniel M Gessel dixit:>Wouldn't Clang be a good option to generating unoptimized LLVM IR?More like broken ;-) sometimes at least.>On Nov 28, 2008, at 6:13 AM, Duncan Sands wrote:>> 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:llvm-pcc, anyone? :þ //mirabilos -- Sometimes they [people] care too much: pretty printers [and syntax highligh- ting, d.A.] mechanically produce pretty output that accentuates irrelevant detail in the program, which is as sensible as putting all the prepositions in English text in bold font. -- Rob Pike in "Notes on Programming in C"
I've had good luck with Clang, but I'll keep an eye out. I still think it would be a good option in an educational environment. Heck, fixing a bug or two in Clang would't be a bad learning experience. :) Dan On Dec 1, 2008, at 5:49 AM, Thorsten Glaser wrote:> Daniel M Gessel dixit: > >> Wouldn't Clang be a good option to generating unoptimized LLVM IR? > > More like broken ;-) sometimes at least. > >> On Nov 28, 2008, at 6:13 AM, Duncan Sands wrote: > >>> 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: > > llvm-pcc, anyone? :þ > > //mirabilos > -- > Sometimes they [people] care too much: pretty printers [and syntax > highligh- > ting, d.A.] mechanically produce pretty output that accentuates > irrelevant > detail in the program, which is as sensible as putting all the > prepositions > in English text in bold font. -- Rob Pike in "Notes on Programming > in C" > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev