[llvm-commits] [poolalloc] r44245 - in /poolalloc/branches/SVA/lib: DSA/Local.cpp DSA/Makefile PoolAllocate/Makefile PoolAllocate/TransformFunctionBody.cpp
Author: criswell Date: Mon Nov 19 15:44:41 2007 New Revision: 44245 URL: http://llvm.org/viewvc/llvm-project?rev=44245&view=rev Log: Recognize malloc() and free() as allocators and deallocators, even in kernel mode. Build object files for linking with the SAFECode tool. Use the correct type for pools when running in kernel and non-kernel mode. Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp poolalloc/branches/SVA/lib/DSA/Makefile poolalloc/branches/SVA/lib/PoolAllocate/Makefile poolalloc/branches/SVA/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/branches/SVA/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/DSA/Local.cpp?rev=44245&r1=44244&r2=44245&view=diff == --- poolalloc/branches/SVA/lib/DSA/Local.cpp (original) +++ poolalloc/branches/SVA/lib/DSA/Local.cpp Mon Nov 19 15:44:41 2007 @@ -1802,6 +1802,7 @@ AllocList.push_back("__alloc_bootmem"); AllocList.push_back(" __get_free_pages"); AllocList.push_back("pseudo_alloc"); + AllocList.push_back("malloc"); #if 0 FreeList.push_back("kfree"); @@ -1810,6 +1811,7 @@ FreeList.push_back("free_pages"); FreeList.push_back("kmem_cache_free"); FreeList.push_back("pseudo_free"); + FreeList.push_back("free"); //figure out all system call numbers Function* lrs = M.getNamedFunction("llva_register_syscall"); Modified: poolalloc/branches/SVA/lib/DSA/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/DSA/Makefile?rev=44245&r1=44244&r2=44245&view=diff == --- poolalloc/branches/SVA/lib/DSA/Makefile (original) +++ poolalloc/branches/SVA/lib/DSA/Makefile Mon Nov 19 15:44:41 2007 @@ -8,8 +8,8 @@ ##===--===## LEVEL = ../.. SHARED_LIBRARY=1 -LOADABLE_MODULE = 1 -DONT_BUILD_RELINKED=1 +#LOADABLE_MODULE = 1 +#DONT_BUILD_RELINKED=1 LIBRARYNAME = LLVMDataStructure include $(LEVEL)/Makefile.common Modified: poolalloc/branches/SVA/lib/PoolAllocate/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/PoolAllocate/Makefile?rev=44245&r1=44244&r2=44245&view=diff == --- poolalloc/branches/SVA/lib/PoolAllocate/Makefile (original) +++ poolalloc/branches/SVA/lib/PoolAllocate/Makefile Mon Nov 19 15:44:41 2007 @@ -7,8 +7,8 @@ # Give the name of a library. This will build a dynamic version. # SHARED_LIBRARY=1 -LOADABLE_MODULE = 1 -DONT_BUILD_RELINKED=1 +#LOADABLE_MODULE = 1 +#DONT_BUILD_RELINKED=1 LIBRARYNAME=poolalloc # Modified: poolalloc/branches/SVA/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/lib/PoolAllocate/TransformFunctionBody.cpp?rev=44245&r1=44244&r2=44245&view=diff == --- poolalloc/branches/SVA/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/branches/SVA/lib/PoolAllocate/TransformFunctionBody.cpp Mon Nov 19 15:44:41 2007 @@ -649,7 +649,11 @@ //Dinakar we need pooldescriptors for allocas in the callee if it escapes BasicBlock::iterator InsertPt = TheCall->getParent()->getParent()->front().begin(); Type *VoidPtrTy = PointerType::get(Type::SByteTy); +#ifdef SAFECODE + ArgVal = new AllocaInst(ArrayType::get(VoidPtrTy, 50), 0, "PD", InsertPt); +#else ArgVal = new AllocaInst(ArrayType::get(VoidPtrTy, 16), 0, "PD", InsertPt); +#endif Value *ElSize = ConstantInt::get(Type::UIntTy,0); Value *Align = ConstantInt::get(Type::UIntTy,0); new CallInst(PAInfo.PoolInit, make_vector(ArgVal, ElSize, Align, 0),"", TheCall); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44244 - /llvm/trunk/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll
Author: lattner Date: Mon Nov 19 15:43:22 2007 New Revision: 44244 URL: http://llvm.org/viewvc/llvm-project?rev=44244&view=rev Log: Testcase for PR1811 Added: llvm/trunk/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll Added: llvm/trunk/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll?rev=44244&view=auto == --- llvm/trunk/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/2007-11-19-VectorSplitting.ll Mon Nov 19 15:43:22 2007 @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g3 +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 +; PR1811 + +define void @execute_shader(<4 x float>* %OUT, <4 x float>* %IN, <4 x float>* +%CONST) { +entry: +%input2 = load <4 x float>* null, align 16 ; <<4 x float>> + %shuffle7 = shufflevector <4 x float> %input2, <4 x float> < float 0.00e+00, float 1.00e+00, float 0.00e+00, float 1.00e+00 >, <4 x i32> < i32 2, i32 2, i32 2, i32 2 > ; <<4 x float>> [#uses=1] + +%mul1 = mul <4 x float> %shuffle7, zeroinitializer ; <<4 x +%add2 = add <4 x float> %mul1, %input2 ; <<4 x float>> +store <4 x float> %add2, <4 x float>* null, align 16 +ret void +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44243 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Author: lattner Date: Mon Nov 19 15:38:03 2007 New Revision: 44243 URL: http://llvm.org/viewvc/llvm-project?rev=44243&view=rev Log: ExpandUnalignedLoad doesn't handle vectors right at all apparently. Fix a couple of problems: 1. Don't assume the VT-1 is a VT that is half the size. 2. Treat vectors of FP in the vector path, not the FP path. This has a couple of remaining problems before it will work with the code in PR1811: the code below this change assumes that it can use extload/shift/or to construct the result, which isn't right for vectors. This also doesn't handle vectors of 1 or vectors that aren't pow-2. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=44243&r1=44242&r2=44243&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 19 15:38:03 2007 @@ -619,13 +619,13 @@ SDOperand Ptr = LD->getBasePtr(); MVT::ValueType VT = LD->getValueType(0); MVT::ValueType LoadedVT = LD->getLoadedVT(); - if (MVT::isFloatingPoint(VT)) { + if (MVT::isFloatingPoint(VT) && !MVT::isVector(VT)) { // Expand to a (misaligned) integer load of the same size, // then bitconvert to floating point. MVT::ValueType intVT; -if (LoadedVT==MVT::f64) +if (LoadedVT == MVT::f64) intVT = MVT::i64; -else if (LoadedVT==MVT::f32) +else if (LoadedVT == MVT::f32) intVT = MVT::i32; else assert(0 && "Unaligned load of unsupported floating point type"); @@ -641,11 +641,25 @@ return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other), Ops, 2); } - assert(MVT::isInteger(LoadedVT) && "Unaligned load of unsupported type."); - MVT::ValueType NewLoadedVT = LoadedVT - 1; - int NumBits = MVT::getSizeInBits(NewLoadedVT); - int Alignment = LD->getAlignment(); - int IncrementSize = NumBits / 8; + assert((MVT::isInteger(LoadedVT) || MVT::isVector(LoadedVT)) && + "Unaligned load of unsupported type."); + + // Compute the new VT that is half the size of the old one. We either have an + // integer MVT or we have a vector MVT. + unsigned NumBits = MVT::getSizeInBits(LoadedVT); + MVT::ValueType NewLoadedVT; + if (!MVT::isVector(LoadedVT)) { +NewLoadedVT = MVT::getIntegerType(NumBits/2); + } else { +// FIXME: This is not right for <1 x anything> it is also not right for +// non-power-of-two vectors. +NewLoadedVT = MVT::getVectorType(MVT::getVectorElementType(LoadedVT), + MVT::getVectorNumElements(LoadedVT)/2); + } + NumBits >>= 1; + + unsigned Alignment = LD->getAlignment(); + unsigned IncrementSize = NumBits / 8; ISD::LoadExtType HiExtType = LD->getExtensionType(); // If the original load is NON_EXTLOAD, the hi part load must be ZEXTLOAD. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44242 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Author: lattner Date: Mon Nov 19 15:16:54 2007 New Revision: 44242 URL: http://llvm.org/viewvc/llvm-project?rev=44242&view=rev Log: Implement vector expand support for shuffle_vector. This fixes PR1811. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=44242&r1=44241&r2=44242&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 19 15:16:54 2007 @@ -6286,6 +6286,41 @@ TLI.getPointerTy())); break; } + case ISD::VECTOR_SHUFFLE: { +// Build the low part. +SDOperand Mask = Node->getOperand(2); +SmallVector Ops; +MVT::ValueType PtrVT = TLI.getPointerTy(); + +// Insert all of the elements from the input that are needed. We use +// buildvector of extractelement here because the input vectors will have +// to be legalized, so this makes the code simpler. +for (unsigned i = 0; i != NewNumElts_Lo; ++i) { + unsigned Idx = cast(Mask.getOperand(i))->getValue(); + SDOperand InVec = Node->getOperand(0); + if (Idx >= NumElements) { +InVec = Node->getOperand(1); +Idx -= NumElements; + } + Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, NewEltVT, InVec, +DAG.getConstant(Idx, PtrVT))); +} +Lo = DAG.getNode(ISD::BUILD_VECTOR, NewVT_Lo, &Ops[0], Ops.size()); +Ops.clear(); + +for (unsigned i = NewNumElts_Lo; i != NumElements; ++i) { + unsigned Idx = cast(Mask.getOperand(i))->getValue(); + SDOperand InVec = Node->getOperand(0); + if (Idx >= NumElements) { +InVec = Node->getOperand(1); +Idx -= NumElements; + } + Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, NewEltVT, InVec, +DAG.getConstant(Idx, PtrVT))); +} +Hi = DAG.getNode(ISD::BUILD_VECTOR, NewVT_Lo, &Ops[0], Ops.size()); +break; + } case ISD::BUILD_VECTOR: { SmallVector LoOps(Node->op_begin(), Node->op_begin()+NewNumElts_Lo); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.0] r44241 - in /llvm-gcc-4.0/trunk/gcc: config/arm/arm.h llvm-convert.cpp
Author: laurov Date: Mon Nov 19 14:49:31 2007 New Revision: 44241 URL: http://llvm.org/viewvc/llvm-project?rev=44241&view=rev Log: ARM: Implement the '%@' inline asm extension. Modified: llvm-gcc-4.0/trunk/gcc/config/arm/arm.h llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.0/trunk/gcc/config/arm/arm.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/config/arm/arm.h?rev=44241&r1=44240&r2=44241&view=diff == --- llvm-gcc-4.0/trunk/gcc/config/arm/arm.h (original) +++ llvm-gcc-4.0/trunk/gcc/config/arm/arm.h Mon Nov 19 14:49:31 2007 @@ -2925,6 +2925,15 @@ /* Doing struct copy by partial-word loads and stores is not a good idea on ARM. */ #define TARGET_LLVM_MIN_BYTES_COPY_BY_MEMCPY 4 + +/* These are a couple of extensions to the asm formats + %@ prints out ASM_COMMENT_START + TODO: %r prints out REGISTER_PREFIX reg_names[arg] */ +#define LLVM_ASM_EXTENSIONS(ESCAPED_CHAR, ASM, RESULT) \ + else if ((ESCAPED_CHAR) == '@') {\ +(RESULT) += ASM_COMMENT_START; \ + } + /* APPLE LOCAL end llvm */ #endif /* ! GCC_ARM_H */ Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=44241&r1=44240&r2=44241&view=diff == --- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Mon Nov 19 14:49:31 2007 @@ -3831,7 +3831,11 @@ Result += '%'; } else if (EscapedChar == '=') { // Unique ID for the asm instance. Result += utostr(InlineAsmNum); - } else if (ISALPHA(EscapedChar)) { + } +#ifdef LLVM_ASM_EXTENSIONS + LLVM_ASM_EXTENSIONS(EscapedChar, InStr, Result) +#endif + else if (ISALPHA(EscapedChar)) { // % followed by a letter and some digits. This outputs an operand in a // special way depending on the letter. We turn this into LLVM ${N:o} // syntax. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44240 - in /llvm/trunk: include/llvm/Analysis/Dominators.h include/llvm/BasicBlock.h include/llvm/Target/TargetMachine.h lib/Target/PowerPC/PPCTargetMachine.cpp lib/Target/Power
Author: djg Date: Mon Nov 19 14:46:23 2007 New Revision: 44240 URL: http://llvm.org/viewvc/llvm-project?rev=44240&view=rev Log: Remove meaningless qualifiers from return types, avoiding compiler warnings. Modified: llvm/trunk/include/llvm/Analysis/Dominators.h llvm/trunk/include/llvm/BasicBlock.h llvm/trunk/include/llvm/Target/TargetMachine.h llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h llvm/trunk/lib/VMCore/BasicBlock.cpp Modified: llvm/trunk/include/llvm/Analysis/Dominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=44240&r1=44239&r2=44240&view=diff == --- llvm/trunk/include/llvm/Analysis/Dominators.h (original) +++ llvm/trunk/include/llvm/Analysis/Dominators.h Mon Nov 19 14:46:23 2007 @@ -345,7 +345,7 @@ /// isReachableFromEntry - Return true if A is dominated by the entry /// block of the function containing it. - const bool isReachableFromEntry(NodeT* A) { + bool isReachableFromEntry(NodeT* A) { assert (!this->isPostDominator() && "This is not implemented for post dominators"); return dominates(&A->getParent()->front(), A); Modified: llvm/trunk/include/llvm/BasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=44240&r1=44239&r2=44240&view=diff == --- llvm/trunk/include/llvm/BasicBlock.h (original) +++ llvm/trunk/include/llvm/BasicBlock.h Mon Nov 19 14:46:23 2007 @@ -93,7 +93,7 @@ /// null pointer back. /// TerminatorInst *getTerminator(); - const TerminatorInst *const getTerminator() const; + const TerminatorInst *getTerminator() const; /// Returns a pointer to the first instructon in this block that is not a /// PHINode instruction. When adding instruction to the beginning of the Modified: llvm/trunk/include/llvm/Target/TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=44240&r1=44239&r2=44240&view=diff == --- llvm/trunk/include/llvm/Target/TargetMachine.h (original) +++ llvm/trunk/include/llvm/Target/TargetMachine.h Mon Nov 19 14:46:23 2007 @@ -187,7 +187,7 @@ /// getEnableTailMergeDefault - the default setting for -enable-tail-merge /// on this target. User flag overrides. - virtual const bool getEnableTailMergeDefault() const { return true; } + virtual bool getEnableTailMergeDefault() const { return true; } /// addPassesToEmitFile - Add passes to the specified pass manager to get the /// specified file emitted. Typically this will involve several steps of code @@ -325,7 +325,7 @@ /// getEnableTailMergeDefault - the default setting for -enable-tail-merge /// on this target. User flag overrides. - virtual const bool getEnableTailMergeDefault() const { return true; } + virtual bool getEnableTailMergeDefault() const { return true; } }; } // End llvm namespace Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=44240&r1=44239&r2=44240&view=diff == --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Mon Nov 19 14:46:23 2007 @@ -101,7 +101,7 @@ /// Override this for PowerPC. Tail merging happily breaks up instruction issue /// groups, which typically degrades performance. -const bool PPCTargetMachine::getEnableTailMergeDefault() const { return false; } +bool PPCTargetMachine::getEnableTailMergeDefault() const { return false; } PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS) : PPCTargetMachine(M, FS, false) { Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h?rev=44240&r1=44239&r2=44240&view=diff == --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h Mon Nov 19 14:46:23 2007 @@ -73,7 +73,7 @@ bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); - virtual const bool getEnableTailMergeDefault() const; + virtual bool getEnableTailMergeDefault() const; }; /// PPC32TargetMachine - PowerPC 32-bit target machine. Modified: llvm/trunk/lib/VMCore/BasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/BasicBlock.cpp?rev=44240&r1=44239&r2=44240
[llvm-commits] [llvm] r44239 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Author: lattner Date: Mon Nov 19 14:21:32 2007 New Revision: 44239 URL: http://llvm.org/viewvc/llvm-project?rev=44239&view=rev Log: Implement splitting of UNDEF nodes. This is the first step towards fixing PR1811 Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=44239&r1=44238&r2=44239&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 19 14:21:32 2007 @@ -6265,6 +6265,10 @@ Node->dump(&DAG); #endif assert(0 && "Unhandled operation in SplitVectorOp!"); + case ISD::UNDEF: +Lo = DAG.getNode(ISD::UNDEF, NewVT_Lo); +Hi = DAG.getNode(ISD::UNDEF, NewVT_Hi); +break; case ISD::BUILD_PAIR: Lo = Node->getOperand(0); Hi = Node->getOperand(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] r44238 - /llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
On Nov 19, 2007, at 10:44 AM, Lauro Ramos Venancio wrote: > Author: laurov > Date: Mon Nov 19 12:44:45 2007 > New Revision: 44238 > > URL: http://llvm.org/viewvc/llvm-project?rev=44238&view=rev > Log: > ARM inline asm extension: use ASM_COMMENT_START instead of '@'. Thanks Lauro! -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r44238 - /llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
Author: laurov Date: Mon Nov 19 12:44:45 2007 New Revision: 44238 URL: http://llvm.org/viewvc/llvm-project?rev=44238&view=rev Log: ARM inline asm extension: use ASM_COMMENT_START instead of '@'. Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=44238&r1=44237&r2=44238&view=diff == --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Mon Nov 19 12:44:45 2007 @@ -2723,7 +2723,7 @@ TODO: %r prints out REGISTER_PREFIX reg_names[arg] */ #define LLVM_ASM_EXTENSIONS(ESCAPED_CHAR, ASM, RESULT) \ else if ((ESCAPED_CHAR) == '@') {\ -(RESULT) += '@';\ +(RESULT) += ASM_COMMENT_START; \ } /* LLVM LOCAL end */ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44236 - /llvm/trunk/docs/tutorial/JITTutorial2.html
Author: resistor Date: Mon Nov 19 10:10:59 2007 New Revision: 44236 URL: http://llvm.org/viewvc/llvm-project?rev=44236&view=rev Log: Teach me to do stuff late at night. Modified: llvm/trunk/docs/tutorial/JITTutorial2.html Modified: llvm/trunk/docs/tutorial/JITTutorial2.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/JITTutorial2.html?rev=44236&r1=44235&r2=44236&view=diff == --- llvm/trunk/docs/tutorial/JITTutorial2.html (original) +++ llvm/trunk/docs/tutorial/JITTutorial2.html Mon Nov 19 10:10:59 2007 @@ -47,7 +47,7 @@ The above is a graphical representation of a program in LLVM IR. It places each basic block on a node of a graph, and uses directed edges to indicate flow control. These blocks will be serialized when written to a text or bitcode file, but it is often useful conceptually to think of them as a graph. Again, if you are unsure about the code in the diagram, you should skim through the LLVM Language Reference Manual and convince yourself that it is, in fact, the GCD algorithm. -The first part of our code is practically the same as from the first tutorial. The same basic setup is required: creating a module, verifying it, and running the PrintModulePass on it. Even the first segment of makeLLVMModule() looks essentially the same, except that gcd takes one more parameter than mul_add. +The first part of our code is practically the same as from the first tutorial. The same basic setup is required: creating a module, verifying it, and running the PrintModulePass on it. Even the first segment of makeLLVMModule() looks essentially the same, except that gcd takes one fewer parameter than mul_add. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44235 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
Author: djg Date: Mon Nov 19 09:36:19 2007 New Revision: 44235 URL: http://llvm.org/viewvc/llvm-project?rev=44235&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=44235&r1=44234&r2=44235&view=diff == --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Nov 19 09:36:19 2007 @@ -180,7 +180,7 @@ // CopyFromReg - This node indicates that the input value is a virtual or // physical register that is defined outside of the scope of this -// SelectionDAG. The register is available from the RegSDNode object. +// SelectionDAG. The register is available from the RegisterSDNode object. CopyFromReg, // UNDEF - An undefined node ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44234 - in /llvm/trunk: include/llvm/ADT/StringMap.h include/llvm/Analysis/ScalarEvolutionExpressions.h include/llvm/Bitcode/Serialize.h lib/Bitcode/Reader/BitcodeReader.cpp lib
Author: djg Date: Mon Nov 19 09:30:20 2007 New Revision: 44234 URL: http://llvm.org/viewvc/llvm-project?rev=44234&view=rev Log: Add explicit keywords. Modified: llvm/trunk/include/llvm/ADT/StringMap.h llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h llvm/trunk/include/llvm/Bitcode/Serialize.h llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp llvm/trunk/lib/Transforms/Scalar/CorrelatedExprs.cpp Modified: llvm/trunk/include/llvm/ADT/StringMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=44234&r1=44233&r2=44234&view=diff == --- llvm/trunk/include/llvm/ADT/StringMap.h (original) +++ llvm/trunk/include/llvm/ADT/StringMap.h Mon Nov 19 09:30:20 2007 @@ -28,7 +28,7 @@ class StringMapEntryBase { unsigned StrLen; public: - StringMapEntryBase(unsigned Len) : StrLen(Len) {} + explicit StringMapEntryBase(unsigned Len) : StrLen(Len) {} unsigned getKeyLength() const { return StrLen; } }; @@ -55,7 +55,7 @@ unsigned NumTombstones; unsigned ItemSize; protected: - StringMapImpl(unsigned itemSize) : ItemSize(itemSize) { + explicit StringMapImpl(unsigned itemSize) : ItemSize(itemSize) { // Initialize the map with zero buckets to allocation. TheTable = 0; NumBuckets = 0; @@ -115,7 +115,7 @@ class StringMapEntry : public StringMapEntryBase { ValueTy Val; public: - StringMapEntry(unsigned StrLen) + explicit StringMapEntry(unsigned StrLen) : StringMapEntryBase(StrLen), Val() {} StringMapEntry(unsigned StrLen, const ValueTy &V) : StringMapEntryBase(StrLen), Val(V) {} @@ -204,7 +204,7 @@ typedef StringMapEntry MapEntryTy; public: StringMap() : StringMapImpl(sizeof(MapEntryTy)) {} - StringMap(unsigned InitialSize) + explicit StringMap(unsigned InitialSize) : StringMapImpl(InitialSize, sizeof(MapEntryTy)) {} AllocatorTy &getAllocator() { return Allocator; } @@ -314,8 +314,8 @@ protected: StringMapImpl::ItemBucket *Ptr; public: - StringMapConstIterator(StringMapImpl::ItemBucket *Bucket, - bool NoAdvance = false) + explicit StringMapConstIterator(StringMapImpl::ItemBucket *Bucket, + bool NoAdvance = false) : Ptr(Bucket) { if (!NoAdvance) AdvancePastEmptyBuckets(); } Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=44234&r1=44233&r2=44234&view=diff == --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Mon Nov 19 09:30:20 2007 @@ -285,7 +285,7 @@ class SCEVAddExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; -SCEVAddExpr(const std::vector &ops) +explicit SCEVAddExpr(const std::vector &ops) : SCEVCommutativeExpr(scAddExpr, ops) { } @@ -305,7 +305,7 @@ class SCEVMulExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; -SCEVMulExpr(const std::vector &ops) +explicit SCEVMulExpr(const std::vector &ops) : SCEVCommutativeExpr(scMulExpr, ops) { } @@ -468,7 +468,7 @@ friend class ScalarEvolution; Value *V; -SCEVUnknown(Value *v) : SCEV(scUnknown), V(v) {} +explicit SCEVUnknown(Value *v) : SCEV(scUnknown), V(v) {} protected: ~SCEVUnknown(); Modified: llvm/trunk/include/llvm/Bitcode/Serialize.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Serialize.h?rev=44234&r1=44233&r2=44234&view=diff == --- llvm/trunk/include/llvm/Bitcode/Serialize.h (original) +++ llvm/trunk/include/llvm/Bitcode/Serialize.h Mon Nov 19 09:30:20 2007 @@ -31,7 +31,7 @@ MapTy PtrMap; public: - Serializer(BitstreamWriter& stream); + explicit Serializer(BitstreamWriter& stream); ~Serializer(); template Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=44234&r1=44233&r2=44234&view=diff == --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Nov 19 09:30:20 2007 @@ -123,7 +123,7 @@ void operator=(const ConstantPlaceHolder &); // DO NOT IMPLEMENT public: Use Op; -ConstantPlaceHolder(const Type *Ty) +explicit ConstantPlaceHolder(const Type *Ty) : ConstantExpr(Ty, Instruction::UserOp1, &Op, 1), Op(UndefValue::get(Type::Int32Ty), this) { } Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp URL:
[llvm-commits] [llvm] r44233 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/X86/split-vector-rem.ll
Author: djg Date: Mon Nov 19 09:15:03 2007 New Revision: 44233 URL: http://llvm.org/viewvc/llvm-project?rev=44233&view=rev Log: Add support in SplitVectorOp for remainder operators. Added: llvm/trunk/test/CodeGen/X86/split-vector-rem.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=44233&r1=44232&r2=44233&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 19 09:15:03 2007 @@ -6341,7 +6341,10 @@ case ISD::FPOW: case ISD::AND: case ISD::OR: - case ISD::XOR: { + case ISD::XOR: + case ISD::UREM: + case ISD::SREM: + case ISD::FREM: { SDOperand LL, LH, RL, RH; SplitVectorOp(Node->getOperand(0), LL, LH); SplitVectorOp(Node->getOperand(1), RL, RH); Added: llvm/trunk/test/CodeGen/X86/split-vector-rem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/split-vector-rem.ll?rev=44233&view=auto == --- llvm/trunk/test/CodeGen/X86/split-vector-rem.ll (added) +++ llvm/trunk/test/CodeGen/X86/split-vector-rem.ll Mon Nov 19 09:15:03 2007 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep div | count 16 +; RUN: llvm-as < %s | llc -march=x86-64 | grep fmodf | count 8 + +define <8 x i32> @foo(<8 x i32> %t, <8 x i32> %u) { + %m = srem <8 x i32> %t, %u + ret <8 x i32> %m +} +define <8 x i32> @bar(<8 x i32> %t, <8 x i32> %u) { + %m = urem <8 x i32> %t, %u + ret <8 x i32> %m +} +define <8 x float> @qux(<8 x float> %t, <8 x float> %u) { + %m = frem <8 x float> %t, %u + ret <8 x float> %m +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r44232 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Author: baldrick Date: Mon Nov 19 09:07:37 2007 New Revision: 44232 URL: http://llvm.org/viewvc/llvm-project?rev=44232&view=rev Log: Workaround PR1146 by eliminating silly bitcasting in calls due to disagreements over attributes. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=44232&r1=44231&r2=44232&view=diff == --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Nov 19 09:07:37 2007 @@ -33,6 +33,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" // FIXME: Remove once PR1146 is done. #include "llvm/Module.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Support/MathExtras.h" @@ -2165,20 +2166,31 @@ Value *Callee = Emit(TREE_OPERAND(exp, 0), 0); - if (TREE_OPERAND(exp, 2)) { -// This is a direct call to a function using a static chain. We need to -// change the function type to one with an extra parameter for the chain. -assert(fndecl && "Indirect static chain call!"); -tree function_type = TYPE_MAIN_VARIANT(TREE_TYPE(fndecl)); -tree static_chain = TREE_OPERAND(exp, 2); - -unsigned CallingConv; -const Type *Ty = TheTypeConverter->ConvertFunctionType(function_type, - fndecl, - static_chain, - CallingConv); -Callee = BitCastToType(Callee, PointerType::get(Ty)); - } + // Avoid this kind of thing while waiting for PR1146 to be fixed: + // + // call void bitcast (void (i32* noalias , i32*)* @_Z3fooPiPVi + // to void (i32*, i32*)*)( i32* %x, i32* %y ) + // + // The problem is that some attributes like noalias are only stored in the + // GCC function declaration and are not available from the function type. + // Converting the function type to LLVM results in an LLVM function type + // without the attributes. The function declaration however is turned into + // an LLVM function type with the attributes present. The discrepancy in + // the types results in the bitcast. The solution is to bitcast back to the + // type of the function declaration. Once PR1146 is done this logic will only + // be needed for nested functions (-> TREE_OPERAND(exp, 2) is not NULL) - they + // get an extra parameter. + assert(TREE_TYPE (TREE_OPERAND (exp, 0)) && + TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == POINTER_TYPE + && "Not calling a function pointer?"); + tree function_type = TREE_TYPE(TREE_TYPE (TREE_OPERAND (exp, 0))); + unsigned CallingConv; + const Type *Ty = TheTypeConverter->ConvertFunctionType(function_type, + fndecl, + TREE_OPERAND(exp, 2), + CallingConv); + Callee = BitCastToType(IntrinsicInst::StripPointerCasts(Callee), + PointerType::get(Ty)); //EmitCall(exp, DestLoc); Value *Result = EmitCallOf(Callee, exp, DestLoc); @@ -2388,7 +2400,7 @@ ABIConverter.HandleArgument(TREE_TYPE(TREE_VALUE(arg))); } } - + // Compile stuff like: // %tmp = call float (...)* bitcast (float ()* @foo to float (...)*)( ) // to: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.0] r44231 - /llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
Author: baldrick Date: Mon Nov 19 09:06:19 2007 New Revision: 44231 URL: http://llvm.org/viewvc/llvm-project?rev=44231&view=rev Log: Workaround PR1146 by eliminating silly bitcasting in calls due to disagreements over attributes. Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=44231&r1=44230&r2=44231&view=diff == --- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Mon Nov 19 09:06:19 2007 @@ -33,6 +33,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" // FIXME: Remove once PR1146 is done. #include "llvm/Module.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Support/MathExtras.h" @@ -2648,20 +2649,31 @@ Value *Callee = Emit(TREE_OPERAND(exp, 0), 0); - if (TREE_OPERAND(exp, 2)) { -// This is a direct call to a function using a static chain. We need to -// change the function type to one with an extra parameter for the chain. -assert(fndecl && "Indirect static chain call!"); -tree function_type = TYPE_MAIN_VARIANT(TREE_TYPE(fndecl)); -tree static_chain = TREE_OPERAND(exp, 2); - -unsigned CallingConv; -const Type *Ty = TheTypeConverter->ConvertFunctionType(function_type, - fndecl, - static_chain, - CallingConv); -Callee = CastToType(Instruction::BitCast, Callee, PointerType::get(Ty)); - } + // Avoid this kind of thing while waiting for PR1146 to be fixed: + // + // call void bitcast (void (i32* noalias , i32*)* @_Z3fooPiPVi + // to void (i32*, i32*)*)( i32* %x, i32* %y ) + // + // The problem is that some attributes like noalias are only stored in the + // GCC function declaration and are not available from the function type. + // Converting the function type to LLVM results in an LLVM function type + // without the attributes. The function declaration however is turned into + // an LLVM function type with the attributes present. The discrepancy in + // the types results in the bitcast. The solution is to bitcast back to the + // type of the function declaration. Once PR1146 is done this logic will only + // be needed for nested functions (-> TREE_OPERAND(exp, 2) is not NULL) - they + // get an extra parameter. + assert(TREE_TYPE (TREE_OPERAND (exp, 0)) && + TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == POINTER_TYPE + && "Not calling a function pointer?"); + tree function_type = TREE_TYPE(TREE_TYPE (TREE_OPERAND (exp, 0))); + unsigned CallingConv; + const Type *Ty = TheTypeConverter->ConvertFunctionType(function_type, + fndecl, + TREE_OPERAND(exp, 2), + CallingConv); + Callee = BitCastToType(IntrinsicInst::StripPointerCasts(Callee), + PointerType::get(Ty)); //EmitCall(exp, DestLoc); Value *Result = EmitCallOf(Callee, exp, DestLoc); @@ -2857,7 +2869,7 @@ ABIConverter.HandleArgument(TREE_TYPE(TREE_VALUE(arg))); } } - + // Compile stuff like: // %tmp = call float (...)* bitcast (float ()* @foo to float (...)*)( ) // to: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r44230 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Author: baldrick Date: Mon Nov 19 09:05:10 2007 New Revision: 44230 URL: http://llvm.org/viewvc/llvm-project?rev=44230&view=rev Log: Add attributes corresponding to gcc's nothrow and noreturn. Get attributes via flags_from_decl_or_type. Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp 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=44230&r1=44229&r2=44230&view=diff == --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Nov 19 09:05:10 2007 @@ -1023,12 +1023,22 @@ ParamAttrsVector Attrs; uint16_t RAttributes = ParamAttr::None; + int flags = flags_from_decl_or_type(decl ? decl : type); + // Check for 'const' function attribute - if (decl && TREE_READONLY(decl)) + if (flags & ECF_CONST) RAttributes |= ParamAttr::Const; + // Check for 'noreturn' function attribute + if (flags & ECF_NORETURN) +RAttributes |= ParamAttr::NoReturn; + + // Check for 'nounwind' function attribute + if (flags & ECF_NOTHROW) +RAttributes |= ParamAttr::NoUnwind; + // Check for 'pure' function attribute - if (decl && DECL_IS_PURE(decl)) + if (flags & ECF_PURE) RAttributes |= ParamAttr::Pure; // Compute whether the result needs to be zext or sext'd ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.0] r44229 - /llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Author: baldrick Date: Mon Nov 19 09:04:41 2007 New Revision: 44229 URL: http://llvm.org/viewvc/llvm-project?rev=44229&view=rev Log: Add attributes corresponding to gcc's nothrow and noreturn. Get attributes via flags_from_decl_or_type. Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp?rev=44229&r1=44228&r2=44229&view=diff == --- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Mon Nov 19 09:04:41 2007 @@ -988,12 +988,22 @@ ParamAttrsVector Attrs; uint16_t RAttributes = ParamAttr::None; + int flags = flags_from_decl_or_type(decl ? decl : type); + // Check for 'const' function attribute - if (decl && TREE_READONLY(decl)) + if (flags & ECF_CONST) RAttributes |= ParamAttr::Const; + // Check for 'noreturn' function attribute + if (flags & ECF_NORETURN) +RAttributes |= ParamAttr::NoReturn; + + // Check for 'nounwind' function attribute + if (flags & ECF_NOTHROW) +RAttributes |= ParamAttr::NoUnwind; + // Check for 'pure' function attribute - if (decl && DECL_IS_PURE(decl)) + if (flags & ECF_PURE) RAttributes |= ParamAttr::Pure; // Compute whether the result needs to be zext or sext'd ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits