[llvm-commits] [llvm-gcc-4-2] r39806 - /llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp
Author: baldrick Date: Fri Jul 13 07:12:16 2007 New Revision: 39806 URL: http://llvm.org/viewvc/llvm-project?rev=39806view=rev Log: Forward port of [129234]. exception handling tweaks from Duncan: (1) Fix some comments. (2) Correct off-by-one in test for branching within the same scope (currently it never triggers, but comes out in the wash later). (3) Have all branches to the same destination share cleanup code, not just exception unwinding branches. Currently each non-unwind branch (like falling through at the end of a try scope) gets its own copy of cleanups. Change inspired by the thought that the optimizers find it easy to duplicate blocks, but hard to merge them. (4) Add a missing bitcast in a rare case. Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39806r1=39805r2=39806view=diff == --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 07:12:16 2007 @@ -1320,21 +1320,14 @@ /// exception edge (as indicated by IsExceptionEdge) these are expanded, /// otherwise not. /// -/// Note that it is illegal for inserted cleanups to throw any exceptions, -/// as indicated by isExceptionEdge. This is an important case for -/// exception handling: when unwinding the stack due to an active exception, any -/// destructors which propagate exceptions should cause terminate to be called. -/// Thus, if a cleanup does throw an exception, its exception destination must -/// go to a designated terminate block. -/// /// Note that all calling code should emit a new basic block after this, so that /// future code does not fall after the terminator. /// void TreeToLLVM::EmitBranchInternal(BasicBlock *Dest, bool IsExceptionEdge) { // Insert the branch. BranchInst *BI = Builder.CreateBr(Dest); - - // If there are no current exception scopes, this edge *couldn't* need + + // If there are no current exception scopes, this edge *couldn't* need // cleanups. It is not possible to jump into a scope that requires a cleanup. // This keeps the C case fast. if (CurrentEHScopes.empty()) return; @@ -1344,11 +1337,10 @@ if (Dest-getParent()) { // This is a forward reference to a block. Since we know that we can't jump // INTO a region that has cleanups, we can only be branching out. -// std::mapBasicBlock*, unsigned::iterator I = BlockEHScope.find(Dest); -if (I != BlockEHScope.end() I-second == CurrentEHScopes.size()) +if (I != BlockEHScope.end() I-second == CurrentEHScopes.size() - 1) return; // Branch within the same EH scope. - + assert((I == BlockEHScope.end() || I-second CurrentEHScopes.size()) Invalid branch into EH region); } @@ -1361,12 +1353,12 @@ /// that works. void TreeToLLVM::AddBranchFixup(BranchInst *BI, bool isExceptionEdge) { BasicBlock *Dest = BI-getSuccessor(0); - + // Check to see if we already have a fixup for this destination. std::vectorBranchFixup BranchFixups = CurrentEHScopes.back().BranchFixups; for (unsigned i = 0, e = BranchFixups.size(); i != e; ++i) if (BranchFixups[i].SrcBranch-getSuccessor(0) == Dest -BranchFixups[i].isExceptionEdge) { +BranchFixups[i].isExceptionEdge == isExceptionEdge) { BranchFixup Fixup = BranchFixups[i]; // We found a fixup for this destination already. Recycle it. if (Fixup.SrcBranch-getParent()-front() == Fixup.SrcBranch) { @@ -2212,11 +2204,11 @@ FinallyStack.pop_back(); // Because we can emit the same cleanup in more than one context, we must -// strip off LLVM information from the decls in the code. Otherwise, the -// we will try to insert the same label into multiple places in the code. +// strip off LLVM information from the decls in the code. Otherwise, we +// will try to insert the same label into multiple places in the code. StripLLVMTranslation(CleanupCode); - - + + // Catches will supply own terminator. if (!Builder.GetInsertBlock()-getTerminator()) { // Emit a branch to the new target. @@ -2284,6 +2276,7 @@ tree TypeInfoNopExpr = (*lang_eh_runtime_type)(Types); // Produce value. Duplicate typeinfo get folded here. Value *TypeInfo = Emit(TypeInfoNopExpr, 0); +TypeInfo = BitCastToType(TypeInfo, PointerType::get(Type::Int8Ty)); // Call get eh type id. Value *TypeID = Builder.CreateCall(FuncEHGetTypeID, TypeInfo, 1, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4-2] r39808 - /llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp
Author: baldrick Date: Fri Jul 13 07:15:51 2007 New Revision: 39808 URL: http://llvm.org/viewvc/llvm-project?rev=39808view=rev Log: Forward port of [129262]. A function that only has cleanups (destructors) to run when an exception is raised currently is not assigned a personality function because we don't bother creating a call to eh.selector if there are no catches. But the personality function is still needed, since it is the personality function that analyses the exception table and decides where to jump to (to the cleanups in this case). This patch causes a call to eh.selector to be generated in every landing pad, even if it has no type infos, because that specifies the personality function. Patch from Duncan Sands. Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39808r1=39807r2=39808view=diff == --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 07:15:51 2007 @@ -2009,6 +2009,11 @@ // Fetch and store the exception selector. std::vectorValue* Args; + // The exception and the personality function. + Args.push_back(Builder.CreateLoad(ExceptionValue, eh_ptr)); + Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality, +PointerType::get(Type::Int8Ty))); + for (std::vectorEHScope::reverse_iterator I = CurrentEHScopes.rbegin(), E = CurrentEHScopes.rend(); I != E; ++I) { if (TREE_CODE(I-TryExpr) == TRY_CATCH_EXPR) { @@ -2022,16 +2027,6 @@ EH_FILTER_EXPR) ? FilterExpr : CatchList; } - if (I-InfosType == CatchList !I-TypeInfos.size()) -continue; - - // Lazily add the exception and the personality function. - if (!Args.size()) { -Args.push_back(Builder.CreateLoad(ExceptionValue, eh_ptr)); -Args.push_back(CastToType(Instruction::BitCast, FuncCPPPersonality, - PointerType::get(Type::Int8Ty))); - } - if (I-InfosType == FilterExpr) // Filter - note the size. Args.push_back(ConstantInt::get(Type::Int32Ty, I-TypeInfos.size())); @@ -2042,11 +2037,9 @@ } } - if (Args.size()) { -Value *Select = Builder.CreateCall(FuncEHSelector, Args[0], Args.size(), - eh_select); -Builder.CreateStore(Select, ExceptionSelectorValue); - } + Value *Select = Builder.CreateCall(FuncEHSelector, Args[0], Args.size(), + eh_select); + Builder.CreateStore(Select, ExceptionSelectorValue); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39803 - in /llvm/trunk/test/CodeGen/PowerPC: 2006-01-20-ShiftPartsCrash.ll 2006-08-15-SelectionCrash.ll
Author: ggreif Date: Fri Jul 13 05:08:18 2007 New Revision: 39803 URL: http://llvm.org/viewvc/llvm-project?rev=39803view=rev Log: these tests do not need a triple on Solaris. Thanks sabre! Modified: llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll Modified: llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll?rev=39803r1=39802r2=39803view=diff == --- llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll Fri Jul 13 05:08:18 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 +; RUN: llvm-upgrade %s | llvm-as | llc void %iterative_hash_host_wide_int() { %zero = alloca int ; int* [#uses=2] Modified: llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll?rev=39803r1=39802r2=39803view=diff == --- llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll Fri Jul 13 05:08:18 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade %s | llvm-as | llc -mtriple=powerpc-apple-darwin8 +; RUN: llvm-upgrade %s | llvm-as | llc %struct..0anon = type { int } %struct.rtx_def = type { ushort, ubyte, ubyte, [1 x %struct..0anon] } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39801 - /llvm/trunk/autoconf/AutoRegen.sh
Author: reid Date: Fri Jul 13 05:02:45 2007 New Revision: 39801 URL: http://llvm.org/viewvc/llvm-project?rev=39801view=rev Log: Set the mime-type of this file to text/plain because (silly) SVN doesn't know that application/x-sh is text. Modified: llvm/trunk/autoconf/AutoRegen.sh (props changed) Propchange: llvm/trunk/autoconf/AutoRegen.sh -- --- svn:mime-type (original) +++ svn:mime-type Fri Jul 13 05:02:45 2007 @@ -1 +1 @@ -application/x-sh +text/plain ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in
On Fri, 2007-07-13 at 12:24 +0200, Gabor Greif wrote: Thanks, Reid! in your include/llvm/Config/config.h what do you get for powf fmodf strtof round ? i.e. I have /* #undef HAVE_POWF */ /* #undef HAVE_FMODF */ /* #undef HAVE_STRTOF */ /* #undef HAVE_ROUND */ I don't know, I didn't configure :) And I'm 6 hours late for going to bed .. sorry. Cheers! Gabor ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in
Author: ggreif Date: Fri Jul 13 04:48:29 2007 New Revision: 39800 URL: http://llvm.org/viewvc/llvm-project?rev=39800view=rev Log: * llvm.spec.in: update blurb * autoconf/AutoRegen.sh: use variables for autofoo versions * autoconf/configure.ac: test for some more functions that are not guaranteed on solaris Note: the svn:mime-type of autoconf/AutoRegen.sh should be set to something that allows for text compares using svn diff Modified: llvm/trunk/autoconf/AutoRegen.sh llvm/trunk/autoconf/configure.ac llvm/trunk/llvm.spec.in Modified: llvm/trunk/autoconf/AutoRegen.sh URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/AutoRegen.sh?rev=39800r1=39799r2=39800view=diff == Binary files - no diff available. Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=39800r1=39799r2=39800view=diff == --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Fri Jul 13 04:48:29 2007 @@ -721,7 +721,8 @@ dnl===---=== AC_CHECK_FUNCS([backtrace ceilf floorf roundf rintf nearbyintf getcwd ]) -AC_CHECK_FUNCS([getpagesize getrusage getrlimit setrlimit gettimeofday]) +AC_CHECK_FUNCS([powf fmodf strtof round ]) +AC_CHECK_FUNCS([getpagesize getrusage getrlimit setrlimit gettimeofday ]) AC_CHECK_FUNCS([isatty mkdtemp mkstemp ]) AC_CHECK_FUNCS([mktemp realpath sbrk setrlimit strdup strerror strerror_r ]) AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ]) Modified: llvm/trunk/llvm.spec.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/llvm.spec.in?rev=39800r1=39799r2=39800view=diff == --- llvm/trunk/llvm.spec.in (original) +++ llvm/trunk/llvm.spec.in Fri Jul 13 04:48:29 2007 @@ -15,8 +15,9 @@ LLVM is a compiler infrastructure designed for compile-time, link-time, runtime, and idle-time optimization of programs from arbitrary programming languages. LLVM is written in C++ and has been developed since 2000 at the University of -Illinois and Apple. It currently supports compilation of C and C++ programs, -using front-ends derived from GCC 3.4 and 4.0.1. The compiler infrastructure +Illinois and Apple. It currently supports compilation of C and C++ programs, +using front-ends derived from GCC 4.0.1. A new front-end for the C family of +languages is in development. The compiler infrastructure includes mirror sets of programming tools as well as libraries with equivalent functionality. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in
Unfortunately I could not regenerate configure because I am missing autoconf 2.60 (have 2.59 only) Reid or Chris, can somebody run autoconf/AutoRegen.sh and check in configure ? I sincerely hope that I did not mess up anything :-O Cheers, Gabor ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39802 - in /llvm/trunk: configure include/llvm/Config/config.h.in
Author: reid Date: Fri Jul 13 05:05:30 2007 New Revision: 39802 URL: http://llvm.org/viewvc/llvm-project?rev=39802view=rev Log: Regenerate to pick up Gabor's changes. Modified: llvm/trunk/configure llvm/trunk/include/llvm/Config/config.h.in Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=39802r1=39801r2=39802view=diff == --- llvm/trunk/configure (original) +++ llvm/trunk/configure Fri Jul 13 05:05:30 2007 @@ -30140,6 +30140,119 @@ +for ac_func in powf fmodf strtof round +do +as_ac_var=`echo ac_cv_func_$ac_func | $as_tr_sh` +{ echo $as_me:$LINENO: checking for $ac_func 5 +echo $ECHO_N checking for $ac_func... $ECHO_C 6; } +if { as_var=$as_ac_var; eval test \\${$as_var+set}\ = set; }; then + echo $ECHO_N (cached) $ECHO_C 6 +else + cat conftest.$ac_ext _ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h conftest.$ac_ext +cat conftest.$ac_ext _ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case limits.h declares $ac_func. + For example, HP-UX 11i limits.h declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, +which can conflict with char $ac_func (); below. +Prefer limits.h to assert.h if __STDC__ is defined, since +limits.h exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include limits.h +#else +# include assert.h +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern C +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements +to always fail with ENOSYS. Some functions are actually named +something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try=$ac_link +case (($ac_try in + *\* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval echo \\$as_me:$LINENO: $ac_try_echo\) 5 + (eval $ac_link) 2conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 conftest.err + rm -f conftest.er1 + cat conftest.err 5 + echo $as_me:$LINENO: \$? = $ac_status 5 + (exit $ac_status); } +{ ac_try='test -z $ac_c_werror_flag || test ! -s conftest.err' + { (case (($ac_try in + *\* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval echo \\$as_me:$LINENO: $ac_try_echo\) 5 + (eval $ac_try) 25 + ac_status=$? + echo $as_me:$LINENO: \$? = $ac_status 5 + (exit $ac_status); }; } +{ ac_try='test -s conftest$ac_exeext' + { (case (($ac_try in + *\* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval echo \\$as_me:$LINENO: $ac_try_echo\) 5 + (eval $ac_try) 25 + ac_status=$? + echo $as_me:$LINENO: \$? = $ac_status 5 + (exit $ac_status); }; }; then + eval $as_ac_var=yes +else + echo $as_me: failed program was: 5 +sed 's/^/| /' conftest.$ac_ext 5 + + eval $as_ac_var=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo $as_me:$LINENO: result: $ac_res 5 +echo ${ECHO_T}$ac_res 6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat confdefs.h _ACEOF +#define `echo HAVE_$ac_func | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + for ac_func in getpagesize getrusage getrlimit setrlimit gettimeofday do Modified: llvm/trunk/include/llvm/Config/config.h.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=39802r1=39801r2=39802view=diff == --- llvm/trunk/include/llvm/Config/config.h.in (original) +++ llvm/trunk/include/llvm/Config/config.h.in Fri Jul 13 05:05:30 2007 @@ -115,6 +115,9 @@ /* Define to 1 if you have the `floorf' function. */ #undef HAVE_FLOORF +/* Define to 1 if you have the `fmodf' function. */ +#undef HAVE_FMODF + /* Does not have forward iterator */ #undef HAVE_FWD_ITERATOR @@ -270,6 +273,9 @@ /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR +/* Define to 1 if you have the `powf' function. */ +#undef HAVE_POWF + /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS @@ -294,6 +300,9 @@ /* Define to 1 if you have the `rintf' function. */ #undef HAVE_RINTF +/* Define to 1 if you have the `round' function. */ +#undef HAVE_ROUND + /* Define to 1 if you have the `roundf' function. */ #undef HAVE_ROUNDF @@ -369,6 +378,9 @@ /* Define to 1 if you have the `strrchr' function. */
[llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in
Thanks, Reid! in your include/llvm/Config/config.h what do you get for powf fmodf strtof round ? i.e. I have /* #undef HAVE_POWF */ /* #undef HAVE_FMODF */ /* #undef HAVE_STRTOF */ /* #undef HAVE_ROUND */ Cheers! Gabor ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4-2] r39804 - /llvm-gcc-4-2/trunk/build_gcc
Author: baldrick Date: Fri Jul 13 06:24:59 2007 New Revision: 39804 URL: http://llvm.org/viewvc/llvm-project?rev=39804view=rev Log: Correct the directory that the man pages are installed into. Modified: llvm-gcc-4-2/trunk/build_gcc Modified: llvm-gcc-4-2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/build_gcc?rev=39804r1=39803r2=39804view=diff == --- llvm-gcc-4-2/trunk/build_gcc (original) +++ llvm-gcc-4-2/trunk/build_gcc Fri Jul 13 06:24:59 2007 @@ -155,7 +155,7 @@ CONFIGFLAGS=--disable-checking --enable-werror \ --prefix=$DEST_ROOT \ - --mandir=$DEST_ROOT/share/man \ + --mandir=$LLVM_INSTALL_PREFIX/share/man \ --enable-languages=c,objc,c++,obj-c++ \ --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \ $LIBSTDCXX_CONFIG_OPTION \ @@ -352,9 +352,9 @@ cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* .$HTMLDIR/ || exit 1 # Manual pages -mkdir -p .$DEST_ROOT/share || exit 1 +mkdir -p .$LLVM_INSTALL_PREFIX/share || exit 1 # LLVM LOCAL build_gcc bug with non-/usr $DEST_ROOT -cp -Rp $DIR/dst-$BUILD-$BUILD/$DEST_ROOT/share/man .$DEST_ROOT/share/ \ +cp -Rp $DIR/dst-$BUILD-$BUILD$LLVM_INSTALL_PREFIX/share/man .$LLVM_INSTALL_PREFIX/share/ \ || exit 1 # exclude fsf-funding.7 gfdl.7 gpl.7 as they are currently built in # the gcc project @@ -477,7 +477,7 @@ done # Add extra man page symlinks for 'c++' and for arch-specific names. -MDIR=$DEST_DIR$DEST_ROOT/share/man/man1 +MDIR=$DEST_DIR$LLVM_INSTALL_PREFIX/share/man/man1 ln -f $MDIR/g++-$MAJ_VERS.1 $MDIR/c++-$MAJ_VERS.1 || exit 1 for t in $TARGETS ; do ln -f $MDIR/gcc-$MAJ_VERS.1 $MDIR/$t-apple-darwin$DARWIN_VERS-gcc-$VERS.1 \ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4-2] r39810 - in /llvm-gcc-4-2/trunk/gcc/config/i386: i386.c llvm-i386-target.h
Author: baldrick Date: Fri Jul 13 10:37:31 2007 New Revision: 39810 URL: http://llvm.org/viewvc/llvm-project?rev=39810view=rev Log: Make it compile on i386. Modified: llvm-gcc-4-2/trunk/gcc/config/i386/i386.c llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h Modified: llvm-gcc-4-2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/i386.c?rev=39810r1=39809r2=39810view=diff == --- llvm-gcc-4-2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/i386.c Fri Jul 13 10:37:31 2007 @@ -1123,7 +1123,8 @@ int x86_prefetch_sse; /* ix86_regparm_string as a number */ -static int ix86_regparm; +/* LLVM local */ +int ix86_regparm; /* -mstackrealign option */ extern int ix86_force_align_arg_pointer; Modified: llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h?rev=39810r1=39809r2=39810view=diff == --- llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h (original) +++ llvm-gcc-4-2/trunk/gcc/config/i386/llvm-i386-target.h Fri Jul 13 10:37:31 2007 @@ -35,6 +35,8 @@ `inreg` parameter attribute */ #define LLVM_TARGET_ENABLE_REGPARM +extern int ix86_regparm; + #define LLVM_TARGET_INIT_REGPARM(local_regparm, type) \ { \ tree attr; \ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39800 - in /llvm/trunk: autoconf/AutoRegen.sh autoconf/configure.ac llvm.spec.in
Reid, I hope you had a peaceful sleep! I tried the configure file here on linux, and it seems okay. No need to do this any more. Cheers, Gabor ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4-2] r39811 - in /llvm-gcc-4-2/trunk/gcc: llvm-convert.cpp llvm-debug.cpp
Author: baldrick Date: Fri Jul 13 10:43:51 2007 New Revision: 39811 URL: http://llvm.org/viewvc/llvm-project?rev=39811view=rev Log: Include tm_p.h to get the definition of REG_CLASS_FROM_CONSTRAINT. Simplify use of vectors with constructors, and fix some small conversion bugs while there (eg: index used for value, value used for index). Ressurect ConvertUnionCONSTRUCTOR, make it compile. FILE_TYPE has gone forever - it seems pointless to keep the comment. Before CHAR_TYPE was nuked, dwarf2out was changed to treat CHAR_TYPE and INTEGER_TYPE identically - so try to test for pascal strings using INTEGER_TYPE rather than CHAR_TYPE. Determine the encoding for INTEGER_TYPE in the same way as in dwarf2out. Break long lines. Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp llvm-gcc-4-2/trunk/gcc/llvm-debug.cpp Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39811r1=39810r2=39811view=diff == --- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Fri Jul 13 10:43:51 2007 @@ -46,6 +46,7 @@ #include system.h #include coretypes.h #include tm.h +#include tm_p.h #include tree.h #include c-tree.h // FIXME: eliminate. #include tree-iterator.h @@ -3675,11 +3676,9 @@ if (ConstraintChar == 'r') // REG_CLASS_FROM_CONSTRAINT doesn't support 'r' for some reason. RegClass = GENERAL_REGS; -#if 0 /* FIXME FIXME */ else - /* REG_CLASS_FROM_LETTER is now history find replacement... */ RegClass = REG_CLASS_FROM_CONSTRAINT(Constraint[-1], Constraint-1); -#endif + if (RegClass == NO_REGS) { // not a reg class. Result += ConstraintChar; continue; @@ -3902,7 +3901,8 @@ // Process clobbers. // Some targets automatically clobber registers across an asm. - tree Clobbers = targetm.md_asm_clobbers(ASM_OUTPUTS(exp), ASM_INPUTS(exp), ASM_CLOBBERS(exp)); + tree Clobbers = targetm.md_asm_clobbers(ASM_OUTPUTS(exp), ASM_INPUTS(exp), + ASM_CLOBBERS(exp)); for (; Clobbers; Clobbers = TREE_CHAIN(Clobbers)) { const char *RegName = TREE_STRING_POINTER(TREE_VALUE(Clobbers)); int RegCode = decode_reg_name(RegName); @@ -5151,15 +5151,19 @@ // Store each element of the constructor into the corresponding field of // DEST. if (!elt) return 0; // no elements -assert(VEC_length(constructor_elt, elt) == 0 Union CONSTRUCTOR should have one element!); -if (!VEC_index(constructor_elt, elt, 0)-value) return 0; // Not actually initialized? - -if (!ConvertType(TREE_TYPE(VEC_index(constructor_elt, elt, 0)-index))-isFirstClassType()) { - Value *V = Emit(VEC_index(constructor_elt, elt, 0)-index, DestLoc); +assert(VEC_length(constructor_elt, elt) == 1 +Union CONSTRUCTOR should have one element!); +tree tree_purpose = VEC_index(constructor_elt, elt, 0)-index; +tree tree_value = VEC_index(constructor_elt, elt, 0)-value; +if (!tree_purpose) + return 0; // Not actually initialized? + +if (!ConvertType(TREE_TYPE(tree_purpose))-isFirstClassType()) { + Value *V = Emit(tree_value, DestLoc); assert(V == 0 Aggregate value returned in a register?); } else { // Scalar value. Evaluate to a register, then do the store. - Value *V = Emit(VEC_index(constructor_elt, elt, 0)-value, 0); + Value *V = Emit(tree_value, 0); DestLoc = CastToType(Instruction::BitCast, DestLoc, PointerType::get(V-getType())); Builder.CreateStore(V, DestLoc); @@ -5421,16 +5425,16 @@ } unsigned NextFieldToFill = 0; - unsigned HOST_WIDE_INT elt_idx; - tree elt_purpose, elt_value; - FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), elt_idx, elt_purpose, elt_value) { + unsigned HOST_WIDE_INT ix; + tree elt_index, elt_value; + FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), ix, elt_index, elt_value) { // Find and decode the constructor's value. Constant *Val = Convert(elt_value); SomeVal = Val; // Get the index position of the element within the array. Note that this // can be NULL_TREE, which means that it belongs in the next available slot. -tree index = elt_purpose; +tree index = elt_index; // The first and last field to fill in, inclusive. unsigned FieldOffset, FieldLastOffset; @@ -5740,10 +5744,10 @@ ResultElts.resize(STy-getNumElements()); tree NextField = TYPE_FIELDS(TREE_TYPE(exp)); - unsigned HOST_WIDE_INT elt_idx; - tree elt_purpose, elt_value; - FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), elt_idx, elt_purpose, elt_value) { -tree Field = elt_purpose;// The fielddecl for the field. + unsigned HOST_WIDE_INT ix; + tree elt_value; + tree Field; // The fielddecl for the field. +
[llvm-commits] [llvm] r39813 - /llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
Author: lattner Date: Fri Jul 13 11:24:10 2007 New Revision: 39813 URL: http://llvm.org/viewvc/llvm-project?rev=39813view=rev Log: Fix CodeGen/Generic/print-arith-fp.ll on sparc (PR1551) Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=39813r1=39812r2=39813view=diff == --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Fri Jul 13 11:24:10 2007 @@ -191,8 +191,10 @@ setOperationAction(ISD::FSIN , MVT::f64, Expand); setOperationAction(ISD::FCOS , MVT::f64, Expand); + setOperationAction(ISD::FREM , MVT::f64, Expand); setOperationAction(ISD::FSIN , MVT::f32, Expand); setOperationAction(ISD::FCOS , MVT::f32, Expand); + setOperationAction(ISD::FREM , MVT::f32, Expand); setOperationAction(ISD::CTPOP, MVT::i32, Expand); setOperationAction(ISD::CTTZ , MVT::i32, Expand); setOperationAction(ISD::CTLZ , MVT::i32, Expand); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4-2] r39809 - in /llvm-gcc-4-2/trunk: gcc/Makefile.in gcc/configure gcc/configure.ac libcpp/configure libcpp/configure.ac
On Jul 13, 2007, at 6:04 AM, Duncan Sands wrote: Author: baldrick Date: Fri Jul 13 08:04:38 2007 New Revision: 39809 URL: http://llvm.org/viewvc/llvm-project?rev=39809view=rev Log: Forward port of [129252] and [129261]. Awesome, thanks Duncan! -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39816 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/PostRASchedulerList.cpp lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/
Author: johannes Date: Fri Jul 13 12:13:54 2007 New Revision: 39816 URL: http://llvm.org/viewvc/llvm-project?rev=39816view=rev Log: Skeleton of post-RA scheduler; doesn't do anything yet. Change name of -sched option and DEBUG_TYPE to pre-RA-sched; adjust testcases. Added: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Modified: llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp llvm/trunk/test/CodeGen/Generic/2006-07-03-schedulers.ll llvm/trunk/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=39816r1=39815r2=39816view=diff == --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Fri Jul 13 12:13:54 2007 @@ -89,6 +89,9 @@ /// FunctionPass *createPrologEpilogCodeInserter(); + /// createPostRAScheduler - under development. + FunctionPass *createPostRAScheduler(); + /// BranchFolding Pass - This pass performs machine code CFG based /// optimizations to delete branches to branches, eliminate branches to /// successor blocks (creating fall throughs), and eliminating branches over Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=39816r1=39815r2=39816view=diff == --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Fri Jul 13 12:13:54 2007 @@ -78,6 +78,9 @@ // Insert prolog/epilog code. Eliminate abstract frame index references... PM.add(createPrologEpilogCodeInserter()); + // Second pass scheduler. + PM.add(createPostRAScheduler()); + // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); @@ -181,6 +184,9 @@ if (PrintMachineCode) // Print the register-allocated code PM.add(createMachineFunctionPrinterPass(cerr)); + // Second pass scheduler. + PM.add(createPostRAScheduler()); + // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); Added: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=39816view=auto == --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (added) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Fri Jul 13 12:13:54 2007 @@ -0,0 +1,81 @@ +//===- SchedulePostRAList.cpp - list scheduler ===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Dale Johannesen and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===--===// +// +// This implements a top-down list scheduler, using standard algorithms. +// The basic approach uses a priority queue of available nodes to schedule. +// One at a time, nodes are taken from the priority queue (thus in priority +// order), checked for legality to schedule, and emitted if legal. +// +// Nodes may not be legal to schedule either due to structural hazards (e.g. +// pipeline or resource constraints) or because an input to the instruction has +// not completed execution. +// +//===--===// + +#define DEBUG_TYPE post-RA-sched +#include llvm/CodeGen/Passes.h +#include llvm/CodeGen/MachineFunctionPass.h +#include llvm/Support/Debug.h +//#include llvm/ADT/Statistic.h +//#include climits +//#include queue +#include llvm/Support/CommandLine.h +using namespace llvm; + +namespace { + bool NoPostRAScheduling; + + // When this works it will be on by default. + cl::optbool, true + DisablePostRAScheduler(disable-post-RA-scheduler, + cl::desc(Disable scheduling after register allocation), + cl::location(NoPostRAScheduling), + cl::init(true)); + + class VISIBILITY_HIDDEN SchedulePostRATDList : public MachineFunctionPass { + public: +static char ID; +SchedulePostRATDList() : MachineFunctionPass((intptr_t)ID) {} + private: +MachineFunction *MF; +const TargetMachine *TM; +
Re: [llvm-commits] [llvm-gcc-4-2] r39811 - in /llvm-gcc-4-2/trunk/gcc: llvm-convert.cpp llvm-debug.cpp
On Jul 13, 2007, at 8:43 AM, Duncan Sands wrote: Include tm_p.h to get the definition of REG_CLASS_FROM_CONSTRAINT. Simplify use of vectors with constructors, and fix some small conversion bugs while there (eg: index used for value, value used for index). Ressurect ConvertUnionCONSTRUCTOR, make it compile. FILE_TYPE has gone forever - it seems pointless to keep the comment. Before CHAR_TYPE was nuked, dwarf2out was changed to treat CHAR_TYPE and INTEGER_TYPE identically - so try to test for pascal strings using INTEGER_TYPE rather than CHAR_TYPE. Determine the encoding for INTEGER_TYPE in the same way as in dwarf2out. Break long lines. Thanks! - Devang ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39817 - in /llvm/trunk/lib/CodeGen: LLVMTargetMachine.cpp PostRASchedulerList.cpp
Author: johannes Date: Fri Jul 13 12:31:29 2007 New Revision: 39817 URL: http://llvm.org/viewvc/llvm-project?rev=39817view=rev Log: Modify previous patch per review comments. Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=39817r1=39816r2=39817view=diff == --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Fri Jul 13 12:31:29 2007 @@ -79,7 +79,8 @@ PM.add(createPrologEpilogCodeInserter()); // Second pass scheduler. - PM.add(createPostRAScheduler()); + if (!Fast) +PM.add(createPostRAScheduler()); // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) @@ -185,7 +186,8 @@ PM.add(createMachineFunctionPrinterPass(cerr)); // Second pass scheduler. - PM.add(createPostRAScheduler()); + if (!Fast) +PM.add(createPostRAScheduler()); // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=39817r1=39816r2=39817view=diff == --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Fri Jul 13 12:31:29 2007 @@ -1,4 +1,4 @@ -//===- SchedulePostRAList.cpp - list scheduler ===// +//===- SchedulePostRAList.cpp - list scheduler ===// // // The LLVM Compiler Infrastructure // ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39819 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp
Author: resistor Date: Fri Jul 13 13:26:26 2007 New Revision: 39819 URL: http://llvm.org/viewvc/llvm-project?rev=39819view=rev Log: Be more aggressive in removing dead stores, and in removing instructions trivially dead after DSE. This drastically improves the effect of FastDSE on kimwitu++. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39819r1=39818r2=39819view=diff == --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Fri Jul 13 13:26:26 2007 @@ -56,6 +56,14 @@ SetVectorInstruction* possiblyDead); void DeleteDeadInstructionChains(Instruction *I, SetVectorInstruction* DeadInsts); +void TranslatePointerBitCasts(Value* v) { + assert(isaPointerType(v-getType()) Translating a non-pointer type?); + + // See through pointer-to-pointer bitcasts + while (BitCastInst* C = dyn_castBitCastInst(v)) +if (isaPointerType(C-getSrcTy())) + v = C-getOperand(0); +} // getAnalysisUsage - We require post dominance frontiers (aka Control // Dependence Graph) @@ -93,6 +101,7 @@ pointer = S-getPointerOperand(); else if (FreeInst* F = dyn_castFreeInst(BBI)) pointer = F-getPointerOperand(); + assert(pointer Not a free or a store?); StoreInst* last = lastStore[pointer]; @@ -110,6 +119,8 @@ // DCE instructions only used to calculate that store if (Instruction* D = dyn_castInstruction(last-getOperand(0))) possiblyDead.insert(D); + if (Instruction* D = dyn_castInstruction(last-getOperand(1))) +possiblyDead.insert(D); last-eraseFromParent(); NumFastStores++; @@ -165,7 +176,7 @@ Value* depPointer = dependency-getPointerOperand(); unsigned depPointerSize = TD.getTypeSize(dependency-getOperand(0)-getType()); - + // Check for aliasing AliasAnalysis::AliasResult A = AA.alias(F-getPointerOperand(), ~0UL, depPointer, depPointerSize); @@ -177,6 +188,8 @@ // DCE instructions only used to calculate that store if (Instruction* D = dyn_castInstruction(dependency-getOperand(0))) possiblyDead.insert(D); +if (Instruction* D = dyn_castInstruction(dependency-getOperand(1))) + possiblyDead.insert(D); dependency-eraseFromParent(); NumFastStores++; @@ -216,23 +229,24 @@ // If we find a store whose pointer is dead... if (StoreInst* S = dyn_castStoreInst(BBI)) { - if (deadPointers.count(S-getPointerOperand())){ + Value* pointerOperand = S-getPointerOperand(); + // See through pointer-to-pointer bitcasts + TranslatePointerBitCasts(pointerOperand); + + if (deadPointers.count(pointerOperand)){ // Remove it! MD.removeInstruction(S); // DCE instructions only used to calculate that store if (Instruction* D = dyn_castInstruction(S-getOperand(0))) possiblyDead.insert(D); +if (Instruction* D = dyn_castInstruction(S-getOperand(1))) + possiblyDead.insert(D); BBI++; S-eraseFromParent(); NumFastStores++; MadeChange = true; - - // If we can't trivially delete this store, consider it undead - } else { -killPointer = S-getPointerOperand(); -killPointerSize = TD.getTypeSize(S-getOperand(0)-getType()); } // If we encounter a use of the pointer, it is no longer considered dead @@ -261,7 +275,7 @@ // See if the call site touches it AliasAnalysis::ModRefResult A = AA.getModRefInfo(CallSite::get(BBI), *I, pointerSize); -if (A != AliasAnalysis::NoModRef) +if (A == AliasAnalysis::ModRef || A == AliasAnalysis::Ref) dead.push_back(*I); } @@ -315,6 +329,8 @@ // DCE instructions only used to calculate that store if (Instruction* D = dyn_castInstruction(S-getOperand(0))) possiblyDead.insert(D); + if (Instruction* D = dyn_castInstruction(S-getOperand(1))) +possiblyDead.insert(D); BBI++; S-eraseFromParent(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [test-suite] r39820 - in /test-suite/trunk: Makefile.programs SingleSource/Benchmarks/Shootout-C++/Makefile
Author: evancheng Date: Fri Jul 13 14:13:15 2007 New Revision: 39820 URL: http://llvm.org/viewvc/llvm-project?rev=39820view=rev Log: Force Shootout-C++ llc executables to be linked with g++. Modified: test-suite/trunk/Makefile.programs test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/Makefile Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=39820r1=39819r2=39820view=diff == --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Fri Jul 13 14:13:15 2007 @@ -109,7 +109,9 @@ # the LINK_WITH_LLVMGCC_LIBS variable is set, then the link is done that # way. Unfortunately, this can't help JIT because it is always linked with # the libraries of lli. +ifndef LLVMGCCLD LLVMGCCLD := $(CC) +endif ifdef LINK_WITH_LLVMGCC_LIBS #LLVMGCCLD := $(CC) -L$(LLVMGCCDIR)/lib/gcc/$(LLVMGCCARCH) -L$(LLVMGCCDIR)/lib/debug -L$(LLVMGCCDIR)/lib LLVMGCCLD := $(CC) -L$(LLVMGCCDIR)/lib/gcc/$(LLVMGCCARCH) -L$(LLVMGCCDIR)/lib Modified: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Shootout-C%2B%2B/Makefile?rev=39820r1=39819r2=39820view=diff == --- test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/Makefile (original) +++ test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/Makefile Fri Jul 13 14:13:15 2007 @@ -1,8 +1,7 @@ LEVEL = ../../.. CXXFLAGS += -Wno-deprecated CPPFLAGS += -Wno-deprecated -LDFLAGS += -lm -lstdc++ -LIBS += -lstdc++ +LLVMGCCLD := $(CXX) REQUIRES_EH_SUPPORT=1 FP_TOLERANCE = 0.0001 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [poolalloc] r39821 - /poolalloc/branches/SVA/lib/DSA/Local.cpp
Author: criswell Date: Fri Jul 13 14:35:24 2007 New Revision: 39821 URL: http://llvm.org/viewvc/llvm-project?rev=39821view=rev Log: Changed the system call number/function map to record the actual system call number instead of the LLVM Value representing the number. Multiple LLVM Values can represent the same number. Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/DSA/Local.cpp?rev=39821r1=39820r2=39821view=diff == --- poolalloc/branches/SVA/lib/DSA/Local.cpp (original) +++ poolalloc/branches/SVA/lib/DSA/Local.cpp Fri Jul 13 14:35:24 2007 @@ -40,7 +40,7 @@ static Statistic CacheAllocs (dsa, Number of kmem_cache_alloc calls); static Statistic KMallocs(dsa, Number of kmalloc calls); static Statistic GlobalPools (dsa, Number of global pools); -std::mapValue*, Function* syscalls; +std::mapunsigned int, Function* syscalls; #endif Statistic stat_unknown (dsa, Number of markunknowns); @@ -1443,8 +1443,9 @@ } if (isSyscall6) { -assert (syscalls[CS.getArgument(0)] No registered syscall by that number); -Callee = syscalls[CS.getArgument(0)]; +assert (isaConstantInt(CS.getArgument(0)) llva_syscall6 called with non-const argument); +ConstantInt * C = dyn_castConstantInt(CS.getArgument(0)); +Callee = syscalls[C-getSExtValue()]; } // Set up the return value... @@ -1675,8 +1676,9 @@ if (lrs) for (Value::use_iterator ii = lrs-use_begin(), ee = lrs-use_end(); ii != ee; ++ii) if (CallInst* CI = dyn_castCallInst(*ii)) -if (CI-getCalledFunction() == lrs) { - Value* num = CI-getOperand(1); +if ((CI-getCalledFunction() == lrs) (isaConstantInt(CI-getOperand(1 { + ConstantInt * CNum = dyn_castConstantInt(CI-getOperand(1)); + unsigned int num = CNum-getSExtValue(); Value* fun = CI-getOperand(2); if (ConstantExpr* CE = dyn_castConstantExpr(fun)) if (CE-getOpcode() == Instruction::Cast) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39823 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Author: djg Date: Fri Jul 13 15:03:40 2007 New Revision: 39823 URL: http://llvm.org/viewvc/llvm-project?rev=39823view=rev Log: Don't call SimplifyVBinOp for non-vector operations, following earlier review feedback. This theoretically makes the common (scalar) case more efficient. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=39823r1=39822r2=39823view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Jul 13 15:03:40 2007 @@ -851,8 +851,10 @@ MVT::ValueType VT = N0.getValueType(); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (add x, undef) - undef if (N0.getOpcode() == ISD::UNDEF) @@ -1007,8 +1009,10 @@ MVT::ValueType VT = N0.getValueType(); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (sub x, x) - 0 if (N0 == N1) @@ -1047,8 +1051,10 @@ MVT::ValueType VT = N0.getValueType(); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (mul x, undef) - 0 if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) @@ -1129,8 +1135,10 @@ MVT::ValueType VT = N-getValueType(0); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (sdiv c1, c2) - c1/c2 if (N0C N1C !N1C-isNullValue()) @@ -1205,8 +1213,10 @@ MVT::ValueType VT = N-getValueType(0); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (udiv c1, c2) - c1/c2 if (N0C N1C !N1C-isNullValue()) @@ -1416,8 +1426,10 @@ MVT::ValueType VT = N1.getValueType(); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (and x, undef) - 0 if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) @@ -1604,8 +1616,10 @@ unsigned OpSizeInBits = MVT::getSizeInBits(VT); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (or x, undef) - -1 if (N0.getOpcode() == ISD::UNDEF || N1.getOpcode() == ISD::UNDEF) @@ -1890,8 +1904,10 @@ MVT::ValueType VT = N0.getValueType(); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (xor x, undef) - undef if (N0.getOpcode() == ISD::UNDEF) @@ -3009,8 +3025,10 @@ MVT::ValueType VT = N-getValueType(0); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (fadd c1, c2) - c1+c2 if (N0CFP N1CFP) @@ -3042,8 +3060,10 @@ MVT::ValueType VT = N-getValueType(0); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (fsub c1, c2) - c1-c2 if (N0CFP N1CFP) @@ -3069,8 +3089,10 @@ MVT::ValueType VT = N-getValueType(0); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if (FoldedVOp.Val) return FoldedVOp; + if (MVT::isVector(VT)) { +SDOperand FoldedVOp = SimplifyVBinOp(N); +if (FoldedVOp.Val) return FoldedVOp; + } // fold (fmul c1, c2) - c1*c2 if (N0CFP N1CFP) @@ -3113,8 +3135,10 @@ MVT::ValueType VT = N-getValueType(0); // fold vector ops - SDOperand FoldedVOp = SimplifyVBinOp(N); - if
[llvm-commits] [llvm] r39825 - /llvm/trunk/docs/LangRef.html
Author: lattner Date: Fri Jul 13 15:08:19 2007 New Revision: 39825 URL: http://llvm.org/viewvc/llvm-project?rev=39825view=rev Log: remove obsolete note Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=39825r1=39824r2=39825view=diff == --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Fri Jul 13 15:08:19 2007 @@ -710,11 +710,6 @@ function). Because the block can have no predecessors, it also cannot have any a href=#i_phiPHI nodes/a./p -pLLVM functions are identified by their name and type signature. Hence, two -functions with the same name but different parameter lists or return values are -considered different functions, and LLVM will resolve references to each -appropriately./p - pLLVM allows an explicit section to be specified for functions. If the target supports it, it will emit functions to the section specified./p ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39827 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Author: djg Date: Fri Jul 13 15:14:11 2007 New Revision: 39827 URL: http://llvm.org/viewvc/llvm-project?rev=39827view=rev Log: Fix the comment for LegalizeOp to more accurately reflect what it does. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=39827r1=39826r2=39827view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Jul 13 15:14:11 2007 @@ -551,9 +551,10 @@ } -/// LegalizeOp - We know that the specified value has a legal type. -/// Recursively ensure that the operands have legal types, then return the -/// result. +/// LegalizeOp - We know that the specified value has a legal type, and +/// that its operands are legal. Now ensure that the operation itself +/// is legal, recursively ensuring that the operands' operations remain +/// legal. SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { assert(isTypeLegal(Op.getValueType()) Caller should expand or promote operands that are not legal!); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39828 - in /llvm/trunk/utils/TableGen: CodeGenTarget.cpp CodeGenTarget.h
Author: djg Date: Fri Jul 13 15:16:50 2007 New Revision: 39828 URL: http://llvm.org/viewvc/llvm-project?rev=39828view=rev Log: Eliminate an unused parameter. Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp llvm/trunk/utils/TableGen/CodeGenTarget.h Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=39828r1=39827r2=39828view=diff == --- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Fri Jul 13 15:16:50 2007 @@ -30,7 +30,7 @@ /// getValueType - Return the MCV::ValueType that the specified TableGen record /// corresponds to. -MVT::ValueType llvm::getValueType(Record *Rec, const CodeGenTarget *CGT) { +MVT::ValueType llvm::getValueType(Record *Rec) { return (MVT::ValueType)Rec-getValueAsInt(Value); } @@ -623,7 +623,7 @@ Record *TyEl = TypeList-getElementAsRecord(i); assert(TyEl-isSubClassOf(LLVMType) Expected a type!); ArgTypes.push_back(TyEl-getValueAsString(TypeVal)); -MVT::ValueType VT = getValueType(TyEl-getValueAsDef(VT), CGT); +MVT::ValueType VT = getValueType(TyEl-getValueAsDef(VT)); isOverloaded |= VT == MVT::iAny; ArgVTs.push_back(VT); ArgTypeDefs.push_back(TyEl); Modified: llvm/trunk/utils/TableGen/CodeGenTarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.h?rev=39828r1=39827r2=39828view=diff == --- llvm/trunk/utils/TableGen/CodeGenTarget.h (original) +++ llvm/trunk/utils/TableGen/CodeGenTarget.h Fri Jul 13 15:16:50 2007 @@ -35,7 +35,7 @@ /// getValueType - Return the MVT::ValueType that the specified TableGen record /// corresponds to. -MVT::ValueType getValueType(Record *Rec, const CodeGenTarget *CGT = 0); +MVT::ValueType getValueType(Record *Rec); std::string getName(MVT::ValueType T); std::string getEnumName(MVT::ValueType T); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39822 - /llvm/trunk/docs/LangRef.html
Author: lattner Date: Fri Jul 13 15:01:46 2007 New Revision: 39822 URL: http://llvm.org/viewvc/llvm-project?rev=39822view=rev Log: fix some bugs in the manual Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=39822r1=39821r2=39822view=diff == --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Fri Jul 13 15:01:46 2007 @@ -667,7 +667,7 @@ div class=doc_code pre -%G = constant float 1.0, section foo, align 4 [EMAIL PROTECTED] = constant float 1.0, section foo, align 4 /pre /div @@ -1382,7 +1382,7 @@ ddStructure constants are represented with notation similar to structure type definitions (a comma separated list of elements, surrounded by braces (tt{}/tt)). For example: tt{ i32 4, float 17.0, i32* %G }/tt, - where tt%G/tt is declared as tt%G = external global i32/tt. Structure constants + where tt%G/tt is declared as tt@G = external global i32/tt. Structure constants must have a href=#t_structstructure type/a, and the number and types of elements must match those specified by the type. /dd ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39834 - in /llvm/trunk/lib/Transforms/Scalar: LoopRotation.cpp LoopUnswitch.cpp
Author: dpatel Date: Fri Jul 13 16:53:42 2007 New Revision: 39834 URL: http://llvm.org/viewvc/llvm-project?rev=39834view=rev Log: Disable claims to preserve analysis until open issues are resolved. Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=39834r1=39833r2=39834view=diff == --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Fri Jul 13 16:53:42 2007 @@ -62,13 +62,6 @@ AU.addPreservedLoopInfo(); AU.addRequiredID(LoopSimplifyID); AU.addPreservedID(LoopSimplifyID); - AU.addPreservedDominatorTree(); - // Request DominanceFrontier now, even though Loop Rotate does - // not use it. This allows Pass Manager to schedule Dominance - // Frontier early enough such that one LPPassManager can handle - // loop rotate as well as licm pass. - AU.addRequiredDominanceFrontier(); - AU.addPreservedDominanceFrontier(); } // Helper functions Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=39834r1=39833r2=39834view=diff == --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Fri Jul 13 16:53:42 2007 @@ -83,12 +83,9 @@ virtual void getAnalysisUsage(AnalysisUsage AU) const { AU.addRequiredID(LoopSimplifyID); AU.addPreservedID(LoopSimplifyID); - AU.addPreservedDominatorTree(); - AU.addPreservedDominanceFrontier(); AU.addRequiredLoopInfo(); AU.addPreservedLoopInfo(); AU.addRequiredID(LCSSAID); - AU.addPreservedID(LCSSAID); } private: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39839 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp
Author: resistor Date: Fri Jul 13 17:50:48 2007 New Revision: 39839 URL: http://llvm.org/viewvc/llvm-project?rev=39839view=rev Log: Handle GEPs with all-zero indices in the same way we handle pointer-pointer bitcasts. Also, fix a potentia infinite loop. This brings FastDSE to parity with old DSE on 175.vpr. Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Modified: llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp?rev=39839r1=39838r2=39839view=diff == --- llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp Fri Jul 13 17:50:48 2007 @@ -60,9 +60,18 @@ assert(isaPointerType(v-getType()) Translating a non-pointer type?); // See through pointer-to-pointer bitcasts - while (BitCastInst* C = dyn_castBitCastInst(v)) -if (isaPointerType(C-getSrcTy())) - v = C-getOperand(0); + while (isaBitCastInst(v) || isaGetElementPtrInst(v)) +if (BitCastInst* C = dyn_castBitCastInst(v)) { + if (isaPointerType(C-getSrcTy())) +v = C-getOperand(0); + else +break; +} else if (GetElementPtrInst* G = dyn_castGetElementPtrInst(v)) { + if (G-hasAllZeroIndices()) +v = G-getOperand(0); + else +break; +} } // getAnalysisUsage - We require post dominance frontiers (aka Control ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r39839 - /llvm/trunk/lib/Transforms/Scalar/FastDSE.cpp
Handle GEPs with all-zero indices in the same way we handle pointer- pointer bitcasts. Also, fix a potentia infinite loop. Nifty. + while (isaBitCastInst(v) || isaGetElementPtrInst(v)) +if (BitCastInst* C = dyn_castBitCastInst(v)) { + if (isaPointerType(C-getSrcTy())) +v = C-getOperand(0); + else +break; Note that if you know the result type of a bitcast is a pointer, that you are guaranteed that the operand is also a pointer type, there is no need to check. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39843 - /llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td
Author: evancheng Date: Fri Jul 13 18:55:50 2007 New Revision: 39843 URL: http://llvm.org/viewvc/llvm-project?rev=39843view=rev Log: Fix for PR1540: Specify F0, F1 are sub-registers of D0, etc. Modified: llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td Modified: llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td?rev=39843r1=39842r2=39843view=diff == --- llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td Fri Jul 13 18:55:50 2007 @@ -26,9 +26,9 @@ let Num = num; } // Rd - Slots in the FP register file for 64-bit floating-point values. -class Rdbits5 num, string n, listRegister aliases : SparcRegn { +class Rdbits5 num, string n, listRegister subregs : SparcRegn { let Num = num; - let Aliases = aliases; + let SubRegs = subregs; } // Integer registers ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39844 - in /llvm/trunk: include/llvm/Transforms/Scalar.h lib/Transforms/Utils/LCSSA.cpp
Author: dpatel Date: Fri Jul 13 18:57:11 2007 New Revision: 39844 URL: http://llvm.org/viewvc/llvm-project?rev=39844view=rev Log: Make LCSSA a loop pass. Modified: llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=39844r1=39843r2=39844view=diff == --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Fri Jul 13 18:57:11 2007 @@ -306,7 +306,7 @@ // LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop // optimizations. // -FunctionPass *createLCSSAPass(); +LoopPass *createLCSSAPass(); extern const PassInfo *LCSSAID; //===--===// Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=39844r1=39843r2=39844view=diff == --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Fri Jul 13 18:57:11 2007 @@ -36,7 +36,8 @@ #include llvm/ADT/SetVector.h #include llvm/ADT/Statistic.h #include llvm/Analysis/Dominators.h -#include llvm/Analysis/LoopInfo.h +#include llvm/Analysis/LoopPass.h +#include llvm/Analysis/ScalarEvolution.h #include llvm/Support/CFG.h #include llvm/Support/Compiler.h #include algorithm @@ -46,17 +47,17 @@ STATISTIC(NumLCSSA, Number of live out of a loop variables); namespace { - struct VISIBILITY_HIDDEN LCSSA : public FunctionPass { + struct VISIBILITY_HIDDEN LCSSA : public LoopPass { static char ID; // Pass identification, replacement for typeid -LCSSA() : FunctionPass((intptr_t)ID) {} +LCSSA() : LoopPass((intptr_t)ID) {} // Cached analysis information for the current function. LoopInfo *LI; DominatorTree *DT; std::vectorBasicBlock* LoopBlocks; -virtual bool runOnFunction(Function F); -bool visitSubloop(Loop* L); +virtual bool runOnLoop(Loop *L, LPPassManager LPM); + void ProcessInstruction(Instruction* Instr, const std::vectorBasicBlock* exitBlocks); @@ -69,7 +70,9 @@ AU.addRequiredID(LoopSimplifyID); AU.addPreservedID(LoopSimplifyID); AU.addRequiredLoopInfo(); + AU.addPreservedLoopInfo(); AU.addRequiredDominatorTree(); + AU.addPreservedScalarEvolution(); } private: void getLoopValuesUsedOutsideLoop(Loop *L, @@ -88,28 +91,15 @@ RegisterPassLCSSA X(lcssa, Loop-Closed SSA Form Pass); } -FunctionPass *llvm::createLCSSAPass() { return new LCSSA(); } +LoopPass *llvm::createLCSSAPass() { return new LCSSA(); } const PassInfo *llvm::LCSSAID = X.getPassInfo(); /// runOnFunction - Process all loops in the function, inner-most out. -bool LCSSA::runOnFunction(Function F) { - bool changed = false; +bool LCSSA::runOnLoop(Loop *L, LPPassManager LPM) { - LI = getAnalysisLoopInfo(); + LI = LPM.getAnalysisLoopInfo(); DT = getAnalysisDominatorTree(); - for (LoopInfo::iterator I = LI-begin(), E = LI-end(); I != E; ++I) -changed |= visitSubloop(*I); - - return changed; -} - -/// visitSubloop - Recursively process all subloops, and then process the given -/// loop if it has live-out values. -bool LCSSA::visitSubloop(Loop* L) { - for (Loop::iterator I = L-begin(), E = L-end(); I != E; ++I) -visitSubloop(*I); - // Speed up queries by creating a sorted list of blocks LoopBlocks.clear(); LoopBlocks.insert(LoopBlocks.end(), L-block_begin(), L-block_end()); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39845 - /llvm/trunk/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll
Author: evancheng Date: Fri Jul 13 18:57:33 2007 New Revision: 39845 URL: http://llvm.org/viewvc/llvm-project?rev=39845view=rev Log: Added test case from PR1540. Added: llvm/trunk/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll Added: llvm/trunk/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll?rev=39845view=auto == --- llvm/trunk/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll (added) +++ llvm/trunk/test/CodeGen/SPARC/2007-07-05-LiveIntervalAssert.ll Fri Jul 13 18:57:33 2007 @@ -0,0 +1,11 @@ +; RUN: llvm-as %s | llc -march=sparc +; PR1540 + +declare float @sinf(float) +declare double @sin(double) +define double @test_sin(float %F) { +%G = call float @sinf( float %F ) ; float [#uses=1] +%H = fpext float %G to double ; double [#uses=1] +%I = call double @sin( double %H ) ; double [#uses=1] +ret double %I +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39851 - in /llvm/trunk: include/llvm/Support/ConstantRange.h lib/Support/ConstantRange.cpp
Author: nicholas Date: Fri Jul 13 21:51:34 2007 New Revision: 39851 URL: http://llvm.org/viewvc/llvm-project?rev=39851view=rev Log: Add alternate ConstantRange intersection algorithm. Modified: llvm/trunk/include/llvm/Support/ConstantRange.h llvm/trunk/lib/Support/ConstantRange.cpp Modified: llvm/trunk/include/llvm/Support/ConstantRange.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ConstantRange.h?rev=39851r1=39850r2=39851view=diff == --- llvm/trunk/include/llvm/Support/ConstantRange.h (original) +++ llvm/trunk/include/llvm/Support/ConstantRange.h Fri Jul 13 21:51:34 2007 @@ -143,6 +143,12 @@ /// ConstantRange intersectWith(const ConstantRange CR) const; + /// maximalIntersectWith - Return the range that results from the intersection + /// of this range with another range. The resultant range is guaranteed to + /// include all elements contained in both input ranges, and is also + /// guaranteed to be the smallest possible set that does so. + ConstantRange maximalIntersectWith(const ConstantRange CR) const; + /// unionWith - Return the range that results from the union of this range /// with another range. The resultant range is guaranteed to include the /// elements of both sets, but may contain more. For example, [3, 9) union Modified: llvm/trunk/lib/Support/ConstantRange.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ConstantRange.cpp?rev=39851r1=39850r2=39851view=diff == --- llvm/trunk/lib/Support/ConstantRange.cpp (original) +++ llvm/trunk/lib/Support/ConstantRange.cpp Fri Jul 13 21:51:34 2007 @@ -246,6 +246,87 @@ return *this; } +/// maximalIntersectWith - Return the range that results from the intersection +/// of this range with another range. The resultant range is guaranteed to +/// include all elements contained in both input ranges, and is also guaranteed +/// to be the smallest possible set that does so. +ConstantRange ConstantRange::maximalIntersectWith(const ConstantRange CR) const { + assert(getBitWidth() == CR.getBitWidth() + ConstantRange types don't agree!); + + // Handle common cases. + if ( isEmptySet() || CR.isFullSet()) return *this; + if (CR.isEmptySet() ||isFullSet()) return CR; + + if (!isWrappedSet() CR.isWrappedSet()) +return CR.maximalIntersectWith(*this); + + if (!isWrappedSet() !CR.isWrappedSet()) { +if (Lower.ult(CR.Lower)) { + if (Upper.ule(CR.Lower)) +return ConstantRange(getBitWidth(), false); + + if (Upper.ult(CR.Upper)) +return ConstantRange(CR.Lower, Upper); + + return CR; +} else { + if (Upper.ult(CR.Upper)) +return *this; + + if (Lower.ult(CR.Upper)) +return ConstantRange(Lower, CR.Upper); + + return ConstantRange(getBitWidth(), false); +} + } + + if (isWrappedSet() !CR.isWrappedSet()) { +if (CR.Lower.ult(Upper)) { + if (CR.Upper.ult(Upper)) +return CR; + + if (CR.Upper.ult(Lower)) +return ConstantRange(CR.Lower, Upper); + + if (getSetSize().ult(CR.getSetSize())) +return *this; + else +return CR; +} else if (CR.Lower.ult(Lower)) { + if (CR.Upper.ule(Lower)) +return ConstantRange(getBitWidth(), false); + + return ConstantRange(Lower, CR.Upper); +} +return CR; + } + + if (CR.Upper.ult(Upper)) { +if (CR.Lower.ult(Upper)) { + if (getSetSize().ult(CR.getSetSize())) +return *this; + else +return CR; +} + +if (CR.Lower.ult(Lower)) + return ConstantRange(Lower, CR.Upper); + +return CR; + } else if (CR.Upper.ult(Lower)) { +if (CR.Lower.ult(Lower)) + return *this; + +return ConstantRange(CR.Lower, Upper); + } + if (getSetSize().ult(CR.getSetSize())) +return *this; + else +return CR; +} + + /// unionWith - Return the range that results from the union of this range with /// another range. The resultant range is guaranteed to include the elements of /// both sets, but may contain more. For example, [3, 9) union [12,15) is ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r39852 - /llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp
Author: nicholas Date: Fri Jul 13 23:28:04 2007 New Revision: 39852 URL: http://llvm.org/viewvc/llvm-project?rev=39852view=rev Log: Use maximal intersection algorithm exclusively. Fixes miscompile bug. Modified: llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Modified: llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp?rev=39852r1=39851r2=39852view=diff == --- llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Fri Jul 13 23:28:04 2007 @@ -938,7 +938,7 @@ std::lower_bound(begin(), E, std::make_pair(Subtree, empty), swo); if (I != end() I-first == Subtree) { - ConstantRange CR2 = I-second.intersectWith(CR); + ConstantRange CR2 = I-second.maximalIntersectWith(CR); assert(!CR2.isEmptySet() !CR2.isSingleElement() Invalid union of ranges.); I-second = CR2; @@ -970,18 +970,18 @@ ConstantRange Range(CR.getBitWidth()); if (LV_s == SGT_BIT) { -Range = Range.intersectWith(makeConstantRange( +Range = Range.maximalIntersectWith(makeConstantRange( hasEQ ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_SGT, CR)); } else if (LV_s == SLT_BIT) { -Range = Range.intersectWith(makeConstantRange( +Range = Range.maximalIntersectWith(makeConstantRange( hasEQ ? ICmpInst::ICMP_SLE : ICmpInst::ICMP_SLT, CR)); } if (LV_u == UGT_BIT) { -Range = Range.intersectWith(makeConstantRange( +Range = Range.maximalIntersectWith(makeConstantRange( hasEQ ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_UGT, CR)); } else if (LV_u == ULT_BIT) { -Range = Range.intersectWith(makeConstantRange( +Range = Range.maximalIntersectWith(makeConstantRange( hasEQ ? ICmpInst::ICMP_ULE : ICmpInst::ICMP_ULT, CR)); } @@ -1104,7 +1104,7 @@ switch (LV) { default: assert(!Impossible lattice value!); case NE: -return CR1.intersectWith(CR2).isEmptySet(); +return CR1.maximalIntersectWith(CR2).isEmptySet(); case ULT: return CR1.getUnsignedMax().ult(CR2.getUnsignedMin()); case ULE: @@ -1170,7 +1170,7 @@ unsigned i = VN.valueNumber(*I, Subtree); ConstantRange CR_Kill = i ? range(i, Subtree) : range(*I); if (CR_Kill.isFullSet()) continue; -Merged = Merged.intersectWith(CR_Kill); +Merged = Merged.maximalIntersectWith(CR_Kill); } if (Merged.isFullSet() || Merged == CR_New) return; @@ -1180,7 +1180,7 @@ void applyRange(unsigned n, const ConstantRange CR, DomTreeDFS::Node *Subtree, VRPSolver *VRP) { - ConstantRange Merged = CR.intersectWith(range(n, Subtree)); + ConstantRange Merged = CR.maximalIntersectWith(range(n, Subtree)); if (Merged.isEmptySet()) { markBlock(VRP); return; @@ -1270,14 +1270,14 @@ ConstantRange CR2 = range(n2, Subtree); if (!CR1.isSingleElement()) { -ConstantRange NewCR1 = CR1.intersectWith(create(LV, CR2)); +ConstantRange NewCR1 = CR1.maximalIntersectWith(create(LV, CR2)); if (NewCR1 != CR1) applyRange(n1, NewCR1, Subtree, VRP); } if (!CR2.isSingleElement()) { -ConstantRange NewCR2 = CR2.intersectWith(create(reversePredicate(LV), -CR1)); +ConstantRange NewCR2 = CR2.maximalIntersectWith( + create(reversePredicate(LV), CR1)); if (NewCR2 != CR2) applyRange(n2, NewCR2, Subtree, VRP); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits