Anton Korobeynikov
2007-May-18 21:35 UTC
[LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
Hello, Bram> * It seems that a C-call like printf("---\n") is transformed to puts > ("---") in the LLVM IR instead of keeping it a printf. What are the > circumstances in which this happens? Do other similar conversions > occur? Can this be turned off (lower optimisation level?)? Manually > replacing the puts-calls by a printf-call is not straightforward, as > the argument should be appended a '\n' (implicit with puts).This transformation is performed via simplify-libcalls optimization pass. You can look into corresponding source to check for list of xforms. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University.
Bram Adams
2007-May-20 21:21 UTC
[LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
Hi, Op 19-mei-07, om 00:39 heeft Chris Lattner het volgende geschreven:> Anton is right. You should be able to use -fno-builtins to disable > this.Thanks, that did the trick. Some final remarks (my app works again :-)): * llvm.va_start and similar intrinsics now have an i8* arg instead of an sbyte** * For some reason the Arguments of a Function are now circularly linked, i.e. getPrev()/Next() does not yield 0 when the first Argument is reached, but jumps back to the last one. I experienced this with a loop I was using to find out the index of an Argument. It relied on the fact that getPrev() would eventually give 0, which worked in previous LLVM versions. On a related note: while using llvmc I have some test cases where the following error now pops up on Linux X86 (not on OSX): <premain>: CommandLine Error: Argument 'debug' defined more than once! llvmc: CommandLine Error: Argument 'debug' defined more than once! These are the arguments I provide to llvmc (I need the -disable-opt as some of the standard passes absolutely need to occur before my passes, and the rest must come afterwards): llvmc --config-dir ${ASPICERE2_SRC}/config/ -Tlnk="-L${LLVM_FRONT}/ lib" -Tlnk="-L${ASPICERE2_INSTALL}/lib" -Tlnk="-L${SWI_LIB}" -Tlnk="- load=${ASPICERE2_INSTALL}/lib/weaver" -Tlnk="-load=$ {ASPICERE2_INSTALL}/lib/native" -Tlnk="-disable-opt" -Tlnk="- constmerge" -Tlnk="-globalsmodref-aa" -Tlnk="-reify" -Tlnk="-match" - Tlnk="-weave" -Tlnk="-globalsmodref-aa" -Tlnk="-internalize" -Tlnk="- ipsccp" -Tlnk="-globalopt" -Tlnk="-constmerge" -Tlnk="-deadargelim" - Tlnk="-instcombine" -Tlnk="-inline" -Tlnk="-prune-eh" -Tlnk="- globalopt" -Tlnk="-globaldce" -Tlnk="-argpromotion" -Tlnk="- instcombine" -Tlnk="-scalarrepl" -Tlnk="-globalsmodref-aa" -Tlnk="- licm" -Tlnk="-load-vn" -Tlnk="-gcse" -Tlnk="-dse" -Tlnk="- instcombine" -Tlnk="-simplifycfg" -Tlnk="-globaldce" $FILTERED_ARGS $ASPECT_STRING_TO_C Variable $FILTERED_ARGS contains some .c files and also the -o switch with the name of the resulting binary, while $ASPECT_STRING_TO_C contains another number of .c files. The weird thing (besides that I only experience this error on Linux) is that although all my test cases use llvmc, only two fail with this error without a clear reason. Any ideas on this? Kind regards, Bram Adams GH-SEL, INTEC, Ghent University (Belgium)
Maybe Matching Threads
- [LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
- [LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
- [LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
- [LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
- [LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*