[llvm-commits] [poolalloc] r161199 - in /poolalloc/trunk: include/poolalloc/PoolAllocate.h include/poolalloc/RunTimeAssociate.h lib/AssistDS/GEPExprArgs.cpp lib/AssistDS/LoadArgs.cpp lib/AssistDS/StructReturnToPointer.cpp lib/AssistDS/TypeChecks.cpp lib/DSA/Basic.cpp lib/DSA/Local.cpp lib/PoolAllocate/PAMultipleGlobalPool.cpp lib/PoolAllocate/PoolAllocate.cpp lib/PoolAllocate/TransformFunctionBody.cpp test/lit.cfg

Will Dietz wdietz2 at illinois.edu
Thu Aug 2 12:10:22 PDT 2012


Author: wdietz2
Date: Thu Aug  2 14:10:22 2012
New Revision: 161199

URL: http://llvm.org/viewvc/llvm-project?rev=161199&view=rev
Log:
Mostly update poolalloc to mainline LLVM.

Modified:
    poolalloc/trunk/include/poolalloc/PoolAllocate.h
    poolalloc/trunk/include/poolalloc/RunTimeAssociate.h
    poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp
    poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
    poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp
    poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
    poolalloc/trunk/lib/DSA/Basic.cpp
    poolalloc/trunk/lib/DSA/Local.cpp
    poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp
    poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
    poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
    poolalloc/trunk/test/lit.cfg

Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Thu Aug  2 14:10:22 2012
@@ -24,7 +24,6 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Support/CallSite.h"
 #include "llvm/ADT/EquivalenceClasses.h"
-#include "llvm/ADT/VectorExtras.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/StringMap.h"

Modified: poolalloc/trunk/include/poolalloc/RunTimeAssociate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/RunTimeAssociate.h?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/include/poolalloc/RunTimeAssociate.h (original)
+++ poolalloc/trunk/include/poolalloc/RunTimeAssociate.h Thu Aug  2 14:10:22 2012
@@ -23,7 +23,6 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Support/CallSite.h"
 #include "llvm/ADT/EquivalenceClasses.h"
-#include "llvm/ADT/VectorExtras.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Support/CommandLine.h"
 

Modified: poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp Thu Aug  2 14:10:22 2012
@@ -173,8 +173,7 @@
           if (FnAttrs != Attribute::None)
             AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-          AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
-                                                    AttributesVec.end());
+          AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
 
           CallInst *CallI = CallInst::Create(NewF,Args,"", CI);
           CallI->setCallingConv(CI->getCallingConv());

Modified: poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/LoadArgs.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/LoadArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/LoadArgs.cpp Thu Aug  2 14:10:22 2012
@@ -200,8 +200,8 @@
           if (FnAttrs != Attribute::None)
             AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-          AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
-                                                    AttributesVec.end());
+          AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
+
           CallInst *CallI = CallInst::Create(NewF,Args,"", CI);
           CallI->setCallingConv(CI->getCallingConv());
           CallI->setAttributes(NewCallPAL);

Modified: poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp Thu Aug  2 14:10:22 2012
@@ -141,9 +141,8 @@
       if (FnAttrs != Attribute::None)
         AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-      AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
-                                                AttributesVec.end());
-      
+      AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
+
       CallInst *CallI = CallInst::Create(NF, Args, "", CI);
       CallI->setCallingConv(CI->getCallingConv());
       CallI->setAttributes(NewCallPAL);

Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Thu Aug  2 14:10:22 2012
@@ -600,7 +600,8 @@
 
   // Add an entry for uninitialized(Type Number = 0)
 
-  Constant *CA = ConstantArray::get(M.getContext(), "UNINIT", true);
+  Constant *CA = ConstantDataArray::getString(M.getContext(),
+                                              "UNINIT", true);
   GlobalVariable *GV = new GlobalVariable(M, 
                                           CA->getType(),
                                           true,
@@ -621,7 +622,8 @@
 
     *test << TI->first;
     //WriteTypeSymbolic(*test, TI->first, &M);
-    Constant *CA = ConstantArray::get(M.getContext(), test->str(), true);
+    Constant *CA = ConstantDataArray::getString(M.getContext(),
+                                                test->str(), true);
     GlobalVariable *GV = new GlobalVariable(M, 
                                             CA->getType(),
                                             true,
@@ -1081,8 +1083,7 @@
         if (FnAttrs != Attribute::None)
           AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-        AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
-                                                  AttributesVec.end());
+        AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
 
 
         // Create the substitute call
@@ -1129,9 +1130,7 @@
         if (FnAttrs != Attribute::None)
           AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
 
-        AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec.begin(),
-                                                  AttributesVec.end());
-
+        AttrListPtr NewCallPAL = AttrListPtr::get(AttributesVec);
 
         // Create the substitute call
         CallInst *CallI = CallInst::Create(&F,
@@ -1185,7 +1184,7 @@
   // Find all basic blocks which terminate the function.
   std::set<BasicBlock *> exitBlocks;
   for (inst_iterator I = inst_begin(&F), E = inst_end(&F); I != E; ++I) {
-    if (isa<ReturnInst>(*I) || isa<UnwindInst>(*I)) {
+    if (isa<ReturnInst>(*I) || isa<ResumeInst>(*I)) {
       exitBlocks.insert(I->getParent());
     }
   }

Modified: poolalloc/trunk/lib/DSA/Basic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Basic.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Basic.cpp (original)
+++ poolalloc/trunk/lib/DSA/Basic.cpp Thu Aug  2 14:10:22 2012
@@ -15,15 +15,15 @@
 #include "dsa/DataStructure.h"
 #include "dsa/DSGraph.h"
 
-#include "llvm/Module.h"
-#include "llvm/DerivedTypes.h"
 #include "llvm/Constants.h"
+#include "llvm/DerivedTypes.h"
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
+#include "llvm/Module.h"
+#include "llvm/TypeBuilder.h"
 #include "llvm/Support/InstIterator.h"
 #include "llvm/Support/InstVisitor.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Support/TypeBuilder.h"
 
 using namespace llvm;
 

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Thu Aug  2 14:10:22 2012
@@ -1240,6 +1240,11 @@
     //
     // Undefined values and NULL pointers have no DSNodes, so they do nothing.
     //
+  } else if (isa<ConstantDataSequential>(C)) {
+    //
+    // ConstantDataSequential's are arrays of integers or floats, so they
+    // have no DSNodes.  Nothing to do here.
+    //
   } else {
     assert(0 && "Unknown constant type!");
   }

Modified: poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp Thu Aug  2 14:10:22 2012
@@ -19,13 +19,13 @@
 #include "dsa/DSGraph.h"
 #include "dsa/CallTargets.h"
 #include "poolalloc/PoolAllocate.h"
+
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
-#include "llvm/Constants.h"
+#include "llvm/TypeBuilder.h"
 #include "llvm/Support/CFG.h"
-#include "llvm/Support/TypeBuilder.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/Cloning.h"

Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Thu Aug  2 14:10:22 2012
@@ -1415,7 +1415,7 @@
     if (F.getName().str() != "main")
       for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
         if (isa<ReturnInst>(BB->getTerminator()) ||
-            isa<UnwindInst>(BB->getTerminator()))
+            isa<ResumeInst>(BB->getTerminator()))
           PoolDestroyPoints.push_back(BB->getTerminator());
   } else {
     // Keep track of the blocks we have inserted poolinit/destroy into.

Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Thu Aug  2 14:10:22 2012
@@ -27,7 +27,6 @@
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/VectorExtras.h"
 
 #include <iostream>
 using namespace llvm;

Modified: poolalloc/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/lit.cfg?rev=161199&r1=161198&r2=161199&view=diff
==============================================================================
--- poolalloc/trunk/test/lit.cfg (original)
+++ poolalloc/trunk/test/lit.cfg Thu Aug  2 14:10:22 2012
@@ -40,18 +40,6 @@
 # Tweak the PATH to include the scripts dir, the tools dir, and the llvm-gcc bin
 # dir (if available).
 if llvm_obj_root is not None:
-    # Include llvm-gcc first, as the llvm-gcc binaryies will not appear
-    # neither in the tools nor in the scripts dir. However it might be
-    # possible, that some old llvm tools are in the llvm-gcc dir. Adding
-    # llvm-gcc dir first ensures, that those will always be overwritten
-    # by the new tools in llvm_tools_dir. So now outdated tools are used
-      # for testing
-    llvmgcc_dir = getattr(config, 'llvmgcc_dir', None)
-    if llvmgcc_dir:
-        path = os.path.pathsep.join((os.path.join(llvmgcc_dir, 'bin'),
-                                     config.environment['PATH']))
-        config.environment['PATH'] = path
-
     llvm_src_root = getattr(config, 'llvm_src_root', None)
     if not llvm_src_root:
         lit.fatal('No LLVM source root set!')
@@ -161,21 +149,8 @@
         site_exp[m.group(1)] = m.group(2)
 
 # Add substitutions.
-config.substitutions.append(('%llvmgcc_only', site_exp['llvmgcc']))
-for sub in ['llvmgcc', 'llvmgxx', 'emitir', 'compile_cxx', 'compile_c',
-            'link', 'shlibext', 'ocamlopt', 'llvmdsymutil', 'llvmlibsdir',
-            'llvmshlibdir',
-            'bugpoint_topts']:
-    if sub in ('llvmgcc', 'llvmgxx'):
-        config.substitutions.append(('%' + sub,
-                                     site_exp[sub] + ' %emitir -w'))
-    # FIXME: This is a hack to avoid LLVMC tests failing due to a clang driver
-    #        warning when passing in "-fexceptions -fno-exceptions".
-    elif sub == 'compile_cxx':
-        config.substitutions.append(('%' + sub,
-                                  site_exp[sub].replace('-fno-exceptions', '')))
-    else:
-        config.substitutions.append(('%' + sub, site_exp[sub]))
+for sub in ['link', 'shlibext', 'ocamlopt', 'llvmshlibdir']:
+    config.substitutions.append(('%' + sub, site_exp[sub]))
 
 # For each occurrence of an llvm tool name as its own word, replace it
 # with the full path to the build directory holding that tool.  This
@@ -184,28 +159,30 @@
 # includes every tool placed in $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
 # (llvm_tools_dir in lit parlance).
                 # Don't match 'bugpoint-' or 'clang-'.
-                                        # Don't match '/clang'.
+                # Don't match '/clang' or '-clang'.
 if os.pathsep == ';':
     pathext = os.environ.get('PATHEXT', '').split(';')
 else:
     pathext = ['']
-for pattern in [r"\bbugpoint\b(?!-)",   r"(?<!/)\bclang\b(?!-)",
+for pattern in [r"\bbugpoint\b(?!-)",   r"(?<!/|-)\bclang\b(?!-)",
                 r"\bgold\b",
                 r"\bllc\b",             r"\blli\b",
                 r"\bllvm-ar\b",         r"\bllvm-as\b",
                 r"\bllvm-bcanalyzer\b", r"\bllvm-config\b",
-                r"\bllvm-diff\b",       r"\bllvm-dis\b",
+                r"\bllvm-cov\b",        r"\bllvm-diff\b",
+                r"\bllvm-dis\b",        r"\bllvm-dwarfdump\b",
                 r"\bllvm-extract\b",    r"\bllvm-ld\b",
                 r"\bllvm-link\b",       r"\bllvm-mc\b",
-                r"\bllvm-nm\b",         r"\bllvm-prof\b",
-                r"\bllvm-ranlib\b",     r"\bllvm-shlib\b",
-                r"\bllvm-stub\b",       r"\bllvm2cpp\b",
+                r"\bllvm-nm\b",         r"\bllvm-objdump\b",
+                r"\bllvm-prof\b",       r"\bllvm-ranlib\b",
+                r"\bllvm-rtdyld\b",     r"\bllvm-shlib\b",
+                r"\bllvm-size\b",       r"\bllvm-stub\b",
                 # Don't match '-llvmc'.
                 r"(?<!-)\bllvmc\b",     r"\blto\b",
                                         # Don't match '.opt', '-opt',
                                         # '^opt' or '/opt'.
                 r"\bmacho-dump\b",      r"(?<!\.|-|\^|/)\bopt\b",
-                r"\btblgen\b",          r"\bFileCheck\b",
+                r"\bllvm-tblgen\b",     r"\bFileCheck\b",
                 r"\bFileUpdate\b",      r"\bc-index-test\b",
                 r"\bfpcmp\b",           r"\bllvm-PerfectShuffle\b",
                 # Handle these specially as they are strings searched
@@ -242,10 +219,6 @@
 def llvm_supports_darwin_and_target(name):
     return 'darwin' in config.target_triple and llvm_supports_target(name)
 
-langs = set([s.strip() for s in site_exp['llvmgcc_langs'].split(',')])
-def llvm_gcc_supports(name):
-    return name.strip() in langs
-
 bindings = set([s.strip() for s in site_exp['llvm_bindings'].split(',')])
 def llvm_supports_binding(name):
     return name.strip() in bindings
@@ -317,5 +290,10 @@
 if loadable_module:
     config.available_features.add('loadable_module')
 
-## if config.enable_assertions:
-##     config.available_features.add('asserts')
+# llc knows whether he is compiled with -DNDEBUG.
+import subprocess
+llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
+                           stdout = subprocess.PIPE)
+if re.search(r'with assertions', llc_cmd.stdout.read()):
+    config.available_features.add('asserts')
+llc_cmd.wait()





More information about the llvm-commits mailing list