[llvm-commits] [llvm-gcc-4.2] r46160 - /llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
Author: evancheng Date: Fri Jan 18 02:39:55 2008 New Revision: 46160 URL: http://llvm.org/viewvc/llvm-project?rev=46160&view=rev Log: Eliminate a compilation warning: mixing declarations and code is badness. Forgot it's not C++. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c 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=46160&r1=46159&r2=46160&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Fri Jan 18 02:39:55 2008 @@ -15553,26 +15553,6 @@ tree V8HI_type_node = build_vector_type_for_mode (intHI_type_node, V8HImode); tree V1DI_type_node = build_vector_type_for_mode (long_long_integer_type_node, V1DImode); - /* APPLE LOCAL begin LLVM */ -#ifdef ENABLE_LLVM - /* LLVM doesn't initialize the RTL backend, so build_vector_type will assign -all of these types BLKmode. This interferes with i386.c-specific -argument passing routines. As such, give them the correct modes here -manually. */ - TYPE_MODE (V16QI_type_node) = V16QImode; - TYPE_MODE (V2SI_type_node) = V2SImode; - TYPE_MODE (V2SF_type_node) = V2SFmode; - TYPE_MODE (V2DI_type_node) = V2DImode; - TYPE_MODE (V2DF_type_node) = V2DFmode; - TYPE_MODE (V4SF_type_node) = V4SFmode; - TYPE_MODE (V4SI_type_node) = V4SImode; - TYPE_MODE (V4HI_type_node) = V4HImode; - TYPE_MODE (V8QI_type_node) = V8QImode; - TYPE_MODE (V8HI_type_node) = V8HImode; - TYPE_MODE (V1DI_type_node) = V1DImode; -#endif - /* APPLE LOCAL end LLVM */ - tree pchar_type_node = build_pointer_type (char_type_node); tree pcchar_type_node = build_pointer_type ( build_type_variant (char_type_node, 1, 0)); @@ -15860,6 +15840,26 @@ tree float128_type; tree ftype; + /* APPLE LOCAL begin LLVM */ +#ifdef ENABLE_LLVM + /* LLVM doesn't initialize the RTL backend, so build_vector_type will assign +all of these types BLKmode. This interferes with i386.c-specific +argument passing routines. As such, give them the correct modes here +manually. */ + TYPE_MODE (V16QI_type_node) = V16QImode; + TYPE_MODE (V2SI_type_node) = V2SImode; + TYPE_MODE (V2SF_type_node) = V2SFmode; + TYPE_MODE (V2DI_type_node) = V2DImode; + TYPE_MODE (V2DF_type_node) = V2DFmode; + TYPE_MODE (V4SF_type_node) = V4SFmode; + TYPE_MODE (V4SI_type_node) = V4SImode; + TYPE_MODE (V4HI_type_node) = V4HImode; + TYPE_MODE (V8QI_type_node) = V8QImode; + TYPE_MODE (V8HI_type_node) = V8HImode; + TYPE_MODE (V1DI_type_node) = V1DImode; +#endif + /* APPLE LOCAL end LLVM */ + /* The __float80 type. */ if (TYPE_MODE (long_double_type_node) == XFmode) (*lang_hooks.types.register_builtin_type) (long_double_type_node, ___ 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] r46157 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp
Hi Evan, > Do not pass zero sized array, struct, or class using byval attribute. This is > true on both x86-32 and x86-64. is this because LLVM can't handle it, or is it an optimization? If LLVM can't handle passing zero-sized objects using byval, that sounds like a bug... Thanks, Duncan. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46144 - in /llvm/trunk/lib/Target: PowerPC/PPCAsmPrinter.cpp X86/X86AsmPrinter.cpp
On Jan 18, 2008, at 10:13 AM, Tanya Lattner wrote: > Should the test/CodeGen/X86/aligned-comm.ll be un-XFAILED? Its now > XPASSing. > > -Tanya I guess so; given the current state of llvm it is supposed to pass. Longterm what should happen is that tentative definitions ("common") get represented differently in the IR than weak globals; when that happens the test will be incorrect (again). > On Jan 17, 2008, at 3:04 PM, Dale Johannesen wrote: > >> Author: johannes >> Date: Thu Jan 17 17:04:07 2008 >> New Revision: 46144 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=46144&view=rev >> Log: >> Revert the part of 45848 that treated weak globals >> as weak globals rather than commons. While not wrong, >> this change tickled a latent bug in Darwin's strip, >> so revert it for now as a workaround. >> >> >> Modified: >>llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp >>llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp >> >> Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ >> PowerPC/PPCAsmPrinter.cpp?rev=46144&r1=46143&r2=46144&view=diff >> >> = >> = >> >> --- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original) >> +++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Thu Jan 17 >> 17:04:07 2008 >> @@ -917,7 +917,8 @@ >> >> if (C->isNullValue() && /* FIXME: Verify correct */ >> !I->hasSection() && >> -(I->hasInternalLinkage() || I->hasExternalLinkage())) { >> +(I->hasInternalLinkage() || I->hasWeakLinkage() || >> + I->hasLinkOnceLinkage() || I->hasExternalLinkage())) { >> if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, >> avoid it. >> if (I->hasExternalLinkage()) { >> O << "\t.globl " << name << '\n'; >> >> Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/ >> X86AsmPrinter.cpp?rev=46144&r1=46143&r2=46144&view=diff >> >> = >> = >> >> --- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original) >> +++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Thu Jan 17 17:04:07 >> 2008 >> @@ -181,9 +181,8 @@ >> } >> >> if (!I->isThreadLocal() && >> - (I->hasInternalLinkage() || >> - (!Subtarget->isTargetDarwin() && >> -(I->hasWeakLinkage() || I->hasLinkOnceLinkage() { >> + (I->hasInternalLinkage() || I->hasWeakLinkage() || >> + I->hasLinkOnceLinkage())) { >> if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, >> avoid it. >> if (!NoZerosInBSS && TAI->getBSSSection()) >> SwitchToDataSection(TAI->getBSSSection(), I); >> >> >> ___ >> 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 mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46144 - in /llvm/trunk/lib/Target: PowerPC/PPCAsmPrinter.cpp X86/X86AsmPrinter.cpp
Should the test/CodeGen/X86/aligned-comm.ll be un-XFAILED? Its now XPASSing. -Tanya On Jan 17, 2008, at 3:04 PM, Dale Johannesen wrote: > Author: johannes > Date: Thu Jan 17 17:04:07 2008 > New Revision: 46144 > > URL: http://llvm.org/viewvc/llvm-project?rev=46144&view=rev > Log: > Revert the part of 45848 that treated weak globals > as weak globals rather than commons. While not wrong, > this change tickled a latent bug in Darwin's strip, > so revert it for now as a workaround. > > > Modified: > llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp > llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp > > Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PowerPC/PPCAsmPrinter.cpp?rev=46144&r1=46143&r2=46144&view=diff > > == > > --- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Thu Jan 17 > 17:04:07 2008 > @@ -917,7 +917,8 @@ > > if (C->isNullValue() && /* FIXME: Verify correct */ > !I->hasSection() && > -(I->hasInternalLinkage() || I->hasExternalLinkage())) { > +(I->hasInternalLinkage() || I->hasWeakLinkage() || > + I->hasLinkOnceLinkage() || I->hasExternalLinkage())) { >if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, > avoid it. >if (I->hasExternalLinkage()) { > O << "\t.globl " << name << '\n'; > > Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/ > X86AsmPrinter.cpp?rev=46144&r1=46143&r2=46144&view=diff > > == > > --- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Thu Jan 17 17:04:07 > 2008 > @@ -181,9 +181,8 @@ >} > >if (!I->isThreadLocal() && > - (I->hasInternalLinkage() || > - (!Subtarget->isTargetDarwin() && > -(I->hasWeakLinkage() || I->hasLinkOnceLinkage() { > + (I->hasInternalLinkage() || I->hasWeakLinkage() || > + I->hasLinkOnceLinkage())) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, > avoid it. > if (!NoZerosInBSS && TAI->getBSSSection()) >SwitchToDataSection(TAI->getBSSSection(), I); > > > ___ > 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
Re: [llvm-commits] [llvm] r46140 - in /llvm/trunk: include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CellSPU/ lib/Target/Mips/ lib/Target/PowerPC/
On Jan 17, 2008, at 10:03 PM, Duncan Sands wrote: > Hi Chris, >> + LegalizeAction getTruncStoreAction(MVT::ValueType ValVT, >> + MVT::ValueType MemVT) const { >> +assert(ValVT < MVT::LAST_VALUETYPE && MemVT < 32 && > > what is 32? Did you mean <= LAST_INTEGER_VALUETYPE or something? > Now I > come to notice it, it is bad that you have to use < for > LAST_VALUE_TYPE > but <= for LAST_INTEGER_VALUETYPE and friends... 32 is sizeof(uint64_t)*8 / 2, because each entry takes two bits in a uint64_t. I converted this to symbolic math to make it more obvious, and switched to using array_lengthof instead of comparing against MVT::LAST_VALUETYPE directly. >> - /// isStoreXLegal - Return true if the specified store with >> truncation is >> + /// isTruncStoreLegal - Return true if the specified store with >> truncation is >> /// legal on this target. >> - bool isStoreXLegal(MVT::ValueType VT) const { >> -return getStoreXAction(VT) == Legal || getStoreXAction(VT) == >> Custom; >> + bool isTruncStoreLegal(MVT::ValueType ValVT, MVT::ValueType >> MemVT) const { >> +return getTruncStoreAction(ValVT, MemVT) == Legal || >> + getTruncStoreAction(ValVT, MemVT) == Custom; >> } > > It would be more friendly to have isStoreXLegal return false if VT > or MemVT is > an extended value type, rather than having it assert in > getTruncStoreAction... This is tricky because I can't just use isTypeLegal here. PPC for example supports a truncstore from i32 to i8 even though i8 isn't legal. When I return to working on apints, I'll figure out what the right answer is. >> + // If this is an FP_ROUND or TRUNC followed by a store, fold >> this into a >> + // truncating store. We can do this even if this is already a >> truncstore. >> + if ((Value.getOpcode() == ISD::FP_ROUND || Value.getOpcode() == >> ISD::TRUNCATE) >> + && TLI.isTypeLegal(Value.getOperand(0).getValueType()) && >> + Value.Val->hasOneUse() && ST->isUnindexed() && >> + TLI.isTruncStoreLegal(Value.getOperand(0).getValueType(), >> +ST->getStoredVT())) { > > For example, this will assert if ST->getStoredVT() >= 32, eg an > apfloat (!). Also, > before legalize this could be done whether all these guys are legal > or not I suppose. It could be done, but isn't profitable and doesn't simplify the code necessarily. >> + case Expand: >> +// Just store the low part. This may become a non-trunc >> store, so make >> +// sure to use getTruncStore, not UpdateNodeOperands below. >> +ExpandOp(ST->getValue(), Tmp3, Tmp4); >> +return DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST- >> >getSrcValue(), >> + SVOffset, MVT::i8, isVolatile, >> Alignment); > > This may be wrong for apints, since the expanded value type may be > smaller than > ST->getStoredVT(), eg if you are expanding i64, and ST- > >getStoredVT() is i40. I > can take care of this. Ok. As it turns out, I think this code is unreachable currently. If we made the above dag combine xform happen even for illegal xforms before legalize, then this code would be live. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46088 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/DwarfWriter.cpp lib/CodeGen/MachineModuleInfo.cpp
On Jan 17, 2008, at 1:31 AM, Duncan Sands wrote: > Hi Dale, > >> Do not mark EH tables no-dead-strip unless the >> associated function is so marked. > > can you please explain what this means? Dead stripping is a linktime optimization, where code not reachable from main is removed. Functions can be marked no-dead-strip (__attribute__((used)) in gcc) to prevent the linker from removing them, even though they aren't obviously reachable. On Darwin the EH tables do not have a magic association with the corresponding function; they're treated as separate symbols by the linker (and there are subtle differences between the Tiger and Leopard linkers, just to make things more interesting). Generally, storage class and visibility have to match between function and table so the linker does not pick a function/table combination from different files (which doesn't work). So, if a function is marked no-dead-strip, its table must be also. The bug here was that tables were being marked no- dead-strip when the function was not; since the tables have references to the functions, this resulted in the function being kept as well; and if the functions have references to undefined externals that don't exist anywhere, you get a linktime (or, in some circumstances, dynamic linktime) crash. (If I ran the universe, people with dead code that calls undefined externals would have to clean up their code. I don't.) > And is > there a testcase? Not now. This only affects Darwin (and now SPU, but I'm pretty sure this is the right thing there too), fwiw. > Thanks! > > D. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r46181 - in /llvm-gcc-4.2/trunk/gcc: configure configure.ac
Author: dpatel Date: Fri Jan 18 16:41:06 2008 New Revision: 46181 URL: http://llvm.org/viewvc/llvm-project?rev=46181&view=rev Log: Do not raise error if system llvm (e.g. --enable-llvm=/usr/local) is used. Modified: llvm-gcc-4.2/trunk/gcc/configure llvm-gcc-4.2/trunk/gcc/configure.ac Modified: llvm-gcc-4.2/trunk/gcc/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure?rev=46181&r1=46180&r2=46181&view=diff == --- llvm-gcc-4.2/trunk/gcc/configure (original) +++ llvm-gcc-4.2/trunk/gcc/configure Fri Jan 18 16:41:06 2008 @@ -7407,8 +7407,7 @@ fi if test -x "$LLVMBASEPATH/bin/llc$EXEEXT"; then echo Found Installed LLVM Tree in $LLVMBASEPATH - fi - if test x$LLVMBUILDMODE == x; then + elif test x$LLVMBUILDMODE == x; then { { echo "$as_me:$LINENO: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&5 echo "$as_me: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR" >&2;} { (exit 1); exit 1; }; } @@ -8034,7 +8033,7 @@ else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:8037: version of makeinfo is $ac_prog_version" >&5 + echo "configure:8036: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[4-9]*) Modified: llvm-gcc-4.2/trunk/gcc/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure.ac?rev=46181&r1=46180&r2=46181&view=diff == --- llvm-gcc-4.2/trunk/gcc/configure.ac (original) +++ llvm-gcc-4.2/trunk/gcc/configure.ac Fri Jan 18 16:41:06 2008 @@ -892,8 +892,7 @@ fi if test -x "$LLVMBASEPATH/bin/llc$EXEEXT"; then echo Found Installed LLVM Tree in $LLVMBASEPATH - fi - if test x$LLVMBUILDMODE == x; then + elif test x$LLVMBUILDMODE == x; then AC_MSG_ERROR([You must specify valid path to your LLVM tree with --enable-llvm=DIR]) fi ], ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46180 - in /llvm/trunk/utils/buildit: GNUmakefile build_llvm
Author: evancheng Date: Fri Jan 18 15:01:00 2008 New Revision: 46180 URL: http://llvm.org/viewvc/llvm-project?rev=46180&view=rev Log: Fix makefiles to enable Apply style debug build. Modified: llvm/trunk/utils/buildit/GNUmakefile llvm/trunk/utils/buildit/build_llvm Modified: llvm/trunk/utils/buildit/GNUmakefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/GNUmakefile?rev=46180&r1=46179&r2=46180&view=diff == --- llvm/trunk/utils/buildit/GNUmakefile (original) +++ llvm/trunk/utils/buildit/GNUmakefile Fri Jan 18 15:01:00 2008 @@ -41,6 +41,13 @@ LLVM_ASSERTIONS := no endif +# Default is optimized build. +ifeq ($(LLVM_DEBUG),1) +LLVM_OPTIMIZED := no +else +LLVM_OPTIMIZED := yes +endif + ifndef RC_ProjectSourceVersion RC_ProjectSourceVersion = endif @@ -54,7 +61,7 @@ $(SRC)/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \ $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \ $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) \ - $(LLVM_ASSERTIONS) + $(LLVM_ASSERTIONS) $(LLVM_OPTIMIZED) # installhdrs does nothing, because the headers aren't useful until # the compiler is installed. Modified: llvm/trunk/utils/buildit/build_llvm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=46180&r1=46179&r2=46180&view=diff == --- llvm/trunk/utils/buildit/build_llvm (original) +++ llvm/trunk/utils/buildit/build_llvm Fri Jan 18 15:01:00 2008 @@ -44,6 +44,10 @@ # enabled in the LLVM libs/tools. LLVM_ASSERTIONS="$9" +# The tenth parameter is a yes/no that indicates whether this is an optimized +# build. +LLVM_OPTIMIZED="${10}" + # The current working directory is where the build will happen. It may already # contain a partial result of an interrupted build, in which case this script # will continue where it left off. @@ -55,19 +59,6 @@ # If the user has CC set in their environment unset it now unset CC -# The B&I build srcript (~rc/bin/buildit) accepts an '-othercflags' command-line -# flag, and captures the argument to that flag in $RC_NONARCH_CFLAGS (and -# mysteriously prepends '-pipe' thereto). We will allow this to override the -# default $CFLAGS and $CXXFLAGS. - -if [ "x$LLVM_DEBUG" == "x" ]; then -CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}" -OPTIMIZE_OPTS="ENABLE_OPTIMIZED=1" -else -CFLAGS="-g" -OPTIMIZE_OPTS= -fi - # Run the build. @@ -85,7 +76,9 @@ if [ \! -f Makefile.config ]; then $SRC_DIR/llvm/configure --prefix=$DEST_DIR$DEST_ROOT \ ---enable-targets=x86,powerpc,cbe --enable-assertions=$LLVM_ASSERTIONS \ +--enable-targets=x86,powerpc,cbe \ +--enable-assertions=$LLVM_ASSERTIONS \ +--enable-optimized=$LLVM_OPTIMIZED \ || exit 1 fi ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46174 - in /llvm/trunk: lib/Target/PowerPC/PPCISelLowering.cpp test/CodeGen/PowerPC/frounds.ll
Author: johannes Date: Fri Jan 18 13:55:37 2008 New Revision: 46174 URL: http://llvm.org/viewvc/llvm-project?rev=46174&view=rev Log: Implement flt_rounds for PowerPC. Added: llvm/trunk/test/CodeGen/PowerPC/frounds.ll Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=46174&r1=46173&r2=46174&view=diff == --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Jan 18 13:55:37 2008 @@ -109,6 +109,8 @@ setOperationAction(ISD::FCOS , MVT::f32, Expand); setOperationAction(ISD::FREM , MVT::f32, Expand); setOperationAction(ISD::FPOW , MVT::f32, Expand); + + setOperationAction(ISD::FLT_ROUNDS, MVT::i32, Custom); // If we're enabling GP optimizations, use hardware square root if (!TM.getSubtarget().hasFSQRT()) { @@ -2207,6 +2209,67 @@ return FP; } +static SDOperand LowerFLT_ROUNDS(SDOperand Op, SelectionDAG &DAG) { + /* + The rounding mode is in bits 30:31 of FPSR, and has the following + settings: + 00 Round to nearest + 01 Round to 0 + 10 Round to +inf + 11 Round to -inf + + FLT_ROUNDS, on the other hand, expects the following: +-1 Undefined + 0 Round to 0 + 1 Round to nearest + 2 Round to +inf + 3 Round to -inf + + To perform the conversion, we do: +((FPSCR & 0x3) ^ ((~FPSCR & 0x3) >> 1)) + */ + + MachineFunction &MF = DAG.getMachineFunction(); + MVT::ValueType VT = Op.getValueType(); + MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); + std::vector NodeTys; + SDOperand MFFSreg, InFlag; + + // Save FP Control Word to register + NodeTys.push_back(MVT::f64);// return register + NodeTys.push_back(MVT::Flag); // unused in this context + SDOperand Chain = DAG.getNode(PPCISD::MFFS, NodeTys, &InFlag, 0); + + // Save FP register to stack slot + int SSFI = MF.getFrameInfo()->CreateStackObject(8, 8); + SDOperand StackSlot = DAG.getFrameIndex(SSFI, PtrVT); + SDOperand Store = DAG.getStore(DAG.getEntryNode(), Chain, + StackSlot, NULL, 0); + + // Load FP Control Word from low 32 bits of stack slot. + SDOperand Four = DAG.getConstant(4, PtrVT); + SDOperand Addr = DAG.getNode(ISD::ADD, PtrVT, StackSlot, Four); + SDOperand CWD = DAG.getLoad(MVT::i32, Store, Addr, NULL, 0); + + // Transform as necessary + SDOperand CWD1 = +DAG.getNode(ISD::AND, MVT::i32, +CWD, DAG.getConstant(3, MVT::i32)); + SDOperand CWD2 = +DAG.getNode(ISD::SRL, MVT::i32, +DAG.getNode(ISD::AND, MVT::i32, +DAG.getNode(ISD::XOR, MVT::i32, +CWD, DAG.getConstant(3, MVT::i32)), +DAG.getConstant(3, MVT::i32)), +DAG.getConstant(1, MVT::i8)); + + SDOperand RetVal = +DAG.getNode(ISD::XOR, MVT::i32, CWD1, CWD2); + + return DAG.getNode((MVT::getSizeInBits(VT) < 16 ? + ISD::TRUNCATE : ISD::ZERO_EXTEND), VT, RetVal); +} + static SDOperand LowerSHL_PARTS(SDOperand Op, SelectionDAG &DAG) { assert(Op.getNumOperands() == 3 && Op.getValueType() == MVT::i32 && Op.getOperand(1).getValueType() == MVT::i32 && "Unexpected SHL!"); @@ -3027,6 +3090,7 @@ case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG); case ISD::SINT_TO_FP: return LowerSINT_TO_FP(Op, DAG); case ISD::FP_ROUND_INREG: return LowerFP_ROUND_INREG(Op, DAG); + case ISD::FLT_ROUNDS: return LowerFLT_ROUNDS(Op, DAG); // Lower 64-bit shifts. case ISD::SHL_PARTS: return LowerSHL_PARTS(Op, DAG); Added: llvm/trunk/test/CodeGen/PowerPC/frounds.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/frounds.ll?rev=46174&view=auto == --- llvm/trunk/test/CodeGen/PowerPC/frounds.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/frounds.ll Fri Jan 18 13:55:37 2008 @@ -0,0 +1,19 @@ +; RUN: llvm-as | llc -march=ppc32 + +define i32 @foo() { +entry: + %retval = alloca i32; [#uses=2] + %tmp = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %tmp1 = call i32 @llvm.flt.rounds( ); [#uses=1] + store i32 %tmp1, i32* %tmp, align 4 + %tmp2 = load i32* %tmp, align 4 ; [#uses=1] + store i32 %tmp2, i32* %retval, align 4 + br label %return + +return:; preds = %entry + %retval3 = load i32* %retval; [#uses=1] + ret i32 %retval3 +} + +declare i32 @llvm.flt.rounds() nounwind ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http
[llvm-commits] [llvm] r46173 - in /llvm/trunk/test/CodeGen/CellSPU: call.ll call_indirect.ll ctpop.ll dp_farith.ll eqv.ll extract_elt.ll fdiv.ll fneg-fabs.ll immed32.ll immed64.ll int2fp.ll intrinsics
Author: lattner Date: Fri Jan 18 13:53:43 2008 New Revision: 46173 URL: http://llvm.org/viewvc/llvm-project?rev=46173&view=rev Log: remove extraneous &&'s from tests, as Scott is apparently not going to. Modified: llvm/trunk/test/CodeGen/CellSPU/call.ll llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll llvm/trunk/test/CodeGen/CellSPU/ctpop.ll llvm/trunk/test/CodeGen/CellSPU/dp_farith.ll llvm/trunk/test/CodeGen/CellSPU/eqv.ll llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll llvm/trunk/test/CodeGen/CellSPU/fdiv.ll llvm/trunk/test/CodeGen/CellSPU/fneg-fabs.ll llvm/trunk/test/CodeGen/CellSPU/immed32.ll llvm/trunk/test/CodeGen/CellSPU/immed64.ll llvm/trunk/test/CodeGen/CellSPU/int2fp.ll llvm/trunk/test/CodeGen/CellSPU/intrinsics_branch.ll llvm/trunk/test/CodeGen/CellSPU/intrinsics_float.ll llvm/trunk/test/CodeGen/CellSPU/intrinsics_logical.ll llvm/trunk/test/CodeGen/CellSPU/mul_ops.ll llvm/trunk/test/CodeGen/CellSPU/sp_farith.ll llvm/trunk/test/CodeGen/CellSPU/struct_1.ll llvm/trunk/test/CodeGen/CellSPU/struct_2.ll llvm/trunk/test/CodeGen/CellSPU/vec_const.ll llvm/trunk/test/CodeGen/CellSPU/vecinsert.ll Modified: llvm/trunk/test/CodeGen/CellSPU/call.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/call.ll?rev=46173&r1=46172&r2=46173&view=diff == --- llvm/trunk/test/CodeGen/CellSPU/call.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/call.ll Fri Jan 18 13:53:43 2008 @@ -1,5 +1,5 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep brsl%t1.s | count 1 && +; RUN: grep brsl%t1.s | count 1 ; RUN: grep brasl %t1.s | count 1 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" Modified: llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll?rev=46173&r1=46172&r2=46173&view=diff == --- llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll Fri Jan 18 13:53:43 2008 @@ -1,19 +1,19 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s -; RUN: grep bisl%t1.s | count 7 && -; RUN: grep ila %t1.s | count 1 && -; RUN: grep rotqbyi %t1.s | count 4 && -; RUN: grep lqa %t1.s | count 5 && -; RUN: grep lqd %t1.s | count 6 && +; RUN: grep bisl%t1.s | count 7 +; RUN: grep ila %t1.s | count 1 +; RUN: grep rotqbyi %t1.s | count 4 +; RUN: grep lqa %t1.s | count 5 +; RUN: grep lqd %t1.s | count 6 ; RUN: grep dispatch_tab %t1.s | count 10 -; RUN: grep bisl%t2.s | count 7 && -; RUN: grep ilhu%t2.s | count 2 && -; RUN: grep iohl%t2.s | count 2 && -; RUN: grep rotqby %t2.s | count 6 && -; RUN: grep lqd %t2.s | count 12 && -; RUN: grep lqx %t2.s | count 8 && -; RUN: grep il %t2.s | count 9 && -; RUN: grep ai %t2.s | count 5 && +; RUN: grep bisl%t2.s | count 7 +; RUN: grep ilhu%t2.s | count 2 +; RUN: grep iohl%t2.s | count 2 +; RUN: grep rotqby %t2.s | count 6 +; RUN: grep lqd %t2.s | count 12 +; RUN: grep lqx %t2.s | count 8 +; RUN: grep il %t2.s | count 9 +; RUN: grep ai %t2.s | count 5 ; RUN: grep dispatch_tab %t2.s | count 7 ; ModuleID = 'call_indirect.bc' Modified: llvm/trunk/test/CodeGen/CellSPU/ctpop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/ctpop.ll?rev=46173&r1=46172&r2=46173&view=diff == --- llvm/trunk/test/CodeGen/CellSPU/ctpop.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/ctpop.ll Fri Jan 18 13:53:43 2008 @@ -1,7 +1,7 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep cntb%t1.s | count 3 && -; RUN: grep andi%t1.s | count 3 && -; RUN: grep rotmi %t1.s | count 2 && +; RUN: grep cntb%t1.s | count 3 +; RUN: grep andi%t1.s | count 3 +; RUN: grep rotmi %t1.s | count 2 ; RUN: grep rothmi %t1.s | count 1 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" target triple = "spu" Modified: llvm/trunk/test/CodeGen/CellSPU/dp_farith.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/dp_farith.ll?rev=46173&r1=46172&r2=46173&view=diff == --- llvm/trunk/test/CodeGen/CellSPU/dp_farith.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/dp_farith.ll Fri Jan 18 13:53:43 2008 @@ -1,9 +1,9 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep dfa%t1.s | count 2 && -; RUN: grep dfs%t1.s | count 2
[llvm-commits] [llvm] r46161 - in /llvm/trunk: lib/Target/PowerPC/PPCISelLowering.cpp test/CodeGen/PowerPC/stfiwx-2.ll
Author: lattner Date: Fri Jan 18 10:54:56 2008 New Revision: 46161 URL: http://llvm.org/viewvc/llvm-project?rev=46161&view=rev Log: Fix a latent bug exposed by my truncstore patch. We compiled stfiwx-2.ll to: _test: fctiwz f0, f1 stfiwx f0, 0, r4 blr instead of: _test: fctiwz f0, f1 stfd f0, -8(r1) nop nop lwz r2, -4(r1) stb r2, 0(r4) blr The former is not correct (stores 4 bytes, not 1). Added: llvm/trunk/test/CodeGen/PowerPC/stfiwx-2.ll Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=46161&r1=46160&r2=46161&view=diff == --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Jan 18 10:54:56 2008 @@ -3184,6 +3184,7 @@ case ISD::STORE: // Turn STORE (FP_TO_SINT F) -> STFIWX(FCTIWZ(F)). if (TM.getSubtarget().hasSTFIWX() && +!cast(N)->isTruncatingStore() && N->getOperand(1).getOpcode() == ISD::FP_TO_SINT && N->getOperand(1).getValueType() == MVT::i32 && N->getOperand(1).getOperand(0).getValueType() != MVT::ppcf128) { Added: llvm/trunk/test/CodeGen/PowerPC/stfiwx-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/stfiwx-2.ll?rev=46161&view=auto == --- llvm/trunk/test/CodeGen/PowerPC/stfiwx-2.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/stfiwx-2.ll Fri Jan 18 10:54:56 2008 @@ -0,0 +1,11 @@ +; This cannot be a stfiwx +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep stb +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep stfiwx + +define void @test(float %F, i8* %P) { + %I = fptosi float %F to i32 + %X = trunc i32 %I to i8 + store i8 %X, i8* %P + ret void +} + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46171 - /llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Author: lattner Date: Fri Jan 18 13:36:20 2008 New Revision: 46171 URL: http://llvm.org/viewvc/llvm-project?rev=46171&view=rev Log: remove extraneous &'s. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=46171&r1=46170&r2=46171&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Fri Jan 18 13:36:20 2008 @@ -159,8 +159,8 @@ memset(OpActions, 0, sizeof(OpActions)); memset(LoadXActions, 0, sizeof(LoadXActions)); memset(TruncStoreActions, 0, sizeof(TruncStoreActions)); - memset(&IndexedModeActions, 0, sizeof(IndexedModeActions)); - memset(&ConvertActions, 0, sizeof(ConvertActions)); + memset(IndexedModeActions, 0, sizeof(IndexedModeActions)); + memset(ConvertActions, 0, sizeof(ConvertActions)); // Set default actions for various operations. for (unsigned VT = 0; VT != (unsigned)MVT::LAST_VALUETYPE; ++VT) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46167 - in /llvm/branches/release_22/lib/Target: PowerPC/PPCAsmPrinter.cpp X86/X86AsmPrinter.cpp
Author: tbrethou Date: Fri Jan 18 13:13:34 2008 New Revision: 46167 URL: http://llvm.org/viewvc/llvm-project?rev=46167&view=rev Log: Merge from mainline. Revert the part of 45848 that treated weak globals as weak globals rather than commons. While not wrong, this change tickled a latent bug in Darwin's strip, so revert it for now as a workaround. Modified: llvm/branches/release_22/lib/Target/PowerPC/PPCAsmPrinter.cpp llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp Modified: llvm/branches/release_22/lib/Target/PowerPC/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=46167&r1=46166&r2=46167&view=diff == --- llvm/branches/release_22/lib/Target/PowerPC/PPCAsmPrinter.cpp (original) +++ llvm/branches/release_22/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Jan 18 13:13:34 2008 @@ -917,7 +917,8 @@ if (C->isNullValue() && /* FIXME: Verify correct */ !I->hasSection() && -(I->hasInternalLinkage() || I->hasExternalLinkage())) { +(I->hasInternalLinkage() || I->hasWeakLinkage() || + I->hasLinkOnceLinkage() || I->hasExternalLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (I->hasExternalLinkage()) { O << "\t.globl " << name << '\n'; Modified: llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp?rev=46167&r1=46166&r2=46167&view=diff == --- llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp (original) +++ llvm/branches/release_22/lib/Target/X86/X86AsmPrinter.cpp Fri Jan 18 13:13:34 2008 @@ -181,9 +181,8 @@ } if (!I->isThreadLocal() && - (I->hasInternalLinkage() || - (!Subtarget->isTargetDarwin() && -(I->hasWeakLinkage() || I->hasLinkOnceLinkage() { + (I->hasInternalLinkage() || I->hasWeakLinkage() || + I->hasLinkOnceLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (!NoZerosInBSS && TAI->getBSSSection()) SwitchToDataSection(TAI->getBSSSection(), I); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r46163 - /llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
Author: laurov Date: Fri Jan 18 12:14:23 2008 New Revision: 46163 URL: http://llvm.org/viewvc/llvm-project?rev=46163&view=rev Log: Eliminate a compilation warning. Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=46163&r1=46162&r2=46163&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Fri Jan 18 12:14:23 2008 @@ -15233,11 +15233,14 @@ (inter-module thumbness is fixed up by the linker). */ rtx tem = gen_rtx_SYMBOL_REF (Pmode, function_name); - if (TARGET_MACHO - && ! machopic_data_defined_p (function_rtx)) +#if TARGET_MACHO + if (! machopic_data_defined_p (function_rtx)) tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-8)); else tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7)); +#else + tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7)); +#endif /* APPLE LOCAL end ARM 4745175 */ tem = gen_rtx_MINUS (GET_MODE (tem), ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46175 - /llvm/branches/Apple/
Author: dpatel Date: Fri Jan 18 14:02:18 2008 New Revision: 46175 URL: http://llvm.org/viewvc/llvm-project?rev=46175&view=rev Log: Place for Apple specific branches. Added: llvm/branches/Apple/ ___ 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] r46170 - in /llvm-gcc-4.2/trunk/gcc: autom4te.cache/output.0 autom4te.cache/requests autom4te.cache/traces.0 configure configure.ac
On Jan 18, 2008, at 11:40 AM, Eric Christopher wrote: > > On Jan 18, 2008, at 11:35 AM, Devang Patel wrote: > >> llvm-gcc-4.2/trunk/gcc/autom4te.cache/output.0 >> llvm-gcc-4.2/trunk/gcc/autom4te.cache/requests >> llvm-gcc-4.2/trunk/gcc/autom4te.cache/traces.0 > > Any reason why the auto-cache is checked into svn? No idea. I do not even know how they are used. If you think they are not required please remove it. Thanks, - Devang ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46172 - /llvm/trunk/test/CodeGen/X86/aligned-comm.ll
Author: johannes Date: Fri Jan 18 13:53:31 2008 New Revision: 46172 URL: http://llvm.org/viewvc/llvm-project?rev=46172&view=rev Log: Test is correct again for the moment. Modified: llvm/trunk/test/CodeGen/X86/aligned-comm.ll Modified: llvm/trunk/test/CodeGen/X86/aligned-comm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/aligned-comm.ll?rev=46172&r1=46171&r2=46172&view=diff == --- llvm/trunk/test/CodeGen/X86/aligned-comm.ll (original) +++ llvm/trunk/test/CodeGen/X86/aligned-comm.ll Fri Jan 18 13:53:31 2008 @@ -2,9 +2,6 @@ ; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin10 | grep {array,16512,7} ; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin9 | grep {array,16512,7} ; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin8 | not grep {7} -; XFAIL: * - -; Currently there is no construct which generates .comm, so test is xfail'ed. ; Darwin 9+ should get alignment on common symbols. Darwin8 does ; not support this. ___ 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] r46170 - in /llvm-gcc-4.2/trunk/gcc: autom4te.cache/output.0 autom4te.cache/requests autom4te.cache/traces.0 configure configure.ac
On Jan 18, 2008, at 11:35 AM, Devang Patel wrote: > llvm-gcc-4.2/trunk/gcc/autom4te.cache/output.0 >llvm-gcc-4.2/trunk/gcc/autom4te.cache/requests >llvm-gcc-4.2/trunk/gcc/autom4te.cache/traces.0 Any reason why the auto-cache is checked into svn? -eric ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46169 - /llvm/branches/release_22/test/CodeGen/X86/aligned-comm.ll
Author: tbrethou Date: Fri Jan 18 13:18:51 2008 New Revision: 46169 URL: http://llvm.org/viewvc/llvm-project?rev=46169&view=rev Log: UnXFAIL this test. Modified: llvm/branches/release_22/test/CodeGen/X86/aligned-comm.ll Modified: llvm/branches/release_22/test/CodeGen/X86/aligned-comm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/test/CodeGen/X86/aligned-comm.ll?rev=46169&r1=46168&r2=46169&view=diff == --- llvm/branches/release_22/test/CodeGen/X86/aligned-comm.ll (original) +++ llvm/branches/release_22/test/CodeGen/X86/aligned-comm.ll Fri Jan 18 13:18:51 2008 @@ -2,9 +2,6 @@ ; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin10 | grep {array,16512,7} ; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin9 | grep {array,16512,7} ; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin8 | not grep {7} -; XFAIL: * - -; Currently there is no construct which generates .comm, so test is xfail'ed. ; Darwin 9+ should get alignment on common symbols. Darwin8 does ; not support this. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46168 - /llvm/branches/release_22/lib/Target/ARM/ARMAsmPrinter.cpp
Author: tbrethou Date: Fri Jan 18 13:15:06 2008 New Revision: 46168 URL: http://llvm.org/viewvc/llvm-project?rev=46168&view=rev Log: Merge from mainline. Revert the part of 45849 that treated weak globals as weak globals rather than commons. While not wrong, this change tickled a latent bug in Darwin's strip, so revert it for now as a workaround. Modified: llvm/branches/release_22/lib/Target/ARM/ARMAsmPrinter.cpp Modified: llvm/branches/release_22/lib/Target/ARM/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/Target/ARM/ARMAsmPrinter.cpp?rev=46168&r1=46167&r2=46168&view=diff == --- llvm/branches/release_22/lib/Target/ARM/ARMAsmPrinter.cpp (original) +++ llvm/branches/release_22/lib/Target/ARM/ARMAsmPrinter.cpp Fri Jan 18 13:15:06 2008 @@ -845,9 +845,8 @@ } } - if (I->hasInternalLinkage() || - (!Subtarget->isTargetDarwin() && -(I->hasWeakLinkage() || I->hasLinkOnceLinkage( { + if (I->hasInternalLinkage() || I->hasWeakLinkage() || + I->hasLinkOnceLinkage()) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (!NoZerosInBSS && TAI->getBSSSection()) SwitchToDataSection(TAI->getBSSSection(), I); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46144 - in /llvm/trunk/lib/Target: PowerPC/PPCAsmPrinter.cpp X86/X86AsmPrinter.cpp
On Jan 18, 2008, at 10:19 AM, Dale Johannesen wrote: > On Jan 18, 2008, at 10:13 AM, Tanya Lattner wrote: >> Should the test/CodeGen/X86/aligned-comm.ll be un-XFAILED? Its now >> XPASSing. >> >> -Tanya > > I guess so; given the current state of llvm it is supposed to pass. > Longterm what should happen is that tentative definitions ("common") > get represented differently in the IR than weak globals; when that > happens the test will be incorrect (again). The goal is to keep the tree in a state where all tests pass or xfail. Please update the test, and if you commit something that breaks a test, please xfail it. Thanks Dale, -Chris ___ 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] r46157 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp
Hi Evan, > It's for ABI compatibility reason. Also, it makes sense. presumably this results in the parameter being dropped? If so, the LLVM codegenerators could do that too. And either they should, or the verifier should check for this case. Ciao, Duncan. ___ 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] r46157 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp
It's for ABI compatibility reason. Also, it makes sense. Evan On Jan 18, 2008, at 1:39 AM, Duncan Sands wrote: > Hi Evan, > >> Do not pass zero sized array, struct, or class using byval >> attribute. This is true on both x86-32 and x86-64. > > is this because LLVM can't handle it, or is it an optimization? > If LLVM can't handle passing zero-sized objects using byval, that > sounds like a bug... > > Thanks, > > Duncan. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46162 - /llvm/trunk/include/llvm/Target/TargetLowering.h
Author: lattner Date: Fri Jan 18 11:13:03 2008 New Revision: 46162 URL: http://llvm.org/viewvc/llvm-project?rev=46162&view=rev Log: remove magic numbers. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=46162&r1=46161&r2=46162&view=diff == --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Fri Jan 18 11:13:03 2008 @@ -307,8 +307,8 @@ /// expander for it. LegalizeAction getTruncStoreAction(MVT::ValueType ValVT, MVT::ValueType MemVT) const { -assert(ValVT < MVT::LAST_VALUETYPE && MemVT < 32 && - "Table isn't big enough!"); +assert(ValVT < array_lengthof(TruncStoreActions) && + MemVT < sizeof(TruncStoreActions[0])*4 && "Table isn't big enough!"); return (LegalizeAction)((TruncStoreActions[ValVT] >> (2*MemVT)) & 3); } @@ -359,8 +359,8 @@ /// for it. LegalizeAction getConvertAction(MVT::ValueType FromVT, MVT::ValueType ToVT) const { -assert(FromVT < MVT::LAST_VALUETYPE && ToVT < 32 && - "Table isn't big enough!"); +assert(FromVT < array_lengthof(ConvertActions) && + ToVT < sizeof(ConvertActions[0])*4 && "Table isn't big enough!"); return (LegalizeAction)((ConvertActions[FromVT] >> (2*ToVT)) & 3); } @@ -747,7 +747,7 @@ /// with the specified type and indicate what to do about it. void setOperationAction(unsigned Op, MVT::ValueType VT, LegalizeAction Action) { -assert(VT < 32 && Op < array_lengthof(OpActions) && +assert(VT < sizeof(OpActions[0])*4 && Op < array_lengthof(OpActions) && "Table isn't big enough!"); OpActions[Op] &= ~(uint64_t(3UL) << VT*2); OpActions[Op] |= (uint64_t)Action << VT*2; @@ -757,7 +757,8 @@ /// work with the with specified type and indicate what to do about it. void setLoadXAction(unsigned ExtType, MVT::ValueType VT, LegalizeAction Action) { -assert(VT < 32 && ExtType < array_lengthof(LoadXActions) && +assert(VT < sizeof(LoadXActions[0])*4 && + ExtType < array_lengthof(LoadXActions) && "Table isn't big enough!"); LoadXActions[ExtType] &= ~(uint64_t(3UL) << VT*2); LoadXActions[ExtType] |= (uint64_t)Action << VT*2; @@ -767,8 +768,8 @@ /// not work with the with specified type and indicate what to do about it. void setTruncStoreAction(MVT::ValueType ValVT, MVT::ValueType MemVT, LegalizeAction Action) { -assert(ValVT < MVT::LAST_VALUETYPE && MemVT < 32 && - "Table isn't big enough!"); +assert(ValVT < array_lengthof(TruncStoreActions) && + MemVT < sizeof(TruncStoreActions[0])*4 && "Table isn't big enough!"); TruncStoreActions[ValVT] &= ~(uint64_t(3UL) << MemVT*2); TruncStoreActions[ValVT] |= (uint64_t)Action << MemVT*2; } @@ -779,7 +780,7 @@ /// TargetLowering.cpp void setIndexedLoadAction(unsigned IdxMode, MVT::ValueType VT, LegalizeAction Action) { -assert(VT < 32 && IdxMode < +assert(VT < sizeof(IndexedModeActions[0])*4 && IdxMode < array_lengthof(IndexedModeActions[0]) && "Table isn't big enough!"); IndexedModeActions[0][IdxMode] &= ~(uint64_t(3UL) << VT*2); @@ -792,8 +793,8 @@ /// TargetLowering.cpp void setIndexedStoreAction(unsigned IdxMode, MVT::ValueType VT, LegalizeAction Action) { -assert(VT < 32 && IdxMode < - array_lengthof(IndexedModeActions[1]) && +assert(VT < sizeof(IndexedModeActions[1][0])*4 && + IdxMode < array_lengthof(IndexedModeActions[1]) && "Table isn't big enough!"); IndexedModeActions[1][IdxMode] &= ~(uint64_t(3UL) << VT*2); IndexedModeActions[1][IdxMode] |= (uint64_t)Action << VT*2; @@ -803,8 +804,8 @@ /// not work with the with specified type and indicate what to do about it. void setConvertAction(MVT::ValueType FromVT, MVT::ValueType ToVT, LegalizeAction Action) { -assert(FromVT < MVT::LAST_VALUETYPE && ToVT < 32 && - "Table isn't big enough!"); +assert(FromVT < array_lengthof(ConvertActions) && + ToVT < sizeof(ConvertActions[0])*4 && "Table isn't big enough!"); ConvertActions[FromVT] &= ~(uint64_t(3UL) << ToVT*2); ConvertActions[FromVT] |= (uint64_t)Action << ToVT*2; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46165 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
Author: lattner Date: Fri Jan 18 12:51:16 2008 New Revision: 46165 URL: http://llvm.org/viewvc/llvm-project?rev=46165&view=rev Log: get symbolic information for ppc ldbl nodes. Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=46165&r1=46164&r2=46165&view=diff == --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Jan 18 12:51:16 2008 @@ -382,6 +382,11 @@ case PPCISD::LBRX: return "PPCISD::LBRX"; case PPCISD::STBRX: return "PPCISD::STBRX"; case PPCISD::COND_BRANCH: return "PPCISD::COND_BRANCH"; + case PPCISD::MFFS: return "PPCISD::MFFS"; + case PPCISD::MTFSB0:return "PPCISD::MTFSB0"; + case PPCISD::MTFSB1:return "PPCISD::MTFSB1"; + case PPCISD::FADDRTZ: return "PPCISD::FADDRTZ"; + case PPCISD::MTFSF: return "PPCISD::MTFSF"; } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r46164 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp
Author: evancheng Date: Fri Jan 18 12:35:18 2008 New Revision: 46164 URL: http://llvm.org/viewvc/llvm-project?rev=46164&view=rev Log: i32 / i64 all integer structs are not passed byval. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp 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=46164&r1=46163&r2=46164&view=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 Jan 18 12:35:18 2008 @@ -62,13 +62,10 @@ } \ } -extern bool llvm_x86_is_zero_sized_aggregate(tree); -extern bool llvm_x86_64_should_pass_aggregate_in_memory(tree); +extern bool llvm_x86_should_pass_aggregate_in_memory(tree); #define LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(X) \ - (!llvm_x86_is_zero_sized_aggregate(X) && \ - (!TARGET_64BIT ||\ -llvm_x86_64_should_pass_aggregate_in_memory(X))) + llvm_x86_should_pass_aggregate_in_memory(X) /* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=46164&r1=46163&r2=46164&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Fri Jan 18 12:35:18 2008 @@ -664,23 +664,43 @@ extern "C" enum machine_mode ix86_getNaturalModeForType(tree); extern "C" int ix86_HowToPassArgument(enum machine_mode, tree, int, int*, int*); -/* Target hook for llvm-abi.h. It returns true if the specified type is a - zero sized array, struct, or class. */ -bool llvm_x86_is_zero_sized_aggregate(tree type) { - enum machine_mode Mode = ix86_getNaturalModeForType(type); - HOST_WIDE_INT Bytes = -(Mode == BLKmode) ? int_size_in_bytes(type) : (int) GET_MODE_SIZE(Mode); - return Bytes == 0; -} - /* Target hook for llvm-abi.h. It returns true if an aggregate of the specified type should be passed in memory. This is only called for x86-64. */ -bool llvm_x86_64_should_pass_aggregate_in_memory(tree type) { +static bool llvm_x86_64_should_pass_aggregate_in_memory(tree type, +enum machine_mode Mode){ int IntRegs, SSERegs; - enum machine_mode Mode = ix86_getNaturalModeForType(type); /* If ix86_HowToPassArgument return 0, then it's passed byval in memory.*/ return !ix86_HowToPassArgument(Mode, type, 0, &IntRegs, &SSERegs); } +/* Target hook for llvm-abi.h. It returns true if an aggregate of the + specified type should be passed in memory. */ +bool llvm_x86_should_pass_aggregate_in_memory(tree type) { + enum machine_mode Mode = ix86_getNaturalModeForType(type); + HOST_WIDE_INT Bytes = +(Mode == BLKmode) ? int_size_in_bytes(type) : (int) GET_MODE_SIZE(Mode); + + // Zero sized array, struct, or class, not passed in memory. + if (Bytes == 0) +return false; + + if (Bytes == GET_MODE_SIZE(SImode) || Bytes == GET_MODE_SIZE(DImode)) { +// 32-bit or 64-bit and all elements are integers, not passed in memory. +bool AllIntegers = true; +const Type *Ty = ConvertType(type); +for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end(); + I != E; ++I) + if (!I->get()->isIntOrIntVector()) { +AllIntegers = false; +break; + } +if (AllIntegers) + return false; + } + if (!TARGET_64BIT) +return true; + return llvm_x86_64_should_pass_aggregate_in_memory(type, Mode); +} + /* LLVM LOCAL end (ENTIRE FILE!) */ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46166 - /llvm/trunk/include/llvm/ADT/StringExtras.h
Author: lattner Date: Fri Jan 18 12:54:31 2008 New Revision: 46166 URL: http://llvm.org/viewvc/llvm-project?rev=46166&view=rev Log: don't form an std::string with a null pointer, it aborts. Modified: llvm/trunk/include/llvm/ADT/StringExtras.h Modified: llvm/trunk/include/llvm/ADT/StringExtras.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringExtras.h?rev=46166&r1=46165&r2=46166&view=diff == --- llvm/trunk/include/llvm/ADT/StringExtras.h (original) +++ llvm/trunk/include/llvm/ADT/StringExtras.h Fri Jan 18 12:54:31 2008 @@ -98,7 +98,7 @@ return ftostr(V.convertToDouble()); else if (&V.getSemantics() == &APFloat::IEEEsingle) return ftostr((double)V.convertToFloat()); - return 0; // error + return ""; // error } static inline std::string LowercaseString(const std::string &S) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46187 - in /llvm/trunk: include/llvm/ADT/FoldingSet.h lib/Support/FoldingSet.cpp
Author: kremenek Date: Fri Jan 18 22:22:50 2008 New Revision: 46187 URL: http://llvm.org/viewvc/llvm-project?rev=46187&view=rev Log: Made 'FoldingSetNodeID' a proper class instead of a nested class in 'FoldingSetNodeImpl' (previously 'FoldingSetNodeID' was a typedef of 'FoldingSetNodeImpl::NodeID'). Why? Clients can now easily forward declare 'FoldingSetNodeID' without having to include FoldingSet.h. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h llvm/trunk/lib/Support/FoldingSet.cpp Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=46187&r1=46186&r2=46187&view=diff == --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Fri Jan 18 22:22:50 2008 @@ -96,8 +96,9 @@ ///bool WasRemoved = RemoveNode(N); /// /// The result indicates whether the node existed in the folding set. - - + +class FoldingSetNodeID; + //===--===// /// FoldingSetImpl - Implements the folding set functionality. The main /// structure is an array of buckets. Each bucket is indexed by the hash of @@ -123,49 +124,6 @@ explicit FoldingSetImpl(unsigned Log2InitSize = 6); virtual ~FoldingSetImpl(); - // Forward declaration. - class Node; - - //======// - /// NodeID - This class is used to gather all the unique data bits of a - /// node. When all the bits are gathered this class is used to produce a - /// hash value for the node. - /// - class NodeID { -/// Bits - Vector of all the data bits that make the node unique. -/// Use a SmallVector to avoid a heap allocation in the common case. -SmallVector Bits; - - public: -NodeID() {} - -/// getRawData - Return the ith entry in the Bits data. -/// -unsigned getRawData(unsigned i) const { - return Bits[i]; -} - -/// Add* - Add various data types to Bit data. -/// -void AddPointer(const void *Ptr); -void AddInteger(signed I); -void AddInteger(unsigned I); -void AddInteger(int64_t I); -void AddInteger(uint64_t I); -void AddFloat(float F); -void AddDouble(double D); -void AddAPFloat(const APFloat& apf); -void AddString(const std::string &String); - -/// ComputeHash - Compute a strong hash value for this NodeID, used to -/// lookup the node in the FoldingSetImpl. -unsigned ComputeHash() const; - -/// operator== - Used to compare two nodes to each other. -/// -bool operator==(const NodeID &RHS) const; - }; - //======// /// Node - This class is used to maintain the singly linked bucket list in /// a folding set. @@ -196,7 +154,7 @@ /// FindNodeOrInsertPos - Look up the node specified by ID. If it exists, /// return it. If not, return the insertion token that will make insertion /// faster. - Node *FindNodeOrInsertPos(const NodeID &ID, void *&InsertPos); + Node *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos); /// InsertNode - Insert the specified node into the folding set, knowing that /// it is not already in the folding set. InsertPos must be obtained from @@ -216,13 +174,51 @@ /// GetNodeProfile - Instantiations of the FoldingSet template implement /// this function to gather data bits for the given node. - virtual void GetNodeProfile(NodeID &ID, Node *N) const = 0; + virtual void GetNodeProfile(FoldingSetNodeID &ID, Node *N) const = 0; }; -// Convenience types to hide the implementation of the folding set. -typedef FoldingSetImpl::Node FoldingSetNode; -typedef FoldingSetImpl::NodeID FoldingSetNodeID; +//======// +/// FoldingSetNodeID - This class is used to gather all the unique data bits of +/// a node. When all the bits are gathered this class is used to produce a +/// hash value for the node. +/// +class FoldingSetNodeID { + /// Bits - Vector of all the data bits that make the node unique. + /// Use a SmallVector to avoid a heap allocation in the common case. + SmallVector Bits; + +public: + FoldingSetNodeID() {} + + /// getRawData - Return the ith entry in the Bits data. + /// + unsigned getRawData(unsigned i) const { +return Bits[i]; + } + + /// Add* - Add various data types to Bit data. + /// + void AddPointer(const void *Ptr); + void AddInteger(signed I); + void AddInteger(unsigned I); + void AddInteger(int64_t I); + void AddInteger(uint64_t I); + void AddFloat(float F); + void AddDouble(double D); + void AddAPFloat(const APFloat& apf); + void AddString(const std::string &String); + + /// ComputeHash - Compute a strong hash value for this Fol
[llvm-commits] [llvm] r46188 - in /llvm/trunk: include/llvm/ADT/APInt.h lib/Support/APInt.cpp
Author: kremenek Date: Fri Jan 18 22:23:33 2008 New Revision: 46188 URL: http://llvm.org/viewvc/llvm-project?rev=46188&view=rev Log: Added FoldingSet style 'profiling' support for APInt. Modified: llvm/trunk/include/llvm/ADT/APInt.h llvm/trunk/lib/Support/APInt.cpp Modified: llvm/trunk/include/llvm/ADT/APInt.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=46188&r1=46187&r2=46188&view=diff == --- llvm/trunk/include/llvm/ADT/APInt.h (original) +++ llvm/trunk/include/llvm/ADT/APInt.h Fri Jan 18 22:23:33 2008 @@ -24,6 +24,7 @@ namespace llvm { class Serializer; class Deserializer; + class FoldingSetNodeID; /* An unsigned host type used as a single part of a multi-part bignum. */ @@ -210,6 +211,10 @@ /// for object deserialization (pair this with the static method Read). explicit APInt() : BitWidth(1) {} + /// Profile - Used to insert APInt objects, or objects that contain APInt + /// objects, into FoldingSets. + void Profile(FoldingSetNodeID& ID) const; + /// @brief Used by the Bitcode serializer to emit APInts to Bitcode. void Emit(Serializer& S) const; Modified: llvm/trunk/lib/Support/APInt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=46188&r1=46187&r2=46188&view=diff == --- llvm/trunk/lib/Support/APInt.cpp (original) +++ llvm/trunk/lib/Support/APInt.cpp Fri Jan 18 22:23:33 2008 @@ -14,6 +14,7 @@ #define DEBUG_TYPE "apint" #include "llvm/ADT/APInt.h" +#include "llvm/ADT/FoldingSet.h" #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include @@ -24,7 +25,6 @@ using namespace llvm; - /// This enumeration just provides for internal constants used in this /// translation unit. enum { @@ -165,6 +165,18 @@ return clearUnusedBits(); } +/// Profile - This method 'profiles' an APInt for use with FoldingSet. +void APInt::Profile(FoldingSetNodeID& ID) const { + if (isSingleWord()) { +ID.AddInteger(VAL); +return; + } + + uint32_t NumWords = getNumWords(); + for (unsigned i = 0; i < NumWords; ++i) +ID.AddInteger(pVal[i]); +} + /// add_1 - This function adds a single "digit" integer, y, to the multiple /// "digit" integer array, x[]. x[] is modified to reflect the addition and /// 1 is returned if there is a carry out, otherwise 0 is returned. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46186 - /llvm/trunk/include/llvm/ADT/FoldingSet.h
Author: kremenek Date: Fri Jan 18 21:58:00 2008 New Revision: 46186 URL: http://llvm.org/viewvc/llvm-project?rev=46186&view=rev Log: Made 'profiling' of objects in a FoldingSet trait-based using FoldingSetTrait instead of always assuming that the stored objects had a method called 'Profile'. The default behavior is to dispatch to a 'Profile' method (as before), but via template specialization this behavior can now be overridden by clients. Added templated class 'FoldingSetNodeWrapper', a generic wrapper class that allows one to insert objects into a FoldingSet that do not directly inherit from FoldingSetNode. This is useful for inserting objects that do not always need to pay the overhead of inheriting from FoldingSetNode, or were designed with that behavior in mind. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=46186&r1=46185&r2=46186&view=diff == --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Fri Jan 18 21:58:00 2008 @@ -226,6 +226,19 @@ template class FoldingSetIterator; //===--===// +/// FoldingSetTrait - This trait class is used to define behavior of how +/// to "profile" (in the FoldingSet parlance) an object of a given type. +/// The default behavior is to invoke a 'Profile' method on an object, but +/// through template specialization the behavior can be tailored for specific +/// types. Combined with the FoldingSetNodeWrapper classs, one can add objects +/// to FoldingSets that were not originally designed to have that behavior. +/// +template struct FoldingSetTrait { + static inline void Profile(const T& X, FoldingSetNodeID& ID) { X.Profile(ID);} + static inline void Profile(T& X, FoldingSetNodeID& ID) { X.Profile(ID); } +}; + +//===--===// /// FoldingSet - This template class is used to instantiate a specialized /// implementation of the folding set to the node class T. T must be a /// subclass of FoldingSetNode and implement a Profile function. @@ -236,7 +249,7 @@ /// way to convert nodes into a unique specifier. virtual void GetNodeProfile(NodeID &ID, Node *N) const { T *TN = static_cast(N); -TN->Profile(ID); +FoldingSetTrait::Profile(*TN,ID); } public: @@ -307,6 +320,45 @@ FoldingSetIterator tmp = *this; ++*this; return tmp; } }; + +//===--===// +/// FoldingSetNodeWrapper - This template class is used to "wrap" arbitrary +/// types in an enclosing object so that they can be inserted into FoldingSets. +template +class FoldingSetNodeWrapper : public FoldingSetNode { + T data; +public: + FoldingSetNodeWrapper(const T& x) : data(x) {} + virtual ~FoldingSetNodeWrapper(); + + template + explicit FoldingSetNodeWrapper(const A1& a1) +: data(a1) {} + + template + explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2) +: data(a1,a2) {} + + template + explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3) +: data(a1,a2,a3) {} + + template + explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3, + const A4& a4) +: data(a1,a2,a3,a4) {} + + template + explicit FoldingSetNodeWrapper(const A1& a1, const A2& a2, const A3& a3, + const A4& a4, const A5& a5) + : data(a1,a2,a3,a4,a5) {} + + + void Profile(FoldingSetNodeID& ID) { FoldingSetTrait::Profile(data, ID); } + + operator T&() { return data; } + operator const T&() const { return data; } +}; } // End of namespace llvm. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46140 - in /llvm/trunk : include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Tar get/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CellSP U/ lib/Target/Mips/ lib/Target/Power
Hi Chris, > 32 is sizeof(uint64_t)*8 / 2, because each entry takes two bits in a > uint64_t. > > I converted this to symbolic math to make it more obvious, and > switched to using array_lengthof instead of comparing against > MVT::LAST_VALUETYPE directly. thanks! > > This may be wrong for apints, since the expanded value type may be > > smaller than > > ST->getStoredVT(), eg if you are expanding i64, and ST- > > >getStoredVT() is i40. I > > can take care of this. > > Ok. As it turns out, I think this code is unreachable currently. If > we made the above dag combine xform happen even for illegal xforms > before legalize, then this code would be live. I'd forgotten that the new legalize stuff already takes care of this case, and once that is turned on this particular bit of code will be removed anyway (though not the part following which handles illegal trunc store of a legal type). Ciao, Duncan. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46176 - /llvm/branches/Apple/llvmCore-2010/
Author: dpatel Date: Fri Jan 18 14:03:19 2008 New Revision: 46176 URL: http://llvm.org/viewvc/llvm-project?rev=46176&view=rev Log: Create llvmCore-2010 branch based on llvmCore-2009 tag. Added: llvm/branches/Apple/llvmCore-2010/ - copied from r46175, llvm/tags/Apple/llvmCore-2009/ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46178 - /llvm/tags/Apple/llvmCore-2010/
Author: dpatel Date: Fri Jan 18 14:10:27 2008 New Revision: 46178 URL: http://llvm.org/viewvc/llvm-project?rev=46178&view=rev Log: Tag llvmCore-2010 Added: llvm/tags/Apple/llvmCore-2010/ - copied from r46177, llvm/branches/Apple/llvmCore-2010/ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46190 - /llvm/trunk/include/llvm/ADT/ImmutableSet.h
Author: kremenek Date: Fri Jan 18 22:51:55 2008 New Revision: 46190 URL: http://llvm.org/viewvc/llvm-project?rev=46190&view=rev Log: Modified ImmutableSet/ImmutableMap to use FoldingSet profiling using FoldingSetTrait instead of directly calling a 'Profile' method. Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=46190&r1=46189&r2=46190&view=diff == --- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original) +++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Fri Jan 18 22:51:55 2008 @@ -717,8 +717,8 @@ typedef const T& value_type_ref; static inline void Profile(FoldingSetNodeID& ID, value_type_ref X) { -X.Profile(ID); - } +FoldingSetTrait::Profile(X,ID); + } }; /// Profile traits for integers. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46189 - in /llvm/trunk: include/llvm/ADT/APSInt.h lib/Support/APSInt.cpp
Author: kremenek Date: Fri Jan 18 22:31:12 2008 New Revision: 46189 URL: http://llvm.org/viewvc/llvm-project?rev=46189&view=rev Log: Added FoldingSet style 'profiling' support for APSInt. Added: llvm/trunk/lib/Support/APSInt.cpp Modified: llvm/trunk/include/llvm/ADT/APSInt.h Modified: llvm/trunk/include/llvm/ADT/APSInt.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APSInt.h?rev=46189&r1=46188&r2=46189&view=diff == --- llvm/trunk/include/llvm/ADT/APSInt.h (original) +++ llvm/trunk/include/llvm/ADT/APSInt.h Fri Jan 18 22:31:12 2008 @@ -125,6 +125,10 @@ assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); return IsUnsigned ? uge(RHS) : sge(RHS); } + + /// Profile - Used to insert APSInt objects, or objects that contain APSInt + /// objects, into FoldingSets. + void Profile(FoldingSetNodeID& ID) const; }; } // end namespace llvm Added: llvm/trunk/lib/Support/APSInt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APSInt.cpp?rev=46189&view=auto == --- llvm/trunk/lib/Support/APSInt.cpp (added) +++ llvm/trunk/lib/Support/APSInt.cpp Fri Jan 18 22:31:12 2008 @@ -0,0 +1,23 @@ +//===-- llvm/ADT/APSInt.cpp - Arbitrary Precision Signed Int ---*- C++ -*--===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// +// +// This file implements the APSInt class, which is a simple class that +// represents an arbitrary sized integer that knows its signedness. +// +//===--===// + +#include "llvm/ADT/APSInt.h" +#include "llvm/ADT/FoldingSet.h" + +using namespace llvm; + +void APSInt::Profile(FoldingSetNodeID& ID) const { + ID.AddInteger((unsigned) (IsUnsigned ? 1 : 0)); + APInt::Profile(ID); +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r46191 - in /llvm-gcc-4.2/trunk/gcc: config/i386/i386-protos.h config/i386/i386.c config/i386/i386.h config/i386/llvm-i386-target.h config/i386/llvm-i386.cpp llvm-abi.h
Author: evancheng Date: Sat Jan 19 00:03:38 2008 New Revision: 46191 URL: http://llvm.org/viewvc/llvm-project?rev=46191&view=rev Log: Much improved x86-64 ABI compliance. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h llvm-gcc-4.2/trunk/gcc/config/i386/i386.c llvm-gcc-4.2/trunk/gcc/config/i386/i386.h llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp llvm-gcc-4.2/trunk/gcc/llvm-abi.h Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h?rev=46191&r1=46190&r2=46191&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386-protos.h Sat Jan 19 00:03:38 2008 @@ -257,7 +257,13 @@ extern int asm_preferred_eh_data_format (int, int); /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM +#define MAX_CLASSES 4 enum machine_mode ix86_getNaturalModeForType(tree type); int ix86_HowToPassArgument(enum machine_mode mode, tree type, int in_return, int *int_nregs, int *sse_nregs); +int ix86_ClassifyArgument(enum machine_mode mode, tree type, + enum x86_64_reg_class classes[MAX_CLASSES], + int bit_offset); +#endif /* LLVM LOCAL end */ 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=46191&r1=46190&r2=46191&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Sat Jan 19 00:03:38 2008 @@ -1246,6 +1246,9 @@ static void i386_solaris_elf_named_section (const char *, unsigned int, tree) ATTRIBUTE_UNUSED; +/* LLVM LOCAL begin */ + +#ifndef ENABLE_LLVM /* Register class used for passing given 64bit part of the argument. These represent classes as documented by the PS ABI, with the exception of SSESF, SSEDF classes, that are basically SSE class, just gcc will @@ -1268,6 +1271,10 @@ X86_64_COMPLEX_X87_CLASS, X86_64_MEMORY_CLASS }; +#endif /* !ENABLE_LLVM */ + +/* LLVM LOCAL end */ + static const char * const x86_64_reg_class_name[] = { "no", "integer", "integerSI", "sse", "sseSF", "sseDF", "sseup", "x87", "x87up", "cplx87", "no" @@ -3263,9 +3270,16 @@ int offset = tree_low_cst (BINFO_OFFSET (base_binfo), 0) * 8; tree type = BINFO_TYPE (base_binfo); +/* LLVM local */ +#ifdef ENABLE_LLVM + num = classify_argument (type_natural_mode (type), + type, subclasses, + (offset + bit_offset) % 256); +#else num = classify_argument (TYPE_MODE (type), type, subclasses, (offset + bit_offset) % 256); +#endif if (!num) return 0; for (i = 0; i < num; i++) @@ -3301,10 +3315,18 @@ } else { +/* LLVM local */ +#ifdef ENABLE_LLVM + num = classify_argument (type_natural_mode (TREE_TYPE (field)), + TREE_TYPE (field), subclasses, + (int_bit_position (field) + + bit_offset) % 256); +#else num = classify_argument (TYPE_MODE (TREE_TYPE (field)), TREE_TYPE (field), subclasses, (int_bit_position (field) + bit_offset) % 256); +#endif if (!num) return 0; for (i = 0; i < num; i++) @@ -3323,8 +3345,14 @@ /* Arrays are handled as small records. */ { int num; +/* LLVM local */ +#ifdef ENABLE_LLVM + num = classify_argument (type_natural_mode (TREE_TYPE (type)), +TREE_TYPE (type), subclasses, bit_offset); +#else num = classify_argument (TYPE_MODE (TREE_TYPE (type)), TREE_TYPE (type), subclasses, bit_offset); +#endif if (!num) return 0; @@ -3356,9 +3384,16 @@ if (TREE_TYPE (field) == error_mark_node) continue; +/* LLVM local */ +#ifdef ENABLE_LLVM + num = classify_argument (type_natural_mode (TREE_TYPE (field)), + TREE_TYPE (field), subclasses, + bit_offset); +#else