[llvm-commits] [llvm] r46738 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Author: resistor Date: Mon Feb 4 22:34:03 2008 New Revision: 46738 URL: http://llvm.org/viewvc/llvm-project?rev=46738&view=rev Log: Fix an obscure read-after-free bug that Duncan found. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46738&r1=46737&r2=46738&view=diff == --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon Feb 4 22:34:03 2008 @@ -463,15 +463,17 @@ reverseDep[depGraphLocal[rem].first].erase(rem); if (depGraphEntry->second.first != NonLocal && +depGraphEntry->second.first != None && depGraphEntry->second.second) { // If we have dep info for rem, set them to it BasicBlock::iterator RI = depGraphEntry->second.first; RI++; newDep = RI; -} else if (depGraphEntry->second.first == NonLocal && +} else if ( (depGraphEntry->second.first == NonLocal || + depGraphEntry->second.first == None ) && depGraphEntry->second.second ) { // If we have a confirmed non-local flag, use it - newDep = NonLocal; + newDep = depGraphEntry->second.first; } else { // Otherwise, use the immediate successor of rem // NOTE: This is because, when getDependence is called, it will first @@ -480,14 +482,22 @@ RI++; newDep = RI; } - -SmallPtrSet& set = reverseDep[rem]; -for (SmallPtrSet::iterator I = set.begin(), E = set.end(); - I != E; ++I) { - // Insert the new dependencies - // Mark it as unconfirmed as long as it is not the non-local flag - depGraphLocal[*I] = std::make_pair(newDep, !newDep); -} + } else { +// Otherwise, use the immediate successor of rem +// NOTE: This is because, when getDependence is called, it will first +// check the immediate predecessor of what is in the cache. +BasicBlock::iterator RI = rem; +RI++; +newDep = RI; + } + + SmallPtrSet& set = reverseDep[rem]; + for (SmallPtrSet::iterator I = set.begin(), E = set.end(); + I != E; ++I) { +// Insert the new dependencies +// Mark it as unconfirmed as long as it is not the non-local flag +depGraphLocal[*I] = std::make_pair(newDep, (newDep == NonLocal || +newDep == None)); } depGraphLocal.erase(rem); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46739 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
Author: lattner Date: Mon Feb 4 22:45:32 2008 New Revision: 46739 URL: http://llvm.org/viewvc/llvm-project?rev=46739&view=rev Log: Fix a bug compiling PR1978 (perhaps not the only one though) which was incorrectly simplifying "x == (gep x, 1, i)" into false, even though i could be negative. As it turns out, all the code to handle this already existed, we just need to disable the incorrect optimization case and let the general case handle it. Added: llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=46739&r1=46738&r2=46739&view=diff == --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Feb 4 22:45:32 2008 @@ -4629,60 +4629,11 @@ Value *PtrBase = GEPLHS->getOperand(0); if (PtrBase == RHS) { -// As an optimization, we don't actually have to compute the actual value of -// OFFSET if this is a icmp_eq or icmp_ne comparison, just return whether -// each index is zero or not. -if (Cond == ICmpInst::ICMP_EQ || Cond == ICmpInst::ICMP_NE) { - Instruction *InVal = 0; - gep_type_iterator GTI = gep_type_begin(GEPLHS); - for (unsigned i = 1, e = GEPLHS->getNumOperands(); i != e; ++i, ++GTI) { -bool EmitIt = true; -if (Constant *C = dyn_cast(GEPLHS->getOperand(i))) { - if (isa(C)) // undef index -> undef. -return ReplaceInstUsesWith(I, UndefValue::get(I.getType())); - if (C->isNullValue()) -EmitIt = false; - else if (TD->getABITypeSize(GTI.getIndexedType()) == 0) { -EmitIt = false; // This is indexing into a zero sized array? - } else if (isa(C)) -return ReplaceInstUsesWith(I, // No comparison is needed here. - ConstantInt::get(Type::Int1Ty, - Cond == ICmpInst::ICMP_NE)); -} - -if (EmitIt) { - Instruction *Comp = -new ICmpInst(Cond, GEPLHS->getOperand(i), -Constant::getNullValue(GEPLHS->getOperand(i)->getType())); - if (InVal == 0) -InVal = Comp; - else { -InVal = InsertNewInstBefore(InVal, I); -InsertNewInstBefore(Comp, I); -if (Cond == ICmpInst::ICMP_NE) // True if any are unequal - InVal = BinaryOperator::createOr(InVal, Comp); -else // True if all are equal - InVal = BinaryOperator::createAnd(InVal, Comp); - } -} - } - - if (InVal) -return InVal; - else -// No comparison is needed here, all indexes = 0 -ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty, -Cond == ICmpInst::ICMP_EQ)); -} - -// Only lower this if the icmp is the only user of the GEP or if we expect -// the result to fold to a constant! -if (isa(GEPLHS) || GEPLHS->hasOneUse()) { - // ((gep Ptr, OFFSET) cmp Ptr) ---> (OFFSET cmp 0). - Value *Offset = EmitGEPOffset(GEPLHS, I, *this); - return new ICmpInst(ICmpInst::getSignedPredicate(Cond), Offset, - Constant::getNullValue(Offset->getType())); -} +// ((gep Ptr, OFFSET) cmp Ptr) ---> (OFFSET cmp 0). +// This transformation is valid because we know pointers can't overflow. +Value *Offset = EmitGEPOffset(GEPLHS, I, *this); +return new ICmpInst(ICmpInst::getSignedPredicate(Cond), Offset, +Constant::getNullValue(Offset->getType())); } else if (User *GEPRHS = dyn_castGetElementPtr(RHS)) { // If the base pointers are different, but the indices are the same, just // compare the base pointer. Added: llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll?rev=46739&view=auto == --- llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll Mon Feb 4 22:45:32 2008 @@ -0,0 +1,33 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i32 %indvar, 0} +; PR1978 +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i686-apple-darwin8" + %struct.x = type <{ i8 }> [EMAIL PROTECTED] = internal constant [6 x i8] c"Main!\00" ; <[6 x i8]*> [#uses=1] [EMAIL PROTECTE
Re: [llvm-commits] [llvm] r46727 - /llvm/trunk/include/llvm/IntrinsicsX86.td
On Feb 4, 2008, at 3:27 PM, Dale Johannesen wrote: > Author: johannes > Date: Mon Feb 4 17:27:29 2008 > New Revision: 46727 > > URL: http://llvm.org/viewvc/llvm-project?rev=46727&view=rev > Log: > Do not unconditionally redefine vec_ext_v16qi and > vec_ext_v4si builtins. This is a hack; they should > be defined here, then resolved in the X86 BE. > However there is enough other stuff missing in the > X86 BE for SSE41 that this will do for now. I think these are in the category of builtins that should be expanded by the FE, and thus should be removed. Nate, thoughts? -Chris > > > Modified: >llvm/trunk/include/llvm/IntrinsicsX86.td > > Modified: llvm/trunk/include/llvm/IntrinsicsX86.td > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=46727&r1=46726&r2=46727&view=diff > > = > = > = > = > = > = > = > = > == > --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) > +++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Feb 4 17:27:29 2008 > @@ -764,9 +764,9 @@ > > // Vector extract > let TargetPrefix = "x86" in { // All intrinsics start with > "llvm.x86.". > - def int_x86_sse41_pextrb : > GCCBuiltin<"__builtin_ia32_vec_ext_v16qi">, > + def int_x86_sse41_pextrb : > Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>; > - def int_x86_sse41_pextrd : > GCCBuiltin<"__builtin_ia32_vec_ext_v4si">, > + def int_x86_sse41_pextrd : > Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>; > def int_x86_sse41_pextrq : > GCCBuiltin<"__builtin_ia32_vec_ext_v2di">, > Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>; > > > ___ > 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] r46746 - /llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
Author: sampo Date: Tue Feb 5 02:49:09 2008 New Revision: 46746 URL: http://llvm.org/viewvc/llvm-project?rev=46746&view=rev Log: Ident mnemonics appropriately Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=46746&r1=46745&r2=46746&view=diff == --- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Feb 5 02:49:09 2008 @@ -514,10 +514,10 @@ unsigned char MB = MI->getOperand(3).getImm(); unsigned char ME = MI->getOperand(4).getImm(); if (SH <= 31 && MB == 0 && ME == (31-SH)) { - O << "slwi "; FoundMnemonic = true; + O << "\tslwi "; FoundMnemonic = true; } if (SH <= 31 && MB == (32-SH) && ME == 31) { - O << "srwi "; FoundMnemonic = true; + O << "\tsrwi "; FoundMnemonic = true; SH = 32-SH; } if (FoundMnemonic) { @@ -529,7 +529,7 @@ } } else if (MI->getOpcode() == PPC::OR || MI->getOpcode() == PPC::OR8) { if (MI->getOperand(1).getReg() == MI->getOperand(2).getReg()) { - O << "mr "; + O << "\tmr "; printOperand(MI, 0); O << ", "; printOperand(MI, 1); @@ -541,7 +541,7 @@ unsigned char ME = MI->getOperand(3).getImm(); // rldicr RA, RS, SH, 63-SH == sldi RA, RS, SH if (63-SH == ME) { - O << "sldi "; + O << "\tsldi "; printOperand(MI, 0); O << ", "; printOperand(MI, 1); ___ 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] r46726 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Hi Devang, > Use appropriate alignment while handling packed struct member. do you have a testcase for this? Thanks, Duncan. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46741 - in /llvm/trunk/docs/tutorial: LangImpl4.html LangImpl5.html LangImpl6.html LangImpl7.html
Author: lattner Date: Tue Feb 5 00:18:42 2008 New Revision: 46741 URL: http://llvm.org/viewvc/llvm-project?rev=46741&view=rev Log: dump the module *before* we delete it, not after. Modified: llvm/trunk/docs/tutorial/LangImpl4.html llvm/trunk/docs/tutorial/LangImpl5.html llvm/trunk/docs/tutorial/LangImpl6.html llvm/trunk/docs/tutorial/LangImpl7.html Modified: llvm/trunk/docs/tutorial/LangImpl4.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=46741&r1=46740&r2=46741&view=diff == --- llvm/trunk/docs/tutorial/LangImpl4.html (original) +++ llvm/trunk/docs/tutorial/LangImpl4.html Tue Feb 5 00:18:42 2008 @@ -1109,11 +1109,11 @@ MainLoop(); TheFPM = 0; - } // Free module provider and pass manager. - + +// Print out all of the generated code. +TheModule->dump(); + } // Free module provider (and thus the module) and pass manager. - // Print out all of the generated code. - TheModule->dump(); return 0; } Modified: llvm/trunk/docs/tutorial/LangImpl5.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=46741&r1=46740&r2=46741&view=diff == --- llvm/trunk/docs/tutorial/LangImpl5.html (original) +++ llvm/trunk/docs/tutorial/LangImpl5.html Tue Feb 5 00:18:42 2008 @@ -1735,11 +1735,11 @@ MainLoop(); TheFPM = 0; - } // Free module provider and pass manager. - + +// Print out all of the generated code. +TheModule->dump(); + } // Free module provider (and thus the module) and pass manager. - // Print out all of the generated code. - TheModule->dump(); return 0; } Modified: llvm/trunk/docs/tutorial/LangImpl6.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=46741&r1=46740&r2=46741&view=diff == --- llvm/trunk/docs/tutorial/LangImpl6.html (original) +++ llvm/trunk/docs/tutorial/LangImpl6.html Tue Feb 5 00:18:42 2008 @@ -1774,11 +1774,11 @@ MainLoop(); TheFPM = 0; - } // Free module provider and pass manager. - - - // Print out all of the generated code. - TheModule->dump(); + +// Print out all of the generated code. +TheModule->dump(); + } // Free module provider (and thus the module) and pass manager. + return 0; } Modified: llvm/trunk/docs/tutorial/LangImpl7.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl7.html?rev=46741&r1=46740&r2=46741&view=diff == --- llvm/trunk/docs/tutorial/LangImpl7.html (original) +++ llvm/trunk/docs/tutorial/LangImpl7.html Tue Feb 5 00:18:42 2008 @@ -2129,11 +2129,12 @@ MainLoop(); TheFPM = 0; - } // Free module provider and pass manager. - - - // Print out all of the generated code. - TheModule->dump(); + +// Print out all of the generated code. +TheModule->dump(); + + } // Free module provider (and thus the module) and pass manager. + return 0; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46748 - /llvm/tags/Apple/llvmCore-2015/
Author: void Date: Tue Feb 5 03:52:54 2008 New Revision: 46748 URL: http://llvm.org/viewvc/llvm-project?rev=46748&view=rev Log: Creating llvmCore-2015 branch Added: llvm/tags/Apple/llvmCore-2015/ - copied from r46747, llvm/trunk/ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r46749 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2015/
Author: void Date: Tue Feb 5 03:53:01 2008 New Revision: 46749 URL: http://llvm.org/viewvc/llvm-project?rev=46749&view=rev Log: Creating llvmgcc42-2015 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2015/ - copied from r46748, llvm-gcc-4.2/trunk/ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r46747 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.c config/rs6000/rs6000.c varasm.c
Author: void Date: Tue Feb 5 03:46:24 2008 New Revision: 46747 URL: http://llvm.org/viewvc/llvm-project?rev=46747&view=rev Log: maybe_assemble_visibility issues a warning if the visibility isn't supported on a particular platform. A configuration might check for visibility. A warning in this case indicates that it's not supported. So this warning is actually important. Make it so! Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c llvm-gcc-4.2/trunk/gcc/varasm.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=46747&r1=46746&r2=46747&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Tue Feb 5 03:46:24 2008 @@ -1988,6 +1988,19 @@ extern". There is no MACH-O equivalent of ELF's VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */ +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM +void +darwin_assemble_visibility (tree decl ATTRIBUTE_UNUSED, int vis) +{ + /* Emit a warning if the visibility isn't supported with this + configuration. We don't want to output anything to the ASM file, of + course. */ + if (!(vis == VISIBILITY_DEFAULT || vis == VISIBILITY_HIDDEN)) +warning (OPT_Wattributes, "internal and protected visibility attributes " +"not supported in this configuration; ignored"); +} +#else void darwin_assemble_visibility (tree decl, int vis) { @@ -2004,6 +2017,8 @@ warning (OPT_Wattributes, "internal and protected visibility attributes " "not supported in this configuration; ignored"); } +#endif +/* LLVM LOCAL end */ /* Output a difference of two labels that will be an assembly time constant if the two labels are local. (.long lab1-lab2 will be Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c?rev=46747&r1=46746&r2=46747&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Tue Feb 5 03:46:24 2008 @@ -944,10 +944,14 @@ #undef TARGET_ASM_INTEGER #define TARGET_ASM_INTEGER rs6000_assemble_integer +/* LLVM LOCAL - Use default assemble_visibility */ +#ifndef ENABLE_LLVM #ifdef HAVE_GAS_HIDDEN #undef TARGET_ASM_ASSEMBLE_VISIBILITY #define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility #endif +/* LLVM LOCAL - Use default assemble_visibility */ +#endif #undef TARGET_HAVE_TLS #define TARGET_HAVE_TLS HAVE_AS_TLS Modified: llvm-gcc-4.2/trunk/gcc/varasm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=46747&r1=46746&r2=46747&view=diff == --- llvm-gcc-4.2/trunk/gcc/varasm.c (original) +++ llvm-gcc-4.2/trunk/gcc/varasm.c Tue Feb 5 03:46:24 2008 @@ -1889,7 +1889,15 @@ fprintf(stderr, "LLVM must emit the data!"); abort(); } + emit_global_to_llvm(decl); + + /* The "make_assemble_visibility" method may issue a warning if the visibility + attribute isn't supported in a configuration. This is all done through a + call-back. We want to issue this same warning when needed. */ + if (TREE_PUBLIC (decl)) +maybe_assemble_visibility (decl); + return; #endif /* LLVM LOCAL end */ @@ -5307,7 +5315,8 @@ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); type = visibility_types[vis]; -#ifdef HAVE_GAS_HIDDEN + +#if !defined(ENABLE_LLVM) && defined(HAVE_GAS_HIDDEN) fprintf (asm_out_file, "\t.%s\t", type); assemble_name (asm_out_file, name); fprintf (asm_out_file, "\n"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46727 - /llvm/trunk/include/llvm/IntrinsicsX86.td
On Feb 4, 2008, at 9:07 PM, Chris Lattner wrote: > > On Feb 4, 2008, at 3:27 PM, Dale Johannesen wrote: > >> Author: johannes >> Date: Mon Feb 4 17:27:29 2008 >> New Revision: 46727 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=46727&view=rev >> Log: >> Do not unconditionally redefine vec_ext_v16qi and >> vec_ext_v4si builtins. This is a hack; they should >> be defined here, then resolved in the X86 BE. >> However there is enough other stuff missing in the >> X86 BE for SSE41 that this will do for now. > > I think these are in the category of builtins that should be expanded > by the FE, and thus should be removed. Nate, thoughts? > > -Chris That means you have to know whether you've got SSE4.1 in the FE. This is not an insuperable obstacle, but I think it's better to leave target dependencies in the BE when possible. >> Modified: >> llvm/trunk/include/llvm/IntrinsicsX86.td >> >> Modified: llvm/trunk/include/llvm/IntrinsicsX86.td >> URL: >> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=46727&r1=46726&r2=46727&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> = >> --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) >> +++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Feb 4 17:27:29 2008 >> @@ -764,9 +764,9 @@ >> >> // Vector extract >> let TargetPrefix = "x86" in { // All intrinsics start with >> "llvm.x86.". >> - def int_x86_sse41_pextrb : >> GCCBuiltin<"__builtin_ia32_vec_ext_v16qi">, >> + def int_x86_sse41_pextrb : >> Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>; >> - def int_x86_sse41_pextrd : >> GCCBuiltin<"__builtin_ia32_vec_ext_v4si">, >> + def int_x86_sse41_pextrd : >> Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>; >> def int_x86_sse41_pextrq : >> GCCBuiltin<"__builtin_ia32_vec_ext_v2di">, >> Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>; >> >> >> ___ >> 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
[llvm-commits] [llvm] r46753 - in /llvm/trunk/include/llvm/ADT: ImmutableMap.h ImmutableSet.h
Author: kremenek Date: Tue Feb 5 11:30:43 2008 New Revision: 46753 URL: http://llvm.org/viewvc/llvm-project?rev=46753&view=rev Log: Changed profiling method for ImmutableMap to once again just use its unique ImutAVLTree* for profiling. Modified ImutAVLTree: (1) changed ComputeHash() to ComputeDigest() and (2) changed Profile() to use the computed digest and (3) modified insertion of IMutAVLTree into the FoldingSet owned by the ImutAVLTreeFactory object to use profiling instead of computing a direct hash. This fixes a bug where our abuse of the FoldingSet would not work when the FoldingSet was resized. Modified: llvm/trunk/include/llvm/ADT/ImmutableMap.h llvm/trunk/include/llvm/ADT/ImmutableSet.h Modified: llvm/trunk/include/llvm/ADT/ImmutableMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableMap.h?rev=46753&r1=46752&r2=46753&view=diff == --- llvm/trunk/include/llvm/ADT/ImmutableMap.h (original) +++ llvm/trunk/include/llvm/ADT/ImmutableMap.h Tue Feb 5 11:30:43 2008 @@ -206,7 +206,7 @@ inline unsigned getHeight() const { return Root ? Root->getHeight() : 0; } static inline void Profile(FoldingSetNodeID& ID, const ImmutableMap& M) { -M.Root->Profile(ID); +ID.AddPointer(M.Root); } inline void Profile(FoldingSetNodeID& ID) const { Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=46753&r1=46752&r2=46753&view=diff == --- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original) +++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Tue Feb 5 11:30:43 2008 @@ -203,13 +203,10 @@ return getHeight(); } - /// Profile - Profiling for ImutAVLTree. This is not used by the - //Factory object (which internally uses a FoldingSet), but can - //be used by external clients that wish to insert an ImutAVLTree - //object into a FoldingSet. - void Profile(llvm::FoldingSetNodeID& ID) const { -ID.AddPointer(this); - } + /// Profile - Profiling for ImutAVLTree. + void Profile(llvm::FoldingSetNodeID& ID) { +ID.AddInteger(ComputeDigest()); + } //======// // Internal Values. @@ -220,7 +217,7 @@ ImutAVLTree* Right; unsigned Height; value_type Value; - unsigned Hash; + unsigned Digest; //======// // Internal methods (node manipulation; used by Factory). @@ -234,7 +231,7 @@ /// ImutAVLFactory. ImutAVLTree(ImutAVLTree* l, ImutAVLTree* r, value_type_ref v, unsigned height) : Left(reinterpret_cast(l) | Mutable), -Right(r), Height(height), Value(v), Hash(0) {} +Right(r), Height(height), Value(v), Digest(0) {} /// isMutable - Returns true if the left and right subtree references @@ -299,27 +296,27 @@ static inline - unsigned ComputeHash(ImutAVLTree* L, ImutAVLTree* R, value_type_ref V) { -unsigned hash = 0; + unsigned ComputeDigest(ImutAVLTree* L, ImutAVLTree* R, value_type_ref V) { +unsigned digest = 0; -if (L) hash += L->ComputeHash(); +if (L) digest += L->ComputeDigest(); -{ // Compute hash of stored data. +{ // Compute digest of stored data. FoldingSetNodeID ID; ImutInfo::Profile(ID,V); - hash += ID.ComputeHash(); + digest += ID.ComputeHash(); } -if (R) hash += R->ComputeHash(); +if (R) digest += R->ComputeDigest(); -return hash; +return digest; } - inline unsigned ComputeHash() { -if (Hash) return Hash; + inline unsigned ComputeDigest() { +if (Digest) return Digest; -unsigned X = ComputeHash(getSafeLeft(), getRight(), getValue()); -if (!isMutable()) Hash = X; +unsigned X = ComputeDigest(getSafeLeft(), getRight(), getValue()); +if (!isMutable()) Digest = X; return X; } @@ -408,15 +405,19 @@ //===--===// TreeTy* CreateNode(TreeTy* L, value_type_ref V, TreeTy* R) { -// Search the FoldingSet bucket for a Tree with the same hash. -unsigned hash = TreeTy::ComputeHash(L, R, V); +// Search the FoldingSet bucket for a Tree with the same digest. +FoldingSetNodeID ID; +unsigned digest = TreeTy::ComputeDigest(L, R, V); +ID.AddInteger(digest); +unsigned hash = ID.ComputeHash(); + typename CacheTy::bucket_iterator I = Cache.bucket_begin(hash); typename CacheTy::bucket_iterator E = Cache.bucket_end(hash); for (; I != E; ++I) { TreeTy* T = &*I; - if (T->ComputeHash() != hash) + if (T->ComputeDigest() != digest) continue; // We found a collision. Perform a comparison of Contents
[llvm-commits] [llvm] r46757 - /llvm/trunk/include/llvm/ADT/ImmutableSet.h
Author: kremenek Date: Tue Feb 5 12:50:25 2008 New Revision: 46757 URL: http://llvm.org/viewvc/llvm-project?rev=46757&view=rev Log: Added FoldingSet profiling support to ImmutableSet. 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=46757&r1=46756&r2=46757&view=diff == --- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original) +++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Tue Feb 5 12:50:25 2008 @@ -1012,11 +1012,24 @@ iterator end() const { return iterator(); } //===--===// + // Utility methods. + //===--===// + + inline unsigned getHeight() const { return Root ? Root->getHeight() : 0; } + + static inline void Profile(FoldingSetNodeID& ID, const ImmutableSet& S) { +ID.AddPointer(S.Root); + } + + inline void Profile(FoldingSetNodeID& ID) const { +return Profile(ID,*this); + } + + //===--===// // For testing. //===--===// void verify() const { if (Root) Root->verify(); } - unsigned getHeight() const { return Root ? Root->getHeight() : 0; } }; } // end namespace llvm ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46730 - /llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp
Evan, > This should also work on x86 now. But this this worked on PPC before then? -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46727 - /llvm/trunk/include/llvm/IntrinsicsX86.td
On Feb 5, 2008, at 9:43 AM, Dale Johannesen wrote: > > On Feb 4, 2008, at 9:07 PM, Chris Lattner wrote: > >> >> On Feb 4, 2008, at 3:27 PM, Dale Johannesen wrote: >> >>> Author: johannes >>> Date: Mon Feb 4 17:27:29 2008 >>> New Revision: 46727 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=46727&view=rev >>> Log: >>> Do not unconditionally redefine vec_ext_v16qi and >>> vec_ext_v4si builtins. This is a hack; they should >>> be defined here, then resolved in the X86 BE. >>> However there is enough other stuff missing in the >>> X86 BE for SSE41 that this will do for now. >> >> I think these are in the category of builtins that should be expanded >> by the FE, and thus should be removed. Nate, thoughts? >> >> -Chris > > That means you have to know whether you've got SSE4.1 in the FE. > This is not an insuperable obstacle, but I think it's better to leave > target > dependencies in the BE when possible. Even with SSE4.1, it's a good idea to lower them to extract element instructions. X86ISelLoweringhas all the information necessary to determine what instructions to they should be selected to. Evan > > >>> Modified: >>> llvm/trunk/include/llvm/IntrinsicsX86.td >>> >>> Modified: llvm/trunk/include/llvm/IntrinsicsX86.td >>> URL: >>> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=46727&r1=46726&r2=46727&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> >>> --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) >>> +++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Feb 4 17:27:29 >>> 2008 >>> @@ -764,9 +764,9 @@ >>> >>> // Vector extract >>> let TargetPrefix = "x86" in { // All intrinsics start with >>> "llvm.x86.". >>> - def int_x86_sse41_pextrb : >>> GCCBuiltin<"__builtin_ia32_vec_ext_v16qi">, >>> + def int_x86_sse41_pextrb : >>> Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>; >>> - def int_x86_sse41_pextrd : >>> GCCBuiltin<"__builtin_ia32_vec_ext_v4si">, >>> + def int_x86_sse41_pextrd : >>> Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>; >>> def int_x86_sse41_pextrq : >>> GCCBuiltin<"__builtin_ia32_vec_ext_v2di">, >>> Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>; >>> >>> >>> ___ >>> 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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46730 - /llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp
Yes it did. Evan On Feb 5, 2008, at 10:38 AM, Anton Korobeynikov wrote: > Evan, > >> This should also work on x86 now. > But this this worked on PPC before then? > > -- > With best regards, Anton Korobeynikov. > > Faculty of Mathematics & Mechanics, Saint Petersburg State University. > > > ___ > 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] r46760 - in /llvm/trunk: Makefile.rules autoconf/configure.ac
Author: lattner Date: Tue Feb 5 13:43:40 2008 New Revision: 46760 URL: http://llvm.org/viewvc/llvm-project?rev=46760&view=rev Log: Make the check for GCC version more robust, fix shared library dependencies in makefile, and fix llvm_cv_no_link_all_option on darwin. Patch by Shantonu Sen, more info here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-February/012410.html Modified: llvm/trunk/Makefile.rules llvm/trunk/autoconf/configure.ac Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=46760&r1=46759&r2=46760&view=diff == --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Feb 5 13:43:40 2008 @@ -805,7 +805,7 @@ else SharedLibKindMessage := "Shared Library" endif -$(LibName.LA): $(ObjectsLO) $(LibDir)/.dir +$(LibName.LA): $(ObjectsLO) $(ProjLibsPaths) $(LLVMLibsPaths) $(LibDir)/.dir $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \ $(LIBRARYNAME)$(SHLIBEXT) $(Verb) $(LTLink) -o $@ $(ObjectsLO) $(ProjLibsOptions) \ Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=46760&r1=46759&r2=46760&view=diff == --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Tue Feb 5 13:43:40 2008 @@ -119,7 +119,7 @@ llvm_cv_platform_type="Unix" ;; *-*-darwin*) llvm_cv_link_all_option="-Wl,-all_load" -llvm_cv_link_all_option="-Wl,-noall_load" +llvm_cv_no_link_all_option="-Wl,-noall_load" llvm_cv_os_type="Darwin" llvm_cv_platform_type="Unix" ;; *-*-freebsd*) @@ -656,11 +656,10 @@ dnl Verify that GCC is version 3.0 or higher if test "$GCC" = "yes" then - gccmajor=`$CC --version | head -n 1 | sed 's/[[^0-9]]*\([[0-9.]]\).*/\1/'` - if test "$gccmajor" -lt "3" - then -AC_MSG_ERROR([gcc 3.x required, but you have a lower version]) - fi + AC_COMPILE_IFELSE([[#if !defined(__GNUC__) || __GNUC__ < 3 +#error Unsupported GCC version +#endif +]], [], [AC_MSG_ERROR([gcc 3.x required, but you have a lower version])]) fi dnl Check for GNU Make. We use its extensions, so don't build without it ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46761 - /llvm/trunk/configure
Author: lattner Date: Tue Feb 5 13:43:53 2008 New Revision: 46761 URL: http://llvm.org/viewvc/llvm-project?rev=46761&view=rev Log: regenerate Modified: llvm/trunk/configure Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=46761&r1=46760&r2=46761&view=diff == --- llvm/trunk/configure (original) +++ llvm/trunk/configure Tue Feb 5 13:43:53 2008 @@ -2263,7 +2263,7 @@ llvm_cv_platform_type="Unix" ;; *-*-darwin*) llvm_cv_link_all_option="-Wl,-all_load" -llvm_cv_link_all_option="-Wl,-noall_load" +llvm_cv_no_link_all_option="-Wl,-noall_load" llvm_cv_os_type="Darwin" llvm_cv_platform_type="Unix" ;; *-*-freebsd*) @@ -26953,13 +26953,57 @@ if test "$GCC" = "yes" then - gccmajor=`$CC --version | head -n 1 | sed 's/[^0-9]*\([0-9.]\).*/\1/'` - if test "$gccmajor" -lt "3" - then -{ { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 + cat >conftest.$ac_ext <<_ACEOF +#if !defined(__GNUC__) || __GNUC__ < 3 +#error Unsupported GCC version +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +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_compile") 2>conftest.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") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && +{ ac_try='test -s conftest.$ac_objext' + { (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") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;} { (exit 1); exit 1; }; } - fi +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test -z "$llvm_cv_gnu_make_command" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46727 - /llvm/trunk/include/llvm/IntrinsicsX86.td
On Feb 5, 2008, at 11:37 AM, Evan Cheng wrote: >> That means you have to know whether you've got SSE4.1 in the FE. >> This is not an insuperable obstacle, but I think it's better to leave >> target >> dependencies in the BE when possible. > > Even with SSE4.1, it's a good idea to lower them to extract element > instructions. X86ISelLoweringhas all the information necessary to > determine what instructions to they should be selected to. Do you mean 'even without SSE4.1'? -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46727 - /llvm/trunk/include/llvm/IntrinsicsX86.td
With or without... On Feb 5, 2008, at 11:39 AM, Chris Lattner wrote: > > On Feb 5, 2008, at 11:37 AM, Evan Cheng wrote: > >>> That means you have to know whether you've got SSE4.1 in the FE. >>> This is not an insuperable obstacle, but I think it's better to >>> leave >>> target >>> dependencies in the BE when possible. >> >> Even with SSE4.1, it's a good idea to lower them to extract element >> instructions. X86ISelLoweringhas all the information necessary to >> determine what instructions to they should be selected to. > > Do you mean 'even without SSE4.1'? > > -Chris > ___ > 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] r46763 - in /llvm/trunk: lib/CodeGen/LiveVariables.cpp test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll
Author: evancheng Date: Tue Feb 5 14:04:18 2008 New Revision: 46763 URL: http://llvm.org/viewvc/llvm-project?rev=46763&view=rev Log: If a vr is already marked alive in a bb, then it has PHI uses that are visited earlier, then it is not killed in the def block (i.e. not dead). Added: llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveVariables.cpp?rev=46763&r1=46762&r2=46763&view=diff == --- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Tue Feb 5 14:04:18 2008 @@ -436,8 +436,9 @@ if (MO.isRegister() && MO.isDef() && MO.getReg()) { if (MRegisterInfo::isVirtualRegister(MO.getReg())) { VarInfo &VRInfo = getVarInfo(MO.getReg()); -// Defaults to dead -VRInfo.Kills.push_back(MI); +if (VRInfo.AliveBlocks.none()) + // If vr is not alive in any block, then defaults to dead. + VRInfo.Kills.push_back(MI); } else if (MRegisterInfo::isPhysicalRegister(MO.getReg()) && !ReservedRegisters[MO.getReg()]) { HandlePhysRegDef(MO.getReg(), MI); Added: llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll?rev=46763&view=auto == --- llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll Tue Feb 5 14:04:18 2008 @@ -0,0 +1,67 @@ +; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin + + %struct.Handle = type { %struct.oopDesc** } + %struct.JNI_ArgumentPusher = type { %struct.SignatureIterator, %struct.JavaCallArguments* } + %struct.JNI_ArgumentPusherArray = type { %struct.JNI_ArgumentPusher, %struct.JvmtiEventEnabled* } + %struct.JavaCallArguments = type { [9 x i32], [9 x i32], i32*, i32*, i32, i32, i32 } + %struct.JvmtiEventEnabled = type { i64 } + %struct.KlassHandle = type { %struct.Handle } + %struct.SignatureIterator = type { i32 (...)**, %struct.KlassHandle, i32, i32, i32 } + %struct.instanceOopDesc = type { %struct.oopDesc } + %struct.oopDesc = type { %struct.instanceOopDesc*, %struct.instanceOopDesc* } [EMAIL PROTECTED] = external constant [44 x i8] ; <[44 x i8]*> [#uses=1] + +define void @_ZN23JNI_ArgumentPusherArray7iterateEy(%struct.JNI_ArgumentPusherArray* %this, i64 %fingerprint) nounwind { +entry: + br label %bb113 + +bb22.preheader:; preds = %bb113 + ret void + +bb32.preheader:; preds = %bb113 + ret void + +bb42.preheader:; preds = %bb113 + ret void + +bb52: ; preds = %bb113 + br label %bb113 + +bb62.preheader:; preds = %bb113 + ret void + +bb72.preheader:; preds = %bb113 + ret void + +bb82: ; preds = %bb113 + br label %bb113 + +bb93: ; preds = %bb113 + br label %bb113 + +bb103.preheader: ; preds = %bb113 + ret void + +bb113: ; preds = %bb113, %bb93, %bb82, %bb52, %entry + %fingerprint_addr.0.reg2mem.9 = phi i64 [ 0, %entry ], [ 0, %bb52 ], [ 0, %bb82 ], [ 0, %bb93 ], [ %tmp118, %bb113 ]; [#uses=1] + tail call void @_Z28report_should_not_reach_herePKci( i8* getelementptr ([44 x i8]* @.str, i32 0, i32 0), i32 817 ) nounwind + %tmp118 = lshr i64 %fingerprint_addr.0.reg2mem.9, 4 ; [#uses=2] + %tmp21158 = and i64 %tmp118, 15 ; [#uses=1] + switch i64 %tmp21158, label %bb113 [ +i64 1, label %bb22.preheader +i64 2, label %bb52 +i64 3, label %bb32.preheader +i64 4, label %bb42.preheader +i64 5, label %bb62.preheader +i64 6, label %bb82 +i64 7, label %bb93 +i64 8, label %bb103.preheader +i64 9, label %bb72.preheader +i64 10, label %UnifiedReturnBlock + ] + +UnifiedReturnBlock:; preds = %bb113 + ret void +} + +declare void @_Z28report_should_not_reach_herePKci(i8*, i32) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46764 - in /llvm/trunk: include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td lib/Target/X86/X86ISelLowering.cpp
Author: johannes Date: Tue Feb 5 14:46:33 2008 New Revision: 46764 URL: http://llvm.org/viewvc/llvm-project?rev=46764&view=rev Log: Implement sseregparm. Modified: llvm/trunk/include/llvm/CallingConv.h llvm/trunk/lib/Target/X86/X86CallingConv.td llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/include/llvm/CallingConv.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallingConv.h?rev=46764&r1=46763&r2=46764&view=diff == --- llvm/trunk/include/llvm/CallingConv.h (original) +++ llvm/trunk/include/llvm/CallingConv.h Tue Feb 5 14:46:33 2008 @@ -57,7 +57,11 @@ /// X86_FastCall - 'fast' analog of X86_StdCall. Passes first two arguments /// in ECX:EDX registers, others - via stack. Callee is responsible for /// stack cleaning. -X86_FastCall = 65 +X86_FastCall = 65, + +/// X86_SSEreg - The standard convention except that float and double +/// values are returned in XMM0 if SSE support is available. +X86_SSECall = 66 }; } // End CallingConv namespace Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=46764&r1=46763&r2=46764&view=diff == --- llvm/trunk/lib/Target/X86/X86CallingConv.td (original) +++ llvm/trunk/lib/Target/X86/X86CallingConv.td Tue Feb 5 14:46:33 2008 @@ -61,6 +61,15 @@ CCDelegateTo ]>; +// X86-32 SSEregparm return-value convention. +def RetCC_X86_32_SSE : CallingConv<[ + // The X86-32 sseregparm calling convention returns FP values in XMM0 if the + // target has SSE2, otherwise it is the C calling convention. + CCIfType<[f32], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0]>>>, + CCIfType<[f64], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0]>>>, + CCDelegateTo +]>; + // X86-64 C return-value convention. def RetCC_X86_64_C : CallingConv<[ // The X86-64 calling convention always returns FP values in XMM0. @@ -69,12 +78,12 @@ CCDelegateTo ]>; - - // This is the root return-value convention for the X86-32 backend. def RetCC_X86_32 : CallingConv<[ // If FastCC, use RetCC_X86_32_Fast. CCIfCC<"CallingConv::Fast", CCDelegateTo>, + // If SSECC, use RetCC_X86_32_SSE. + CCIfCC<"CallingConv::X86_SSECall", CCDelegateTo>, // Otherwise, use RetCC_X86_32_C. CCDelegateTo ]>; @@ -179,6 +188,11 @@ // Handles byval parameters. CCIfByVal>, + // The first 3 float or double arguments, if marked 'inreg' and if the call + // is not a vararg call and if SSE2 is available, are passed in SSE registers. + CCIfNotVarArg, + // Integer/Float values get stored in stack slots that are 4 bytes in // size and 4-byte aligned. CCIfType<[i32, f32], CCAssignToStack<4, 4>>, Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46764&r1=46763&r2=46764&view=diff == --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Feb 5 14:46:33 2008 @@ -1137,9 +1137,9 @@ RC = X86::GR32RegisterClass; else if (Is64Bit && RegVT == MVT::i64) RC = X86::GR64RegisterClass; - else if (Is64Bit && RegVT == MVT::f32) + else if (RegVT == MVT::f32) RC = X86::FR32RegisterClass; - else if (Is64Bit && RegVT == MVT::f64) + else if (RegVT == MVT::f64) RC = X86::FR64RegisterClass; else { assert(MVT::isVector(RegVT)); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r46765 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h llvm-types.cpp
Author: johannes Date: Tue Feb 5 14:48:34 2008 New Revision: 46765 URL: http://llvm.org/viewvc/llvm-project?rev=46765&view=rev Log: Implement sseregparm in llvm. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h llvm-gcc-4.2/trunk/gcc/llvm-types.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=46765&r1=46764&r2=46765&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 Tue Feb 5 14:48:34 2008 @@ -28,8 +28,11 @@ CC = CallingConv::X86_StdCall;\ } else if (lookup_attribute("fastcall", type_attributes)) { \ CC = CallingConv::X86_FastCall; \ +} else if (!TARGET_64BIT && \ + lookup_attribute("sseregparm", type_attributes)){\ + CC = CallingConv::X86_SSECall;\ } \ - } \ + } /* LLVM specific stuff for converting gcc's `regparm` attribute to LLVM's `inreg` parameter attribute */ @@ -37,28 +40,46 @@ extern int ix86_regparm; -#define LLVM_TARGET_INIT_REGPARM(local_regparm, type) \ +#define LLVM_TARGET_INIT_REGPARM(local_regparm, local_fp_regparm, type) \ { \ tree attr; \ local_regparm = ix86_regparm; \ +local_fp_regparm = TARGET_SSEREGPARM ? 3 : 0; \ attr = lookup_attribute ("regparm", \ TYPE_ATTRIBUTES (type)); \ if (attr) { \ local_regparm = TREE_INT_CST_LOW (TREE_VALUE \ (TREE_VALUE (attr))); \ } \ +attr = lookup_attribute("sseregparm", \ + TYPE_ATTRIBUTES (type)); \ +if (attr) \ + local_fp_regparm = 3; \ } -#define LLVM_ADJUST_REGPARM_ATTRIBUTE(Attribute, Size, \ - local_regparm)\ +#define LLVM_ADJUST_REGPARM_ATTRIBUTE(Attribute, Type, Size,\ + local_regparm,\ + local_fp_regparm) \ { \ if (!TARGET_64BIT) {\ - int words = (Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \ - local_regparm -= words; \ - if (local_regparm>=0) { \ -Attribute |= ParamAttr::InReg; \ - } else\ -local_regparm = 0; \ + if (TREE_CODE(Type) == REAL_TYPE && \ + (TYPE_PRECISION(Type)==32 || \ + TYPE_PRECISION(Type)==64)) { \ + local_fp_regparm -= 1;\ + if (local_fp_regparm >= 0)\ +Attribute |= ParamAttr::InReg; \ + else \ +local_fp_regparm = 0; \ + } else if (TREE_CODE(Type) == INTEGER_TYPE || \ + TREE_CODE(Type) == ENUMERAL_TYPE) {\ + int words = \ + (Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \ + local_regparm -= words; \ + if (local_regparm>=0) \ +Attribute |= ParamAttr::InReg; \ + else \ +local_regparm = 0; \ + } \ } \ } Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=46765&r1=46764&r2=46765&view=diff == --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm
[llvm-commits] [llvm] r46767 - /llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Author: lattner Date: Tue Feb 5 15:26:23 2008 New Revision: 46767 URL: http://llvm.org/viewvc/llvm-project?rev=46767&view=rev Log: Make RenamePass faster by making the 'is this a new phi node' check more intelligent. This speeds up mem2reg from 5.29s to 0.79s on a synthetic testcase with tons of predecessors and phi nodes. Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=46767&r1=46766&r2=46767&view=diff == --- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Tue Feb 5 15:26:23 2008 @@ -849,7 +849,6 @@ return true; } - // RenamePass - Recursively traverse the CFG of the function, renaming loads and // stores to the allocas which we are promoting. IncomingVals indicates what // value each Alloca contains on exit from the predecessor block Pred. @@ -877,6 +876,14 @@ // If we have PHI nodes to update, compute the number of edges from Pred to // BB. if (!HasPredEntries) { + // We want to be able to distinguish between PHI nodes being inserted by + // this invocation of mem2reg from those phi nodes that already existed in + // the IR before mem2reg was run. We determine that APN is being inserted + // because it is missing incoming edges. All other PHI nodes being + // inserted by this pass of mem2reg will have the same number of incoming + // operands so far. Remember this count. + unsigned NewPHINumOperands = APN->getNumOperands(); + TerminatorInst *PredTerm = Pred->getTerminator(); unsigned NumEdges = 0; for (unsigned i = 0, e = PredTerm->getNumSuccessors(); i != e; ++i) { @@ -902,16 +909,9 @@ APN = dyn_cast(PNI); if (APN == 0) break; -// Verify it doesn't already have entries for Pred. If it does, it is -// not being inserted by this mem2reg invocation. -HasPredEntries = false; -for (unsigned i = 0, e = APN->getNumIncomingValues(); i != e; ++i) { - if (APN->getIncomingBlock(i) == Pred) { -HasPredEntries = true; -break; - } -} - } while (!HasPredEntries); +// Verify that it is missing entries. If not, it is not being inserted +// by this mem2reg invocation so we want to ignore it. + } while (APN->getNumOperands() == NewPHINumOperands); } } ___ 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] r46765 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h llvm-types.cpp
Hi Dale, Looks like there is some desynchronization here now: > + } else if (TREE_CODE(Type) == INTEGER_TYPE || \ > + TREE_CODE(Type) == ENUMERAL_TYPE) {\ Shouldn't be POINTER_TYPE here also? > +if (TREE_CODE(ArgTy) == INTEGER_TYPE || TREE_CODE(ArgTy) == POINTER_TYPE > || > +TREE_CODE(ArgTy) == REAL_TYPE) And ENUMERAL_TYPE here? -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. ___ 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] r46765 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h llvm-types.cpp
On Feb 5, 2008, at 1:56 PM, Anton Korobeynikov wrote: > Hi Dale, > > Looks like there is some desynchronization here now: > >> + } else if (TREE_CODE(Type) == INTEGER_TYPE || \ >> + TREE_CODE(Type) == ENUMERAL_TYPE) {\ > Shouldn't be POINTER_TYPE here also? > >> +if (TREE_CODE(ArgTy) == INTEGER_TYPE || TREE_CODE(ArgTy) == >> POINTER_TYPE || >> +TREE_CODE(ArgTy) == REAL_TYPE) > And ENUMERAL_TYPE here? Oops, I meant POINTER throughout, as it was before. Will fix, thanks. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46727 - /llvm/trunk/include/llvm/IntrinsicsX86.td
On Feb 5, 2008, at 11:41 AM, Evan Cheng wrote: > With or without... Right, I agree. The f.e. should do this unconditionally, -Chris > > > On Feb 5, 2008, at 11:39 AM, Chris Lattner wrote: > >> >> On Feb 5, 2008, at 11:37 AM, Evan Cheng wrote: >> That means you have to know whether you've got SSE4.1 in the FE. This is not an insuperable obstacle, but I think it's better to leave target dependencies in the BE when possible. >>> >>> Even with SSE4.1, it's a good idea to lower them to extract element >>> instructions. X86ISelLoweringhas all the information necessary to >>> determine what instructions to they should be selected to. >> >> Do you mean 'even without SSE4.1'? >> >> -Chris >> ___ >> 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
[llvm-commits] [llvm-gcc-4.2] r46773 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
Author: johannes Date: Tue Feb 5 16:22:23 2008 New Revision: 46773 URL: http://llvm.org/viewvc/llvm-project?rev=46773&view=rev Log: Fix per review feedback. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h 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=46773&r1=46772&r2=46773&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 Tue Feb 5 16:22:23 2008 @@ -71,7 +71,7 @@ else \ local_fp_regparm = 0; \ } else if (TREE_CODE(Type) == INTEGER_TYPE || \ - TREE_CODE(Type) == ENUMERAL_TYPE) {\ + TREE_CODE(Type) == POINTER_TYPE) { \ int words = \ (Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \ local_regparm -= words; \ ___ 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] r46765 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h llvm-types.cpp
On Feb 5, 2008, at 2:16 PM, Dale Johannesen wrote: > > On Feb 5, 2008, at 1:56 PM, Anton Korobeynikov wrote: > >> Hi Dale, >> >> Looks like there is some desynchronization here now: >> >>> + } else if (TREE_CODE(Type) == INTEGER_TYPE || \ >>> + TREE_CODE(Type) == ENUMERAL_TYPE) {\ >> Shouldn't be POINTER_TYPE here also? >> >>> +if (TREE_CODE(ArgTy) == INTEGER_TYPE || TREE_CODE(ArgTy) == >>> POINTER_TYPE || >>> +TREE_CODE(ArgTy) == REAL_TYPE) >> And ENUMERAL_TYPE here? > > Oops, I meant POINTER throughout, as it was before. Will fix, thanks. Fixed. There is something wrong with the dependencies. I had to remove llvm-types.o to get it to recompile. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46764 - in /llvm/trunk: include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td lib/Target/X86/X86ISelLowering.cpp
On Feb 5, 2008, at 12:46 PM, Dale Johannesen wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=46764&view=rev > Log: > Implement sseregparm. Very nice. One thought about X86_SSECall: if it is only used to return float/ double in an xmm reg, you could get the same effect by having the CFE lower ssecall functions to return <4x f32> and <2 x f64> instead of float/double. On the callee, you'd end up with an "ret insertelement undef, fpval" and on the caller side you'd get an extract element. I think the calling convention stuff that Evan has been working on is powerful enough to model though sort of stuff, but might need minor extensions. Do you think it would be reasonable do use this approach? Doing so would eliminate a "magic" calling convention, which would be nice :) -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46556 - in /llvm/trunk: include/llvm/CodeGen/PseudoSourceValue.h include/llvm/Value.h lib/CodeGen/PseudoSourceValue.cpp
> Some comments on the patch: > > + > + // Save loads/stores matched by a pattern. > + if (!N->isLeaf() && N->getName().empty() && > + ((N->getOperator()->getName() == "ld") || > + (N->getOperator()->getName() == "st") || > + (N->getOperator()->getName() == "ist"))) { > + LSI.push_back(RootName); > + } > + > > I am not sure about this. Perhaps it should be similar to > what > InstrInfoEmitter.cpp is doing? The MayStore and MayLoad properties are per-instruction; the code above needs to know which specific SDNodes in the pattern will be represented with StoreSDNode or LoadSDNode. An alternative to checking for "st" and friends would be to check if the node's Opcode field is one of the strings "ISD::STORE" or "ISD::LOAD"; I guess that's a little more flexible. > + static const char *PSVNames[] = { > + "FPRel", > + "SPRel", > + "GPRel", > + "TPRel", > + "CPRel", > + "JTRel" > + }; > > I am taking exception to the names. FPRel looks too much like it has > something to do with FP register, GPRel looks like it is referring to > general purpose register. How about just spill it out? e.g. > StackObjRel, FixedStackObjRel, GOTRel, ThreadPtrRel, > ConstPoolRel, JumpTabRel? Sounds reasonable to me. I'll update this before committing. Dan ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46764 - in /llvm/trunk: include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td lib/Target/X86/X86ISelLowering.cpp
On Feb 5, 2008, at 2:25 PM, Chris Lattner wrote: > On Feb 5, 2008, at 12:46 PM, Dale Johannesen wrote: >> URL: http://llvm.org/viewvc/llvm-project?rev=46764&view=rev >> Log: >> Implement sseregparm. > > Very nice. > > One thought about X86_SSECall: if it is only used to return float/ > double in an xmm reg, you could get the same effect by having the CFE > lower ssecall functions to return <4x f32> and <2 x f64> instead of > float/double. On the callee, you'd end up with an "ret insertelement > undef, fpval" and on the caller side you'd get an extract element. > > I think the calling convention stuff that Evan has been working on is > powerful enough to model though sort of stuff, but might need minor > extensions. Do you think it would be reasonable do use this > approach? Doing so would eliminate a "magic" calling convention, > which would be nice :) It would, but coercing standard types to a different type strikes me as worse. The IR really ought to be able to handle standard types without obfuscation. What I really wanted was to put InReg on the return value. ___ 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] r46773 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
> URL: http://llvm.org/viewvc/llvm-project?rev=46773&view=rev > Log: > Fix per review feedback. Thanks! -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46764 - in /llvm/trunk: include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td lib/Target/X86/X86ISelLowering.cpp
On Feb 5, 2008, at 2:34 PM, Chris Lattner wrote: > On Feb 5, 2008, at 2:31 PM, Dale Johannesen wrote: >>> I think the calling convention stuff that Evan has been working on >>> is >>> powerful enough to model though sort of stuff, but might need minor >>> extensions. Do you think it would be reasonable do use this >>> approach? Doing so would eliminate a "magic" calling convention, >>> which would be nice :) >> >> It would, but coercing standard types to a different type strikes me >> as worse. >> The IR really ought to be able to handle standard types without >> obfuscation. > > I don't think it would be a problem in this specific case, but I > understand what you mean. > >> What I really wanted was to put InReg on the return value. > > Ah, that's a good idea. Why not do that? :) Generally, putting the > attribute on argument "#0" means that the attribute applies to the > function or the return value. Given that 'inreg' doesn't make any > sense for a function, it would be fine to overload it for this, what > do you think? Sound good if it's that simple. It looked more complicated, but I was probably missing something. I'll look again. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46727 - /llvm/trunk/include/llvm/IntrinsicsX86.td
On Feb 5, 2008, at 2:19 PM, Chris Lattner wrote: > On Feb 5, 2008, at 11:41 AM, Evan Cheng wrote: >> With or without... > > Right, I agree. The f.e. should do this unconditionally, > > -Chris OK, maybe so. The trouble is people use those builtins that are linked to a particular instruction, and expect to get that instruction and nothing else. But I don't have much sympathy for those people:) >> On Feb 5, 2008, at 11:39 AM, Chris Lattner wrote: >>> On Feb 5, 2008, at 11:37 AM, Evan Cheng wrote: >>> > That means you have to know whether you've got SSE4.1 in the FE. > This is not an insuperable obstacle, but I think it's better to > leave > target > dependencies in the BE when possible. Even with SSE4.1, it's a good idea to lower them to extract element instructions. X86ISelLoweringhas all the information necessary to determine what instructions to they should be selected to. >>> >>> Do you mean 'even without SSE4.1'? >>> >>> -Chris >>> ___ >>> 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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46775 - /llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
Author: evancheng Date: Tue Feb 5 16:44:06 2008 New Revision: 46775 URL: http://llvm.org/viewvc/llvm-project?rev=46775&view=rev Log: Move to getCALLSEQ_END to ensure CALLSEQ_END node produces a flag. This is consistent with the definition in td file. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=46775&r1=46774&r2=46775&view=diff == --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Tue Feb 5 16:44:06 2008 @@ -1227,6 +1227,13 @@ Chain = DAG.getNode(CallOpc, NodeTys, &Ops[0], Ops.size()); InFlag = Chain.getValue(1); + Chain = DAG.getCALLSEQ_END(Chain, + DAG.getConstant(NumStackBytes, PtrVT), + DAG.getConstant(0, PtrVT), + InFlag); + if (Op.Val->getValueType(0) != MVT::Other) +InFlag = Chain.getValue(1); + SDOperand ResultVals[3]; unsigned NumResults = 0; NodeTys.clear(); @@ -1278,8 +1285,6 @@ break; } - Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain, - DAG.getConstant(NumStackBytes, PtrVT)); NodeTys.push_back(MVT::Other); // If the function returns void, just return the chain. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46776 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/2008-02-05-ISelCrash.ll utils/TableGen/DAGISelEmitter.cpp
Author: evancheng Date: Tue Feb 5 16:50:29 2008 New Revision: 46776 URL: http://llvm.org/viewvc/llvm-project?rev=46776&view=rev Log: Fix PR1975: dag isel emitter produces patterns that isel wrong flag result. Added: llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=46776&r1=46775&r2=46776&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Feb 5 16:50:29 2008 @@ -3183,10 +3183,6 @@ void SelectionDAG::ReplaceAllUsesWith(SDOperand FromN, SDOperand To, DAGUpdateListener *UpdateListener) { SDNode *From = FromN.Val; - // FIXME: This works around a dag isel emitter bug. - if (From->getNumValues() == 1 && FromN.ResNo != 0) -return; // FIXME: THIS IS BOGUS - assert(From->getNumValues() == 1 && FromN.ResNo == 0 && "Cannot replace with this method!"); assert(From != To.Val && "Cannot replace uses of with self"); Added: llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll?rev=46776&view=auto == --- llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll Tue Feb 5 16:50:29 2008 @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=x86 +; PR1975 + [EMAIL PROTECTED] = external global i64 ; [#uses=2] + +define fastcc i32 @ab(i32 %alpha, i32 %beta) nounwind { +entry: + %tmp1 = load i64* @nodes, align 8 ; [#uses=1] + %tmp2 = add i64 %tmp1, 1; [#uses=1] + store i64 %tmp2, i64* @nodes, align 8 + ret i32 0 +} Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=46776&r1=46775&r2=46776&view=diff == --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Tue Feb 5 16:50:29 2008 @@ -305,6 +305,8 @@ std::map VariableMap; // Node to operator mapping std::map OperatorMap; + // Name of the folded node which produces a flag. + std::pair FoldedFlag; // Names of all the folded nodes which produce chains. std::vector > FoldedChains; // Original input chain(s). @@ -587,8 +589,17 @@ emitCheck(RootName + ".getOpcode() == " + CInfo.getEnumName()); EmitMatchCode(Child, Parent, RootName, ChainSuffix, FoundChain); - if (NodeHasProperty(Child, SDNPHasChain, CGP)) + bool HasChain = false; + if (NodeHasProperty(Child, SDNPHasChain, CGP)) { +HasChain = true; FoldedChains.push_back(std::make_pair(RootName, CInfo.getNumResults())); + } + if (NodeHasProperty(Child, SDNPOutFlag, CGP)) { +assert(FoldedFlag.first == "" && FoldedFlag.second == 0 && + "Pattern folded multiple nodes which produce flags?"); +FoldedFlag = std::make_pair(RootName, +CInfo.getNumResults() + (unsigned)HasChain); + } } else { // If this child has a name associated with it, capture it in VarMap. If // we already saw this in the pattern, emit code to verify dagness. @@ -1105,9 +1116,15 @@ } if (NodeHasOutFlag) { - emitCode("ReplaceUses(SDOperand(N.Val, " + - utostr(NumPatResults + (unsigned)InputHasChain) - +"), InFlag);"); + if (FoldedFlag.first != "") { +emitCode("ReplaceUses(SDOperand(" + FoldedFlag.first + ".Val, " + + utostr(FoldedFlag.second) + "), InFlag);"); + } else { +assert(NodeHasProperty(Pattern, SDNPOutFlag, CGP)); +emitCode("ReplaceUses(SDOperand(N.Val, " + + utostr(NumPatResults + (unsigned)InputHasChain) + +"), InFlag);"); + } NeedReplace = true; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46727 - /llvm/trunk/include/llvm/IntrinsicsX86.td
On Feb 5, 2008 2:40 PM, Dale Johannesen <[EMAIL PROTECTED]> wrote: > > On Feb 5, 2008, at 2:19 PM, Chris Lattner wrote: > > > On Feb 5, 2008, at 11:41 AM, Evan Cheng wrote: > >> With or without... > > > > Right, I agree. The f.e. should do this unconditionally, > > > > -Chris > > OK, maybe so. The trouble is people use those builtins that are > linked to a > particular instruction, and expect to get that instruction and nothing > else. > But I don't have much sympathy for those people:) > That's when we point them to the docs on inline ASM ;-) -bw ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46764 - in /llvm/trunk: include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td lib/Target/X86/X86ISelLowering.cpp
On Feb 5, 2008, at 2:31 PM, Dale Johannesen wrote: >> I think the calling convention stuff that Evan has been working on is >> powerful enough to model though sort of stuff, but might need minor >> extensions. Do you think it would be reasonable do use this >> approach? Doing so would eliminate a "magic" calling convention, >> which would be nice :) > > It would, but coercing standard types to a different type strikes me > as worse. > The IR really ought to be able to handle standard types without > obfuscation. I don't think it would be a problem in this specific case, but I understand what you mean. > What I really wanted was to put InReg on the return value. Ah, that's a good idea. Why not do that? :) Generally, putting the attribute on argument "#0" means that the attribute applies to the function or the return value. Given that 'inreg' doesn't make any sense for a function, it would be fine to overload it for this, what do you think? -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46781 - /llvm/trunk/include/llvm/ADT/StringMap.h
Author: asl Date: Tue Feb 5 17:34:40 2008 New Revision: 46781 URL: http://llvm.org/viewvc/llvm-project?rev=46781&view=rev Log: Don't dereference an invalid pointer if string is empty. Modified: llvm/trunk/include/llvm/ADT/StringMap.h Modified: llvm/trunk/include/llvm/ADT/StringMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=46781&r1=46780&r2=46781&view=diff == --- llvm/trunk/include/llvm/ADT/StringMap.h (original) +++ llvm/trunk/include/llvm/ADT/StringMap.h Tue Feb 5 17:34:40 2008 @@ -273,7 +273,7 @@ return find(Key, Key + strlen(Key)); } iterator find(const std::string &Key) { -const char* key_start = &Key[0]; +const char* key_start = (Key.empty() ? NULL : &Key[0]); return find(key_start, key_start + Key.size()); } @@ -286,7 +286,7 @@ return find(Key, Key + strlen(Key)); } const_iterator find(const std::string &Key) const { -const char* key_start = &Key[0]; +const char* key_start = (Key.empty() ? NULL : &Key[0]); return find(key_start, key_start + Key.size()); } @@ -295,7 +295,7 @@ return entry.getValue(); } ValueTy& operator[](const std::string &Key) { -const char* key_start = &Key[0]; +const char* key_start = (Key.empty() ? NULL : &Key[0]); value_type& entry = GetOrCreateValue(key_start, key_start + Key.size()); return entry.getValue(); } @@ -307,7 +307,7 @@ return count(Key, Key + strlen(Key)); } size_type count(const std::string &Key) const { -const char* key_start = &Key[0]; +const char* key_start = (Key.empty() ? NULL : &Key[0]); return count(key_start, key_start + Key.size()); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46790 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Author: tbrethou Date: Tue Feb 5 18:54:55 2008 New Revision: 46790 URL: http://llvm.org/viewvc/llvm-project?rev=46790&view=rev Log: Throttle the non-local dependence analysis for basic blocks with more than 50 predecessors. Added command line option to play with this threshold. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46790&r1=46789&r2=46790&view=diff == --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Feb 5 18:54:55 2008 @@ -20,6 +20,7 @@ #include "llvm/Function.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetData.h" #include "llvm/ADT/Statistic.h" @@ -27,6 +28,15 @@ using namespace llvm; +namespace { + // Control the calculation of non-local dependencies by only examining the + // predecessors if the basic block has less than X amount (50 by default). + cl::opt + PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50), +cl::desc("Control the calculation of non-local" + "dependencies (default = 50)")); +} + STATISTIC(NumCacheNonlocal, "Number of cached non-local responses"); STATISTIC(NumUncacheNonlocal, "Number of uncached non-local responses"); @@ -211,15 +221,18 @@ } // If we didn't find anything, recurse on the precessors of this block +// Only do this for blocks with a small number of predecessors. bool predOnStack = false; bool inserted = false; -for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); - PI != PE; ++PI) - if (!visited.count(*PI)) { -stack.push_back(*PI); -inserted = true; - } else -predOnStack = true; +if (std::distance(pred_begin(BB), pred_end(BB)) <= PredLimit) { + for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); + PI != PE; ++PI) +if (!visited.count(*PI)) { + stack.push_back(*PI); + inserted = true; +} else + predOnStack = true; +} // If we inserted a new predecessor, then we'll come back to this block if (inserted) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46790 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Wow, that must be one hell of a CFG you're dealing with. ;-) --Owen On Feb 5, 2008, at 6:54 PM, Tanya Lattner wrote: Author: tbrethou Date: Tue Feb 5 18:54:55 2008 New Revision: 46790 URL: http://llvm.org/viewvc/llvm-project?rev=46790&view=rev Log: Throttle the non-local dependence analysis for basic blocks with more than 50 predecessors. Added command line option to play with this threshold. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46790&r1=46789&r2=46790&view=diff = = = = = = = = == --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Feb 5 18:54:55 2008 @@ -20,6 +20,7 @@ #include "llvm/Function.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetData.h" #include "llvm/ADT/Statistic.h" @@ -27,6 +28,15 @@ using namespace llvm; +namespace { + // Control the calculation of non-local dependencies by only examining the + // predecessors if the basic block has less than X amount (50 by default). + cl::opt + PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50), +cl::desc("Control the calculation of non-local" + "dependencies (default = 50)")); +} + STATISTIC(NumCacheNonlocal, "Number of cached non-local responses"); STATISTIC(NumUncacheNonlocal, "Number of uncached non-local responses"); @@ -211,15 +221,18 @@ } // If we didn't find anything, recurse on the precessors of this block +// Only do this for blocks with a small number of predecessors. bool predOnStack = false; bool inserted = false; -for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); - PI != PE; ++PI) - if (!visited.count(*PI)) { -stack.push_back(*PI); -inserted = true; - } else -predOnStack = true; +if (std::distance(pred_begin(BB), pred_end(BB)) <= PredLimit) { + for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); + PI != PE; ++PI) +if (!visited.count(*PI)) { + stack.push_back(*PI); + inserted = true; +} else + predOnStack = true; +} // If we inserted a new predecessor, then we'll come back to this block if (inserted) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits smime.p7s Description: S/MIME cryptographic signature ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46810 - /llvm/trunk/docs/ReleaseNotes.html
Author: lattner Date: Wed Feb 6 00:30:34 2008 New Revision: 46810 URL: http://llvm.org/viewvc/llvm-project?rev=46810&view=rev Log: a starter shell for 2.2 release notes Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=46810&r1=46809&r2=46810&view=diff == --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Wed Feb 6 00:30:34 2008 @@ -4,11 +4,11 @@ - LLVM 2.1 Release Notes + LLVM 2.2 Release Notes -LLVM 2.1 Release Notes +LLVM 2.2 Release Notes Introduction @@ -32,7 +32,7 @@ This document contains the release notes for the LLVM compiler -infrastructure, release 2.1. Here we describe the status of LLVM, including +infrastructure, release 2.2. Here we describe the status of LLVM, including major improvements from the previous release and any known problems. All LLVM releases may be downloaded from the http://llvm.org/releases/";>LLVM releases web site. @@ -58,31 +58,35 @@ -This is the twelfth public release of the LLVM Compiler Infrastructure. -It includes many features and refinements from LLVM 2.0. +This is the thirteenth public release of the LLVM Compiler Infrastructure. +It includes many features and refinements from LLVM 2.1. -New Frontends +llvm-gcc 4.0, llvm-gcc 4.2, and clang -LLVM 2.1 brings two new beta C front-ends. First, a new version of llvm-gcc -based on GCC 4.2, innovatively called "llvm-gcc-4.2". This promises to bring -FORTRAN and Ada support to LLVM as well as features like atomic builtins and -OpenMP. None of these actually work yet, but don't let that stop you checking -it out! - -Second, LLVM now includes its own native C and Objective-C front-end (C++ is -in progress, but is not very far along) code named "http://clang.llvm.org/";>clang". This front-end has a number of great -features, primarily aimed at source-level analysis and speeding up compile-time. -At this point though, the LLVM Code Generator component is still very early in -development, so it's mostly useful for people looking to build source-level -analysis tools or source-to-source translators. +LLVM 2.2 fully supports both the llvm-gcc 4.0 and llvm-gcc 4.2 front-ends (in +LLVM 2.1, llvm-gcc 4.2 was beta). Since LLVM 2.1, the llvm-gcc 4.2 front-end +has made leaps and bounds and is now at least as good as 4.0 in virtually every +area, and is better in several areas (for example, exception handling +correctness). We strongly recommend that you migrate from llvm-gcc 4.0 to +llvm-gcc 4.2 in this release cycle because LLVM 2.2 is the last release +that will support llvm-gcc 4.0: LLVM 2.3 will only support the llvm-gcc +4.2 front-end. + +The http://clang.llvm.org/";>clang project is an effort +to build a set of new front-end technology for the LLVM optimizer and code +generator. Currently, its C and Objective-C support is maturing nicely, and it +has advanced source-to-source analysis and transformation capabilities. If you +are interested in building source-level tools for C and Objective-C (and +eventually C++), you should take a look. However, note that clang is not an +official part of the LLVM 2.2 release. If you are interested in this project, +please see the web site and check it out from SVN head. @@ -98,24 +102,7 @@ -Owen Anderson wrote the new MemoryDependenceAnalysis pass, which provides -a lazy, caching layer on top of AliasAnalysis. He then used it to rewrite -DeadStoreElimination which resulted in significantly better compile time in -common cases, -Owen implemented the new GVN pass, which is also based on -MemoryDependenceAnalysis. This pass replaces GCSE/LoadVN in the standard -set of passes, providing more aggressive optimization at a some-what -improved compile-time cost. -Owen implemented GVN-PRE, a partial redundancy elimination algorithm that -shares some details with the new GVN pass. It is still in need of compile -time tuning, and is not turned on by default. -Devang merged ETForest and DomTree into a single easier to use data -structure. This makes it more obvious which datastructure to choose -(because there is only one) and makes the compiler more memory and time -efficient (less stuff to keep up-to-date). -Nick Lewycky improved loop trip count analysis to handle many more common -cases. +. @@ -133,38 +120,7 @@ -Dale finished up the Tail Merging optimization in the code generator, and -enabled it by default. This produces smaller code that is also faster in -some cases. - -Christopher Lamb implemented support for virtual register sub-registers, -which can be used to better model many forms of subregisters. As an example -use, he modified the X86 backend to use this to model truncates and -