From daniel at zuster.org Mon Sep 14 00:22:47 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 14 Sep 2009 05:22:47 -0000 Subject: [llvm-commits] [llvm] r81757 - /llvm/trunk/lib/MC/CMakeLists.txt Message-ID: <200909140522.n8E5MlLt023041@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 14 00:22:47 2009 New Revision: 81757 URL: http://llvm.org/viewvc/llvm-project?rev=81757&view=rev Log: Update CMake. Modified: llvm/trunk/lib/MC/CMakeLists.txt Modified: llvm/trunk/lib/MC/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/CMakeLists.txt?rev=81757&r1=81756&r2=81757&view=diff ============================================================================== --- llvm/trunk/lib/MC/CMakeLists.txt (original) +++ llvm/trunk/lib/MC/CMakeLists.txt Mon Sep 14 00:22:47 2009 @@ -11,6 +11,7 @@ MCDisassembler.cpp MCExpr.cpp MCInst.cpp + MCInstPrinter.cpp MCMachOStreamer.cpp MCNullStreamer.cpp MCSection.cpp From daniel at zuster.org Mon Sep 14 00:22:54 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 14 Sep 2009 05:22:54 -0000 Subject: [llvm-commits] [llvm] r81758 - /llvm/trunk/cmake/modules/LLVMLibDeps.cmake Message-ID: <200909140522.n8E5Ms1T023067@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 14 00:22:54 2009 New Revision: 81758 URL: http://llvm.org/viewvc/llvm-project?rev=81758&view=rev Log: Update CMake dependencies. Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMLibDeps.cmake?rev=81758&r1=81757&r2=81758&view=diff ============================================================================== --- llvm/trunk/cmake/modules/LLVMLibDeps.cmake (original) +++ llvm/trunk/cmake/modules/LLVMLibDeps.cmake Mon Sep 14 00:22:54 2009 @@ -1,7 +1,7 @@ -set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMARMInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMARMInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMARMCodeGen LLVMARMInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMARMInfo LLVMSupport) -set(MSVC_LIB_DEPS_LLVMAlphaAsmPrinter LLVMAlphaInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMAlphaAsmPrinter LLVMAlphaInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMAlphaCodeGen LLVMAlphaInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMAlphaInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget) @@ -10,12 +10,12 @@ set(MSVC_LIB_DEPS_LLVMAsmPrinter LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMBitReader LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMBitWriter LLVMCore LLVMSupport LLVMSystem) -set(MSVC_LIB_DEPS_LLVMBlackfinAsmPrinter LLVMAsmPrinter LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMBlackfinAsmPrinter LLVMAsmPrinter LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMBlackfinInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMCBackend LLVMAnalysis LLVMCBackendInfo LLVMCodeGen LLVMCore LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa) set(MSVC_LIB_DEPS_LLVMCBackendInfo LLVMSupport) -set(MSVC_LIB_DEPS_LLVMCellSPUAsmPrinter LLVMAsmPrinter LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMCellSPUAsmPrinter LLVMAsmPrinter LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMCellSPUInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMCodeGen LLVMAnalysis LLVMCore LLVMMC LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils) @@ -32,26 +32,26 @@ set(MSVC_LIB_DEPS_LLVMMC LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMMSIL LLVMAnalysis LLVMCodeGen LLVMCore LLVMMSILInfo LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa) set(MSVC_LIB_DEPS_LLVMMSILInfo LLVMSupport) -set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMSP430Info LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMMSP430CodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSelectionDAG LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMMSP430Info LLVMSupport) -set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMMipsCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMipsInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMMipsInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMPIC16 LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMPIC16Info LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) -set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMPIC16 LLVMPIC16Info LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPIC16 LLVMPIC16Info LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMPIC16Info LLVMSupport) -set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMPowerPCInfo LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMPowerPCCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMPowerPCInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMScalarOpts LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils) set(MSVC_LIB_DEPS_LLVMSelectionDAG LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget) -set(MSVC_LIB_DEPS_LLVMSparcAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMSparcAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMSparcCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMSparcInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMSystem ) -set(MSVC_LIB_DEPS_LLVMSystemZAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMSystemZInfo LLVMTarget) +set(MSVC_LIB_DEPS_LLVMSystemZAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMSystemZInfo LLVMTarget) set(MSVC_LIB_DEPS_LLVMSystemZCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystemZInfo LLVMTarget) set(MSVC_LIB_DEPS_LLVMSystemZInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMTarget LLVMCore LLVMMC LLVMSupport LLVMSystem) @@ -61,7 +61,7 @@ set(MSVC_LIB_DEPS_LLVMX86CodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget LLVMX86Info) set(MSVC_LIB_DEPS_LLVMX86Info LLVMSupport) set(MSVC_LIB_DEPS_LLVMXCore LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget LLVMXCoreInfo) -set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMXCoreInfo) +set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget LLVMXCoreInfo) set(MSVC_LIB_DEPS_LLVMXCoreInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMipa LLVMAnalysis LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMipo LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa) From eocallaghan at auroraux.org Mon Sep 14 07:45:07 2009 From: eocallaghan at auroraux.org (Edward O'Callaghan) Date: Mon, 14 Sep 2009 12:45:07 -0000 Subject: [llvm-commits] [compiler-rt] r81760 - in /compiler-rt/trunk: CMakeLists.txt lib/CMakeLists.txt lib/arm/CMakeLists.txt Message-ID: <200909141245.n8ECj8J8029513@zion.cs.uiuc.edu> Author: evocallaghan Date: Mon Sep 14 07:45:07 2009 New Revision: 81760 URL: http://llvm.org/viewvc/llvm-project?rev=81760&view=rev Log: Update cmake files for arm support hooks. Added: compiler-rt/trunk/lib/arm/CMakeLists.txt Modified: compiler-rt/trunk/CMakeLists.txt compiler-rt/trunk/lib/CMakeLists.txt Modified: compiler-rt/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=81760&r1=81759&r2=81760&view=diff ============================================================================== --- compiler-rt/trunk/CMakeLists.txt (original) +++ compiler-rt/trunk/CMakeLists.txt Mon Sep 14 07:45:07 2009 @@ -34,7 +34,7 @@ ) SET( Achitectures - i386 ppc x86_64 + i386 x86_64 ppc arm ) SET( Configurations Modified: compiler-rt/trunk/lib/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/CMakeLists.txt?rev=81760&r1=81759&r2=81760&view=diff ============================================================================== --- compiler-rt/trunk/lib/CMakeLists.txt (original) +++ compiler-rt/trunk/lib/CMakeLists.txt Mon Sep 14 07:45:07 2009 @@ -51,6 +51,7 @@ # ADD_SUBDIRECTORY( ppc ) # ADD_SUBDIRECTORY( x86_64 ) # ADD_SUBDIRECTORY( i386 ) +# ADD_SUBDIRECTORY( arm ) #FOREACH( LOOP_VAR ${Achitectures} ) # See ARCHIVE_OUTPUT_DIRECTORY docs. Added: compiler-rt/trunk/lib/arm/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/CMakeLists.txt?rev=81760&view=auto ============================================================================== (empty) From xerxes at zafena.se Mon Sep 14 07:59:02 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Mon, 14 Sep 2009 14:59:02 +0200 Subject: [llvm-commits] ping - [patch] configure.ac ARM TARGET_HAS_JIT In-Reply-To: <4AA76A91.2030705@zafena.se> References: <4AA76A91.2030705@zafena.se> Message-ID: <4AAE3E16.1000508@zafena.se> Im just pinging this patch, I am looking for someone with access to the correct autotools to test the patch and to regenerate the configure script. Thanks! Xerxes R?nby skrev: > The current llvm-config suggests the Interpreter on ARM when running > llvm-config --libs engine > > $ llvm-config --libs engine > -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts > -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC > -lLLVMCore -lLLVMSupport -lLLVMSystem > > expected result would be to output the JIT instead of the Interpreter: > > $ llvm-config --libs engine > -lLLVMARMAsmPrinter -lLLVMARMCodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter > -lLLVMARMInfo -lLLVMJIT -lLLVMExecutionEngine -lLLVMCodeGen > -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis > -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport -lLLVMSystem > > The attached patch fixes this issue. > I need someone to commit this for me since the configure script needs > regenerating from configure.ac with some specific version of autotools. > > Cheers > Xerxes > > ------------------------------------------------------------------------ > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Mon Sep 14 08:39:42 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Sep 2009 13:39:42 -0000 Subject: [llvm-commits] [gcc-plugin] r81761 - /gcc-plugin/trunk/Makefile Message-ID: <200909141339.n8EDdguo004107@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 14 08:39:42 2009 New Revision: 81761 URL: http://llvm.org/viewvc/llvm-project?rev=81761&view=rev Log: Correct a build dependency. Modified: gcc-plugin/trunk/Makefile Modified: gcc-plugin/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/Makefile?rev=81761&r1=81760&r2=81761&view=diff ============================================================================== --- gcc-plugin/trunk/Makefile (original) +++ gcc-plugin/trunk/Makefile Mon Sep 14 08:39:42 2009 @@ -30,7 +30,7 @@ llvm.so: $(PLUGIN_OBJECT_FILES) $(CXX) -shared $^ -o $@ $(LDFLAGS) -llvm-cache.c: gt-llvm-cache.h +llvm-cache.o: gt-llvm-cache.h gt-llvm-cache.h: cd $(GCCOBJECT_DIR)/gcc && ./build/gengtype \ From baldrick at free.fr Mon Sep 14 08:54:33 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Sep 2009 13:54:33 -0000 Subject: [llvm-commits] [gcc-plugin] r81762 - in /gcc-plugin/trunk: ./ gt-llvm-cache.h Message-ID: <200909141354.n8EDsYnw006148@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 14 08:54:33 2009 New Revision: 81762 URL: http://llvm.org/viewvc/llvm-project?rev=81762&view=rev Log: The generated header containing garbage collector information is actually not host or target specific as far as I can see. Add it to the repository so everyone doesn't have to generate it (which requires a big gcc patch). Added: gcc-plugin/trunk/gt-llvm-cache.h Modified: gcc-plugin/trunk/ (props changed) Propchange: gcc-plugin/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore (removed) @@ -1 +0,0 @@ -gt-llvm-cache.h Added: gcc-plugin/trunk/gt-llvm-cache.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/gt-llvm-cache.h?rev=81762&view=auto ============================================================================== --- gcc-plugin/trunk/gt-llvm-cache.h (added) +++ gcc-plugin/trunk/gt-llvm-cache.h Mon Sep 14 08:54:33 2009 @@ -0,0 +1,1962 @@ +/* Type information for GCC. + Copyright (C) 2004, 2007, 2009 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* This file is machine generated. Do not edit. */ + +/* Dynamic enumeration of plugin types. */ +#ifdef GCC_PLUGIN_HAVE_PCH +static int gccplugin_type_base; +#define gt_ggc_e_13tree_llvm_map ((gccplugin_type_base>0)?(gccplugin_type_base+0):0) +#define gt_e_P13tree_llvm_map4htab ((gccplugin_type_base>0)?(gccplugin_type_base+1):0) + +#define GCCPLUGIN_TYPE_COUNT 2 +/* end ifdef GCC_PLUGIN_HAVE_PCH */ +#endif + +/* GC marker procedures. */ +#define gt_ggc_m_13tree_llvm_map(X) do { \ + if (X != NULL) gt_ggc_mx_tree_llvm_map (X);\ + } while (0) +extern void gt_ggc_mx_tree_llvm_map (void *); +#define gt_ggc_m_15interface_tuple(X) do { \ + if (X != NULL) gt_ggc_mx_interface_tuple (X);\ + } while (0) +extern void gt_ggc_mx_interface_tuple (void *); +#define gt_ggc_m_16volatilized_type(X) do { \ + if (X != NULL) gt_ggc_mx_volatilized_type (X);\ + } while (0) +extern void gt_ggc_mx_volatilized_type (void *); +#define gt_ggc_m_17string_descriptor(X) do { \ + if (X != NULL) gt_ggc_mx_string_descriptor (X);\ + } while (0) +extern void gt_ggc_mx_string_descriptor (void *); +#define gt_ggc_m_15c_inline_static(X) do { \ + if (X != NULL) gt_ggc_mx_c_inline_static (X);\ + } while (0) +extern void gt_ggc_mx_c_inline_static (void *); +#define gt_ggc_m_24VEC_c_goto_bindings_p_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_c_goto_bindings_p_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_c_goto_bindings_p_gc (void *); +#define gt_ggc_m_15c_goto_bindings(X) do { \ + if (X != NULL) gt_ggc_mx_c_goto_bindings (X);\ + } while (0) +extern void gt_ggc_mx_c_goto_bindings (void *); +#define gt_ggc_m_7c_scope(X) do { \ + if (X != NULL) gt_ggc_mx_c_scope (X);\ + } while (0) +extern void gt_ggc_mx_c_scope (void *); +#define gt_ggc_m_9c_binding(X) do { \ + if (X != NULL) gt_ggc_mx_c_binding (X);\ + } while (0) +extern void gt_ggc_mx_c_binding (void *); +#define gt_ggc_m_12c_label_vars(X) do { \ + if (X != NULL) gt_ggc_mx_c_label_vars (X);\ + } while (0) +extern void gt_ggc_mx_c_label_vars (void *); +#define gt_ggc_m_8c_parser(X) do { \ + if (X != NULL) gt_ggc_mx_c_parser (X);\ + } while (0) +extern void gt_ggc_mx_c_parser (void *); +#define gt_ggc_m_9imp_entry(X) do { \ + if (X != NULL) gt_ggc_mx_imp_entry (X);\ + } while (0) +extern void gt_ggc_mx_imp_entry (void *); +#define gt_ggc_m_16hashed_attribute(X) do { \ + if (X != NULL) gt_ggc_mx_hashed_attribute (X);\ + } while (0) +extern void gt_ggc_mx_hashed_attribute (void *); +#define gt_ggc_m_12hashed_entry(X) do { \ + if (X != NULL) gt_ggc_mx_hashed_entry (X);\ + } while (0) +extern void gt_ggc_mx_hashed_entry (void *); +#define gt_ggc_m_14type_assertion(X) do { \ + if (X != NULL) gt_ggc_mx_type_assertion (X);\ + } while (0) +extern void gt_ggc_mx_type_assertion (void *); +#define gt_ggc_m_18treetreehash_entry(X) do { \ + if (X != NULL) gt_ggc_mx_treetreehash_entry (X);\ + } while (0) +extern void gt_ggc_mx_treetreehash_entry (void *); +#define gt_ggc_m_5CPool(X) do { \ + if (X != NULL) gt_ggc_mx_CPool (X);\ + } while (0) +extern void gt_ggc_mx_CPool (void *); +#define gt_ggc_m_3JCF(X) do { \ + if (X != NULL) gt_ggc_mx_JCF (X);\ + } while (0) +extern void gt_ggc_mx_JCF (void *); +#define gt_ggc_m_17module_htab_entry(X) do { \ + if (X != NULL) gt_ggc_mx_module_htab_entry (X);\ + } while (0) +extern void gt_ggc_mx_module_htab_entry (void *); +#define gt_ggc_m_13binding_level(X) do { \ + if (X != NULL) gt_ggc_mx_binding_level (X);\ + } while (0) +extern void gt_ggc_mx_binding_level (void *); +#define gt_ggc_m_9opt_stack(X) do { \ + if (X != NULL) gt_ggc_mx_opt_stack (X);\ + } while (0) +extern void gt_ggc_mx_opt_stack (void *); +#define gt_ggc_m_16def_pragma_macro(X) do { \ + if (X != NULL) gt_ggc_mx_def_pragma_macro (X);\ + } while (0) +extern void gt_ggc_mx_def_pragma_macro (void *); +#define gt_ggc_m_22def_pragma_macro_value(X) do { \ + if (X != NULL) gt_ggc_mx_def_pragma_macro_value (X);\ + } while (0) +extern void gt_ggc_mx_def_pragma_macro_value (void *); +#define gt_ggc_m_11align_stack(X) do { \ + if (X != NULL) gt_ggc_mx_align_stack (X);\ + } while (0) +extern void gt_ggc_mx_align_stack (void *); +#define gt_ggc_m_18VEC_tree_gc_vec_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_tree_gc_vec_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_tree_gc_vec_gc (void *); +#define gt_ggc_m_19VEC_const_char_p_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_const_char_p_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_const_char_p_gc (void *); +#define gt_ggc_m_21pending_abstract_type(X) do { \ + if (X != NULL) gt_ggc_mx_pending_abstract_type (X);\ + } while (0) +extern void gt_ggc_mx_pending_abstract_type (void *); +#define gt_ggc_m_9cp_parser(X) do { \ + if (X != NULL) gt_ggc_mx_cp_parser (X);\ + } while (0) +extern void gt_ggc_mx_cp_parser (void *); +#define gt_ggc_m_17cp_parser_context(X) do { \ + if (X != NULL) gt_ggc_mx_cp_parser_context (X);\ + } while (0) +extern void gt_ggc_mx_cp_parser_context (void *); +#define gt_ggc_m_8cp_lexer(X) do { \ + if (X != NULL) gt_ggc_mx_cp_lexer (X);\ + } while (0) +extern void gt_ggc_mx_cp_lexer (void *); +#define gt_ggc_m_10tree_check(X) do { \ + if (X != NULL) gt_ggc_mx_tree_check (X);\ + } while (0) +extern void gt_ggc_mx_tree_check (void *); +#define gt_ggc_m_22VEC_deferred_access_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_deferred_access_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_deferred_access_gc (void *); +#define gt_ggc_m_10spec_entry(X) do { \ + if (X != NULL) gt_ggc_mx_spec_entry (X);\ + } while (0) +extern void gt_ggc_mx_spec_entry (void *); +#define gt_ggc_m_16pending_template(X) do { \ + if (X != NULL) gt_ggc_mx_pending_template (X);\ + } while (0) +extern void gt_ggc_mx_pending_template (void *); +#define gt_ggc_m_21named_label_use_entry(X) do { \ + if (X != NULL) gt_ggc_mx_named_label_use_entry (X);\ + } while (0) +extern void gt_ggc_mx_named_label_use_entry (void *); +#define gt_ggc_m_28VEC_deferred_access_check_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_deferred_access_check_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_deferred_access_check_gc (void *); +#define gt_ggc_m_11tinst_level(X) do { \ + if (X != NULL) gt_ggc_mx_tinst_level (X);\ + } while (0) +extern void gt_ggc_mx_tinst_level (void *); +#define gt_ggc_m_18sorted_fields_type(X) do { \ + if (X != NULL) gt_ggc_mx_sorted_fields_type (X);\ + } while (0) +extern void gt_ggc_mx_sorted_fields_type (void *); +#define gt_ggc_m_18VEC_tree_pair_s_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_tree_pair_s_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_tree_pair_s_gc (void *); +#define gt_ggc_m_17named_label_entry(X) do { \ + if (X != NULL) gt_ggc_mx_named_label_entry (X);\ + } while (0) +extern void gt_ggc_mx_named_label_entry (void *); +#define gt_ggc_m_14cp_token_cache(X) do { \ + if (X != NULL) gt_ggc_mx_cp_token_cache (X);\ + } while (0) +extern void gt_ggc_mx_cp_token_cache (void *); +#define gt_ggc_m_11saved_scope(X) do { \ + if (X != NULL) gt_ggc_mx_saved_scope (X);\ + } while (0) +extern void gt_ggc_mx_saved_scope (void *); +#define gt_ggc_m_16cxx_int_tree_map(X) do { \ + if (X != NULL) gt_ggc_mx_cxx_int_tree_map (X);\ + } while (0) +extern void gt_ggc_mx_cxx_int_tree_map (void *); +#define gt_ggc_m_23VEC_cp_class_binding_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_cp_class_binding_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_cp_class_binding_gc (void *); +#define gt_ggc_m_24VEC_cxx_saved_binding_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_cxx_saved_binding_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_cxx_saved_binding_gc (void *); +#define gt_ggc_m_16cp_binding_level(X) do { \ + if (X != NULL) gt_ggc_mx_cp_binding_level (X);\ + } while (0) +extern void gt_ggc_mx_cp_binding_level (void *); +#define gt_ggc_m_11cxx_binding(X) do { \ + if (X != NULL) gt_ggc_mx_cxx_binding (X);\ + } while (0) +extern void gt_ggc_mx_cxx_binding (void *); +#define gt_ggc_m_15binding_entry_s(X) do { \ + if (X != NULL) gt_ggc_mx_binding_entry_s (X);\ + } while (0) +extern void gt_ggc_mx_binding_entry_s (void *); +#define gt_ggc_m_15binding_table_s(X) do { \ + if (X != NULL) gt_ggc_mx_binding_table_s (X);\ + } while (0) +extern void gt_ggc_mx_binding_table_s (void *); +#define gt_ggc_m_14VEC_tinfo_s_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_tinfo_s_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_tinfo_s_gc (void *); +#define gt_ggc_m_18gnat_binding_level(X) do { \ + if (X != NULL) gt_ggc_mx_gnat_binding_level (X);\ + } while (0) +extern void gt_ggc_mx_gnat_binding_level (void *); +#define gt_ggc_m_9elab_info(X) do { \ + if (X != NULL) gt_ggc_mx_elab_info (X);\ + } while (0) +extern void gt_ggc_mx_elab_info (void *); +#define gt_ggc_m_10stmt_group(X) do { \ + if (X != NULL) gt_ggc_mx_stmt_group (X);\ + } while (0) +extern void gt_ggc_mx_stmt_group (void *); +#define gt_ggc_m_16VEC_parm_attr_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_parm_attr_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_parm_attr_gc (void *); +#define gt_ggc_m_11parm_attr_d(X) do { \ + if (X != NULL) gt_ggc_mx_parm_attr_d (X);\ + } while (0) +extern void gt_ggc_mx_parm_attr_d (void *); +#define gt_ggc_m_19lto_symtab_decl_def(X) do { \ + if (X != NULL) gt_ggc_mx_lto_symtab_decl_def (X);\ + } while (0) +extern void gt_ggc_mx_lto_symtab_decl_def (void *); +#define gt_ggc_m_25lto_symtab_identifier_def(X) do { \ + if (X != NULL) gt_ggc_mx_lto_symtab_identifier_def (X);\ + } while (0) +extern void gt_ggc_mx_lto_symtab_identifier_def (void *); +#define gt_ggc_m_20ssa_operand_memory_d(X) do { \ + if (X != NULL) gt_ggc_mx_ssa_operand_memory_d (X);\ + } while (0) +extern void gt_ggc_mx_ssa_operand_memory_d (void *); +#define gt_ggc_m_13scev_info_str(X) do { \ + if (X != NULL) gt_ggc_mx_scev_info_str (X);\ + } while (0) +extern void gt_ggc_mx_scev_info_str (void *); +#define gt_ggc_m_13VEC_gimple_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_gimple_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_gimple_gc (void *); +#define gt_ggc_m_9type_hash(X) do { \ + if (X != NULL) gt_ggc_mx_type_hash (X);\ + } while (0) +extern void gt_ggc_mx_type_hash (void *); +#define gt_ggc_m_16string_pool_data(X) do { \ + if (X != NULL) gt_ggc_mx_string_pool_data (X);\ + } while (0) +extern void gt_ggc_mx_string_pool_data (void *); +#define gt_ggc_m_13libfunc_entry(X) do { \ + if (X != NULL) gt_ggc_mx_libfunc_entry (X);\ + } while (0) +extern void gt_ggc_mx_libfunc_entry (void *); +#define gt_ggc_m_23temp_slot_address_entry(X) do { \ + if (X != NULL) gt_ggc_mx_temp_slot_address_entry (X);\ + } while (0) +extern void gt_ggc_mx_temp_slot_address_entry (void *); +#define gt_ggc_m_15throw_stmt_node(X) do { \ + if (X != NULL) gt_ggc_mx_throw_stmt_node (X);\ + } while (0) +extern void gt_ggc_mx_throw_stmt_node (void *); +#define gt_ggc_m_16VEC_eh_region_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_eh_region_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_eh_region_gc (void *); +#define gt_ggc_m_11eh_region_d(X) do { \ + if (X != NULL) gt_ggc_mx_eh_region_d (X);\ + } while (0) +extern void gt_ggc_mx_eh_region_d (void *); +#define gt_ggc_m_16var_loc_list_def(X) do { \ + if (X != NULL) gt_ggc_mx_var_loc_list_def (X);\ + } while (0) +extern void gt_ggc_mx_var_loc_list_def (void *); +#define gt_ggc_m_12var_loc_node(X) do { \ + if (X != NULL) gt_ggc_mx_var_loc_node (X);\ + } while (0) +extern void gt_ggc_mx_var_loc_node (void *); +#define gt_ggc_m_20VEC_die_arg_entry_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_die_arg_entry_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_die_arg_entry_gc (void *); +#define gt_ggc_m_16limbo_die_struct(X) do { \ + if (X != NULL) gt_ggc_mx_limbo_die_struct (X);\ + } while (0) +extern void gt_ggc_mx_limbo_die_struct (void *); +#define gt_ggc_m_20VEC_pubname_entry_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_pubname_entry_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_pubname_entry_gc (void *); +#define gt_ggc_m_19VEC_dw_attr_node_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_dw_attr_node_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_dw_attr_node_gc (void *); +#define gt_ggc_m_25dw_ranges_by_label_struct(X) do { \ + if (X != NULL) gt_ggc_mx_dw_ranges_by_label_struct (X);\ + } while (0) +extern void gt_ggc_mx_dw_ranges_by_label_struct (void *); +#define gt_ggc_m_16dw_ranges_struct(X) do { \ + if (X != NULL) gt_ggc_mx_dw_ranges_struct (X);\ + } while (0) +extern void gt_ggc_mx_dw_ranges_struct (void *); +#define gt_ggc_m_28dw_separate_line_info_struct(X) do { \ + if (X != NULL) gt_ggc_mx_dw_separate_line_info_struct (X);\ + } while (0) +extern void gt_ggc_mx_dw_separate_line_info_struct (void *); +#define gt_ggc_m_19dw_line_info_struct(X) do { \ + if (X != NULL) gt_ggc_mx_dw_line_info_struct (X);\ + } while (0) +extern void gt_ggc_mx_dw_line_info_struct (void *); +#define gt_ggc_m_25VEC_deferred_locations_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_deferred_locations_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_deferred_locations_gc (void *); +#define gt_ggc_m_18dw_loc_list_struct(X) do { \ + if (X != NULL) gt_ggc_mx_dw_loc_list_struct (X);\ + } while (0) +extern void gt_ggc_mx_dw_loc_list_struct (void *); +#define gt_ggc_m_15dwarf_file_data(X) do { \ + if (X != NULL) gt_ggc_mx_dwarf_file_data (X);\ + } while (0) +extern void gt_ggc_mx_dwarf_file_data (void *); +#define gt_ggc_m_15queued_reg_save(X) do { \ + if (X != NULL) gt_ggc_mx_queued_reg_save (X);\ + } while (0) +extern void gt_ggc_mx_queued_reg_save (void *); +#define gt_ggc_m_20indirect_string_node(X) do { \ + if (X != NULL) gt_ggc_mx_indirect_string_node (X);\ + } while (0) +extern void gt_ggc_mx_indirect_string_node (void *); +#define gt_ggc_m_19dw_loc_descr_struct(X) do { \ + if (X != NULL) gt_ggc_mx_dw_loc_descr_struct (X);\ + } while (0) +extern void gt_ggc_mx_dw_loc_descr_struct (void *); +#define gt_ggc_m_13dw_fde_struct(X) do { \ + if (X != NULL) gt_ggc_mx_dw_fde_struct (X);\ + } while (0) +extern void gt_ggc_mx_dw_fde_struct (void *); +#define gt_ggc_m_13dw_cfi_struct(X) do { \ + if (X != NULL) gt_ggc_mx_dw_cfi_struct (X);\ + } while (0) +extern void gt_ggc_mx_dw_cfi_struct (void *); +#define gt_ggc_m_8typeinfo(X) do { \ + if (X != NULL) gt_ggc_mx_typeinfo (X);\ + } while (0) +extern void gt_ggc_mx_typeinfo (void *); +#define gt_ggc_m_22VEC_alias_set_entry_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_alias_set_entry_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_alias_set_entry_gc (void *); +#define gt_ggc_m_17alias_set_entry_d(X) do { \ + if (X != NULL) gt_ggc_mx_alias_set_entry_d (X);\ + } while (0) +extern void gt_ggc_mx_alias_set_entry_d (void *); +#define gt_ggc_m_24constant_descriptor_tree(X) do { \ + if (X != NULL) gt_ggc_mx_constant_descriptor_tree (X);\ + } while (0) +extern void gt_ggc_mx_constant_descriptor_tree (void *); +#define gt_ggc_m_15cgraph_asm_node(X) do { \ + if (X != NULL) gt_ggc_mx_cgraph_asm_node (X);\ + } while (0) +extern void gt_ggc_mx_cgraph_asm_node (void *); +#define gt_ggc_m_12varpool_node(X) do { \ + if (X != NULL) gt_ggc_mx_varpool_node (X);\ + } while (0) +extern void gt_ggc_mx_varpool_node (void *); +#define gt_ggc_m_22VEC_cgraph_node_set_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_cgraph_node_set_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_cgraph_node_set_gc (void *); +#define gt_ggc_m_19cgraph_node_set_def(X) do { \ + if (X != NULL) gt_ggc_mx_cgraph_node_set_def (X);\ + } while (0) +extern void gt_ggc_mx_cgraph_node_set_def (void *); +#define gt_ggc_m_27cgraph_node_set_element_def(X) do { \ + if (X != NULL) gt_ggc_mx_cgraph_node_set_element_def (X);\ + } while (0) +extern void gt_ggc_mx_cgraph_node_set_element_def (void *); +#define gt_ggc_m_22VEC_cgraph_node_ptr_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_cgraph_node_ptr_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_cgraph_node_ptr_gc (void *); +#define gt_ggc_m_11cgraph_edge(X) do { \ + if (X != NULL) gt_ggc_mx_cgraph_edge (X);\ + } while (0) +extern void gt_ggc_mx_cgraph_edge (void *); +#define gt_ggc_m_24VEC_ipa_replace_map_p_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_ipa_replace_map_p_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_ipa_replace_map_p_gc (void *); +#define gt_ggc_m_15ipa_replace_map(X) do { \ + if (X != NULL) gt_ggc_mx_ipa_replace_map (X);\ + } while (0) +extern void gt_ggc_mx_ipa_replace_map (void *); +#define gt_ggc_m_11cgraph_node(X) do { \ + if (X != NULL) gt_ggc_mx_cgraph_node (X);\ + } while (0) +extern void gt_ggc_mx_cgraph_node (void *); +#define gt_ggc_m_18VEC_basic_block_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_basic_block_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_basic_block_gc (void *); +#define gt_ggc_m_14gimple_bb_info(X) do { \ + if (X != NULL) gt_ggc_mx_gimple_bb_info (X);\ + } while (0) +extern void gt_ggc_mx_gimple_bb_info (void *); +#define gt_ggc_m_11rtl_bb_info(X) do { \ + if (X != NULL) gt_ggc_mx_rtl_bb_info (X);\ + } while (0) +extern void gt_ggc_mx_rtl_bb_info (void *); +#define gt_ggc_m_11VEC_edge_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_edge_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_edge_gc (void *); +#define gt_ggc_m_17cselib_val_struct(X) do { \ + if (X != NULL) gt_ggc_mx_cselib_val_struct (X);\ + } while (0) +extern void gt_ggc_mx_cselib_val_struct (void *); +#define gt_ggc_m_12elt_loc_list(X) do { \ + if (X != NULL) gt_ggc_mx_elt_loc_list (X);\ + } while (0) +extern void gt_ggc_mx_elt_loc_list (void *); +#define gt_ggc_m_13VEC_loop_p_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_loop_p_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_loop_p_gc (void *); +#define gt_ggc_m_4loop(X) do { \ + if (X != NULL) gt_ggc_mx_loop (X);\ + } while (0) +extern void gt_ggc_mx_loop (void *); +#define gt_ggc_m_9loop_exit(X) do { \ + if (X != NULL) gt_ggc_mx_loop_exit (X);\ + } while (0) +extern void gt_ggc_mx_loop_exit (void *); +#define gt_ggc_m_13nb_iter_bound(X) do { \ + if (X != NULL) gt_ggc_mx_nb_iter_bound (X);\ + } while (0) +extern void gt_ggc_mx_nb_iter_bound (void *); +#define gt_ggc_m_17language_function(X) do { \ + if (X != NULL) gt_ggc_mx_language_function (X);\ + } while (0) +extern void gt_ggc_mx_language_function (void *); +#define gt_ggc_m_5loops(X) do { \ + if (X != NULL) gt_ggc_mx_loops (X);\ + } while (0) +extern void gt_ggc_mx_loops (void *); +#define gt_ggc_m_18control_flow_graph(X) do { \ + if (X != NULL) gt_ggc_mx_control_flow_graph (X);\ + } while (0) +extern void gt_ggc_mx_control_flow_graph (void *); +#define gt_ggc_m_9eh_status(X) do { \ + if (X != NULL) gt_ggc_mx_eh_status (X);\ + } while (0) +extern void gt_ggc_mx_eh_status (void *); +#define gt_ggc_m_20initial_value_struct(X) do { \ + if (X != NULL) gt_ggc_mx_initial_value_struct (X);\ + } while (0) +extern void gt_ggc_mx_initial_value_struct (void *); +#define gt_ggc_m_17rtx_constant_pool(X) do { \ + if (X != NULL) gt_ggc_mx_rtx_constant_pool (X);\ + } while (0) +extern void gt_ggc_mx_rtx_constant_pool (void *); +#define gt_ggc_m_18VEC_temp_slot_p_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_temp_slot_p_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_temp_slot_p_gc (void *); +#define gt_ggc_m_9temp_slot(X) do { \ + if (X != NULL) gt_ggc_mx_temp_slot (X);\ + } while (0) +extern void gt_ggc_mx_temp_slot (void *); +#define gt_ggc_m_9gimple_df(X) do { \ + if (X != NULL) gt_ggc_mx_gimple_df (X);\ + } while (0) +extern void gt_ggc_mx_gimple_df (void *); +#define gt_ggc_m_23VEC_call_site_record_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_call_site_record_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_call_site_record_gc (void *); +#define gt_ggc_m_18call_site_record_d(X) do { \ + if (X != NULL) gt_ggc_mx_call_site_record_d (X);\ + } while (0) +extern void gt_ggc_mx_call_site_record_d (void *); +#define gt_ggc_m_14sequence_stack(X) do { \ + if (X != NULL) gt_ggc_mx_sequence_stack (X);\ + } while (0) +extern void gt_ggc_mx_sequence_stack (void *); +#define gt_ggc_m_8elt_list(X) do { \ + if (X != NULL) gt_ggc_mx_elt_list (X);\ + } while (0) +extern void gt_ggc_mx_elt_list (void *); +#define gt_ggc_m_17tree_priority_map(X) do { \ + if (X != NULL) gt_ggc_mx_tree_priority_map (X);\ + } while (0) +extern void gt_ggc_mx_tree_priority_map (void *); +#define gt_ggc_m_12tree_int_map(X) do { \ + if (X != NULL) gt_ggc_mx_tree_int_map (X);\ + } while (0) +extern void gt_ggc_mx_tree_int_map (void *); +#define gt_ggc_m_8tree_map(X) do { \ + if (X != NULL) gt_ggc_mx_tree_map (X);\ + } while (0) +extern void gt_ggc_mx_tree_map (void *); +#define gt_ggc_m_14lang_tree_node(X) do { \ + if (X != NULL) gt_ggc_mx_lang_tree_node (X);\ + } while (0) +extern void gt_ggc_mx_lang_tree_node (void *); +#define gt_ggc_m_24tree_statement_list_node(X) do { \ + if (X != NULL) gt_ggc_mx_tree_statement_list_node (X);\ + } while (0) +extern void gt_ggc_mx_tree_statement_list_node (void *); +#define gt_ggc_m_9lang_decl(X) do { \ + if (X != NULL) gt_ggc_mx_lang_decl (X);\ + } while (0) +extern void gt_ggc_mx_lang_decl (void *); +#define gt_ggc_m_9lang_type(X) do { \ + if (X != NULL) gt_ggc_mx_lang_type (X);\ + } while (0) +extern void gt_ggc_mx_lang_type (void *); +#define gt_ggc_m_10die_struct(X) do { \ + if (X != NULL) gt_ggc_mx_die_struct (X);\ + } while (0) +extern void gt_ggc_mx_die_struct (void *); +#define gt_ggc_m_15varray_head_tag(X) do { \ + if (X != NULL) gt_ggc_mx_varray_head_tag (X);\ + } while (0) +extern void gt_ggc_mx_varray_head_tag (void *); +#define gt_ggc_m_12ptr_info_def(X) do { \ + if (X != NULL) gt_ggc_mx_ptr_info_def (X);\ + } while (0) +extern void gt_ggc_mx_ptr_info_def (void *); +#define gt_ggc_m_22VEC_constructor_elt_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_constructor_elt_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_constructor_elt_gc (void *); +#define gt_ggc_m_10tree_ann_d(X) do { \ + if (X != NULL) gt_ggc_mx_tree_ann_d (X);\ + } while (0) +extern void gt_ggc_mx_tree_ann_d (void *); +#define gt_ggc_m_17VEC_alias_pair_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_alias_pair_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_alias_pair_gc (void *); +#define gt_ggc_m_11VEC_tree_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_tree_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_tree_gc (void *); +#define gt_ggc_m_8function(X) do { \ + if (X != NULL) gt_ggc_mx_function (X);\ + } while (0) +extern void gt_ggc_mx_function (void *); +#define gt_ggc_m_23constant_descriptor_rtx(X) do { \ + if (X != NULL) gt_ggc_mx_constant_descriptor_rtx (X);\ + } while (0) +extern void gt_ggc_mx_constant_descriptor_rtx (void *); +#define gt_ggc_m_11fixed_value(X) do { \ + if (X != NULL) gt_ggc_mx_fixed_value (X);\ + } while (0) +extern void gt_ggc_mx_fixed_value (void *); +#define gt_ggc_m_10real_value(X) do { \ + if (X != NULL) gt_ggc_mx_real_value (X);\ + } while (0) +extern void gt_ggc_mx_real_value (void *); +#define gt_ggc_m_10VEC_rtx_gc(X) do { \ + if (X != NULL) gt_ggc_mx_VEC_rtx_gc (X);\ + } while (0) +extern void gt_ggc_mx_VEC_rtx_gc (void *); +#define gt_ggc_m_12object_block(X) do { \ + if (X != NULL) gt_ggc_mx_object_block (X);\ + } while (0) +extern void gt_ggc_mx_object_block (void *); +#define gt_ggc_m_9reg_attrs(X) do { \ + if (X != NULL) gt_ggc_mx_reg_attrs (X);\ + } while (0) +extern void gt_ggc_mx_reg_attrs (void *); +#define gt_ggc_m_9mem_attrs(X) do { \ + if (X != NULL) gt_ggc_mx_mem_attrs (X);\ + } while (0) +extern void gt_ggc_mx_mem_attrs (void *); +#define gt_ggc_m_14bitmap_obstack(X) do { \ + if (X != NULL) gt_ggc_mx_bitmap_obstack (X);\ + } while (0) +extern void gt_ggc_mx_bitmap_obstack (void *); +#define gt_ggc_m_18bitmap_element_def(X) do { \ + if (X != NULL) gt_ggc_mx_bitmap_element_def (X);\ + } while (0) +extern void gt_ggc_mx_bitmap_element_def (void *); +#define gt_ggc_m_16machine_function(X) do { \ + if (X != NULL) gt_ggc_mx_machine_function (X);\ + } while (0) +extern void gt_ggc_mx_machine_function (void *); +#define gt_ggc_m_17stack_local_entry(X) do { \ + if (X != NULL) gt_ggc_mx_stack_local_entry (X);\ + } while (0) +extern void gt_ggc_mx_stack_local_entry (void *); +#define gt_ggc_m_15basic_block_def(X) do { \ + if (X != NULL) gt_ggc_mx_basic_block_def (X);\ + } while (0) +extern void gt_ggc_mx_basic_block_def (void *); +#define gt_ggc_m_8edge_def(X) do { \ + if (X != NULL) gt_ggc_mx_edge_def (X);\ + } while (0) +extern void gt_ggc_mx_edge_def (void *); +#define gt_ggc_m_17gimple_seq_node_d(X) do { \ + if (X != NULL) gt_ggc_mx_gimple_seq_node_d (X);\ + } while (0) +extern void gt_ggc_mx_gimple_seq_node_d (void *); +#define gt_ggc_m_12gimple_seq_d(X) do { \ + if (X != NULL) gt_ggc_mx_gimple_seq_d (X);\ + } while (0) +extern void gt_ggc_mx_gimple_seq_d (void *); +#define gt_ggc_m_7section(X) do { \ + if (X != NULL) gt_ggc_mx_section (X);\ + } while (0) +extern void gt_ggc_mx_section (void *); +#define gt_ggc_m_18gimple_statement_d(X) do { \ + if (X != NULL) gt_ggc_mx_gimple_statement_d (X);\ + } while (0) +extern void gt_ggc_mx_gimple_statement_d (void *); +#define gt_ggc_m_9rtvec_def(X) do { \ + if (X != NULL) gt_ggc_mx_rtvec_def (X);\ + } while (0) +extern void gt_ggc_mx_rtvec_def (void *); +#define gt_ggc_m_7rtx_def(X) do { \ + if (X != NULL) gt_ggc_mx_rtx_def (X);\ + } while (0) +extern void gt_ggc_mx_rtx_def (void *); +#define gt_ggc_m_15bitmap_head_def(X) do { \ + if (X != NULL) gt_ggc_mx_bitmap_head_def (X);\ + } while (0) +extern void gt_ggc_mx_bitmap_head_def (void *); +#define gt_ggc_m_9tree_node(X) do { \ + if (X != NULL) gt_ggc_mx_tree_node (X);\ + } while (0) +#define gt_ggc_mx_tree_node gt_ggc_mx_lang_tree_node +#define gt_ggc_m_6answer(X) do { \ + if (X != NULL) gt_ggc_mx_answer (X);\ + } while (0) +extern void gt_ggc_mx_answer (void *); +#define gt_ggc_m_9cpp_macro(X) do { \ + if (X != NULL) gt_ggc_mx_cpp_macro (X);\ + } while (0) +extern void gt_ggc_mx_cpp_macro (void *); +#define gt_ggc_m_9cpp_token(X) do { \ + if (X != NULL) gt_ggc_mx_cpp_token (X);\ + } while (0) +extern void gt_ggc_mx_cpp_token (void *); +#define gt_ggc_m_9line_maps(X) do { \ + if (X != NULL) gt_ggc_mx_line_maps (X);\ + } while (0) +extern void gt_ggc_mx_line_maps (void *); +extern void gt_ggc_m_II17splay_tree_node_s (void *); +extern void gt_ggc_m_SP9tree_node17splay_tree_node_s (void *); +extern void gt_ggc_m_P9tree_nodeP9tree_node17splay_tree_node_s (void *); +extern void gt_ggc_m_IP9tree_node17splay_tree_node_s (void *); +extern void gt_ggc_m_P13tree_llvm_map4htab (void *); + +void +gt_ggc_m_P13tree_llvm_map4htab (void *x_p) +{ + struct htab * const x = (struct htab *)x_p; + if (ggc_test_and_set_mark (x)) + { + if ((*x).entries != NULL) { + size_t i0; + for (i0 = 0; i0 != (size_t)(((*x)).size); i0++) { + gt_ggc_m_13tree_llvm_map ((*x).entries[i0]); + } + ggc_mark ((*x).entries); + } + } +} +extern void gt_ggc_m_P15interface_tuple4htab (void *); +extern void gt_ggc_m_P16volatilized_type4htab (void *); +extern void gt_ggc_m_P17string_descriptor4htab (void *); +extern void gt_ggc_m_P14type_assertion4htab (void *); +extern void gt_ggc_m_P18treetreehash_entry4htab (void *); +extern void gt_ggc_m_P17module_htab_entry4htab (void *); +extern void gt_ggc_m_P16def_pragma_macro4htab (void *); +extern void gt_ggc_m_P21pending_abstract_type4htab (void *); +extern void gt_ggc_m_P10spec_entry4htab (void *); +extern void gt_ggc_m_P16cxx_int_tree_map4htab (void *); +extern void gt_ggc_m_P17named_label_entry4htab (void *); +extern void gt_ggc_m_P12tree_int_map4htab (void *); +extern void gt_ggc_m_P19lto_symtab_decl_def4htab (void *); +extern void gt_ggc_m_P25lto_symtab_identifier_def4htab (void *); +extern void gt_ggc_m_IP9tree_node12splay_tree_s (void *); +extern void gt_ggc_m_P9tree_nodeP9tree_node12splay_tree_s (void *); +extern void gt_ggc_m_P12varpool_node4htab (void *); +extern void gt_ggc_m_P13scev_info_str4htab (void *); +extern void gt_ggc_m_P23constant_descriptor_rtx4htab (void *); +extern void gt_ggc_m_P24constant_descriptor_tree4htab (void *); +extern void gt_ggc_m_P12object_block4htab (void *); +extern void gt_ggc_m_P7section4htab (void *); +extern void gt_ggc_m_P17tree_priority_map4htab (void *); +extern void gt_ggc_m_P8tree_map4htab (void *); +extern void gt_ggc_m_P9type_hash4htab (void *); +extern void gt_ggc_m_P13libfunc_entry4htab (void *); +extern void gt_ggc_m_P23temp_slot_address_entry4htab (void *); +extern void gt_ggc_m_P15throw_stmt_node4htab (void *); +extern void gt_ggc_m_P9reg_attrs4htab (void *); +extern void gt_ggc_m_P9mem_attrs4htab (void *); +extern void gt_ggc_m_P7rtx_def4htab (void *); +extern void gt_ggc_m_SP9tree_node12splay_tree_s (void *); +extern void gt_ggc_m_P16var_loc_list_def4htab (void *); +extern void gt_ggc_m_P10die_struct4htab (void *); +extern void gt_ggc_m_P15dwarf_file_data4htab (void *); +extern void gt_ggc_m_P20indirect_string_node4htab (void *); +extern void gt_ggc_m_P11cgraph_node4htab (void *); +extern void gt_ggc_m_II12splay_tree_s (void *); +extern void gt_ggc_m_P27cgraph_node_set_element_def4htab (void *); +extern void gt_ggc_m_P11cgraph_edge4htab (void *); +extern void gt_ggc_m_P9loop_exit4htab (void *); +extern void gt_ggc_m_P9tree_node4htab (void *); + +/* PCH type-walking procedures. */ +#define gt_pch_n_13tree_llvm_map(X) do { \ + if (X != NULL) gt_pch_nx_tree_llvm_map (X);\ + } while (0) +extern void gt_pch_nx_tree_llvm_map (void *); +#define gt_pch_n_15interface_tuple(X) do { \ + if (X != NULL) gt_pch_nx_interface_tuple (X);\ + } while (0) +extern void gt_pch_nx_interface_tuple (void *); +#define gt_pch_n_16volatilized_type(X) do { \ + if (X != NULL) gt_pch_nx_volatilized_type (X);\ + } while (0) +extern void gt_pch_nx_volatilized_type (void *); +#define gt_pch_n_17string_descriptor(X) do { \ + if (X != NULL) gt_pch_nx_string_descriptor (X);\ + } while (0) +extern void gt_pch_nx_string_descriptor (void *); +#define gt_pch_n_15c_inline_static(X) do { \ + if (X != NULL) gt_pch_nx_c_inline_static (X);\ + } while (0) +extern void gt_pch_nx_c_inline_static (void *); +#define gt_pch_n_24VEC_c_goto_bindings_p_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_c_goto_bindings_p_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_c_goto_bindings_p_gc (void *); +#define gt_pch_n_15c_goto_bindings(X) do { \ + if (X != NULL) gt_pch_nx_c_goto_bindings (X);\ + } while (0) +extern void gt_pch_nx_c_goto_bindings (void *); +#define gt_pch_n_7c_scope(X) do { \ + if (X != NULL) gt_pch_nx_c_scope (X);\ + } while (0) +extern void gt_pch_nx_c_scope (void *); +#define gt_pch_n_9c_binding(X) do { \ + if (X != NULL) gt_pch_nx_c_binding (X);\ + } while (0) +extern void gt_pch_nx_c_binding (void *); +#define gt_pch_n_12c_label_vars(X) do { \ + if (X != NULL) gt_pch_nx_c_label_vars (X);\ + } while (0) +extern void gt_pch_nx_c_label_vars (void *); +#define gt_pch_n_8c_parser(X) do { \ + if (X != NULL) gt_pch_nx_c_parser (X);\ + } while (0) +extern void gt_pch_nx_c_parser (void *); +#define gt_pch_n_9imp_entry(X) do { \ + if (X != NULL) gt_pch_nx_imp_entry (X);\ + } while (0) +extern void gt_pch_nx_imp_entry (void *); +#define gt_pch_n_16hashed_attribute(X) do { \ + if (X != NULL) gt_pch_nx_hashed_attribute (X);\ + } while (0) +extern void gt_pch_nx_hashed_attribute (void *); +#define gt_pch_n_12hashed_entry(X) do { \ + if (X != NULL) gt_pch_nx_hashed_entry (X);\ + } while (0) +extern void gt_pch_nx_hashed_entry (void *); +#define gt_pch_n_14type_assertion(X) do { \ + if (X != NULL) gt_pch_nx_type_assertion (X);\ + } while (0) +extern void gt_pch_nx_type_assertion (void *); +#define gt_pch_n_18treetreehash_entry(X) do { \ + if (X != NULL) gt_pch_nx_treetreehash_entry (X);\ + } while (0) +extern void gt_pch_nx_treetreehash_entry (void *); +#define gt_pch_n_5CPool(X) do { \ + if (X != NULL) gt_pch_nx_CPool (X);\ + } while (0) +extern void gt_pch_nx_CPool (void *); +#define gt_pch_n_3JCF(X) do { \ + if (X != NULL) gt_pch_nx_JCF (X);\ + } while (0) +extern void gt_pch_nx_JCF (void *); +#define gt_pch_n_17module_htab_entry(X) do { \ + if (X != NULL) gt_pch_nx_module_htab_entry (X);\ + } while (0) +extern void gt_pch_nx_module_htab_entry (void *); +#define gt_pch_n_13binding_level(X) do { \ + if (X != NULL) gt_pch_nx_binding_level (X);\ + } while (0) +extern void gt_pch_nx_binding_level (void *); +#define gt_pch_n_9opt_stack(X) do { \ + if (X != NULL) gt_pch_nx_opt_stack (X);\ + } while (0) +extern void gt_pch_nx_opt_stack (void *); +#define gt_pch_n_16def_pragma_macro(X) do { \ + if (X != NULL) gt_pch_nx_def_pragma_macro (X);\ + } while (0) +extern void gt_pch_nx_def_pragma_macro (void *); +#define gt_pch_n_22def_pragma_macro_value(X) do { \ + if (X != NULL) gt_pch_nx_def_pragma_macro_value (X);\ + } while (0) +extern void gt_pch_nx_def_pragma_macro_value (void *); +#define gt_pch_n_11align_stack(X) do { \ + if (X != NULL) gt_pch_nx_align_stack (X);\ + } while (0) +extern void gt_pch_nx_align_stack (void *); +#define gt_pch_n_18VEC_tree_gc_vec_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_tree_gc_vec_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_tree_gc_vec_gc (void *); +#define gt_pch_n_19VEC_const_char_p_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_const_char_p_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_const_char_p_gc (void *); +#define gt_pch_n_21pending_abstract_type(X) do { \ + if (X != NULL) gt_pch_nx_pending_abstract_type (X);\ + } while (0) +extern void gt_pch_nx_pending_abstract_type (void *); +#define gt_pch_n_9cp_parser(X) do { \ + if (X != NULL) gt_pch_nx_cp_parser (X);\ + } while (0) +extern void gt_pch_nx_cp_parser (void *); +#define gt_pch_n_17cp_parser_context(X) do { \ + if (X != NULL) gt_pch_nx_cp_parser_context (X);\ + } while (0) +extern void gt_pch_nx_cp_parser_context (void *); +#define gt_pch_n_8cp_lexer(X) do { \ + if (X != NULL) gt_pch_nx_cp_lexer (X);\ + } while (0) +extern void gt_pch_nx_cp_lexer (void *); +#define gt_pch_n_10tree_check(X) do { \ + if (X != NULL) gt_pch_nx_tree_check (X);\ + } while (0) +extern void gt_pch_nx_tree_check (void *); +#define gt_pch_n_22VEC_deferred_access_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_deferred_access_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_deferred_access_gc (void *); +#define gt_pch_n_10spec_entry(X) do { \ + if (X != NULL) gt_pch_nx_spec_entry (X);\ + } while (0) +extern void gt_pch_nx_spec_entry (void *); +#define gt_pch_n_16pending_template(X) do { \ + if (X != NULL) gt_pch_nx_pending_template (X);\ + } while (0) +extern void gt_pch_nx_pending_template (void *); +#define gt_pch_n_21named_label_use_entry(X) do { \ + if (X != NULL) gt_pch_nx_named_label_use_entry (X);\ + } while (0) +extern void gt_pch_nx_named_label_use_entry (void *); +#define gt_pch_n_28VEC_deferred_access_check_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_deferred_access_check_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_deferred_access_check_gc (void *); +#define gt_pch_n_11tinst_level(X) do { \ + if (X != NULL) gt_pch_nx_tinst_level (X);\ + } while (0) +extern void gt_pch_nx_tinst_level (void *); +#define gt_pch_n_18sorted_fields_type(X) do { \ + if (X != NULL) gt_pch_nx_sorted_fields_type (X);\ + } while (0) +extern void gt_pch_nx_sorted_fields_type (void *); +#define gt_pch_n_18VEC_tree_pair_s_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_tree_pair_s_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_tree_pair_s_gc (void *); +#define gt_pch_n_17named_label_entry(X) do { \ + if (X != NULL) gt_pch_nx_named_label_entry (X);\ + } while (0) +extern void gt_pch_nx_named_label_entry (void *); +#define gt_pch_n_14cp_token_cache(X) do { \ + if (X != NULL) gt_pch_nx_cp_token_cache (X);\ + } while (0) +extern void gt_pch_nx_cp_token_cache (void *); +#define gt_pch_n_11saved_scope(X) do { \ + if (X != NULL) gt_pch_nx_saved_scope (X);\ + } while (0) +extern void gt_pch_nx_saved_scope (void *); +#define gt_pch_n_16cxx_int_tree_map(X) do { \ + if (X != NULL) gt_pch_nx_cxx_int_tree_map (X);\ + } while (0) +extern void gt_pch_nx_cxx_int_tree_map (void *); +#define gt_pch_n_23VEC_cp_class_binding_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_cp_class_binding_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_cp_class_binding_gc (void *); +#define gt_pch_n_24VEC_cxx_saved_binding_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_cxx_saved_binding_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_cxx_saved_binding_gc (void *); +#define gt_pch_n_16cp_binding_level(X) do { \ + if (X != NULL) gt_pch_nx_cp_binding_level (X);\ + } while (0) +extern void gt_pch_nx_cp_binding_level (void *); +#define gt_pch_n_11cxx_binding(X) do { \ + if (X != NULL) gt_pch_nx_cxx_binding (X);\ + } while (0) +extern void gt_pch_nx_cxx_binding (void *); +#define gt_pch_n_15binding_entry_s(X) do { \ + if (X != NULL) gt_pch_nx_binding_entry_s (X);\ + } while (0) +extern void gt_pch_nx_binding_entry_s (void *); +#define gt_pch_n_15binding_table_s(X) do { \ + if (X != NULL) gt_pch_nx_binding_table_s (X);\ + } while (0) +extern void gt_pch_nx_binding_table_s (void *); +#define gt_pch_n_14VEC_tinfo_s_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_tinfo_s_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_tinfo_s_gc (void *); +#define gt_pch_n_18gnat_binding_level(X) do { \ + if (X != NULL) gt_pch_nx_gnat_binding_level (X);\ + } while (0) +extern void gt_pch_nx_gnat_binding_level (void *); +#define gt_pch_n_9elab_info(X) do { \ + if (X != NULL) gt_pch_nx_elab_info (X);\ + } while (0) +extern void gt_pch_nx_elab_info (void *); +#define gt_pch_n_10stmt_group(X) do { \ + if (X != NULL) gt_pch_nx_stmt_group (X);\ + } while (0) +extern void gt_pch_nx_stmt_group (void *); +#define gt_pch_n_16VEC_parm_attr_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_parm_attr_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_parm_attr_gc (void *); +#define gt_pch_n_11parm_attr_d(X) do { \ + if (X != NULL) gt_pch_nx_parm_attr_d (X);\ + } while (0) +extern void gt_pch_nx_parm_attr_d (void *); +#define gt_pch_n_19lto_symtab_decl_def(X) do { \ + if (X != NULL) gt_pch_nx_lto_symtab_decl_def (X);\ + } while (0) +extern void gt_pch_nx_lto_symtab_decl_def (void *); +#define gt_pch_n_25lto_symtab_identifier_def(X) do { \ + if (X != NULL) gt_pch_nx_lto_symtab_identifier_def (X);\ + } while (0) +extern void gt_pch_nx_lto_symtab_identifier_def (void *); +#define gt_pch_n_20ssa_operand_memory_d(X) do { \ + if (X != NULL) gt_pch_nx_ssa_operand_memory_d (X);\ + } while (0) +extern void gt_pch_nx_ssa_operand_memory_d (void *); +#define gt_pch_n_13scev_info_str(X) do { \ + if (X != NULL) gt_pch_nx_scev_info_str (X);\ + } while (0) +extern void gt_pch_nx_scev_info_str (void *); +#define gt_pch_n_13VEC_gimple_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_gimple_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_gimple_gc (void *); +#define gt_pch_n_9type_hash(X) do { \ + if (X != NULL) gt_pch_nx_type_hash (X);\ + } while (0) +extern void gt_pch_nx_type_hash (void *); +#define gt_pch_n_16string_pool_data(X) do { \ + if (X != NULL) gt_pch_nx_string_pool_data (X);\ + } while (0) +extern void gt_pch_nx_string_pool_data (void *); +#define gt_pch_n_13libfunc_entry(X) do { \ + if (X != NULL) gt_pch_nx_libfunc_entry (X);\ + } while (0) +extern void gt_pch_nx_libfunc_entry (void *); +#define gt_pch_n_23temp_slot_address_entry(X) do { \ + if (X != NULL) gt_pch_nx_temp_slot_address_entry (X);\ + } while (0) +extern void gt_pch_nx_temp_slot_address_entry (void *); +#define gt_pch_n_15throw_stmt_node(X) do { \ + if (X != NULL) gt_pch_nx_throw_stmt_node (X);\ + } while (0) +extern void gt_pch_nx_throw_stmt_node (void *); +#define gt_pch_n_16VEC_eh_region_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_eh_region_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_eh_region_gc (void *); +#define gt_pch_n_11eh_region_d(X) do { \ + if (X != NULL) gt_pch_nx_eh_region_d (X);\ + } while (0) +extern void gt_pch_nx_eh_region_d (void *); +#define gt_pch_n_16var_loc_list_def(X) do { \ + if (X != NULL) gt_pch_nx_var_loc_list_def (X);\ + } while (0) +extern void gt_pch_nx_var_loc_list_def (void *); +#define gt_pch_n_12var_loc_node(X) do { \ + if (X != NULL) gt_pch_nx_var_loc_node (X);\ + } while (0) +extern void gt_pch_nx_var_loc_node (void *); +#define gt_pch_n_20VEC_die_arg_entry_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_die_arg_entry_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_die_arg_entry_gc (void *); +#define gt_pch_n_16limbo_die_struct(X) do { \ + if (X != NULL) gt_pch_nx_limbo_die_struct (X);\ + } while (0) +extern void gt_pch_nx_limbo_die_struct (void *); +#define gt_pch_n_20VEC_pubname_entry_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_pubname_entry_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_pubname_entry_gc (void *); +#define gt_pch_n_19VEC_dw_attr_node_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_dw_attr_node_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_dw_attr_node_gc (void *); +#define gt_pch_n_25dw_ranges_by_label_struct(X) do { \ + if (X != NULL) gt_pch_nx_dw_ranges_by_label_struct (X);\ + } while (0) +extern void gt_pch_nx_dw_ranges_by_label_struct (void *); +#define gt_pch_n_16dw_ranges_struct(X) do { \ + if (X != NULL) gt_pch_nx_dw_ranges_struct (X);\ + } while (0) +extern void gt_pch_nx_dw_ranges_struct (void *); +#define gt_pch_n_28dw_separate_line_info_struct(X) do { \ + if (X != NULL) gt_pch_nx_dw_separate_line_info_struct (X);\ + } while (0) +extern void gt_pch_nx_dw_separate_line_info_struct (void *); +#define gt_pch_n_19dw_line_info_struct(X) do { \ + if (X != NULL) gt_pch_nx_dw_line_info_struct (X);\ + } while (0) +extern void gt_pch_nx_dw_line_info_struct (void *); +#define gt_pch_n_25VEC_deferred_locations_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_deferred_locations_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_deferred_locations_gc (void *); +#define gt_pch_n_18dw_loc_list_struct(X) do { \ + if (X != NULL) gt_pch_nx_dw_loc_list_struct (X);\ + } while (0) +extern void gt_pch_nx_dw_loc_list_struct (void *); +#define gt_pch_n_15dwarf_file_data(X) do { \ + if (X != NULL) gt_pch_nx_dwarf_file_data (X);\ + } while (0) +extern void gt_pch_nx_dwarf_file_data (void *); +#define gt_pch_n_15queued_reg_save(X) do { \ + if (X != NULL) gt_pch_nx_queued_reg_save (X);\ + } while (0) +extern void gt_pch_nx_queued_reg_save (void *); +#define gt_pch_n_20indirect_string_node(X) do { \ + if (X != NULL) gt_pch_nx_indirect_string_node (X);\ + } while (0) +extern void gt_pch_nx_indirect_string_node (void *); +#define gt_pch_n_19dw_loc_descr_struct(X) do { \ + if (X != NULL) gt_pch_nx_dw_loc_descr_struct (X);\ + } while (0) +extern void gt_pch_nx_dw_loc_descr_struct (void *); +#define gt_pch_n_13dw_fde_struct(X) do { \ + if (X != NULL) gt_pch_nx_dw_fde_struct (X);\ + } while (0) +extern void gt_pch_nx_dw_fde_struct (void *); +#define gt_pch_n_13dw_cfi_struct(X) do { \ + if (X != NULL) gt_pch_nx_dw_cfi_struct (X);\ + } while (0) +extern void gt_pch_nx_dw_cfi_struct (void *); +#define gt_pch_n_8typeinfo(X) do { \ + if (X != NULL) gt_pch_nx_typeinfo (X);\ + } while (0) +extern void gt_pch_nx_typeinfo (void *); +#define gt_pch_n_22VEC_alias_set_entry_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_alias_set_entry_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_alias_set_entry_gc (void *); +#define gt_pch_n_17alias_set_entry_d(X) do { \ + if (X != NULL) gt_pch_nx_alias_set_entry_d (X);\ + } while (0) +extern void gt_pch_nx_alias_set_entry_d (void *); +#define gt_pch_n_24constant_descriptor_tree(X) do { \ + if (X != NULL) gt_pch_nx_constant_descriptor_tree (X);\ + } while (0) +extern void gt_pch_nx_constant_descriptor_tree (void *); +#define gt_pch_n_15cgraph_asm_node(X) do { \ + if (X != NULL) gt_pch_nx_cgraph_asm_node (X);\ + } while (0) +extern void gt_pch_nx_cgraph_asm_node (void *); +#define gt_pch_n_12varpool_node(X) do { \ + if (X != NULL) gt_pch_nx_varpool_node (X);\ + } while (0) +extern void gt_pch_nx_varpool_node (void *); +#define gt_pch_n_22VEC_cgraph_node_set_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_cgraph_node_set_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_cgraph_node_set_gc (void *); +#define gt_pch_n_19cgraph_node_set_def(X) do { \ + if (X != NULL) gt_pch_nx_cgraph_node_set_def (X);\ + } while (0) +extern void gt_pch_nx_cgraph_node_set_def (void *); +#define gt_pch_n_27cgraph_node_set_element_def(X) do { \ + if (X != NULL) gt_pch_nx_cgraph_node_set_element_def (X);\ + } while (0) +extern void gt_pch_nx_cgraph_node_set_element_def (void *); +#define gt_pch_n_22VEC_cgraph_node_ptr_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_cgraph_node_ptr_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_cgraph_node_ptr_gc (void *); +#define gt_pch_n_11cgraph_edge(X) do { \ + if (X != NULL) gt_pch_nx_cgraph_edge (X);\ + } while (0) +extern void gt_pch_nx_cgraph_edge (void *); +#define gt_pch_n_24VEC_ipa_replace_map_p_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_ipa_replace_map_p_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_ipa_replace_map_p_gc (void *); +#define gt_pch_n_15ipa_replace_map(X) do { \ + if (X != NULL) gt_pch_nx_ipa_replace_map (X);\ + } while (0) +extern void gt_pch_nx_ipa_replace_map (void *); +#define gt_pch_n_11cgraph_node(X) do { \ + if (X != NULL) gt_pch_nx_cgraph_node (X);\ + } while (0) +extern void gt_pch_nx_cgraph_node (void *); +#define gt_pch_n_18VEC_basic_block_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_basic_block_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_basic_block_gc (void *); +#define gt_pch_n_14gimple_bb_info(X) do { \ + if (X != NULL) gt_pch_nx_gimple_bb_info (X);\ + } while (0) +extern void gt_pch_nx_gimple_bb_info (void *); +#define gt_pch_n_11rtl_bb_info(X) do { \ + if (X != NULL) gt_pch_nx_rtl_bb_info (X);\ + } while (0) +extern void gt_pch_nx_rtl_bb_info (void *); +#define gt_pch_n_11VEC_edge_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_edge_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_edge_gc (void *); +#define gt_pch_n_17cselib_val_struct(X) do { \ + if (X != NULL) gt_pch_nx_cselib_val_struct (X);\ + } while (0) +extern void gt_pch_nx_cselib_val_struct (void *); +#define gt_pch_n_12elt_loc_list(X) do { \ + if (X != NULL) gt_pch_nx_elt_loc_list (X);\ + } while (0) +extern void gt_pch_nx_elt_loc_list (void *); +#define gt_pch_n_13VEC_loop_p_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_loop_p_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_loop_p_gc (void *); +#define gt_pch_n_4loop(X) do { \ + if (X != NULL) gt_pch_nx_loop (X);\ + } while (0) +extern void gt_pch_nx_loop (void *); +#define gt_pch_n_9loop_exit(X) do { \ + if (X != NULL) gt_pch_nx_loop_exit (X);\ + } while (0) +extern void gt_pch_nx_loop_exit (void *); +#define gt_pch_n_13nb_iter_bound(X) do { \ + if (X != NULL) gt_pch_nx_nb_iter_bound (X);\ + } while (0) +extern void gt_pch_nx_nb_iter_bound (void *); +#define gt_pch_n_17language_function(X) do { \ + if (X != NULL) gt_pch_nx_language_function (X);\ + } while (0) +extern void gt_pch_nx_language_function (void *); +#define gt_pch_n_5loops(X) do { \ + if (X != NULL) gt_pch_nx_loops (X);\ + } while (0) +extern void gt_pch_nx_loops (void *); +#define gt_pch_n_18control_flow_graph(X) do { \ + if (X != NULL) gt_pch_nx_control_flow_graph (X);\ + } while (0) +extern void gt_pch_nx_control_flow_graph (void *); +#define gt_pch_n_9eh_status(X) do { \ + if (X != NULL) gt_pch_nx_eh_status (X);\ + } while (0) +extern void gt_pch_nx_eh_status (void *); +#define gt_pch_n_20initial_value_struct(X) do { \ + if (X != NULL) gt_pch_nx_initial_value_struct (X);\ + } while (0) +extern void gt_pch_nx_initial_value_struct (void *); +#define gt_pch_n_17rtx_constant_pool(X) do { \ + if (X != NULL) gt_pch_nx_rtx_constant_pool (X);\ + } while (0) +extern void gt_pch_nx_rtx_constant_pool (void *); +#define gt_pch_n_18VEC_temp_slot_p_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_temp_slot_p_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_temp_slot_p_gc (void *); +#define gt_pch_n_9temp_slot(X) do { \ + if (X != NULL) gt_pch_nx_temp_slot (X);\ + } while (0) +extern void gt_pch_nx_temp_slot (void *); +#define gt_pch_n_9gimple_df(X) do { \ + if (X != NULL) gt_pch_nx_gimple_df (X);\ + } while (0) +extern void gt_pch_nx_gimple_df (void *); +#define gt_pch_n_23VEC_call_site_record_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_call_site_record_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_call_site_record_gc (void *); +#define gt_pch_n_18call_site_record_d(X) do { \ + if (X != NULL) gt_pch_nx_call_site_record_d (X);\ + } while (0) +extern void gt_pch_nx_call_site_record_d (void *); +#define gt_pch_n_14sequence_stack(X) do { \ + if (X != NULL) gt_pch_nx_sequence_stack (X);\ + } while (0) +extern void gt_pch_nx_sequence_stack (void *); +#define gt_pch_n_8elt_list(X) do { \ + if (X != NULL) gt_pch_nx_elt_list (X);\ + } while (0) +extern void gt_pch_nx_elt_list (void *); +#define gt_pch_n_17tree_priority_map(X) do { \ + if (X != NULL) gt_pch_nx_tree_priority_map (X);\ + } while (0) +extern void gt_pch_nx_tree_priority_map (void *); +#define gt_pch_n_12tree_int_map(X) do { \ + if (X != NULL) gt_pch_nx_tree_int_map (X);\ + } while (0) +extern void gt_pch_nx_tree_int_map (void *); +#define gt_pch_n_8tree_map(X) do { \ + if (X != NULL) gt_pch_nx_tree_map (X);\ + } while (0) +extern void gt_pch_nx_tree_map (void *); +#define gt_pch_n_14lang_tree_node(X) do { \ + if (X != NULL) gt_pch_nx_lang_tree_node (X);\ + } while (0) +extern void gt_pch_nx_lang_tree_node (void *); +#define gt_pch_n_24tree_statement_list_node(X) do { \ + if (X != NULL) gt_pch_nx_tree_statement_list_node (X);\ + } while (0) +extern void gt_pch_nx_tree_statement_list_node (void *); +#define gt_pch_n_9lang_decl(X) do { \ + if (X != NULL) gt_pch_nx_lang_decl (X);\ + } while (0) +extern void gt_pch_nx_lang_decl (void *); +#define gt_pch_n_9lang_type(X) do { \ + if (X != NULL) gt_pch_nx_lang_type (X);\ + } while (0) +extern void gt_pch_nx_lang_type (void *); +#define gt_pch_n_10die_struct(X) do { \ + if (X != NULL) gt_pch_nx_die_struct (X);\ + } while (0) +extern void gt_pch_nx_die_struct (void *); +#define gt_pch_n_15varray_head_tag(X) do { \ + if (X != NULL) gt_pch_nx_varray_head_tag (X);\ + } while (0) +extern void gt_pch_nx_varray_head_tag (void *); +#define gt_pch_n_12ptr_info_def(X) do { \ + if (X != NULL) gt_pch_nx_ptr_info_def (X);\ + } while (0) +extern void gt_pch_nx_ptr_info_def (void *); +#define gt_pch_n_22VEC_constructor_elt_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_constructor_elt_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_constructor_elt_gc (void *); +#define gt_pch_n_10tree_ann_d(X) do { \ + if (X != NULL) gt_pch_nx_tree_ann_d (X);\ + } while (0) +extern void gt_pch_nx_tree_ann_d (void *); +#define gt_pch_n_17VEC_alias_pair_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_alias_pair_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_alias_pair_gc (void *); +#define gt_pch_n_11VEC_tree_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_tree_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_tree_gc (void *); +#define gt_pch_n_8function(X) do { \ + if (X != NULL) gt_pch_nx_function (X);\ + } while (0) +extern void gt_pch_nx_function (void *); +#define gt_pch_n_23constant_descriptor_rtx(X) do { \ + if (X != NULL) gt_pch_nx_constant_descriptor_rtx (X);\ + } while (0) +extern void gt_pch_nx_constant_descriptor_rtx (void *); +#define gt_pch_n_11fixed_value(X) do { \ + if (X != NULL) gt_pch_nx_fixed_value (X);\ + } while (0) +extern void gt_pch_nx_fixed_value (void *); +#define gt_pch_n_10real_value(X) do { \ + if (X != NULL) gt_pch_nx_real_value (X);\ + } while (0) +extern void gt_pch_nx_real_value (void *); +#define gt_pch_n_10VEC_rtx_gc(X) do { \ + if (X != NULL) gt_pch_nx_VEC_rtx_gc (X);\ + } while (0) +extern void gt_pch_nx_VEC_rtx_gc (void *); +#define gt_pch_n_12object_block(X) do { \ + if (X != NULL) gt_pch_nx_object_block (X);\ + } while (0) +extern void gt_pch_nx_object_block (void *); +#define gt_pch_n_9reg_attrs(X) do { \ + if (X != NULL) gt_pch_nx_reg_attrs (X);\ + } while (0) +extern void gt_pch_nx_reg_attrs (void *); +#define gt_pch_n_9mem_attrs(X) do { \ + if (X != NULL) gt_pch_nx_mem_attrs (X);\ + } while (0) +extern void gt_pch_nx_mem_attrs (void *); +#define gt_pch_n_14bitmap_obstack(X) do { \ + if (X != NULL) gt_pch_nx_bitmap_obstack (X);\ + } while (0) +extern void gt_pch_nx_bitmap_obstack (void *); +#define gt_pch_n_18bitmap_element_def(X) do { \ + if (X != NULL) gt_pch_nx_bitmap_element_def (X);\ + } while (0) +extern void gt_pch_nx_bitmap_element_def (void *); +#define gt_pch_n_16machine_function(X) do { \ + if (X != NULL) gt_pch_nx_machine_function (X);\ + } while (0) +extern void gt_pch_nx_machine_function (void *); +#define gt_pch_n_17stack_local_entry(X) do { \ + if (X != NULL) gt_pch_nx_stack_local_entry (X);\ + } while (0) +extern void gt_pch_nx_stack_local_entry (void *); +#define gt_pch_n_15basic_block_def(X) do { \ + if (X != NULL) gt_pch_nx_basic_block_def (X);\ + } while (0) +extern void gt_pch_nx_basic_block_def (void *); +#define gt_pch_n_8edge_def(X) do { \ + if (X != NULL) gt_pch_nx_edge_def (X);\ + } while (0) +extern void gt_pch_nx_edge_def (void *); +#define gt_pch_n_17gimple_seq_node_d(X) do { \ + if (X != NULL) gt_pch_nx_gimple_seq_node_d (X);\ + } while (0) +extern void gt_pch_nx_gimple_seq_node_d (void *); +#define gt_pch_n_12gimple_seq_d(X) do { \ + if (X != NULL) gt_pch_nx_gimple_seq_d (X);\ + } while (0) +extern void gt_pch_nx_gimple_seq_d (void *); +#define gt_pch_n_7section(X) do { \ + if (X != NULL) gt_pch_nx_section (X);\ + } while (0) +extern void gt_pch_nx_section (void *); +#define gt_pch_n_18gimple_statement_d(X) do { \ + if (X != NULL) gt_pch_nx_gimple_statement_d (X);\ + } while (0) +extern void gt_pch_nx_gimple_statement_d (void *); +#define gt_pch_n_9rtvec_def(X) do { \ + if (X != NULL) gt_pch_nx_rtvec_def (X);\ + } while (0) +extern void gt_pch_nx_rtvec_def (void *); +#define gt_pch_n_7rtx_def(X) do { \ + if (X != NULL) gt_pch_nx_rtx_def (X);\ + } while (0) +extern void gt_pch_nx_rtx_def (void *); +#define gt_pch_n_15bitmap_head_def(X) do { \ + if (X != NULL) gt_pch_nx_bitmap_head_def (X);\ + } while (0) +extern void gt_pch_nx_bitmap_head_def (void *); +#define gt_pch_n_9tree_node(X) do { \ + if (X != NULL) gt_pch_nx_tree_node (X);\ + } while (0) +#define gt_pch_nx_tree_node gt_pch_nx_lang_tree_node +#define gt_pch_n_6answer(X) do { \ + if (X != NULL) gt_pch_nx_answer (X);\ + } while (0) +extern void gt_pch_nx_answer (void *); +#define gt_pch_n_9cpp_macro(X) do { \ + if (X != NULL) gt_pch_nx_cpp_macro (X);\ + } while (0) +extern void gt_pch_nx_cpp_macro (void *); +#define gt_pch_n_9cpp_token(X) do { \ + if (X != NULL) gt_pch_nx_cpp_token (X);\ + } while (0) +extern void gt_pch_nx_cpp_token (void *); +#define gt_pch_n_9line_maps(X) do { \ + if (X != NULL) gt_pch_nx_line_maps (X);\ + } while (0) +extern void gt_pch_nx_line_maps (void *); +extern void gt_pch_n_II17splay_tree_node_s (void *); +extern void gt_pch_n_SP9tree_node17splay_tree_node_s (void *); +extern void gt_pch_n_P9tree_nodeP9tree_node17splay_tree_node_s (void *); +extern void gt_pch_n_IP9tree_node17splay_tree_node_s (void *); +extern void gt_pch_n_P13tree_llvm_map4htab (void *); + +void +gt_pch_n_P13tree_llvm_map4htab (void *x_p) +{ +#ifdef GCC_PLUGIN_HAVE_PCH + struct htab * const x = (struct htab *)x_p; + if (gt_pch_note_object (x, x, gt_pch_p_P13tree_llvm_map4htab, gt_e_P13tree_llvm_map4htab)) + { + if ((*x).entries != NULL) { + size_t i0; + for (i0 = 0; i0 != (size_t)(((*x)).size); i0++) { + gt_pch_n_13tree_llvm_map ((*x).entries[i0]); + } + gt_pch_note_object ((*x).entries, x, gt_pch_p_P13tree_llvm_map4htab, gt_types_enum_last); + } + } +/* end ifdef GCC_PLUGIN_HAVE_PCH*/ +#endif +} +extern void gt_pch_n_P15interface_tuple4htab (void *); +extern void gt_pch_n_P16volatilized_type4htab (void *); +extern void gt_pch_n_P17string_descriptor4htab (void *); +extern void gt_pch_n_P14type_assertion4htab (void *); +extern void gt_pch_n_P18treetreehash_entry4htab (void *); +extern void gt_pch_n_P17module_htab_entry4htab (void *); +extern void gt_pch_n_P16def_pragma_macro4htab (void *); +extern void gt_pch_n_P21pending_abstract_type4htab (void *); +extern void gt_pch_n_P10spec_entry4htab (void *); +extern void gt_pch_n_P16cxx_int_tree_map4htab (void *); +extern void gt_pch_n_P17named_label_entry4htab (void *); +extern void gt_pch_n_P12tree_int_map4htab (void *); +extern void gt_pch_n_P19lto_symtab_decl_def4htab (void *); +extern void gt_pch_n_P25lto_symtab_identifier_def4htab (void *); +extern void gt_pch_n_IP9tree_node12splay_tree_s (void *); +extern void gt_pch_n_P9tree_nodeP9tree_node12splay_tree_s (void *); +extern void gt_pch_n_P12varpool_node4htab (void *); +extern void gt_pch_n_P13scev_info_str4htab (void *); +extern void gt_pch_n_P23constant_descriptor_rtx4htab (void *); +extern void gt_pch_n_P24constant_descriptor_tree4htab (void *); +extern void gt_pch_n_P12object_block4htab (void *); +extern void gt_pch_n_P7section4htab (void *); +extern void gt_pch_n_P17tree_priority_map4htab (void *); +extern void gt_pch_n_P8tree_map4htab (void *); +extern void gt_pch_n_P9type_hash4htab (void *); +extern void gt_pch_n_P13libfunc_entry4htab (void *); +extern void gt_pch_n_P23temp_slot_address_entry4htab (void *); +extern void gt_pch_n_P15throw_stmt_node4htab (void *); +extern void gt_pch_n_P9reg_attrs4htab (void *); +extern void gt_pch_n_P9mem_attrs4htab (void *); +extern void gt_pch_n_P7rtx_def4htab (void *); +extern void gt_pch_n_SP9tree_node12splay_tree_s (void *); +extern void gt_pch_n_P16var_loc_list_def4htab (void *); +extern void gt_pch_n_P10die_struct4htab (void *); +extern void gt_pch_n_P15dwarf_file_data4htab (void *); +extern void gt_pch_n_P20indirect_string_node4htab (void *); +extern void gt_pch_n_P11cgraph_node4htab (void *); +extern void gt_pch_n_II12splay_tree_s (void *); +extern void gt_pch_n_P27cgraph_node_set_element_def4htab (void *); +extern void gt_pch_n_P11cgraph_edge4htab (void *); +extern void gt_pch_n_P9loop_exit4htab (void *); +extern void gt_pch_n_P9tree_node4htab (void *); + +/* Local pointer-walking routines. */ +extern void gt_pch_p_13tree_llvm_map + (void *, void *, gt_pointer_operator, void *); + +void +gt_pch_p_13tree_llvm_map (ATTRIBUTE_UNUSED void *this_obj, + void *x_p, + ATTRIBUTE_UNUSED gt_pointer_operator op, + ATTRIBUTE_UNUSED void *cookie) +{ +#ifdef GCC_PLUGIN_HAVE_PCH + struct tree_llvm_map * const x ATTRIBUTE_UNUSED = (struct tree_llvm_map *)x_p; + if ((void *)(x) == this_obj) + op (&((*x).base.from), cookie); +/* end ifdef GCC_PLUGIN_HAVE_PCH */ +#endif +} +extern void gt_pch_p_15interface_tuple + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16volatilized_type + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17string_descriptor + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15c_inline_static + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_24VEC_c_goto_bindings_p_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15c_goto_bindings + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_7c_scope + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9c_binding + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12c_label_vars + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_8c_parser + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9imp_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16hashed_attribute + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12hashed_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_14type_assertion + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18treetreehash_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_5CPool + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_3JCF + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17module_htab_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_13binding_level + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9opt_stack + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16def_pragma_macro + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_22def_pragma_macro_value + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11align_stack + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18VEC_tree_gc_vec_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_19VEC_const_char_p_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_21pending_abstract_type + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9cp_parser + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17cp_parser_context + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_8cp_lexer + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_10tree_check + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_22VEC_deferred_access_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_10spec_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16pending_template + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_21named_label_use_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_28VEC_deferred_access_check_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11tinst_level + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18sorted_fields_type + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18VEC_tree_pair_s_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17named_label_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_14cp_token_cache + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11saved_scope + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16cxx_int_tree_map + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_23VEC_cp_class_binding_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_24VEC_cxx_saved_binding_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16cp_binding_level + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11cxx_binding + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15binding_entry_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15binding_table_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_14VEC_tinfo_s_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18gnat_binding_level + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9elab_info + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_10stmt_group + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16VEC_parm_attr_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11parm_attr_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_19lto_symtab_decl_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_25lto_symtab_identifier_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_20ssa_operand_memory_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_13scev_info_str + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_13VEC_gimple_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9type_hash + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16string_pool_data + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_13libfunc_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_23temp_slot_address_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15throw_stmt_node + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16VEC_eh_region_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11eh_region_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16var_loc_list_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12var_loc_node + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_20VEC_die_arg_entry_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16limbo_die_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_20VEC_pubname_entry_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_19VEC_dw_attr_node_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_25dw_ranges_by_label_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16dw_ranges_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_28dw_separate_line_info_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_19dw_line_info_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_25VEC_deferred_locations_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18dw_loc_list_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15dwarf_file_data + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15queued_reg_save + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_20indirect_string_node + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_19dw_loc_descr_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_13dw_fde_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_13dw_cfi_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_8typeinfo + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_22VEC_alias_set_entry_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17alias_set_entry_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_24constant_descriptor_tree + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15cgraph_asm_node + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12varpool_node + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_22VEC_cgraph_node_set_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_19cgraph_node_set_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_27cgraph_node_set_element_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_22VEC_cgraph_node_ptr_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11cgraph_edge + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_24VEC_ipa_replace_map_p_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15ipa_replace_map + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11cgraph_node + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18VEC_basic_block_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_14gimple_bb_info + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11rtl_bb_info + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11VEC_edge_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17cselib_val_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12elt_loc_list + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_13VEC_loop_p_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_4loop + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9loop_exit + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_13nb_iter_bound + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17language_function + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_5loops + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18control_flow_graph + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9eh_status + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_20initial_value_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17rtx_constant_pool + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18VEC_temp_slot_p_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9temp_slot + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9gimple_df + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_23VEC_call_site_record_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18call_site_record_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_14sequence_stack + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_8elt_list + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17tree_priority_map + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12tree_int_map + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_8tree_map + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_14lang_tree_node + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_24tree_statement_list_node + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9lang_decl + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9lang_type + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_10die_struct + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15varray_head_tag + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12ptr_info_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_22VEC_constructor_elt_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_10tree_ann_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17VEC_alias_pair_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11VEC_tree_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_8function + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_23constant_descriptor_rtx + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_11fixed_value + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_10real_value + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_10VEC_rtx_gc + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12object_block + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9reg_attrs + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9mem_attrs + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_14bitmap_obstack + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18bitmap_element_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_16machine_function + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17stack_local_entry + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15basic_block_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_8edge_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_17gimple_seq_node_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_12gimple_seq_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_7section + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_18gimple_statement_d + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9rtvec_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_7rtx_def + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_15bitmap_head_def + (void *, void *, gt_pointer_operator, void *); +#define gt_pch_p_9tree_node gt_pch_p_14lang_tree_node +extern void gt_pch_p_6answer + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9cpp_macro + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9cpp_token + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_9line_maps + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_II17splay_tree_node_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_SP9tree_node17splay_tree_node_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P9tree_nodeP9tree_node17splay_tree_node_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_IP9tree_node17splay_tree_node_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P13tree_llvm_map4htab + (void *, void *, gt_pointer_operator, void *); + +void +gt_pch_p_P13tree_llvm_map4htab (ATTRIBUTE_UNUSED void *this_obj, + void *x_p, + ATTRIBUTE_UNUSED gt_pointer_operator op, + ATTRIBUTE_UNUSED void *cookie) +{ +#ifdef GCC_PLUGIN_HAVE_PCH + struct htab * const x ATTRIBUTE_UNUSED = (struct htab *)x_p; + if ((*x).entries != NULL) { + size_t i0; + for (i0 = 0; i0 != (size_t)(((*x)).size); i0++) { + if ((void *)((*x).entries) == this_obj) + op (&((*x).entries[i0]), cookie); + } + if ((void *)(x) == this_obj) + op (&((*x).entries), cookie); + } +/* end ifdef GCC_PLUGIN_HAVE_PCH */ +#endif +} +extern void gt_pch_p_P15interface_tuple4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P16volatilized_type4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P17string_descriptor4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P14type_assertion4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P18treetreehash_entry4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P17module_htab_entry4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P16def_pragma_macro4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P21pending_abstract_type4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P10spec_entry4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P16cxx_int_tree_map4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P17named_label_entry4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P12tree_int_map4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P19lto_symtab_decl_def4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P25lto_symtab_identifier_def4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_IP9tree_node12splay_tree_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P9tree_nodeP9tree_node12splay_tree_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P12varpool_node4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P13scev_info_str4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P23constant_descriptor_rtx4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P24constant_descriptor_tree4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P12object_block4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P7section4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P17tree_priority_map4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P8tree_map4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P9type_hash4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P13libfunc_entry4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P23temp_slot_address_entry4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P15throw_stmt_node4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P9reg_attrs4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P9mem_attrs4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P7rtx_def4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_SP9tree_node12splay_tree_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P16var_loc_list_def4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P10die_struct4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P15dwarf_file_data4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P20indirect_string_node4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P11cgraph_node4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_II12splay_tree_s + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P27cgraph_node_set_element_def4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P11cgraph_edge4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P9loop_exit4htab + (void *, void *, gt_pointer_operator, void *); +extern void gt_pch_p_P9tree_node4htab + (void *, void *, gt_pointer_operator, void *); + +/* GC roots. */ + +EXPORTED_CONST struct ggc_cache_tab gt_ggc_rc__gt_llvm_cache_h[] = { + { + &llvm_cache, + 1, + sizeof (llvm_cache), + >_ggc_mx_tree_llvm_map, + >_pch_nx_tree_llvm_map, + &tree_llvm_map_marked_p + }, + LAST_GGC_CACHE_TAB +}; + +EXPORTED_CONST struct ggc_root_tab gt_pch_rc__gt_llvm_cache_h[] = { + { + &llvm_cache, + 1, + sizeof (llvm_cache), + >_ggc_m_P13tree_llvm_map4htab, + >_pch_n_P13tree_llvm_map4htab + }, + LAST_GGC_ROOT_TAB +}; + + +void +gt_ggc_mx_tree_llvm_map (void *x_p) +{ + struct tree_llvm_map * const x = (struct tree_llvm_map *)x_p; + if (ggc_test_and_set_mark (x)) + { + gt_ggc_m_9tree_node ((*x).base.from); + } +} + +void +gt_pch_nx_tree_llvm_map (void *x_p) +{ +#ifdef GCC_PLUGIN_HAVE_PCH + struct tree_llvm_map * const x = (struct tree_llvm_map *)x_p; + if (gt_pch_note_object (x, x, gt_pch_p_13tree_llvm_map, gt_ggc_e_13tree_llvm_map)) + { + gt_pch_n_9tree_node ((*x).base.from); + } +/* end ifdef GCC_PLUGIN_HAVE_PCH*/ +#endif +} From baldrick at free.fr Mon Sep 14 09:03:12 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Sep 2009 14:03:12 -0000 Subject: [llvm-commits] [gcc-plugin] r81763 - /gcc-plugin/trunk/gcc-patches/gengtype.diff Message-ID: <200909141403.n8EE3C6L007411@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 14 09:03:12 2009 New Revision: 81763 URL: http://llvm.org/viewvc/llvm-project?rev=81763&view=rev Log: This patch is no longer needed. Removed: gcc-plugin/trunk/gcc-patches/gengtype.diff Removed: gcc-plugin/trunk/gcc-patches/gengtype.diff URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/gcc-patches/gengtype.diff?rev=81762&view=auto ============================================================================== --- gcc-plugin/trunk/gcc-patches/gengtype.diff (original) +++ gcc-plugin/trunk/gcc-patches/gengtype.diff (removed) @@ -1,737 +0,0 @@ -Index: lto/gcc/doc/plugins.texi -=================================================================== ---- lto.orig/gcc/doc/plugins.texi 2009-09-01 00:16:27.962891836 +0200 -+++ lto/gcc/doc/plugins.texi 2009-09-01 10:21:15.728775623 +0200 -@@ -226,12 +226,16 @@ - their own @code{GTY}-ed data. This can be done with the - @code{PLUGIN_REGISTER_GGC_ROOTS} pseudo-event with a null callback and - the extra root table as @code{user_data}. Running the @code{gengtype ---p @var{source-dir} @var{file-list} @var{plugin*.c} ...} utility --generates this extra root table. -+-P @file{gt-plugin.h} @var{source-dir} @var{file-list} @var{plugin*.c} -+...} utility generates this extra root table, with the PCH related -+generated code kept wrapped with the @code{#ifdef -+GCC_PLUGIN_HAVE_PCH}, so disabled by default. - - You should understand the details of memory management inside GCC - before using @code{PLUGIN_GGC_MARKING} or -- at code{PLUGIN_REGISTER_GGC_ROOTS}. -+ at code{PLUGIN_REGISTER_GGC_ROOTS}. Notice that using plugins which -+need these features may break the generation of precompiled headers -+[PCH], unless these plugins take specific measures. - - - @section Giving information about a plugin -Index: lto/gcc/gengtype.c -=================================================================== ---- lto.orig/gcc/gengtype.c 2009-09-01 10:20:35.755693766 +0200 -+++ lto/gcc/gengtype.c 2009-09-01 10:21:15.732708428 +0200 -@@ -24,6 +24,7 @@ - #include "errors.h" /* for fatal */ - #include "double-int.h" - -+ - /* Data types, macros, etc. used only in this file. */ - - /* Kinds of types we can understand. */ -@@ -64,6 +65,7 @@ - type_p type; - struct fileloc line; - options_p opt; -+ bool inplugin; /* flag set if appearing inside a plugin */ - }; - - #define NUM_PARAM 10 -@@ -83,6 +85,7 @@ - type_p next; - type_p pointer_to; - enum gc_used_enum gc_used; -+ bool inplugin; - union { - type_p p; - struct { -@@ -145,6 +148,12 @@ - directory. */ - static char** plugin_files; - static int nb_plugin_files; -+/* index of first plugin file in gt_files */ -+static int first_plugin_file_ix= -1; -+/* the generated plugin output name & file */ -+static char* plugin_output_filename; -+static outf_p plugin_output; -+ - - /* The output header file that is included into pretty much every - source file. */ -@@ -167,12 +176,16 @@ - - - /* Nonzero iff an error has occurred. */ --bool hit_error = false; -+bool hit_error = FALSE; -+/* Flag set when parsing a plugin file */ -+bool is_plugin_file = FALSE; -+ - - static void gen_rtx_next (void); - static void write_rtx_next (void); - static void open_base_files (void); - static void close_output_files (void); -+static void output_delayed_functions (void); - - /* Report an error at POS, printing MSG. */ - -@@ -465,8 +478,19 @@ - if (plugin_files) - { - int i; -+ first_plugin_file_ix = nfiles; - for (i = 0; i < nb_plugin_files; i++) -- gt_files[nfiles++] = plugin_files[i]; -+ { -+ /* Each added entry in gt_files should have additional -+ space for its lang_bitmap before. */ -+ int plugfilen = strlen (plugin_files[i]); -+ char* plugent = -+ (char*) xcalloc (1, plugfilen+1 + sizeof (lang_bitmap)); -+ plugent += sizeof (lang_bitmap); -+ strcpy(plugent, plugin_files[i]); -+ gt_files[nfiles++] = plugent; -+ /* We don't bother freeing plugent ! */ -+ } - } - num_gt_files = nfiles; - } -@@ -512,17 +536,18 @@ - /* The one and only TYPE_STRING. */ - - static struct type string_type = { -- TYPE_STRING, 0, 0, GC_USED, {0} -+ TYPE_STRING, 0, 0, GC_USED, false, {0} - }; - - /* The two and only TYPE_SCALARs. Their u.scalar_is_char flags are - set to appropriate values at the beginning of main. */ - - static struct type scalar_nonchar = { -- TYPE_SCALAR, 0, 0, GC_USED, {0} -+ TYPE_SCALAR, 0, 0, GC_USED, false, {0} - }; -+ - static struct type scalar_char = { -- TYPE_SCALAR, 0, 0, GC_USED, {0} -+ TYPE_SCALAR, 0, 0, GC_USED, false, {0} - }; - - /* Lists of various things. */ -@@ -663,8 +688,9 @@ - isunion ? "union" : "struct", s->u.s.tag); - error_at_line (&s->u.s.line, "previous definition here"); - } -- -+ - s->kind = isunion ? TYPE_UNION : TYPE_STRUCT; -+ s->inplugin = is_plugin_file; - s->u.s.tag = name; - s->u.s.line = *pos; - s->u.s.fields = fields; -@@ -709,6 +735,7 @@ - s->next = structures; - structures = s; - s->kind = isunion ? TYPE_UNION : TYPE_STRUCT; -+ s->inplugin = is_plugin_file; - s->u.s.tag = name; - structures = s; - return s; -@@ -732,6 +759,7 @@ - { - res = XCNEW (struct type); - res->kind = TYPE_PARAM_STRUCT; -+ res->inplugin = is_plugin_file; - res->next = param_structs; - param_structs = res; - res->u.param_struct.stru = t; -@@ -760,6 +788,7 @@ - { - type_p r = XCNEW (struct type); - r->kind = TYPE_POINTER; -+ r->inplugin = is_plugin_file; - r->u.p = t; - t->pointer_to = r; - } -@@ -775,6 +804,7 @@ - - v = XCNEW (struct type); - v->kind = TYPE_ARRAY; -+ v->inplugin = is_plugin_file; - v->u.a.p = t; - v->u.a.len = len; - return v; -@@ -819,6 +849,7 @@ - n->line = *pos; - n->opt = o; - n->next = variables; -+ n->inplugin = is_plugin_file; - variables = n; - } - -@@ -1492,6 +1523,9 @@ - f = XCNEW (struct outf); - f->next = output_files; - f->name = oname; -+ i = f->buflength = 4096; -+ f->buf = XNEWVEC (char, i); -+ f->bufused = 0; - output_files = f; - - oprintf (f, "/* Type information for %s.\n", name); -@@ -1508,7 +1542,7 @@ - void - oprintf (outf_p o, const char *format, ...) - { -- char *s; -+ char *s = NULL; - size_t slength; - va_list ap; - -@@ -1516,7 +1550,11 @@ - in that case. */ - if (!o) - return; -- -+ -+ gcc_assert (o->buf != NULL); -+ -+ gcc_assert (o->bufused <= o->buflength); -+ - va_start (ap, format); - slength = vasprintf (&s, format, ap); - if (s == NULL || (int)slength < 0) -@@ -1526,16 +1564,24 @@ - if (o->bufused + slength > o->buflength) - { - size_t new_len = o->buflength; -+ char *oldbuf = o->buf; - if (new_len == 0) - new_len = 1024; - do { - new_len *= 2; - } while (o->bufused + slength >= new_len); -- o->buf = XRESIZEVEC (char, o->buf, new_len); -+ o->buf = XNEWVEC (char, new_len); -+ if (oldbuf) -+ { -+ memcpy(o->buf, oldbuf, o->bufused); -+ oldbuf[0] = 0; -+ } -+ free (oldbuf); - o->buflength = new_len; - } - memcpy (o->buf + o->bufused, s, slength); - o->bufused += slength; -+ gcc_assert (o->bufused <= o->buflength); - free (s); - } - -@@ -1546,10 +1592,13 @@ - { - size_t i; - -- if (nb_plugin_files > 0 && plugin_files) -+ if (nb_plugin_files > 0 && plugin_files) - return; -- -+ -+ /* header file should be generated even in plugin mode */ - header_file = create_file ("GCC", "gtype-desc.h"); -+ -+ - - base_files = XNEWVEC (outf_p, num_lang_dirs); - -@@ -1567,7 +1616,8 @@ - "hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h", - "optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h", - "tree-flow.h", "reload.h", "cpp-id-data.h", "tree-chrec.h", -- "cfglayout.h", "except.h", "output.h", "gimple.h", "cfgloop.h", NULL -+ "cfglayout.h", "except.h", "output.h", "gimple.h", "cfgloop.h", -+ NULL - }; - const char *const *ifp; - outf_p gtype_desc_c; -@@ -1712,15 +1762,19 @@ - input_file = "system.h"; - - /* In plugin mode, return NULL unless the input_file is one of the -- plugin_files. */ -+ plugin_files or is the specified plugin_output_filename. */ - if (plugin_files && nb_plugin_files > 0) - { - int ix= -1, i; - for (i = 0; i < nb_plugin_files && ix < 0; i++) -- if (strcmp (input_file, plugin_files[i]) == 0) -- ix = i; -- if (ix < 0) -+ if (strcmp (input_file, plugin_files[i]) == 0) -+ ix = i; -+ if (ix < 0 -+ && plugin_output_filename -+ && strcmp (input_file, plugin_output_filename)) - return NULL; -+ if (plugin_output_filename) -+ return plugin_output; - } - - /* Determine the output file name. */ -@@ -1763,9 +1817,9 @@ - - if (lang_index >= 0) - return base_files[lang_index]; -- -+ - output_name = "gtype-desc.c"; -- for_name = NULL; -+ for_name = "GCC"; - } - - /* Look through to see if we've ever seen this output filename before. */ -@@ -1832,6 +1886,9 @@ - fatal ("writing output file %s: %s", of->name, strerror (errno)); - if (fclose (newfile) != 0) - fatal ("closing output file %s: %s", of->name, strerror (errno)); -+ free(of->buf); -+ of->buf = NULL; -+ of->bufused = of->buflength = 0; - } - } - -@@ -1864,6 +1921,7 @@ - const char *reorder_note_routine; - const char *comment; - int skip_hooks; /* skip hook generation if non zero */ -+ int is_pch; /* set for PCH stuff to output ifndef */ - }; - - static void output_escaped_param (struct walk_type_data *d, -@@ -1873,6 +1931,7 @@ - static void write_func_for_structure - (type_p orig_s, type_p s, type_p * param, - const struct write_types_data *wtd); -+static void delay_func_for_structure (type_p s, const struct write_types_data* wtd); - static void write_types_process_field - (type_p f, const struct walk_type_data *d); - static void write_types (type_p structures, -@@ -2587,6 +2646,8 @@ - } - oprintf (d.of, " (void *x_p)\n"); - oprintf (d.of, "{\n"); -+ if (plugin_output && d.of == plugin_output && wtd->is_pch) -+ oprintf (d.of, "#ifdef GCC_PLUGIN_HAVE_PCH\n"); - oprintf (d.of, " %s %s * %sx = (%s %s *)x_p;\n", - s->kind == TYPE_UNION ? "union" : "struct", s->u.s.tag, - chain_next == NULL ? "const " : "", -@@ -2691,6 +2752,8 @@ - oprintf (d.of, " }\n"); - if (chain_circular != NULL) - oprintf (d.of, " while (x != xlimit);\n"); -+ if (plugin_output && d.of == plugin_output && wtd->is_pch) -+ oprintf (d.of, "/* end ifdef GCC_PLUGIN_HAVE_PCH*/\n#endif\n"); - oprintf (d.of, "}\n"); - } - -@@ -2701,8 +2764,9 @@ - const struct write_types_data *wtd) - { - type_p s; -- -- oprintf (header_file, "\n/* %s*/\n", wtd->comment); -+ outf_p outheadf = plugin_output_filename ? plugin_output : header_file; -+ -+ oprintf (outheadf, "\n/* %s*/\n", wtd->comment); - for (s = structures; s; s = s->next) - if (s->gc_used == GC_POINTED_TO - || s->gc_used == GC_MAYBE_POINTED_TO) -@@ -2713,13 +2777,13 @@ - && s->u.s.line.file == NULL) - continue; - -- oprintf (header_file, "#define gt_%s_", wtd->prefix); -- output_mangled_typename (header_file, s); -- oprintf (header_file, "(X) do { \\\n"); -- oprintf (header_file, -+ oprintf (outheadf, "#define gt_%s_", wtd->prefix); -+ output_mangled_typename (outheadf, s); -+ oprintf (outheadf, "(X) do { \\\n"); -+ oprintf (outheadf, - " if (X != NULL) gt_%sx_%s (X);\\\n", wtd->prefix, - s->u.s.tag); -- oprintf (header_file, -+ oprintf (outheadf, - " } while (0)\n"); - - for (opt = s->u.s.opt; opt; opt = opt->next) -@@ -2729,7 +2793,7 @@ - if (t->kind == TYPE_STRUCT - || t->kind == TYPE_UNION - || t->kind == TYPE_LANG_STRUCT) -- oprintf (header_file, -+ oprintf (outheadf, - "#define gt_%sx_%s gt_%sx_%s\n", - wtd->prefix, s->u.s.tag, wtd->prefix, t->u.s.tag); - else -@@ -2741,7 +2805,7 @@ - continue; - - /* Declare the marker procedure only once. */ -- oprintf (header_file, -+ oprintf (outheadf, - "extern void gt_%sx_%s (void *);\n", - wtd->prefix, s->u.s.tag); - -@@ -2752,7 +2816,10 @@ - continue; - } - -- if (s->kind == TYPE_LANG_STRUCT) -+ /* in plugin mode, the write_func_for_structure should be delayed */ -+ if (nb_plugin_files > 0 && plugin_output_filename) -+ delay_func_for_structure (s, wtd); -+ else if (s->kind == TYPE_LANG_STRUCT) - { - type_p ss; - for (ss = s->u.s.lang_struct; ss; ss = ss->next) -@@ -2769,9 +2836,9 @@ - type_p stru = s->u.param_struct.stru; - - /* Declare the marker procedure. */ -- oprintf (header_file, "extern void gt_%s_", wtd->prefix); -- output_mangled_typename (header_file, s); -- oprintf (header_file, " (void *);\n"); -+ oprintf (outheadf, "extern void gt_%s_", wtd->prefix); -+ output_mangled_typename (outheadf, s); -+ oprintf (outheadf, " (void *);\n"); - - if (stru->u.s.line.file == NULL) - { -@@ -2795,6 +2862,7 @@ - { - "ggc_m", NULL, "ggc_mark", "ggc_test_and_set_mark", NULL, - "GC marker procedures. ", -+ FALSE, - FALSE - }; - -@@ -2803,6 +2871,7 @@ - "pch_n", "pch_p", "gt_pch_note_object", "gt_pch_note_object", - "gt_pch_note_reorder", - "PCH type-walking procedures. ", -+ TRUE, - TRUE - }; - -@@ -2875,11 +2944,15 @@ - "\tATTRIBUTE_UNUSED gt_pointer_operator op,\n" - "\tATTRIBUTE_UNUSED void *cookie)\n"); - oprintf (d.of, "{\n"); -+ if (plugin_output && d.of == plugin_output) -+ oprintf (d.of, "#ifdef GCC_PLUGIN_HAVE_PCH\n"); - oprintf (d.of, " %s %s * const x ATTRIBUTE_UNUSED = (%s %s *)x_p;\n", - s->kind == TYPE_UNION ? "union" : "struct", s->u.s.tag, - s->kind == TYPE_UNION ? "union" : "struct", s->u.s.tag); - d.indent = 2; - walk_type (s, &d); -+ if (plugin_output && d.of == plugin_output) -+ oprintf (d.of, "/* end ifdef GCC_PLUGIN_HAVE_PCH */\n#endif\n"); - oprintf (d.of, "}\n"); - } - -@@ -2888,11 +2961,13 @@ - static void - write_local (type_p structures, type_p param_structs) - { -+ outf_p outheadf = plugin_output_filename ? plugin_output : header_file; -+ - type_p s; - -- if (!header_file) -+ if (!outheadf) - return; -- oprintf (header_file, "\n/* Local pointer-walking routines. */\n"); -+ oprintf (outheadf, "\n/* Local pointer-walking routines. */\n"); - for (s = structures; s; s = s->next) - if (s->gc_used == GC_POINTED_TO - || s->gc_used == GC_MAYBE_POINTED_TO) -@@ -2910,11 +2985,11 @@ - || t->kind == TYPE_UNION - || t->kind == TYPE_LANG_STRUCT) - { -- oprintf (header_file, "#define gt_pch_p_"); -- output_mangled_typename (header_file, s); -- oprintf (header_file, " gt_pch_p_"); -- output_mangled_typename (header_file, t); -- oprintf (header_file, "\n"); -+ oprintf (outheadf, "#define gt_pch_p_"); -+ output_mangled_typename (outheadf, s); -+ oprintf (outheadf, " gt_pch_p_"); -+ output_mangled_typename (outheadf, t); -+ oprintf (outheadf, "\n"); - } - else - error_at_line (&s->u.s.line, -@@ -2925,9 +3000,9 @@ - continue; - - /* Declare the marker procedure only once. */ -- oprintf (header_file, "extern void gt_pch_p_"); -- output_mangled_typename (header_file, s); -- oprintf (header_file, -+ oprintf (outheadf, "extern void gt_pch_p_"); -+ output_mangled_typename (outheadf, s); -+ oprintf (outheadf, - "\n (void *, void *, gt_pointer_operator, void *);\n"); - - if (s->kind == TYPE_LANG_STRUCT) -@@ -2947,9 +3022,9 @@ - type_p stru = s->u.param_struct.stru; - - /* Declare the marker procedure. */ -- oprintf (header_file, "extern void gt_pch_p_"); -- output_mangled_typename (header_file, s); -- oprintf (header_file, -+ oprintf (outheadf, "extern void gt_pch_p_"); -+ output_mangled_typename (outheadf, s); -+ oprintf (outheadf, - "\n (void *, void *, gt_pointer_operator, void *);\n"); - - if (stru->u.s.line.file == NULL) -@@ -2970,17 +3045,60 @@ - } - } - --/* Write out the 'enum' definition for gt_types_enum. */ -+/* Write out only to header_file the 'enum' definition for gt_types_enum. */ - - static void - write_enum_defn (type_p structures, type_p param_structs) - { -- type_p s; -- -+ type_p s = NULL; -+ /* in plugin mode, define dynamically the enumeration values */ -+ if (plugin_output) -+ { -+ int cnt = 0; -+ oprintf (plugin_output, "\n/* Dynamic enumeration of plugin types. */\n"); -+ oprintf (plugin_output, "#ifdef GCC_PLUGIN_HAVE_PCH\n"); -+ oprintf (plugin_output, "static int gccplugin_type_base;\n"); -+ -+ for (s = structures; s; s = s->next) -+ { -+ if (!s->inplugin) -+ continue; -+ if (s->gc_used == GC_POINTED_TO -+ || s->gc_used == GC_MAYBE_POINTED_TO) -+ { -+ if (s->gc_used == GC_MAYBE_POINTED_TO -+ && s->u.s.line.file == NULL) -+ continue; -+ oprintf (plugin_output, "#define gt_ggc_e_"); -+ output_mangled_typename (plugin_output, s); -+ oprintf (plugin_output, -+ " ((gccplugin_type_base>0)?(gccplugin_type_base+%d):0)\n", -+ cnt); -+ cnt++; -+ } -+ } -+ for (s = param_structs; s; s = s->next) -+ if (s->gc_used == GC_POINTED_TO && s->inplugin) -+ { -+ oprintf (plugin_output, "#define gt_e_"); -+ output_mangled_typename (plugin_output, s); -+ oprintf (plugin_output, -+ " ((gccplugin_type_base>0)?(gccplugin_type_base+%d):0)\n", -+ cnt); -+ cnt++; -+ } -+ oprintf (plugin_output, -+ "\n#define GCCPLUGIN_TYPE_COUNT %d\n", cnt); -+ oprintf (plugin_output, "/* end ifdef GCC_PLUGIN_HAVE_PCH */\n#endif\n"); -+ return; -+ } -+ -+ /* write only to header_file */ - if (!header_file) - return; -- oprintf (header_file, "\n/* Enumeration of types known. */\n"); -+ oprintf (header_file, "\n/* Enumeration of known types. */\n"); - oprintf (header_file, "enum gt_types_enum {\n"); -+ oprintf (header_file, " gt_types_enum_firstempty,\n"); - for (s = structures; s; s = s->next) - if (s->gc_used == GC_POINTED_TO - || s->gc_used == GC_MAYBE_POINTED_TO) -@@ -3332,12 +3450,15 @@ - - for (v = variables; v; v = v->next) - { -- outf_p f = get_output_file_with_visibility (v->line.file); -+ outf_p f = NULL; - struct flist *fli; - const char *length = NULL; - int deletable_p = 0; - options_p o; -- -+ if (nb_plugin_files > 0 && plugin_output_filename && v->inplugin) -+ f = plugin_output; -+ else -+ f = get_output_file_with_visibility (v->line.file); - for (o = v->opt; o; o = o->next) - if (strcmp (o->name, "length") == 0) - length = o->info; -@@ -3629,6 +3750,74 @@ - do_typedef (astratname, new_structure (astratname, 0, pos, field, 0), pos); - } - -+ -+/* in plugin mode, the write of functions for structure is delayed to -+ the end; we keep a vector of these */ -+struct delayedstructfunc_st -+{ -+ type_p dly_s; -+ const struct write_types_data* dly_wtd; -+}; -+static struct delayedstructfunc_st* dlystructab; -+static int dlystructsiz; -+static int dlystructcnt; -+ -+ -+ -+ -+static void -+delay_func_for_structure (type_p s, const struct write_types_data* wtd) -+{ -+ gcc_assert (s != NULL); -+ gcc_assert (wtd != NULL); -+ if (dlystructcnt + 1 >= dlystructsiz) -+ { -+ struct delayedstructfunc_st* oldtab = dlystructab; -+ int oldsiz = dlystructsiz; -+ int newsiz = (32 + oldsiz) * 2; -+ int i = 0; -+ gcc_assert (newsiz > dlystructcnt); -+ dlystructab = XNEWVEC(struct delayedstructfunc_st, newsiz); -+ for (i = 0; i < dlystructcnt; i++) -+ dlystructab[i] = oldtab[i]; -+ for (i = dlystructcnt; i < newsiz; i++) -+ { -+ dlystructab[i].dly_s = NULL; -+ dlystructab[i].dly_wtd = NULL; -+ } -+ dlystructsiz = newsiz; -+ free (oldtab); -+ } -+ dlystructab[dlystructcnt].dly_s = s; -+ dlystructab[dlystructcnt].dly_wtd = wtd; -+ dlystructcnt++; -+} -+ -+ -+static void -+output_delayed_functions(void) -+{ -+ int i = 0; -+ gcc_assert (plugin_output); -+ for (i = 0; ikind == TYPE_LANG_STRUCT) -+ { -+ type_p ss; -+ for (ss = s->u.s.lang_struct; ss; ss = ss->next) -+ write_func_for_structure (s, ss, NULL, wtd); -+ } -+ else -+ write_func_for_structure (s, s, NULL, wtd); -+ } -+ free (dlystructab); -+ dlystructab = NULL; -+ dlystructcnt = dlystructsiz = 0; -+} -+ - - int - main (int argc, char **argv) -@@ -3639,20 +3828,23 @@ - /* fatal uses this */ - progname = "gengtype"; - -- if (argc >= 5 && !strcmp (argv[1], "-p")) -+ if (argc >= 6 && !strcmp (argv[1], "-P")) - { -- srcdir = argv[2]; -- inputlist = argv[3]; -- plugin_files = argv+4; -- nb_plugin_files = argc-4; -+ plugin_output_filename = argv[2]; -+ plugin_output = create_file ("GCC", plugin_output_filename); -+ srcdir = argv[3]; -+ inputlist = argv[4]; -+ plugin_files = argv + 5; -+ nb_plugin_files = argc - 5; - } -+ - else if (argc == 3) - { - srcdir = argv[1]; - inputlist = argv[2]; - } - else -- fatal ("usage: gengtype [-p] srcdir input-list [file1 file2 ... fileN]"); -+ fatal ("usage: gengtype [-P pluginout.h] srcdir input-list [file1 file2 ... fileN]"); - - srcdir_len = strlen (srcdir); - -@@ -3678,9 +3870,14 @@ - do_scalar_typedef ("void", &pos); pos.line++; - do_typedef ("PTR", create_pointer (resolve_typedef ("void", &pos)), &pos); - -- for (i = 0; i < num_gt_files; i++) -- parse_file (gt_files[i]); -- -+ for (i = 0; i < num_gt_files; i++) -+ { -+ is_plugin_file = first_plugin_file_ix >= 0 -+ && (int)i >= first_plugin_file_ix; -+ parse_file (gt_files[i]); -+ is_plugin_file = false; -+ } -+ - if (hit_error) - return 1; - -@@ -3693,6 +3890,10 @@ - write_local (structures, param_structs); - write_roots (variables); - write_rtx_next (); -+ -+ if (plugin_output) -+ output_delayed_functions (); -+ - close_output_files (); - - if (hit_error) -Index: lto/gcc/gengtype.h -=================================================================== ---- lto.orig/gcc/gengtype.h 2009-09-01 00:16:27.942856818 +0200 -+++ lto/gcc/gengtype.h 2009-09-01 10:21:15.728775623 +0200 -@@ -76,6 +76,9 @@ - extern void parse_file (const char *name); - extern bool hit_error; - -+/* flag set when parsing a plugin file */ -+extern bool is_plugin_file; -+ - /* Token codes. */ - enum { - EOF_TOKEN = 0, From daniel at zuster.org Mon Sep 14 10:27:43 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 14 Sep 2009 15:27:43 -0000 Subject: [llvm-commits] [llvm] r81764 - /llvm/trunk/test/Makefile Message-ID: <200909141527.n8EFRiqq018327@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 14 10:27:43 2009 New Revision: 81764 URL: http://llvm.org/viewvc/llvm-project?rev=81764&view=rev Log: Add a VALGRIND_EXTRA_ARGS makefile variable, with the obvious semantics. Modified: llvm/trunk/test/Makefile Modified: llvm/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?rev=81764&r1=81763&r2=81764&view=diff ============================================================================== --- llvm/trunk/test/Makefile (original) +++ llvm/trunk/test/Makefile Mon Sep 14 10:27:43 2009 @@ -43,7 +43,7 @@ endif ifdef VG -VALGRIND := valgrind --tool=memcheck --quiet --trace-children=yes --error-exitcode=3 --leak-check=full +VALGRIND := valgrind --tool=memcheck --quiet --trace-children=yes --error-exitcode=3 --leak-check=full $(VALGRIND_EXTRA_ARGS) endif IGNORE_TESTS := From baldrick at free.fr Mon Sep 14 10:44:04 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Sep 2009 15:44:04 -0000 Subject: [llvm-commits] [gcc-plugin] r81765 - /gcc-plugin/trunk/Makefile Message-ID: <200909141544.n8EFi46a020800@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 14 10:44:04 2009 New Revision: 81765 URL: http://llvm.org/viewvc/llvm-project?rev=81765&view=rev Log: Don't remove gt-llvm-cache.h when doing "make clean" now that we distribute this file rather than always generating it. Modified: gcc-plugin/trunk/Makefile Modified: gcc-plugin/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/Makefile?rev=81765&r1=81764&r2=81765&view=diff ============================================================================== --- gcc-plugin/trunk/Makefile (original) +++ gcc-plugin/trunk/Makefile Mon Sep 14 10:44:04 2009 @@ -40,4 +40,4 @@ sed -i "s/ggc_root_tab .*\[\]/ggc_root_tab gt_pch_rc__gt_llvm_cache_h[]/" $(GENGTYPE_OUTPUT) clean:: - rm -f *.o *.so $(ARCH_DIR)/*.o $(GENGTYPE_OUTPUT) + rm -f *.o *.so $(ARCH_DIR)/*.o From gohman at apple.com Mon Sep 14 10:54:19 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Sep 2009 08:54:19 -0700 Subject: [llvm-commits] Static Profile Patch In-Reply-To: References: Message-ID: <030E9AA3-1AF1-433F-8807-9628E7155939@apple.com> Hi Andrei, Here are some review comments for this patch. I think it would be fine to check into the tree at this point, so that future changes can be reviewed incrementally instead of with monolithic patches. BranchPredictionPass has double getEdgeProbability(Edge &edge) const; as a public member function, but Edge is a private typedef, so one of these has the wrong visibility. The passes should override the Pass::releaseMemory virtual function. Some currently have a Clear member function; they should implement releaseMemory and have it call Clear, or perhaps Clear should be renamed releaseMemory, depending on how it's used. lib/Analysis/BranchPredictionPass.cpp has #include "llvm/Transforms/Utils/BasicBlockUtils.h" which is a red flag because lib/Analysis code is not allowed to depend on lib/Transforms code. However, this #include appears to be unneeded, so it should be removed. BranchHeuristicsInfo::MatchCallHeuristic and some of the others don't test whether the terminator is a BranchInst. It looks like there's nothing preventing them from analyzing a block with an InvokeInst as its terminator. Is that intended by the heuristics? BranchHeuristicsInfo::postDominates calls PostDominatorTree::properlyDominates. Since the distinction between domination and proper domination is often both subtle and critical for algorithm correctness, please either rename this function or add comments or both. BranchPredictionInfo::FindBackEdges does a DominatorTree query for every edge in the function. It would be possible to get a close approximation of this using LoopInfo. That would miss unnatural loops and spaghetti code though; is that the reason for doing the full traversal? Please add a comment about this. BranchPredictionInfo::FindExitEdges seems to be redundant with Loop::getExitEdges. Could BranchPredictionInfo::FindStores and FindCalls be combined to avoid doing so many function traversals? In its current form, BranchPredictionPass won't be usable in LLVM's default optimization pipeline because it requires post-dominator tree construction. None of LLVM's current default optimization passes require post-dominator trees, so constructing it just for this pass will likely be too slow. It could possibly be justified for -O3, if there are sufficient benefits to oughtweigh the costs. There are many LLVM users that don't use the standard -O2 or -O3 passes also, of course. Dan On Sep 11, 2009, at 6:46 PM, Andrei Alvares wrote: > Hello everyone, > Since this patch hasn't been applied yet, I'm taking the liberty > to send a more updated version. I made several changes in the branch > predictor (BranchPredictionPass) and in the intra procedural static > profiler (BlockEdgeFrequencyPass). > Attachment: stprof-11.09.09.patch. > > While I was debbuging the code, I've noticed that I was > maintaining data across multiple calls of runOnFunction on both > passes, which was indeed an undesirable behavior. After cleaning up, > both passes shown improved results. In fact, the branch predictor > produced very close related prediction as Ball's predictor. I ran > the branch predictor on the SPEC 2000 (int and float). I'm attaching > "heuristics.txt" which compared results separated by heuristic for > both predictors. While most heuristics predicted more accurately, > the call and opcode heuristics shown worst results. This means that > is still space for improvements. Also, I've found a bug in the way > the predictor threats a branch that have some backedge sucessors, > but not all. I expected that the other branches were always exit > edges, but there are cases that this situation is not true. > > Moreover, while calculating blocks and edge frequencies it is > possible to verify if it is calculating correct frequency > information. Since the entry block frequency is always one, is > expected that the exit's total frequency is also one. So, all we > need to do is check the sum of all predecessors edges of exit's > basic blocks to match one. However, I've found two cases of > miscalculation by the pass: (1) when the control flow graph is not > reducible; (2) when seems to be a loop that does not terminates (has > no exit blocks). Although this pass can calculate frequencies for > those situations, it might not be accurate. Nevertheless, seems like > the pass is doing what is supposed to. > > The global static profiler (inter procedural) is not as accurate > as Wu's paper yet. But after those fixes, it has improved quite > significantly. I'm attaching the results of the profiler comparing > the correct prediction rate of the top most executed blocks, edges, > and function call invocations (ranging from 10% to 50%). > Attachments: block.txt, edge.txt and call.txt. > > Thanks, > Andrei > > On Wed, Sep 2, 2009 at 3:37 PM, Andrei Alvares > wrote: > Hello everyone, > Here it follows the static profiler implementation, developed as > part of my google summer of code project. It performs branch > predictions in compilation time, i.e., assign probabilities to branch > outcomes using a set of predefined heuristics. Also, it calculates > intra and interprocedural profiling by staticly estimate basic blocks > and edges frequencies (local and global) and function call invocations > frequencies. > Attachment: stprof-02.02.09.patch > > I've run the static profiler on some of the SPECint 2000 programs > (those that I was able to compile and run). It has not yet achieved > the accuracy found in Wu's paper, but I believe it can still be > improved. > Best regards, > Andrei > > Youfeng Wu and James R. Larus. Static branch frequency and program > profile analysis. In MICRO 27: Proceedings of the 27th annual > international symposium on Microarchitecture. IEEE, 1994. > > < > heuristics > .txt > > > < > blocks > .txt > > > < > edge > .txt > > > < > call > .txt > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From daniel at zuster.org Mon Sep 14 11:10:32 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 14 Sep 2009 16:10:32 -0000 Subject: [llvm-commits] [llvm] r81766 - in /llvm/trunk/utils/valgrind: ./ x86_64-pc-linux-gnu_gcc-4.3.3.supp Message-ID: <200909141610.n8EGAWdQ024254@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 14 11:10:32 2009 New Revision: 81766 URL: http://llvm.org/viewvc/llvm-project?rev=81766&view=rev Log: Add a valgrind suppressions file for x86_64/linux/4.3.3. Added: llvm/trunk/utils/valgrind/ llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp Added: llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp?rev=81766&view=auto ============================================================================== --- llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp (added) +++ llvm/trunk/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp Mon Sep 14 11:10:32 2009 @@ -0,0 +1,23 @@ +{ + libstdcxx_overlapped_memcpy_in_stable_sort_1 + Memcheck:Overlap + fun:memcpy + ... + fun:_ZSt11stable_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIPKN4llvm5ValueEjESt6vectorIS7_SaIS7_EEEEN12_GLOBAL__N_116CstSortPredicateEEvT_SF_T0_ +} + +{ + libstdcxx_overlapped_memcpy_in_stable_sort_2 + Memcheck:Overlap + fun:memcpy + ... + fun:_ZSt11stable_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIPKN4llvm5ValueEjESt6vectorIS7_SaIS7_EEEEN12_GLOBAL__N_116CstSortPredicateEEvT_SF_T0_ +} + +{ + libstdcxx_overlapped_memcpy_in_stable_sort_3 + Memcheck:Overlap + fun:memcpy + ... + fun:_ZSt11stable_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIPKN4llvm4TypeEjESt6vectorIS7_SaIS7_EEEEPFbRKS7_SE_EEvT_SH_T0_ +} From echristo at apple.com Mon Sep 14 11:38:49 2009 From: echristo at apple.com (Eric Christopher) Date: Mon, 14 Sep 2009 16:38:49 -0000 Subject: [llvm-commits] [llvm] r81768 - in /llvm/trunk: autoconf/configure.ac configure Message-ID: <200909141638.n8EGcoZJ028249@zion.cs.uiuc.edu> Author: echristo Date: Mon Sep 14 11:38:49 2009 New Revision: 81768 URL: http://llvm.org/viewvc/llvm-project?rev=81768&view=rev Log: Enable the jit for llvm-config. Patch by Xerxes R?nby! Modified: llvm/trunk/autoconf/configure.ac llvm/trunk/configure Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=81768&r1=81767&r2=81768&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Mon Sep 14 11:38:49 2009 @@ -396,7 +396,7 @@ PowerPC) AC_SUBST(TARGET_HAS_JIT,1) ;; x86_64) AC_SUBST(TARGET_HAS_JIT,1) ;; Alpha) AC_SUBST(TARGET_HAS_JIT,1) ;; - ARM) AC_SUBST(TARGET_HAS_JIT,0) ;; + ARM) AC_SUBST(TARGET_HAS_JIT,1) ;; Mips) AC_SUBST(TARGET_HAS_JIT,0) ;; PIC16) AC_SUBST(TARGET_HAS_JIT,0) ;; XCore) AC_SUBST(TARGET_HAS_JIT,0) ;; Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=81768&r1=81767&r2=81768&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Mon Sep 14 11:38:49 2009 @@ -4902,7 +4902,7 @@ ;; Alpha) TARGET_HAS_JIT=1 ;; - ARM) TARGET_HAS_JIT=0 + ARM) TARGET_HAS_JIT=1 ;; Mips) TARGET_HAS_JIT=0 ;; From sabre at nondot.org Mon Sep 14 11:49:26 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Sep 2009 16:49:26 -0000 Subject: [llvm-commits] [llvm] r81770 - /llvm/trunk/lib/Target/README.txt Message-ID: <200909141649.n8EGnQnb029947@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 14 11:49:26 2009 New Revision: 81770 URL: http://llvm.org/viewvc/llvm-project?rev=81770&view=rev Log: add PR# Modified: llvm/trunk/lib/Target/README.txt Modified: llvm/trunk/lib/Target/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/README.txt?rev=81770&r1=81769&r2=81770&view=diff ============================================================================== --- llvm/trunk/lib/Target/README.txt (original) +++ llvm/trunk/lib/Target/README.txt Mon Sep 14 11:49:26 2009 @@ -1653,6 +1653,7 @@ Instcombine should be able to optimize away the loads (and thus the globals). +See also PR4973 //===---------------------------------------------------------------------===// From baldrick at free.fr Mon Sep 14 12:19:46 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Sep 2009 17:19:46 -0000 Subject: [llvm-commits] [gcc-plugin] r81772 - /gcc-plugin/trunk/llvm-backend.cpp Message-ID: <200909141719.n8EHJkBF001549@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 14 12:19:45 2009 New Revision: 81772 URL: http://llvm.org/viewvc/llvm-project?rev=81772&view=rev Log: Turn off a bunch more GCC optimizations (there are more we might want to turn off, but this is most of them). In particular, by turning off function cloning this works around GCC bug 41355, which was firing an assertion in EmitCallOf. With these changes sqlite3 compiles at all optimization levels. Modified: gcc-plugin/trunk/llvm-backend.cpp Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=81772&r1=81771&r2=81772&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Mon Sep 14 12:19:45 2009 @@ -1992,6 +1992,32 @@ } }; +/// pass_ipa_null - IPA pass that does nothing. +static struct ipa_opt_pass_d pass_ipa_null = { + { + IPA_PASS, + NULL, /* name */ + gate_null, /* gate */ + NULL, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_NONE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0 /* todo_flags_finish */ + }, + NULL, /* generate_summary */ + NULL, /* write_summary */ + NULL, /* read_summary */ + NULL, /* function_read_summary */ + 0, /* TODOs */ + NULL, /* function_transform */ + NULL /* variable_transform */ +}; + /// pass_rtl_null - RTL pass that does nothing. static struct rtl_opt_pass pass_rtl_null = { @@ -2012,6 +2038,26 @@ } }; +/// pass_simple_ipa_null - Simple IPA pass that does nothing. +static struct simple_ipa_opt_pass pass_simple_ipa_null = +{ + { + SIMPLE_IPA_PASS, + NULL, /* name */ + gate_null, /* gate */ + NULL, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_NONE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0 /* todo_flags_finish */ + } +}; + // Garbage collector roots. extern const struct ggc_cache_tab gt_ggc_rc__gt_llvm_cache_h[]; @@ -2114,6 +2160,85 @@ // TODO: figure out a good way of turning off ipa optimization passes. // Could just set optimize to zero (after taking a copy), but this would // also impact front-end optimizations. + + // Turn off pass_ipa_early_inline. + pass_info.pass = &pass_simple_ipa_null.pass; + pass_info.reference_pass_name = "einline_ipa"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_all_early_optimizations. + pass_info.pass = &pass_gimple_null.pass; + pass_info.reference_pass_name = "early_optimizations"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_increase_alignment. + pass_info.pass = &pass_simple_ipa_null.pass; + pass_info.reference_pass_name = "increase_alignment"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_matrix_reorg. + pass_info.pass = &pass_simple_ipa_null.pass; + pass_info.reference_pass_name = "matrix-reorg"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_cp. + pass_info.pass = &pass_ipa_null.pass; + pass_info.reference_pass_name = "cp"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_inline. + pass_info.pass = &pass_ipa_null.pass; + pass_info.reference_pass_name = "inline"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_reference. + pass_info.pass = &pass_ipa_null.pass; + pass_info.reference_pass_name = "static-var"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_pure_const. + pass_info.pass = &pass_ipa_null.pass; + pass_info.reference_pass_name = "pure-const"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_type_escape. + pass_info.pass = &pass_simple_ipa_null.pass; + pass_info.reference_pass_name = "type-escape-var"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_pta. + pass_info.pass = &pass_simple_ipa_null.pass; + pass_info.reference_pass_name = "pta"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_ipa_struct_reorg. + pass_info.pass = &pass_simple_ipa_null.pass; + pass_info.reference_pass_name = "ipa_struct_reorg"; + pass_info.ref_pass_instance_number = 0; + pass_info.pos_op = PASS_POS_REPLACE; + register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info); + + // Turn off pass_all_optimizations. pass_info.pass = &pass_gimple_null.pass; pass_info.reference_pass_name = "*all_optimizations"; pass_info.ref_pass_instance_number = 0; From grosbach at apple.com Mon Sep 14 12:27:35 2009 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 14 Sep 2009 17:27:35 -0000 Subject: [llvm-commits] [llvm] r81773 - /llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Message-ID: <200909141727.n8EHRa2X002525@zion.cs.uiuc.edu> Author: grosbach Date: Mon Sep 14 12:27:35 2009 New Revision: 81773 URL: http://llvm.org/viewvc/llvm-project?rev=81773&view=rev Log: trivial whitespace cleanup Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=81773&r1=81772&r2=81773&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Mon Sep 14 12:27:35 2009 @@ -28,7 +28,7 @@ cl::desc("Disable if-conversion pass")); static const MCAsmInfo *createMCAsmInfo(const Target &T, - const StringRef &TT) { + const StringRef &TT) { Triple TheTriple(TT); switch (TheTriple.getOS()) { case Triple::Darwin: @@ -43,7 +43,7 @@ // Register the target. RegisterTargetMachine X(TheARMTarget); RegisterTargetMachine Y(TheThumbTarget); - + // Register the target asm info. RegisterAsmInfoFn A(TheARMTarget, createMCAsmInfo); RegisterAsmInfoFn B(TheThumbTarget, createMCAsmInfo); From gohman at apple.com Mon Sep 14 15:40:10 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Sep 2009 20:40:10 -0000 Subject: [llvm-commits] [llvm] r81782 - /llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h Message-ID: <200909142040.n8EKeAeI028387@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 14 15:40:10 2009 New Revision: 81782 URL: http://llvm.org/viewvc/llvm-project?rev=81782&view=rev Log: Update a comment to match the source. PseudoSourceValues are now obtained via accessor functions. Modified: llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h Modified: llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h?rev=81782&r1=81781&r2=81782&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h Mon Sep 14 15:40:10 2009 @@ -51,10 +51,13 @@ MachineMemOperand(const Value *v, unsigned int f, int64_t o, uint64_t s, unsigned int a); - /// getValue - Return the base address of the memory access. - /// Special values are PseudoSourceValue::FPRel, PseudoSourceValue::SPRel, - /// and the other PseudoSourceValue members which indicate references to - /// frame/stack pointer relative references and other special references. + /// getValue - Return the base address of the memory access. This may either + /// be a normal LLVM IR Value, or one of the special values used in CodeGen. + /// Special values are those obtained via + /// PseudoSourceValue::getFixedStack(int), PseudoSourceValue::getStack, and + /// other PseudoSourceValue member functions which return objects which stand + /// for frame/stack pointer relative references and other special references + /// which are not representable in the high-level IR. const Value *getValue() const { return V; } /// getFlags - Return the raw flags of the source value, \see MemOperandFlags. From isanbard at gmail.com Mon Sep 14 15:52:38 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 14 Sep 2009 20:52:38 -0000 Subject: [llvm-commits] [llvm] r81785 - /llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Message-ID: <200909142052.n8EKqcK0030132@zion.cs.uiuc.edu> Author: void Date: Mon Sep 14 15:52:37 2009 New Revision: 81785 URL: http://llvm.org/viewvc/llvm-project?rev=81785&view=rev Log: Pull the creation of the "RewindFunction" function out of the loop. It's only created once, so shouldn't be stuck in the middle of the loop. Also early exit if there are no uses of UnwindInst in the function. Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp?rev=81785&r1=81784&r2=81785&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Mon Sep 14 15:52:37 2009 @@ -219,29 +219,40 @@ /// at runtime if there is no such exception: using unwind to throw a new /// exception is currently not supported. bool DwarfEHPrepare::LowerUnwinds() { - bool Changed = false; + SmallVector UnwindInsts; for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) { TerminatorInst *TI = I->getTerminator(); - if (!isa(TI)) - continue; + if (isa(TI)) + UnwindInsts.push_back(TI); + } + + if (UnwindInsts.empty()) return false; + + // Find the rewind function if we didn't already. + if (!RewindFunction) { + LLVMContext &Ctx = UnwindInsts[0]->getContext(); + std::vector + Params(1, PointerType::getUnqual(Type::getInt8Ty(Ctx))); + FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx), + Params, false); + const char *RewindName = TLI->getLibcallName(RTLIB::UNWIND_RESUME); + RewindFunction = F->getParent()->getOrInsertFunction(RewindName, FTy); + } + + bool Changed = false; + + for (SmallVectorImpl::iterator + I = UnwindInsts.begin(), E = UnwindInsts.end(); I != E; ++I) { + TerminatorInst *TI = *I; // Replace the unwind instruction with a call to _Unwind_Resume (or the // appropriate target equivalent) followed by an UnreachableInst. - // Find the rewind function if we didn't already. - if (!RewindFunction) { - std::vector Params(1, - PointerType::getUnqual(Type::getInt8Ty(TI->getContext()))); - FunctionType *FTy = FunctionType::get(Type::getVoidTy(TI->getContext()), - Params, false); - const char *RewindName = TLI->getLibcallName(RTLIB::UNWIND_RESUME); - RewindFunction = F->getParent()->getOrInsertFunction(RewindName, FTy); - } - // Create the call... CallInst *CI = CallInst::Create(RewindFunction, - CreateReadOfExceptionValue(I), "", TI); + CreateReadOfExceptionValue(TI->getParent()), + "", TI); CI->setCallingConv(TLI->getLibcallCallingConv(RTLIB::UNWIND_RESUME)); // ...followed by an UnreachableInst. new UnreachableInst(TI->getContext(), TI); From echristo at apple.com Mon Sep 14 16:13:49 2009 From: echristo at apple.com (Eric Christopher) Date: Mon, 14 Sep 2009 21:13:49 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r81788 - /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C Message-ID: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> Author: echristo Date: Mon Sep 14 16:13:49 2009 New Revision: 81788 URL: http://llvm.org/viewvc/llvm-project?rev=81788&view=rev Log: Update this test, the except table is now in the data section. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/eh1.C?rev=81788&r1=81787&r2=81788&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C Mon Sep 14 16:13:49 2009 @@ -1,6 +1,6 @@ -/* APPLE LOCAL file EH __TEXT __gcc_except_tab 5819051 */ +/* APPLE LOCAL file EH __DATA __gcc_except_tab 5819051 */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-final { scan-assembler "section __TEXT,__gcc_except_tab" } } */ +/* { dg-final { scan-assembler "__DATA,__gcc_except_tab" } } */ /* Radar 5819051 */ #include From clattner at apple.com Mon Sep 14 16:31:59 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Sep 2009 14:31:59 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r81788 - /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C In-Reply-To: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> References: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> Message-ID: On Sep 14, 2009, at 2:13 PM, Eric Christopher wrote: > Author: echristo > Date: Mon Sep 14 16:13:49 2009 > New Revision: 81788 > > URL: http://llvm.org/viewvc/llvm-project?rev=81788&view=rev > Log: > Update this test, the except table is now in the data section. But that is a "bug", so we want the test to continue failing? -Chris > > Modified: > llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C > > Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/eh1.C?rev=81788&r1=81787&r2=81788&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C (original) > +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C Mon Sep 14 > 16:13:49 2009 > @@ -1,6 +1,6 @@ > -/* APPLE LOCAL file EH __TEXT __gcc_except_tab 5819051 */ > +/* APPLE LOCAL file EH __DATA __gcc_except_tab 5819051 */ > /* { dg-do compile { target *-*-darwin* } } */ > -/* { dg-final { scan-assembler "section > __TEXT,__gcc_except_tab" } } */ > +/* { dg-final { scan-assembler "__DATA,__gcc_except_tab" } } */ > /* Radar 5819051 */ > > #include > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Mon Sep 14 16:33:43 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 14 Sep 2009 21:33:43 -0000 Subject: [llvm-commits] [llvm] r81796 - in /llvm/trunk: include/llvm/CodeGen/LiveInterval.h include/llvm/CodeGen/LiveIntervalAnalysis.h lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200909142133.n8ELXhcQ003245@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 14 16:33:42 2009 New Revision: 81796 URL: http://llvm.org/viewvc/llvm-project?rev=81796&view=rev Log: Add early coalescing to liveintervals. This is work in progress and is known to miscompute some tests. Read it at your own rish, I have aged 10 year while writing this. The gist of this is if source of some of the copies that feed into a phi join is defined by the phi join, we'd like to eliminate them. However, if any of the non-identity source overlaps the live interval of the phi join then the coalescer won't be able to coalesce them. The early coalescer's job is to eliminate the identity copies by partially-coalescing the two live intervals. Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=81796&r1=81795&r2=81796&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Mon Sep 14 16:33:42 2009 @@ -584,7 +584,6 @@ /// for the Value number. VNInfo *createValueCopy(const VNInfo *orig, BumpPtrAllocator &VNInfoAllocator) { - VNInfo *VNI = static_cast(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo), alignof())); Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=81796&r1=81795&r2=81796&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Mon Sep 14 16:33:42 2009 @@ -65,9 +65,6 @@ AliasAnalysis *aa_; LiveVariables* lv_; - - - /// Special pool allocator for VNInfo's (LiveInterval val#). /// BumpPtrAllocator VNInfoAllocator; @@ -94,9 +91,14 @@ DenseMap terminatorGaps; + /// phiJoinCopies - Copy instructions which are PHI joins. + SmallVector phiJoinCopies; + + /// allocatableRegs_ - A bit vector of allocatable registers. BitVector allocatableRegs_; - std::vector ClonedMIs; + /// CloneMIs - A list of clones as result of re-materialization. + std::vector CloneMIs; typedef LiveInterval::InstrSlots InstrSlots; @@ -430,7 +432,14 @@ private: /// computeIntervals - Compute live intervals. void computeIntervals(); - + + bool isProfitableToCoalesce(LiveInterval &DstInt, LiveInterval &SrcInt, + SmallVector &IdentCopies, + SmallVector &OtherCopies, + bool &HaveConflict); + + void performEarlyCoalescing(); + /// handleRegisterDef - update intervals for a register def /// (calls handlePhysicalRegisterDef and /// handleVirtualRegisterDef) @@ -560,7 +569,8 @@ static LiveInterval* createInterval(unsigned Reg); - void printRegName(unsigned reg) const; + void printInstrs(raw_ostream &O) const; + void dumpInstrs() const; }; } // End llvm namespace Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=81796&r1=81795&r2=81796&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Sep 14 16:33:42 2009 @@ -49,19 +49,20 @@ static cl::opt DisableReMat("disable-rematerialization", cl::init(false), cl::Hidden); -static cl::opt SplitAtBB("split-intervals-at-bb", - cl::init(true), cl::Hidden); -static cl::opt SplitLimit("split-limit", - cl::init(-1), cl::Hidden); - static cl::opt EnableAggressiveRemat("aggressive-remat", cl::Hidden); static cl::opt EnableFastSpilling("fast-spill", cl::init(false), cl::Hidden); -STATISTIC(numIntervals, "Number of original intervals"); -STATISTIC(numFolds , "Number of loads/stores folded into instructions"); -STATISTIC(numSplits , "Number of intervals split"); +static cl::opt EarlyCoalescing("early-coalescing", cl::init(false)); + +static cl::opt CoalescingLimit("early-coalescing-limit", + cl::init(-1), cl::Hidden); + +STATISTIC(numIntervals , "Number of original intervals"); +STATISTIC(numFolds , "Number of loads/stores folded into instructions"); +STATISTIC(numSplits , "Number of intervals split"); +STATISTIC(numCoalescing, "Number of early coalescing performed"); char LiveIntervals::ID = 0; static RegisterPass X("liveintervals", "Live Interval Analysis"); @@ -96,12 +97,13 @@ i2miMap_.clear(); r2iMap_.clear(); terminatorGaps.clear(); + phiJoinCopies.clear(); // Release VNInfo memroy regions after all VNInfo objects are dtor'd. VNInfoAllocator.Reset(); - while (!ClonedMIs.empty()) { - MachineInstr *MI = ClonedMIs.back(); - ClonedMIs.pop_back(); + while (!CloneMIs.empty()) { + MachineInstr *MI = CloneMIs.back(); + CloneMIs.pop_back(); mf_->DeleteMachineInstr(MI); } } @@ -264,6 +266,7 @@ mi2iMap_.clear(); i2miMap_.clear(); terminatorGaps.clear(); + phiJoinCopies.clear(); FunctionSize = 0; @@ -518,6 +521,7 @@ processImplicitDefs(); computeNumbering(); computeIntervals(); + performEarlyCoalescing(); numIntervals += getNumIntervals(); @@ -533,6 +537,10 @@ OS << "\n"; } + printInstrs(OS); +} + +void LiveIntervals::printInstrs(raw_ostream &OS) const { OS << "********** MACHINEINSTRS **********\n"; for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end(); @@ -545,6 +553,10 @@ } } +void LiveIntervals::dumpInstrs() const { + printInstrs(errs()); +} + /// conflictsWithPhysRegDef - Returns true if the specified register /// is defined during the duration of the specified interval. bool LiveIntervals::conflictsWithPhysRegDef(const LiveInterval &li, @@ -626,7 +638,7 @@ } -void LiveIntervals::printRegName(unsigned reg) const { +static void printRegName(unsigned reg, const TargetRegisterInfo* tri_) { if (TargetRegisterInfo::isPhysicalRegister(reg)) errs() << tri_->getName(reg); else @@ -641,7 +653,7 @@ LiveInterval &interval) { DEBUG({ errs() << "\t\tregister: "; - printRegName(interval.reg); + printRegName(interval.reg, tri_); }); // Virtual registers may be defined multiple times (due to phi @@ -789,12 +801,10 @@ // first redefinition of the vreg that we have seen, go back and change // the live range in the PHI block to be a different value number. if (interval.containsOneValue()) { - assert(vi.Kills.size() == 1 && - "PHI elimination vreg should have one kill, the PHI itself!"); - // Remove the old range that we now know has an incorrect number. VNInfo *VNI = interval.getValNumInfo(0); MachineInstr *Killer = vi.Kills[0]; + phiJoinCopies.push_back(Killer); MachineInstrIndex Start = getMBBStartIdx(Killer->getParent()); MachineInstrIndex End = getNextSlot(getUseIndex(getInstructionIndex(Killer))); @@ -805,7 +815,7 @@ }); interval.removeRange(Start, End); assert(interval.ranges.size() == 1 && - "newly discovered PHI interval has >1 ranges."); + "Newly discovered PHI interval has >1 ranges."); MachineBasicBlock *killMBB = getMBBFromIndex(interval.endIndex()); VNI->addKill(terminatorGaps[killMBB]); VNI->setHasPHIKill(true); @@ -835,7 +845,7 @@ MachineInstrIndex defIndex = getDefIndex(MIIdx); if (MO.isEarlyClobber()) defIndex = getUseIndex(MIIdx); - + VNInfo *ValNo; MachineInstr *CopyMI = NULL; unsigned SrcReg, DstReg, SrcSubReg, DstSubReg; @@ -868,7 +878,7 @@ // lifetime must end somewhere in its defining basic block. DEBUG({ errs() << "\t\tregister: "; - printRegName(interval.reg); + printRegName(interval.reg, tri_); }); MachineInstrIndex baseIndex = MIIdx; @@ -977,7 +987,7 @@ LiveInterval &interval, bool isAlias) { DEBUG({ errs() << "\t\tlivein register: "; - printRegName(interval.reg); + printRegName(interval.reg, tri_); }); // Look for kills, if it reaches a def before it's killed, then it shouldn't @@ -1039,6 +1049,138 @@ DEBUG(errs() << " +" << LR << '\n'); } +bool +LiveIntervals::isProfitableToCoalesce(LiveInterval &DstInt, LiveInterval &SrcInt, + SmallVector &IdentCopies, + SmallVector &OtherCopies, + bool &HaveConflict) { + HaveConflict = false; + + unsigned NumIdent = 0; + unsigned NumSources = 0; + for (MachineRegisterInfo::reg_iterator ri = mri_->reg_begin(SrcInt.reg), + re = mri_->reg_end(); ri != re; ++ri) { + MachineOperand &O = ri.getOperand(); + if (!O.isDef()) + continue; + + ++NumSources; + MachineInstr *MI = &*ri; + unsigned SrcReg, DstReg, SrcSubReg, DstSubReg; + if (!tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubReg, DstSubReg)) + continue; + if (SrcReg != DstInt.reg) { + OtherCopies.push_back(MI); + HaveConflict |= DstInt.liveAt(getInstructionIndex(MI)); + } else { + IdentCopies.push_back(MI); + ++NumIdent; + } + } + + return NumSources >= 5 && (((float)NumIdent) / NumSources) > 0.20F; +} + +void LiveIntervals::performEarlyCoalescing() { + if (!EarlyCoalescing) + return; + + /// Perform early coalescing: eliminate copies which feed into phi joins + /// and whose sources are defined by the phi joins. + for (unsigned i = 0, e = phiJoinCopies.size(); i != e; ++i) { + MachineInstr *Join = phiJoinCopies[i]; + if (CoalescingLimit != -1 && (int)numCoalescing == CoalescingLimit) + break; + + unsigned PHISrc, PHIDst, SrcSubReg, DstSubReg; + bool isMove= tii_->isMoveInstr(*Join, PHISrc, PHIDst, SrcSubReg, DstSubReg); +#ifndef NDEBUG + assert(isMove && "PHI join instruction must be a move!"); +#else + isMove = isMove; +#endif + + LiveInterval &DstInt = getInterval(PHIDst); + LiveInterval &SrcInt = getInterval(PHISrc); + SmallVector IdentCopies; + SmallVector OtherCopies; + bool HaveConflict; + if (!isProfitableToCoalesce(DstInt, SrcInt, IdentCopies, OtherCopies, + HaveConflict)) + continue; + + DEBUG(errs() << "PHI Join: " << *Join); + assert(DstInt.containsOneValue() && "PHI join should have just one val#!"); + VNInfo *VNI = DstInt.getValNumInfo(0); + VNInfo *NewVNI = HaveConflict + ? 0 : SrcInt.getNextValue(VNI->def, 0, false, VNInfoAllocator); + // Now let's eliminate all the would-be identity copies. + for (unsigned i = 0, e = IdentCopies.size(); i != e; ++i) { + MachineInstr *PHICopy = IdentCopies[i]; + DEBUG(errs() << "Coalescing: " << *PHICopy); + + MachineBasicBlock *PHIMBB = PHICopy->getParent(); + MachineInstrIndex MIIndex = getInstructionIndex(PHICopy); + MachineInstrIndex DefIndex = getDefIndex(MIIndex); + LiveRange *SLR = SrcInt.getLiveRangeContaining(DefIndex); + MachineInstrIndex StartIndex = HaveConflict + ? SLR->start : getMBBStartIdx(PHIMBB); + MachineInstrIndex EndIndex = SLR->end; + + // Delete val# defined by the now identity copy and add the range from + // beginning of the mbb to the end of the range. + SrcInt.removeValNo(SLR->valno); + if (HaveConflict) { + DEBUG(errs() << " added range [" << StartIndex << ',' + << EndIndex << "] to reg" << DstInt.reg << '\n'); + DstInt.addRange(LiveRange(StartIndex, EndIndex, VNI)); + // FIXME: Update uses of src to dst in this range? + } else { + DEBUG(errs() << " added range [" << StartIndex << ',' + << SLR->start << "] to reg" << SrcInt.reg << '\n'); + SrcInt.addRange(LiveRange(StartIndex, EndIndex, NewVNI)); + if (PHICopy->killsRegister(PHIDst)) + EndIndex = DefIndex; + DstInt.removeRange(StartIndex, EndIndex); + } + RemoveMachineInstrFromMaps(PHICopy); + PHICopy->eraseFromParent(); + } + if (HaveConflict) { + // First unset the kill. + for (unsigned i = 0, e = Join->getNumOperands(); i != e; ++i) { + MachineOperand &O = Join->getOperand(i); + if (!O.isReg() || O.getReg() != PHISrc) + continue; + if (O.isKill()) + O.setIsKill(false); + } + MachineInstrIndex MIIndex = getInstructionIndex(Join); + MachineInstrIndex UseIndex = getUseIndex(MIIndex); + MachineInstrIndex DefIndex = getDefIndex(MIIndex); + LiveRange *SLR = SrcInt.getLiveRangeContaining(UseIndex); + LiveRange *DLR = DstInt.getLiveRangeContaining(DefIndex); + SrcInt.addRange(LiveRange(DLR->start, DLR->end, SLR->valno)); + } else { + SrcInt.MergeValueInAsValue(DstInt, VNI, NewVNI); + + // Change all references of phi source to destination. + for (MachineRegisterInfo::reg_iterator ri = mri_->reg_begin(PHIDst), + re = mri_->reg_end(); ri != re; ) { + MachineOperand &O = ri.getOperand(); + ++ri; + O.setReg(PHISrc); + } + removeInterval(DstInt.reg); + + RemoveMachineInstrFromMaps(Join); + Join->eraseFromParent(); + } + + ++numCoalescing; + } +} + /// computeIntervals - computes the live intervals for virtual /// registers. for some ordering of the machine instructions [1,N] a /// live interval is an interval [i, j) where 1 <= i <= j < N for @@ -2230,9 +2372,7 @@ return NewLIs; } - bool TrySplit = SplitAtBB && !intervalIsInOneMBB(li); - if (SplitLimit != -1 && (int)numSplits >= SplitLimit) - TrySplit = false; + bool TrySplit = !intervalIsInOneMBB(li); if (TrySplit) ++numSplits; bool NeedStackSlot = false; @@ -2251,7 +2391,7 @@ ReMatOrigDefs[VN] = ReMatDefMI; // Original def may be modified so we have to make a copy here. MachineInstr *Clone = mf_->CloneMachineInstr(ReMatDefMI); - ClonedMIs.push_back(Clone); + CloneMIs.push_back(Clone); ReMatDefs[VN] = Clone; bool CanDelete = true; From wendling at apple.com Mon Sep 14 16:36:45 2009 From: wendling at apple.com (Bill Wendling) Date: Mon, 14 Sep 2009 14:36:45 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r81788 - /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C In-Reply-To: References: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> Message-ID: On Sep 14, 2009, at 2:31 PM, Chris Lattner wrote: > On Sep 14, 2009, at 2:13 PM, Eric Christopher wrote: > >> Author: echristo >> Date: Mon Sep 14 16:13:49 2009 >> New Revision: 81788 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=81788&view=rev >> Log: >> Update this test, the except table is now in the data section. > > But that is a "bug", so we want the test to continue failing? > "Bug" is a bit harsh. :-) It's just not very optimal. Plastering a "FIXME" in there with the radar number would be fine, perhaps? -bw From echristo at apple.com Mon Sep 14 16:39:27 2009 From: echristo at apple.com (Eric Christopher) Date: Mon, 14 Sep 2009 14:39:27 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r81788 - /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C In-Reply-To: References: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> Message-ID: <0F0E8899-5FF6-4605-8F4C-492718DC94E4@apple.com> On Sep 14, 2009, at 2:36 PM, Bill Wendling wrote: > On Sep 14, 2009, at 2:31 PM, Chris Lattner wrote: > >> On Sep 14, 2009, at 2:13 PM, Eric Christopher wrote: >> >>> Author: echristo >>> Date: Mon Sep 14 16:13:49 2009 >>> New Revision: 81788 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=81788&view=rev >>> Log: >>> Update this test, the except table is now in the data section. >> >> But that is a "bug", so we want the test to continue failing? >> > "Bug" is a bit harsh. :-) It's just not very optimal. Plastering a > "FIXME" in there with the radar number > would be fine, perhaps? Mmm.. either way. I'm happy to revert as it's a bug by that definition :) -eric From idadesub at users.sourceforge.net Mon Sep 14 16:54:15 2009 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Mon, 14 Sep 2009 21:54:15 -0000 Subject: [llvm-commits] [llvm] r81799 - in /llvm/trunk/docs/tutorial: OCamlLangImpl4.html OCamlLangImpl5.html OCamlLangImpl6.html OCamlLangImpl7.html Message-ID: <200909142154.n8ELsG6x006016@zion.cs.uiuc.edu> Author: erickt Date: Mon Sep 14 16:54:15 2009 New Revision: 81799 URL: http://llvm.org/viewvc/llvm-project?rev=81799&view=rev Log: Make sure to initialize the fpm in the ocaml tutorial. Modified: llvm/trunk/docs/tutorial/OCamlLangImpl4.html llvm/trunk/docs/tutorial/OCamlLangImpl5.html llvm/trunk/docs/tutorial/OCamlLangImpl6.html llvm/trunk/docs/tutorial/OCamlLangImpl7.html Modified: llvm/trunk/docs/tutorial/OCamlLangImpl4.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl4.html?rev=81799&r1=81798&r2=81799&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl4.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl4.html Mon Sep 14 16:54:15 2009 @@ -206,6 +206,8 @@ (* Simplify the control flow graph (deleting unreachable blocks, etc). *) add_cfg_simplification the_fpm; + ignore (PassManager.initialize the_fpm); + (* Run the main "interpreter loop" now. *) Toplevel.main_loop the_fpm the_execution_engine stream; @@ -992,6 +994,8 @@ (* Simplify the control flow graph (deleting unreachable blocks, etc). *) add_cfg_simplification the_fpm; + ignore (PassManager.initialize the_fpm); + (* Run the main "interpreter loop" now. *) Toplevel.main_loop the_fpm the_execution_engine stream; Modified: llvm/trunk/docs/tutorial/OCamlLangImpl5.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl5.html?rev=81799&r1=81798&r2=81799&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl5.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl5.html Mon Sep 14 16:54:15 2009 @@ -1519,6 +1519,8 @@ (* Simplify the control flow graph (deleting unreachable blocks, etc). *) add_cfg_simplification the_fpm; + ignore (PassManager.initialize the_fpm); + (* Run the main "interpreter loop" now. *) Toplevel.main_loop the_fpm the_execution_engine stream; Modified: llvm/trunk/docs/tutorial/OCamlLangImpl6.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl6.html?rev=81799&r1=81798&r2=81799&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl6.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl6.html Mon Sep 14 16:54:15 2009 @@ -1518,6 +1518,8 @@ (* Simplify the control flow graph (deleting unreachable blocks, etc). *) add_cfg_simplification the_fpm; + ignore (PassManager.initialize the_fpm); + (* Run the main "interpreter loop" now. *) Toplevel.main_loop the_fpm the_execution_engine stream; Modified: llvm/trunk/docs/tutorial/OCamlLangImpl7.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl7.html?rev=81799&r1=81798&r2=81799&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl7.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl7.html Mon Sep 14 16:54:15 2009 @@ -1852,6 +1852,8 @@ (* Simplify the control flow graph (deleting unreachable blocks, etc). *) add_cfg_simplification the_fpm; + ignore (PassManager.initialize the_fpm); + (* Run the main "interpreter loop" now. *) Toplevel.main_loop the_fpm the_execution_engine stream; From idadesub at users.sourceforge.net Mon Sep 14 16:54:32 2009 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Mon, 14 Sep 2009 21:54:32 -0000 Subject: [llvm-commits] [llvm] r81800 - in /llvm/trunk: bindings/ocaml/executionengine/executionengine_ocaml.c bindings/ocaml/executionengine/llvm_executionengine.ml bindings/ocaml/executionengine/llvm_executionengine.mli docs/tutorial/OCamlLangImpl4.html docs/tutorial/OCamlLangImpl5.html docs/tutorial/OCamlLangImpl6.html docs/tutorial/OCamlLangImpl7.html Message-ID: <200909142154.n8ELsWWG006068@zion.cs.uiuc.edu> Author: erickt Date: Mon Sep 14 16:54:32 2009 New Revision: 81800 URL: http://llvm.org/viewvc/llvm-project?rev=81800&view=rev Log: Expose initializing the native target for the execution engine. Modified: llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli llvm/trunk/docs/tutorial/OCamlLangImpl4.html llvm/trunk/docs/tutorial/OCamlLangImpl5.html llvm/trunk/docs/tutorial/OCamlLangImpl6.html llvm/trunk/docs/tutorial/OCamlLangImpl7.html Modified: llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c?rev=81800&r1=81799&r2=81800&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c (original) +++ llvm/trunk/bindings/ocaml/executionengine/executionengine_ocaml.c Mon Sep 14 16:54:32 2009 @@ -24,11 +24,15 @@ #include #include -/* Force the LLVM interpreter, JIT, and native target to be linked in. */ +/* Force the LLVM interpreter and JIT to be linked in. */ void llvm_initialize(void) { LLVMLinkInInterpreter(); LLVMLinkInJIT(); - LLVMInitializeNativeTarget(); +} + +/* unit -> bool */ +CAMLprim value llvm_initialize_native_target(value Unit) { + return Val_bool(LLVMInitializeNativeTarget()); } /* Can't use the recommended caml_named_value mechanism for backwards Modified: llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml?rev=81800&r1=81799&r2=81800&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml (original) +++ llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.ml Mon Sep 14 16:54:32 2009 @@ -109,3 +109,6 @@ *) end + +external initialize_native_target : unit -> bool + = "llvm_initialize_native_target" Modified: llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli?rev=81800&r1=81799&r2=81800&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli (original) +++ llvm/trunk/bindings/ocaml/executionengine/llvm_executionengine.mli Mon Sep 14 16:54:32 2009 @@ -161,3 +161,6 @@ [ee]. *) val target_data: t -> Llvm_target.TargetData.t end + +external initialize_native_target : unit -> bool + = "llvm_initialize_native_target" Modified: llvm/trunk/docs/tutorial/OCamlLangImpl4.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl4.html?rev=81800&r1=81799&r2=81800&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl4.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl4.html Mon Sep 14 16:54:32 2009 @@ -962,6 +962,8 @@ open Llvm_scalar_opts let main () = + ignore (initialize_native_target ()); + (* Install standard binary operators. * 1 is the lowest precedence. *) Hashtbl.add Parser.binop_precedence '<' 10; Modified: llvm/trunk/docs/tutorial/OCamlLangImpl5.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl5.html?rev=81800&r1=81799&r2=81800&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl5.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl5.html Mon Sep 14 16:54:32 2009 @@ -1487,6 +1487,8 @@ open Llvm_scalar_opts let main () = + ignore (initialize_native_target ()); + (* Install standard binary operators. * 1 is the lowest precedence. *) Hashtbl.add Parser.binop_precedence '<' 10; Modified: llvm/trunk/docs/tutorial/OCamlLangImpl6.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl6.html?rev=81800&r1=81799&r2=81800&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl6.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl6.html Mon Sep 14 16:54:32 2009 @@ -1486,6 +1486,8 @@ open Llvm_scalar_opts let main () = + ignore (initialize_native_target ()); + (* Install standard binary operators. * 1 is the lowest precedence. *) Hashtbl.add Parser.binop_precedence '<' 10; Modified: llvm/trunk/docs/tutorial/OCamlLangImpl7.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl7.html?rev=81800&r1=81799&r2=81800&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl7.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl7.html Mon Sep 14 16:54:32 2009 @@ -1816,6 +1816,8 @@ open Llvm_scalar_opts let main () = + ignore (initialize_native_target ()); + (* Install standard binary operators. * 1 is the lowest precedence. *) Hashtbl.add Parser.binop_precedence '=' 2; From mrs at apple.com Mon Sep 14 16:58:46 2009 From: mrs at apple.com (Mike Stump) Date: Mon, 14 Sep 2009 14:58:46 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r81788 - /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C In-Reply-To: <0F0E8899-5FF6-4605-8F4C-492718DC94E4@apple.com> References: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> <0F0E8899-5FF6-4605-8F4C-492718DC94E4@apple.com> Message-ID: <5650EAC4-4B8F-4FEB-BE0A-AF5E0FE2A101@apple.com> On Sep 14, 2009, at 2:39 PM, Eric Christopher wrote: > Mmm.. either way. I'm happy to revert as it's a bug by that > definition :) Reversion is best I think as I suspect there are many failures in the testsuite. The thing being tested is actually a feature of gcc. Testing for a non-feature, would be odd. If you wanted to test results to be cleaner, you can mark it as expected. I can dig up the older radar number for when we switched gcc to text, if you want (please don't ask though). From echristo at apple.com Mon Sep 14 17:07:32 2009 From: echristo at apple.com (Eric Christopher) Date: Mon, 14 Sep 2009 15:07:32 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r81788 - /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C In-Reply-To: <5650EAC4-4B8F-4FEB-BE0A-AF5E0FE2A101@apple.com> References: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> <0F0E8899-5FF6-4605-8F4C-492718DC94E4@apple.com> <5650EAC4-4B8F-4FEB-BE0A-AF5E0FE2A101@apple.com> Message-ID: <74AAF02F-4ECA-4522-BE03-19EB3D1EFC78@apple.com> On Sep 14, 2009, at 2:58 PM, Mike Stump wrote: > On Sep 14, 2009, at 2:39 PM, Eric Christopher wrote: >> Mmm.. either way. I'm happy to revert as it's a bug by that >> definition :) > > Reversion is best I think as I suspect there are many failures in > the testsuite. The thing being tested is actually a feature of > gcc. Testing for a non-feature, would be odd. If you wanted to > test results to be cleaner, you can mark it as expected. I can dig > up the older radar number for when we switched gcc to text, if you > want (please don't ask though). Nah. At any rate, I'm talking with Bill about it. -eric From kledzik at apple.com Mon Sep 14 18:26:56 2009 From: kledzik at apple.com (Nick Kledzik) Date: Mon, 14 Sep 2009 23:26:56 -0000 Subject: [llvm-commits] [compiler-rt] r81809 - in /compiler-rt/trunk: lib/arm/ test/Unit/ Message-ID: <200909142326.n8ENQv9B018505@zion.cs.uiuc.edu> Author: kledzik Date: Mon Sep 14 18:26:56 2009 New Revision: 81809 URL: http://llvm.org/viewvc/llvm-project?rev=81809&view=rev Log: add conversion functions and test cases for ARM Added: compiler-rt/trunk/lib/arm/extendsfdf2vfp.S compiler-rt/trunk/lib/arm/fixdfsivfp.S compiler-rt/trunk/lib/arm/fixsfsivfp.S compiler-rt/trunk/lib/arm/fixunsdfsivfp.S compiler-rt/trunk/lib/arm/fixunssfsivfp.S compiler-rt/trunk/lib/arm/floatsidfvfp.S compiler-rt/trunk/lib/arm/floatsisfvfp.S compiler-rt/trunk/lib/arm/floatunssidfvfp.S compiler-rt/trunk/lib/arm/floatunssisfvfp.S compiler-rt/trunk/lib/arm/truncdfsf2vfp.S compiler-rt/trunk/test/Unit/extebdsfdf2vfp_test.c compiler-rt/trunk/test/Unit/fixdfsivfp_test.c compiler-rt/trunk/test/Unit/fixsfsivfp_test.c compiler-rt/trunk/test/Unit/fixunsdfsivfp_test.c compiler-rt/trunk/test/Unit/fixunssfsivfp_test.c compiler-rt/trunk/test/Unit/floatsidfvfp_test.c compiler-rt/trunk/test/Unit/floatsisfvfp_test.c compiler-rt/trunk/test/Unit/floatunssidfvfp_test.c compiler-rt/trunk/test/Unit/floatunssisfvfp_test.c compiler-rt/trunk/test/Unit/truncdfsf2vfp_test.c Added: compiler-rt/trunk/lib/arm/extendsfdf2vfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/extendsfdf2vfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/extendsfdf2vfp.S (added) +++ compiler-rt/trunk/lib/arm/extendsfdf2vfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,23 @@ +//===-- extendsfdf2vfp.S - Implement extendsfdf2vfp -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern double __extendsfdf2vfp(float a); +// +// Converts single precision float to double precision result. +// Uses Darwin calling convention where a single precision parameter is +// passed in a GPR and a double precision result is returned in R0/R1 pair. +// + .globl ___extendsfdf2vfp +___extendsfdf2vfp: + fmsr s15, r0 // load float register from R0 + fcvtds d7, s15 // convert single to double + fmrrd r0, r1, d7 // return result in r0/r1 pair + bx lr Added: compiler-rt/trunk/lib/arm/fixdfsivfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/fixdfsivfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/fixdfsivfp.S (added) +++ compiler-rt/trunk/lib/arm/fixdfsivfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,23 @@ +//===-- fixdfsivfp.S - Implement fixdfsivfp -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern int __fixdfsivfp(double a); +// +// Converts double precision float to a 32-bit int rounding towards zero. +// Uses Darwin calling convention where a double precision parameter is +// passed in GPR register pair. +// + .globl ___fixdfsivfp +___fixdfsivfp: + fmdrr d7, r0, r1 // load double register from R0/R1 + ftosizd s15, d7 // convert double to 32-bit int into s15 + fmrs r0, s15 // move s15 to result register + bx lr Added: compiler-rt/trunk/lib/arm/fixsfsivfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/fixsfsivfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/fixsfsivfp.S (added) +++ compiler-rt/trunk/lib/arm/fixsfsivfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,23 @@ +//===-- fixsfsivfp.S - Implement fixsfsivfp -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern int __fixsfsivfp(float a); +// +// Converts single precision float to a 32-bit int rounding towards zero. +// Uses Darwin calling convention where a single precision parameter is +// passed in a GPR.. +// + .globl ___fixsfsivfp +___fixsfsivfp: + fmsr s15, r0 // load float register from R0 + ftosizs s15, s15 // convert single to 32-bit int into s15 + fmrs r0, s15 // move s15 to result register + bx lr Added: compiler-rt/trunk/lib/arm/fixunsdfsivfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/fixunsdfsivfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/fixunsdfsivfp.S (added) +++ compiler-rt/trunk/lib/arm/fixunsdfsivfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,24 @@ +//===-- fixunsdfsivfp.S - Implement fixunsdfsivfp -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern unsigned int __fixunsdfsivfp(double a); +// +// Converts double precision float to a 32-bit unsigned int rounding towards +// zero. All negative values become zero. +// Uses Darwin calling convention where a double precision parameter is +// passed in GPR register pair. +// + .globl ___fixunsdfsivfp +___fixunsdfsivfp: + fmdrr d7, r0, r1 // load double register from R0/R1 + ftouizd s15, d7 // convert double to 32-bit int into s15 + fmrs r0, s15 // move s15 to result register + bx lr Added: compiler-rt/trunk/lib/arm/fixunssfsivfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/fixunssfsivfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/fixunssfsivfp.S (added) +++ compiler-rt/trunk/lib/arm/fixunssfsivfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,24 @@ +//===-- fixunssfsivfp.S - Implement fixunssfsivfp -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern unsigned int __fixunssfsivfp(float a); +// +// Converts single precision float to a 32-bit unsigned int rounding towards +// zero. All negative values become zero. +// Uses Darwin calling convention where a single precision parameter is +// passed in a GPR.. +// + .globl ___fixunssfsivfp +___fixunssfsivfp: + fmsr s15, r0 // load float register from R0 + ftouizs s15, s15 // convert single to 32-bit unsigned into s15 + fmrs r0, s15 // move s15 to result register + bx lr Added: compiler-rt/trunk/lib/arm/floatsidfvfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/floatsidfvfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/floatsidfvfp.S (added) +++ compiler-rt/trunk/lib/arm/floatsidfvfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,23 @@ +//===-- floatsidfvfp.S - Implement floatsidfvfp ---------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern double __floatsidfvfp(int a); +// +// Converts a 32-bit int to a double precision float. +// Uses Darwin calling convention where a double precision result is +// return in GPR register pair. +// + .globl ___floatsidfvfp +___floatsidfvfp: + fmsr s15, r0 // move int to float register s15 + fsitod d7, s15 // convert 32-bit int in s15 to double in d7 + fmrrd r0, r1, d7 // move d7 to result register pair r0/r1 + bx lr Added: compiler-rt/trunk/lib/arm/floatsisfvfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/floatsisfvfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/floatsisfvfp.S (added) +++ compiler-rt/trunk/lib/arm/floatsisfvfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,23 @@ +//===-- floatsisfvfp.S - Implement floatsisfvfp ---------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern float __floatsisfvfp(int a); +// +// Converts single precision float to a 32-bit int rounding towards zero. +// Uses Darwin calling convention where a single precision result is +// return in a GPR.. +// + .globl ___floatsisfvfp +___floatsisfvfp: + fmsr s15, r0 // move int to float register s15 + fsitos s15, s15 // convert 32-bit int in s15 to float in s15 + fmrs r0, s15 // move s15 to result register + bx lr Added: compiler-rt/trunk/lib/arm/floatunssidfvfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/floatunssidfvfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/floatunssidfvfp.S (added) +++ compiler-rt/trunk/lib/arm/floatunssidfvfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,23 @@ +//===-- floatunssidfvfp.S - Implement floatunssidfvfp ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern double __floatunssidfvfp(unsigned int a); +// +// Converts a 32-bit int to a double precision float. +// Uses Darwin calling convention where a double precision result is +// return in GPR register pair. +// + .globl ___floatunssidfvfp +___floatunssidfvfp: + fmsr s15, r0 // move int to float register s15 + fuitod d7, s15 // convert 32-bit int in s15 to double in d7 + fmrrd r0, r1, d7 // move d7 to result register pair r0/r1 + bx lr Added: compiler-rt/trunk/lib/arm/floatunssisfvfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/floatunssisfvfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/floatunssisfvfp.S (added) +++ compiler-rt/trunk/lib/arm/floatunssisfvfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,23 @@ +//===-- floatunssisfvfp.S - Implement floatunssisfvfp ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern float __floatunssisfvfp(unsigned int a); +// +// Converts single precision float to a 32-bit int rounding towards zero. +// Uses Darwin calling convention where a single precision result is +// return in a GPR.. +// + .globl ___floatunssisfvfp +___floatunssisfvfp: + fmsr s15, r0 // move int to float register s15 + fuitos s15, s15 // convert 32-bit int in s15 to float in s15 + fmrs r0, s15 // move s15 to result register + bx lr Added: compiler-rt/trunk/lib/arm/truncdfsf2vfp.S URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/arm/truncdfsf2vfp.S?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/lib/arm/truncdfsf2vfp.S (added) +++ compiler-rt/trunk/lib/arm/truncdfsf2vfp.S Mon Sep 14 18:26:56 2009 @@ -0,0 +1,23 @@ +//===-- truncdfsf2vfp.S - Implement truncdfsf2vfp -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +// +// extern float __truncdfsf2vfp(double a); +// +// Converts double precision float to signle precision result. +// Uses Darwin calling convention where a double precision parameter is +// passed in a R0/R1 pair and a signle precision result is returned in R0. +// + .globl ___truncdfsf2vfp +___truncdfsf2vfp: + fmdrr d7, r0, r1 // load double from r0/r1 pair + fcvtsd s15, d7 // convert double to single (trucate precision) + fmrs r0, s15 // return result in r0 + bx lr Added: compiler-rt/trunk/test/Unit/extebdsfdf2vfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/extebdsfdf2vfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/extebdsfdf2vfp_test.c (added) +++ compiler-rt/trunk/test/Unit/extebdsfdf2vfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,46 @@ +//===-- extendsfdf2vfp_test.c - Test __extendsfdf2vfp ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __extendsfdf2vfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern double __extendsfdf2vfp(float a); + +#if __arm__ +int test__extendsfdf2vfp(float a) +{ + double actual = __extendsfdf2vfp(a); + double expected = a; + if (actual != expected) + printf("error in test__extendsfdf2vfp(%f) = %f, expected %f\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__extendsfdf2vfp(0.0)) + return 1; + if (test__extendsfdf2vfp(1.0)) + return 1; + if (test__extendsfdf2vfp(-1.0)) + return 1; + if (test__extendsfdf2vfp(3.1415926535)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/fixdfsivfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/fixdfsivfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/fixdfsivfp_test.c (added) +++ compiler-rt/trunk/test/Unit/fixdfsivfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,48 @@ +//===-- fixdfsivfp_test.c - Test __fixdfsivfp -----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __fixdfsivfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern int __fixdfsivfp(double a); + +#if __arm__ +int test__fixdfsivfp(double a) +{ + int actual = __fixdfsivfp(a); + int expected = a; + if (actual != expected) + printf("error in test__fixdfsivfp(%f) = %d, expected %d\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__fixdfsivfp(0.0)) + return 1; + if (test__fixdfsivfp(1.0)) + return 1; + if (test__fixdfsivfp(-1.0)) + return 1; + if (test__fixdfsivfp(2147483647)) + return 1; + if (test__fixdfsivfp(-2147483648.0)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/fixsfsivfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/fixsfsivfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/fixsfsivfp_test.c (added) +++ compiler-rt/trunk/test/Unit/fixsfsivfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,50 @@ +//===-- fixsfsivfp_test.c - Test __fixsfsivfp -----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __fixsfsivfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern int __fixsfsivfp(float a); + +#if __arm__ +int test__fixsfsivfp(float a) +{ + int actual = __fixsfsivfp(a); + int expected = a; + if (actual != expected) + printf("error in test__fixsfsivfp(%f) = %u, expected %u\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__fixsfsivfp(0.0)) + return 1; + if (test__fixsfsivfp(1.0)) + return 1; + if (test__fixsfsivfp(-1.0)) + return 1; + if (test__fixsfsivfp(2147483647.0)) + return 1; + if (test__fixsfsivfp(-2147483648.0)) + return 1; + if (test__fixsfsivfp(65536.0)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/fixunsdfsivfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/fixunsdfsivfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/fixunsdfsivfp_test.c (added) +++ compiler-rt/trunk/test/Unit/fixunsdfsivfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,48 @@ +//===-- fixunsdfsivfp_test.c - Test __fixunsdfsivfp -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __fixunsdfsivfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern unsigned int __fixunsdfsivfp(double a); + +#if __arm__ +int test__fixunsdfsivfp(double a) +{ + unsigned int actual = __fixunsdfsivfp(a); + unsigned int expected = a; + if (actual != expected) + printf("error in test__fixunsdfsivfp(%f) = %u, expected %u\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__fixunsdfsivfp(0.0)) + return 1; + if (test__fixunsdfsivfp(1.0)) + return 1; + if (test__fixunsdfsivfp(-1.0)) + return 1; + if (test__fixunsdfsivfp(4294967295.0)) + return 1; + if (test__fixunsdfsivfp(65536.0)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/fixunssfsivfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/fixunssfsivfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/fixunssfsivfp_test.c (added) +++ compiler-rt/trunk/test/Unit/fixunssfsivfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,48 @@ +//===-- fixunssfsivfp_test.c - Test __fixunssfsivfp -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __fixunssfsivfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern unsigned int __fixunssfsivfp(float a); + +#if __arm__ +int test__fixunssfsivfp(float a) +{ + unsigned int actual = __fixunssfsivfp(a); + unsigned int expected = a; + if (actual != expected) + printf("error in test__fixunssfsivfp(%f) = %u, expected %u\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__fixunssfsivfp(0.0)) + return 1; + if (test__fixunssfsivfp(1.0)) + return 1; + if (test__fixunssfsivfp(-1.0)) + return 1; + if (test__fixunssfsivfp(4294967295.0)) + return 1; + if (test__fixunssfsivfp(65536.0)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/floatsidfvfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/floatsidfvfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/floatsidfvfp_test.c (added) +++ compiler-rt/trunk/test/Unit/floatsidfvfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,48 @@ +//===-- floatsidfvfp_test.c - Test __floatsidfvfp -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __floatsidfvfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern double __floatsidfvfp(int a); + +#if __arm__ +int test__floatsidfvfp(int a) +{ + double actual = __floatsidfvfp(a); + double expected = a; + if (actual != expected) + printf("error in test__ floatsidfvfp(%d) = %f, expected %f\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__floatsidfvfp(0)) + return 1; + if (test__floatsidfvfp(1)) + return 1; + if (test__floatsidfvfp(-1)) + return 1; + if (test__floatsidfvfp(0x7FFFFFFF)) + return 1; + if (test__floatsidfvfp(0x80000000)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/floatsisfvfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/floatsisfvfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/floatsisfvfp_test.c (added) +++ compiler-rt/trunk/test/Unit/floatsisfvfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,48 @@ +//===-- floatsisfvfp_test.c - Test __floatsisfvfp -------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __floatsisfvfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern float __floatsisfvfp(int a); + +#if __arm__ +int test__floatsisfvfp(int a) +{ + float actual = __floatsisfvfp(a); + float expected = a; + if (actual != expected) + printf("error in test__floatsisfvfp(%d) = %f, expected %f\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__floatsisfvfp(0)) + return 1; + if (test__floatsisfvfp(1)) + return 1; + if (test__floatsisfvfp(-1)) + return 1; + if (test__floatsisfvfp(0x7FFFFFFF)) + return 1; + if (test__floatsisfvfp(0x80000000)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/floatunssidfvfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/floatunssidfvfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/floatunssidfvfp_test.c (added) +++ compiler-rt/trunk/test/Unit/floatunssidfvfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,48 @@ +//===-- floatunssidfvfp_test.c - Test __floatunssidfvfp -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __floatunssidfvfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern double __floatunssidfvfp(unsigned int a); + +#if __arm__ +int test__floatunssidfvfp(unsigned int a) +{ + double actual = __floatunssidfvfp(a); + double expected = a; + if (actual != expected) + printf("error in test__floatunssidfvfp(%u) = %f, expected %f\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__floatunssidfvfp(0)) + return 1; + if (test__floatunssidfvfp(1)) + return 1; + if (test__floatunssidfvfp(0x7FFFFFFF)) + return 1; + if (test__floatunssidfvfp(0x80000000)) + return 1; + if (test__floatunssidfvfp(0xFFFFFFFF)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/floatunssisfvfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/floatunssisfvfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/floatunssisfvfp_test.c (added) +++ compiler-rt/trunk/test/Unit/floatunssisfvfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,48 @@ +//===-- floatunssisfvfp_test.c - Test __floatunssisfvfp -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __floatunssisfvfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern float __floatunssisfvfp(unsigned int a); + +#if __arm__ +int test__floatunssisfvfp(unsigned int a) +{ + float actual = __floatunssisfvfp(a); + float expected = a; + if (actual != expected) + printf("error in test__floatunssisfvfp(%u) = %f, expected %f\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__floatunssisfvfp(0)) + return 1; + if (test__floatunssisfvfp(1)) + return 1; + if (test__floatunssisfvfp(0x7FFFFFFF)) + return 1; + if (test__floatunssisfvfp(0x80000000)) + return 1; + if (test__floatunssisfvfp(0xFFFFFFFF)) + return 1; +#endif + return 0; +} Added: compiler-rt/trunk/test/Unit/truncdfsf2vfp_test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/truncdfsf2vfp_test.c?rev=81809&view=auto ============================================================================== --- compiler-rt/trunk/test/Unit/truncdfsf2vfp_test.c (added) +++ compiler-rt/trunk/test/Unit/truncdfsf2vfp_test.c Mon Sep 14 18:26:56 2009 @@ -0,0 +1,48 @@ +//===-- truncdfsf2vfp_test.c - Test __truncdfsf2vfp -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file tests __truncdfsf2vfp for the compiler_rt library. +// +//===----------------------------------------------------------------------===// + +#include +#include +#include + + +extern float __truncdfsf2vfp(double a); + +#if __arm__ +int test__truncdfsf2vfp(double a) +{ + float actual = __truncdfsf2vfp(a); + float expected = a; + if (actual != expected) + printf("error in test__truncdfsf2vfp(%f) = %f, expected %f\n", + a, actual, expected); + return actual != expected; +} +#endif + +int main() +{ +#if __arm__ + if (test__truncdfsf2vfp(0.0)) + return 1; + if (test__truncdfsf2vfp(1.0)) + return 1; + if (test__truncdfsf2vfp(-1.0)) + return 1; + if (test__truncdfsf2vfp(3.1415926535)) + return 1; + if (test__truncdfsf2vfp(123.456)) + return 1; +#endif + return 0; +} From gohman at apple.com Mon Sep 14 18:39:10 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Sep 2009 23:39:10 -0000 Subject: [llvm-commits] [llvm] r81810 - in /llvm/trunk: lib/Transforms/Scalar/MemCpyOptimizer.cpp test/Transforms/MemCpyOpt/align.ll Message-ID: <200909142339.n8ENdBg2020112@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 14 18:39:10 2009 New Revision: 81810 URL: http://llvm.org/viewvc/llvm-project?rev=81810&view=rev Log: When extending a memset range past the front, set the alignment of the memset region to the alignment of the new start address. Added: llvm/trunk/test/Transforms/MemCpyOpt/align.ll Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=81810&r1=81809&r2=81810&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Mon Sep 14 18:39:10 2009 @@ -273,6 +273,7 @@ if (Start < I->Start) { I->Start = Start; I->StartPtr = SI->getPointerOperand(); + I->Alignment = SI->getAlignment(); } // Now we know that Start <= I->End and Start >= I->Start (so the startpoint Added: llvm/trunk/test/Transforms/MemCpyOpt/align.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/align.ll?rev=81810&view=auto ============================================================================== --- llvm/trunk/test/Transforms/MemCpyOpt/align.ll (added) +++ llvm/trunk/test/Transforms/MemCpyOpt/align.ll Mon Sep 14 18:39:10 2009 @@ -0,0 +1,18 @@ +; RUN: opt < %s -S -memcpyopt | FileCheck %s + +; The resulting memset is only 4-byte aligned, despite containing +; a 16-byte alignmed store in the middle. + +; CHECK: call void @llvm.memset.i64(i8* %a01, i8 0, i64 16, i32 4) + +define void @foo(i32* %p) { + %a0 = getelementptr i32* %p, i64 0 + store i32 0, i32* %a0, align 4 + %a1 = getelementptr i32* %p, i64 1 + store i32 0, i32* %a1, align 16 + %a2 = getelementptr i32* %p, i64 2 + store i32 0, i32* %a2, align 4 + %a3 = getelementptr i32* %p, i64 3 + store i32 0, i32* %a3, align 4 + ret void +} From clattner at apple.com Mon Sep 14 18:40:14 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Sep 2009 16:40:14 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r81788 - /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C In-Reply-To: <5650EAC4-4B8F-4FEB-BE0A-AF5E0FE2A101@apple.com> References: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> <0F0E8899-5FF6-4605-8F4C-492718DC94E4@apple.com> <5650EAC4-4B8F-4FEB-BE0A-AF5E0FE2A101@apple.com> Message-ID: <9B99C10F-203C-4DB4-AFEF-47215F63F31D@apple.com> On Sep 14, 2009, at 2:58 PM, Mike Stump wrote: > On Sep 14, 2009, at 2:39 PM, Eric Christopher wrote: >> Mmm.. either way. I'm happy to revert as it's a bug by that >> definition :) > > Reversion is best I think as I suspect there are many failures in the > testsuite. Yes, I agree with mike, reverting is best IMO. If we were going from 1 failure to 0, I'd be ok with this, if we're going from 1000 failures to 999, it is best to leave it failing. Adding a comment to the testcase with a radar number pointing out the llvm issue would be a good idea though so that future people analyzing the issue won't redo the work you've done. -Chris > The thing being tested is actually a feature of gcc. > Testing for a non-feature, would be odd. If you wanted to test > results to be cleaner, you can mark it as expected. I can dig up the > older radar number for when we switched gcc to text, if you want > (please don't ask though). > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From natebegeman at mac.com Mon Sep 14 19:13:12 2009 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 15 Sep 2009 00:13:12 -0000 Subject: [llvm-commits] [llvm] r81813 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200909150013.n8F0DCbX024473@zion.cs.uiuc.edu> Author: sampo Date: Mon Sep 14 19:13:12 2009 New Revision: 81813 URL: http://llvm.org/viewvc/llvm-project?rev=81813&view=rev Log: Add an "original alignment" field to load and store nodes. This enables the DAG Combiner to disambiguate chains for loads and stores of types which are broken up by the Legalizer into smaller pieces. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=81813&r1=81812&r2=81813&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Sep 14 19:13:12 2009 @@ -544,7 +544,7 @@ /// SDValue getLoad(EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, bool isVolatile=false, - unsigned Alignment=0); + unsigned Alignment=0, unsigned OrigAlignment=0); SDValue getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, EVT EVT, bool isVolatile=false, @@ -552,16 +552,16 @@ SDValue getIndexedLoad(SDValue OrigLoad, DebugLoc dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM); SDValue getLoad(ISD::MemIndexedMode AM, DebugLoc dl, ISD::LoadExtType ExtType, - EVT VT, SDValue Chain, - SDValue Ptr, SDValue Offset, - const Value *SV, int SVOffset, EVT EVT, - bool isVolatile=false, unsigned Alignment=0); + EVT VT, SDValue Chain, SDValue Ptr, SDValue Offset, + const Value *SV, int SVOffset, EVT EVT, + bool isVolatile=false, unsigned Alignment=0, + unsigned OrigAlignment=0); /// getStore - Helper function to build ISD::STORE nodes. /// SDValue getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, const Value *SV, int SVOffset, bool isVolatile=false, - unsigned Alignment=0); + unsigned Alignment=0, unsigned OrigAlignment=0); SDValue getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, const Value *SV, int SVOffset, EVT TVT, bool isVolatile=false, unsigned Alignment=0); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=81813&r1=81812&r2=81813&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Sep 14 19:13:12 2009 @@ -1519,17 +1519,22 @@ //! SVOffset - Memory location offset. Note that base is defined in MemSDNode int SVOffset; + //! OrigAlign - The original alignment of this MemSDNode in the case where + // this node was created by legalize from a MemSDNode with known alignment. + unsigned OrigAlign; + public: MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, EVT MemoryVT, const Value *srcValue, int SVOff, - unsigned alignment, bool isvolatile); + unsigned alignment, bool isvolatile, unsigned oalign); MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, const SDValue *Ops, unsigned NumOps, EVT MemoryVT, const Value *srcValue, int SVOff, - unsigned alignment, bool isvolatile); + unsigned alignment, bool isvolatile, unsigned oalign); /// Returns alignment and volatility of the memory access unsigned getAlignment() const { return (1u << (SubclassData >> 6)) >> 1; } + unsigned getOriginalAlignment() const { return OrigAlign; } bool isVolatile() const { return (SubclassData >> 5) & 1; } /// getRawSubclassData - Return the SubclassData value, which contains an @@ -1600,14 +1605,14 @@ SDValue Cmp, SDValue Swp, const Value* SrcVal, unsigned Align=0) : MemSDNode(Opc, dl, VTL, MemVT, SrcVal, /*SVOffset=*/0, - Align, /*isVolatile=*/true) { + Align, /*isVolatile=*/true, /* OrigAlign=*/0) { InitOperands(Ops, Chain, Ptr, Cmp, Swp); } AtomicSDNode(unsigned Opc, DebugLoc dl, SDVTList VTL, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Val, const Value* SrcVal, unsigned Align=0) : MemSDNode(Opc, dl, VTL, MemVT, SrcVal, /*SVOffset=*/0, - Align, /*isVolatile=*/true) { + Align, /*isVolatile=*/true, /* OrigAlign=*/0) { InitOperands(Ops, Chain, Ptr, Val); } @@ -1648,7 +1653,8 @@ const SDValue *Ops, unsigned NumOps, EVT MemoryVT, const Value *srcValue, int SVO, unsigned Align, bool Vol, bool ReadMem, bool WriteMem) - : MemSDNode(Opc, dl, VTs, Ops, NumOps, MemoryVT, srcValue, SVO, Align, Vol), + : MemSDNode(Opc, dl, VTs, Ops, NumOps, MemoryVT, srcValue, SVO, Align, Vol, + /* OrigAlign=*/0), ReadMem(ReadMem), WriteMem(WriteMem) { } @@ -2263,8 +2269,9 @@ public: LSBaseSDNode(ISD::NodeType NodeTy, DebugLoc dl, SDValue *Operands, unsigned numOperands, SDVTList VTs, ISD::MemIndexedMode AM, - EVT VT, const Value *SV, int SVO, unsigned Align, bool Vol) - : MemSDNode(NodeTy, dl, VTs, VT, SV, SVO, Align, Vol) { + EVT VT, const Value *SV, int SVO, unsigned Align, bool Vol, + unsigned OAlign) + : MemSDNode(NodeTy, dl, VTs, VT, SV, SVO, Align, Vol, OAlign) { assert(Align != 0 && "Loads and stores should have non-zero aligment"); SubclassData |= AM << 2; assert(getAddressingMode() == AM && "MemIndexedMode encoding error!"); @@ -2302,9 +2309,10 @@ friend class SelectionDAG; LoadSDNode(SDValue *ChainPtrOff, DebugLoc dl, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, EVT LVT, - const Value *SV, int O=0, unsigned Align=0, bool Vol=false) + const Value *SV, int O=0, unsigned Align=0, bool Vol=false, + unsigned OAlign=0) : LSBaseSDNode(ISD::LOAD, dl, ChainPtrOff, 3, - VTs, AM, LVT, SV, O, Align, Vol) { + VTs, AM, LVT, SV, O, Align, Vol, OAlign) { SubclassData |= (unsigned short)ETy; assert(getExtensionType() == ETy && "LoadExtType encoding error!"); } @@ -2331,9 +2339,10 @@ friend class SelectionDAG; StoreSDNode(SDValue *ChainValuePtrOff, DebugLoc dl, SDVTList VTs, ISD::MemIndexedMode AM, bool isTrunc, EVT SVT, - const Value *SV, int O=0, unsigned Align=0, bool Vol=false) + const Value *SV, int O=0, unsigned Align=0, bool Vol=false, + unsigned OAlign=0) : LSBaseSDNode(ISD::STORE, dl, ChainValuePtrOff, 4, - VTs, AM, SVT, SV, O, Align, Vol) { + VTs, AM, SVT, SV, O, Align, Vol, OAlign) { SubclassData |= (unsigned short)isTrunc; assert(isTruncatingStore() == isTrunc && "isTrunc encoding error!"); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=81813&r1=81812&r2=81813&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Sep 14 19:13:12 2009 @@ -3646,9 +3646,12 @@ ISD::LoadExtType ExtType, EVT VT, SDValue Chain, SDValue Ptr, SDValue Offset, const Value *SV, int SVOffset, EVT EVT, - bool isVolatile, unsigned Alignment) { + bool isVolatile, unsigned Alignment, + unsigned OrigAlignment) { if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(VT); + if (OrigAlignment == 0) + OrigAlignment = Alignment; if (VT == EVT) { ExtType = ISD::NON_EXTLOAD; @@ -3679,12 +3682,13 @@ AddNodeIDNode(ID, ISD::LOAD, VTs, Ops, 3); ID.AddInteger(EVT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(ExtType, AM, isVolatile, Alignment)); + ID.AddInteger(OrigAlignment); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); SDNode *N = NodeAllocator.Allocate(); new (N) LoadSDNode(Ops, dl, VTs, AM, ExtType, EVT, SV, SVOffset, - Alignment, isVolatile); + Alignment, isVolatile, OrigAlignment); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); return SDValue(N, 0); @@ -3693,10 +3697,11 @@ SDValue SelectionDAG::getLoad(EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, - bool isVolatile, unsigned Alignment) { + bool isVolatile, unsigned Alignment, + unsigned OrigAlignment) { SDValue Undef = getUNDEF(Ptr.getValueType()); return getLoad(ISD::UNINDEXED, dl, ISD::NON_EXTLOAD, VT, Chain, Ptr, Undef, - SV, SVOffset, VT, isVolatile, Alignment); + SV, SVOffset, VT, isVolatile, Alignment, OrigAlignment); } SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT, @@ -3723,11 +3728,14 @@ SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, const Value *SV, int SVOffset, - bool isVolatile, unsigned Alignment) { + bool isVolatile, unsigned Alignment, + unsigned OrigAlignment) { EVT VT = Val.getValueType(); if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(VT); + if (OrigAlignment == 0) + OrigAlignment = Alignment; SDVTList VTs = getVTList(MVT::Other); SDValue Undef = getUNDEF(Ptr.getValueType()); @@ -3737,12 +3745,13 @@ ID.AddInteger(VT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(false, ISD::UNINDEXED, isVolatile, Alignment)); + ID.AddInteger(OrigAlignment); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); SDNode *N = NodeAllocator.Allocate(); new (N) StoreSDNode(Ops, dl, VTs, ISD::UNINDEXED, false, - VT, SV, SVOffset, Alignment, isVolatile); + VT, SV, SVOffset, Alignment, isVolatile, OrigAlignment); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); return SDValue(N, 0); @@ -4968,9 +4977,10 @@ } MemSDNode::MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, EVT memvt, - const Value *srcValue, int SVO, - unsigned alignment, bool vol) - : SDNode(Opc, dl, VTs), MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO) { + const Value *srcValue, int SVO, unsigned alignment, + bool vol, unsigned origAlign) + : SDNode(Opc, dl, VTs), MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO), + OrigAlign(origAlign) { SubclassData = encodeMemSDNodeFlags(0, ISD::UNINDEXED, vol, alignment); assert(isPowerOf2_32(alignment) && "Alignment is not a power of 2!"); assert(getAlignment() == alignment && "Alignment representation error!"); @@ -4978,11 +4988,11 @@ } MemSDNode::MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, - const SDValue *Ops, - unsigned NumOps, EVT memvt, const Value *srcValue, - int SVO, unsigned alignment, bool vol) + const SDValue *Ops, unsigned NumOps, EVT memvt, + const Value *srcValue, int SVO, unsigned alignment, + bool vol, unsigned origAlign) : SDNode(Opc, dl, VTs, Ops, NumOps), - MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO) { + MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO), OrigAlign(origAlign) { SubclassData = encodeMemSDNodeFlags(0, ISD::UNINDEXED, vol, alignment); assert(isPowerOf2_32(alignment) && "Alignment is not a power of 2!"); assert(getAlignment() == alignment && "Alignment representation error!"); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=81813&r1=81812&r2=81813&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Sep 14 19:13:12 2009 @@ -2812,11 +2812,10 @@ EVT PtrVT = Ptr.getValueType(); for (unsigned i = 0; i != NumValues; ++i) { SDValue L = DAG.getLoad(ValueVTs[i], getCurDebugLoc(), Root, - DAG.getNode(ISD::ADD, getCurDebugLoc(), - PtrVT, Ptr, - DAG.getConstant(Offsets[i], PtrVT)), - SV, Offsets[i], - isVolatile, Alignment); + DAG.getNode(ISD::ADD, getCurDebugLoc(), + PtrVT, Ptr, + DAG.getConstant(Offsets[i], PtrVT)), + SV, Offsets[i], isVolatile, Alignment, Alignment); Values[i] = L; Chains[i] = L.getValue(1); } @@ -2866,7 +2865,7 @@ PtrVT, Ptr, DAG.getConstant(Offsets[i], PtrVT)), PtrV, Offsets[i], - isVolatile, Alignment); + isVolatile, Alignment, Alignment); DAG.setRoot(DAG.getNode(ISD::TokenFactor, getCurDebugLoc(), MVT::Other, &Chains[0], NumValues)); From gohman at apple.com Mon Sep 14 19:14:11 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 00:14:11 -0000 Subject: [llvm-commits] [llvm] r81814 - in /llvm/trunk: lib/Target/X86/X86Instr64bit.td test/CodeGen/X86/cmov-zext.ll Message-ID: <200909150014.n8F0EBt6024605@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 14 19:14:11 2009 New Revision: 81814 URL: http://llvm.org/viewvc/llvm-project?rev=81814&view=rev Log: On x86-64, the 32-bit cmov doesn't actually clear the high 32-bit of its result if the condition is false. Added: llvm/trunk/test/CodeGen/X86/cmov-zext.ll Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=81814&r1=81813&r2=81814&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Sep 14 19:14:11 2009 @@ -387,13 +387,15 @@ [(set GR64:$dst, (zextloadi64i32 addr:$src))]>; // Any instruction that defines a 32-bit result leaves the high half of the -// register. Truncate can be lowered to EXTRACT_SUBREG, and CopyFromReg may -// be copying from a truncate, but any other 32-bit operation will zero-extend +// register. Truncate can be lowered to EXTRACT_SUBREG. CopyFromReg may +// be copying from a truncate. And x86's cmov doesn't do anything if the +// condition is false. But any other 32-bit operation will zero-extend // up to 64 bits. def def32 : PatLeaf<(i32 GR32:$src), [{ return N->getOpcode() != ISD::TRUNCATE && N->getOpcode() != TargetInstrInfo::EXTRACT_SUBREG && - N->getOpcode() != ISD::CopyFromReg; + N->getOpcode() != ISD::CopyFromReg && + N->getOpcode() != X86ISD::CMOV; }]>; // In the case of a 32-bit def that is known to implicitly zero-extend, Added: llvm/trunk/test/CodeGen/X86/cmov-zext.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov-zext.ll?rev=81814&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/cmov-zext.ll (added) +++ llvm/trunk/test/CodeGen/X86/cmov-zext.ll Mon Sep 14 19:14:11 2009 @@ -0,0 +1,19 @@ +; RUN: llc < %s -march=x86-64 | FileCheck %s + +; x86's 32-bit cmov doesn't clobber the high 32 bits of the destination +; if the condition is false. An explicit zero-extend (movl) is needed +; after the cmov. + +; CHECK: cmovne %edi, %esi +; CHECK-NEXT: movl %esi, %edi + +declare void @bar(i64) nounwind + +define void @foo(i64 %a, i64 %b, i1 %p) nounwind { + %c = trunc i64 %a to i32 + %d = trunc i64 %b to i32 + %e = select i1 %p, i32 %c, i32 %d + %f = zext i32 %e to i64 + call void @bar(i64 %f) + ret void +} From natebegeman at mac.com Mon Sep 14 19:14:29 2009 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 15 Sep 2009 00:14:29 -0000 Subject: [llvm-commits] [llvm] r81815 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Message-ID: <200909150014.n8F0ETD1024652@zion.cs.uiuc.edu> Author: sampo Date: Mon Sep 14 19:14:28 2009 New Revision: 81815 URL: http://llvm.org/viewvc/llvm-project?rev=81815&view=rev Log: Teach the legalizer to propagate the original alignment of loads and store when it splits them. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=81815&r1=81814&r2=81815&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Sep 14 19:14:28 2009 @@ -170,7 +170,8 @@ DAG.getUNDEF(N->getBasePtr().getValueType()), N->getSrcValue(), N->getSrcValueOffset(), N->getMemoryVT().getVectorElementType(), - N->isVolatile(), N->getAlignment()); + N->isVolatile(), N->getAlignment(), + N->getOriginalAlignment()); // Legalized the chain result - switch anything that used the old chain to // use the new one. @@ -360,7 +361,8 @@ return DAG.getStore(N->getChain(), dl, GetScalarizedVector(N->getOperand(1)), N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), - N->isVolatile(), N->getAlignment()); + N->isVolatile(), N->getAlignment(), + N->getOriginalAlignment()); } @@ -715,13 +717,14 @@ int SVOffset = LD->getSrcValueOffset(); EVT MemoryVT = LD->getMemoryVT(); unsigned Alignment = LD->getAlignment(); + unsigned OrigAlignment = LD->getOriginalAlignment(); bool isVolatile = LD->isVolatile(); EVT LoMemVT, HiMemVT; GetSplitDestVTs(MemoryVT, LoMemVT, HiMemVT); Lo = DAG.getLoad(ISD::UNINDEXED, dl, ExtType, LoVT, Ch, Ptr, Offset, - SV, SVOffset, LoMemVT, isVolatile, Alignment); + SV, SVOffset, LoMemVT, isVolatile, Alignment, OrigAlignment); unsigned IncrementSize = LoMemVT.getSizeInBits()/8; Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, @@ -729,7 +732,7 @@ SVOffset += IncrementSize; Alignment = MinAlign(Alignment, IncrementSize); Hi = DAG.getLoad(ISD::UNINDEXED, dl, ExtType, HiVT, Ch, Ptr, Offset, - SV, SVOffset, HiMemVT, isVolatile, Alignment); + SV, SVOffset, HiMemVT, isVolatile, Alignment, OrigAlignment); // Build a factor node to remember that this load is independent of the // other one. @@ -1079,6 +1082,7 @@ int SVOffset = N->getSrcValueOffset(); EVT MemoryVT = N->getMemoryVT(); unsigned Alignment = N->getAlignment(); + unsigned OrigAlignment = N->getOriginalAlignment(); bool isVol = N->isVolatile(); SDValue Lo, Hi; GetSplitVector(N->getOperand(1), Lo, Hi); @@ -1093,7 +1097,7 @@ LoMemVT, isVol, Alignment); else Lo = DAG.getStore(Ch, dl, Lo, Ptr, N->getSrcValue(), SVOffset, - isVol, Alignment); + isVol, Alignment, OrigAlignment); // Increment the pointer to the other half. Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, @@ -1106,7 +1110,8 @@ isVol, MinAlign(Alignment, IncrementSize)); else Hi = DAG.getStore(Ch, dl, Hi, Ptr, N->getSrcValue(), SVOffset+IncrementSize, - isVol, MinAlign(Alignment, IncrementSize)); + isVol, MinAlign(Alignment, IncrementSize), + OrigAlignment); return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Lo, Hi); } From natebegeman at mac.com Mon Sep 14 19:18:30 2009 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 15 Sep 2009 00:18:30 -0000 Subject: [llvm-commits] [llvm] r81816 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200909150018.n8F0IUmY025160@zion.cs.uiuc.edu> Author: sampo Date: Mon Sep 14 19:18:30 2009 New Revision: 81816 URL: http://llvm.org/viewvc/llvm-project?rev=81816&view=rev Log: Substantially speed up combiner-aa in the following ways: 1. Switch from an std::set to a SmallPtrSet for visited chain nodes. 2. Do not force the recursive flattening of token factor nodes, regardless of use count. 3. Immediately process newly created TokenFactor nodes. Also, improve combiner-aa by teaching it that loads to non-overlapping offsets of relatively aligned objects cannot alias. These changes result in a >5x speedup for combiner-aa on most testcases. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=81816&r1=81815&r2=81816&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Sep 14 19:18:30 2009 @@ -239,14 +239,17 @@ /// overlap. bool isAlias(SDValue Ptr1, int64_t Size1, const Value *SrcValue1, int SrcValueOffset1, + unsigned SrcValueAlign1, SDValue Ptr2, int64_t Size2, - const Value *SrcValue2, int SrcValueOffset2) const; + const Value *SrcValue2, int SrcValueOffset2, + unsigned SrcValueAlign2) const; /// FindAliasInfo - Extracts the relevant alias information from the memory /// node. Returns true if the operand was a load. bool FindAliasInfo(SDNode *N, SDValue &Ptr, int64_t &Size, - const Value *&SrcValue, int &SrcValueOffset) const; + const Value *&SrcValue, int &SrcValueOffset, + unsigned &SrcValueAlignment) const; /// FindBetterChain - Walk up chain skipping non-aliasing memory nodes, /// looking for a better chain (aliasing node.) @@ -886,7 +889,7 @@ break; case ISD::TokenFactor: - if ((CombinerAA || Op.hasOneUse()) && + if (Op.hasOneUse() && std::find(TFs.begin(), TFs.end(), Op.getNode()) == TFs.end()) { // Queue up for processing. TFs.push_back(Op.getNode()); @@ -907,7 +910,7 @@ } } } - + SDValue Result; // If we've change things around then replace token factor. @@ -4959,7 +4962,10 @@ // Create token factor to keep old chain connected. SDValue Token = DAG.getNode(ISD::TokenFactor, N->getDebugLoc(), MVT::Other, Chain, ReplLoad.getValue(1)); - + + // Make sure the new and old chains are cleaned up. + AddToWorkList(Token.getNode()); + // Replace uses with load result and token factor. Don't add users // to work list. return CombineTo(N, ReplLoad.getValue(0), Token, false); @@ -5180,8 +5186,9 @@ // If there is a better chain. if (Chain != BetterChain) { - // Replace the chain to avoid dependency. SDValue ReplStore; + + // Replace the chain to avoid dependency. if (ST->isTruncatingStore()) { ReplStore = DAG.getTruncStore(BetterChain, N->getDebugLoc(), Value, Ptr, ST->getSrcValue(),ST->getSrcValueOffset(), @@ -5197,6 +5204,9 @@ SDValue Token = DAG.getNode(ISD::TokenFactor, N->getDebugLoc(), MVT::Other, Chain, ReplStore); + // Make sure the new and old chains are cleaned up. + AddToWorkList(Token.getNode()); + // Don't add users to work list. return CombineTo(N, Token, false); } @@ -6103,8 +6113,10 @@ /// overlap. bool DAGCombiner::isAlias(SDValue Ptr1, int64_t Size1, const Value *SrcValue1, int SrcValueOffset1, + unsigned SrcValueAlign1, SDValue Ptr2, int64_t Size2, - const Value *SrcValue2, int SrcValueOffset2) const { + const Value *SrcValue2, int SrcValueOffset2, + unsigned SrcValueAlign2) const { // If they are the same then they must be aliases. if (Ptr1 == Ptr2) return true; @@ -6122,6 +6134,22 @@ // If we know both bases then they can't alias. if (KnownBase1 && KnownBase2) return false; + // If we know required SrcValue1 and SrcValue2 have relatively large alignment + // compared to the size and offset of the access, we may be able to prove they + // do not alias. This check is conservative for now to catch cases created by + // splitting vector types. + if ((SrcValueAlign1 == SrcValueAlign2) && + (SrcValueOffset1 != SrcValueOffset2) && + (Size1 == Size2) && (SrcValueAlign1 > Size1)) { + int64_t OffAlign1 = SrcValueOffset1 % SrcValueAlign1; + int64_t OffAlign2 = SrcValueOffset2 % SrcValueAlign1; + + // There is no overlap between these relatively aligned accesses of similar + // size, return no alias. + if ((OffAlign1 + Size1) <= OffAlign2 || (OffAlign2 + Size2) <= OffAlign1) + return false; + } + if (CombinerGlobalAA) { // Use alias analysis information. int64_t MinOffset = std::min(SrcValueOffset1, SrcValueOffset2); @@ -6141,18 +6169,22 @@ /// node. Returns true if the operand was a load. bool DAGCombiner::FindAliasInfo(SDNode *N, SDValue &Ptr, int64_t &Size, - const Value *&SrcValue, int &SrcValueOffset) const { + const Value *&SrcValue, + int &SrcValueOffset, + unsigned &SrcValueAlign) const { if (LoadSDNode *LD = dyn_cast(N)) { Ptr = LD->getBasePtr(); Size = LD->getMemoryVT().getSizeInBits() >> 3; SrcValue = LD->getSrcValue(); SrcValueOffset = LD->getSrcValueOffset(); + SrcValueAlign = LD->getOriginalAlignment(); return true; } else if (StoreSDNode *ST = dyn_cast(N)) { Ptr = ST->getBasePtr(); Size = ST->getMemoryVT().getSizeInBits() >> 3; SrcValue = ST->getSrcValue(); SrcValueOffset = ST->getSrcValueOffset(); + SrcValueAlign = ST->getOriginalAlignment(); } else { llvm_unreachable("FindAliasInfo expected a memory operand"); } @@ -6165,14 +6197,16 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain, SmallVector &Aliases) { SmallVector Chains; // List of chains to visit. - std::set Visited; // Visited node set. + SmallPtrSet Visited; // Visited node set. // Get alias information for node. SDValue Ptr; - int64_t Size = 0; - const Value *SrcValue = 0; - int SrcValueOffset = 0; - bool IsLoad = FindAliasInfo(N, Ptr, Size, SrcValue, SrcValueOffset); + int64_t Size; + const Value *SrcValue; + int SrcValueOffset; + unsigned SrcValueAlign; + bool IsLoad = FindAliasInfo(N, Ptr, Size, SrcValue, SrcValueOffset, + SrcValueAlign); // Starting off. Chains.push_back(OriginalChain); @@ -6184,9 +6218,9 @@ SDValue Chain = Chains.back(); Chains.pop_back(); - // Don't bother if we've been before. - if (Visited.find(Chain.getNode()) != Visited.end()) continue; - Visited.insert(Chain.getNode()); + // Don't bother if we've been before. + if (!Visited.insert(Chain.getNode())) + continue; switch (Chain.getOpcode()) { case ISD::EntryToken: @@ -6197,16 +6231,19 @@ case ISD::STORE: { // Get alias information for Chain. SDValue OpPtr; - int64_t OpSize = 0; - const Value *OpSrcValue = 0; - int OpSrcValueOffset = 0; + int64_t OpSize; + const Value *OpSrcValue; + int OpSrcValueOffset; + unsigned OpSrcValueAlign; bool IsOpLoad = FindAliasInfo(Chain.getNode(), OpPtr, OpSize, - OpSrcValue, OpSrcValueOffset); + OpSrcValue, OpSrcValueOffset, + OpSrcValueAlign); // If chain is alias then stop here. if (!(IsLoad && IsOpLoad) && - isAlias(Ptr, Size, SrcValue, SrcValueOffset, - OpPtr, OpSize, OpSrcValue, OpSrcValueOffset)) { + isAlias(Ptr, Size, SrcValue, SrcValueOffset, SrcValueAlign, + OpPtr, OpSize, OpSrcValue, OpSrcValueOffset, + OpSrcValueAlign)) { Aliases.push_back(Chain); } else { // Look further up the chain. @@ -6218,10 +6255,14 @@ } case ISD::TokenFactor: - // We have to check each of the operands of the token factor, so we queue - // then up. Adding the operands to the queue (stack) in reverse order - // maintains the original order and increases the likelihood that getNode - // will find a matching token factor (CSE.) + // We have to check each of the operands of the token factor for "small" + // token factors, so we queue them up. Adding the operands to the queue + // (stack) in reverse order maintains the original order and increases the + // likelihood that getNode will find a matching token factor (CSE.) + if (Chain.getNumOperands() > 16) { + Aliases.push_back(Chain); + break; + } for (unsigned n = Chain.getNumOperands(); n;) Chains.push_back(Chain.getOperand(--n)); // Eliminate the token factor if we can. @@ -6253,13 +6294,8 @@ } // Construct a custom tailored token factor. - SDValue NewChain = DAG.getNode(ISD::TokenFactor, N->getDebugLoc(), MVT::Other, - &Aliases[0], Aliases.size()); - - // Make sure the old chain gets cleaned up. - if (NewChain != OldChain) AddToWorkList(OldChain.getNode()); - - return NewChain; + return DAG.getNode(ISD::TokenFactor, N->getDebugLoc(), MVT::Other, + &Aliases[0], Aliases.size()); } // SelectionDAG::Combine - This is the entry point for the file. From enderby at apple.com Mon Sep 14 19:27:26 2009 From: enderby at apple.com (Kevin Enderby) Date: Tue, 15 Sep 2009 00:27:26 -0000 Subject: [llvm-commits] [llvm] r81817 - in /llvm/trunk: lib/Target/ARM/AsmParser/ lib/Target/ARM/AsmParser/ARMAsmParser.cpp lib/Target/ARM/AsmParser/CMakeLists.txt lib/Target/ARM/AsmParser/Makefile lib/Target/ARM/Makefile test/MC/AsmParser/arm_word_directive.s test/MC/AsmParser/directive_values.s test/MC/AsmParser/x86_word_directive.s Message-ID: <200909150027.n8F0RQUw026432@zion.cs.uiuc.edu> Author: enderby Date: Mon Sep 14 19:27:25 2009 New Revision: 81817 URL: http://llvm.org/viewvc/llvm-project?rev=81817&view=rev Log: Added the first bits of the ARM target assembler to llvm-mc. For now it only parses the .word directive as 4 bytes and ARMAsmParser::ParseInstruction will give an error is called. Broke out the test of the .word directive into two different test cases, one for x86 and one for arm. Added: llvm/trunk/lib/Target/ARM/AsmParser/ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt llvm/trunk/lib/Target/ARM/AsmParser/Makefile llvm/trunk/test/MC/AsmParser/arm_word_directive.s llvm/trunk/test/MC/AsmParser/x86_word_directive.s Modified: llvm/trunk/lib/Target/ARM/Makefile llvm/trunk/test/MC/AsmParser/directive_values.s Added: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=81817&view=auto ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (added) +++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Mon Sep 14 19:27:25 2009 @@ -0,0 +1,93 @@ +//===-- ARMAsmParser.cpp - Parse ARM assembly to MCInst instructions ------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "ARM.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Twine.h" +#include "llvm/MC/MCAsmLexer.h" +#include "llvm/MC/MCAsmParser.h" +#include "llvm/MC/MCStreamer.h" +#include "llvm/MC/MCExpr.h" +#include "llvm/MC/MCInst.h" +#include "llvm/Support/SourceMgr.h" +#include "llvm/Target/TargetRegistry.h" +#include "llvm/Target/TargetAsmParser.h" +using namespace llvm; + +namespace { +struct ARMOperand; + +class ARMAsmParser : public TargetAsmParser { + MCAsmParser &Parser; + +private: + MCAsmParser &getParser() const { return Parser; } + + MCAsmLexer &getLexer() const { return Parser.getLexer(); } + + void Warning(SMLoc L, const Twine &Msg) { Parser.Warning(L, Msg); } + + bool Error(SMLoc L, const Twine &Msg) { return Parser.Error(L, Msg); } + + bool ParseDirectiveWord(unsigned Size, SMLoc L); + +public: + ARMAsmParser(const Target &T, MCAsmParser &_Parser) + : TargetAsmParser(T), Parser(_Parser) {} + + virtual bool ParseInstruction(const StringRef &Name, MCInst &Inst); + + virtual bool ParseDirective(AsmToken DirectiveID); +}; + +} // end anonymous namespace + +bool ARMAsmParser::ParseInstruction(const StringRef &Name, MCInst &Inst) { + SMLoc Loc = getLexer().getTok().getLoc(); + Error(Loc, "ARMAsmParser::ParseInstruction currently unimplemented"); + return true; +} + +bool ARMAsmParser::ParseDirective(AsmToken DirectiveID) { + StringRef IDVal = DirectiveID.getIdentifier(); + if (IDVal == ".word") + return ParseDirectiveWord(4, DirectiveID.getLoc()); + return true; +} + +/// ParseDirectiveWord +/// ::= .word [ expression (, expression)* ] +bool ARMAsmParser::ParseDirectiveWord(unsigned Size, SMLoc L) { + if (getLexer().isNot(AsmToken::EndOfStatement)) { + for (;;) { + const MCExpr *Value; + if (getParser().ParseExpression(Value)) + return true; + + getParser().getStreamer().EmitValue(Value, Size); + + if (getLexer().is(AsmToken::EndOfStatement)) + break; + + // FIXME: Improve diagnostic. + if (getLexer().isNot(AsmToken::Comma)) + return Error(L, "unexpected token in directive"); + getLexer().Lex(); + } + } + + getLexer().Lex(); + return false; +} + +// Force static initialization. +extern "C" void LLVMInitializeARMAsmParser() { + RegisterAsmParser X(TheARMTarget); + RegisterAsmParser Y(TheThumbTarget); +} Added: llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt?rev=81817&view=auto ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt (added) +++ llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt Mon Sep 14 19:27:25 2009 @@ -0,0 +1,6 @@ +include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) + +add_llvm_library(LLVMARMAsmParser + ARMAsmParser.cpp + ) +add_dependencies(LLVMARMAsmParser) Added: llvm/trunk/lib/Target/ARM/AsmParser/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/Makefile?rev=81817&view=auto ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmParser/Makefile (added) +++ llvm/trunk/lib/Target/ARM/AsmParser/Makefile Mon Sep 14 19:27:25 2009 @@ -0,0 +1,15 @@ +##===- lib/Target/ARM/AsmParser/Makefile -------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LEVEL = ../../../.. +LIBRARYNAME = LLVMARMAsmParser + +# Hack: we need to include 'main' ARM target directory to grab private headers +CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. + +include $(LEVEL)/Makefile.common Modified: llvm/trunk/lib/Target/ARM/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Makefile?rev=81817&r1=81816&r2=81817&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Makefile (original) +++ llvm/trunk/lib/Target/ARM/Makefile Mon Sep 14 19:27:25 2009 @@ -18,6 +18,6 @@ ARMGenDAGISel.inc ARMGenSubtarget.inc \ ARMGenCodeEmitter.inc ARMGenCallingConv.inc -DIRS = AsmPrinter TargetInfo +DIRS = AsmPrinter AsmParser TargetInfo include $(LEVEL)/Makefile.common Added: llvm/trunk/test/MC/AsmParser/arm_word_directive.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/arm_word_directive.s?rev=81817&view=auto ============================================================================== --- llvm/trunk/test/MC/AsmParser/arm_word_directive.s (added) +++ llvm/trunk/test/MC/AsmParser/arm_word_directive.s Mon Sep 14 19:27:25 2009 @@ -0,0 +1,6 @@ +@ RUN: llvm-mc -triple arm-unknown-unknown %s | FileCheck %s + +@ CHECK: TEST0: +@ CHECK: .long 3 +TEST0: + .word 3 Modified: llvm/trunk/test/MC/AsmParser/directive_values.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_values.s?rev=81817&r1=81816&r2=81817&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/directive_values.s (original) +++ llvm/trunk/test/MC/AsmParser/directive_values.s Mon Sep 14 19:27:25 2009 @@ -19,8 +19,3 @@ # CHECK: .quad 9 TEST3: .quad 9 - -# CHECK: TEST4: -# CHECK: .short 3 -TEST4: - .word 3 Added: llvm/trunk/test/MC/AsmParser/x86_word_directive.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/x86_word_directive.s?rev=81817&view=auto ============================================================================== --- llvm/trunk/test/MC/AsmParser/x86_word_directive.s (added) +++ llvm/trunk/test/MC/AsmParser/x86_word_directive.s Mon Sep 14 19:27:25 2009 @@ -0,0 +1,6 @@ +# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s + +# CHECK: TEST0: +# CHECK: .short 3 +TEST0: + .word 3 From scallanan at apple.com Mon Sep 14 19:35:17 2009 From: scallanan at apple.com (Sean Callanan) Date: Tue, 15 Sep 2009 00:35:17 -0000 Subject: [llvm-commits] [llvm] r81818 - in /llvm/trunk/lib/Target/X86: X86InstrFormats.td X86InstrInfo.td Message-ID: <200909150035.n8F0ZIBH027512@zion.cs.uiuc.edu> Author: spyffe Date: Mon Sep 14 19:35:17 2009 New Revision: 81818 URL: http://llvm.org/viewvc/llvm-project?rev=81818&view=rev Log: Modified the Intel instruction tables to include versions of CALL and JMP with segmented addresses provided in-line, as pairs of immediates. Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=81818&r1=81817&r2=81818&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Mon Sep 14 19:35:17 2009 @@ -143,6 +143,24 @@ let Pattern = pattern; } +// Templates for instructions that use a 16- or 32-bit segmented address as +// their only operand: lcall (FAR CALL) and ljmp (FAR JMP) +// +// Iseg16 - 16-bit segment selector, 16-bit offset +// Iseg32 - 16-bit segment selector, 32-bit offset + +class Iseg16 o, Format f, dag outs, dag ins, string asm, + list pattern> : X86Inst { + let Pattern = pattern; + let CodeSize = 3; +} + +class Iseg32 o, Format f, dag outs, dag ins, string asm, + list pattern> : X86Inst { + let Pattern = pattern; + let CodeSize = 3; +} + // SSE1 Instruction Templates: // // SSI - SSE1 instructions with XS prefix. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=81818&r1=81817&r2=81818&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Sep 14 19:35:17 2009 @@ -584,9 +584,17 @@ [(brind GR32:$dst)]>; def JMP32m : I<0xFF, MRM4m, (outs), (ins i32mem:$dst), "jmp{l}\t{*}$dst", [(brind (loadi32 addr:$dst))]>; - def FARJMP16 : I<0xFF, MRM5m, (outs), (ins opaque32mem:$dst), + + def FARJMP16i : Iseg16<0xEA, RawFrm, (outs), + (ins i16imm:$seg, i16imm:$off), + "ljmp{w}\t$seg, $off", []>, OpSize; + def FARJMP32i : Iseg32<0xEA, RawFrm, (outs), + (ins i16imm:$seg, i32imm:$off), + "ljmp{l}\t$seg, $off", []>; + + def FARJMP16m : I<0xFF, MRM5m, (outs), (ins opaque32mem:$dst), "ljmp{w}\t{*}$dst", []>, OpSize; - def FARJMP32 : I<0xFF, MRM5m, (outs), (ins opaque48mem:$dst), + def FARJMP32m : I<0xFF, MRM5m, (outs), (ins opaque48mem:$dst), "ljmp{l}\t{*}$dst", []>; } @@ -669,9 +677,16 @@ def CALL32m : I<0xFF, MRM2m, (outs), (ins i32mem:$dst, variable_ops), "call\t{*}$dst", [(X86call (loadi32 addr:$dst))]>; - def FARCALL16 : I<0xFF, MRM3m, (outs), (ins opaque32mem:$dst), + def FARCALL16i : Iseg16<0x9A, RawFrm, (outs), + (ins i16imm:$seg, i16imm:$off), + "lcall{w}\t$seg, $off", []>, OpSize; + def FARCALL32i : Iseg32<0x9A, RawFrm, (outs), + (ins i16imm:$seg, i32imm:$off), + "lcall{l}\t$seg, $off", []>; + + def FARCALL16m : I<0xFF, MRM3m, (outs), (ins opaque32mem:$dst), "lcall{w}\t{*}$dst", []>, OpSize; - def FARCALL32 : I<0xFF, MRM3m, (outs), (ins opaque48mem:$dst), + def FARCALL32m : I<0xFF, MRM3m, (outs), (ins opaque48mem:$dst), "lcall{l}\t{*}$dst", []>; } From natebegeman at mac.com Mon Sep 14 19:38:09 2009 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 15 Sep 2009 00:38:09 -0000 Subject: [llvm-commits] [llvm] r81819 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200909150038.n8F0c9Kq027893@zion.cs.uiuc.edu> Author: sampo Date: Mon Sep 14 19:38:09 2009 New Revision: 81819 URL: http://llvm.org/viewvc/llvm-project?rev=81819&view=rev Log: Remove incorrect CSE code from r81813. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=81819&r1=81818&r2=81819&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Sep 14 19:38:09 2009 @@ -3682,7 +3682,6 @@ AddNodeIDNode(ID, ISD::LOAD, VTs, Ops, 3); ID.AddInteger(EVT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(ExtType, AM, isVolatile, Alignment)); - ID.AddInteger(OrigAlignment); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); @@ -3745,7 +3744,6 @@ ID.AddInteger(VT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(false, ISD::UNINDEXED, isVolatile, Alignment)); - ID.AddInteger(OrigAlignment); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); From wendling at apple.com Mon Sep 14 20:02:22 2009 From: wendling at apple.com (Bill Wendling) Date: Mon, 14 Sep 2009 18:02:22 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r81788 - /llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C In-Reply-To: <5650EAC4-4B8F-4FEB-BE0A-AF5E0FE2A101@apple.com> References: <200909142113.n8ELDnQK000590@zion.cs.uiuc.edu> <0F0E8899-5FF6-4605-8F4C-492718DC94E4@apple.com> <5650EAC4-4B8F-4FEB-BE0A-AF5E0FE2A101@apple.com> Message-ID: <5F4B670F-0A52-4107-9805-2DCA43755206@apple.com> On Sep 14, 2009, at 2:58 PM, Mike Stump wrote: > On Sep 14, 2009, at 2:39 PM, Eric Christopher wrote: >> Mmm.. either way. I'm happy to revert as it's a bug by that >> definition :) > > Reversion is best I think as I suspect there are many failures in > the testsuite. The thing being tested is actually a feature of > gcc. Testing for a non-feature, would be odd. If you wanted to > test results to be cleaner, you can mark it as expected. I can dig > up the older radar number for when we switched gcc to text, if you > want (please don't ask though). No need. I have it in the radar I'm working on already to switch to __TEXT. -bw From gohman at apple.com Mon Sep 14 20:22:01 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 01:22:01 -0000 Subject: [llvm-commits] [llvm] r81821 - in /llvm/trunk: lib/Target/X86/X86ISelDAGToDAG.cpp test/CodeGen/X86/combiner-aa-1.ll Message-ID: <200909150122.n8F1M1kC000958@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 14 20:22:01 2009 New Revision: 81821 URL: http://llvm.org/viewvc/llvm-project?rev=81821&view=rev Log: Don't pull a load through a callseq_start if the load's chain has multiple uses, as one of the other uses may be on a path to a different node above the callseq_start, because that leads to a cyclic graph. This problem is exposed when -combiner-global-alias-analysis is used. This fixes PR4880. Added: llvm/trunk/test/CodeGen/X86/combiner-aa-1.ll Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=81821&r1=81820&r2=81821&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Sep 14 20:22:01 2009 @@ -447,7 +447,8 @@ if (Chain.getOperand(0).getNode() == Callee.getNode()) return true; if (Chain.getOperand(0).getOpcode() == ISD::TokenFactor && - Callee.getValue(1).isOperandOf(Chain.getOperand(0).getNode())) + Callee.getValue(1).isOperandOf(Chain.getOperand(0).getNode()) && + Callee.getValue(1).hasOneUse()) return true; return false; } Added: llvm/trunk/test/CodeGen/X86/combiner-aa-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/combiner-aa-1.ll?rev=81821&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/combiner-aa-1.ll (added) +++ llvm/trunk/test/CodeGen/X86/combiner-aa-1.ll Mon Sep 14 20:22:01 2009 @@ -0,0 +1,23 @@ +; RUN: llc < %s --combiner-alias-analysis --combiner-global-alias-analysis +; PR4880 + +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:32:32" +target triple = "i386-pc-linux-gnu" + +%struct.alst_node = type { %struct.node } +%struct.arg_node = type { %struct.node, i8*, %struct.alst_node* } +%struct.arglst_node = type { %struct.alst_node, %struct.arg_node*, %struct.arglst_node* } +%struct.lam_node = type { %struct.alst_node, %struct.arg_node*, %struct.alst_node* } +%struct.node = type { i32 (...)**, %struct.node* } + +define i32 @._ZN8lam_node18resolve_name_clashEP8arg_nodeP9alst_node._ZNK8lam_nodeeqERK8exp_node._ZN11arglst_nodeD0Ev(%struct.lam_node* %this.this, %struct.arg_node* %outer_arg, %struct.alst_node* %env.cmp, %struct.arglst_node* %this, i32 %functionID) { +comb_entry: + %.SV59 = alloca %struct.node* ; <%struct.node**> [#uses=1] + %0 = load i32 (...)*** null, align 4 ; [#uses=1] + %1 = getelementptr inbounds i32 (...)** %0, i32 3 ; [#uses=1] + %2 = load i32 (...)** %1, align 4 ; [#uses=1] + store %struct.node* undef, %struct.node** %.SV59 + %3 = bitcast i32 (...)* %2 to i32 (%struct.node*)* ; [#uses=1] + %4 = tail call i32 %3(%struct.node* undef) ; [#uses=0] + unreachable +} From evan.cheng at apple.com Mon Sep 14 20:32:25 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 14 Sep 2009 18:32:25 -0700 Subject: [llvm-commits] [llvm] r81657 - in /llvm/trunk: lib/Target/ARM/ARMRegisterInfo.td test/CodeGen/ARM/2009-09-13-InvalidSubreg.ll In-Reply-To: <200909130059.n8D0xhIF024496@zion.cs.uiuc.edu> References: <200909130059.n8D0xhIF024496@zion.cs.uiuc.edu> Message-ID: On Sep 12, 2009, at 5:59 PM, Anton Korobeynikov wrote: > > + > +// Dummy f32 regclass to represent impossible subreg indices. > +def SPR_INVALID : RegisterClass<"ARM", [f32], 32, [SDummy]> { > + let CopyCost = -1; > +} > + Hi Anton, Could you explain why this is needed? Evan > // Scalar double precision floating point / generic 64-bit vector > register > // class. > // ARM requires only word alignment for double. It's more performant > if it > @@ -262,7 +274,7 @@ > D8, D9, D10, D11, D12, D13, D14, D15, > D16, D17, D18, D19, D20, D21, D22, D23, > D24, D25, D26, D27, D28, D29, D30, D31]> { > - let SubRegClassList = [SPR, SPR]; > + let SubRegClassList = [SPR_INVALID, SPR_INVALID]; > let MethodProtos = [{ > iterator allocation_order_begin(const MachineFunction &MF) const; > iterator allocation_order_end(const MachineFunction &MF) const; > @@ -317,14 +329,22 @@ > // operations > def DPR_8 : RegisterClass<"ARM", [f64, v4i16, v2f32], 64, > [D0, D1, D2, D3, D4, D5, D6, D7]> { > - let SubRegClassList = [SPR, SPR]; > + let SubRegClassList = [SPR_8, SPR_8]; > } > > // Generic 128-bit vector register class. > def QPR : RegisterClass<"ARM", [v16i8, v8i16, v4i32, v2i64, v4f32, > v2f64], 128, > [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, > Q8, Q9, Q10, Q11, Q12, Q13, Q14, Q15]> { > - let SubRegClassList = [SPR, SPR, SPR, SPR, DPR, DPR]; > + let SubRegClassList = [SPR_INVALID, SPR_INVALID, SPR_INVALID, > SPR_INVALID, > + DPR, DPR]; > +} > + > +// Subset of QPR that have 32-bit SPR subregs. > +def QPR_VFP2 : RegisterClass<"ARM", [v16i8, v8i16, v4i32, v2i64, > v4f32, v2f64], > + 128, > + [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7] > > { > + let SubRegClassList = [SPR, SPR, SPR, SPR, DPR_VFP2, DPR_VFP2]; > } > > // Subset of QPR that have 32-bit SPR subregs. > > Added: llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSubreg.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSubreg.ll?rev=81657&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSubreg.ll (added) > +++ llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSubreg.ll Sat Sep > 12 19:59:43 2009 > @@ -0,0 +1,61 @@ > +; RUN: llc -mattr=+neon < %s > +; PR4965 > +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- > i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64" > +target triple = "armv7-eabi" > + > +%struct.fr = type { [6 x %struct.pl] } > +%struct.obb = type { %"struct.m4", %"struct.p3" } > +%struct.pl = type { %"struct.p3" } > +%"struct.m4" = type { %"struct.p3", %"struct.p3", %"struct.p3", > %"struct.p3" } > +%"struct.p3" = type { <4 x float> } > + > +declare <2 x float> @llvm.arm.neon.vpadd.v2f32(<2 x float>, <2 x > float>) nounwind readnone > + > +define arm_aapcs_vfpcc i8 @foo(%struct.fr* nocapture %this, > %struct.obb* %box) nounwind { > +entry: > + %val.i.i = load <4 x float>* undef ; <<4 x float>> > [#uses=1] > + %val2.i.i = load <4 x float>* null ; <<4 x float>> > [#uses=1] > + %elt3.i.i = getelementptr inbounds %struct.obb* %box, i32 0, i32 > 0, i32 2, i32 0 ; <<4 x float>*> [#uses=1] > + %val4.i.i = load <4 x float>* %elt3.i.i ; <<4 x float>> > [#uses=1] > + %0 = shufflevector <2 x float> undef, <2 x float> > zeroinitializer, <4 x i32> ; <<4 x > float>> [#uses=1] > + %1 = fadd <4 x float> undef, zeroinitializer ; <<4 x float>> > [#uses=1] > + br label %bb33 > + > +bb: ; preds = %bb33 > + %2 = fmul <4 x float> %val.i.i, undef ; <<4 x float>> > [#uses=1] > + %3 = fmul <4 x float> %val2.i.i, undef ; <<4 x float>> > [#uses=1] > + %4 = fadd <4 x float> %3, %2 ; <<4 x float>> > [#uses=1] > + %5 = fmul <4 x float> %val4.i.i, undef ; <<4 x float>> > [#uses=1] > + %6 = fadd <4 x float> %5, %4 ; <<4 x float>> > [#uses=1] > + %7 = bitcast <4 x float> %6 to <4 x i32> ; <<4 x i32>> > [#uses=1] > + %8 = and <4 x i32> %7, -2147483648, i32 -2147483648> ; <<4 x i32>> [#uses=1] > + %9 = or <4 x i32> %8, undef ; <<4 x i32>> > [#uses=1] > + %10 = bitcast <4 x i32> %9 to <4 x float> ; <<4 x float>> > [#uses=1] > + %11 = shufflevector <4 x float> %10, <4 x float> undef, <2 x i32> > ; <<2 x float>> [#uses=1] > + %12 = shufflevector <2 x float> %11, <2 x float> undef, <4 x i32> > zeroinitializer ; <<4 x float>> [#uses=1] > + %13 = fmul <4 x float> undef, %12 ; <<4 x float>> > [#uses=1] > + %14 = fmul <4 x float> %0, undef ; <<4 x float>> > [#uses=1] > + %15 = fadd <4 x float> %14, %13 ; <<4 x float>> > [#uses=1] > + %16 = fadd <4 x float> undef, %15 ; <<4 x float>> > [#uses=1] > + %17 = fadd <4 x float> %1, %16 ; <<4 x float>> > [#uses=1] > + %18 = fmul <4 x float> zeroinitializer, %17 ; <<4 x float>> > [#uses=1] > + %19 = insertelement <4 x float> %18, float 0.000000e+00, i32 3 ; > <<4 x float>> [#uses=2] > + %20 = shufflevector <4 x float> %19, <4 x float> undef, <2 x i32> > ; <<2 x float>> [#uses=1] > + %21 = shufflevector <4 x float> %19, <4 x float> undef, <2 x i32> > ; <<2 x float>> [#uses=1] > + %22 = tail call <2 x float> @llvm.arm.neon.vpadd.v2f32(<2 x > float> %20, <2 x float> %21) nounwind ; <<2 x float>> [#uses=2] > + %23 = tail call <2 x float> @llvm.arm.neon.vpadd.v2f32(<2 x > float> %22, <2 x float> %22) nounwind ; <<2 x float>> [#uses=2] > + %24 = shufflevector <2 x float> %23, <2 x float> %23, <4 x i32> > zeroinitializer ; <<4 x float>> [#uses=1] > + %25 = fadd <4 x float> %24, zeroinitializer ; <<4 x float>> > [#uses=1] > + %tmp46 = extractelement <4 x float> %25, i32 0 ; [#uses=1] > + %26 = fcmp olt float %tmp46, 0.000000e+00 ; [#uses=1] > + br i1 %26, label %bb41, label %bb33 > + > +bb33: ; preds = %bb, > %entry > + br i1 undef, label %bb34, label %bb > + > +bb34: ; preds = %bb33 > + ret i8 undef > + > +bb41: ; preds = %bb > + ret i8 1 > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Sep 14 20:41:29 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Sep 2009 18:41:29 -0700 Subject: [llvm-commits] [llvm] r80930 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Instr64bit.td X86InstrInfo.td In-Reply-To: <4AA00AB1.8080304@free.fr> References: <200909031718.n83HIqqR031599@zion.cs.uiuc.edu> <4AA00AB1.8080304@free.fr> Message-ID: <3AC8C10E-B832-4870-A80F-97C1B3524C7F@apple.com> On Sep 3, 2009, at 11:28 AM, Duncan Sands wrote: > Hi Dan, > > > >> Add a -disable-16bit flag and associated support for experimenting >> with >> >> >> disabling the use of 16-bit operations on x86. This doesn't yet >> work for >> >> >> inline asms with 16-bit constraints, vectors with 16-bit elements, >> >> >> trampoline code, and perhaps other obscurities, but it's enough to >> try >> >> >> some experiments. >> >> > > not sure why you mention trampoline code here? All I know is that one of test failures happened to be in the vicinity of a trampoline setup, and there was nothing else suspicious around. If -disable-16bit is worth pursuing, I'll do more testing and figure out what's really going on there. Dan From sabre at nondot.org Mon Sep 14 21:22:48 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 02:22:48 -0000 Subject: [llvm-commits] [llvm] r81822 - in /llvm/trunk/test/CodeGen/X86: cmov-zext.ll cmov.ll commute-cmov.ll Message-ID: <200909150222.n8F2Mmm9008567@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 14 21:22:47 2009 New Revision: 81822 URL: http://llvm.org/viewvc/llvm-project?rev=81822&view=rev Log: merge two cmov tests into one. Added: llvm/trunk/test/CodeGen/X86/cmov.ll - copied, changed from r81821, llvm/trunk/test/CodeGen/X86/commute-cmov.ll Removed: llvm/trunk/test/CodeGen/X86/cmov-zext.ll llvm/trunk/test/CodeGen/X86/commute-cmov.ll Removed: llvm/trunk/test/CodeGen/X86/cmov-zext.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov-zext.ll?rev=81821&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/cmov-zext.ll (original) +++ llvm/trunk/test/CodeGen/X86/cmov-zext.ll (removed) @@ -1,19 +0,0 @@ -; RUN: llc < %s -march=x86-64 | FileCheck %s - -; x86's 32-bit cmov doesn't clobber the high 32 bits of the destination -; if the condition is false. An explicit zero-extend (movl) is needed -; after the cmov. - -; CHECK: cmovne %edi, %esi -; CHECK-NEXT: movl %esi, %edi - -declare void @bar(i64) nounwind - -define void @foo(i64 %a, i64 %b, i1 %p) nounwind { - %c = trunc i64 %a to i32 - %d = trunc i64 %b to i32 - %e = select i1 %p, i32 %c, i32 %d - %f = zext i32 %e to i64 - call void @bar(i64 %f) - ret void -} Copied: llvm/trunk/test/CodeGen/X86/cmov.ll (from r81821, llvm/trunk/test/CodeGen/X86/commute-cmov.ll) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov.ll?p2=llvm/trunk/test/CodeGen/X86/cmov.ll&p1=llvm/trunk/test/CodeGen/X86/commute-cmov.ll&r1=81821&r2=81822&rev=81822&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/commute-cmov.ll (original) +++ llvm/trunk/test/CodeGen/X86/cmov.ll Mon Sep 14 21:22:47 2009 @@ -1,30 +1,48 @@ -; RUN: llc < %s -march=x86 | FileCheck %s +; RUN: llc < %s -march=x86-64 | FileCheck %s -define i32 @test1(i32 %x, i32 %n, i32 %w, i32 %v) nounwind readnone { +define i32 @test1(i32 %x, i32 %n, i32 %w, i32* %vp) nounwind readnone { entry: ; CHECK: test1: ; CHECK: btl ; CHECK-NEXT: movl $12, %eax -; CHECK-NEXT: cmovae 16(%esp), %eax +; CHECK-NEXT: cmovae (%rcx), %eax ; CHECK-NEXT: ret %0 = lshr i32 %x, %n ; [#uses=1] %1 = and i32 %0, 1 ; [#uses=1] %toBool = icmp eq i32 %1, 0 ; [#uses=1] + %v = load i32* %vp %.0 = select i1 %toBool, i32 %v, i32 12 ; [#uses=1] ret i32 %.0 } -define i32 @test2(i32 %x, i32 %n, i32 %w, i32 %v) nounwind readnone { +define i32 @test2(i32 %x, i32 %n, i32 %w, i32* %vp) nounwind readnone { entry: ; CHECK: test2: ; CHECK: btl ; CHECK-NEXT: movl $12, %eax -; CHECK-NEXT: cmovb 16(%esp), %eax +; CHECK-NEXT: cmovb (%rcx), %eax ; CHECK-NEXT: ret %0 = lshr i32 %x, %n ; [#uses=1] %1 = and i32 %0, 1 ; [#uses=1] %toBool = icmp eq i32 %1, 0 ; [#uses=1] + %v = load i32* %vp %.0 = select i1 %toBool, i32 12, i32 %v ; [#uses=1] ret i32 %.0 } + + +declare void @bar(i64) nounwind + +define void @test3(i64 %a, i64 %b, i1 %p) nounwind { +; CHECK: test3: +; CHECK: cmovne %edi, %esi +; CHECK-NEXT: movl %esi, %edi + + %c = trunc i64 %a to i32 + %d = trunc i64 %b to i32 + %e = select i1 %p, i32 %c, i32 %d + %f = zext i32 %e to i64 + call void @bar(i64 %f) + ret void +} Removed: llvm/trunk/test/CodeGen/X86/commute-cmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/commute-cmov.ll?rev=81821&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/commute-cmov.ll (original) +++ llvm/trunk/test/CodeGen/X86/commute-cmov.ll (removed) @@ -1,30 +0,0 @@ -; RUN: llc < %s -march=x86 | FileCheck %s - -define i32 @test1(i32 %x, i32 %n, i32 %w, i32 %v) nounwind readnone { -entry: -; CHECK: test1: -; CHECK: btl -; CHECK-NEXT: movl $12, %eax -; CHECK-NEXT: cmovae 16(%esp), %eax -; CHECK-NEXT: ret - - %0 = lshr i32 %x, %n ; [#uses=1] - %1 = and i32 %0, 1 ; [#uses=1] - %toBool = icmp eq i32 %1, 0 ; [#uses=1] - %.0 = select i1 %toBool, i32 %v, i32 12 ; [#uses=1] - ret i32 %.0 -} -define i32 @test2(i32 %x, i32 %n, i32 %w, i32 %v) nounwind readnone { -entry: -; CHECK: test2: -; CHECK: btl -; CHECK-NEXT: movl $12, %eax -; CHECK-NEXT: cmovb 16(%esp), %eax -; CHECK-NEXT: ret - - %0 = lshr i32 %x, %n ; [#uses=1] - %1 = and i32 %0, 1 ; [#uses=1] - %toBool = icmp eq i32 %1, 0 ; [#uses=1] - %.0 = select i1 %toBool, i32 12, i32 %v ; [#uses=1] - ret i32 %.0 -} From sabre at nondot.org Mon Sep 14 21:25:21 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 02:25:21 -0000 Subject: [llvm-commits] [llvm] r81823 - in /llvm/trunk/test/CodeGen/X86: cmov-i8-eflags.ll cmov.ll select-no-cmov.ll Message-ID: <200909150225.n8F2PMV1008916@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 14 21:25:21 2009 New Revision: 81823 URL: http://llvm.org/viewvc/llvm-project?rev=81823&view=rev Log: merge some more cmov tests into cmov.ll Removed: llvm/trunk/test/CodeGen/X86/cmov-i8-eflags.ll llvm/trunk/test/CodeGen/X86/select-no-cmov.ll Modified: llvm/trunk/test/CodeGen/X86/cmov.ll Removed: llvm/trunk/test/CodeGen/X86/cmov-i8-eflags.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov-i8-eflags.ll?rev=81822&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/cmov-i8-eflags.ll (original) +++ llvm/trunk/test/CodeGen/X86/cmov-i8-eflags.ll (removed) @@ -1,61 +0,0 @@ -; RUN: llc -march=x86-64 < %s | FileCheck %s -; PR4814 - -; CodeGen shouldn't try to do a setne after an expanded 8-bit conditional -; move without recomputing EFLAGS, because the expansion of the conditional -; move with control flow may clobber EFLAGS (e.g., with xor, to set the -; register to zero). - -; The test is a little awkward; the important part is that there's a test before the -; setne. - -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" - - at g_3 = external global i8 ; [#uses=1] - at g_96 = external global i8 ; [#uses=2] - at g_100 = external global i8 ; [#uses=2] - at _2E_str = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=1] - -define i32 @main() nounwind { -entry: - %0 = load i8* @g_3, align 1 ; [#uses=2] - %1 = sext i8 %0 to i32 ; [#uses=1] - %.lobit.i = lshr i8 %0, 7 ; [#uses=1] - %tmp.i = zext i8 %.lobit.i to i32 ; [#uses=1] - %tmp.not.i = xor i32 %tmp.i, 1 ; [#uses=1] - %iftmp.17.0.i.i = ashr i32 %1, %tmp.not.i ; [#uses=1] - %retval56.i.i = trunc i32 %iftmp.17.0.i.i to i8 ; [#uses=1] - %2 = icmp eq i8 %retval56.i.i, 0 ; [#uses=2] - %g_96.promoted.i = load i8* @g_96 ; [#uses=3] - %3 = icmp eq i8 %g_96.promoted.i, 0 ; [#uses=2] - br i1 %3, label %func_4.exit.i, label %bb.i.i.i - -bb.i.i.i: ; preds = %entry - %4 = volatile load i8* @g_100, align 1 ; [#uses=0] - br label %func_4.exit.i - -; CHECK: g_100 -; CHECK: testb -; CHECK: testb %al, %al -; CHECK-NEXT: setne %al -; CHECK-NEXT: testb - -func_4.exit.i: ; preds = %bb.i.i.i, %entry - %.not.i = xor i1 %2, true ; [#uses=1] - %brmerge.i = or i1 %3, %.not.i ; [#uses=1] - %.mux.i = select i1 %2, i8 %g_96.promoted.i, i8 0 ; [#uses=1] - br i1 %brmerge.i, label %func_1.exit, label %bb.i.i - -bb.i.i: ; preds = %func_4.exit.i - %5 = volatile load i8* @g_100, align 1 ; [#uses=0] - br label %func_1.exit - -func_1.exit: ; preds = %bb.i.i, %func_4.exit.i - %g_96.tmp.0.i = phi i8 [ %g_96.promoted.i, %bb.i.i ], [ %.mux.i, %func_4.exit.i ] ; [#uses=2] - store i8 %g_96.tmp.0.i, i8* @g_96 - %6 = zext i8 %g_96.tmp.0.i to i32 ; [#uses=1] - %7 = tail call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([15 x i8]* @_2E_str, i64 0, i64 0), i32 %6) nounwind ; [#uses=0] - ret i32 0 -} - -declare i32 @printf(i8* nocapture, ...) nounwind Modified: llvm/trunk/test/CodeGen/X86/cmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov.ll?rev=81823&r1=81822&r2=81823&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/cmov.ll (original) +++ llvm/trunk/test/CodeGen/X86/cmov.ll Mon Sep 14 21:25:21 2009 @@ -1,4 +1,5 @@ ; RUN: llc < %s -march=x86-64 | FileCheck %s +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" define i32 @test1(i32 %x, i32 %n, i32 %w, i32* %vp) nounwind readnone { entry: @@ -46,3 +47,97 @@ call void @bar(i64 %f) ret void } + + + +; CodeGen shouldn't try to do a setne after an expanded 8-bit conditional +; move without recomputing EFLAGS, because the expansion of the conditional +; move with control flow may clobber EFLAGS (e.g., with xor, to set the +; register to zero). + +; The test is a little awkward; the important part is that there's a test before the +; setne. +; PR4814 + + + at g_3 = external global i8 ; [#uses=1] + at g_96 = external global i8 ; [#uses=2] + at g_100 = external global i8 ; [#uses=2] + at _2E_str = external constant [15 x i8], align 1 ; <[15 x i8]*> [#uses=1] + +define i32 @test4() nounwind { +entry: + %0 = load i8* @g_3, align 1 ; [#uses=2] + %1 = sext i8 %0 to i32 ; [#uses=1] + %.lobit.i = lshr i8 %0, 7 ; [#uses=1] + %tmp.i = zext i8 %.lobit.i to i32 ; [#uses=1] + %tmp.not.i = xor i32 %tmp.i, 1 ; [#uses=1] + %iftmp.17.0.i.i = ashr i32 %1, %tmp.not.i ; [#uses=1] + %retval56.i.i = trunc i32 %iftmp.17.0.i.i to i8 ; [#uses=1] + %2 = icmp eq i8 %retval56.i.i, 0 ; [#uses=2] + %g_96.promoted.i = load i8* @g_96 ; [#uses=3] + %3 = icmp eq i8 %g_96.promoted.i, 0 ; [#uses=2] + br i1 %3, label %func_4.exit.i, label %bb.i.i.i + +bb.i.i.i: ; preds = %entry + %4 = volatile load i8* @g_100, align 1 ; [#uses=0] + br label %func_4.exit.i + +; CHECK: test4: +; CHECK: g_100 +; CHECK: testb +; CHECK: testb %al, %al +; CHECK-NEXT: setne %al +; CHECK-NEXT: testb + +func_4.exit.i: ; preds = %bb.i.i.i, %entry + %.not.i = xor i1 %2, true ; [#uses=1] + %brmerge.i = or i1 %3, %.not.i ; [#uses=1] + %.mux.i = select i1 %2, i8 %g_96.promoted.i, i8 0 ; [#uses=1] + br i1 %brmerge.i, label %func_1.exit, label %bb.i.i + +bb.i.i: ; preds = %func_4.exit.i + %5 = volatile load i8* @g_100, align 1 ; [#uses=0] + br label %func_1.exit + +func_1.exit: ; preds = %bb.i.i, %func_4.exit.i + %g_96.tmp.0.i = phi i8 [ %g_96.promoted.i, %bb.i.i ], [ %.mux.i, %func_4.exit.i ] ; [#uses=2] + store i8 %g_96.tmp.0.i, i8* @g_96 + %6 = zext i8 %g_96.tmp.0.i to i32 ; [#uses=1] + %7 = tail call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([15 x i8]* @_2E_str, i64 0, i64 0), i32 %6) nounwind ; [#uses=0] + ret i32 0 +} + +declare i32 @printf(i8* nocapture, ...) nounwind + + +; Should compile to setcc | -2. +; rdar://6668608 +define i32 @test5(i32* nocapture %P) nounwind readonly { +entry: +; CHECK: test5: +; CHECK: setg %al +; CHECK: movzbl %al, %eax +; CHECK: orl $-2, %eax +; CHECK: ret + + %0 = load i32* %P, align 4 ; [#uses=1] + %1 = icmp sgt i32 %0, 41 ; [#uses=1] + %iftmp.0.0 = select i1 %1, i32 -1, i32 -2 ; [#uses=1] + ret i32 %iftmp.0.0 +} + +define i32 @test6(i32* nocapture %P) nounwind readonly { +entry: +; CHECK: test6: +; CHECK: setl %al +; CHECK: movzbl %al, %eax +; CHECK: leal 4(%rax,%rax,8), %eax +; CHECK: ret + %0 = load i32* %P, align 4 ; [#uses=1] + %1 = icmp sgt i32 %0, 41 ; [#uses=1] + %iftmp.0.0 = select i1 %1, i32 4, i32 13 ; [#uses=1] + ret i32 %iftmp.0.0 +} + + Removed: llvm/trunk/test/CodeGen/X86/select-no-cmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/select-no-cmov.ll?rev=81822&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/select-no-cmov.ll (original) +++ llvm/trunk/test/CodeGen/X86/select-no-cmov.ll (removed) @@ -1,26 +0,0 @@ -; RUN: llc < %s | not grep cmov - -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 = "i386-apple-darwin7" - -; Should compile to setcc | -2. -; rdar://6668608 -define i32 @test(i32* nocapture %P) nounwind readonly { -entry: - %0 = load i32* %P, align 4 ; [#uses=1] - %1 = icmp sgt i32 %0, 41 ; [#uses=1] - %iftmp.0.0 = select i1 %1, i32 -1, i32 -2 ; [#uses=1] - ret i32 %iftmp.0.0 -} - -; setl %al -; movzbl %al, %eax -; leal 4(%eax,%eax,8), %eax -define i32 @test2(i32* nocapture %P) nounwind readonly { -entry: - %0 = load i32* %P, align 4 ; [#uses=1] - %1 = icmp sgt i32 %0, 41 ; [#uses=1] - %iftmp.0.0 = select i1 %1, i32 4, i32 13 ; [#uses=1] - ret i32 %iftmp.0.0 -} - From sabre at nondot.org Mon Sep 14 21:27:23 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 02:27:23 -0000 Subject: [llvm-commits] [llvm] r81824 - in /llvm/trunk/test/CodeGen/X86: cmov.ll select-i8.ll Message-ID: <200909150227.n8F2ROrs009182@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 14 21:27:23 2009 New Revision: 81824 URL: http://llvm.org/viewvc/llvm-project?rev=81824&view=rev Log: merge one more in. Removed: llvm/trunk/test/CodeGen/X86/select-i8.ll Modified: llvm/trunk/test/CodeGen/X86/cmov.ll Modified: llvm/trunk/test/CodeGen/X86/cmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov.ll?rev=81824&r1=81823&r2=81824&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/cmov.ll (original) +++ llvm/trunk/test/CodeGen/X86/cmov.ll Mon Sep 14 21:27:23 2009 @@ -141,3 +141,13 @@ } +; Don't try to use a 16-bit conditional move to do an 8-bit select, +; because it isn't worth it. Just use a branch instead. +define i8 @test7(i1 inreg %c, i8 inreg %a, i8 inreg %b) nounwind { +; CHECK: test7: +; CHECK: testb $1, %dil +; CHECK-NEXT: jne LBB + + %d = select i1 %c, i8 %a, i8 %b + ret i8 %d +} Removed: llvm/trunk/test/CodeGen/X86/select-i8.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/select-i8.ll?rev=81823&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/select-i8.ll (original) +++ llvm/trunk/test/CodeGen/X86/select-i8.ll (removed) @@ -1,12 +0,0 @@ -; RUN: llc < %s -march=x86 > %t -; RUN: not grep movz %t -; RUN: not grep cmov %t -; RUN: grep movb %t | count 2 - -; Don't try to use a 16-bit conditional move to do an 8-bit select, -; because it isn't worth it. Just use a branch instead. - -define i8 @foo(i1 inreg %c, i8 inreg %a, i8 inreg %b) { - %d = select i1 %c, i8 %a, i8 %b - ret i8 %d -} From foldr at codedgers.com Mon Sep 14 22:39:48 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Tue, 15 Sep 2009 03:39:48 -0000 Subject: [llvm-commits] [llvm] r81826 - in /llvm/trunk: include/llvm/System/Program.h lib/System/Unix/Program.inc lib/System/Win32/Program.inc Message-ID: <200909150339.n8F3dn4T018712@zion.cs.uiuc.edu> Author: foldr Date: Mon Sep 14 22:39:45 2009 New Revision: 81826 URL: http://llvm.org/viewvc/llvm-project?rev=81826&view=rev Log: Get rid of GetProcessId in Win32/Program.inc. GetProcessId was introduced only in XP. As a bonus, this change makes Program objects copyable, since Program is now basically a PID. Modified: llvm/trunk/include/llvm/System/Program.h llvm/trunk/lib/System/Unix/Program.inc llvm/trunk/lib/System/Win32/Program.inc Modified: llvm/trunk/include/llvm/System/Program.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Program.h?rev=81826&r1=81825&r2=81826&view=diff ============================================================================== --- llvm/trunk/include/llvm/System/Program.h (original) +++ llvm/trunk/include/llvm/System/Program.h Mon Sep 14 22:39:45 2009 @@ -29,22 +29,18 @@ /// @since 1.4 /// @brief An abstraction for finding and executing programs. class Program { - /// Opaque handle for target specific data. - void *Data_; - // Noncopyable. - Program(const Program& other); - Program& operator=(const Program& other); + unsigned Pid_; /// @name Methods /// @{ public: - Program(); - ~Program(); + Program() : Pid_(0) {} + ~Program() {} /// Return process ID of this program. - unsigned GetPid() const; + unsigned GetPid() const { return Pid_; } /// This function executes the program using the \p arguments provided. The /// invoked program will inherit the stdin, stdout, and stderr file Modified: llvm/trunk/lib/System/Unix/Program.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=81826&r1=81825&r2=81826&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Program.inc (original) +++ llvm/trunk/lib/System/Unix/Program.inc Mon Sep 14 22:39:45 2009 @@ -34,15 +34,6 @@ namespace llvm { using namespace sys; -Program::Program() : Data_(0) {} - -Program::~Program() {} - -unsigned Program::GetPid() const { - uint64_t pid = reinterpret_cast(Data_); - return static_cast(pid); -} - // This function just uses the PATH environment variable to find the program. Path Program::FindProgramByName(const std::string& progName) { @@ -214,7 +205,7 @@ break; } - Data_ = reinterpret_cast(child); + Pid_ = child; return true; } @@ -226,7 +217,7 @@ #ifdef HAVE_SYS_WAIT_H struct sigaction Act, Old; - if (Data_ == 0) { + if (Pid_ == 0) { MakeErrMsg(ErrMsg, "Process not started!"); return -1; } @@ -242,8 +233,7 @@ // Parent process: Wait for the child process to terminate. int status; - uint64_t pid = reinterpret_cast(Data_); - pid_t child = static_cast(pid); + pid_t child = Pid_; while (wait(&status) != child) if (secondsToWait && errno == EINTR) { // Kill the child. @@ -291,15 +281,12 @@ bool Program::Kill(std::string* ErrMsg) { - if (Data_ == 0) { + if (Pid_ == 0) { MakeErrMsg(ErrMsg, "Process not started!"); return true; } - uint64_t pid64 = reinterpret_cast(Data_); - pid_t pid = static_cast(pid64); - - if (kill(pid, SIGKILL) != 0) { + if (kill(Pid_, SIGKILL) != 0) { MakeErrMsg(ErrMsg, "The process couldn't be killed!"); return true; } Modified: llvm/trunk/lib/System/Win32/Program.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Program.inc?rev=81826&r1=81825&r2=81826&view=diff ============================================================================== --- llvm/trunk/lib/System/Win32/Program.inc (original) +++ llvm/trunk/lib/System/Win32/Program.inc Mon Sep 14 22:39:45 2009 @@ -25,21 +25,6 @@ namespace llvm { using namespace sys; -Program::Program() : Data_(0) {} - -Program::~Program() { - if (Data_) { - HANDLE hProcess = reinterpret_cast(Data_); - CloseHandle(hProcess); - Data_ = 0; - } -} - -unsigned Program::GetPid() const { - HANDLE hProcess = reinterpret_cast(Data_); - return GetProcessId(hProcess); -} - // This function just uses the PATH environment variable to find the program. Path Program::FindProgramByName(const std::string& progName) { @@ -137,11 +122,6 @@ const Path** redirects, unsigned memoryLimit, std::string* ErrMsg) { - if (Data_) { - HANDLE hProcess = reinterpret_cast(Data_); - CloseHandle(Data_); - Data_ = 0; - } if (!path.canExecute()) { if (ErrMsg) @@ -269,9 +249,10 @@ path.str() + "'"); return false; } - Data_ = reinterpret_cast(pi.hProcess); + Pid_ = pi.dwProcessId; // Make sure these get closed no matter what. + AutoHandle hProcess(pi.hProcess); AutoHandle hThread(pi.hThread); // Assign the process to a job if a memory limit is defined. @@ -305,12 +286,17 @@ int Program::Wait(unsigned secondsToWait, std::string* ErrMsg) { - if (Data_ == 0) { + if (Pid_ == 0) { MakeErrMsg(ErrMsg, "Process not started!"); return -1; } - HANDLE hProcess = reinterpret_cast(Data_); + HANDLE hOpen = OpenProcess(SYNCHRONIZE, FALSE, Pid_); + if (hOpen == NULL) { + MakeErrMsg(ErrMsg, "OpenProcess failed!"); + return -1; + } + AutoHandle hProcess(hOpen); // Wait for the process to terminate. DWORD millisecondsToWait = INFINITE; @@ -341,12 +327,18 @@ bool Program::Kill(std::string* ErrMsg) { - if (Data_ == 0) { + if (Pid_ == 0) { MakeErrMsg(ErrMsg, "Process not started!"); return true; } - HANDLE hProcess = reinterpret_cast(Data_); + HANDLE hOpen = OpenProcess(PROCESS_TERMINATE, FALSE, Pid_); + if (hOpen == NULL) { + MakeErrMsg(ErrMsg, "OpenProcess failed!"); + return true; + } + AutoHandle hProcess(hOpen); + if (TerminateProcess(hProcess, 1) == 0) { MakeErrMsg(ErrMsg, "The process couldn't be killed!"); return true; From kremenek at apple.com Mon Sep 14 23:06:37 2009 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Sep 2009 04:06:37 -0000 Subject: [llvm-commits] [llvm] r81827 - /llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt Message-ID: <200909150406.n8F46b0d021932@zion.cs.uiuc.edu> Author: kremenek Date: Mon Sep 14 23:06:36 2009 New Revision: 81827 URL: http://llvm.org/viewvc/llvm-project?rev=81827&view=rev Log: Remove invalid add_dependencies line to unbreak the CMake build. Modified: llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt Modified: llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt?rev=81827&r1=81826&r2=81827&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt (original) +++ llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt Mon Sep 14 23:06:36 2009 @@ -3,4 +3,4 @@ add_llvm_library(LLVMARMAsmParser ARMAsmParser.cpp ) -add_dependencies(LLVMARMAsmParser) + From kremenek at apple.com Mon Sep 14 23:06:42 2009 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 14 Sep 2009 21:06:42 -0700 Subject: [llvm-commits] [llvm] r81817 - in /llvm/trunk: lib/Target/ARM/AsmParser/ lib/Target/ARM/AsmParser/ARMAsmParser.cpp lib/Target/ARM/AsmParser/CMakeLists.txt lib/Target/ARM/AsmParser/Makefile lib/Target/ARM/Makefile test/MC/AsmParser/arm_word_directive.s test/MC/AsmParser/directive_values.s test/MC/AsmParser/x86_word_directive.s In-Reply-To: <200909150027.n8F0RQUw026432@zion.cs.uiuc.edu> References: <200909150027.n8F0RQUw026432@zion.cs.uiuc.edu> Message-ID: On Sep 14, 2009, at 5:27 PM, Kevin Enderby wrote: > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt (added) > +++ llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt Mon Sep 14 > 19:27:25 2009 > @@ -0,0 +1,6 @@ > +include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. $ > {CMAKE_CURRENT_SOURCE_DIR}/.. ) > + > +add_llvm_library(LLVMARMAsmParser > + ARMAsmParser.cpp > + ) > +add_dependencies(LLVMARMAsmParser) > Hi Kevin, This last line actually breaks the CMake builds: CMake Error at lib/Target/ARM/AsmParser/CMakeLists.txt:6 (add_dependencies): add_dependencies called with incorrect number of arguments Were you trying to add a specific dependency between the LLVMARMAsmParser and something else? I've gone ahead and removed this last line, but I'm not certain if that is the right thing to do. The CMake build now works, but I'm not certain if a dependency is suppose to be there. Ted -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090914/be180ee6/attachment.html From kremenek at apple.com Mon Sep 14 23:17:35 2009 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Sep 2009 04:17:35 -0000 Subject: [llvm-commits] [llvm] r81828 - /llvm/tags/checker/checker-0.220/ Message-ID: <200909150417.n8F4HZFG023349@zion.cs.uiuc.edu> Author: kremenek Date: Mon Sep 14 23:17:34 2009 New Revision: 81828 URL: http://llvm.org/viewvc/llvm-project?rev=81828&view=rev Log: Removing checker-0.220. Removed: llvm/tags/checker/checker-0.220/ From kremenek at apple.com Mon Sep 14 23:19:24 2009 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Sep 2009 04:19:24 -0000 Subject: [llvm-commits] [llvm] r81831 - /llvm/tags/checker/checker-0.220/ Message-ID: <200909150419.n8F4JOrs023602@zion.cs.uiuc.edu> Author: kremenek Date: Mon Sep 14 23:19:24 2009 New Revision: 81831 URL: http://llvm.org/viewvc/llvm-project?rev=81831&view=rev Log: Tagging checker-0.220. Added: llvm/tags/checker/checker-0.220/ - copied from r81830, llvm/trunk/ From sabre at nondot.org Mon Sep 14 23:27:29 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 04:27:29 -0000 Subject: [llvm-commits] [llvm] r81833 - /llvm/trunk/test/CodeGen/X86/cmov.ll Message-ID: <200909150427.n8F4RTxe024619@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 14 23:27:29 2009 New Revision: 81833 URL: http://llvm.org/viewvc/llvm-project?rev=81833&view=rev Log: this is failing on linux hosts, force a triple. Modified: llvm/trunk/test/CodeGen/X86/cmov.ll Modified: llvm/trunk/test/CodeGen/X86/cmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov.ll?rev=81833&r1=81832&r2=81833&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/cmov.ll (original) +++ llvm/trunk/test/CodeGen/X86/cmov.ll Mon Sep 14 23:27:29 2009 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86-64 | FileCheck %s +; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" define i32 @test1(i32 %x, i32 %n, i32 %w, i32* %vp) nounwind readnone { From sabre at nondot.org Mon Sep 14 23:37:49 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 04:37:49 -0000 Subject: [llvm-commits] [llvm] r81834 - /llvm/trunk/include/llvm/ADT/SCCIterator.h Message-ID: <200909150437.n8F4bnf2025925@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 14 23:37:49 2009 New Revision: 81834 URL: http://llvm.org/viewvc/llvm-project?rev=81834&view=rev Log: switch scciterator to use DenseMap instead of std::map Modified: llvm/trunk/include/llvm/ADT/SCCIterator.h Modified: llvm/trunk/include/llvm/ADT/SCCIterator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SCCIterator.h?rev=81834&r1=81833&r2=81834&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SCCIterator.h (original) +++ llvm/trunk/include/llvm/ADT/SCCIterator.h Mon Sep 14 23:37:49 2009 @@ -22,7 +22,7 @@ #define LLVM_ADT_SCCITERATOR_H #include "llvm/ADT/GraphTraits.h" -#include +#include "llvm/ADT/DenseMap.h" #include namespace llvm { @@ -48,7 +48,7 @@ // visitNum is the global counter. // nodeVisitNumbers are per-node visit numbers, also used as DFS flags. unsigned visitNum; - std::map nodeVisitNumbers; + DenseMap nodeVisitNumbers; // SCCNodeStack - Stack holding nodes of the SCC. std::vector SCCNodeStack; From sabre at nondot.org Mon Sep 14 23:45:26 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 04:45:26 -0000 Subject: [llvm-commits] [llvm] r81836 - /llvm/trunk/lib/VMCore/PassManager.cpp Message-ID: <200909150445.n8F4jQn1026893@zion.cs.uiuc.edu> Author: lattner Date: Mon Sep 14 23:45:26 2009 New Revision: 81836 URL: http://llvm.org/viewvc/llvm-project?rev=81836&view=rev Log: add some missing quotes in debug output Modified: llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=81836&r1=81835&r2=81836&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Sep 14 23:45:26 2009 @@ -1041,10 +1041,10 @@ errs() << "' on Module '" << Msg << "'...\n"; break; case ON_LOOP_MSG: - errs() << "' on Loop " << Msg << "'...\n"; + errs() << "' on Loop '" << Msg << "'...\n"; break; case ON_CG_MSG: - errs() << "' on Call Graph " << Msg << "'...\n"; + errs() << "' on Call Graph '" << Msg << "'...\n"; break; default: break; From sabre at nondot.org Tue Sep 15 00:03:04 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 05:03:04 -0000 Subject: [llvm-commits] [llvm] r81838 - in /llvm/trunk: include/llvm/PassManagers.h lib/Analysis/IPA/CallGraphSCCPass.cpp lib/VMCore/PassManager.cpp Message-ID: <200909150503.n8F534eE029077@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 00:03:04 2009 New Revision: 81838 URL: http://llvm.org/viewvc/llvm-project?rev=81838&view=rev Log: make -debug-pass=Executions show information about what call graph nodes are in the SCC for each execution of a CGSCC pass. Modified: llvm/trunk/include/llvm/PassManagers.h llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=81838&r1=81837&r2=81838&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Tue Sep 15 00:03:04 2009 @@ -380,6 +380,11 @@ // then PMT_Last active pass mangers. std::map *InheritedAnalysis[PMT_Last]; + + /// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions + /// or higher is specified. + bool isPassDebuggingExecutionsOrMore() const; + private: void dumpAnalysisUsage(const StringRef &Msg, const Pass *P, const AnalysisUsage::VectorType &Set) const; Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=81838&r1=81837&r2=81838&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Tue Sep 15 00:03:04 2009 @@ -317,7 +317,20 @@ PassNo != e; ++PassNo) { Pass *P = getContainedPass(PassNo); - dumpPassInfo(P, EXECUTION_MSG, ON_CG_MSG, ""); + // If we're in -debug-pass=Executions mode, construct the SCC node list, + // otherwise avoid constructing this string as it is expensive. + if (isPassDebuggingExecutionsOrMore()) { + std::string Functions; +#ifndef NDEBUG + raw_string_ostream OS(Functions); + for (unsigned i = 0, e = CurSCC.size(); i != e; ++i) { + if (i) OS << ", "; + CurSCC[i]->print(OS); + } + OS.flush(); +#endif + dumpPassInfo(P, EXECUTION_MSG, ON_CG_MSG, Functions); + } dumpRequiredSet(P); initializeAnalysisImpl(P); Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=81838&r1=81837&r2=81838&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Tue Sep 15 00:03:04 2009 @@ -67,6 +67,15 @@ clEnumValEnd)); } // End of llvm namespace +/// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions +/// or higher is specified. +bool PMDataManager::isPassDebuggingExecutionsOrMore() const { + return PassDebugging >= Executions; +} + + + + void PassManagerPrettyStackEntry::print(raw_ostream &OS) const { if (V == 0 && M == 0) OS << "Releasing pass '"; @@ -1044,7 +1053,7 @@ errs() << "' on Loop '" << Msg << "'...\n"; break; case ON_CG_MSG: - errs() << "' on Call Graph '" << Msg << "'...\n"; + errs() << "' on Call Graph Nodes '" << Msg << "'...\n"; break; default: break; @@ -1076,10 +1085,10 @@ return; errs() << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; for (unsigned i = 0; i != Set.size(); ++i) { - if (i) errs() << ","; - errs() << " " << Set[i]->getPassName(); + if (i) errs() << ','; + errs() << ' ' << Set[i]->getPassName(); } - errs() << "\n"; + errs() << '\n'; } /// Add RequiredPass into list of lower level passes required by pass P. From sabre at nondot.org Tue Sep 15 00:14:57 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 05:14:57 -0000 Subject: [llvm-commits] [llvm] r81840 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <200909150514.n8F5EvZv030678@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 00:14:57 2009 New Revision: 81840 URL: http://llvm.org/viewvc/llvm-project?rev=81840&view=rev Log: add newline to debug dump Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=81840&r1=81839&r2=81840&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Sep 15 00:14:57 2009 @@ -337,7 +337,7 @@ /// predicate, do SROA now. void SROA::DoScalarReplacement(AllocationInst *AI, std::vector &WorkList) { - DEBUG(errs() << "Found inst to SROA: " << *AI); + DEBUG(errs() << "Found inst to SROA: " << *AI << '\n'); SmallVector ElementAllocas; if (const StructType *ST = dyn_cast(AI->getAllocatedType())) { ElementAllocas.reserve(ST->getNumContainedTypes()); From sabre at nondot.org Tue Sep 15 00:40:35 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 05:40:35 -0000 Subject: [llvm-commits] [llvm] r81843 - in /llvm/trunk: include/llvm/Analysis/CallGraph.h lib/Analysis/IPA/CallGraph.cpp lib/Transforms/IPO/ArgumentPromotion.cpp Message-ID: <200909150540.n8F5eZA2001379@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 00:40:35 2009 New Revision: 81843 URL: http://llvm.org/viewvc/llvm-project?rev=81843&view=rev Log: add a new CallGraphNode::replaceCallEdge method and use it from argpromote to avoid invalidating an iterator. This fixes PR4977. All clang tests now pass with expensive checking (on my system at least). Modified: llvm/trunk/include/llvm/Analysis/CallGraph.h llvm/trunk/lib/Analysis/IPA/CallGraph.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Modified: llvm/trunk/include/llvm/Analysis/CallGraph.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CallGraph.h?rev=81843&r1=81842&r2=81843&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/CallGraph.h (original) +++ llvm/trunk/include/llvm/Analysis/CallGraph.h Tue Sep 15 00:40:35 2009 @@ -270,6 +270,12 @@ /// removeOneAbstractEdgeTo - Remove one edge associated with a null callsite /// from this node to the specified callee function. void removeOneAbstractEdgeTo(CallGraphNode *Callee); + + /// replaceCallEdge - This method replaces the edge in the node for the + /// specified call site with a new one. Note that this method takes linear + /// time, so it should be used sparingly. + void replaceCallEdge(CallSite CS, CallSite NewCS, CallGraphNode *NewNode); + }; //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=81843&r1=81842&r2=81843&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Tue Sep 15 00:40:35 2009 @@ -279,5 +279,22 @@ } } +/// replaceCallEdge - This method replaces the edge in the node for the +/// specified call site with a new one. Note that this method takes linear +/// time, so it should be used sparingly. +void CallGraphNode::replaceCallEdge(CallSite CS, + CallSite NewCS, CallGraphNode *NewNode){ + for (CalledFunctionsVector::iterator I = CalledFunctions.begin(); ; ++I) { + assert(I != CalledFunctions.end() && "Cannot find callsite to remove!"); + if (I->first == CS.getInstruction()) { + I->second->DropRef(); + I->first = NewCS.getInstruction(); + I->second = NewNode; + NewNode->AddRef(); + return; + } + } +} + // Enuse that users of CallGraph.h also link with this file DEFINING_FILE_FOR(CallGraph) Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=81843&r1=81842&r2=81843&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Tue Sep 15 00:40:35 2009 @@ -589,7 +589,7 @@ // Construct the new function type using the new arguments. FunctionType *NFTy = FunctionType::get(RetTy, Params, FTy->isVarArg()); - // Create the new function body and insert it into the module... + // Create the new function body and insert it into the module. Function *NF = Function::Create(NFTy, F->getLinkage(), F->getName()); NF->copyAttributesFrom(F); @@ -599,7 +599,8 @@ // Recompute the parameter attributes list based on the new arguments for // the function. - NF->setAttributes(AttrListPtr::get(AttributesVec.begin(), AttributesVec.end())); + NF->setAttributes(AttrListPtr::get(AttributesVec.begin(), + AttributesVec.end())); AttributesVec.clear(); F->getParent()->getFunctionList().insert(F, NF); @@ -729,8 +730,7 @@ // Update the callgraph to know that the callsite has been transformed. CallGraphNode *CalleeNode = CG[Call->getParent()->getParent()]; - CalleeNode->removeCallEdgeFor(Call); - CalleeNode->addCalledFunction(New, NF_CGN); + CalleeNode->replaceCallEdge(Call, New, NF_CGN); if (!Call->use_empty()) { Call->replaceAllUsesWith(New); From sabre at nondot.org Tue Sep 15 01:28:12 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 06:28:12 -0000 Subject: [llvm-commits] [llvm] r81845 - in /llvm/trunk: lib/VMCore/ConstantFold.cpp test/Assembler/insertextractvalue.ll Message-ID: <200909150628.n8F6SDib007558@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 01:28:12 2009 New Revision: 81845 URL: http://llvm.org/viewvc/llvm-project?rev=81845&view=rev Log: fix PR4963: folding insertvalue would sometimes turn a packed struct into an unpacked one. Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp llvm/trunk/test/Assembler/insertextractvalue.ll Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=81845&r1=81844&r2=81845&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Tue Sep 15 01:28:12 2009 @@ -499,17 +499,19 @@ if (isa(Agg)) { // Insertion of constant into aggregate undef - // Optimize away insertion of undef + // Optimize away insertion of undef. if (isa(Val)) return const_cast(Agg); + // Otherwise break the aggregate undef into multiple undefs and do - // the insertion + // the insertion. const CompositeType *AggTy = cast(Agg->getType()); unsigned numOps; if (const ArrayType *AR = dyn_cast(AggTy)) numOps = AR->getNumElements(); else numOps = cast(AggTy)->getNumElements(); + std::vector Ops(numOps); for (unsigned i = 0; i < numOps; ++i) { const Type *MemberTy = AggTy->getTypeAtIndex(i); @@ -520,24 +522,27 @@ UndefValue::get(MemberTy); Ops[i] = const_cast(Op); } - if (isa(AggTy)) - return ConstantStruct::get(Context, Ops); - else - return ConstantArray::get(cast(AggTy), Ops); + + if (const StructType* ST = dyn_cast(AggTy)) + return ConstantStruct::get(Context, Ops, ST->isPacked()); + return ConstantArray::get(cast(AggTy), Ops); } + if (isa(Agg)) { // Insertion of constant into aggregate zero - // Optimize away insertion of zero + // Optimize away insertion of zero. if (Val->isNullValue()) return const_cast(Agg); + // Otherwise break the aggregate zero into multiple zeros and do - // the insertion + // the insertion. const CompositeType *AggTy = cast(Agg->getType()); unsigned numOps; if (const ArrayType *AR = dyn_cast(AggTy)) numOps = AR->getNumElements(); else numOps = cast(AggTy)->getNumElements(); + std::vector Ops(numOps); for (unsigned i = 0; i < numOps; ++i) { const Type *MemberTy = AggTy->getTypeAtIndex(i); @@ -549,13 +554,14 @@ Constant::getNullValue(MemberTy); Ops[i] = const_cast(Op); } - if (isa(AggTy)) - return ConstantStruct::get(Context, Ops); - else - return ConstantArray::get(cast(AggTy), Ops); + + if (const StructType* ST = dyn_cast(AggTy)) + return ConstantStruct::get(Context, Ops, ST->isPacked()); + return ConstantArray::get(cast(AggTy), Ops); } + if (isa(Agg) || isa(Agg)) { - // Insertion of constant into aggregate constant + // Insertion of constant into aggregate constant. std::vector Ops(Agg->getNumOperands()); for (unsigned i = 0; i < Agg->getNumOperands(); ++i) { const Constant *Op = @@ -565,12 +571,10 @@ Agg->getOperand(i); Ops[i] = const_cast(Op); } - Constant *C; - if (isa(Agg->getType())) - C = ConstantStruct::get(Context, Ops); - else - C = ConstantArray::get(cast(Agg->getType()), Ops); - return C; + + if (const StructType* ST = dyn_cast(Agg->getType())) + return ConstantStruct::get(Context, Ops, ST->isPacked()); + return ConstantArray::get(cast(Agg->getType()), Ops); } return 0; @@ -585,7 +589,7 @@ if (C1->getType() == Type::getPPC_FP128Ty(Context)) return 0; - // Handle UndefValue up front + // Handle UndefValue up front. if (isa(C1) || isa(C2)) { switch (Opcode) { case Instruction::Xor: Modified: llvm/trunk/test/Assembler/insertextractvalue.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/insertextractvalue.ll?rev=81845&r1=81844&r2=81845&view=diff ============================================================================== --- llvm/trunk/test/Assembler/insertextractvalue.ll (original) +++ llvm/trunk/test/Assembler/insertextractvalue.ll Tue Sep 15 01:28:12 2009 @@ -21,3 +21,9 @@ store {{i32},{float, double}} insertvalue ({{i32},{float, double}} zeroinitializer, double 20.0, 1, 1), {{i32},{float, double}}* %p ret float extractvalue ({{i32},{float, double}} zeroinitializer, 1, 0) } + + +; PR4963 +define <{ i32, i32 }> @test57() { + ret <{ i32, i32 }> insertvalue (<{ i32, i32 }> zeroinitializer, i32 4, 1) +} From nicholas at mxc.ca Tue Sep 15 01:28:26 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 15 Sep 2009 06:28:26 -0000 Subject: [llvm-commits] [llvm] r81846 - in /llvm/trunk: lib/VMCore/Type.cpp test/Other/2009-09-14-function-elements.ll Message-ID: <200909150628.n8F6SQQ4007601@zion.cs.uiuc.edu> Author: nicholas Date: Tue Sep 15 01:28:26 2009 New Revision: 81846 URL: http://llvm.org/viewvc/llvm-project?rev=81846&view=rev Log: Forbid arrays of function-type and structures with function-typed fields. While I'm there, change code that does: SomeTy == Type::getFooType(Context) into: SomeTy->getTypeID() == FooTyID to decrease the amount of useless type creation which may involve locking, etc. Added: llvm/trunk/test/Other/2009-09-14-function-elements.ll Modified: llvm/trunk/lib/VMCore/Type.cpp Modified: llvm/trunk/lib/VMCore/Type.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=81846&r1=81845&r2=81846&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Type.cpp (original) +++ llvm/trunk/lib/VMCore/Type.cpp Tue Sep 15 01:28:26 2009 @@ -364,11 +364,10 @@ bool FunctionType::isValidReturnType(const Type *RetTy) { if (RetTy->isFirstClassType()) { if (const PointerType *PTy = dyn_cast(RetTy)) - return PTy->getElementType() != Type::getMetadataTy(RetTy->getContext()); + return PTy->getElementType()->getTypeID() != MetadataTyID; return true; } - if (RetTy == Type::getVoidTy(RetTy->getContext()) || - RetTy == Type::getMetadataTy(RetTy->getContext()) || + if (RetTy->getTypeID() == VoidTyID || RetTy->getTypeID() == MetadataTyID || isa(RetTy)) return true; @@ -389,8 +388,7 @@ bool FunctionType::isValidArgumentType(const Type *ArgTy) { if ((!ArgTy->isFirstClassType() && !isa(ArgTy)) || (isa(ArgTy) && - cast(ArgTy)->getElementType() == - Type::getMetadataTy(ArgTy->getContext()))) + cast(ArgTy)->getElementType()->getTypeID() == MetadataTyID)) return false; return true; @@ -829,13 +827,12 @@ } bool ArrayType::isValidElementType(const Type *ElemTy) { - if (ElemTy == Type::getVoidTy(ElemTy->getContext()) || - ElemTy == Type::getLabelTy(ElemTy->getContext()) || - ElemTy == Type::getMetadataTy(ElemTy->getContext())) + if (ElemTy->getTypeID() == VoidTyID || ElemTy->getTypeID() == LabelTyID || + ElemTy->getTypeID() == MetadataTyID || isa(ElemTy)) return false; if (const PointerType *PTy = dyn_cast(ElemTy)) - if (PTy->getElementType() == Type::getMetadataTy(ElemTy->getContext())) + if (PTy->getElementType()->getTypeID() == MetadataTyID) return false; return true; @@ -909,13 +906,12 @@ } bool StructType::isValidElementType(const Type *ElemTy) { - if (ElemTy == Type::getVoidTy(ElemTy->getContext()) || - ElemTy == Type::getLabelTy(ElemTy->getContext()) || - ElemTy == Type::getMetadataTy(ElemTy->getContext())) + if (ElemTy->getTypeID() == VoidTyID || ElemTy->getTypeID() == LabelTyID || + ElemTy->getTypeID() == MetadataTyID || isa(ElemTy)) return false; if (const PointerType *PTy = dyn_cast(ElemTy)) - if (PTy->getElementType() == Type::getMetadataTy(ElemTy->getContext())) + if (PTy->getElementType()->getTypeID() == MetadataTyID) return false; return true; @@ -928,7 +924,7 @@ PointerType *PointerType::get(const Type *ValueType, unsigned AddressSpace) { assert(ValueType && "Can't get a pointer to type!"); - assert(ValueType != Type::getVoidTy(ValueType->getContext()) && + assert(ValueType->getTypeID() != VoidTyID && "Pointer to void is not valid, use i8* instead!"); assert(isValidElementType(ValueType) && "Invalid type for pointer element!"); PointerValType PVT(ValueType, AddressSpace); @@ -955,12 +951,12 @@ } bool PointerType::isValidElementType(const Type *ElemTy) { - if (ElemTy == Type::getVoidTy(ElemTy->getContext()) || - ElemTy == Type::getLabelTy(ElemTy->getContext())) + if (ElemTy->getTypeID() == VoidTyID || + ElemTy->getTypeID() == LabelTyID) return false; if (const PointerType *PTy = dyn_cast(ElemTy)) - if (PTy->getElementType() == Type::getMetadataTy(ElemTy->getContext())) + if (PTy->getElementType()->getTypeID() == MetadataTyID) return false; return true; Added: llvm/trunk/test/Other/2009-09-14-function-elements.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/2009-09-14-function-elements.ll?rev=81846&view=auto ============================================================================== --- llvm/trunk/test/Other/2009-09-14-function-elements.ll (added) +++ llvm/trunk/test/Other/2009-09-14-function-elements.ll Tue Sep 15 01:28:26 2009 @@ -0,0 +1,6 @@ +; RUN: not llvm-as %s -disable-output 2>/dev/null + +; Arrays and structures with function types (not function pointers) are illegal. + + at foo = external global [4 x i32 (i32)] + at bar = external global { i32 (i32) } From clattner at apple.com Tue Sep 15 01:29:42 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Sep 2009 23:29:42 -0700 Subject: [llvm-commits] [llvm] r81845 - in /llvm/trunk: lib/VMCore/ConstantFold.cpp test/Assembler/insertextractvalue.ll In-Reply-To: <200909150628.n8F6SDib007558@zion.cs.uiuc.edu> References: <200909150628.n8F6SDib007558@zion.cs.uiuc.edu> Message-ID: <74A7C8B1-614C-44CA-A454-3ECF822D13A4@apple.com> On Sep 14, 2009, at 11:28 PM, Chris Lattner wrote: > Author: lattner > Date: Tue Sep 15 01:28:12 2009 > New Revision: 81845 > > URL: http://llvm.org/viewvc/llvm-project?rev=81845&view=rev > Log: > fix PR4963: folding insertvalue would sometimes turn a packed struct > into > an unpacked one. I forgot to mention that the patch was by written by Tomas Lindquist Olsen! -Chris From sabre at nondot.org Tue Sep 15 01:34:29 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 06:34:29 -0000 Subject: [llvm-commits] [llvm] r81848 - /llvm/trunk/test/Transforms/ConstProp/basictest.ll Message-ID: <200909150634.n8F6YTKP008432@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 01:34:29 2009 New Revision: 81848 URL: http://llvm.org/viewvc/llvm-project?rev=81848&view=rev Log: convert to filecheck Modified: llvm/trunk/test/Transforms/ConstProp/basictest.ll Modified: llvm/trunk/test/Transforms/ConstProp/basictest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ConstProp/basictest.ll?rev=81848&r1=81847&r2=81848&view=diff ============================================================================== --- llvm/trunk/test/Transforms/ConstProp/basictest.ll (original) +++ llvm/trunk/test/Transforms/ConstProp/basictest.ll Tue Sep 15 01:34:29 2009 @@ -1,20 +1,21 @@ +; RUN: opt < %s -constprop -die -S | FileCheck %s + ; This is a basic sanity check for constant propogation. The add instruction ; should be eliminated. - -; RUN: opt < %s -constprop -die -S | not grep add - -define i32 @test(i1 %B) { +define i32 @test1(i1 %B) { br i1 %B, label %BB1, label %BB2 -BB1: ; preds = %0 - %Val = add i32 0, 0 ; [#uses=1] +BB1: + %Val = add i32 0, 0 br label %BB3 -BB2: ; preds = %0 +BB2: br label %BB3 -BB3: ; preds = %BB2, %BB1 - %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ] ; [#uses=1] +BB3: +; CHECK: @test1 +; CHECK: %Ret = phi i32 [ 0, %BB1 ], [ 1, %BB2 ] + %Ret = phi i32 [ %Val, %BB1 ], [ 1, %BB2 ] ret i32 %Ret } From clattner at apple.com Tue Sep 15 01:41:26 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Sep 2009 23:41:26 -0700 Subject: [llvm-commits] [llvm] r81813 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp In-Reply-To: <200909150013.n8F0DCbX024473@zion.cs.uiuc.edu> References: <200909150013.n8F0DCbX024473@zion.cs.uiuc.edu> Message-ID: On Sep 14, 2009, at 5:13 PM, Nate Begeman wrote: > Author: sampo > Date: Mon Sep 14 19:13:12 2009 > New Revision: 81813 > > URL: http://llvm.org/viewvc/llvm-project?rev=81813&view=rev > Log: > Add an "original alignment" field to load and store nodes. This > enables the > DAG Combiner to disambiguate chains for loads and stores of types > which are > broken up by the Legalizer into smaller pieces. Hi Nate, > + //! OrigAlign - The original alignment of this MemSDNode in the > case where > + // this node was created by legalize from a MemSDNode with known > alignment. > + unsigned OrigAlign; I don't understand what this means. Is this saying that the load/ store is always an access to [ptr_with_some_alignment]+SVOffset? If so, it seems that the ultimate alignment of the access is actually: MinAlign(OrigAlign, SVOffset) (from MathExtras.h). If this is true, then you can make the comment much more strong, and fix MemSDNode to never actually store the alignment of the access (store OrigAlign instead and compute the access alignment when needed). If we do need to keep both alignments around, is there any way to encode this in SubclassData like the alignment field itself is to avoid growing MemSDNode (the biggest sdnode)? -Chris From evan.cheng at apple.com Tue Sep 15 01:45:17 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Sep 2009 06:45:17 -0000 Subject: [llvm-commits] [llvm] r81849 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200909150645.n8F6jHVo009922@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 15 01:45:16 2009 New Revision: 81849 URL: http://llvm.org/viewvc/llvm-project?rev=81849&view=rev Log: Another try at early partial coalescing. Identity phi source copies (their sources are defined by phi join def) are coalesced. And the phi join copy is backward copy propagated into the other copies. Still miscompiling some tests. :-( Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=81849&r1=81848&r2=81849&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Sep 15 01:45:16 2009 @@ -1052,23 +1052,19 @@ bool LiveIntervals::isProfitableToCoalesce(LiveInterval &DstInt, LiveInterval &SrcInt, SmallVector &IdentCopies, - SmallVector &OtherCopies, - bool &HaveConflict) { - HaveConflict = false; - + SmallVector &OtherCopies) { + bool HaveConflict = false; unsigned NumIdent = 0; - unsigned NumSources = 0; for (MachineRegisterInfo::reg_iterator ri = mri_->reg_begin(SrcInt.reg), re = mri_->reg_end(); ri != re; ++ri) { MachineOperand &O = ri.getOperand(); if (!O.isDef()) continue; - ++NumSources; MachineInstr *MI = &*ri; unsigned SrcReg, DstReg, SrcSubReg, DstSubReg; if (!tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubReg, DstSubReg)) - continue; + return false; if (SrcReg != DstInt.reg) { OtherCopies.push_back(MI); HaveConflict |= DstInt.liveAt(getInstructionIndex(MI)); @@ -1078,7 +1074,9 @@ } } - return NumSources >= 5 && (((float)NumIdent) / NumSources) > 0.20F; + if (!HaveConflict) + return false; // Let coalescer handle it + return IdentCopies.size() > OtherCopies.size(); } void LiveIntervals::performEarlyCoalescing() { @@ -1104,78 +1102,78 @@ LiveInterval &SrcInt = getInterval(PHISrc); SmallVector IdentCopies; SmallVector OtherCopies; - bool HaveConflict; - if (!isProfitableToCoalesce(DstInt, SrcInt, IdentCopies, OtherCopies, - HaveConflict)) + if (!isProfitableToCoalesce(DstInt, SrcInt, IdentCopies, OtherCopies)) continue; DEBUG(errs() << "PHI Join: " << *Join); assert(DstInt.containsOneValue() && "PHI join should have just one val#!"); VNInfo *VNI = DstInt.getValNumInfo(0); - VNInfo *NewVNI = HaveConflict - ? 0 : SrcInt.getNextValue(VNI->def, 0, false, VNInfoAllocator); + + // Change the non-identity copies to directly target the phi destination. + for (unsigned i = 0, e = OtherCopies.size(); i != e; ++i) { + MachineInstr *PHICopy = OtherCopies[i]; + DEBUG(errs() << "Moving: " << *PHICopy); + + MachineInstrIndex MIIndex = getInstructionIndex(PHICopy); + MachineInstrIndex DefIndex = getDefIndex(MIIndex); + LiveRange *SLR = SrcInt.getLiveRangeContaining(DefIndex); + MachineInstrIndex StartIndex = SLR->start; + MachineInstrIndex EndIndex = SLR->end; + + // Delete val# defined by the now identity copy and add the range from + // beginning of the mbb to the end of the range. + SrcInt.removeValNo(SLR->valno); + DEBUG(errs() << " added range [" << StartIndex << ',' + << EndIndex << "] to reg" << DstInt.reg << '\n'); + if (DstInt.liveAt(StartIndex)) + DstInt.removeRange(StartIndex, EndIndex); + VNInfo *NewVNI = DstInt.getNextValue(DefIndex, PHICopy, true, + VNInfoAllocator); + NewVNI->setHasPHIKill(true); + DstInt.addRange(LiveRange(StartIndex, EndIndex, NewVNI)); + for (unsigned j = 0, ee = PHICopy->getNumOperands(); j != ee; ++j) { + MachineOperand &MO = PHICopy->getOperand(j); + if (!MO.isReg() || MO.getReg() != PHISrc) + continue; + MO.setReg(PHIDst); + } + } + // Now let's eliminate all the would-be identity copies. for (unsigned i = 0, e = IdentCopies.size(); i != e; ++i) { MachineInstr *PHICopy = IdentCopies[i]; DEBUG(errs() << "Coalescing: " << *PHICopy); - MachineBasicBlock *PHIMBB = PHICopy->getParent(); MachineInstrIndex MIIndex = getInstructionIndex(PHICopy); MachineInstrIndex DefIndex = getDefIndex(MIIndex); LiveRange *SLR = SrcInt.getLiveRangeContaining(DefIndex); - MachineInstrIndex StartIndex = HaveConflict - ? SLR->start : getMBBStartIdx(PHIMBB); + MachineInstrIndex StartIndex = SLR->start; MachineInstrIndex EndIndex = SLR->end; // Delete val# defined by the now identity copy and add the range from // beginning of the mbb to the end of the range. SrcInt.removeValNo(SLR->valno); - if (HaveConflict) { - DEBUG(errs() << " added range [" << StartIndex << ',' - << EndIndex << "] to reg" << DstInt.reg << '\n'); - DstInt.addRange(LiveRange(StartIndex, EndIndex, VNI)); - // FIXME: Update uses of src to dst in this range? - } else { - DEBUG(errs() << " added range [" << StartIndex << ',' - << SLR->start << "] to reg" << SrcInt.reg << '\n'); - SrcInt.addRange(LiveRange(StartIndex, EndIndex, NewVNI)); - if (PHICopy->killsRegister(PHIDst)) - EndIndex = DefIndex; - DstInt.removeRange(StartIndex, EndIndex); - } RemoveMachineInstrFromMaps(PHICopy); PHICopy->eraseFromParent(); - } - if (HaveConflict) { - // First unset the kill. - for (unsigned i = 0, e = Join->getNumOperands(); i != e; ++i) { - MachineOperand &O = Join->getOperand(i); - if (!O.isReg() || O.getReg() != PHISrc) - continue; - if (O.isKill()) - O.setIsKill(false); - } - MachineInstrIndex MIIndex = getInstructionIndex(Join); - MachineInstrIndex UseIndex = getUseIndex(MIIndex); - MachineInstrIndex DefIndex = getDefIndex(MIIndex); - LiveRange *SLR = SrcInt.getLiveRangeContaining(UseIndex); - LiveRange *DLR = DstInt.getLiveRangeContaining(DefIndex); - SrcInt.addRange(LiveRange(DLR->start, DLR->end, SLR->valno)); - } else { - SrcInt.MergeValueInAsValue(DstInt, VNI, NewVNI); - - // Change all references of phi source to destination. - for (MachineRegisterInfo::reg_iterator ri = mri_->reg_begin(PHIDst), - re = mri_->reg_end(); ri != re; ) { - MachineOperand &O = ri.getOperand(); - ++ri; - O.setReg(PHISrc); - } - removeInterval(DstInt.reg); - - RemoveMachineInstrFromMaps(Join); - Join->eraseFromParent(); - } + DEBUG(errs() << " added range [" << StartIndex << ',' + << EndIndex << "] to reg" << DstInt.reg << '\n'); + DstInt.addRange(LiveRange(StartIndex, EndIndex, VNI)); + } + + // Remove the phi join and update the phi block liveness. + MachineInstrIndex MIIndex = getInstructionIndex(Join); + MachineInstrIndex UseIndex = getUseIndex(MIIndex); + MachineInstrIndex DefIndex = getDefIndex(MIIndex); + LiveRange *SLR = SrcInt.getLiveRangeContaining(UseIndex); + LiveRange *DLR = DstInt.getLiveRangeContaining(DefIndex); + DLR->valno->setCopy(0); + DLR->valno->setIsDefAccurate(false); + DstInt.addRange(LiveRange(SLR->start, SLR->end, DLR->valno)); + SrcInt.removeRange(SLR->start, SLR->end); + assert(SrcInt.empty()); + removeInterval(PHISrc); + RemoveMachineInstrFromMaps(Join); + Join->eraseFromParent(); ++numCoalescing; } From evan.cheng at apple.com Tue Sep 15 02:05:13 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Sep 2009 07:05:13 -0000 Subject: [llvm-commits] [llvm] r81850 - /llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Message-ID: <200909150705.n8F75DYH012710@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 15 02:05:12 2009 New Revision: 81850 URL: http://llvm.org/viewvc/llvm-project?rev=81850&view=rev Log: Forgot this. Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=81850&r1=81849&r2=81850&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue Sep 15 02:05:12 2009 @@ -435,8 +435,7 @@ bool isProfitableToCoalesce(LiveInterval &DstInt, LiveInterval &SrcInt, SmallVector &IdentCopies, - SmallVector &OtherCopies, - bool &HaveConflict); + SmallVector &OtherCopies); void performEarlyCoalescing(); From nicholas at mxc.ca Tue Sep 15 02:08:26 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 15 Sep 2009 07:08:26 -0000 Subject: [llvm-commits] [llvm] r81851 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <200909150708.n8F78Q63013103@zion.cs.uiuc.edu> Author: nicholas Date: Tue Sep 15 02:08:25 2009 New Revision: 81851 URL: http://llvm.org/viewvc/llvm-project?rev=81851&view=rev Log: Add more newlines to make up for the ones removed from the end of instructions. Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=81851&r1=81850&r2=81851&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Sep 15 02:08:25 2009 @@ -244,8 +244,8 @@ // constructs like "void foo() { int A[] = {1,2,3,4,5,6,7,8,9...}; }" if 'A' // is only subsequently read. if (Instruction *TheCopy = isOnlyCopiedFromConstantGlobal(AI)) { - DEBUG(errs() << "Found alloca equal to global: " << *AI); - DEBUG(errs() << " memcpy = " << *TheCopy); + DEBUG(errs() << "Found alloca equal to global: " << *AI << '\n'); + DEBUG(errs() << " memcpy = " << *TheCopy << '\n'); Constant *TheSrc = cast(TheCopy->getOperand(2)); AI->replaceAllUsesWith(ConstantExpr::getBitCast(TheSrc, AI->getType())); TheCopy->eraseFromParent(); // Don't mutate the global. @@ -306,7 +306,7 @@ // we just get a lot of insert/extracts. If at least one vector is // involved, then we probably really do have a union of vector/array. if (VectorTy && isa(VectorTy) && HadAVector) { - DEBUG(errs() << "CONVERT TO VECTOR: " << *AI << " TYPE = " + DEBUG(errs() << "CONVERT TO VECTOR: " << *AI << "\n TYPE = " << *VectorTy << '\n'); // Create and insert the vector alloca. @@ -488,7 +488,7 @@ if (Info.isUnsafe) return; break; } - DEBUG(errs() << " Transformation preventing inst: " << *User); + DEBUG(errs() << " Transformation preventing inst: " << *User << '\n'); return MarkUnsafe(Info); case Instruction::Call: if (MemIntrinsic *MI = dyn_cast(User)) { @@ -498,10 +498,10 @@ break; } } - DEBUG(errs() << " Transformation preventing inst: " << *User); + DEBUG(errs() << " Transformation preventing inst: " << *User << '\n'); return MarkUnsafe(Info); default: - DEBUG(errs() << " Transformation preventing inst: " << *User); + DEBUG(errs() << " Transformation preventing inst: " << *User << '\n'); return MarkUnsafe(Info); } } @@ -926,7 +926,8 @@ IntegerType::get(SI->getContext(), AllocaSizeBits), "", SI); - DEBUG(errs() << "PROMOTING STORE TO WHOLE ALLOCA: " << *AI << *SI); + DEBUG(errs() << "PROMOTING STORE TO WHOLE ALLOCA: " << *AI << '\n' << *SI + << '\n'); // There are two forms here: AI could be an array or struct. Both cases // have different ways to compute the element offset. @@ -1042,7 +1043,8 @@ TD->getTypeAllocSizeInBits(LI->getType()) != AllocaSizeBits) return; - DEBUG(errs() << "PROMOTING LOAD OF WHOLE ALLOCA: " << *AI << *LI); + DEBUG(errs() << "PROMOTING LOAD OF WHOLE ALLOCA: " << *AI << '\n' << *LI + << '\n'); // There are two forms here: AI could be an array or struct. Both cases // have different ways to compute the element offset. @@ -1169,7 +1171,8 @@ I != E; ++I) { isSafeUseOfAllocation(cast(*I), AI, Info); if (Info.isUnsafe) { - DEBUG(errs() << "Cannot transform: " << *AI << " due to user: " << **I); + DEBUG(errs() << "Cannot transform: " << *AI << "\n due to user: " + << **I << '\n'); return 0; } } From asl at math.spbu.ru Tue Sep 15 02:12:03 2009 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 15 Sep 2009 11:12:03 +0400 Subject: [llvm-commits] [llvm] r81657 - in /llvm/trunk: lib/Target/ARM/ARMRegisterInfo.td test/CodeGen/ARM/2009-09-13-InvalidSubreg.ll In-Reply-To: References: <200909130059.n8D0xhIF024496@zion.cs.uiuc.edu> Message-ID: Hello, Evan > Could you explain why this is needed? ARM 'high' D / Q registers don't have 32-bit subregs. Previously we incorrectly claimed that all Q / D registers do have them. This confuses the codegen while computing superregs - it was allowed to have e.g. Q8 as a superreg of 32-bit subreg, which is definitely incorrect. We discussed the PR in question with Bob and decided that proper solution will be to model subregs properly. All other solutions turned out to be pretty fragile. The dummy subclass is needed since we want to have same subreg indices for both QPR and QPR_VFP2 reglcass. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Tue Sep 15 02:40:38 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Sep 2009 09:40:38 +0200 Subject: [llvm-commits] [llvm] r80930 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Instr64bit.td X86InstrInfo.td In-Reply-To: <3AC8C10E-B832-4870-A80F-97C1B3524C7F@apple.com> References: <200909031718.n83HIqqR031599@zion.cs.uiuc.edu> <4AA00AB1.8080304@free.fr> <3AC8C10E-B832-4870-A80F-97C1B3524C7F@apple.com> Message-ID: <4AAF44F6.7050700@free.fr> >> not sure why you mention trampoline code here? > > All I know is that one of test failures happened to be in the vicinity > of a trampoline setup, and there was nothing else suspicious around. > If -disable-16bit is worth pursuing, I'll do more testing and figure > out what's really going on there. OK, thanks. Ciao, Duncan. From baldrick at free.fr Tue Sep 15 03:36:42 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Sep 2009 08:36:42 -0000 Subject: [llvm-commits] [gcc-plugin] r81853 - in /gcc-plugin/trunk: llvm-backend.cpp llvm-convert.cpp llvm-internal.h Message-ID: <200909150836.n8F8agb0004778@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 15 03:36:41 2009 New Revision: 81853 URL: http://llvm.org/viewvc/llvm-project?rev=81853&view=rev Log: GCC adds a star '*' at the front of user specified assembler names. LLVM has a similar scheme, only it uses '\1'. Make sure '*' is turned into '\1' in assembler names. With this change sqlite3 links. Modified: gcc-plugin/trunk/llvm-backend.cpp gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-backend.cpp?rev=81853&r1=81852&r2=81853&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-backend.cpp (original) +++ gcc-plugin/trunk/llvm-backend.cpp Tue Sep 15 03:36:41 2009 @@ -1375,14 +1375,11 @@ //TODO timevar_push(TV_LLVM_GLOBALS); - const char *Name = ""; - if (DECL_NAME(decl)) - if (tree AssemblerName = DECL_ASSEMBLER_NAME(decl)) - Name = IDENTIFIER_POINTER(AssemblerName); - + std::string Name = getLLVMAssemblerName(decl).str(); + // Now handle ordinary static variables and functions (in memory). // Also handle vars declared register invalidly. - if (Name[0] == 1) { + if (!Name.empty() && Name[0] == 1) { #ifdef REGISTER_PREFIX if (strlen (REGISTER_PREFIX) != 0) { int reg_number = decode_reg_name(Name); @@ -1407,7 +1404,7 @@ // object. Note that this is quite possibly a forward reference to the // object, so its type may change later. if (TREE_CODE(decl) == FUNCTION_DECL) { - assert(Name[0] && "Function with empty name!"); + assert(!Name.empty() && "Function with empty name!"); // If this function has already been created, reuse the decl. This happens // when we have something like __builtin_memset and memset in the same file. Function *FnEntry = TheModule->getFunction(Name); @@ -1464,7 +1461,7 @@ if (Ty == Type::getVoidTy(Context)) Ty = StructType::get(Context); - if (Name[0] == 0) { // Global has no name. + if (Name.empty()) { // Global has no name. GV = new GlobalVariable(*TheModule, Ty, false, GlobalValue::ExternalLinkage, 0, ""); @@ -1553,15 +1550,6 @@ //TODO timevar_pop(TV_LLVM_GLOBALS); } -/// llvm_get_decl_name - Used by varasm.c, returns the specified declaration's -/// name. -const char *llvm_get_decl_name(void *LLVM) { - if (LLVM) - if (const ValueName *VN = ((Value*)LLVM)->getValueName()) - return VN->getKeyData(); - return ""; -} - /// llvm_mark_decl_weak - Used by varasm.c, called when a decl is found to be /// weak, but it already had an llvm object created for it. This marks the LLVM /// object weak as well. @@ -1641,10 +1629,24 @@ /// extractRegisterName - Get a register name given its decl. In 4.2 unlike 4.0 /// these names have been run through set_user_assembler_name which means they -/// may have a leading \1 at this point; compensate. +/// may have a leading star at this point; compensate. const char* extractRegisterName(tree decl) { const char* Name = IDENTIFIER_POINTER(DECL_ASSEMBLER_NAME(decl)); - return (*Name == 1) ? Name + 1 : Name; + return (*Name == '*') ? Name + 1 : Name; +} + +/// getLLVMAssemblerName - Get the assembler name (DECL_ASSEMBLER_NAME) for the +/// declaration, with any leading star replaced by '\1'. +Twine getLLVMAssemblerName(union tree_node *decl) { + tree Ident = DECL_ASSEMBLER_NAME(decl); + if (!Ident) + return ""; + + const char *Name = IDENTIFIER_POINTER(Ident); + if (*Name != '*') + return Name; + + return "\1" + Twine(Name + 1); } /// FinalizePlugin - Shutdown the plugin. Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81853&r1=81852&r2=81853&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 15 03:36:41 2009 @@ -396,10 +396,10 @@ } void TreeToLLVM::StartFunctionBody() { - const char *Name = ""; - // Get the name of the function. - if (tree ID = DECL_ASSEMBLER_NAME(FnDecl)) - Name = IDENTIFIER_POINTER(ID); + std::string Name = getLLVMAssemblerName(FnDecl).str(); + // TODO: Add support for dropping the leading '\1' in order to support + // unsigned bswap(unsigned) __asm__("llvm.bswap"); + // This would also require adjustments in make_decl_llvm. // Determine the FunctionType and calling convention for this function. tree static_chain = cfun->static_chain_decl; Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=81853&r1=81852&r2=81853&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Tue Sep 15 03:36:41 2009 @@ -127,6 +127,7 @@ void clearTargetBuiltinCache(); const char* extractRegisterName(union tree_node*); void handleVisibility(union tree_node* decl, GlobalValue *GV); +Twine getLLVMAssemblerName(union tree_node *); struct StructTypeConversionInfo; From edwintorok at gmail.com Tue Sep 15 03:41:56 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Tue, 15 Sep 2009 11:41:56 +0300 Subject: [llvm-commits] [gcc-plugin] r81762 - in /gcc-plugin/trunk: ./ gt-llvm-cache.h In-Reply-To: <200909141354.n8EDsYnw006148@zion.cs.uiuc.edu> References: <200909141354.n8EDsYnw006148@zion.cs.uiuc.edu> Message-ID: <4AAF5354.9070909@gmail.com> On 2009-09-14 16:54, Duncan Sands wrote: > Author: baldrick > Date: Mon Sep 14 08:54:33 2009 > New Revision: 81762 > > URL: http://llvm.org/viewvc/llvm-project?rev=81762&view=rev > Log: > The generated header containing garbage collector information > is actually not host or target specific as far as I can see. > Add it to the repository so everyone doesn't have to generate > it (which requires a big gcc patch). > > Added: > gcc-plugin/trunk/gt-llvm-cache.h > Modified: > gcc-plugin/trunk/ (props changed) > > Propchange: gcc-plugin/trunk/ > > ------------------------------------------------------------------------------ > --- svn:ignore (original) > +++ svn:ignore (removed) > @@ -1 +0,0 @@ > -gt-llvm-cache.h > > Added: gcc-plugin/trunk/gt-llvm-cache.h > URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/gt-llvm-cache.h?rev=81762&view=auto > > ============================================================================== > --- gcc-plugin/trunk/gt-llvm-cache.h (added) > +++ gcc-plugin/trunk/gt-llvm-cache.h Mon Sep 14 08:54:33 2009 > @@ -0,0 +1,1962 @@ > +/* Type information for GCC. > + Copyright (C) 2004, 2007, 2009 Free Software Foundation, Inc. > + > +This file is part of GCC. > + > +GCC is free software; you can redistribute it and/or modify it under > +the terms of the GNU General Public License as published by the Free > +Software Foundation; either version 3, or (at your option) any later > +version. > Why is this GPLv3? Best regards, --Edwin From anton at korobeynikov.info Tue Sep 15 03:48:28 2009 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 15 Sep 2009 12:48:28 +0400 Subject: [llvm-commits] [gcc-plugin] r81762 - in /gcc-plugin/trunk: ./ gt-llvm-cache.h In-Reply-To: <4AAF5354.9070909@gmail.com> References: <200909141354.n8EDsYnw006148@zion.cs.uiuc.edu> <4AAF5354.9070909@gmail.com> Message-ID: > Why is this GPLv3? Because the whole gcc plugin is GPLv3 ? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Tue Sep 15 03:59:19 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Sep 2009 10:59:19 +0200 Subject: [llvm-commits] [gcc-plugin] r81762 - in /gcc-plugin/trunk: ./ gt-llvm-cache.h In-Reply-To: <4AAF5354.9070909@gmail.com> References: <200909141354.n8EDsYnw006148@zion.cs.uiuc.edu> <4AAF5354.9070909@gmail.com> Message-ID: <4AAF5767.7080303@free.fr> Hi T?r?k, > Why is this GPLv3? it is autogenerated by gcc (which is GPLv3), and unsurprisingly the gcc developers decided it should be GPLv3 too. This doesn't matter since the plugin is also GPLv3: it is licensed as GPLv2 or later, and makes use of and links with gcc which is GPLv3. I'm pretty sure this makes the plugin GPLv3. Ciao, Duncan. From baldrick at free.fr Tue Sep 15 08:03:26 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Sep 2009 13:03:26 -0000 Subject: [llvm-commits] [gcc-plugin] r81854 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909151303.n8FD3QUJ006682@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 15 08:03:25 2009 New Revision: 81854 URL: http://llvm.org/viewvc/llvm-project?rev=81854&view=rev Log: It turns out that POINTER_PLUS_EXPR means to add a byte offset to the pointer, and not compute ptr+offset (i.e. in units of the pointee) as you might think. With this fix, sqlite3 not only compiles and links, it actually works! Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81854&r1=81853&r2=81854&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 15 08:03:25 2009 @@ -3758,22 +3758,15 @@ } Value *TreeToLLVM::EmitPOINTER_PLUS_EXPR(tree exp) { - tree ptr_type = TREE_TYPE(TREE_OPERAND(exp, 0)); - Value *Ptr = Emit(TREE_OPERAND(exp, 0), 0); - Value *Idx = Emit(TREE_OPERAND(exp, 1), 0); - - // If we are indexing over a variable sized type, do raw pointer arithmetic. - if (!isSequentialCompatible(ptr_type) && !VOID_TYPE_P(TREE_TYPE(ptr_type))) { - // Compute the offset in bytes. - Value *Size = Emit(TYPE_SIZE(TREE_TYPE(ptr_type)), 0); - Idx = Builder.CreateMul(Idx, CastToUIntType(Size, Idx->getType())); - - // Convert the pointer into an i8* and add the offset to it. - Ptr = Builder.CreateBitCast(Ptr, Type::getInt8Ty(Context)->getPointerTo()); - } + Value *Ptr = Emit(TREE_OPERAND(exp, 0), 0); // The pointer. + Value *Idx = Emit(TREE_OPERAND(exp, 1), 0); // The offset in bytes. + // Convert the pointer into an i8* and add the offset to it. + Ptr = Builder.CreateBitCast(Ptr, Type::getInt8Ty(Context)->getPointerTo()); Value *GEP = POINTER_TYPE_OVERFLOW_UNDEFINED ? Builder.CreateInBoundsGEP(Ptr, Idx) : Builder.CreateGEP(Ptr, Idx); + + // The result may be of a different pointer type. return Builder.CreateBitCast(GEP, ConvertType(TREE_TYPE(exp))); } From baldrick at free.fr Tue Sep 15 09:27:11 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Sep 2009 14:27:11 -0000 Subject: [llvm-commits] [gcc-plugin] r81855 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909151427.n8FERBuW017901@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 15 09:27:11 2009 New Revision: 81855 URL: http://llvm.org/viewvc/llvm-project?rev=81855&view=rev Log: In mainline GCC, the filter value is an "int". Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81855&r1=81854&r2=81855&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 15 09:27:11 2009 @@ -1916,22 +1916,22 @@ // Check to see if the exception values have been constructed. if (ExceptionValue) return; - const Type *IntPtr = TD.getIntPtrType(Context); + const Type *IntTy = ConvertType(integer_type_node); ExceptionValue = CreateTemporary(PointerType::getUnqual(Type::getInt8Ty(Context))); ExceptionValue->setName("eh_exception"); - ExceptionSelectorValue = CreateTemporary(IntPtr); + ExceptionSelectorValue = CreateTemporary(IntTy); ExceptionSelectorValue->setName("eh_selector"); FuncEHException = Intrinsic::getDeclaration(TheModule, Intrinsic::eh_exception); FuncEHSelector = Intrinsic::getDeclaration(TheModule, - (IntPtr == Type::getInt32Ty(Context) ? + (IntTy == Type::getInt32Ty(Context) ? Intrinsic::eh_selector_i32 : Intrinsic::eh_selector_i64)); FuncEHGetTypeID = Intrinsic::getDeclaration(TheModule, - (IntPtr == Type::getInt32Ty(Context) ? + (IntTy == Type::getInt32Ty(Context) ? Intrinsic::eh_typeid_for_i32 : Intrinsic::eh_typeid_for_i64)); } From gohman at apple.com Tue Sep 15 10:08:33 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 15:08:33 -0000 Subject: [llvm-commits] [llvm] r81856 - in /llvm/trunk/include/llvm: ADT/SmallSet.h AbstractTypeUser.h Analysis/LoopInfo.h Analysis/ScalarEvolutionExpressions.h CodeGen/LiveVariables.h Support/Timer.h Target/TargetSchedule.td Message-ID: <200909151508.n8FF8YGg023250@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 10:08:33 2009 New Revision: 81856 URL: http://llvm.org/viewvc/llvm-project?rev=81856&view=rev Log: Fix apostrophos. Modified: llvm/trunk/include/llvm/ADT/SmallSet.h llvm/trunk/include/llvm/AbstractTypeUser.h llvm/trunk/include/llvm/Analysis/LoopInfo.h llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h llvm/trunk/include/llvm/CodeGen/LiveVariables.h llvm/trunk/include/llvm/Support/Timer.h llvm/trunk/include/llvm/Target/TargetSchedule.td Modified: llvm/trunk/include/llvm/ADT/SmallSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallSet.h?rev=81856&r1=81855&r2=81856&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallSet.h (original) +++ llvm/trunk/include/llvm/ADT/SmallSet.h Tue Sep 15 10:08:33 2009 @@ -30,7 +30,7 @@ template class SmallSet { /// Use a SmallVector to hold the elements here (even though it will never - /// reach it's 'large' stage) to avoid calling the default ctors of elements + /// reach its 'large' stage) to avoid calling the default ctors of elements /// we will never use. SmallVector Vector; std::set Set; Modified: llvm/trunk/include/llvm/AbstractTypeUser.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/AbstractTypeUser.h?rev=81856&r1=81855&r2=81856&view=diff ============================================================================== --- llvm/trunk/include/llvm/AbstractTypeUser.h (original) +++ llvm/trunk/include/llvm/AbstractTypeUser.h Tue Sep 15 10:08:33 2009 @@ -65,7 +65,7 @@ const Type *NewTy) = 0; /// The other case which AbstractTypeUsers must be aware of is when a type - /// makes the transition from being abstract (where it has clients on it's + /// makes the transition from being abstract (where it has clients on its /// AbstractTypeUsers list) to concrete (where it does not). This method /// notifies ATU's when this occurs for a type. /// Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=81856&r1=81855&r2=81856&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Sep 15 10:08:33 2009 @@ -732,7 +732,7 @@ for (typename InvBlockTraits::ChildIteratorType I = InvBlockTraits::child_begin(BB), E = InvBlockTraits::child_end(BB); I != E; ++I) - if (DT.dominates(BB, *I)) // If BB dominates it's predecessor... + if (DT.dominates(BB, *I)) // If BB dominates its predecessor... TodoStack.push_back(*I); if (TodoStack.empty()) return 0; // No backedges to this block... @@ -758,7 +758,7 @@ if (LoopT *SubLoop = const_cast(getLoopFor(X))) if (SubLoop->getHeader() == X && isNotAlreadyContainedIn(SubLoop, L)){ - // Remove the subloop from it's current parent... + // Remove the subloop from its current parent... assert(SubLoop->ParentLoop && SubLoop->ParentLoop != L); LoopT *SLP = SubLoop->ParentLoop; // SubLoopParent typename std::vector::iterator I = Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=81856&r1=81855&r2=81856&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Tue Sep 15 10:08:33 2009 @@ -575,7 +575,7 @@ //===--------------------------------------------------------------------===// /// SCEVUnknown - This means that we are dealing with an entirely unknown SCEV - /// value, and only represent it as it's LLVM Value. This is the "bottom" + /// value, and only represent it as its LLVM Value. This is the "bottom" /// value for the analysis. /// class SCEVUnknown : public SCEV { Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=81856&r1=81855&r2=81856&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Tue Sep 15 10:08:33 2009 @@ -155,7 +155,7 @@ MachineInstr *FindLastPartialDef(unsigned Reg, unsigned &PartDefReg); /// hasRegisterUseBelow - Return true if the specified register is used after - /// the current instruction and before it's next definition. + /// the current instruction and before its next definition. bool hasRegisterUseBelow(unsigned Reg, MachineBasicBlock::iterator I, MachineBasicBlock *MBB); Modified: llvm/trunk/include/llvm/Support/Timer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Timer.h?rev=81856&r1=81855&r2=81856&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Timer.h (original) +++ llvm/trunk/include/llvm/Support/Timer.h Tue Sep 15 10:08:33 2009 @@ -27,7 +27,7 @@ class raw_ostream; /// Timer - This class is used to track the amount of time spent between -/// invocations of it's startTimer()/stopTimer() methods. Given appropriate OS +/// invocations of its startTimer()/stopTimer() methods. Given appropriate OS /// support it can also keep track of the RSS of the program at various points. /// By default, the Timer will print the amount of time it has captured to /// standard error when the laster timer is destroyed, otherwise it is printed Modified: llvm/trunk/include/llvm/Target/TargetSchedule.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSchedule.td?rev=81856&r1=81855&r2=81856&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetSchedule.td (original) +++ llvm/trunk/include/llvm/Target/TargetSchedule.td Tue Sep 15 10:08:33 2009 @@ -60,7 +60,7 @@ //===----------------------------------------------------------------------===// // Instruction itinerary data - These values provide a runtime map of an -// instruction itinerary class (name) to it's itinerary data. +// instruction itinerary class (name) to its itinerary data. // class InstrItinData stages, list operandcycles = []> { From gohman at apple.com Tue Sep 15 10:09:54 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 15:09:54 -0000 Subject: [llvm-commits] [llvm] r81857 - /llvm/trunk/test/CodeGen/X86/cmov.ll Message-ID: <200909151509.n8FF9sdj023434@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 10:09:54 2009 New Revision: 81857 URL: http://llvm.org/viewvc/llvm-project?rev=81857&view=rev Log: Restore a comment that was lost in the merge. Modified: llvm/trunk/test/CodeGen/X86/cmov.ll Modified: llvm/trunk/test/CodeGen/X86/cmov.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/cmov.ll?rev=81857&r1=81856&r2=81857&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/cmov.ll (original) +++ llvm/trunk/test/CodeGen/X86/cmov.ll Tue Sep 15 10:09:54 2009 @@ -33,6 +33,10 @@ } +; x86's 32-bit cmov doesn't clobber the high 32 bits of the destination +; if the condition is false. An explicit zero-extend (movl) is needed +; after the cmov. + declare void @bar(i64) nounwind define void @test3(i64 %a, i64 %b, i1 %p) nounwind { From gohman at apple.com Tue Sep 15 10:33:42 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 15:33:42 -0000 Subject: [llvm-commits] [llvm] r81858 - /llvm/trunk/tools/llvm-dis/llvm-dis.cpp Message-ID: <200909151533.n8FFXg5C026578@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 10:33:42 2009 New Revision: 81858 URL: http://llvm.org/viewvc/llvm-project?rev=81858&view=rev Log: Don't bother using a PassManager just to print a Module. Modified: llvm/trunk/tools/llvm-dis/llvm-dis.cpp Modified: llvm/trunk/tools/llvm-dis/llvm-dis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dis/llvm-dis.cpp?rev=81858&r1=81857&r2=81858&view=diff ============================================================================== --- llvm/trunk/tools/llvm-dis/llvm-dis.cpp (original) +++ llvm/trunk/tools/llvm-dis/llvm-dis.cpp Tue Sep 15 10:33:42 2009 @@ -18,9 +18,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/PassManager.h" #include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/Assembly/PrintModulePass.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" @@ -105,11 +103,8 @@ } // All that llvm-dis does is write the assembly to a file. - if (!DontPrint) { - PassManager Passes; - Passes.add(createPrintModulePass(Out.get())); - Passes.run(*M.get()); - } + if (!DontPrint) + *Out << *M; return 0; } From gohman at apple.com Tue Sep 15 10:35:08 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 15:35:08 -0000 Subject: [llvm-commits] [llvm] r81859 - in /llvm/trunk: docs/CommandGuide/llvm-link.pod tools/llvm-link/llvm-link.cpp Message-ID: <200909151535.n8FFZ82t026776@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 10:35:07 2009 New Revision: 81859 URL: http://llvm.org/viewvc/llvm-project?rev=81859&view=rev Log: Give llvm-link a -S option. Modified: llvm/trunk/docs/CommandGuide/llvm-link.pod llvm/trunk/tools/llvm-link/llvm-link.cpp Modified: llvm/trunk/docs/CommandGuide/llvm-link.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-link.pod?rev=81859&r1=81858&r2=81859&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-link.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-link.pod Tue Sep 15 10:35:07 2009 @@ -42,6 +42,10 @@ Specify the output file name. If F is C<->, then B will write its output to standard output. +=item B<-S> + +Write output in LLVM intermediate language (instead of bitcode). + =item B<-d> If specified, B prints a human-readable version of the output Modified: llvm/trunk/tools/llvm-link/llvm-link.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-link/llvm-link.cpp?rev=81859&r1=81858&r2=81859&view=diff ============================================================================== --- llvm/trunk/tools/llvm-link/llvm-link.cpp (original) +++ llvm/trunk/tools/llvm-link/llvm-link.cpp Tue Sep 15 10:35:07 2009 @@ -41,6 +41,10 @@ Force("f", cl::desc("Enable binary output on terminals")); static cl::opt +OutputAssembly("S", + cl::desc("Write output as LLVM assembly"), cl::Hidden); + +static cl::opt Verbose("v", cl::desc("Print information about actions taken")); static cl::opt @@ -116,7 +120,7 @@ // TODO: Iterate over the -l list and link in any modules containing // global symbols that have not been resolved so far. - if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite.get(); + if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite; std::string ErrorInfo; std::auto_ptr @@ -132,13 +136,15 @@ if (OutputFilename != "-") sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - if (verifyModule(*Composite.get())) { + if (verifyModule(*Composite)) { errs() << argv[0] << ": linked module is broken!\n"; return 1; } if (Verbose) errs() << "Writing bitcode...\n"; - if (Force || !CheckBitcodeOutputToConsole(*Out, true)) + if (OutputAssembly) { + *Out << *Composite; + } else if (Force || !CheckBitcodeOutputToConsole(*Out, true)) WriteBitcodeToFile(Composite.get(), *Out); return 0; From gohman at apple.com Tue Sep 15 10:38:31 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 15:38:31 -0000 Subject: [llvm-commits] [llvm] r81860 - /llvm/trunk/test/Linker/ Message-ID: <200909151538.n8FFcWv2027257@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 10:38:31 2009 New Revision: 81860 URL: http://llvm.org/viewvc/llvm-project?rev=81860&view=rev Log: Use llvm-link -S instead of using llvm-dis. Modified: llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll llvm/trunk/test/Linker/2003-01-30-LinkerTypeRename.ll llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll llvm/trunk/test/Linker/2003-05-31-LinkerRename.ll llvm/trunk/test/Linker/2003-08-23-GlobalVarLinking.ll llvm/trunk/test/Linker/2003-10-21-ConflictingTypesTolerance.ll llvm/trunk/test/Linker/2004-12-03-DisagreeingType.ll llvm/trunk/test/Linker/2005-02-12-ConstantGlobals-2.ll llvm/trunk/test/Linker/2005-02-12-ConstantGlobals.ll llvm/trunk/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll llvm/trunk/test/Linker/2006-06-15-GlobalVarAlignment.ll llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll llvm/trunk/test/Linker/AppendingLinkage.ll llvm/trunk/test/Linker/AppendingLinkage2.ll llvm/trunk/test/Linker/ConstantGlobals1.ll llvm/trunk/test/Linker/ConstantGlobals2.ll llvm/trunk/test/Linker/ConstantGlobals3.ll llvm/trunk/test/Linker/LinkOnce.ll llvm/trunk/test/Linker/link-global-to-func.ll llvm/trunk/test/Linker/linknamedmdnode.ll Modified: llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll (original) +++ llvm/trunk/test/Linker/2003-01-30-LinkerRename.ll Tue Sep 15 10:38:31 2009 @@ -3,7 +3,7 @@ ; RUN: echo {define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc ; RUN: llvm-as %s -o %t.2.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep @foo() | grep -v internal +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep @foo() | grep -v internal define i32 @foo() { ret i32 0 } Modified: llvm/trunk/test/Linker/2003-01-30-LinkerTypeRename.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-01-30-LinkerTypeRename.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-01-30-LinkerTypeRename.ll (original) +++ llvm/trunk/test/Linker/2003-01-30-LinkerTypeRename.ll Tue Sep 15 10:38:31 2009 @@ -3,7 +3,7 @@ ; RUN: echo {%Ty = type opaque @GV = external global %Ty*} | llvm-as > %t.1.bc ; RUN: llvm-as < %s > %t.2.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep {%Ty } | not grep opaque +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {%Ty } | not grep opaque %Ty = type i32 Modified: llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll (original) +++ llvm/trunk/test/Linker/2003-04-23-LinkOnceLost.ll Tue Sep 15 10:38:31 2009 @@ -4,7 +4,7 @@ ; RUN: echo { define linkonce void @foo() \{ ret void \} } | \ ; RUN: llvm-as -o %t.2.bc ; RUN: llvm-as %s -o %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep foo | grep linkonce +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep foo | grep linkonce declare void @foo() Modified: llvm/trunk/test/Linker/2003-05-31-LinkerRename.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-05-31-LinkerRename.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-05-31-LinkerRename.ll (original) +++ llvm/trunk/test/Linker/2003-05-31-LinkerRename.ll Tue Sep 15 10:38:31 2009 @@ -6,7 +6,7 @@ ; RUN: echo { define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc ; RUN: llvm-as < %s > %t.2.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep internal | not grep @foo( +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep internal | not grep @foo( declare i32 @foo() Modified: llvm/trunk/test/Linker/2003-08-23-GlobalVarLinking.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-08-23-GlobalVarLinking.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-08-23-GlobalVarLinking.ll (original) +++ llvm/trunk/test/Linker/2003-08-23-GlobalVarLinking.ll Tue Sep 15 10:38:31 2009 @@ -1,7 +1,7 @@ ; RUN: llvm-as < %s > %t.out1.bc ; RUN: echo {@S = external global \{ i32, opaque* \} declare void @F(opaque*)}\ ; RUN: | llvm-as > %t.out2.bc -; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | not grep opaque +; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep opaque ; After linking this testcase, there should be no opaque types left. The two ; S's should cause the opaque type to be resolved to 'int'. Modified: llvm/trunk/test/Linker/2003-10-21-ConflictingTypesTolerance.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2003-10-21-ConflictingTypesTolerance.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2003-10-21-ConflictingTypesTolerance.ll (original) +++ llvm/trunk/test/Linker/2003-10-21-ConflictingTypesTolerance.ll Tue Sep 15 10:38:31 2009 @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s > %t.out1.bc ; RUN: echo { %M = type \[8 x i32\] external global %M } | llvm-as > %t.out2.bc -; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | grep %M | grep \\{ +; RUN: llvm-link %t.out1.bc %t.out2.bc -S | grep %M | grep \\{ %M = type { i32 } Modified: llvm/trunk/test/Linker/2004-12-03-DisagreeingType.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2004-12-03-DisagreeingType.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2004-12-03-DisagreeingType.ll (original) +++ llvm/trunk/test/Linker/2004-12-03-DisagreeingType.ll Tue Sep 15 10:38:31 2009 @@ -1,7 +1,7 @@ ; RUN: echo {@G = weak global \{\{\{\{double\}\}\}\} zeroinitializer } | \ ; RUN: llvm-as > %t.out2.bc ; RUN: llvm-as < %s > %t.out1.bc -; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | not grep {\\}} +; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep {\\}} ; When linked, the global above should be eliminated, being merged with the ; global below. Modified: llvm/trunk/test/Linker/2005-02-12-ConstantGlobals-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2005-02-12-ConstantGlobals-2.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2005-02-12-ConstantGlobals-2.ll (original) +++ llvm/trunk/test/Linker/2005-02-12-ConstantGlobals-2.ll Tue Sep 15 10:38:31 2009 @@ -3,6 +3,6 @@ ; RUN: echo {@X = external constant i32} | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep {global i32 7} +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {global i32 7} @X = global i32 7 Modified: llvm/trunk/test/Linker/2005-02-12-ConstantGlobals.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2005-02-12-ConstantGlobals.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2005-02-12-ConstantGlobals.ll (original) +++ llvm/trunk/test/Linker/2005-02-12-ConstantGlobals.ll Tue Sep 15 10:38:31 2009 @@ -3,6 +3,6 @@ ; RUN: echo {@X = global i32 7} | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep {global i32 7} +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {global i32 7} @X = external constant i32 ; [#uses=0] Modified: llvm/trunk/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll (original) +++ llvm/trunk/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll Tue Sep 15 10:38:31 2009 @@ -1,7 +1,7 @@ ; RUN: echo { @G = appending global \[0 x i32\] zeroinitializer } | \ ; RUN: llvm-as > %t.out2.bc ; RUN: llvm-as < %s > %t.out1.bc -; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | grep {@G =} +; RUN: llvm-link %t.out1.bc %t.out2.bc -S | grep {@G =} ; When linked, the globals should be merged, and the result should still ; be named '@G'. Modified: llvm/trunk/test/Linker/2006-06-15-GlobalVarAlignment.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2006-06-15-GlobalVarAlignment.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2006-06-15-GlobalVarAlignment.ll (original) +++ llvm/trunk/test/Linker/2006-06-15-GlobalVarAlignment.ll Tue Sep 15 10:38:31 2009 @@ -2,6 +2,6 @@ ; RUN: echo {@X = global i32 7, align 8} | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep {align 8} +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {align 8} @X = weak global i32 7, align 4 Modified: llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll (original) +++ llvm/trunk/test/Linker/2008-06-13-LinkOnceRedefinition.ll Tue Sep 15 10:38:31 2009 @@ -3,6 +3,6 @@ ; RUN: llvm-as %s -o %t.foo1.bc ; RUN: llvm-as %s -o %t.foo2.bc ; RUN: echo {define linkonce void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc -; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis -; RUN: llvm-link %t.foo1.bc %t.foo3.bc | llvm-dis +; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S +; RUN: llvm-link %t.foo1.bc %t.foo3.bc -S define linkonce void @foo() { ret void } Modified: llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll (original) +++ llvm/trunk/test/Linker/2008-06-26-AddressSpace.ll Tue Sep 15 10:38:31 2009 @@ -2,8 +2,8 @@ ; in different modules. ; RUN: llvm-as %s -o %t.foo1.bc ; RUN: echo | llvm-as -o %t.foo2.bc -; RUN: llvm-link %t.foo2.bc %t.foo1.bc | llvm-dis | grep {addrspace(2)} -; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis | grep {addrspace(2)} +; RUN: llvm-link %t.foo2.bc %t.foo1.bc -S | grep {addrspace(2)} +; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S | grep {addrspace(2)} ; rdar://6038021 @G = addrspace(2) global i32 256 Modified: llvm/trunk/test/Linker/AppendingLinkage.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/AppendingLinkage.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/AppendingLinkage.ll (original) +++ llvm/trunk/test/Linker/AppendingLinkage.ll Tue Sep 15 10:38:31 2009 @@ -3,7 +3,7 @@ ; RUN: echo {@X = appending global \[1 x i32\] \[i32 8\] } | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep 7 | grep 4 | grep 8 +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep 7 | grep 4 | grep 8 @X = appending global [2 x i32] [ i32 7, i32 4 ] ; <[2 x i32]*> [#uses=2] @Y = global i32* getelementptr ([2 x i32]* @X, i64 0, i64 0) ; [#uses=0] Modified: llvm/trunk/test/Linker/AppendingLinkage2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/AppendingLinkage2.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/AppendingLinkage2.ll (original) +++ llvm/trunk/test/Linker/AppendingLinkage2.ll Tue Sep 15 10:38:31 2009 @@ -3,6 +3,6 @@ ; RUN: echo {@X = appending global \[1 x i32\] \[i32 8\] } | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep 7 | grep 8 +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep 7 | grep 8 @X = appending global [1 x i32] [ i32 7 ] ; <[1 x i32]*> [#uses=0] Modified: llvm/trunk/test/Linker/ConstantGlobals1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/ConstantGlobals1.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/ConstantGlobals1.ll (original) +++ llvm/trunk/test/Linker/ConstantGlobals1.ll Tue Sep 15 10:38:31 2009 @@ -3,7 +3,7 @@ ; RUN: echo {@X = constant \[1 x i32\] \[i32 8\] } | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant @X = external global [1 x i32] ; <[1 x i32]*> [#uses=0] Modified: llvm/trunk/test/Linker/ConstantGlobals2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/ConstantGlobals2.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/ConstantGlobals2.ll (original) +++ llvm/trunk/test/Linker/ConstantGlobals2.ll Tue Sep 15 10:38:31 2009 @@ -3,7 +3,7 @@ ; RUN: echo {@X = external global \[1 x i32\] } | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant @X = constant [1 x i32] [ i32 12 ] ; <[1 x i32]*> [#uses=0] Modified: llvm/trunk/test/Linker/ConstantGlobals3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/ConstantGlobals3.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/ConstantGlobals3.ll (original) +++ llvm/trunk/test/Linker/ConstantGlobals3.ll Tue Sep 15 10:38:31 2009 @@ -3,6 +3,6 @@ ; RUN: echo {@X = external constant \[1 x i32\] } | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant @X = external global [1 x i32] ; <[1 x i32]*> [#uses=0] Modified: llvm/trunk/test/Linker/LinkOnce.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/LinkOnce.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/LinkOnce.ll (original) +++ llvm/trunk/test/Linker/LinkOnce.ll Tue Sep 15 10:38:31 2009 @@ -3,6 +3,6 @@ ; RUN: echo "@X = linkonce global i32 8" | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis +; RUN: llvm-link %t.1.bc %t.2.bc -S @X = linkonce global i32 7 ; [#uses=0] Modified: llvm/trunk/test/Linker/link-global-to-func.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/link-global-to-func.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/link-global-to-func.ll (original) +++ llvm/trunk/test/Linker/link-global-to-func.ll Tue Sep 15 10:38:31 2009 @@ -1,7 +1,7 @@ ; RUN: llvm-as %s -o %t1.bc ; RUN: echo {declare void @__eprintf(i8*, i8*, i32, i8*) noreturn define void @foo() { tail call void @__eprintf( i8* undef, i8* undef, i32 4, i8* null ) noreturn nounwind unreachable }} | llvm-as -o %t2.bc -; RUN: llvm-link %t2.bc %t1.bc -o - | llvm-dis | grep __eprintf -; RUN: llvm-link %t1.bc %t2.bc -o - | llvm-dis | grep __eprintf +; RUN: llvm-link %t2.bc %t1.bc -S | grep __eprintf +; RUN: llvm-link %t1.bc %t2.bc -S | grep __eprintf ; rdar://6072702 Modified: llvm/trunk/test/Linker/linknamedmdnode.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/linknamedmdnode.ll?rev=81860&r1=81859&r2=81860&view=diff ============================================================================== --- llvm/trunk/test/Linker/linknamedmdnode.ll (original) +++ llvm/trunk/test/Linker/linknamedmdnode.ll Tue Sep 15 10:38:31 2009 @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s > %t.bc ; RUN: llvm-as < %p/linknamedmdnode2.ll > %t2.bc -; RUN: llvm-link %t.bc %t2.bc | llvm-dis | grep "!llvm.stuff = !{!0, !1}" +; RUN: llvm-link %t.bc %t2.bc -S | grep "!llvm.stuff = !{!0, !1}" !0 = metadata !{i32 42} !llvm.stuff = !{!0} From gohman at apple.com Tue Sep 15 10:58:07 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 15:58:07 -0000 Subject: [llvm-commits] [llvm] r81861 - in /llvm/trunk: include/llvm/AbstractTypeUser.h include/llvm/Value.h lib/VMCore/Constants.cpp lib/VMCore/ConstantsContext.h lib/VMCore/Type.cpp test/Linker/partial-type-refinement-link.ll test/Linker/partial-type-refinement.ll Message-ID: <200909151558.n8FFw8AN030172@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 10:58:07 2009 New Revision: 81861 URL: http://llvm.org/viewvc/llvm-project?rev=81861&view=rev Log: When a constant's type is refined, update the constant in place instead of cloning and RAUWing it. - Make AbstractTypeUser a friend of Value so that it can offer its subclasses a way to update a Value's type in place. This is better than a universally visible setType method on Value, and it's sufficient for the immediate need. - Eliminate the constant "convert" functions. This eliminates a lot of logic duplication, and fixes a complicated bug where a constant can't actually be cloned during the type refinement process because some of the types that its folder needs are half-destroyed, being in the middle of refinement themselves. - Move the getValType functions from being static overloaded functions in Constants.cpp to be members of class template specializations in ConstantsContext.h. This means that the code ends up getting instantiated twice, however it also makes it possible to eliminate all "convert" functions, so it's not a big net code size increase. And if desired, the duplicate instantiations could be eliminated with some reorganization. Added: llvm/trunk/test/Linker/partial-type-refinement-link.ll llvm/trunk/test/Linker/partial-type-refinement.ll Modified: llvm/trunk/include/llvm/AbstractTypeUser.h llvm/trunk/include/llvm/Value.h llvm/trunk/lib/VMCore/Constants.cpp llvm/trunk/lib/VMCore/ConstantsContext.h llvm/trunk/lib/VMCore/Type.cpp Modified: llvm/trunk/include/llvm/AbstractTypeUser.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/AbstractTypeUser.h?rev=81861&r1=81860&r2=81861&view=diff ============================================================================== --- llvm/trunk/include/llvm/AbstractTypeUser.h (original) +++ llvm/trunk/include/llvm/AbstractTypeUser.h Tue Sep 15 10:58:07 2009 @@ -31,6 +31,7 @@ namespace llvm { +class Value; class Type; class DerivedType; template struct simplify_type; @@ -55,6 +56,12 @@ class AbstractTypeUser { protected: virtual ~AbstractTypeUser(); // Derive from me + + /// setType - It's normally not possible to change a Value's type in place, + /// but an AbstractTypeUser subclass that knows what its doing can be + /// permitted to do so with care. + void setType(Value *V, const Type *NewTy); + public: /// refineAbstractType - The callback method invoked when an abstract type is Modified: llvm/trunk/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=81861&r1=81860&r2=81861&view=diff ============================================================================== --- llvm/trunk/include/llvm/Value.h (original) +++ llvm/trunk/include/llvm/Value.h Tue Sep 15 10:58:07 2009 @@ -81,6 +81,7 @@ friend class ValueSymbolTable; // Allow ValueSymbolTable to directly mod Name. friend class SymbolTable; // Allow SymbolTable to directly poke Name. friend class ValueHandleBase; + friend class AbstractTypeUser; ValueName *Name; void operator=(const Value &); // Do not implement Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=81861&r1=81860&r2=81861&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Tue Sep 15 10:58:07 2009 @@ -878,8 +878,6 @@ //===----------------------------------------------------------------------===// // Factory Function Implementation -static char getValType(ConstantAggregateZero *CPZ) { return 0; } - ConstantAggregateZero* ConstantAggregateZero::get(const Type* Ty) { assert((isa(Ty) || isa(Ty) || isa(Ty)) && "Cannot create an aggregate zero of non-aggregate type!"); @@ -1008,11 +1006,6 @@ //---- ConstantPointerNull::get() implementation... // -static char getValType(ConstantPointerNull *) { - return 0; -} - - ConstantPointerNull *ConstantPointerNull::get(const PointerType *Ty) { // Implicitly locked. return Ty->getContext().pImpl->NullPtrConstants.getOrCreate(Ty, 0); @@ -1030,10 +1023,6 @@ //---- UndefValue::get() implementation... // -static char getValType(UndefValue *) { - return 0; -} - UndefValue *UndefValue::get(const Type *Ty) { // Implicitly locked. return Ty->getContext().pImpl->UndefValueConstants.getOrCreate(Ty, 0); @@ -1050,18 +1039,6 @@ //---- ConstantExpr::get() implementations... // -static ExprMapKeyType getValType(ConstantExpr *CE) { - std::vector Operands; - Operands.reserve(CE->getNumOperands()); - for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) - Operands.push_back(cast(CE->getOperand(i))); - return ExprMapKeyType(CE->getOpcode(), Operands, - CE->isCompare() ? CE->getPredicate() : 0, - CE->getRawSubclassOptionalData(), - CE->hasIndices() ? - CE->getIndices() : SmallVector()); -} - /// This is a utility function to handle folding of casts and lookup of the /// cast in the ExprConstants map. It is used by the various get* methods below. static inline Constant *getFoldedCast( @@ -1878,15 +1855,6 @@ /// work, but would be really slow because it would have to unique each updated /// array instance. -static std::vector getValType(ConstantArray *CA) { - std::vector Elements; - Elements.reserve(CA->getNumOperands()); - for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) - Elements.push_back(cast(CA->getOperand(i))); - return Elements; -} - - void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) { assert(isa(To) && "Cannot make Constant refer to non-constant!"); @@ -1895,7 +1863,7 @@ LLVMContext &Context = getType()->getContext(); LLVMContextImpl *pImpl = Context.pImpl; - std::pair Lookup; + std::pair Lookup; Lookup.first.first = getType(); Lookup.second = this; @@ -1973,14 +1941,6 @@ destroyConstant(); } -static std::vector getValType(ConstantStruct *CS) { - std::vector Elements; - Elements.reserve(CS->getNumOperands()); - for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) - Elements.push_back(cast(CS->getOperand(i))); - return Elements; -} - void ConstantStruct::replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) { assert(isa(To) && "Cannot make Constant refer to non-constant!"); @@ -1989,7 +1949,7 @@ unsigned OperandToUpdate = U-OperandList; assert(getOperand(OperandToUpdate) == From && "ReplaceAllUsesWith broken!"); - std::pair Lookup; + std::pair Lookup; Lookup.first.first = getType(); Lookup.second = this; std::vector &Values = Lookup.first.second; @@ -2049,14 +2009,6 @@ destroyConstant(); } -static std::vector getValType(ConstantVector *CP) { - std::vector Elements; - Elements.reserve(CP->getNumOperands()); - for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) - Elements.push_back(CP->getOperand(i)); - return Elements; -} - void ConstantVector::replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) { assert(isa(To) && "Cannot make Constant refer to non-constant!"); Modified: llvm/trunk/lib/VMCore/ConstantsContext.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantsContext.h?rev=81861&r1=81860&r2=81861&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantsContext.h (original) +++ llvm/trunk/lib/VMCore/ConstantsContext.h Tue Sep 15 10:58:07 2009 @@ -350,10 +350,11 @@ } }; -template -struct ConvertConstantType { - static void convert(ConstantClass *OldC, const TypeClass *NewTy) { - llvm_unreachable("This type cannot be converted!"); +template +struct ConstantKeyData { + typedef void ValType; + static ValType getValType(ConstantClass *C) { + llvm_unreachable("Unknown Constant type!"); } }; @@ -404,50 +405,18 @@ }; template<> -struct ConvertConstantType { - static void convert(ConstantExpr *OldC, const Type *NewTy) { - Constant *New; - switch (OldC->getOpcode()) { - case Instruction::Trunc: - case Instruction::ZExt: - case Instruction::SExt: - case Instruction::FPTrunc: - case Instruction::FPExt: - case Instruction::UIToFP: - case Instruction::SIToFP: - case Instruction::FPToUI: - case Instruction::FPToSI: - case Instruction::PtrToInt: - case Instruction::IntToPtr: - case Instruction::BitCast: - New = ConstantExpr::getCast(OldC->getOpcode(), OldC->getOperand(0), - NewTy); - break; - case Instruction::Select: - New = ConstantExpr::getSelectTy(NewTy, OldC->getOperand(0), - OldC->getOperand(1), - OldC->getOperand(2)); - break; - default: - assert(OldC->getOpcode() >= Instruction::BinaryOpsBegin && - OldC->getOpcode() < Instruction::BinaryOpsEnd); - New = ConstantExpr::getTy(NewTy, OldC->getOpcode(), OldC->getOperand(0), - OldC->getOperand(1)); - break; - case Instruction::GetElementPtr: - // Make everyone now use a constant of the new type... - std::vector Idx(OldC->op_begin()+1, OldC->op_end()); - New = cast(OldC)->isInBounds() ? - ConstantExpr::getInBoundsGetElementPtrTy(NewTy, OldC->getOperand(0), - &Idx[0], Idx.size()) : - ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0), - &Idx[0], Idx.size()); - break; - } - - assert(New != OldC && "Didn't replace constant??"); - OldC->uncheckedReplaceAllUsesWith(New); - OldC->destroyConstant(); // This constant is now dead, destroy it. +struct ConstantKeyData { + typedef ExprMapKeyType ValType; + static ValType getValType(ConstantExpr *CE) { + std::vector Operands; + Operands.reserve(CE->getNumOperands()); + for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) + Operands.push_back(cast(CE->getOperand(i))); + return ExprMapKeyType(CE->getOpcode(), Operands, + CE->isCompare() ? CE->getPredicate() : 0, + CE->getRawSubclassOptionalData(), + CE->hasIndices() ? + CE->getIndices() : SmallVector()); } }; @@ -460,56 +429,46 @@ }; template<> -struct ConvertConstantType { - static void convert(ConstantVector *OldC, const VectorType *NewTy) { - // Make everyone now use a constant of the new type... - std::vector C; - for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i) - C.push_back(cast(OldC->getOperand(i))); - Constant *New = ConstantVector::get(NewTy, C); - assert(New != OldC && "Didn't replace constant??"); - OldC->uncheckedReplaceAllUsesWith(New); - OldC->destroyConstant(); // This constant is now dead, destroy it. +struct ConstantKeyData { + typedef std::vector ValType; + static ValType getValType(ConstantVector *CP) { + std::vector Elements; + Elements.reserve(CP->getNumOperands()); + for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) + Elements.push_back(CP->getOperand(i)); + return Elements; } }; template<> -struct ConvertConstantType { - static void convert(ConstantAggregateZero *OldC, const Type *NewTy) { - // Make everyone now use a constant of the new type... - Constant *New = ConstantAggregateZero::get(NewTy); - assert(New != OldC && "Didn't replace constant??"); - OldC->uncheckedReplaceAllUsesWith(New); - OldC->destroyConstant(); // This constant is now dead, destroy it. +struct ConstantKeyData { + typedef char ValType; + static ValType getValType(ConstantAggregateZero *C) { + return 0; } }; template<> -struct ConvertConstantType { - static void convert(ConstantArray *OldC, const ArrayType *NewTy) { - // Make everyone now use a constant of the new type... - std::vector C; - for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i) - C.push_back(cast(OldC->getOperand(i))); - Constant *New = ConstantArray::get(NewTy, C); - assert(New != OldC && "Didn't replace constant??"); - OldC->uncheckedReplaceAllUsesWith(New); - OldC->destroyConstant(); // This constant is now dead, destroy it. +struct ConstantKeyData { + typedef std::vector ValType; + static ValType getValType(ConstantArray *CA) { + std::vector Elements; + Elements.reserve(CA->getNumOperands()); + for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) + Elements.push_back(cast(CA->getOperand(i))); + return Elements; } }; template<> -struct ConvertConstantType { - static void convert(ConstantStruct *OldC, const StructType *NewTy) { - // Make everyone now use a constant of the new type... - std::vector C; - for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i) - C.push_back(cast(OldC->getOperand(i))); - Constant *New = ConstantStruct::get(NewTy, C); - assert(New != OldC && "Didn't replace constant??"); - - OldC->uncheckedReplaceAllUsesWith(New); - OldC->destroyConstant(); // This constant is now dead, destroy it. +struct ConstantKeyData { + typedef std::vector ValType; + static ValType getValType(ConstantStruct *CS) { + std::vector Elements; + Elements.reserve(CS->getNumOperands()); + for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) + Elements.push_back(cast(CS->getOperand(i))); + return Elements; } }; @@ -522,13 +481,10 @@ }; template<> -struct ConvertConstantType { - static void convert(ConstantPointerNull *OldC, const PointerType *NewTy) { - // Make everyone now use a constant of the new type... - Constant *New = ConstantPointerNull::get(NewTy); - assert(New != OldC && "Didn't replace constant??"); - OldC->uncheckedReplaceAllUsesWith(New); - OldC->destroyConstant(); // This constant is now dead, destroy it. +struct ConstantKeyData { + typedef char ValType; + static ValType getValType(ConstantPointerNull *C) { + return 0; } }; @@ -541,13 +497,10 @@ }; template<> -struct ConvertConstantType { - static void convert(UndefValue *OldC, const Type *NewTy) { - // Make everyone now use a constant of the new type. - Constant *New = UndefValue::get(NewTy); - assert(New != OldC && "Didn't replace constant??"); - OldC->uncheckedReplaceAllUsesWith(New); - OldC->destroyConstant(); // This constant is now dead, destroy it. +struct ConstantKeyData { + typedef char ValType; + static ValType getValType(UndefValue *C) { + return 0; } }; @@ -555,10 +508,11 @@ bool HasLargeKey = false /*true for arrays and structs*/ > class ValueMap : public AbstractTypeUser { public: - typedef std::pair MapKey; - typedef std::map MapTy; - typedef std::map InverseMapTy; - typedef std::map AbstractTypeMapTy; + typedef std::pair MapKey; + typedef std::map MapTy; + typedef std::map InverseMapTy; + typedef std::map + AbstractTypeMapTy; private: /// Map - This is the main map from the element descriptor to the Constants. /// This is the primary way we avoid creating two of the same shape @@ -599,7 +553,7 @@ /// I->second == 0, and should be filled in. /// NOTE: This function is not locked. It is the caller's responsibility // to enforce proper synchronization. - typename MapTy::iterator InsertOrGetItem(std::pair + typename MapTy::iterator InsertOrGetItem(std::pair &InsertVal, bool &Exists) { std::pair IP = Map.insert(InsertVal); @@ -619,7 +573,7 @@ typename MapTy::iterator I = Map.find(MapKey(static_cast(CP->getRawType()), - getValType(CP))); + ConstantKeyData::getValType(CP))); if (I == Map.end() || I->second != CP) { // FIXME: This should not use a linear scan. If this gets to be a // performance problem, someone should look at this. @@ -629,6 +583,22 @@ return I; } + void AddAbstractTypeUser(const Type *Ty, typename MapTy::iterator I) { + // If the type of the constant is abstract, make sure that an entry + // exists for it in the AbstractTypeMap. + if (Ty->isAbstract()) { + const DerivedType *DTy = static_cast(Ty); + typename AbstractTypeMapTy::iterator TI = AbstractTypeMap.find(DTy); + + if (TI == AbstractTypeMap.end()) { + // Add ourselves to the ATU list of the type. + cast(DTy)->addAbstractTypeUser(this); + + AbstractTypeMap.insert(TI, std::make_pair(DTy, I)); + } + } + } + ConstantClass* Create(const TypeClass *Ty, const ValType &V, typename MapTy::iterator I) { ConstantClass* Result = @@ -640,19 +610,7 @@ if (HasLargeKey) // Remember the reverse mapping if needed. InverseMap.insert(std::make_pair(Result, I)); - // If the type of the constant is abstract, make sure that an entry - // exists for it in the AbstractTypeMap. - if (Ty->isAbstract()) { - typename AbstractTypeMapTy::iterator TI = - AbstractTypeMap.find(Ty); - - if (TI == AbstractTypeMap.end()) { - // Add ourselves to the ATU list of the type. - cast(Ty)->addAbstractTypeUser(this); - - AbstractTypeMap.insert(TI, std::make_pair(Ty, I)); - } - } + AddAbstractTypeUser(Ty, I); return Result; } @@ -668,7 +626,7 @@ typename MapTy::iterator I = Map.find(Lookup); // Is it in the map? if (I != Map.end()) - Result = static_cast(I->second); + Result = I->second; if (!Result) { // If no preexisting value, create one now... @@ -678,6 +636,43 @@ return Result; } + void UpdateAbstractTypeMap(const DerivedType *Ty, + typename MapTy::iterator I) { + assert(AbstractTypeMap.count(Ty) && + "Abstract type not in AbstractTypeMap?"); + typename MapTy::iterator &ATMEntryIt = AbstractTypeMap[Ty]; + if (ATMEntryIt == I) { + // Yes, we are removing the representative entry for this type. + // See if there are any other entries of the same type. + typename MapTy::iterator TmpIt = ATMEntryIt; + + // First check the entry before this one... + if (TmpIt != Map.begin()) { + --TmpIt; + if (TmpIt->first.first != Ty) // Not the same type, move back... + ++TmpIt; + } + + // If we didn't find the same type, try to move forward... + if (TmpIt == ATMEntryIt) { + ++TmpIt; + if (TmpIt == Map.end() || TmpIt->first.first != Ty) + --TmpIt; // No entry afterwards with the same type + } + + // If there is another entry in the map of the same abstract type, + // update the AbstractTypeMap entry now. + if (TmpIt != ATMEntryIt) { + ATMEntryIt = TmpIt; + } else { + // Otherwise, we are removing the last instance of this type + // from the table. Remove from the ATM, and from user list. + cast(Ty)->removeAbstractTypeUser(this); + AbstractTypeMap.erase(Ty); + } + } + } + void remove(ConstantClass *CP) { sys::SmartScopedLock Lock(ValueMapLock); typename MapTy::iterator I = FindExistingElement(CP); @@ -689,47 +684,13 @@ // Now that we found the entry, make sure this isn't the entry that // the AbstractTypeMap points to. - const TypeClass *Ty = static_cast(I->first.first); - if (Ty->isAbstract()) { - assert(AbstractTypeMap.count(Ty) && - "Abstract type not in AbstractTypeMap?"); - typename MapTy::iterator &ATMEntryIt = AbstractTypeMap[Ty]; - if (ATMEntryIt == I) { - // Yes, we are removing the representative entry for this type. - // See if there are any other entries of the same type. - typename MapTy::iterator TmpIt = ATMEntryIt; - - // First check the entry before this one... - if (TmpIt != Map.begin()) { - --TmpIt; - if (TmpIt->first.first != Ty) // Not the same type, move back... - ++TmpIt; - } - - // If we didn't find the same type, try to move forward... - if (TmpIt == ATMEntryIt) { - ++TmpIt; - if (TmpIt == Map.end() || TmpIt->first.first != Ty) - --TmpIt; // No entry afterwards with the same type - } - - // If there is another entry in the map of the same abstract type, - // update the AbstractTypeMap entry now. - if (TmpIt != ATMEntryIt) { - ATMEntryIt = TmpIt; - } else { - // Otherwise, we are removing the last instance of this type - // from the table. Remove from the ATM, and from user list. - cast(Ty)->removeAbstractTypeUser(this); - AbstractTypeMap.erase(Ty); - } - } - } + const TypeClass *Ty = I->first.first; + if (Ty->isAbstract()) + UpdateAbstractTypeMap(static_cast(Ty), I); Map.erase(I); } - /// MoveConstantToNewSlot - If we are about to change C to be the element /// specified by I, update our internal data structures to reflect this /// fact. @@ -765,8 +726,7 @@ void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { sys::SmartScopedLock Lock(ValueMapLock); - typename AbstractTypeMapTy::iterator I = - AbstractTypeMap.find(cast(OldTy)); + typename AbstractTypeMapTy::iterator I = AbstractTypeMap.find(OldTy); assert(I != AbstractTypeMap.end() && "Abstract type not in AbstractTypeMap?"); @@ -775,12 +735,39 @@ // leaving will remove() itself, causing the AbstractTypeMapEntry to be // eliminated eventually. do { - ConvertConstantType::convert( - static_cast(I->second->second), - cast(NewTy)); - - I = AbstractTypeMap.find(cast(OldTy)); + ConstantClass *C = I->second->second; + MapKey Key(cast(NewTy), + ConstantKeyData::getValType(C)); + + std::pair IP = + Map.insert(std::make_pair(Key, C)); + if (IP.second) { + // The map didn't previously have an appropriate constant in the + // new type. + + // Remove the old entry. + typename MapTy::iterator OldI = + Map.find(MapKey(cast(OldTy), IP.first->first.second)); + assert(OldI != Map.end() && "Constant not in map!"); + UpdateAbstractTypeMap(OldTy, OldI); + Map.erase(OldI); + + // Set the constant's type. This is done in place! + setType(C, NewTy); + + // Update the inverse map so that we know that this constant is now + // located at descriptor I. + if (HasLargeKey) + InverseMap[C] = IP.first; + + AddAbstractTypeUser(NewTy, IP.first); + } else { + // The map already had an appropriate constant in the new type, so + // there's no longer a need for the old constant. + C->uncheckedReplaceAllUsesWith(IP.first->second); + C->destroyConstant(); // This constant is now dead, destroy it. + } + I = AbstractTypeMap.find(OldTy); } while (I != AbstractTypeMap.end()); } Modified: llvm/trunk/lib/VMCore/Type.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=81861&r1=81860&r2=81861&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Type.cpp (original) +++ llvm/trunk/lib/VMCore/Type.cpp Tue Sep 15 10:58:07 2009 @@ -42,6 +42,9 @@ AbstractTypeUser::~AbstractTypeUser() {} +void AbstractTypeUser::setType(Value *V, const Type *NewTy) { + V->VTy = NewTy; +} //===----------------------------------------------------------------------===// // Type Class Implementation Added: llvm/trunk/test/Linker/partial-type-refinement-link.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/partial-type-refinement-link.ll?rev=81861&view=auto ============================================================================== --- llvm/trunk/test/Linker/partial-type-refinement-link.ll (added) +++ llvm/trunk/test/Linker/partial-type-refinement-link.ll Tue Sep 15 10:58:07 2009 @@ -0,0 +1,20 @@ +; This file is used by first.ll, so it doesn't actually do anything itself +; RUN: true + +%AnalysisResolver = type { i8, %PMDataManager* } +%"DenseMap" = type { i64, %"pair"*, i64, i64 } +%PMDataManager = type { i8, %PMTopLevelManager*, i8, i8, i8, i8, i8, i64, i8 } +%PMTopLevelManager = type { i8, i8, i8, i8, i8, i8, i8, i8, %"DenseMap" } +%P = type { i8, %AnalysisResolver*, i64 } +%PI = type { i8, i8, i8, i8, i8, i8, %"vector", %P* } +%"SmallVImpl" = type { i8, %PI* } +%"_V_base" = type { %"_V_base::_V_impl" } +%"_V_base::_V_impl" = type { %PI*, i8, i8 } +%"pair" = type opaque +%"vector" = type { %"_V_base" } + +define void @f(%"SmallVImpl"* %this) { +entry: + %x = getelementptr inbounds %"SmallVImpl"* %this, i64 0, i32 1 + ret void +} Added: llvm/trunk/test/Linker/partial-type-refinement.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/partial-type-refinement.ll?rev=81861&view=auto ============================================================================== --- llvm/trunk/test/Linker/partial-type-refinement.ll (added) +++ llvm/trunk/test/Linker/partial-type-refinement.ll Tue Sep 15 10:58:07 2009 @@ -0,0 +1,24 @@ +; RUN: llvm-link %s %p/partial-type-refinement-link.ll -S | FileCheck %s +; PR4954 + +; CHECK: load %PI** getelementptr inbounds (%"RegisterP"* @_ZN3mvmL1XE, i64 0, i32 0, i32 6, i32 0, i32 0, i32 0), align 16 + +%AnalysisResolver = type { i8, %PMDataManager* } +%"DenseMap" = type { i64, %"pair"*, i64, i64 } +%PMDataManager = type { i8, %PMTopLevelManager*, i8, i8, i8, i8, i8, i64, i8 } +%PMTopLevelManager = type { i8, i8, i8, i8, i8, i8, i8, i8, %"DenseMap" } +%P = type { i8, %AnalysisResolver*, i64 } +%PI = type { i8, i8, i8, i8, i8, i8, %"vector", %P* } +%"RegisterP" = type { %PI } +%"_V_base" = type { %"_V_base::_V_impl" } +%"_V_base::_V_impl" = type { %PI*, i8, i8 } +%"pair" = type opaque +%"vector" = type { %"_V_base" } + + at _ZN3mvmL1XE = external global %"RegisterP" + +define void @__tcf_0() nounwind { +entry: + %0 = load %PI** getelementptr inbounds (%"RegisterP"* @_ZN3mvmL1XE, i64 0, i32 0, i32 6, i32 0, i32 0, i32 0), align 16 + ret void +} From gohman at apple.com Tue Sep 15 11:00:30 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 16:00:30 -0000 Subject: [llvm-commits] [llvm] r81862 - /llvm/trunk/lib/VMCore/ConstantFold.cpp Message-ID: <200909151600.n8FG0UCv030475@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 11:00:30 2009 New Revision: 81862 URL: http://llvm.org/viewvc/llvm-project?rev=81862&view=rev Log: Fix an accidental inversion of the inbounds flag. Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=81862&r1=81861&r2=81862&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Tue Sep 15 11:00:30 2009 @@ -1873,10 +1873,10 @@ for (unsigned i = 0; i != NumIdx; ++i) if (!NewIdxs[i]) NewIdxs[i] = Idxs[i]; return inBounds ? - ConstantExpr::getGetElementPtr(const_cast(C), - NewIdxs.data(), NewIdxs.size()) : ConstantExpr::getInBoundsGetElementPtr(const_cast(C), - NewIdxs.data(), NewIdxs.size()); + NewIdxs.data(), NewIdxs.size()) : + ConstantExpr::getGetElementPtr(const_cast(C), + NewIdxs.data(), NewIdxs.size()); } // If all indices are known integers and normalized, we can do a simple From gohman at apple.com Tue Sep 15 11:14:44 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 16:14:44 -0000 Subject: [llvm-commits] [llvm] r81864 - /llvm/trunk/lib/Analysis/ValueTracking.cpp Message-ID: <200909151614.n8FGEjLF032266@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 11:14:44 2009 New Revision: 81864 URL: http://llvm.org/viewvc/llvm-project?rev=81864&view=rev Log: Teach ValueTracking how to look through GlobalAliases. GlobalAliases are not folded in the constant folder because the constant folder doesn't simplify ConstantExpr operands. Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=81864&r1=81863&r2=81864&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Tue Sep 15 11:14:44 2009 @@ -16,6 +16,7 @@ #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/GlobalVariable.h" +#include "llvm/GlobalAlias.h" #include "llvm/IntrinsicInst.h" #include "llvm/LLVMContext.h" #include "llvm/Operator.h" @@ -105,6 +106,17 @@ KnownOne.clear(); return; } + // A weak GlobalAlias is totally unknown. A non-weak GlobalAlias has + // the bits of its aliasee. + if (GlobalAlias *GA = dyn_cast(V)) { + if (GA->mayBeOverridden()) { + KnownZero.clear(); KnownOne.clear(); + } else { + ComputeMaskedBits(GA->getAliasee(), Mask, KnownZero, KnownOne, + TD, Depth+1); + } + return; + } KnownZero.clear(); KnownOne.clear(); // Start out not knowing anything. From enderby at apple.com Tue Sep 15 11:29:53 2009 From: enderby at apple.com (Kevin Enderby) Date: Tue, 15 Sep 2009 09:29:53 -0700 Subject: [llvm-commits] [llvm] r81817 - in /llvm/trunk: lib/Target/ARM/AsmParser/ lib/Target/ARM/AsmParser/ARMAsmParser.cpp lib/Target/ARM/AsmParser/CMakeLists.txt lib/Target/ARM/AsmParser/Makefile lib/Target/ARM/Makefile test/MC/AsmParser/arm_word_directive.s test/MC/AsmParser/directive_values.s test/MC/AsmParser/x86_word_directive.s In-Reply-To: References: <200909150027.n8F0RQUw026432@zion.cs.uiuc.edu> Message-ID: Hi Ted, Thanks for fixing that. I was trying to clean out my hacks of my wild copy and pastes and missed that one. For now it shouldn't be there. Kev On Sep 14, 2009, at 9:06 PM, Ted Kremenek wrote: > > On Sep 14, 2009, at 5:27 PM, Kevin Enderby wrote: > >> ===================================================================== >> ========= >> --- llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt (added) >> +++ llvm/trunk/lib/Target/ARM/AsmParser/CMakeLists.txt Mon Sep 14 >> 19:27:25 2009 >> @@ -0,0 +1,6 @@ >> +include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. $ >> {CMAKE_CURRENT_SOURCE_DIR}/.. ) >> + >> +add_llvm_library(LLVMARMAsmParser >> + ARMAsmParser.cpp >> + ) >> +add_dependencies(LLVMARMAsmParser) >> > > Hi Kevin, > > This last line actually breaks the CMake builds: > > CMake Error at lib/Target/ARM/AsmParser/CMakeLists.txt:6 > (add_dependencies): > add_dependencies called with incorrect number of arguments > > Were you trying to add a specific dependency between the > LLVMARMAsmParser and something else? > > I've gone ahead and removed this last line, but I'm not certain if > that is the right thing to do. The CMake build now works, but I'm > not certain if a dependency is suppose to be there. > > Ted > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090915/b1b057c5/attachment.html From kremenek at apple.com Tue Sep 15 12:36:12 2009 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Sep 2009 17:36:12 -0000 Subject: [llvm-commits] [llvm] r81872 - /llvm/tags/checker/checker-0.220/ Message-ID: <200909151736.n8FHaCSl011500@zion.cs.uiuc.edu> Author: kremenek Date: Tue Sep 15 12:36:12 2009 New Revision: 81872 URL: http://llvm.org/viewvc/llvm-project?rev=81872&view=rev Log: Removing checker-0.220. Removed: llvm/tags/checker/checker-0.220/ From natebegeman at mac.com Tue Sep 15 12:36:28 2009 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 15 Sep 2009 10:36:28 -0700 Subject: [llvm-commits] [llvm] r81813 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp In-Reply-To: References: <200909150013.n8F0DCbX024473@zion.cs.uiuc.edu> Message-ID: <53514D84-13CE-464A-A97B-348514BB9325@mac.com> On Sep 14, 2009, at 11:41 PM, Chris Lattner wrote: > > On Sep 14, 2009, at 5:13 PM, Nate Begeman wrote: > >> Author: sampo >> Date: Mon Sep 14 19:13:12 2009 >> New Revision: 81813 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=81813&view=rev >> Log: >> Add an "original alignment" field to load and store nodes. This >> enables the >> DAG Combiner to disambiguate chains for loads and stores of types >> which are >> broken up by the Legalizer into smaller pieces. > > Hi Nate, > >> + //! OrigAlign - The original alignment of this MemSDNode in the >> case where >> + // this node was created by legalize from a MemSDNode with known >> alignment. >> + unsigned OrigAlign; > > I don't understand what this means. Is this saying that the load/ > store is always an access to [ptr_with_some_alignment]+SVOffset? > > If so, it seems that the ultimate alignment of the access is actually: > MinAlign(OrigAlign, SVOffset) > (from MathExtras.h). > > If this is true, then you can make the comment much more strong, and > fix MemSDNode to never actually store the alignment of the access > (store OrigAlign instead and compute the access alignment when > needed). > > If we do need to keep both alignments around, is there any way to > encode this in SubclassData like the alignment field itself is to > avoid growing MemSDNode (the biggest sdnode)? Thanks for the feedback, I'm working on it. Cheers, Nate -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090915/1612af60/attachment.html From kremenek at apple.com Tue Sep 15 12:44:14 2009 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 15 Sep 2009 17:44:14 -0000 Subject: [llvm-commits] [llvm] r81875 - /llvm/tags/checker/checker-0.220/ Message-ID: <200909151744.n8FHiEU9012571@zion.cs.uiuc.edu> Author: kremenek Date: Tue Sep 15 12:44:14 2009 New Revision: 81875 URL: http://llvm.org/viewvc/llvm-project?rev=81875&view=rev Log: Tagging checker-0.220. Added: llvm/tags/checker/checker-0.220/ - copied from r81874, llvm/trunk/ From sabre at nondot.org Tue Sep 15 12:46:24 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 17:46:24 -0000 Subject: [llvm-commits] [llvm] r81877 - in /llvm/trunk: lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp lib/Target/Sparc/SparcISelDAGToDAG.cpp lib/Target/Sparc/SparcISelLowering.cpp lib/Target/Sparc/SparcISelLowering.h lib/Target/Sparc/SparcInstrInfo.cpp lib/Target/Sparc/SparcInstrInfo.h lib/Target/Sparc/SparcInstrInfo.td lib/Target/Sparc/SparcRegisterInfo.td test/CodeGen/SPARC/2009-08-28-PIC.ll test/CodeGen/SPARC/2009-08-28-WeakLinkage.ll Message-ID: <200909151746.n8FHkOcd012915@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 12:46:24 2009 New Revision: 81877 URL: http://llvm.org/viewvc/llvm-project?rev=81877&view=rev Log: several major improvements to the sparc backend: support for weak linkage and PIC codegen. Patch by Venkatraman Govindaraju! Added: llvm/trunk/test/CodeGen/SPARC/2009-08-28-PIC.ll llvm/trunk/test/CodeGen/SPARC/2009-08-28-WeakLinkage.ll Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.h llvm/trunk/lib/Target/Sparc/SparcInstrInfo.cpp llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=81877&r1=81876&r2=81877&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Tue Sep 15 12:46:24 2009 @@ -75,12 +75,14 @@ unsigned AsmVariant, const char *ExtraCode); bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode); + + void emitFunctionHeader(const MachineFunction &MF); + bool printGetPCX(const MachineInstr *MI, unsigned OpNo); }; } // end of anonymous namespace #include "SparcGenAsmWriter.inc" - /// runOnMachineFunction - This uses the printInstruction() /// method to print assembly for each instruction. /// @@ -96,17 +98,9 @@ // BBs the same name. (If you have a better way, please let me know!) O << "\n\n"; - - // Print out the label for the function. - const Function *F = MF.getFunction(); - OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); - EmitAlignment(MF.getAlignment(), F); - O << "\t.globl\t" << CurrentFnName << '\n'; - - printVisibility(CurrentFnName, F->getVisibility()); - - O << "\t.type\t" << CurrentFnName << ", #function\n"; - O << CurrentFnName << ":\n"; + emitFunctionHeader(MF); + + // Emit pre-function debug information. DW->BeginFunction(&MF); @@ -145,9 +139,43 @@ DW->EndFunction(&MF); // We didn't modify anything. + O << "\t.size\t" << CurrentFnName << ", .-" << CurrentFnName << '\n'; return false; } +void SparcAsmPrinter::emitFunctionHeader(const MachineFunction &MF) { + const Function *F = MF.getFunction(); + OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); + EmitAlignment(MF.getAlignment(), F); + + switch (F->getLinkage()) { + default: llvm_unreachable("Unknown linkage type"); + case Function::PrivateLinkage: + case Function::InternalLinkage: + // Function is internal. + break; + case Function::DLLExportLinkage: + case Function::ExternalLinkage: + // Function is externally visible + O << "\t.global\t" << CurrentFnName << '\n'; + break; + case Function::LinkerPrivateLinkage: + case Function::LinkOnceAnyLinkage: + case Function::LinkOnceODRLinkage: + case Function::WeakAnyLinkage: + case Function::WeakODRLinkage: + // Function is weak + O << "\t.weak\t" << CurrentFnName << '\n' ; + break; + } + + printVisibility(CurrentFnName, F->getVisibility()); + + O << "\t.type\t" << CurrentFnName << ", #function\n"; + O << CurrentFnName << ":\n"; +} + + void SparcAsmPrinter::printOperand(const MachineInstr *MI, int opNum) { const MachineOperand &MO = MI->getOperand (opNum); bool CloseParen = false; @@ -215,6 +243,36 @@ } } +bool SparcAsmPrinter::printGetPCX(const MachineInstr *MI, unsigned opNum) { + std::string operand = ""; + const MachineOperand &MO = MI->getOperand(opNum); + switch (MO.getType()) { + default: assert(0 && "Operand is not a register "); + case MachineOperand::MO_Register: + assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) && + "Operand is not a physical register "); + operand = "%" + LowercaseString(getRegisterName(MO.getReg())); + break; + } + + unsigned bbNum = NumberForBB[MI->getParent()->getBasicBlock()]; + + O << '\n' << ".LLGETPCH" << bbNum << ":\n"; + O << "\tcall\t.LLGETPC" << bbNum << '\n' ; + + O << "\t sethi\t" + << "%hi(_GLOBAL_OFFSET_TABLE_+(.-.LLGETPCH" << bbNum << ")), " + << operand << '\n' ; + + O << ".LLGETPC" << bbNum << ":\n" ; + O << "\tor\t" << operand + << ", %lo(_GLOBAL_OFFSET_TABLE_+(.-.LLGETPCH" << bbNum << ")), " + << operand << '\n'; + O << "\tadd\t" << operand << ", %o7, " << operand << '\n'; + + return true; +} + void SparcAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) { int CC = (int)MI->getOperand(opNum).getImm(); O << SPARCCondCodeToString((SPCC::CondCodes)CC); Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=81877&r1=81876&r2=81877&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Tue Sep 15 12:46:24 2009 @@ -34,10 +34,13 @@ /// Subtarget - Keep a pointer to the Sparc Subtarget around so that we can /// make the right decision when generating code for different targets. const SparcSubtarget &Subtarget; + SparcTargetMachine& TM; + MachineBasicBlock *CurBB; public: - explicit SparcDAGToDAGISel(SparcTargetMachine &TM) - : SelectionDAGISel(TM), - Subtarget(TM.getSubtarget()) { + explicit SparcDAGToDAGISel(SparcTargetMachine &tm) + : SelectionDAGISel(tm), + Subtarget(tm.getSubtarget()), + TM(tm) { } SDNode *Select(SDValue Op); @@ -63,6 +66,9 @@ // Include the pieces autogenerated from the target description. #include "SparcGenDAGISel.inc" + +private: + SDNode* getGlobalBaseReg(); }; } // end anonymous namespace @@ -70,12 +76,18 @@ /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. void SparcDAGToDAGISel::InstructionSelect() { DEBUG(BB->dump()); - + CurBB = BB; // Select target instructions for the DAG. SelectRoot(*CurDAG); CurDAG->RemoveDeadNodes(); } +SDNode* SparcDAGToDAGISel::getGlobalBaseReg() { + MachineFunction *MF = CurBB->getParent(); + unsigned GlobalBaseReg = TM.getInstrInfo()->getGlobalBaseReg(MF); + return CurDAG->getRegister(GlobalBaseReg, TLI.getPointerTy()).getNode(); +} + bool SparcDAGToDAGISel::SelectADDRri(SDValue Op, SDValue Addr, SDValue &Base, SDValue &Offset) { if (FrameIndexSDNode *FIN = dyn_cast(Addr)) { @@ -149,6 +161,9 @@ switch (N->getOpcode()) { default: break; + case SPISD::GLOBAL_BASE_REG: + return getGlobalBaseReg(); + case ISD::SDIV: case ISD::UDIV: { // FIXME: should use a custom expander to expose the SRA to the dag. Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=81877&r1=81876&r2=81877&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Tue Sep 15 12:46:24 2009 @@ -740,17 +740,29 @@ } } -static SDValue LowerGLOBALADDRESS(SDValue Op, SelectionDAG &DAG) { +SDValue SparcTargetLowering::LowerGlobalAddress(SDValue Op, + SelectionDAG &DAG) { GlobalValue *GV = cast(Op)->getGlobal(); // FIXME there isn't really any debug info here DebugLoc dl = Op.getDebugLoc(); SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i32); SDValue Hi = DAG.getNode(SPISD::Hi, dl, MVT::i32, GA); SDValue Lo = DAG.getNode(SPISD::Lo, dl, MVT::i32, GA); - return DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); + + if (getTargetMachine().getRelocationModel() != Reloc::PIC_) + return DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); + + SDValue GlobalBase = DAG.getNode(SPISD::GLOBAL_BASE_REG, dl, + getPointerTy()); + SDValue RelAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); + SDValue AbsAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, + GlobalBase, RelAddr); + return DAG.getLoad(getPointerTy(), dl, DAG.getEntryNode(), + AbsAddr, NULL, 0); } -static SDValue LowerCONSTANTPOOL(SDValue Op, SelectionDAG &DAG) { +SDValue SparcTargetLowering::LowerConstantPool(SDValue Op, + SelectionDAG &DAG) { ConstantPoolSDNode *N = cast(Op); // FIXME there isn't really any debug info here DebugLoc dl = Op.getDebugLoc(); @@ -758,7 +770,16 @@ SDValue CP = DAG.getTargetConstantPool(C, MVT::i32, N->getAlignment()); SDValue Hi = DAG.getNode(SPISD::Hi, dl, MVT::i32, CP); SDValue Lo = DAG.getNode(SPISD::Lo, dl, MVT::i32, CP); - return DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); + if (getTargetMachine().getRelocationModel() != Reloc::PIC_) + return DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); + + SDValue GlobalBase = DAG.getNode(SPISD::GLOBAL_BASE_REG, dl, + getPointerTy()); + SDValue RelAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); + SDValue AbsAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, + GlobalBase, RelAddr); + return DAG.getLoad(getPointerTy(), dl, DAG.getEntryNode(), + AbsAddr, NULL, 0); } static SDValue LowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) { @@ -912,8 +933,8 @@ case ISD::FRAMEADDR: return SDValue(); case ISD::GlobalTLSAddress: llvm_unreachable("TLS not implemented for Sparc."); - case ISD::GlobalAddress: return LowerGLOBALADDRESS(Op, DAG); - case ISD::ConstantPool: return LowerCONSTANTPOOL(Op, DAG); + case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG); + case ISD::ConstantPool: return LowerConstantPool(Op, DAG); case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG); case ISD::SINT_TO_FP: return LowerSINT_TO_FP(Op, DAG); case ISD::BR_CC: return LowerBR_CC(Op, DAG); @@ -1054,5 +1075,5 @@ /// getFunctionAlignment - Return the Log2 alignment of this function. unsigned SparcTargetLowering::getFunctionAlignment(const Function *) const { - return 4; + return 2; } Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.h?rev=81877&r1=81876&r2=81877&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.h (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.h Tue Sep 15 12:46:24 2009 @@ -35,7 +35,8 @@ ITOF, // Int to FP within a FP register. CALL, // A call instruction. - RET_FLAG // Return with a flag operand. + RET_FLAG, // Return with a flag operand. + GLOBAL_BASE_REG // Global base reg for PIC }; } @@ -96,6 +97,9 @@ CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, DebugLoc dl, SelectionDAG &DAG); + + SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG); + SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG); }; } // end namespace llvm Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.cpp?rev=81877&r1=81876&r2=81877&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.cpp Tue Sep 15 12:46:24 2009 @@ -17,8 +17,10 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/Support/ErrorHandling.h" #include "SparcGenInstrInfo.inc" +#include "SparcMachineFunctionInfo.h" using namespace llvm; SparcInstrInfo::SparcInstrInfo(SparcSubtarget &ST) @@ -235,3 +237,25 @@ return NewMI; } + +unsigned SparcInstrInfo::getGlobalBaseReg(MachineFunction *MF) const +{ + SparcMachineFunctionInfo *SparcFI = MF->getInfo(); + unsigned GlobalBaseReg = SparcFI->getGlobalBaseReg(); + if (GlobalBaseReg != 0) + return GlobalBaseReg; + + // Insert the set of GlobalBaseReg into the first MBB of the function + MachineBasicBlock &FirstMBB = MF->front(); + MachineBasicBlock::iterator MBBI = FirstMBB.begin(); + MachineRegisterInfo &RegInfo = MF->getRegInfo(); + + GlobalBaseReg = RegInfo.createVirtualRegister(&SP::IntRegsRegClass); + + + DebugLoc dl = DebugLoc::getUnknownLoc(); + + BuildMI(FirstMBB, MBBI, dl, get(SP::GETPCX), GlobalBaseReg); + SparcFI->setGlobalBaseReg(GlobalBaseReg); + return GlobalBaseReg; +} Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h?rev=81877&r1=81876&r2=81877&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h (original) +++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h Tue Sep 15 12:46:24 2009 @@ -97,6 +97,8 @@ MachineInstr* LoadMI) const { return 0; } + + unsigned getGlobalBaseReg(MachineFunction *MF) const; }; } Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td?rev=81877&r1=81876&r2=81877&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Tue Sep 15 12:46:24 2009 @@ -134,6 +134,10 @@ def retflag : SDNode<"SPISD::RET_FLAG", SDTNone, [SDNPHasChain, SDNPOptInFlag]>; +def getPCX : Operand { + let PrintMethod = "printGetPCX"; +} + //===----------------------------------------------------------------------===// // SPARC Flag Conditions //===----------------------------------------------------------------------===// @@ -207,6 +211,11 @@ class Pseudo pattern> : InstSP; +// GETPCX for PIC +let Defs = [O7], Uses = [O7] in { + def GETPCX : Pseudo<(outs getPCX:$getpcseq), (ins), "$getpcseq", [] >; +} + let Defs = [O6], Uses = [O6] in { def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i32imm:$amt), "!ADJCALLSTACKDOWN $amt", @@ -431,18 +440,23 @@ (outs IntRegs:$dst), (ins MEMri:$addr), "add ${addr:arith}, $dst", [(set IntRegs:$dst, ADDRri:$addr)]>; - -defm ADDCC : F3_12<"addcc", 0b010000, addc>; + +let Defs = [ICC] in + defm ADDCC : F3_12<"addcc", 0b010000, addc>; + defm ADDX : F3_12<"addx", 0b001000, adde>; // Section B.15 - Subtract Instructions, p. 110 defm SUB : F3_12 <"sub" , 0b000100, sub>; defm SUBX : F3_12 <"subx" , 0b001100, sube>; -defm SUBCC : F3_12 <"subcc", 0b010100, SPcmpicc>; -def SUBXCCrr: F3_1<2, 0b011100, - (outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c), - "subxcc $b, $c, $dst", []>; +let Defs = [ICC] in { + defm SUBCC : F3_12 <"subcc", 0b010100, SPcmpicc>; + + def SUBXCCrr: F3_1<2, 0b011100, + (outs IntRegs:$dst), (ins IntRegs:$b, IntRegs:$c), + "subxcc $b, $c, $dst", []>; +} // Section B.18 - Multiply Instructions, p. 113 defm UMUL : F3_12np<"umul", 0b001010>; @@ -471,11 +485,12 @@ def BA : BranchSP<0b1000, (ins brtarget:$dst), "ba $dst", [(br bb:$dst)]>; - + // FIXME: the encoding for the JIT should look at the condition field. -def BCOND : BranchSP<0, (ins brtarget:$dst, CCOp:$cc), - "b$cc $dst", - [(SPbricc bb:$dst, imm:$cc)]>; +let Uses = [ICC] in + def BCOND : BranchSP<0, (ins brtarget:$dst, CCOp:$cc), + "b$cc $dst", + [(SPbricc bb:$dst, imm:$cc)]>; // Section B.22 - Branch on Floating-point Condition Codes Instructions, p. 121 @@ -489,9 +504,10 @@ } // FIXME: the encoding for the JIT should look at the condition field. -def FBCOND : FPBranchSP<0, (ins brtarget:$dst, CCOp:$cc), - "fb$cc $dst", - [(SPbrfcc bb:$dst, imm:$cc)]>; +let Uses = [FCC] in + def FBCOND : FPBranchSP<0, (ins brtarget:$dst, CCOp:$cc), + "fb$cc $dst", + [(SPbrfcc bb:$dst, imm:$cc)]>; // Section B.24 - Call and Link Instruction, p. 125 @@ -633,15 +649,16 @@ // Note 2: the result of a FCMP is not available until the 2nd cycle // after the instr is retired, but there is no interlock. This behavior // is modelled with a forced noop after the instruction. -def FCMPS : F3_3<2, 0b110101, 0b001010001, - (outs), (ins FPRegs:$src1, FPRegs:$src2), - "fcmps $src1, $src2\n\tnop", - [(SPcmpfcc FPRegs:$src1, FPRegs:$src2)]>; -def FCMPD : F3_3<2, 0b110101, 0b001010010, - (outs), (ins DFPRegs:$src1, DFPRegs:$src2), - "fcmpd $src1, $src2\n\tnop", - [(SPcmpfcc DFPRegs:$src1, DFPRegs:$src2)]>; - +let Defs = [FCC] in { + def FCMPS : F3_3<2, 0b110101, 0b001010001, + (outs), (ins FPRegs:$src1, FPRegs:$src2), + "fcmps $src1, $src2\n\tnop", + [(SPcmpfcc FPRegs:$src1, FPRegs:$src2)]>; + def FCMPD : F3_3<2, 0b110101, 0b001010010, + (outs), (ins DFPRegs:$src1, DFPRegs:$src2), + "fcmpd $src1, $src2\n\tnop", + [(SPcmpfcc DFPRegs:$src1, DFPRegs:$src2)]>; +} //===----------------------------------------------------------------------===// // V9 Instructions Modified: llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td?rev=81877&r1=81876&r2=81877&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.td Tue Sep 15 12:46:24 2009 @@ -16,6 +16,10 @@ let Namespace = "SP"; } +class SparcCtrlReg: Register { + let Namespace = "SP"; +} + // Registers are identified with 5-bit ID numbers. // Ri - 32-bit integer registers class Ri num, string n> : SparcReg { @@ -31,6 +35,10 @@ let SubRegs = subregs; } +// Control Registers +def ICC : SparcCtrlReg<"ICC">; +def FCC : SparcCtrlReg<"FCC">; + // Integer registers def G0 : Ri< 0, "G0">, DwarfRegNum<[0]>; def G1 : Ri< 1, "G1">, DwarfRegNum<[1]>; @@ -46,7 +54,7 @@ def O3 : Ri<11, "O3">, DwarfRegNum<[11]>; def O4 : Ri<12, "O4">, DwarfRegNum<[12]>; def O5 : Ri<13, "O5">, DwarfRegNum<[13]>; -def O6 : Ri<14, "O6">, DwarfRegNum<[14]>; +def O6 : Ri<14, "SP">, DwarfRegNum<[14]>; def O7 : Ri<15, "O7">, DwarfRegNum<[15]>; def L0 : Ri<16, "L0">, DwarfRegNum<[16]>; def L1 : Ri<17, "L1">, DwarfRegNum<[17]>; @@ -62,7 +70,7 @@ def I3 : Ri<27, "I3">, DwarfRegNum<[27]>; def I4 : Ri<28, "I4">, DwarfRegNum<[28]>; def I5 : Ri<29, "I5">, DwarfRegNum<[29]>; -def I6 : Ri<30, "I6">, DwarfRegNum<[30]>; +def I6 : Ri<30, "FP">, DwarfRegNum<[30]>; def I7 : Ri<31, "I7">, DwarfRegNum<[31]>; // Floating-point registers Added: llvm/trunk/test/CodeGen/SPARC/2009-08-28-PIC.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/2009-08-28-PIC.ll?rev=81877&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/SPARC/2009-08-28-PIC.ll (added) +++ llvm/trunk/test/CodeGen/SPARC/2009-08-28-PIC.ll Tue Sep 15 12:46:24 2009 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=sparc --relocation-model=pic | grep _GLOBAL_OFFSET_TABLE_ + + at foo = global i32 0 ; [#uses=1] + +define i32 @func() nounwind readonly { +entry: + %0 = load i32* @foo, align 4 ; [#uses=1] + ret i32 %0 +} Added: llvm/trunk/test/CodeGen/SPARC/2009-08-28-WeakLinkage.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/2009-08-28-WeakLinkage.ll?rev=81877&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/SPARC/2009-08-28-WeakLinkage.ll (added) +++ llvm/trunk/test/CodeGen/SPARC/2009-08-28-WeakLinkage.ll Tue Sep 15 12:46:24 2009 @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=sparc | grep weak + +define weak i32 @func() nounwind { +entry: + ret i32 0 +} From clattner at apple.com Tue Sep 15 12:47:14 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Sep 2009 10:47:14 -0700 Subject: [llvm-commits] PATCH: SPARC codegen fixes In-Reply-To: References: Message-ID: <979F2A58-EEFE-4782-AA4A-97A6807565EF@apple.com> Hi Venkatraman, I'm sorry for the delay, your patch looks great. I resolved various merge conflicts and committed it as r81877, thanks again! -Chris On Aug 28, 2009, at 8:50 PM, Venkatraman Govindaraju wrote: > On Fri, Aug 28, 2009 at 12:00 AM, Chris Lattner > wrote: >> >> >> Whoa, nice! Some minor stylistic comments: >> >> +let Defs = [ICC] in { >> + defm SUBCC : F3_12 <"subcc", 0b010100, SPcmpicc>; >> >> Please indent by 2. >> > > Done. > >> + case MachineOperand::MO_Register: >> + if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) >> + operand = "%" + LowercaseString (RI.get(MO.getReg()).AsmName); >> + else >> >> No space before arguments of a function call >> > > Deleted > >> + if (LabelForBaseReg.find(operand) == LabelForBaseReg.end()) { >> + LabelForBaseReg[operand] = LabelForBaseReg.size(); >> + } >> >> Please use: >> if (!LabelForBaseReg.count(operand)) >> LabelForBaseReg[operand] = LabelForBaseReg.size(); >> >> It would be even more efficient to just use >> LabelForBaseReg.insert(std::make_pair(operand, ..size)) >> > > See below. I don't need LabelForBaseReg anymore. > >> >> + // Print out PIC Base computation helpers >> >> Please properly punctuate the sentence (end with .) >> >> >> Please don't use tabs in the code. >> > > Removed tabs that I found. > >> >> + case MachineOperand::MO_Register: >> + if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) >> + operand = "%" + LowercaseString (RI.get(MO.getReg()).AsmName); >> + else >> + operand = "%reg" + MO.getReg(); >> + break; >> >> Virtregs can never get to the asmprinter, please turn the "if" into >> an >> assert. >> > > Done. > >> >> >> >> + if (getTargetMachine().getRelocationModel() == Reloc::PIC_) { >> + SDValue GlobalBase = DAG.getNode(SPISD::GLOBAL_BASE_REG, dl, >> + getPointerTy()); >> + SDValue RelAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); >> + SDValue AbsAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, >> + GlobalBase, RelAddr); >> + return DAG.getLoad(getPointerTy(), dl, DAG.getEntryNode(), >> + AbsAddr, NULL, 0); >> + } else { >> + return DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); >> + } >> >> This code would be less nested if you wrote it as: >> >> + if (getTargetMachine().getRelocationModel() != Reloc::PIC_) >> + return DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); >> >> + SDValue GlobalBase = DAG.getNode(SPISD::GLOBAL_BASE_REG, dl, >> + getPointerTy()); >> + SDValue RelAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, Lo, Hi); >> + SDValue AbsAddr = DAG.getNode(ISD::ADD, dl, MVT::i32, >> + GlobalBase, RelAddr); >> + return DAG.getLoad(getPointerTy(), dl, DAG.getEntryNode(), >> + AbsAddr, NULL, 0); >> > > Done. > >> >> >> >> >> Some more important issues: >> >> We need testcases for this :) >> > > I added two testcases. First is to test whether function linkage is > correctly set. Second is to test the PIC code generates code to get > _GLOBAL_OFFSET_TABLE_. > Please let me know how to make them better or need more testcases. > >> >> + O << "\t.section\t\".text\"\n" >> >> Please don't switch sections textually, use >> OutStreamer.SwitchSection. >> >> << "\t.align 4\n" >> >> Likewise, use the streamer to emit the alignment. >> >> >> More generally, I don't understand why LabelForBaseReg needs to be >> a map >> from strings to unsigned. Can't you make it a map from MO.getReg() >> or >> something? Can you give an example of the sort of code you're >> generating >> (I'm not familiar with sparc pic codegen). >> > > I modified the code so that I don't need LabelForBaseReg any more. I > also don't need to change the sections manually. > I am generating the following code for PIC. This example assumes that > register %l7 is allocated to be the base register > > foo: > // > Function Prolog > // > .LLGETPCH0: > // Call sets PC to %o7 > call .LLGETPC0 > // This sequence computes _GLOBAL_OFFSET_TABLE_ offset from call > instruction's PC > sethi %hi(_GLOBAL_OFFSET_TABLE_+(.-.LLGETPC0), %l7 > or %l7, %lo(_GLOBAL_OFFSET_TABLE_+(.-.LLGETPC0), %l7 > .LLGETPC0: > // Finally add the PC to get absolute address of > _GLOBAL_OFFSET_TABLE_ in %l7 > add %l7, %o7, %l7 > > // Loading a global value to scratch register %g1 > // Load the glob ptr's offset > sethi %hi(global), %g1 > add %g1, %lo(global), %g1 > // Load the glob ptr from _GLOBAL_OFFSET_TABLE_ > ld [%g1+%l7], %g1 > // Finally load the value itself. > ld [%g1], %g1 > >> Thanks, >> >> -Chris >> >> > From deeppatel1987 at gmail.com Tue Sep 15 12:53:11 2009 From: deeppatel1987 at gmail.com (Sandeep Patel) Date: Tue, 15 Sep 2009 17:53:11 -0000 Subject: [llvm-commits] [llvm] r81878 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll Message-ID: <200909151753.n8FHrBAn013809@zion.cs.uiuc.edu> Author: sandeep Date: Tue Sep 15 12:53:11 2009 New Revision: 81878 URL: http://llvm.org/viewvc/llvm-project?rev=81878&view=rev Log: Fix superreg use in ARMAsmPrinter. Approved by Anton Korobeynikov. Added: llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=81878&r1=81877&r2=81878&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Tue Sep 15 12:53:11 2009 @@ -318,8 +318,8 @@ << '}'; } else if (Modifier && strcmp(Modifier, "lane") == 0) { unsigned RegNum = ARMRegisterInfo::getRegisterNumbering(Reg); - unsigned DReg = TRI->getMatchingSuperReg(Reg, RegNum & 1 ? 0 : 1, - &ARM::DPRRegClass); + unsigned DReg = TRI->getMatchingSuperReg(Reg, RegNum & 1 ? 2 : 1, + &ARM::DPR_VFP2RegClass); O << getRegisterName(DReg) << '[' << (RegNum & 1) << ']'; } else { O << getRegisterName(Reg); Added: llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll?rev=81878&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll Tue Sep 15 12:53:11 2009 @@ -0,0 +1,41 @@ +; RUN: llc < %s -march=arm -mattr=+neon -mcpu=cortex-a9 + +define arm_aapcs_vfpcc <4 x float> @foo(i8* nocapture %pBuffer, i32 %numItems) nounwind { + %1 = ptrtoint i8* %pBuffer to i32 + + %lsr.iv2641 = inttoptr i32 %1 to float* + %tmp29 = add i32 %1, 4 + %tmp2930 = inttoptr i32 %tmp29 to float* + %tmp31 = add i32 %1, 8 + %tmp3132 = inttoptr i32 %tmp31 to float* + %tmp33 = add i32 %1, 12 + %tmp3334 = inttoptr i32 %tmp33 to float* + %tmp35 = add i32 %1, 16 + %tmp3536 = inttoptr i32 %tmp35 to float* + %tmp37 = add i32 %1, 20 + %tmp3738 = inttoptr i32 %tmp37 to float* + %tmp39 = add i32 %1, 24 + %tmp3940 = inttoptr i32 %tmp39 to float* + %2 = load float* %lsr.iv2641, align 4 + %3 = load float* %tmp2930, align 4 + %4 = load float* %tmp3132, align 4 + %5 = load float* %tmp3334, align 4 + %6 = load float* %tmp3536, align 4 + %7 = load float* %tmp3738, align 4 + %8 = load float* %tmp3940, align 4 + %9 = insertelement <4 x float> undef, float %6, i32 0 + %10 = shufflevector <4 x float> %9, <4 x float> undef, <4 x i32> zeroinitializer + %11 = insertelement <4 x float> %10, float %7, i32 1 + %12 = insertelement <4 x float> %11, float %8, i32 2 + %13 = insertelement <4 x float> undef, float %2, i32 0 + %14 = shufflevector <4 x float> %13, <4 x float> undef, <4 x i32> zeroinitializer + %15 = insertelement <4 x float> %14, float %3, i32 1 + %16 = insertelement <4 x float> %15, float %4, i32 2 + %17 = insertelement <4 x float> %16, float %5, i32 3 + %18 = fsub <4 x float> zeroinitializer, %12 + %19 = shufflevector <4 x float> %18, <4 x float> undef, <4 x i32> zeroinitializer + %20 = shufflevector <4 x float> %17, <4 x float> undef, <2 x i32> + %21 = shufflevector <2 x float> %20, <2 x float> undef, <4 x i32> + + ret <4 x float> %21 +} From bob.wilson at apple.com Tue Sep 15 12:56:18 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 15 Sep 2009 17:56:18 -0000 Subject: [llvm-commits] [llvm] r81879 - /llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Message-ID: <200909151756.n8FHuIP2014196@zion.cs.uiuc.edu> Author: bwilson Date: Tue Sep 15 12:56:18 2009 New Revision: 81879 URL: http://llvm.org/viewvc/llvm-project?rev=81879&view=rev Log: Handle AddrMode4 for Thumb2 in rewriteT2FrameIndex. This occurs for VLDM/VSTM instructions, and without this check, the code assumes that an offset is allowed, as it would be with VLDR/VSTR. The asm printer, however, silently drops the offset, producing incorrect code. Since the address register in this case is either the stack or frame pointer, the spill location ends up conflicting with some other stack slot or with outgoing arguments on the stack. Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=81879&r1=81878&r2=81879&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Tue Sep 15 12:56:18 2009 @@ -383,6 +383,11 @@ "Bit extraction didn't work?"); MI.getOperand(FrameRegIdx+1).ChangeToImmediate(ThisImmVal); } else { + + // AddrMode4 cannot handle any offset. + if (AddrMode == ARMII::AddrMode4) + return false; + // AddrModeT2_so cannot handle any offset. If there is no offset // register then we change to an immediate version. unsigned NewOpc = Opcode; From sabre at nondot.org Tue Sep 15 13:03:13 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 18:03:13 -0000 Subject: [llvm-commits] [llvm] r81881 - /llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h Message-ID: <200909151803.n8FI3D0d015052@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 13:03:13 2009 New Revision: 81881 URL: http://llvm.org/viewvc/llvm-project?rev=81881&view=rev Log: add missing file Added: llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h Added: llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h?rev=81881&view=auto ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h (added) +++ llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h Tue Sep 15 13:03:13 2009 @@ -0,0 +1,32 @@ +//===- SparcMachineFunctionInfo.h - Sparc Machine Function Info -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file declares Sparc specific per-machine-function information. +// +//===----------------------------------------------------------------------===// +#ifndef SPARCMACHINEFUNCTIONINFO_H +#define SPARCMACHINEFUNCTIONINFO_H + +#include "llvm/CodeGen/MachineFunction.h" + +namespace llvm { + + class SparcMachineFunctionInfo : public MachineFunctionInfo { + private: + unsigned GlobalBaseReg; + public: + SparcMachineFunctionInfo() : GlobalBaseReg(0) {} + SparcMachineFunctionInfo(MachineFunction &MF) : GlobalBaseReg(0) {} + + unsigned getGlobalBaseReg() const { return GlobalBaseReg; } + void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; } + }; +} + +#endif From clattner at apple.com Tue Sep 15 13:05:18 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Sep 2009 11:05:18 -0700 Subject: [llvm-commits] [llvm] r81878 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll In-Reply-To: <200909151753.n8FHrBAn013809@zion.cs.uiuc.edu> References: <200909151753.n8FHrBAn013809@zion.cs.uiuc.edu> Message-ID: <91563F0B-3607-41A1-AEFD-B2A9FD62EDEE@apple.com> On Sep 15, 2009, at 10:53 AM, Sandeep Patel wrote: > Author: sandeep > Date: Tue Sep 15 12:53:11 2009 > New Revision: 81878 > > URL: http://llvm.org/viewvc/llvm-project?rev=81878&view=rev > Log: > Fix superreg use in ARMAsmPrinter. Approved by Anton Korobeynikov. Hi Sandeep, Please make the test check for some expected output. I will be hacking on the ARM asmprinter (to make it work like the new X86 asmprinter) real-soon-now and don't want to regress anything. -Chris > > Added: > llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll > Modified: > llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp > > Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=81878&r1=81877&r2=81878&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Tue Sep > 15 12:53:11 2009 > @@ -318,8 +318,8 @@ > << '}'; > } else if (Modifier && strcmp(Modifier, "lane") == 0) { > unsigned RegNum = ARMRegisterInfo::getRegisterNumbering(Reg); > - unsigned DReg = TRI->getMatchingSuperReg(Reg, RegNum & 1 ? > 0 : 1, > - &ARM::DPRRegClass); > + unsigned DReg = TRI->getMatchingSuperReg(Reg, RegNum & 1 ? > 2 : 1, > + > &ARM::DPR_VFP2RegClass); > O << getRegisterName(DReg) << '[' << (RegNum & 1) << ']'; > } else { > O << getRegisterName(Reg); > > Added: llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll?rev=81878&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll (added) > +++ llvm/trunk/test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll Tue > Sep 15 12:53:11 2009 > @@ -0,0 +1,41 @@ > +; RUN: llc < %s -march=arm -mattr=+neon -mcpu=cortex-a9 > + > +define arm_aapcs_vfpcc <4 x float> @foo(i8* nocapture %pBuffer, i32 > %numItems) nounwind { > + %1 = ptrtoint i8* %pBuffer to i32 > + > + %lsr.iv2641 = inttoptr i32 %1 to float* > + %tmp29 = add i32 %1, 4 > + %tmp2930 = inttoptr i32 %tmp29 to float* > + %tmp31 = add i32 %1, 8 > + %tmp3132 = inttoptr i32 %tmp31 to float* > + %tmp33 = add i32 %1, 12 > + %tmp3334 = inttoptr i32 %tmp33 to float* > + %tmp35 = add i32 %1, 16 > + %tmp3536 = inttoptr i32 %tmp35 to float* > + %tmp37 = add i32 %1, 20 > + %tmp3738 = inttoptr i32 %tmp37 to float* > + %tmp39 = add i32 %1, 24 > + %tmp3940 = inttoptr i32 %tmp39 to float* > + %2 = load float* %lsr.iv2641, align 4 > + %3 = load float* %tmp2930, align 4 > + %4 = load float* %tmp3132, align 4 > + %5 = load float* %tmp3334, align 4 > + %6 = load float* %tmp3536, align 4 > + %7 = load float* %tmp3738, align 4 > + %8 = load float* %tmp3940, align 4 > + %9 = insertelement <4 x float> undef, float %6, i32 0 > + %10 = shufflevector <4 x float> %9, <4 x float> undef, <4 x i32> > zeroinitializer > + %11 = insertelement <4 x float> %10, float %7, i32 1 > + %12 = insertelement <4 x float> %11, float %8, i32 2 > + %13 = insertelement <4 x float> undef, float %2, i32 0 > + %14 = shufflevector <4 x float> %13, <4 x float> undef, <4 x i32> > zeroinitializer > + %15 = insertelement <4 x float> %14, float %3, i32 1 > + %16 = insertelement <4 x float> %15, float %4, i32 2 > + %17 = insertelement <4 x float> %16, float %5, i32 3 > + %18 = fsub <4 x float> zeroinitializer, %12 > + %19 = shufflevector <4 x float> %18, <4 x float> undef, <4 x i32> > zeroinitializer > + %20 = shufflevector <4 x float> %17, <4 x float> undef, <2 x i32> > > + %21 = shufflevector <2 x float> %20, <2 x float> undef, <4 x i32> > > + > + ret <4 x float> %21 > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From deeppatel1987 at gmail.com Tue Sep 15 13:09:38 2009 From: deeppatel1987 at gmail.com (Sandeep Patel) Date: Tue, 15 Sep 2009 18:09:38 +0000 Subject: [llvm-commits] [llvm] r81878 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll In-Reply-To: <91563F0B-3607-41A1-AEFD-B2A9FD62EDEE@apple.com> References: <200909151753.n8FHrBAn013809@zion.cs.uiuc.edu> <91563F0B-3607-41A1-AEFD-B2A9FD62EDEE@apple.com> Message-ID: <305d6f60909151109g73bbe53akd79f523771d78ad0@mail.gmail.com> On Tue, Sep 15, 2009 at 6:05 PM, Chris Lattner wrote: > > On Sep 15, 2009, at 10:53 AM, Sandeep Patel wrote: > >> Author: sandeep >> Date: Tue Sep 15 12:53:11 2009 >> New Revision: 81878 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=81878&view=rev >> Log: >> Fix superreg use in ARMAsmPrinter. Approved by Anton Korobeynikov. > > Hi Sandeep, > > Please make the test check for some expected output. ?I will be hacking on > the ARM asmprinter (to make it work like the new X86 asmprinter) > real-soon-now and don't want to regress anything. The expected output is not asserting. There are a ton of tests that are like this. To pick two randomly for ARM: 2007-03-26-RegScavengerAssert.ll and 2009-09-13-InvalidSubreg.ll. deep From clattner at apple.com Tue Sep 15 13:16:01 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Sep 2009 11:16:01 -0700 Subject: [llvm-commits] [llvm] r81878 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/ARM/2009-09-13-InvalidSuperReg.ll In-Reply-To: <305d6f60909151109g73bbe53akd79f523771d78ad0@mail.gmail.com> References: <200909151753.n8FHrBAn013809@zion.cs.uiuc.edu> <91563F0B-3607-41A1-AEFD-B2A9FD62EDEE@apple.com> <305d6f60909151109g73bbe53akd79f523771d78ad0@mail.gmail.com> Message-ID: <99A8D0DF-EB2F-4D57-8A60-D9DC5BCAAFC1@apple.com> On Sep 15, 2009, at 11:09 AM, Sandeep Patel wrote: > On Tue, Sep 15, 2009 at 6:05 PM, Chris Lattner > wrote: >> >> On Sep 15, 2009, at 10:53 AM, Sandeep Patel wrote: >> >>> Author: sandeep >>> Date: Tue Sep 15 12:53:11 2009 >>> New Revision: 81878 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=81878&view=rev >>> Log: >>> Fix superreg use in ARMAsmPrinter. Approved by Anton Korobeynikov. >> >> Hi Sandeep, >> >> Please make the test check for some expected output. I will be >> hacking on >> the ARM asmprinter (to make it work like the new X86 asmprinter) >> real-soon-now and don't want to regress anything. > > The expected output is not asserting. There are a ton of tests that > are like this. To pick two randomly for ARM: > 2007-03-26-RegScavengerAssert.ll and 2009-09-13-InvalidSubreg.ll. Aha, ok, thanks! -Chris From sabre at nondot.org Tue Sep 15 13:23:24 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 18:23:24 -0000 Subject: [llvm-commits] [llvm] r81882 - /llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll Message-ID: <200909151823.n8FINOcg017887@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 13:23:23 2009 New Revision: 81882 URL: http://llvm.org/viewvc/llvm-project?rev=81882&view=rev Log: convert to filecheck Modified: llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll Modified: llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll?rev=81882&r1=81881&r2=81882&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll Tue Sep 15 13:23:23 2009 @@ -1,17 +1,33 @@ -; RUN: llc < %s -march=x86-64 -O0 | grep movslq -; RUN: llc < %s -march=x86 -O0 +; RUN: llc < %s -march=x86-64 -O0 | FileCheck %s --check-prefix=X64 +; RUN: llc < %s -march=x86 -O0 | FileCheck %s --check-prefix=X32 ; PR3181 ; GEP indices are interpreted as signed integers, so they ; should be sign-extended to 64 bits on 64-bit targets. -define i32 @foo(i32 %t3, i32* %t1) nounwind { +define i32 @test1(i32 %t3, i32* %t1) nounwind { %t9 = getelementptr i32* %t1, i32 %t3 ; [#uses=1] %t15 = load i32* %t9 ; [#uses=1] ret i32 %t15 +; X32: test1: +; X32: movl (%ecx,%eax,4), %eax +; X32: ret + +; X64: test1: +; X64: movslq %edi, %rax +; X64: movl (%rsi,%rax,4), %eax +; X64: ret + } -define i32 @bar(i64 %t3, i32* %t1) nounwind { +define i32 @test2(i64 %t3, i32* %t1) nounwind { %t9 = getelementptr i32* %t1, i64 %t3 ; [#uses=1] %t15 = load i32* %t9 ; [#uses=1] ret i32 %t15 +; X32: test2: +; X32: movl (%eax,%ecx,4), %eax +; X32: ret + +; X64: test2: +; X64: movl (%rsi,%rdi,4), %eax +; X64: ret } From baldrick at free.fr Tue Sep 15 13:23:36 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Sep 2009 18:23:36 -0000 Subject: [llvm-commits] [gcc-plugin] r81883 - /gcc-plugin/trunk/llvm-convert.cpp Message-ID: <200909151823.n8FINa79017921@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 15 13:23:36 2009 New Revision: 81883 URL: http://llvm.org/viewvc/llvm-project?rev=81883&view=rev Log: Support ASM expressions that define ssa names. Modified: gcc-plugin/trunk/llvm-convert.cpp Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81883&r1=81882&r2=81883&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 15 13:23:36 2009 @@ -4329,6 +4329,8 @@ SmallVector StoreCallResultAddrs; SmallVector CallResultTypes; SmallVector CallResultIsSigned; + SmallVector CallResultSSANames; + SmallVector CallResultSSATemps; // Process outputs. ValNum = 0; @@ -4384,9 +4386,19 @@ SimplifiedConstraint = CanonicalizeConstraint(Constraint+1); } - LValue Dest = EmitLV(Operand); - const Type *DestValTy = - cast(Dest.Ptr->getType())->getElementType(); + LValue Dest; + const Type *DestValTy; + if (TREE_CODE(Operand) == SSA_NAME) { + // The ASM is defining an ssa name. Store the output to a temporary, then + // load it out again later as the ssa name. + DestValTy = ConvertType(TREE_TYPE(Operand)); + Dest.Ptr = CreateTemporary(DestValTy); + CallResultSSANames.push_back(Operand); + CallResultSSATemps.push_back(Dest.Ptr); + } else { + Dest = EmitLV(Operand); + DestValTy = cast(Dest.Ptr->getType())->getElementType(); + } assert(!Dest.isBitfield() && "Cannot assign into a bitfield!"); if (!AllowsMem && DestValTy->isSingleValueType()) {// Reg dest -> asm return @@ -4613,6 +4625,10 @@ } } + // If the call defined any ssa names, associate them with their value. + for (unsigned i = 0, e = CallResultSSANames.size(); i != e; ++i) + SSANames[CallResultSSANames[i]] = Builder.CreateLoad(CallResultSSATemps[i]); + // Give the backend a chance to upgrade the inline asm to LLVM code. This // handles some common cases that LLVM has intrinsics for, e.g. x86 bswap -> // llvm.bswap. From sabre at nondot.org Tue Sep 15 13:23:37 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 18:23:37 -0000 Subject: [llvm-commits] [llvm] r81884 - in /llvm/trunk/test/CodeGen/X86: fast-isel-gep-sext.ll fast-isel-gep.ll Message-ID: <200909151823.n8FINba4017937@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 13:23:37 2009 New Revision: 81884 URL: http://llvm.org/viewvc/llvm-project?rev=81884&view=rev Log: rename test Added: llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll - copied unchanged from r81882, llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll Removed: llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll Removed: llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll?rev=81883&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-gep-sext.ll (removed) @@ -1,33 +0,0 @@ -; RUN: llc < %s -march=x86-64 -O0 | FileCheck %s --check-prefix=X64 -; RUN: llc < %s -march=x86 -O0 | FileCheck %s --check-prefix=X32 -; PR3181 - -; GEP indices are interpreted as signed integers, so they -; should be sign-extended to 64 bits on 64-bit targets. - -define i32 @test1(i32 %t3, i32* %t1) nounwind { - %t9 = getelementptr i32* %t1, i32 %t3 ; [#uses=1] - %t15 = load i32* %t9 ; [#uses=1] - ret i32 %t15 -; X32: test1: -; X32: movl (%ecx,%eax,4), %eax -; X32: ret - -; X64: test1: -; X64: movslq %edi, %rax -; X64: movl (%rsi,%rax,4), %eax -; X64: ret - -} -define i32 @test2(i64 %t3, i32* %t1) nounwind { - %t9 = getelementptr i32* %t1, i64 %t3 ; [#uses=1] - %t15 = load i32* %t9 ; [#uses=1] - ret i32 %t15 -; X32: test2: -; X32: movl (%eax,%ecx,4), %eax -; X32: ret - -; X64: test2: -; X64: movl (%rsi,%rdi,4), %eax -; X64: ret -} From sabre at nondot.org Tue Sep 15 13:27:02 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 18:27:02 -0000 Subject: [llvm-commits] [llvm] r81886 - in /llvm/trunk: lib/Target/X86/X86InstrBuilder.h test/CodeGen/X86/fast-isel-gep.ll Message-ID: <200909151827.n8FIR2T5018389@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 13:27:02 2009 New Revision: 81886 URL: http://llvm.org/viewvc/llvm-project?rev=81886&view=rev Log: fix PR4984 by ensuring that fastisel adds properly sign extended GEP displacement values to machineinstrs. Modified: llvm/trunk/lib/Target/X86/X86InstrBuilder.h llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll Modified: llvm/trunk/lib/Target/X86/X86InstrBuilder.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrBuilder.h?rev=81886&r1=81885&r2=81886&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrBuilder.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrBuilder.h Tue Sep 15 13:27:02 2009 @@ -47,7 +47,7 @@ unsigned Scale; unsigned IndexReg; - unsigned Disp; + int Disp; GlobalValue *GV; unsigned GVOpFlags; Modified: llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll?rev=81886&r1=81885&r2=81886&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-gep.ll Tue Sep 15 13:27:02 2009 @@ -1,10 +1,9 @@ ; RUN: llc < %s -march=x86-64 -O0 | FileCheck %s --check-prefix=X64 ; RUN: llc < %s -march=x86 -O0 | FileCheck %s --check-prefix=X32 -; PR3181 ; GEP indices are interpreted as signed integers, so they ; should be sign-extended to 64 bits on 64-bit targets. - +; PR3181 define i32 @test1(i32 %t3, i32* %t1) nounwind { %t9 = getelementptr i32* %t1, i32 %t3 ; [#uses=1] %t15 = load i32* %t9 ; [#uses=1] @@ -31,3 +30,24 @@ ; X64: movl (%rsi,%rdi,4), %eax ; X64: ret } + + + +; PR4984 +define i8 @test3(i8* %start) nounwind { +entry: + %A = getelementptr i8* %start, i64 -2 ; [#uses=1] + %B = load i8* %A, align 1 ; [#uses=1] + ret i8 %B + + +; X32: test3: +; X32: movl 4(%esp), %eax +; X32: movb -2(%eax), %al +; X32: ret + +; X64: test3: +; X64: movb -2(%rdi), %al +; X64: ret + +} From dalej at apple.com Tue Sep 15 13:32:15 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 15 Sep 2009 18:32:15 -0000 Subject: [llvm-commits] [llvm] r81888 - /llvm/trunk/lib/Target/X86/X86JITInfo.cpp Message-ID: <200909151832.n8FIWFHp019100@zion.cs.uiuc.edu> Author: johannes Date: Tue Sep 15 13:32:14 2009 New Revision: 81888 URL: http://llvm.org/viewvc/llvm-project?rev=81888&view=rev Log: Change the marker byte for stubs from 0xcd to 0xce (another form of interrupt instruction, which shouldn't arise any other way). 0xcd is also used by JITMemoryManager to initialize the buffer to garbage, which means it could appear following a noreturn call even when that is not a stub, confusing X86CompilationCallback2. PR 4929. Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.cpp?rev=81888&r1=81887&r2=81888&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86JITInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86JITInfo.cpp Tue Sep 15 13:32:14 2009 @@ -338,7 +338,7 @@ "Could not find return address on the stack!"); // It's a stub if there is an interrupt marker after the call. - bool isStub = ((unsigned char*)RetAddr)[0] == 0xCD; + bool isStub = ((unsigned char*)RetAddr)[0] == 0xCE; // The call instruction should have pushed the return value onto the stack... #if defined (X86_64_JIT) @@ -377,7 +377,7 @@ // If this is a stub, rewrite the call into an unconditional branch // instruction so that two return addresses are not pushed onto the stack // when the requested function finally gets called. This also makes the - // 0xCD byte (interrupt) dead, so the marker doesn't effect anything. + // 0xCE byte (interrupt) dead, so the marker doesn't effect anything. #if defined (X86_64_JIT) // If the target address is within 32-bit range of the stub, use a // PC-relative branch instead of loading the actual address. (This is @@ -480,7 +480,10 @@ JCE.emitWordLE((intptr_t)Fn-JCE.getCurrentPCValue()-4); #endif - JCE.emitByte(0xCD); // Interrupt - Just a marker identifying the stub! + // This used to use 0xCD, but that value is used by JITMemoryManager to + // initialize the buffer with garbage, which means it may follow a + // noreturn function call, confusing X86CompilationCallback2. PR 4929. + JCE.emitByte(0xCE); // Interrupt - Just a marker identifying the stub! return JCE.finishGVStub(F); } From isanbard at gmail.com Tue Sep 15 13:35:14 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Sep 2009 18:35:14 -0000 Subject: [llvm-commits] [llvm] r81891 - in /llvm/tags/Apple: llvmCore-2207-Eric/ llvmCore-2207/ Message-ID: <200909151835.n8FIZEiZ019615@zion.cs.uiuc.edu> Author: void Date: Tue Sep 15 13:35:14 2009 New Revision: 81891 URL: http://llvm.org/viewvc/llvm-project?rev=81891&view=rev Log: Move tag with Eric's patch out to recreate 2207. Added: llvm/tags/Apple/llvmCore-2207-Eric/ - copied from r81890, llvm/tags/Apple/llvmCore-2207/ Removed: llvm/tags/Apple/llvmCore-2207/ From isanbard at gmail.com Tue Sep 15 13:35:36 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Sep 2009 18:35:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r81892 - in /llvm-gcc-4.2/tags/Apple: llvmgcc42-2207-Eric/ llvmgcc42-2207/ Message-ID: <200909151835.n8FIZaDs019698@zion.cs.uiuc.edu> Author: void Date: Tue Sep 15 13:35:35 2009 New Revision: 81892 URL: http://llvm.org/viewvc/llvm-project?rev=81892&view=rev Log: Move tag with Eric's patch out to recreate 2207. Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2207-Eric/ - copied from r81891, llvm-gcc-4.2/tags/Apple/llvmgcc42-2207/ Removed: llvm-gcc-4.2/tags/Apple/llvmgcc42-2207/ From isanbard at gmail.com Tue Sep 15 13:36:02 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Sep 2009 18:36:02 -0000 Subject: [llvm-commits] [llvm] r81893 - /llvm/tags/Apple/llvmCore-2207/ Message-ID: <200909151836.n8FIa3M3019765@zion.cs.uiuc.edu> Author: void Date: Tue Sep 15 13:36:02 2009 New Revision: 81893 URL: http://llvm.org/viewvc/llvm-project?rev=81893&view=rev Log: Creating llvmCore-2207 from Bender-SWB. Added: llvm/tags/Apple/llvmCore-2207/ - copied from r81892, llvm/branches/Apple/Bender-SWB/ From isanbard at gmail.com Tue Sep 15 13:36:10 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Sep 2009 18:36:10 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r81894 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2207/ Message-ID: <200909151836.n8FIaB7g019799@zion.cs.uiuc.edu> Author: void Date: Tue Sep 15 13:36:10 2009 New Revision: 81894 URL: http://llvm.org/viewvc/llvm-project?rev=81894&view=rev Log: Creating llvmgcc42-2207 from Bender-SWB. Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2207/ - copied from r81893, llvm-gcc-4.2/branches/Apple/Bender-SWB/ From scallanan at apple.com Tue Sep 15 13:47:29 2009 From: scallanan at apple.com (Sean Callanan) Date: Tue, 15 Sep 2009 18:47:29 -0000 Subject: [llvm-commits] [llvm] r81895 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td X86RegisterInfo.td Message-ID: <200909151847.n8FIlUxl021361@zion.cs.uiuc.edu> Author: spyffe Date: Tue Sep 15 13:47:29 2009 New Revision: 81895 URL: http://llvm.org/viewvc/llvm-project?rev=81895&view=rev Log: Added a new register class for segment registers to the Intel register table. Added 16- and 64-bit MOVs to and from the segment registers to the Intel instruction tables. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td llvm/trunk/lib/Target/X86/X86RegisterInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=81895&r1=81894&r2=81895&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Sep 15 13:47:29 2009 @@ -330,6 +330,16 @@ def MOV64ao32 : RIi32<0xA3, RawFrm, (outs i32imm:$dst), (ins), "mov{q}\t{%rax, $dst|$dst, %rax}", []>; +// Moves to and from segment registers +def MOV64rs : RI<0x8C, MRMDestReg, (outs GR64:$dst), (ins SEGMENT_REG:$src), + "mov{w}\t{$src, $dst|$dst, $src}", []>; +def MOV64ms : RI<0x8C, MRMDestMem, (outs i64mem:$dst), (ins SEGMENT_REG:$src), + "mov{w}\t{$src, $dst|$dst, $src}", []>; +def MOV64sr : RI<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR64:$src), + "mov{w}\t{$src, $dst|$dst, $src}", []>; +def MOV64sm : RI<0x8E, MRMSrcMem, (outs SEGMENT_REG:$dst), (ins i64mem:$src), + "mov{w}\t{$src, $dst|$dst, $src}", []>; + // Sign/Zero extenders // MOVSX64rr8 always has a REX prefix and it has an 8-bit register Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=81895&r1=81894&r2=81895&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Sep 15 13:47:29 2009 @@ -946,6 +946,16 @@ def MOV32ao32 : Ii32 <0xA3, RawFrm, (outs i32imm:$dst), (ins), "mov{l}\t{%eax, $dst|$dst, %eax}", []>; +// Moves to and from segment registers +def MOV16rs : I<0x8C, MRMDestReg, (outs GR16:$dst), (ins SEGMENT_REG:$src), + "mov{w}\t{$src, $dst|$dst, $src}", []>; +def MOV16ms : I<0x8C, MRMDestMem, (outs i16mem:$dst), (ins SEGMENT_REG:$src), + "mov{w}\t{$src, $dst|$dst, $src}", []>; +def MOV16sr : I<0x8E, MRMSrcReg, (outs SEGMENT_REG:$dst), (ins GR16:$src), + "mov{w}\t{$src, $dst|$dst, $src}", []>; +def MOV16sm : I<0x8E, MRMSrcMem, (outs SEGMENT_REG:$dst), (ins i16mem:$src), + "mov{w}\t{$src, $dst|$dst, $src}", []>; + let canFoldAsLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in { def MOV8rm : I<0x8A, MRMSrcMem, (outs GR8 :$dst), (ins i8mem :$src), "mov{b}\t{$src, $dst|$dst, $src}", Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.td?rev=81895&r1=81894&r2=81895&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.td Tue Sep 15 13:47:29 2009 @@ -440,6 +440,11 @@ }]; } +// Segment registers for use by MOV instructions (and others) that have a +// segment register as one operand. Always contain a 16-bit segment +// descriptor. +def SEGMENT_REG : RegisterClass<"X86", [i16], 16, [CS, DS, SS, ES, FS, GS]> { +} // GR8_ABCD_L, GR8_ABCD_H, GR16_ABCD, GR32_ABCD, GR64_ABCD - Subclasses of // GR8, GR16, GR32, and GR64 which contain just the "a" "b", "c", and "d" From grosbach at apple.com Tue Sep 15 13:56:13 2009 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 15 Sep 2009 18:56:13 -0000 Subject: [llvm-commits] [llvm] r81896 - /llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h Message-ID: <200909151856.n8FIuEPv022517@zion.cs.uiuc.edu> Author: grosbach Date: Tue Sep 15 13:56:13 2009 New Revision: 81896 URL: http://llvm.org/viewvc/llvm-project?rev=81896&view=rev Log: Correct comment pasto Modified: llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h Modified: llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h?rev=81896&r1=81895&r2=81896&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h (original) +++ llvm/trunk/include/llvm/CodeGen/RegisterScavenging.h Tue Sep 15 13:56:13 2009 @@ -121,7 +121,7 @@ /// isReserved - Returns true if a register is reserved. It is never "unused". bool isReserved(unsigned Reg) const { return ReservedRegs.test(Reg); } - /// isUsed / isUsed - Test if a register is currently being used. + /// isUsed / isUnused - Test if a register is currently being used. /// bool isUsed(unsigned Reg) const { return !RegsAvailable.test(Reg); } bool isUnused(unsigned Reg) const { return RegsAvailable.test(Reg); } From natebegeman at mac.com Tue Sep 15 14:05:41 2009 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 15 Sep 2009 19:05:41 -0000 Subject: [llvm-commits] [llvm] r81897 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200909151905.n8FJ5fS8023724@zion.cs.uiuc.edu> Author: sampo Date: Tue Sep 15 14:05:41 2009 New Revision: 81897 URL: http://llvm.org/viewvc/llvm-project?rev=81897&view=rev Log: Better solution for tracking both the original alignment of the access, and the current alignment based on the source value offset. This avoids increasing the size of mem nodes. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=81897&r1=81896&r2=81897&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Sep 15 14:05:41 2009 @@ -544,7 +544,7 @@ /// SDValue getLoad(EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, bool isVolatile=false, - unsigned Alignment=0, unsigned OrigAlignment=0); + unsigned Alignment=0); SDValue getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, EVT EVT, bool isVolatile=false, @@ -554,14 +554,13 @@ SDValue getLoad(ISD::MemIndexedMode AM, DebugLoc dl, ISD::LoadExtType ExtType, EVT VT, SDValue Chain, SDValue Ptr, SDValue Offset, const Value *SV, int SVOffset, EVT EVT, - bool isVolatile=false, unsigned Alignment=0, - unsigned OrigAlignment=0); + bool isVolatile=false, unsigned Alignment=0); /// getStore - Helper function to build ISD::STORE nodes. /// SDValue getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, const Value *SV, int SVOffset, bool isVolatile=false, - unsigned Alignment=0, unsigned OrigAlignment=0); + unsigned Alignment=0); SDValue getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, const Value *SV, int SVOffset, EVT TVT, bool isVolatile=false, unsigned Alignment=0); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=81897&r1=81896&r2=81897&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Sep 15 14:05:41 2009 @@ -28,6 +28,7 @@ #include "llvm/CodeGen/ValueTypes.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/Support/Allocator.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/RecyclingAllocator.h" #include "llvm/Support/DataTypes.h" #include "llvm/Support/DebugLoc.h" @@ -1518,23 +1519,22 @@ //! SVOffset - Memory location offset. Note that base is defined in MemSDNode int SVOffset; - - //! OrigAlign - The original alignment of this MemSDNode in the case where - // this node was created by legalize from a MemSDNode with known alignment. - unsigned OrigAlign; - public: MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, EVT MemoryVT, - const Value *srcValue, int SVOff, - unsigned alignment, bool isvolatile, unsigned oalign); + const Value *srcValue, int SVOff, unsigned alignment, + bool isvolatile); MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, const SDValue *Ops, unsigned NumOps, EVT MemoryVT, const Value *srcValue, int SVOff, - unsigned alignment, bool isvolatile, unsigned oalign); + unsigned alignment, bool isvolatile); /// Returns alignment and volatility of the memory access - unsigned getAlignment() const { return (1u << (SubclassData >> 6)) >> 1; } - unsigned getOriginalAlignment() const { return OrigAlign; } + unsigned getOriginalAlignment() const { + return (1u << (SubclassData >> 6)) >> 1; + } + unsigned getAlignment() const { + return MinAlign(getOriginalAlignment(), SVOffset); + } bool isVolatile() const { return (SubclassData >> 5) & 1; } /// getRawSubclassData - Return the SubclassData value, which contains an @@ -1605,14 +1605,14 @@ SDValue Cmp, SDValue Swp, const Value* SrcVal, unsigned Align=0) : MemSDNode(Opc, dl, VTL, MemVT, SrcVal, /*SVOffset=*/0, - Align, /*isVolatile=*/true, /* OrigAlign=*/0) { + Align, /*isVolatile=*/true) { InitOperands(Ops, Chain, Ptr, Cmp, Swp); } AtomicSDNode(unsigned Opc, DebugLoc dl, SDVTList VTL, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Val, const Value* SrcVal, unsigned Align=0) : MemSDNode(Opc, dl, VTL, MemVT, SrcVal, /*SVOffset=*/0, - Align, /*isVolatile=*/true, /* OrigAlign=*/0) { + Align, /*isVolatile=*/true) { InitOperands(Ops, Chain, Ptr, Val); } @@ -1653,8 +1653,7 @@ const SDValue *Ops, unsigned NumOps, EVT MemoryVT, const Value *srcValue, int SVO, unsigned Align, bool Vol, bool ReadMem, bool WriteMem) - : MemSDNode(Opc, dl, VTs, Ops, NumOps, MemoryVT, srcValue, SVO, Align, Vol, - /* OrigAlign=*/0), + : MemSDNode(Opc, dl, VTs, Ops, NumOps, MemoryVT, srcValue, SVO, Align, Vol), ReadMem(ReadMem), WriteMem(WriteMem) { } @@ -2269,9 +2268,8 @@ public: LSBaseSDNode(ISD::NodeType NodeTy, DebugLoc dl, SDValue *Operands, unsigned numOperands, SDVTList VTs, ISD::MemIndexedMode AM, - EVT VT, const Value *SV, int SVO, unsigned Align, bool Vol, - unsigned OAlign) - : MemSDNode(NodeTy, dl, VTs, VT, SV, SVO, Align, Vol, OAlign) { + EVT VT, const Value *SV, int SVO, unsigned Align, bool Vol) + : MemSDNode(NodeTy, dl, VTs, VT, SV, SVO, Align, Vol) { assert(Align != 0 && "Loads and stores should have non-zero aligment"); SubclassData |= AM << 2; assert(getAddressingMode() == AM && "MemIndexedMode encoding error!"); @@ -2309,10 +2307,9 @@ friend class SelectionDAG; LoadSDNode(SDValue *ChainPtrOff, DebugLoc dl, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, EVT LVT, - const Value *SV, int O=0, unsigned Align=0, bool Vol=false, - unsigned OAlign=0) + const Value *SV, int O=0, unsigned Align=0, bool Vol=false) : LSBaseSDNode(ISD::LOAD, dl, ChainPtrOff, 3, - VTs, AM, LVT, SV, O, Align, Vol, OAlign) { + VTs, AM, LVT, SV, O, Align, Vol) { SubclassData |= (unsigned short)ETy; assert(getExtensionType() == ETy && "LoadExtType encoding error!"); } @@ -2339,10 +2336,9 @@ friend class SelectionDAG; StoreSDNode(SDValue *ChainValuePtrOff, DebugLoc dl, SDVTList VTs, ISD::MemIndexedMode AM, bool isTrunc, EVT SVT, - const Value *SV, int O=0, unsigned Align=0, bool Vol=false, - unsigned OAlign=0) + const Value *SV, int O=0, unsigned Align=0, bool Vol=false) : LSBaseSDNode(ISD::STORE, dl, ChainValuePtrOff, 4, - VTs, AM, SVT, SV, O, Align, Vol, OAlign) { + VTs, AM, SVT, SV, O, Align, Vol) { SubclassData |= (unsigned short)isTrunc; assert(isTruncatingStore() == isTrunc && "isTrunc encoding error!"); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=81897&r1=81896&r2=81897&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Tue Sep 15 14:05:41 2009 @@ -170,8 +170,7 @@ DAG.getUNDEF(N->getBasePtr().getValueType()), N->getSrcValue(), N->getSrcValueOffset(), N->getMemoryVT().getVectorElementType(), - N->isVolatile(), N->getAlignment(), - N->getOriginalAlignment()); + N->isVolatile(), N->getOriginalAlignment()); // Legalized the chain result - switch anything that used the old chain to // use the new one. @@ -361,8 +360,7 @@ return DAG.getStore(N->getChain(), dl, GetScalarizedVector(N->getOperand(1)), N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), - N->isVolatile(), N->getAlignment(), - N->getOriginalAlignment()); + N->isVolatile(), N->getOriginalAlignment()); } @@ -716,23 +714,21 @@ const Value *SV = LD->getSrcValue(); int SVOffset = LD->getSrcValueOffset(); EVT MemoryVT = LD->getMemoryVT(); - unsigned Alignment = LD->getAlignment(); - unsigned OrigAlignment = LD->getOriginalAlignment(); + unsigned Alignment = LD->getOriginalAlignment(); bool isVolatile = LD->isVolatile(); EVT LoMemVT, HiMemVT; GetSplitDestVTs(MemoryVT, LoMemVT, HiMemVT); Lo = DAG.getLoad(ISD::UNINDEXED, dl, ExtType, LoVT, Ch, Ptr, Offset, - SV, SVOffset, LoMemVT, isVolatile, Alignment, OrigAlignment); + SV, SVOffset, LoMemVT, isVolatile, Alignment); unsigned IncrementSize = LoMemVT.getSizeInBits()/8; Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, DAG.getIntPtrConstant(IncrementSize)); SVOffset += IncrementSize; - Alignment = MinAlign(Alignment, IncrementSize); Hi = DAG.getLoad(ISD::UNINDEXED, dl, ExtType, HiVT, Ch, Ptr, Offset, - SV, SVOffset, HiMemVT, isVolatile, Alignment, OrigAlignment); + SV, SVOffset, HiMemVT, isVolatile, Alignment); // Build a factor node to remember that this load is independent of the // other one. @@ -1081,8 +1077,7 @@ SDValue Ptr = N->getBasePtr(); int SVOffset = N->getSrcValueOffset(); EVT MemoryVT = N->getMemoryVT(); - unsigned Alignment = N->getAlignment(); - unsigned OrigAlignment = N->getOriginalAlignment(); + unsigned Alignment = N->getOriginalAlignment(); bool isVol = N->isVolatile(); SDValue Lo, Hi; GetSplitVector(N->getOperand(1), Lo, Hi); @@ -1097,21 +1092,19 @@ LoMemVT, isVol, Alignment); else Lo = DAG.getStore(Ch, dl, Lo, Ptr, N->getSrcValue(), SVOffset, - isVol, Alignment, OrigAlignment); + isVol, Alignment); // Increment the pointer to the other half. Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, DAG.getIntPtrConstant(IncrementSize)); + SVOffset += IncrementSize; if (isTruncating) - Hi = DAG.getTruncStore(Ch, dl, Hi, Ptr, - N->getSrcValue(), SVOffset+IncrementSize, - HiMemVT, - isVol, MinAlign(Alignment, IncrementSize)); + Hi = DAG.getTruncStore(Ch, dl, Hi, Ptr, N->getSrcValue(), SVOffset, + HiMemVT, isVol, Alignment); else - Hi = DAG.getStore(Ch, dl, Hi, Ptr, N->getSrcValue(), SVOffset+IncrementSize, - isVol, MinAlign(Alignment, IncrementSize), - OrigAlignment); + Hi = DAG.getStore(Ch, dl, Hi, Ptr, N->getSrcValue(), SVOffset, + isVol, Alignment); return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Lo, Hi); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=81897&r1=81896&r2=81897&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Sep 15 14:05:41 2009 @@ -432,12 +432,14 @@ const LoadSDNode *LD = cast(N); ID.AddInteger(LD->getMemoryVT().getRawBits()); ID.AddInteger(LD->getRawSubclassData()); + ID.AddInteger(LD->getSrcValueOffset()); break; } case ISD::STORE: { const StoreSDNode *ST = cast(N); ID.AddInteger(ST->getMemoryVT().getRawBits()); ID.AddInteger(ST->getRawSubclassData()); + ID.AddInteger(ST->getSrcValueOffset()); break; } case ISD::ATOMIC_CMP_SWAP: @@ -3646,12 +3648,9 @@ ISD::LoadExtType ExtType, EVT VT, SDValue Chain, SDValue Ptr, SDValue Offset, const Value *SV, int SVOffset, EVT EVT, - bool isVolatile, unsigned Alignment, - unsigned OrigAlignment) { + bool isVolatile, unsigned Alignment) { if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(VT); - if (OrigAlignment == 0) - OrigAlignment = Alignment; if (VT == EVT) { ExtType = ISD::NON_EXTLOAD; @@ -3682,12 +3681,13 @@ AddNodeIDNode(ID, ISD::LOAD, VTs, Ops, 3); ID.AddInteger(EVT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(ExtType, AM, isVolatile, Alignment)); + ID.AddInteger(SVOffset); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); SDNode *N = NodeAllocator.Allocate(); new (N) LoadSDNode(Ops, dl, VTs, AM, ExtType, EVT, SV, SVOffset, - Alignment, isVolatile, OrigAlignment); + Alignment, isVolatile); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); return SDValue(N, 0); @@ -3696,11 +3696,10 @@ SDValue SelectionDAG::getLoad(EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, const Value *SV, int SVOffset, - bool isVolatile, unsigned Alignment, - unsigned OrigAlignment) { + bool isVolatile, unsigned Alignment) { SDValue Undef = getUNDEF(Ptr.getValueType()); return getLoad(ISD::UNINDEXED, dl, ISD::NON_EXTLOAD, VT, Chain, Ptr, Undef, - SV, SVOffset, VT, isVolatile, Alignment, OrigAlignment); + SV, SVOffset, VT, isVolatile, Alignment); } SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT, @@ -3727,14 +3726,11 @@ SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, const Value *SV, int SVOffset, - bool isVolatile, unsigned Alignment, - unsigned OrigAlignment) { + bool isVolatile, unsigned Alignment) { EVT VT = Val.getValueType(); if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(VT); - if (OrigAlignment == 0) - OrigAlignment = Alignment; SDVTList VTs = getVTList(MVT::Other); SDValue Undef = getUNDEF(Ptr.getValueType()); @@ -3744,12 +3740,13 @@ ID.AddInteger(VT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(false, ISD::UNINDEXED, isVolatile, Alignment)); + ID.AddInteger(SVOffset); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); SDNode *N = NodeAllocator.Allocate(); new (N) StoreSDNode(Ops, dl, VTs, ISD::UNINDEXED, false, - VT, SV, SVOffset, Alignment, isVolatile, OrigAlignment); + VT, SV, SVOffset, Alignment, isVolatile); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); return SDValue(N, 0); @@ -3779,6 +3776,7 @@ ID.AddInteger(SVT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(true, ISD::UNINDEXED, isVolatile, Alignment)); + ID.AddInteger(SVOffset); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); @@ -4976,25 +4974,24 @@ MemSDNode::MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, EVT memvt, const Value *srcValue, int SVO, unsigned alignment, - bool vol, unsigned origAlign) - : SDNode(Opc, dl, VTs), MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO), - OrigAlign(origAlign) { + bool vol) + : SDNode(Opc, dl, VTs), MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO) { SubclassData = encodeMemSDNodeFlags(0, ISD::UNINDEXED, vol, alignment); assert(isPowerOf2_32(alignment) && "Alignment is not a power of 2!"); - assert(getAlignment() == alignment && "Alignment representation error!"); - assert(isVolatile() == vol && "Volatile representation error!"); + assert(getOriginalAlignment() == alignment && "Alignment encoding error!"); + assert(isVolatile() == vol && "Volatile encoding error!"); } MemSDNode::MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, const SDValue *Ops, unsigned NumOps, EVT memvt, const Value *srcValue, int SVO, unsigned alignment, - bool vol, unsigned origAlign) + bool vol) : SDNode(Opc, dl, VTs, Ops, NumOps), - MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO), OrigAlign(origAlign) { + MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO) { SubclassData = encodeMemSDNodeFlags(0, ISD::UNINDEXED, vol, alignment); assert(isPowerOf2_32(alignment) && "Alignment is not a power of 2!"); - assert(getAlignment() == alignment && "Alignment representation error!"); - assert(isVolatile() == vol && "Volatile representation error!"); + assert(getOriginalAlignment() == alignment && "Alignment encoding error!"); + assert(isVolatile() == vol && "Volatile encoding error!"); } /// getMemOperand - Return a MachineMemOperand object describing the memory Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=81897&r1=81896&r2=81897&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Sep 15 14:05:41 2009 @@ -2815,7 +2815,7 @@ DAG.getNode(ISD::ADD, getCurDebugLoc(), PtrVT, Ptr, DAG.getConstant(Offsets[i], PtrVT)), - SV, Offsets[i], isVolatile, Alignment, Alignment); + SV, Offsets[i], isVolatile, Alignment); Values[i] = L; Chains[i] = L.getValue(1); } @@ -2864,8 +2864,7 @@ DAG.getNode(ISD::ADD, getCurDebugLoc(), PtrVT, Ptr, DAG.getConstant(Offsets[i], PtrVT)), - PtrV, Offsets[i], - isVolatile, Alignment, Alignment); + PtrV, Offsets[i], isVolatile, Alignment); DAG.setRoot(DAG.getNode(ISD::TokenFactor, getCurDebugLoc(), MVT::Other, &Chains[0], NumValues)); From daniel at zuster.org Tue Sep 15 15:08:23 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 13:08:23 -0700 Subject: [llvm-commits] [llvm] r81897 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/Select Message-ID: <6a8523d60909151308k6d94a4a7y82806b0ef3acbcf4@mail.gmail.com> Hi Nate, This causes CodeGen/X86/fold-sext-trunc.ll to fail, at least on x86_64-apple-darwin10. Can you take a look? - Daniel On Tue, Sep 15, 2009 at 12:05 PM, Nate Begeman wrote: > Author: sampo > Date: Tue Sep 15 14:05:41 2009 > New Revision: 81897 > > URL: http://llvm.org/viewvc/llvm-project?rev=81897&view=rev > Log: > Better solution for tracking both the original alignment of the access, and the current alignment based > on the source value offset. ?This avoids increasing the size of mem nodes. > > Modified: > ? ?llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > ? ?llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h > ? ?llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp > ? ?llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > ? ?llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=81897&r1=81896&r2=81897&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue Sep 15 14:05:41 2009 > @@ -544,7 +544,7 @@ > ? /// > ? SDValue getLoad(EVT VT, DebugLoc dl, SDValue Chain, SDValue Ptr, > ? ? ? ? ? ? ? ? ? ? const Value *SV, int SVOffset, bool isVolatile=false, > - ? ? ? ? ? ? ? ? ? ?unsigned Alignment=0, unsigned OrigAlignment=0); > + ? ? ? ? ? ? ? ? ? ?unsigned Alignment=0); > ? SDValue getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT, > ? ? ? ? ? ? ? ? ? ? ? ?SDValue Chain, SDValue Ptr, const Value *SV, > ? ? ? ? ? ? ? ? ? ? ? ?int SVOffset, EVT EVT, bool isVolatile=false, > @@ -554,14 +554,13 @@ > ? SDValue getLoad(ISD::MemIndexedMode AM, DebugLoc dl, ISD::LoadExtType ExtType, > ? ? ? ? ? ? ? ? ? EVT VT, SDValue Chain, SDValue Ptr, SDValue Offset, > ? ? ? ? ? ? ? ? ? const Value *SV, int SVOffset, EVT EVT, > - ? ? ? ? ? ? ? ? ?bool isVolatile=false, unsigned Alignment=0, > - ? ? ? ? ? ? ? ? ?unsigned OrigAlignment=0); > + ? ? ? ? ? ? ? ? ?bool isVolatile=false, unsigned Alignment=0); > > ? /// getStore - Helper function to build ISD::STORE nodes. > ? /// > ? SDValue getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, > ? ? ? ? ? ? ? ? ? ? ?const Value *SV, int SVOffset, bool isVolatile=false, > - ? ? ? ? ? ? ? ? ? ? unsigned Alignment=0, unsigned OrigAlignment=0); > + ? ? ? ? ? ? ? ? ? ? unsigned Alignment=0); > ? SDValue getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, > ? ? ? ? ? ? ? ? ? ? ? ? ? const Value *SV, int SVOffset, EVT TVT, > ? ? ? ? ? ? ? ? ? ? ? ? ? bool isVolatile=false, unsigned Alignment=0); > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=81897&r1=81896&r2=81897&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Sep 15 14:05:41 2009 > @@ -28,6 +28,7 @@ > ?#include "llvm/CodeGen/ValueTypes.h" > ?#include "llvm/CodeGen/MachineMemOperand.h" > ?#include "llvm/Support/Allocator.h" > +#include "llvm/Support/MathExtras.h" > ?#include "llvm/Support/RecyclingAllocator.h" > ?#include "llvm/Support/DataTypes.h" > ?#include "llvm/Support/DebugLoc.h" > @@ -1518,23 +1519,22 @@ > > ? //! SVOffset - Memory location offset. Note that base is defined in MemSDNode > ? int SVOffset; > - > - ?//! OrigAlign - The original alignment of this MemSDNode in the case where > - ?// this node was created by legalize from a MemSDNode with known alignment. > - ?unsigned OrigAlign; > - > ?public: > ? MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, EVT MemoryVT, > - ? ? ? ? ? ?const Value *srcValue, int SVOff, > - ? ? ? ? ? ?unsigned alignment, bool isvolatile, unsigned oalign); > + ? ? ? ? ? ?const Value *srcValue, int SVOff, unsigned alignment, > + ? ? ? ? ? ?bool isvolatile); > > ? MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, const SDValue *Ops, > ? ? ? ? ? ? unsigned NumOps, EVT MemoryVT, const Value *srcValue, int SVOff, > - ? ? ? ? ? ?unsigned alignment, bool isvolatile, unsigned oalign); > + ? ? ? ? ? ?unsigned alignment, bool isvolatile); > > ? /// Returns alignment and volatility of the memory access > - ?unsigned getAlignment() const { return (1u << (SubclassData >> 6)) >> 1; } > - ?unsigned getOriginalAlignment() const { return OrigAlign; } > + ?unsigned getOriginalAlignment() const { > + ? ?return (1u << (SubclassData >> 6)) >> 1; > + ?} > + ?unsigned getAlignment() const { > + ? ?return MinAlign(getOriginalAlignment(), SVOffset); > + ?} > ? bool isVolatile() const { return (SubclassData >> 5) & 1; } > > ? /// getRawSubclassData - Return the SubclassData value, which contains an > @@ -1605,14 +1605,14 @@ > ? ? ? ? ? ? ? ?SDValue Cmp, SDValue Swp, const Value* SrcVal, > ? ? ? ? ? ? ? ?unsigned Align=0) > ? ? : MemSDNode(Opc, dl, VTL, MemVT, SrcVal, /*SVOffset=*/0, > - ? ? ? ? ? ? ? ?Align, /*isVolatile=*/true, /* OrigAlign=*/0) { > + ? ? ? ? ? ? ? ?Align, /*isVolatile=*/true) { > ? ? InitOperands(Ops, Chain, Ptr, Cmp, Swp); > ? } > ? AtomicSDNode(unsigned Opc, DebugLoc dl, SDVTList VTL, EVT MemVT, > ? ? ? ? ? ? ? ?SDValue Chain, SDValue Ptr, > ? ? ? ? ? ? ? ?SDValue Val, const Value* SrcVal, unsigned Align=0) > ? ? : MemSDNode(Opc, dl, VTL, MemVT, SrcVal, /*SVOffset=*/0, > - ? ? ? ? ? ? ? ?Align, /*isVolatile=*/true, /* OrigAlign=*/0) { > + ? ? ? ? ? ? ? ?Align, /*isVolatile=*/true) { > ? ? InitOperands(Ops, Chain, Ptr, Val); > ? } > > @@ -1653,8 +1653,7 @@ > ? ? ? ? ? ? ? ? ? ? ?const SDValue *Ops, unsigned NumOps, > ? ? ? ? ? ? ? ? ? ? ?EVT MemoryVT, const Value *srcValue, int SVO, > ? ? ? ? ? ? ? ? ? ? ?unsigned Align, bool Vol, bool ReadMem, bool WriteMem) > - ? ?: MemSDNode(Opc, dl, VTs, Ops, NumOps, MemoryVT, srcValue, SVO, Align, Vol, > - ? ? ? ? ? ? ? ?/* OrigAlign=*/0), > + ? ?: MemSDNode(Opc, dl, VTs, Ops, NumOps, MemoryVT, srcValue, SVO, Align, Vol), > ? ? ? ReadMem(ReadMem), WriteMem(WriteMem) { > ? } > > @@ -2269,9 +2268,8 @@ > ?public: > ? LSBaseSDNode(ISD::NodeType NodeTy, DebugLoc dl, SDValue *Operands, > ? ? ? ? ? ? ? ?unsigned numOperands, SDVTList VTs, ISD::MemIndexedMode AM, > - ? ? ? ? ? ? ? EVT VT, const Value *SV, int SVO, unsigned Align, bool Vol, > - ? ? ? ? ? ? ? unsigned OAlign) > - ? ?: MemSDNode(NodeTy, dl, VTs, VT, SV, SVO, Align, Vol, OAlign) { > + ? ? ? ? ? ? ? EVT VT, const Value *SV, int SVO, unsigned Align, bool Vol) > + ? ?: MemSDNode(NodeTy, dl, VTs, VT, SV, SVO, Align, Vol) { > ? ? assert(Align != 0 && "Loads and stores should have non-zero aligment"); > ? ? SubclassData |= AM << 2; > ? ? assert(getAddressingMode() == AM && "MemIndexedMode encoding error!"); > @@ -2309,10 +2307,9 @@ > ? friend class SelectionDAG; > ? LoadSDNode(SDValue *ChainPtrOff, DebugLoc dl, SDVTList VTs, > ? ? ? ? ? ? ?ISD::MemIndexedMode AM, ISD::LoadExtType ETy, EVT LVT, > - ? ? ? ? ? ? const Value *SV, int O=0, unsigned Align=0, bool Vol=false, > - ? ? ? ? ? ? unsigned OAlign=0) > + ? ? ? ? ? ? const Value *SV, int O=0, unsigned Align=0, bool Vol=false) > ? ? : LSBaseSDNode(ISD::LOAD, dl, ChainPtrOff, 3, > - ? ? ? ? ? ? ? ? ? VTs, AM, LVT, SV, O, Align, Vol, OAlign) { > + ? ? ? ? ? ? ? ? ? VTs, AM, LVT, SV, O, Align, Vol) { > ? ? SubclassData |= (unsigned short)ETy; > ? ? assert(getExtensionType() == ETy && "LoadExtType encoding error!"); > ? } > @@ -2339,10 +2336,9 @@ > ? friend class SelectionDAG; > ? StoreSDNode(SDValue *ChainValuePtrOff, DebugLoc dl, SDVTList VTs, > ? ? ? ? ? ? ? ISD::MemIndexedMode AM, bool isTrunc, EVT SVT, > - ? ? ? ? ? ? ?const Value *SV, int O=0, unsigned Align=0, bool Vol=false, > - ? ? ? ? ? ? ?unsigned OAlign=0) > + ? ? ? ? ? ? ?const Value *SV, int O=0, unsigned Align=0, bool Vol=false) > ? ? : LSBaseSDNode(ISD::STORE, dl, ChainValuePtrOff, 4, > - ? ? ? ? ? ? ? ? ? VTs, AM, SVT, SV, O, Align, Vol, OAlign) { > + ? ? ? ? ? ? ? ? ? VTs, AM, SVT, SV, O, Align, Vol) { > ? ? SubclassData |= (unsigned short)isTrunc; > ? ? assert(isTruncatingStore() == isTrunc && "isTrunc encoding error!"); > ? } > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=81897&r1=81896&r2=81897&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Tue Sep 15 14:05:41 2009 > @@ -170,8 +170,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DAG.getUNDEF(N->getBasePtr().getValueType()), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?N->getSrcValue(), N->getSrcValueOffset(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?N->getMemoryVT().getVectorElementType(), > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? N->isVolatile(), N->getAlignment(), > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? N->getOriginalAlignment()); > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? N->isVolatile(), N->getOriginalAlignment()); > > ? // Legalized the chain result - switch anything that used the old chain to > ? // use the new one. > @@ -361,8 +360,7 @@ > > ? return DAG.getStore(N->getChain(), dl, GetScalarizedVector(N->getOperand(1)), > ? ? ? ? ? ? ? ? ? ? ? N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), > - ? ? ? ? ? ? ? ? ? ? ?N->isVolatile(), N->getAlignment(), > - ? ? ? ? ? ? ? ? ? ? ?N->getOriginalAlignment()); > + ? ? ? ? ? ? ? ? ? ? ?N->isVolatile(), N->getOriginalAlignment()); > ?} > > > @@ -716,23 +714,21 @@ > ? const Value *SV = LD->getSrcValue(); > ? int SVOffset = LD->getSrcValueOffset(); > ? EVT MemoryVT = LD->getMemoryVT(); > - ?unsigned Alignment = LD->getAlignment(); > - ?unsigned OrigAlignment = LD->getOriginalAlignment(); > + ?unsigned Alignment = LD->getOriginalAlignment(); > ? bool isVolatile = LD->isVolatile(); > > ? EVT LoMemVT, HiMemVT; > ? GetSplitDestVTs(MemoryVT, LoMemVT, HiMemVT); > > ? Lo = DAG.getLoad(ISD::UNINDEXED, dl, ExtType, LoVT, Ch, Ptr, Offset, > - ? ? ? ? ? ? ? ? ? SV, SVOffset, LoMemVT, isVolatile, Alignment, OrigAlignment); > + ? ? ? ? ? ? ? ? ? SV, SVOffset, LoMemVT, isVolatile, Alignment); > > ? unsigned IncrementSize = LoMemVT.getSizeInBits()/8; > ? Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, > ? ? ? ? ? ? ? ? ? ? DAG.getIntPtrConstant(IncrementSize)); > ? SVOffset += IncrementSize; > - ?Alignment = MinAlign(Alignment, IncrementSize); > ? Hi = DAG.getLoad(ISD::UNINDEXED, dl, ExtType, HiVT, Ch, Ptr, Offset, > - ? ? ? ? ? ? ? ? ? SV, SVOffset, HiMemVT, isVolatile, Alignment, OrigAlignment); > + ? ? ? ? ? ? ? ? ? SV, SVOffset, HiMemVT, isVolatile, Alignment); > > ? // Build a factor node to remember that this load is independent of the > ? // other one. > @@ -1081,8 +1077,7 @@ > ? SDValue Ptr = N->getBasePtr(); > ? int SVOffset = N->getSrcValueOffset(); > ? EVT MemoryVT = N->getMemoryVT(); > - ?unsigned Alignment = N->getAlignment(); > - ?unsigned OrigAlignment = N->getOriginalAlignment(); > + ?unsigned Alignment = N->getOriginalAlignment(); > ? bool isVol = N->isVolatile(); > ? SDValue Lo, Hi; > ? GetSplitVector(N->getOperand(1), Lo, Hi); > @@ -1097,21 +1092,19 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ?LoMemVT, isVol, Alignment); > ? else > ? ? Lo = DAG.getStore(Ch, dl, Lo, Ptr, N->getSrcValue(), SVOffset, > - ? ? ? ? ? ? ? ? ? ? ?isVol, Alignment, OrigAlignment); > + ? ? ? ? ? ? ? ? ? ? ?isVol, Alignment); > > ? // Increment the pointer to the other half. > ? Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, > ? ? ? ? ? ? ? ? ? ? DAG.getIntPtrConstant(IncrementSize)); > + ?SVOffset += IncrementSize; > > ? if (isTruncating) > - ? ?Hi = DAG.getTruncStore(Ch, dl, Hi, Ptr, > - ? ? ? ? ? ? ? ? ? ? ? ? ? N->getSrcValue(), SVOffset+IncrementSize, > - ? ? ? ? ? ? ? ? ? ? ? ? ? HiMemVT, > - ? ? ? ? ? ? ? ? ? ? ? ? ? isVol, MinAlign(Alignment, IncrementSize)); > + ? ?Hi = DAG.getTruncStore(Ch, dl, Hi, Ptr, N->getSrcValue(), SVOffset, > + ? ? ? ? ? ? ? ? ? ? ? ? ? HiMemVT, isVol, Alignment); > ? else > - ? ?Hi = DAG.getStore(Ch, dl, Hi, Ptr, N->getSrcValue(), SVOffset+IncrementSize, > - ? ? ? ? ? ? ? ? ? ? ?isVol, MinAlign(Alignment, IncrementSize), > - ? ? ? ? ? ? ? ? ? ? ?OrigAlignment); > + ? ?Hi = DAG.getStore(Ch, dl, Hi, Ptr, N->getSrcValue(), SVOffset, > + ? ? ? ? ? ? ? ? ? ? ?isVol, Alignment); > > ? return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Lo, Hi); > ?} > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=81897&r1=81896&r2=81897&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Sep 15 14:05:41 2009 > @@ -432,12 +432,14 @@ > ? ? const LoadSDNode *LD = cast(N); > ? ? ID.AddInteger(LD->getMemoryVT().getRawBits()); > ? ? ID.AddInteger(LD->getRawSubclassData()); > + ? ?ID.AddInteger(LD->getSrcValueOffset()); > ? ? break; > ? } > ? case ISD::STORE: { > ? ? const StoreSDNode *ST = cast(N); > ? ? ID.AddInteger(ST->getMemoryVT().getRawBits()); > ? ? ID.AddInteger(ST->getRawSubclassData()); > + ? ?ID.AddInteger(ST->getSrcValueOffset()); > ? ? break; > ? } > ? case ISD::ATOMIC_CMP_SWAP: > @@ -3646,12 +3648,9 @@ > ? ? ? ? ? ? ? ? ? ? ? ISD::LoadExtType ExtType, EVT VT, SDValue Chain, > ? ? ? ? ? ? ? ? ? ? ? SDValue Ptr, SDValue Offset, > ? ? ? ? ? ? ? ? ? ? ? const Value *SV, int SVOffset, EVT EVT, > - ? ? ? ? ? ? ? ? ? ? ?bool isVolatile, unsigned Alignment, > - ? ? ? ? ? ? ? ? ? ? ?unsigned OrigAlignment) { > + ? ? ? ? ? ? ? ? ? ? ?bool isVolatile, unsigned Alignment) { > ? if (Alignment == 0) ?// Ensure that codegen never sees alignment 0 > ? ? Alignment = getEVTAlignment(VT); > - ?if (OrigAlignment == 0) > - ? ?OrigAlignment = Alignment; > > ? if (VT == EVT) { > ? ? ExtType = ISD::NON_EXTLOAD; > @@ -3682,12 +3681,13 @@ > ? AddNodeIDNode(ID, ISD::LOAD, VTs, Ops, 3); > ? ID.AddInteger(EVT.getRawBits()); > ? ID.AddInteger(encodeMemSDNodeFlags(ExtType, AM, isVolatile, Alignment)); > + ?ID.AddInteger(SVOffset); > ? void *IP = 0; > ? if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) > ? ? return SDValue(E, 0); > ? SDNode *N = NodeAllocator.Allocate(); > ? new (N) LoadSDNode(Ops, dl, VTs, AM, ExtType, EVT, SV, SVOffset, > - ? ? ? ? ? ? ? ? ? ? Alignment, isVolatile, OrigAlignment); > + ? ? ? ? ? ? ? ? ? ? Alignment, isVolatile); > ? CSEMap.InsertNode(N, IP); > ? AllNodes.push_back(N); > ? return SDValue(N, 0); > @@ -3696,11 +3696,10 @@ > ?SDValue SelectionDAG::getLoad(EVT VT, DebugLoc dl, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SDValue Chain, SDValue Ptr, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? const Value *SV, int SVOffset, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?bool isVolatile, unsigned Alignment, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?unsigned OrigAlignment) { > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?bool isVolatile, unsigned Alignment) { > ? SDValue Undef = getUNDEF(Ptr.getValueType()); > ? return getLoad(ISD::UNINDEXED, dl, ISD::NON_EXTLOAD, VT, Chain, Ptr, Undef, > - ? ? ? ? ? ? ? ? SV, SVOffset, VT, isVolatile, Alignment, OrigAlignment); > + ? ? ? ? ? ? ? ? SV, SVOffset, VT, isVolatile, Alignment); > ?} > > ?SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT, > @@ -3727,14 +3726,11 @@ > > ?SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?SDValue Ptr, const Value *SV, int SVOffset, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bool isVolatile, unsigned Alignment, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned OrigAlignment) { > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bool isVolatile, unsigned Alignment) { > ? EVT VT = Val.getValueType(); > > ? if (Alignment == 0) ?// Ensure that codegen never sees alignment 0 > ? ? Alignment = getEVTAlignment(VT); > - ?if (OrigAlignment == 0) > - ? ?OrigAlignment = Alignment; > > ? SDVTList VTs = getVTList(MVT::Other); > ? SDValue Undef = getUNDEF(Ptr.getValueType()); > @@ -3744,12 +3740,13 @@ > ? ID.AddInteger(VT.getRawBits()); > ? ID.AddInteger(encodeMemSDNodeFlags(false, ISD::UNINDEXED, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?isVolatile, Alignment)); > + ?ID.AddInteger(SVOffset); > ? void *IP = 0; > ? if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) > ? ? return SDValue(E, 0); > ? SDNode *N = NodeAllocator.Allocate(); > ? new (N) StoreSDNode(Ops, dl, VTs, ISD::UNINDEXED, false, > - ? ? ? ? ? ? ? ? ? ? ?VT, SV, SVOffset, Alignment, isVolatile, OrigAlignment); > + ? ? ? ? ? ? ? ? ? ? ?VT, SV, SVOffset, Alignment, isVolatile); > ? CSEMap.InsertNode(N, IP); > ? AllNodes.push_back(N); > ? return SDValue(N, 0); > @@ -3779,6 +3776,7 @@ > ? ID.AddInteger(SVT.getRawBits()); > ? ID.AddInteger(encodeMemSDNodeFlags(true, ISD::UNINDEXED, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?isVolatile, Alignment)); > + ?ID.AddInteger(SVOffset); > ? void *IP = 0; > ? if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) > ? ? return SDValue(E, 0); > @@ -4976,25 +4974,24 @@ > > ?MemSDNode::MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, EVT memvt, > ? ? ? ? ? ? ? ? ? ? ?const Value *srcValue, int SVO, unsigned alignment, > - ? ? ? ? ? ? ? ? ? ? bool vol, unsigned origAlign) > - : SDNode(Opc, dl, VTs), MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO), > - ? OrigAlign(origAlign) { > + ? ? ? ? ? ? ? ? ? ? bool vol) > + : SDNode(Opc, dl, VTs), MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO) { > ? SubclassData = encodeMemSDNodeFlags(0, ISD::UNINDEXED, vol, alignment); > ? assert(isPowerOf2_32(alignment) && "Alignment is not a power of 2!"); > - ?assert(getAlignment() == alignment && "Alignment representation error!"); > - ?assert(isVolatile() == vol && "Volatile representation error!"); > + ?assert(getOriginalAlignment() == alignment && "Alignment encoding error!"); > + ?assert(isVolatile() == vol && "Volatile encoding error!"); > ?} > > ?MemSDNode::MemSDNode(unsigned Opc, DebugLoc dl, SDVTList VTs, > ? ? ? ? ? ? ? ? ? ? ?const SDValue *Ops, unsigned NumOps, EVT memvt, > ? ? ? ? ? ? ? ? ? ? ?const Value *srcValue, int SVO, unsigned alignment, > - ? ? ? ? ? ? ? ? ? ? bool vol, unsigned origAlign) > + ? ? ? ? ? ? ? ? ? ? bool vol) > ? ?: SDNode(Opc, dl, VTs, Ops, NumOps), > - ? ? MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO), OrigAlign(origAlign) { > + ? ? MemoryVT(memvt), SrcValue(srcValue), SVOffset(SVO) { > ? SubclassData = encodeMemSDNodeFlags(0, ISD::UNINDEXED, vol, alignment); > ? assert(isPowerOf2_32(alignment) && "Alignment is not a power of 2!"); > - ?assert(getAlignment() == alignment && "Alignment representation error!"); > - ?assert(isVolatile() == vol && "Volatile representation error!"); > + ?assert(getOriginalAlignment() == alignment && "Alignment encoding error!"); > + ?assert(isVolatile() == vol && "Volatile encoding error!"); > ?} > > ?/// getMemOperand - Return a MachineMemOperand object describing the memory > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=81897&r1=81896&r2=81897&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Tue Sep 15 14:05:41 2009 > @@ -2815,7 +2815,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? DAG.getNode(ISD::ADD, getCurDebugLoc(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PtrVT, Ptr, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DAG.getConstant(Offsets[i], PtrVT)), > - ? ? ? ? ? ? ? ? ? ? ? ? ? ?SV, Offsets[i], isVolatile, Alignment, Alignment); > + ? ? ? ? ? ? ? ? ? ? ? ? ? ?SV, Offsets[i], isVolatile, Alignment); > ? ? Values[i] = L; > ? ? Chains[i] = L.getValue(1); > ? } > @@ -2864,8 +2864,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DAG.getNode(ISD::ADD, getCurDebugLoc(), > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PtrVT, Ptr, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DAG.getConstant(Offsets[i], PtrVT)), > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? PtrV, Offsets[i], > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? isVolatile, Alignment, Alignment); > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? PtrV, Offsets[i], isVolatile, Alignment); > > ? DAG.setRoot(DAG.getNode(ISD::TokenFactor, getCurDebugLoc(), > ? ? ? ? ? ? ? ? ? ? ? ? ? MVT::Other, &Chains[0], NumValues)); > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From daniel at zuster.org Tue Sep 15 15:09:18 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 20:09:18 -0000 Subject: [llvm-commits] [llvm] r81902 - /llvm/trunk/utils/lit/lit.py Message-ID: <200909152009.n8FK9I9H032198@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 15 15:09:17 2009 New Revision: 81902 URL: http://llvm.org/viewvc/llvm-project?rev=81902&view=rev Log: lit: When finding nested test suites, check first in the execpath in case there is a site configuration. Modified: llvm/trunk/utils/lit/lit.py Modified: llvm/trunk/utils/lit/lit.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit.py?rev=81902&r1=81901&r2=81902&view=diff ============================================================================== --- llvm/trunk/utils/lit/lit.py (original) +++ llvm/trunk/utils/lit/lit.py Tue Sep 15 15:09:17 2009 @@ -264,19 +264,28 @@ if filename == 'Output' or filename in lc.excludes: continue - filepath = os.path.join(source_path, filename) - if os.path.isdir(filepath): - # If this directory contains a test suite, reload it. - if dirContainsTestSuite(filepath): - for res in getTests(filepath, litConfig, - testSuiteCache, localConfigCache): - yield res - else: - # Otherwise, continue loading from inside this test suite. - for res in getTestsInSuite(ts, path_in_suite + (filename,), - litConfig, testSuiteCache, - localConfigCache): - yield res + # Ignore non-directories. + file_sourcepath = os.path.join(source_path, filename) + if not os.path.isdir(file_sourcepath): + continue + + # Check for nested test suites, first in the execpath in case there is a + # site configuration and then in the source path. + file_execpath = ts.getExecPath(path_in_suite + (filename,)) + if dirContainsTestSuite(file_execpath): + subiter = getTests(file_execpath, litConfig, + testSuiteCache, localConfigCache) + elif dirContainsTestSuite(file_sourcepath): + subiter = getTests(file_sourcepath, litConfig, + testSuiteCache, localConfigCache) + else: + # Otherwise, continue loading from inside this test suite. + subiter = getTestsInSuite(ts, path_in_suite + (filename,), + litConfig, testSuiteCache, + localConfigCache) + + for res in subiter: + yield res def runTests(numThreads, litConfig, provider, display): # If only using one testing thread, don't use threads at all; this lets us From daniel at zuster.org Tue Sep 15 15:31:13 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 20:31:13 -0000 Subject: [llvm-commits] [llvm] r81909 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200909152031.n8FKVDtV002653@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 15 15:31:12 2009 New Revision: 81909 URL: http://llvm.org/viewvc/llvm-project?rev=81909&view=rev Log: Fix -Asserts warning. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=81909&r1=81908&r2=81909&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Sep 15 15:31:12 2009 @@ -637,13 +637,14 @@ return false; } - +#ifndef NDEBUG static void printRegName(unsigned reg, const TargetRegisterInfo* tri_) { if (TargetRegisterInfo::isPhysicalRegister(reg)) errs() << tri_->getName(reg); else errs() << "%reg" << reg; } +#endif void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, MachineBasicBlock::iterator mi, From daniel at zuster.org Tue Sep 15 15:31:28 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 20:31:28 -0000 Subject: [llvm-commits] [llvm] r81910 - in /llvm/trunk/docs/CommandGuide: llc.pod opt.pod Message-ID: <200909152031.n8FKVSjH002696@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 15 15:31:28 2009 New Revision: 81910 URL: http://llvm.org/viewvc/llvm-project?rev=81910&view=rev Log: Update llc/opt PODs to clarify they support .ll input. Modified: llvm/trunk/docs/CommandGuide/llc.pod llvm/trunk/docs/CommandGuide/opt.pod Modified: llvm/trunk/docs/CommandGuide/llc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llc.pod?rev=81910&r1=81909&r2=81910&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llc.pod (original) +++ llvm/trunk/docs/CommandGuide/llc.pod Tue Sep 15 15:31:28 2009 @@ -10,18 +10,19 @@ =head1 DESCRIPTION -The B command compiles LLVM bitcode into assembly language for a +The B command compiles LLVM source inputs into assembly language for a specified architecture. The assembly language output can then be passed through a native assembler and linker to generate a native executable. The choice of architecture for the output assembly code is automatically -determined from the input bitcode file, unless the B<-march> option is used to -override the default. +determined from the input file, unless the B<-march> option is used to override +the default. =head1 OPTIONS -If I is - or omitted, B reads LLVM bitcode from standard input. -Otherwise, it will read LLVM bitcode from I. +If I is - or omitted, B reads from standard input. Otherwise, it +will from I. Inputs can be in either the LLVM assembly language +format (.ll) or the LLVM bitcode format (.bc). If the B<-o> option is omitted, then B will send its output to standard output if the input is from standard input. If the B<-o> option specifies -, @@ -55,13 +56,13 @@ =item B<-mtriple>=I -Override the target triple specified in the input bitcode file with the -specified string. +Override the target triple specified in the input file with the specified +string. =item B<-march>=I Specify the architecture for which to generate assembly, overriding the target -encoded in the bitcode file. See the output of B for a list of +encoded in the input file. See the output of B for a list of valid architectures. By default this is inferred from the target triple or autodetected to the current architecture. Modified: llvm/trunk/docs/CommandGuide/opt.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/opt.pod?rev=81910&r1=81909&r2=81910&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/opt.pod (original) +++ llvm/trunk/docs/CommandGuide/opt.pod Tue Sep 15 15:31:28 2009 @@ -11,24 +11,25 @@ =head1 DESCRIPTION The B command is the modular LLVM optimizer and analyzer. It takes LLVM -bitcode as input, runs the specified optimizations or analyses on it, and then -outputs the optimized LLVM bitcode or the analysis results. The function of +source files as input, runs the specified optimizations or analyses on it, and then +outputs the optimized file or the analysis results. The function of B depends on whether the B<-analyze> option is given. -When B<-analyze> is specified, B performs various analyses of LLVM -bitcode. It will usually print the results on standard output, but in a few -cases, it will print output to standard error or generate a file with the -analysis output, which is usually done when the output is meant for another -program. +When B<-analyze> is specified, B performs various analyses of the input +source. It will usually print the results on standard output, but in a few +cases, it will print output to standard error or generate a file with the +analysis output, which is usually done when the output is meant for another +program. While B<-analyze> is I given, B attempts to produce an optimized -bitcode file. The optimizations available via B depend upon what +output file. The optimizations available via B depend upon what libraries were linked into it as well as any additional libraries that have been loaded with the B<-load> option. Use the B<-help> option to determine what optimizations you can use. If I is omitted from the command line or is I<->, B reads its -input from standard input. The input must be an LLVM bitcode file. +input from standard input. Inputs can be in either the LLVM assembly language +format (.ll) or the LLVM bitcode format (.bc). If an output filename is not specified with the B<-o> option, B writes its output to the standard output. From daniel at zuster.org Tue Sep 15 15:31:35 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 20:31:35 -0000 Subject: [llvm-commits] [llvm] r81911 - in /llvm/trunk/docs/CommandGuide: llc.pod opt.pod Message-ID: <200909152031.n8FKVZ4C002735@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 15 15:31:35 2009 New Revision: 81911 URL: http://llvm.org/viewvc/llvm-project?rev=81911&view=rev Log: Remove references to obsolete -f option. Modified: llvm/trunk/docs/CommandGuide/llc.pod llvm/trunk/docs/CommandGuide/opt.pod Modified: llvm/trunk/docs/CommandGuide/llc.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llc.pod?rev=81911&r1=81910&r2=81911&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llc.pod (original) +++ llvm/trunk/docs/CommandGuide/llc.pod Tue Sep 15 15:31:35 2009 @@ -48,12 +48,6 @@ I<-O1>, I<-O2>, I<-O3>, and I<-O4> optimization levels used by B and B. -=item B<-f> - -Enable binary output on terminals. Normally, B will refuse to -write raw bitcode output if the output stream is a terminal. With this option, -B will write raw bitcode regardless of the output device. - =item B<-mtriple>=I Override the target triple specified in the input file with the specified Modified: llvm/trunk/docs/CommandGuide/opt.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/opt.pod?rev=81911&r1=81910&r2=81911&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/opt.pod (original) +++ llvm/trunk/docs/CommandGuide/opt.pod Tue Sep 15 15:31:35 2009 @@ -38,12 +38,6 @@ =over -=item B<-f> - -Enable binary output on terminals. Normally, B will refuse to -write raw bitcode output if the output stream is a terminal. With this option, -B will write raw bitcode regardless of the output device. - =item B<-help> Print a summary of command line options. From daniel at zuster.org Tue Sep 15 15:31:46 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 20:31:46 -0000 Subject: [llvm-commits] [llvm] r81912 - in /llvm/trunk: include/llvm/Support/raw_ostream.h lib/Support/raw_ostream.cpp unittests/Support/raw_ostream_test.cpp Message-ID: <200909152031.n8FKVkYL002778@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 15 15:31:46 2009 New Revision: 81912 URL: http://llvm.org/viewvc/llvm-project?rev=81912&view=rev Log: Drop the raw_ostream required buffer size to 1. - As best I can tell, we have eliminated all the code which used to require a larger buffer size. Modified: llvm/trunk/include/llvm/Support/raw_ostream.h llvm/trunk/lib/Support/raw_ostream.cpp llvm/trunk/unittests/Support/raw_ostream_test.cpp Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=81912&r1=81911&r2=81912&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Tue Sep 15 15:31:46 2009 @@ -41,7 +41,7 @@ /// 1. Unbuffered (BufferMode == Unbuffered) /// 1. Uninitialized (BufferMode != Unbuffered && OutBufStart == 0). /// 2. Buffered (BufferMode != Unbuffered && OutBufStart != 0 && - /// OutBufEnd - OutBufStart >= 64). + /// OutBufEnd - OutBufStart >= 1). /// /// If buffered, then the raw_ostream owns the buffer if (BufferMode == /// InternalBuffer); otherwise the buffer has been set via SetBuffer and is Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=81912&r1=81911&r2=81912&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Tue Sep 15 15:31:46 2009 @@ -84,8 +84,8 @@ void raw_ostream::SetBufferAndMode(char *BufferStart, size_t Size, BufferKind Mode) { assert(((Mode == Unbuffered && BufferStart == 0 && Size == 0) || - (Mode != Unbuffered && BufferStart && Size >= 64)) && - "stream must be unbuffered, or have >= 64 bytes of buffer"); + (Mode != Unbuffered && BufferStart && Size)) && + "stream must be unbuffered or have at least one byte"); // Make sure the current buffer is free of content (we can't flush here; the // child buffer management logic will be in write_impl). assert(GetNumBytesInBuffer() == 0 && "Current buffer is non-empty!"); Modified: llvm/trunk/unittests/Support/raw_ostream_test.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/raw_ostream_test.cpp?rev=81912&r1=81911&r2=81912&view=diff ============================================================================== --- llvm/trunk/unittests/Support/raw_ostream_test.cpp (original) +++ llvm/trunk/unittests/Support/raw_ostream_test.cpp Tue Sep 15 15:31:46 2009 @@ -117,4 +117,14 @@ EXPECT_EQ("1.20", printToString(format("%.2f", 1.2), 10)); } +TEST(raw_ostreamTest, TinyBuffer) { + std::string Str; + raw_string_ostream OS(Str); + OS.SetBufferSize(1); + OS << "hello"; + OS << 1; + OS << 'w' << 'o' << 'r' << 'l' << 'd'; + EXPECT_EQ("hello1world", OS.str()); +} + } From vhernandez at apple.com Tue Sep 15 15:38:04 2009 From: vhernandez at apple.com (Victor Hernandez) Date: Tue, 15 Sep 2009 13:38:04 -0700 Subject: [llvm-commits] [PATCH] get all MallocInst transforms/analysis to operate on malloc calls instead (patch #1) Message-ID: <0DCE4E98-5D92-4748-A804-B1EBBA14A240@apple.com> This is the first of 4 patches that will result in malloc calls having the same transforms/analysis applied to them as are currently done to MallocInst. This first patch includes changes to the malloc call creation code (AllocTy is now the element type of the malloc, not the resulting pointer type) and a bug fix to getMallocArraySize (the case where the array size is a product of 2 constants was broken). Also included are changes isSafeToSpeculativelyExecute() and Verifier to treat malloc calls the same as MallocInst. -------------- next part -------------- A non-text attachment was scrubbed... Name: MallocCalls.diff Type: application/octet-stream Size: 12938 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090915/cd11305f/attachment.obj -------------- next part -------------- Victor From gohman at apple.com Tue Sep 15 15:40:52 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Sep 2009 13:40:52 -0700 Subject: [llvm-commits] [llvm] r81911 - in /llvm/trunk/docs/CommandGuide: llc.pod opt.pod In-Reply-To: <200909152031.n8FKVZ4C002735@zion.cs.uiuc.edu> References: <200909152031.n8FKVZ4C002735@zion.cs.uiuc.edu> Message-ID: <7BED6F84-135F-4226-87D8-B326C8005233@apple.com> On Sep 15, 2009, at 1:31 PM, Daniel Dunbar wrote: > Author: ddunbar > Date: Tue Sep 15 15:31:35 2009 > New Revision: 81911 > > URL: http://llvm.org/viewvc/llvm-project?rev=81911&view=rev > Log: > Remove references to obsolete -f option. Hi Danial, the -f option isn't completely obsolete. It's been reduced to meaning "don't suppress binary output to a tty", which is a small part of its original meaning, but at the moment it still does mean that. Dan From vhernandez at apple.com Tue Sep 15 15:44:08 2009 From: vhernandez at apple.com (Victor Hernandez) Date: Tue, 15 Sep 2009 13:44:08 -0700 Subject: [llvm-commits] [PATCH] extend transform passes to treat malloc calls the same as MallocInst (patch #3) Message-ID: <099A54D1-9659-4DB1-B64C-6AF8AB805D84@apple.com> These are the changes to make all the transform passes apply the same analysis to malloc calls as to MallocInst. -------------- next part -------------- A non-text attachment was scrubbed... Name: MallocTransforms.diff Type: application/octet-stream Size: 35205 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090915/31b0b38f/attachment.obj -------------- next part -------------- Victor From vhernandez at apple.com Tue Sep 15 15:44:11 2009 From: vhernandez at apple.com (Victor Hernandez) Date: Tue, 15 Sep 2009 13:44:11 -0700 Subject: [llvm-commits] [PATCH] extend SelectionDAGBuild to treat malloc calls the same as MallocInst (patch #4) Message-ID: <05892D6F-5D3B-45FD-8FA0-82EB6A686B63@apple.com> SelectionDAGBuild is the only pass in CodeGen that handles MallocInst specially. This patch extends that code to handle malloc calls also. -------------- next part -------------- A non-text attachment was scrubbed... Name: MallocCodeGen.diff Type: application/octet-stream Size: 3506 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090915/4846380b/attachment.obj -------------- next part -------------- Victor From vhernandez at apple.com Tue Sep 15 15:44:04 2009 From: vhernandez at apple.com (Victor Hernandez) Date: Tue, 15 Sep 2009 13:44:04 -0700 Subject: [llvm-commits] [PATCH] extend analysis passes to treat malloc calls the same as MallocInst (patch #2) Message-ID: <13429790-6CCE-4644-A1EE-A554440F22E7@apple.com> These are the changes to make all the analysis passes apply the same analysis to malloc calls as to MallocInst. -------------- next part -------------- A non-text attachment was scrubbed... Name: MallocAnalysis.diff Type: application/octet-stream Size: 10518 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090915/0f2fc301/attachment.obj -------------- next part -------------- Victor From scallanan at apple.com Tue Sep 15 15:53:57 2009 From: scallanan at apple.com (Sean Callanan) Date: Tue, 15 Sep 2009 20:53:57 -0000 Subject: [llvm-commits] [llvm] r81914 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td Message-ID: <200909152053.n8FKrvNT005736@zion.cs.uiuc.edu> Author: spyffe Date: Tue Sep 15 15:53:57 2009 New Revision: 81914 URL: http://llvm.org/viewvc/llvm-project?rev=81914&view=rev Log: Added register-to-register ADD instructions to the Intel tables, where the source operand is specified by the R/M field and the destination operand by the Reg field. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=81914&r1=81913&r2=81914&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Sep 15 15:53:57 2009 @@ -457,6 +457,11 @@ "add{q}\t{$src2, $dst|$dst, $src2}", [(set GR64:$dst, (add GR64:$src1, (load addr:$src2))), (implicit EFLAGS)]>; + +// Register-Register Addition +def ADD64mrmrr : RI<0x03, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2), + "add{l}\t{$src2, $dst|$dst, $src2}", []>; + } // isTwoAddress // Memory-Register Addition Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=81914&r1=81913&r2=81914&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Sep 15 15:53:57 2009 @@ -2427,6 +2427,14 @@ "add{l}\t{$src2, $dst|$dst, $src2}", [(set GR32:$dst, (add GR32:$src1, (load addr:$src2))), (implicit EFLAGS)]>; + +// Register-Register Addition +def ADD8mrmrr: I<0x02, MRMSrcReg, (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + "add{b}\t{$src2, $dst|$dst, $src2}", []>; +def ADD16mrmrr: I<0x03, MRMSrcReg,(outs GR16:$dst),(ins GR16:$src1, GR16:$src2), + "add{w}\t{$src2, $dst|$dst, $src2}", []>, OpSize; +def ADD32mrmrr: I<0x03, MRMSrcReg,(outs GR16:$dst),(ins GR16:$src1, GR16:$src2), + "add{l}\t{$src2, $dst|$dst, $src2}", []>; // Register-Integer Addition def ADD8ri : Ii8<0x80, MRM0r, (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), From bob.wilson at apple.com Tue Sep 15 15:58:03 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 15 Sep 2009 20:58:03 -0000 Subject: [llvm-commits] [llvm] r81915 - in /llvm/trunk/test/CodeGen/ARM: veor.ll vfcmp.ll vfp.ll vget_lane.ll vhadd.ll vhsub.ll Message-ID: <200909152058.n8FKw3SG006287@zion.cs.uiuc.edu> Author: bwilson Date: Tue Sep 15 15:58:02 2009 New Revision: 81915 URL: http://llvm.org/viewvc/llvm-project?rev=81915&view=rev Log: Convert more tests to FileCheck. Modified: llvm/trunk/test/CodeGen/ARM/veor.ll llvm/trunk/test/CodeGen/ARM/vfcmp.ll llvm/trunk/test/CodeGen/ARM/vfp.ll llvm/trunk/test/CodeGen/ARM/vget_lane.ll llvm/trunk/test/CodeGen/ARM/vhadd.ll llvm/trunk/test/CodeGen/ARM/vhsub.ll Modified: llvm/trunk/test/CodeGen/ARM/veor.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/veor.ll?rev=81915&r1=81914&r2=81915&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/veor.ll (original) +++ llvm/trunk/test/CodeGen/ARM/veor.ll Tue Sep 15 15:58:02 2009 @@ -1,8 +1,8 @@ -; RUN: llc < %s -march=arm -mattr=+neon > %t -; RUN: grep veor %t | count 8 -; Note: function names do not include "veor" to allow simple grep for opcodes +; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s define <8 x i8> @v_eori8(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: v_eori8: +;CHECK: veor %tmp1 = load <8 x i8>* %A %tmp2 = load <8 x i8>* %B %tmp3 = xor <8 x i8> %tmp1, %tmp2 @@ -10,6 +10,8 @@ } define <4 x i16> @v_eori16(<4 x i16>* %A, <4 x i16>* %B) nounwind { +;CHECK: v_eori16: +;CHECK: veor %tmp1 = load <4 x i16>* %A %tmp2 = load <4 x i16>* %B %tmp3 = xor <4 x i16> %tmp1, %tmp2 @@ -17,6 +19,8 @@ } define <2 x i32> @v_eori32(<2 x i32>* %A, <2 x i32>* %B) nounwind { +;CHECK: v_eori32: +;CHECK: veor %tmp1 = load <2 x i32>* %A %tmp2 = load <2 x i32>* %B %tmp3 = xor <2 x i32> %tmp1, %tmp2 @@ -24,6 +28,8 @@ } define <1 x i64> @v_eori64(<1 x i64>* %A, <1 x i64>* %B) nounwind { +;CHECK: v_eori64: +;CHECK: veor %tmp1 = load <1 x i64>* %A %tmp2 = load <1 x i64>* %B %tmp3 = xor <1 x i64> %tmp1, %tmp2 @@ -31,6 +37,8 @@ } define <16 x i8> @v_eorQi8(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK: v_eorQi8: +;CHECK: veor %tmp1 = load <16 x i8>* %A %tmp2 = load <16 x i8>* %B %tmp3 = xor <16 x i8> %tmp1, %tmp2 @@ -38,6 +46,8 @@ } define <8 x i16> @v_eorQi16(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK: v_eorQi16: +;CHECK: veor %tmp1 = load <8 x i16>* %A %tmp2 = load <8 x i16>* %B %tmp3 = xor <8 x i16> %tmp1, %tmp2 @@ -45,6 +55,8 @@ } define <4 x i32> @v_eorQi32(<4 x i32>* %A, <4 x i32>* %B) nounwind { +;CHECK: v_eorQi32: +;CHECK: veor %tmp1 = load <4 x i32>* %A %tmp2 = load <4 x i32>* %B %tmp3 = xor <4 x i32> %tmp1, %tmp2 @@ -52,6 +64,8 @@ } define <2 x i64> @v_eorQi64(<2 x i64>* %A, <2 x i64>* %B) nounwind { +;CHECK: v_eorQi64: +;CHECK: veor %tmp1 = load <2 x i64>* %A %tmp2 = load <2 x i64>* %B %tmp3 = xor <2 x i64> %tmp1, %tmp2 Modified: llvm/trunk/test/CodeGen/ARM/vfcmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vfcmp.ll?rev=81915&r1=81914&r2=81915&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vfcmp.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vfcmp.ll Tue Sep 15 15:58:02 2009 @@ -1,14 +1,12 @@ -; RUN: llc < %s -march=arm -mattr=+neon > %t -; RUN: grep {vceq\\.f32} %t | count 1 -; RUN: grep {vcgt\\.f32} %t | count 9 -; RUN: grep {vcge\\.f32} %t | count 5 -; RUN: grep vorr %t | count 4 -; RUN: grep vmvn %t | count 7 +; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s ; This tests fcmp operations that do not map directly to NEON instructions. ; une is implemented with VCEQ/VMVN define <2 x i32> @vcunef32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcunef32: +;CHECK: vceq.f32 +;CHECK-NEXT: vmvn %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp une <2 x float> %tmp1, %tmp2 @@ -18,6 +16,8 @@ ; olt is implemented with VCGT define <2 x i32> @vcoltf32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcoltf32: +;CHECK: vcgt.f32 %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp olt <2 x float> %tmp1, %tmp2 @@ -27,6 +27,8 @@ ; ole is implemented with VCGE define <2 x i32> @vcolef32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcolef32: +;CHECK: vcge.f32 %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp ole <2 x float> %tmp1, %tmp2 @@ -36,6 +38,9 @@ ; uge is implemented with VCGT/VMVN define <2 x i32> @vcugef32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcugef32: +;CHECK: vcgt.f32 +;CHECK-NEXT: vmvn %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp uge <2 x float> %tmp1, %tmp2 @@ -45,6 +50,9 @@ ; ule is implemented with VCGT/VMVN define <2 x i32> @vculef32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vculef32: +;CHECK: vcgt.f32 +;CHECK-NEXT: vmvn %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp ule <2 x float> %tmp1, %tmp2 @@ -54,6 +62,9 @@ ; ugt is implemented with VCGE/VMVN define <2 x i32> @vcugtf32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcugtf32: +;CHECK: vcge.f32 +;CHECK-NEXT: vmvn %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp ugt <2 x float> %tmp1, %tmp2 @@ -63,6 +74,9 @@ ; ult is implemented with VCGE/VMVN define <2 x i32> @vcultf32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcultf32: +;CHECK: vcge.f32 +;CHECK-NEXT: vmvn %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp ult <2 x float> %tmp1, %tmp2 @@ -72,6 +86,11 @@ ; ueq is implemented with VCGT/VCGT/VORR/VMVN define <2 x i32> @vcueqf32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcueqf32: +;CHECK: vcgt.f32 +;CHECK-NEXT: vcgt.f32 +;CHECK-NEXT: vorr +;CHECK-NEXT: vmvn %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp ueq <2 x float> %tmp1, %tmp2 @@ -81,6 +100,10 @@ ; one is implemented with VCGT/VCGT/VORR define <2 x i32> @vconef32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vconef32: +;CHECK: vcgt.f32 +;CHECK-NEXT: vcgt.f32 +;CHECK-NEXT: vorr %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp one <2 x float> %tmp1, %tmp2 @@ -90,6 +113,11 @@ ; uno is implemented with VCGT/VCGE/VORR/VMVN define <2 x i32> @vcunof32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcunof32: +;CHECK: vcge.f32 +;CHECK-NEXT: vcgt.f32 +;CHECK-NEXT: vorr +;CHECK-NEXT: vmvn %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp uno <2 x float> %tmp1, %tmp2 @@ -99,6 +127,10 @@ ; ord is implemented with VCGT/VCGE/VORR define <2 x i32> @vcordf32(<2 x float>* %A, <2 x float>* %B) nounwind { +;CHECK: vcordf32: +;CHECK: vcge.f32 +;CHECK-NEXT: vcgt.f32 +;CHECK-NEXT: vorr %tmp1 = load <2 x float>* %A %tmp2 = load <2 x float>* %B %tmp3 = fcmp ord <2 x float> %tmp1, %tmp2 Modified: llvm/trunk/test/CodeGen/ARM/vfp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vfp.ll?rev=81915&r1=81914&r2=81915&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vfp.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vfp.ll Tue Sep 15 15:58:02 2009 @@ -1,19 +1,4 @@ -; RUN: llc < %s -march=arm -mattr=+vfp2 | \ -; RUN: grep fabs | count 2 -; RUN: llc < %s -march=arm -mattr=+vfp2 | \ -; RUN: grep fmscs | count 1 -; RUN: llc < %s -march=arm -mattr=+vfp2 | \ -; RUN: grep fcvt | count 2 -; RUN: llc < %s -march=arm -mattr=+vfp2 | \ -; RUN: grep fuito | count 2 -; RUN: llc < %s -march=arm -mattr=+vfp2 | \ -; RUN: grep fto.i | count 4 -; RUN: llc < %s -march=arm -mattr=+vfp2 | \ -; RUN: grep bmi | count 1 -; RUN: llc < %s -march=arm -mattr=+vfp2 | \ -; RUN: grep bgt | count 1 -; RUN: llc < %s -march=arm -mattr=+vfp2 | \ -; RUN: grep fcmpezs | count 1 +; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s define void @test(float* %P, double* %D) { %A = load float* %P ; [#uses=1] @@ -28,16 +13,20 @@ declare double @fabs(double) define void @test_abs(float* %P, double* %D) { +;CHECK: test_abs: %a = load float* %P ; [#uses=1] +;CHECK: fabss %b = call float @fabsf( float %a ) ; [#uses=1] store float %b, float* %P %A = load double* %D ; [#uses=1] +;CHECK: fabsd %B = call double @fabs( double %A ) ; [#uses=1] store double %B, double* %D ret void } define void @test_add(float* %P, double* %D) { +;CHECK: test_add: %a = load float* %P ; [#uses=2] %b = fadd float %a, %a ; [#uses=1] store float %b, float* %P @@ -48,9 +37,12 @@ } define void @test_ext_round(float* %P, double* %D) { +;CHECK: test_ext_round: %a = load float* %P ; [#uses=1] +;CHECK: fcvtds %b = fpext float %a to double ; [#uses=1] %A = load double* %D ; [#uses=1] +;CHECK: fcvtsd %B = fptrunc double %A to float ; [#uses=1] store double %b, double* %D store float %B, float* %P @@ -58,9 +50,11 @@ } define void @test_fma(float* %P1, float* %P2, float* %P3) { +;CHECK: test_fma: %a1 = load float* %P1 ; [#uses=1] %a2 = load float* %P2 ; [#uses=1] %a3 = load float* %P3 ; [#uses=1] +;CHECK: fmscs %X = fmul float %a1, %a2 ; [#uses=1] %Y = fsub float %X, %a3 ; [#uses=1] store float %Y, float* %P1 @@ -68,42 +62,55 @@ } define i32 @test_ftoi(float* %P1) { +;CHECK: test_ftoi: %a1 = load float* %P1 ; [#uses=1] +;CHECK: ftosizs %b1 = fptosi float %a1 to i32 ; [#uses=1] ret i32 %b1 } define i32 @test_ftou(float* %P1) { +;CHECK: test_ftou: %a1 = load float* %P1 ; [#uses=1] +;CHECK: ftouizs %b1 = fptoui float %a1 to i32 ; [#uses=1] ret i32 %b1 } define i32 @test_dtoi(double* %P1) { +;CHECK: test_dtoi: %a1 = load double* %P1 ; [#uses=1] +;CHECK: ftosizd %b1 = fptosi double %a1 to i32 ; [#uses=1] ret i32 %b1 } define i32 @test_dtou(double* %P1) { +;CHECK: test_dtou: %a1 = load double* %P1 ; [#uses=1] +;CHECK: ftouizd %b1 = fptoui double %a1 to i32 ; [#uses=1] ret i32 %b1 } define void @test_utod(double* %P1, i32 %X) { +;CHECK: test_utod: +;CHECK: fuitod %b1 = uitofp i32 %X to double ; [#uses=1] store double %b1, double* %P1 ret void } define void @test_utod2(double* %P1, i8 %X) { +;CHECK: test_utod2: +;CHECK: fuitod %b1 = uitofp i8 %X to double ; [#uses=1] store double %b1, double* %P1 ret void } define void @test_cmp(float* %glob, i32 %X) { +;CHECK: test_cmp: entry: %tmp = load float* %glob ; [#uses=2] %tmp3 = getelementptr float* %glob, i32 2 ; [#uses=1] @@ -111,6 +118,8 @@ %tmp.upgrd.1 = fcmp oeq float %tmp, %tmp4 ; [#uses=1] %tmp5 = fcmp uno float %tmp, %tmp4 ; [#uses=1] %tmp6 = or i1 %tmp.upgrd.1, %tmp5 ; [#uses=1] +;CHECK: bmi +;CHECK-NEXT: bgt br i1 %tmp6, label %cond_true, label %cond_false cond_true: ; preds = %entry @@ -129,8 +138,10 @@ declare i32 @baz(...) define void @test_cmpfp0(float* %glob, i32 %X) { +;CHECK: test_cmpfp0: entry: %tmp = load float* %glob ; [#uses=1] +;CHECK: fcmpezs %tmp.upgrd.3 = fcmp ogt float %tmp, 0.000000e+00 ; [#uses=1] br i1 %tmp.upgrd.3, label %cond_true, label %cond_false Modified: llvm/trunk/test/CodeGen/ARM/vget_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vget_lane.ll?rev=81915&r1=81914&r2=81915&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vget_lane.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vget_lane.ll Tue Sep 15 15:58:02 2009 @@ -1,11 +1,8 @@ -; RUN: llc < %s -march=arm -mattr=+neon > %t -; RUN: grep {vmov\\.s8} %t | count 2 -; RUN: grep {vmov\\.s16} %t | count 2 -; RUN: grep {vmov\\.u8} %t | count 2 -; RUN: grep {vmov\\.u16} %t | count 2 -; RUN: grep {vmov\\.32} %t | count 2 +; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s define i32 @vget_lanes8(<8 x i8>* %A) nounwind { +;CHECK: vget_lanes8: +;CHECK: vmov.s8 %tmp1 = load <8 x i8>* %A %tmp2 = extractelement <8 x i8> %tmp1, i32 1 %tmp3 = sext i8 %tmp2 to i32 @@ -13,6 +10,8 @@ } define i32 @vget_lanes16(<4 x i16>* %A) nounwind { +;CHECK: vget_lanes16: +;CHECK: vmov.s16 %tmp1 = load <4 x i16>* %A %tmp2 = extractelement <4 x i16> %tmp1, i32 1 %tmp3 = sext i16 %tmp2 to i32 @@ -20,6 +19,8 @@ } define i32 @vget_laneu8(<8 x i8>* %A) nounwind { +;CHECK: vget_laneu8: +;CHECK: vmov.u8 %tmp1 = load <8 x i8>* %A %tmp2 = extractelement <8 x i8> %tmp1, i32 1 %tmp3 = zext i8 %tmp2 to i32 @@ -27,6 +28,8 @@ } define i32 @vget_laneu16(<4 x i16>* %A) nounwind { +;CHECK: vget_laneu16: +;CHECK: vmov.u16 %tmp1 = load <4 x i16>* %A %tmp2 = extractelement <4 x i16> %tmp1, i32 1 %tmp3 = zext i16 %tmp2 to i32 @@ -35,6 +38,8 @@ ; Do a vector add to keep the extraction from being done directly from memory. define i32 @vget_lanei32(<2 x i32>* %A) nounwind { +;CHECK: vget_lanei32: +;CHECK: vmov.32 %tmp1 = load <2 x i32>* %A %tmp2 = add <2 x i32> %tmp1, %tmp1 %tmp3 = extractelement <2 x i32> %tmp2, i32 1 @@ -42,6 +47,8 @@ } define i32 @vgetQ_lanes8(<16 x i8>* %A) nounwind { +;CHECK: vgetQ_lanes8: +;CHECK: vmov.s8 %tmp1 = load <16 x i8>* %A %tmp2 = extractelement <16 x i8> %tmp1, i32 1 %tmp3 = sext i8 %tmp2 to i32 @@ -49,6 +56,8 @@ } define i32 @vgetQ_lanes16(<8 x i16>* %A) nounwind { +;CHECK: vgetQ_lanes16: +;CHECK: vmov.s16 %tmp1 = load <8 x i16>* %A %tmp2 = extractelement <8 x i16> %tmp1, i32 1 %tmp3 = sext i16 %tmp2 to i32 @@ -56,6 +65,8 @@ } define i32 @vgetQ_laneu8(<16 x i8>* %A) nounwind { +;CHECK: vgetQ_laneu8: +;CHECK: vmov.u8 %tmp1 = load <16 x i8>* %A %tmp2 = extractelement <16 x i8> %tmp1, i32 1 %tmp3 = zext i8 %tmp2 to i32 @@ -63,6 +74,8 @@ } define i32 @vgetQ_laneu16(<8 x i16>* %A) nounwind { +;CHECK: vgetQ_laneu16: +;CHECK: vmov.u16 %tmp1 = load <8 x i16>* %A %tmp2 = extractelement <8 x i16> %tmp1, i32 1 %tmp3 = zext i16 %tmp2 to i32 @@ -71,6 +84,8 @@ ; Do a vector add to keep the extraction from being done directly from memory. define i32 @vgetQ_lanei32(<4 x i32>* %A) nounwind { +;CHECK: vgetQ_lanei32: +;CHECK: vmov.32 %tmp1 = load <4 x i32>* %A %tmp2 = add <4 x i32> %tmp1, %tmp1 %tmp3 = extractelement <4 x i32> %tmp2, i32 1 Modified: llvm/trunk/test/CodeGen/ARM/vhadd.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vhadd.ll?rev=81915&r1=81914&r2=81915&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vhadd.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vhadd.ll Tue Sep 15 15:58:02 2009 @@ -1,12 +1,8 @@ -; RUN: llc < %s -march=arm -mattr=+neon > %t -; RUN: grep {vhadd\\.s8} %t | count 2 -; RUN: grep {vhadd\\.s16} %t | count 2 -; RUN: grep {vhadd\\.s32} %t | count 2 -; RUN: grep {vhadd\\.u8} %t | count 2 -; RUN: grep {vhadd\\.u16} %t | count 2 -; RUN: grep {vhadd\\.u32} %t | count 2 +; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s define <8 x i8> @vhadds8(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: vhadds8: +;CHECK: vhadd.s8 %tmp1 = load <8 x i8>* %A %tmp2 = load <8 x i8>* %B %tmp3 = call <8 x i8> @llvm.arm.neon.vhadds.v8i8(<8 x i8> %tmp1, <8 x i8> %tmp2) @@ -14,6 +10,8 @@ } define <4 x i16> @vhadds16(<4 x i16>* %A, <4 x i16>* %B) nounwind { +;CHECK: vhadds16: +;CHECK: vhadd.s16 %tmp1 = load <4 x i16>* %A %tmp2 = load <4 x i16>* %B %tmp3 = call <4 x i16> @llvm.arm.neon.vhadds.v4i16(<4 x i16> %tmp1, <4 x i16> %tmp2) @@ -21,6 +19,8 @@ } define <2 x i32> @vhadds32(<2 x i32>* %A, <2 x i32>* %B) nounwind { +;CHECK: vhadds32: +;CHECK: vhadd.s32 %tmp1 = load <2 x i32>* %A %tmp2 = load <2 x i32>* %B %tmp3 = call <2 x i32> @llvm.arm.neon.vhadds.v2i32(<2 x i32> %tmp1, <2 x i32> %tmp2) @@ -28,6 +28,8 @@ } define <8 x i8> @vhaddu8(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: vhaddu8: +;CHECK: vhadd.u8 %tmp1 = load <8 x i8>* %A %tmp2 = load <8 x i8>* %B %tmp3 = call <8 x i8> @llvm.arm.neon.vhaddu.v8i8(<8 x i8> %tmp1, <8 x i8> %tmp2) @@ -35,6 +37,8 @@ } define <4 x i16> @vhaddu16(<4 x i16>* %A, <4 x i16>* %B) nounwind { +;CHECK: vhaddu16: +;CHECK: vhadd.u16 %tmp1 = load <4 x i16>* %A %tmp2 = load <4 x i16>* %B %tmp3 = call <4 x i16> @llvm.arm.neon.vhaddu.v4i16(<4 x i16> %tmp1, <4 x i16> %tmp2) @@ -42,6 +46,8 @@ } define <2 x i32> @vhaddu32(<2 x i32>* %A, <2 x i32>* %B) nounwind { +;CHECK: vhaddu32: +;CHECK: vhadd.u32 %tmp1 = load <2 x i32>* %A %tmp2 = load <2 x i32>* %B %tmp3 = call <2 x i32> @llvm.arm.neon.vhaddu.v2i32(<2 x i32> %tmp1, <2 x i32> %tmp2) @@ -49,6 +55,8 @@ } define <16 x i8> @vhaddQs8(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK: vhaddQs8: +;CHECK: vhadd.s8 %tmp1 = load <16 x i8>* %A %tmp2 = load <16 x i8>* %B %tmp3 = call <16 x i8> @llvm.arm.neon.vhadds.v16i8(<16 x i8> %tmp1, <16 x i8> %tmp2) @@ -56,6 +64,8 @@ } define <8 x i16> @vhaddQs16(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK: vhaddQs16: +;CHECK: vhadd.s16 %tmp1 = load <8 x i16>* %A %tmp2 = load <8 x i16>* %B %tmp3 = call <8 x i16> @llvm.arm.neon.vhadds.v8i16(<8 x i16> %tmp1, <8 x i16> %tmp2) @@ -63,6 +73,8 @@ } define <4 x i32> @vhaddQs32(<4 x i32>* %A, <4 x i32>* %B) nounwind { +;CHECK: vhaddQs32: +;CHECK: vhadd.s32 %tmp1 = load <4 x i32>* %A %tmp2 = load <4 x i32>* %B %tmp3 = call <4 x i32> @llvm.arm.neon.vhadds.v4i32(<4 x i32> %tmp1, <4 x i32> %tmp2) @@ -70,6 +82,8 @@ } define <16 x i8> @vhaddQu8(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK: vhaddQu8: +;CHECK: vhadd.u8 %tmp1 = load <16 x i8>* %A %tmp2 = load <16 x i8>* %B %tmp3 = call <16 x i8> @llvm.arm.neon.vhaddu.v16i8(<16 x i8> %tmp1, <16 x i8> %tmp2) @@ -77,6 +91,8 @@ } define <8 x i16> @vhaddQu16(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK: vhaddQu16: +;CHECK: vhadd.u16 %tmp1 = load <8 x i16>* %A %tmp2 = load <8 x i16>* %B %tmp3 = call <8 x i16> @llvm.arm.neon.vhaddu.v8i16(<8 x i16> %tmp1, <8 x i16> %tmp2) @@ -84,6 +100,8 @@ } define <4 x i32> @vhaddQu32(<4 x i32>* %A, <4 x i32>* %B) nounwind { +;CHECK: vhaddQu32: +;CHECK: vhadd.u32 %tmp1 = load <4 x i32>* %A %tmp2 = load <4 x i32>* %B %tmp3 = call <4 x i32> @llvm.arm.neon.vhaddu.v4i32(<4 x i32> %tmp1, <4 x i32> %tmp2) Modified: llvm/trunk/test/CodeGen/ARM/vhsub.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vhsub.ll?rev=81915&r1=81914&r2=81915&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vhsub.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vhsub.ll Tue Sep 15 15:58:02 2009 @@ -1,12 +1,8 @@ -; RUN: llc < %s -march=arm -mattr=+neon > %t -; RUN: grep {vhsub\\.s8} %t | count 2 -; RUN: grep {vhsub\\.s16} %t | count 2 -; RUN: grep {vhsub\\.s32} %t | count 2 -; RUN: grep {vhsub\\.u8} %t | count 2 -; RUN: grep {vhsub\\.u16} %t | count 2 -; RUN: grep {vhsub\\.u32} %t | count 2 +; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s define <8 x i8> @vhsubs8(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: vhsubs8: +;CHECK: vhsub.s8 %tmp1 = load <8 x i8>* %A %tmp2 = load <8 x i8>* %B %tmp3 = call <8 x i8> @llvm.arm.neon.vhsubs.v8i8(<8 x i8> %tmp1, <8 x i8> %tmp2) @@ -14,6 +10,8 @@ } define <4 x i16> @vhsubs16(<4 x i16>* %A, <4 x i16>* %B) nounwind { +;CHECK: vhsubs16: +;CHECK: vhsub.s16 %tmp1 = load <4 x i16>* %A %tmp2 = load <4 x i16>* %B %tmp3 = call <4 x i16> @llvm.arm.neon.vhsubs.v4i16(<4 x i16> %tmp1, <4 x i16> %tmp2) @@ -21,6 +19,8 @@ } define <2 x i32> @vhsubs32(<2 x i32>* %A, <2 x i32>* %B) nounwind { +;CHECK: vhsubs32: +;CHECK: vhsub.s32 %tmp1 = load <2 x i32>* %A %tmp2 = load <2 x i32>* %B %tmp3 = call <2 x i32> @llvm.arm.neon.vhsubs.v2i32(<2 x i32> %tmp1, <2 x i32> %tmp2) @@ -28,6 +28,8 @@ } define <8 x i8> @vhsubu8(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: vhsubu8: +;CHECK: vhsub.u8 %tmp1 = load <8 x i8>* %A %tmp2 = load <8 x i8>* %B %tmp3 = call <8 x i8> @llvm.arm.neon.vhsubu.v8i8(<8 x i8> %tmp1, <8 x i8> %tmp2) @@ -35,6 +37,8 @@ } define <4 x i16> @vhsubu16(<4 x i16>* %A, <4 x i16>* %B) nounwind { +;CHECK: vhsubu16: +;CHECK: vhsub.u16 %tmp1 = load <4 x i16>* %A %tmp2 = load <4 x i16>* %B %tmp3 = call <4 x i16> @llvm.arm.neon.vhsubu.v4i16(<4 x i16> %tmp1, <4 x i16> %tmp2) @@ -42,6 +46,8 @@ } define <2 x i32> @vhsubu32(<2 x i32>* %A, <2 x i32>* %B) nounwind { +;CHECK: vhsubu32: +;CHECK: vhsub.u32 %tmp1 = load <2 x i32>* %A %tmp2 = load <2 x i32>* %B %tmp3 = call <2 x i32> @llvm.arm.neon.vhsubu.v2i32(<2 x i32> %tmp1, <2 x i32> %tmp2) @@ -49,6 +55,8 @@ } define <16 x i8> @vhsubQs8(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK: vhsubQs8: +;CHECK: vhsub.s8 %tmp1 = load <16 x i8>* %A %tmp2 = load <16 x i8>* %B %tmp3 = call <16 x i8> @llvm.arm.neon.vhsubs.v16i8(<16 x i8> %tmp1, <16 x i8> %tmp2) @@ -56,6 +64,8 @@ } define <8 x i16> @vhsubQs16(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK: vhsubQs16: +;CHECK: vhsub.s16 %tmp1 = load <8 x i16>* %A %tmp2 = load <8 x i16>* %B %tmp3 = call <8 x i16> @llvm.arm.neon.vhsubs.v8i16(<8 x i16> %tmp1, <8 x i16> %tmp2) @@ -63,6 +73,8 @@ } define <4 x i32> @vhsubQs32(<4 x i32>* %A, <4 x i32>* %B) nounwind { +;CHECK: vhsubQs32: +;CHECK: vhsub.s32 %tmp1 = load <4 x i32>* %A %tmp2 = load <4 x i32>* %B %tmp3 = call <4 x i32> @llvm.arm.neon.vhsubs.v4i32(<4 x i32> %tmp1, <4 x i32> %tmp2) @@ -70,6 +82,8 @@ } define <16 x i8> @vhsubQu8(<16 x i8>* %A, <16 x i8>* %B) nounwind { +;CHECK: vhsubQu8: +;CHECK: vhsub.u8 %tmp1 = load <16 x i8>* %A %tmp2 = load <16 x i8>* %B %tmp3 = call <16 x i8> @llvm.arm.neon.vhsubu.v16i8(<16 x i8> %tmp1, <16 x i8> %tmp2) @@ -77,6 +91,8 @@ } define <8 x i16> @vhsubQu16(<8 x i16>* %A, <8 x i16>* %B) nounwind { +;CHECK: vhsubQu16: +;CHECK: vhsub.u16 %tmp1 = load <8 x i16>* %A %tmp2 = load <8 x i16>* %B %tmp3 = call <8 x i16> @llvm.arm.neon.vhsubu.v8i16(<8 x i16> %tmp1, <8 x i16> %tmp2) @@ -84,6 +100,8 @@ } define <4 x i32> @vhsubQu32(<4 x i32>* %A, <4 x i32>* %B) nounwind { +;CHECK: vhsubQu32: +;CHECK: vhsub.u32 %tmp1 = load <4 x i32>* %A %tmp2 = load <4 x i32>* %B %tmp3 = call <4 x i32> @llvm.arm.neon.vhsubu.v4i32(<4 x i32> %tmp1, <4 x i32> %tmp2) From baldrick at free.fr Tue Sep 15 16:24:15 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 15 Sep 2009 21:24:15 -0000 Subject: [llvm-commits] [gcc-plugin] r81918 - in /gcc-plugin/trunk: llvm-convert.cpp llvm-internal.h Message-ID: <200909152124.n8FLOF7Q009812@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 15 16:24:15 2009 New Revision: 81918 URL: http://llvm.org/viewvc/llvm-project?rev=81918&view=rev Log: Add support for constant POINTER_PLUS_EXPR. Modified: gcc-plugin/trunk/llvm-convert.cpp gcc-plugin/trunk/llvm-internal.h Modified: gcc-plugin/trunk/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=81918&r1=81917&r2=81918&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-convert.cpp (original) +++ gcc-plugin/trunk/llvm-convert.cpp Tue Sep 15 16:24:15 2009 @@ -6941,6 +6941,7 @@ case MINUS_EXPR: return ConvertBinOp_CST(exp); case CONSTRUCTOR: return ConvertCONSTRUCTOR(exp); case VIEW_CONVERT_EXPR: return Convert(TREE_OPERAND(exp, 0)); + case POINTER_PLUS_EXPR: return ConvertPOINTER_PLUS_EXPR(exp); case ADDR_EXPR: return TheFolder->CreateBitCast(EmitLV(TREE_OPERAND(exp, 0)), ConvertType(TREE_TYPE(exp))); @@ -7152,6 +7153,20 @@ return TheFolder->CreateCast(opcode, Elt, Ty); } +Constant *TreeConstantToLLVM::ConvertPOINTER_PLUS_EXPR(tree exp) { + Constant *Ptr = Convert(TREE_OPERAND(exp, 0)); // The pointer. + Constant *Idx = Convert(TREE_OPERAND(exp, 1)); // The offset in bytes. + + // Convert the pointer into an i8* and add the offset to it. + Ptr = TheFolder->CreateBitCast(Ptr, Type::getInt8Ty(Context)->getPointerTo()); + Constant *GEP = POINTER_TYPE_OVERFLOW_UNDEFINED ? + TheFolder->CreateInBoundsGetElementPtr(Ptr, &Idx, 1) : + TheFolder->CreateGetElementPtr(Ptr, &Idx, 1); + + // The result may be of a different pointer type. + return TheFolder->CreateBitCast(GEP, ConvertType(TREE_TYPE(exp))); +} + Constant *TreeConstantToLLVM::ConvertBinOp_CST(tree exp) { Constant *LHS = Convert(TREE_OPERAND(exp, 0)); bool LHSIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp,0))); Modified: gcc-plugin/trunk/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-internal.h?rev=81918&r1=81917&r2=81918&view=diff ============================================================================== --- gcc-plugin/trunk/llvm-internal.h (original) +++ gcc-plugin/trunk/llvm-internal.h Tue Sep 15 16:24:15 2009 @@ -683,7 +683,8 @@ static Constant *ConvertArrayCONSTRUCTOR(tree_node *exp); static Constant *ConvertRecordCONSTRUCTOR(tree_node *exp); static Constant *ConvertUnionCONSTRUCTOR(tree_node *exp); - + static Constant *ConvertPOINTER_PLUS_EXPR(tree_node *exp); + // Constant Expression l-values. static Constant *EmitLV(tree_node *exp); static Constant *EmitLV_Decl(tree_node *exp); From eli.friedman at gmail.com Tue Sep 15 16:37:41 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Tue, 15 Sep 2009 14:37:41 -0700 Subject: [llvm-commits] [llvm] r81914 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td In-Reply-To: <200909152053.n8FKrvNT005736@zion.cs.uiuc.edu> References: <200909152053.n8FKrvNT005736@zion.cs.uiuc.edu> Message-ID: On Tue, Sep 15, 2009 at 1:53 PM, Sean Callanan wrote: ============================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Sep 15 15:53:57 2009 > @@ -2427,6 +2427,14 @@ > ? ? ? ? ? ? ? ? ?"add{l}\t{$src2, $dst|$dst, $src2}", > ? ? ? ? ? ? ? ? ?[(set GR32:$dst, (add GR32:$src1, (load addr:$src2))), > ? ? ? ? ? ? ? ? ? (implicit EFLAGS)]>; > + > +// Register-Register Addition > +def ADD8mrmrr: I<0x02, MRMSrcReg, (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), > + ? ? ? ? ? ? ? ? "add{b}\t{$src2, $dst|$dst, $src2}", []>; > +def ADD16mrmrr: I<0x03, MRMSrcReg,(outs GR16:$dst),(ins GR16:$src1, GR16:$src2), > + ? ? ? ? ? ? ? ? ?"add{w}\t{$src2, $dst|$dst, $src2}", []>, OpSize; > +def ADD32mrmrr: I<0x03, MRMSrcReg,(outs GR16:$dst),(ins GR16:$src1, GR16:$src2), > + ? ? ? ? ? ? ? ? ?"add{l}\t{$src2, $dst|$dst, $src2}", []>; > > ?// Register-Integer Addition > ?def ADD8ri ? ?: Ii8<0x80, MRM0r, (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), It might be worth adding a comment explaining that these are equivalent to ADD32rr and friends. -Eli From eli.friedman at gmail.com Tue Sep 15 16:39:06 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Tue, 15 Sep 2009 14:39:06 -0700 Subject: [llvm-commits] [PATCH] extend SelectionDAGBuild to treat malloc calls the same as MallocInst (patch #4) In-Reply-To: <05892D6F-5D3B-45FD-8FA0-82EB6A686B63@apple.com> References: <05892D6F-5D3B-45FD-8FA0-82EB6A686B63@apple.com> Message-ID: On Tue, Sep 15, 2009 at 1:44 PM, Victor Hernandez wrote: > SelectionDAGBuild is the only pass in CodeGen that handles MallocInst > specially. ?This patch extends that code to handle malloc calls also. This part is both wrong and not necessary. -Eli From scallanan at apple.com Tue Sep 15 16:43:27 2009 From: scallanan at apple.com (Sean Callanan) Date: Tue, 15 Sep 2009 21:43:27 -0000 Subject: [llvm-commits] [llvm] r81923 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td Message-ID: <200909152143.n8FLhRLg012395@zion.cs.uiuc.edu> Author: spyffe Date: Tue Sep 15 16:43:27 2009 New Revision: 81923 URL: http://llvm.org/viewvc/llvm-project?rev=81923&view=rev Log: Updated comments per Eli's suggestion. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=81923&r1=81922&r2=81923&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Sep 15 16:43:27 2009 @@ -458,7 +458,8 @@ [(set GR64:$dst, (add GR64:$src1, (load addr:$src2))), (implicit EFLAGS)]>; -// Register-Register Addition +// Register-Register Addition - Equivalent to the normal rr form (ADD64rr), but +// differently encoded. def ADD64mrmrr : RI<0x03, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src1, GR64:$src2), "add{l}\t{$src2, $dst|$dst, $src2}", []>; Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=81923&r1=81922&r2=81923&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Sep 15 16:43:27 2009 @@ -2428,7 +2428,8 @@ [(set GR32:$dst, (add GR32:$src1, (load addr:$src2))), (implicit EFLAGS)]>; -// Register-Register Addition +// Register-Register Addition - Equivalent to the normal rr forms (ADD8rr, +// ADD16rr, and ADD32rr), but differently encoded. def ADD8mrmrr: I<0x02, MRMSrcReg, (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), "add{b}\t{$src2, $dst|$dst, $src2}", []>; def ADD16mrmrr: I<0x03, MRMSrcReg,(outs GR16:$dst),(ins GR16:$src1, GR16:$src2), From jonz at apple.com Tue Sep 15 16:55:59 2009 From: jonz at apple.com (Jon Ziegler) Date: Tue, 15 Sep 2009 21:55:59 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r81926 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2309/ Message-ID: <200909152155.n8FLtx6w014039@zion.cs.uiuc.edu> Author: jonz Date: Tue Sep 15 16:55:59 2009 New Revision: 81926 URL: http://llvm.org/viewvc/llvm-project?rev=81926&view=rev Log: Creating llvmgcc42-2309 from Leela. Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2309/ - copied from r81925, llvm-gcc-4.2/branches/Apple/Leela/ From jonz at apple.com Tue Sep 15 16:56:19 2009 From: jonz at apple.com (Jon Ziegler) Date: Tue, 15 Sep 2009 21:56:19 -0000 Subject: [llvm-commits] [llvm] r81927 - /llvm/tags/Apple/llvmCore-2309/ Message-ID: <200909152156.n8FLuJe7014090@zion.cs.uiuc.edu> Author: jonz Date: Tue Sep 15 16:56:18 2009 New Revision: 81927 URL: http://llvm.org/viewvc/llvm-project?rev=81927&view=rev Log: Creating llvmCore-2309 from Leela. Added: llvm/tags/Apple/llvmCore-2309/ - copied from r81926, llvm/branches/Apple/Leela/ From echristo at apple.com Tue Sep 15 16:56:46 2009 From: echristo at apple.com (Eric Christopher) Date: Tue, 15 Sep 2009 21:56:46 -0000 Subject: [llvm-commits] [llvm] r81928 - /llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Message-ID: <200909152156.n8FLukm5014157@zion.cs.uiuc.edu> Author: echristo Date: Tue Sep 15 16:56:46 2009 New Revision: 81928 URL: http://llvm.org/viewvc/llvm-project?rev=81928&view=rev Log: Expand on comment. Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp?rev=81928&r1=81927&r2=81928&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Tue Sep 15 16:56:46 2009 @@ -107,7 +107,9 @@ /// NormalizeLandingPads - Normalize and discover landing pads, noting them /// in the LandingPads set. A landing pad is normal if the only CFG edges -/// that end at it are unwind edges from invoke instructions. +/// that end at it are unwind edges from invoke instructions. If we inlined +/// through an invoke we could have a normal branch from the previous +/// unwind block through to the landing pad for the original invoke. /// Abnormal landing pads are fixed up by redirecting all unwind edges to /// a new basic block which falls through to the original. bool DwarfEHPrepare::NormalizeLandingPads() { @@ -132,6 +134,7 @@ break; } } + if (OnlyUnwoundTo) { // Only unwind edges lead to the landing pad. Remember the landing pad. LandingPads.insert(LPad); From isanbard at gmail.com Tue Sep 15 17:18:46 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Sep 2009 22:18:46 -0000 Subject: [llvm-commits] [llvm] r81932 - /llvm/tags/Apple/llvmCore-2207/ Message-ID: <200909152218.n8FMIkVa017042@zion.cs.uiuc.edu> Author: void Date: Tue Sep 15 17:18:46 2009 New Revision: 81932 URL: http://llvm.org/viewvc/llvm-project?rev=81932&view=rev Log: Retagging 2207. Removed: llvm/tags/Apple/llvmCore-2207/ From isanbard at gmail.com Tue Sep 15 17:18:56 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Sep 2009 22:18:56 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r81933 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2207/ Message-ID: <200909152218.n8FMIuKp017074@zion.cs.uiuc.edu> Author: void Date: Tue Sep 15 17:18:56 2009 New Revision: 81933 URL: http://llvm.org/viewvc/llvm-project?rev=81933&view=rev Log: Retagging 2207. Removed: llvm-gcc-4.2/tags/Apple/llvmgcc42-2207/ From isanbard at gmail.com Tue Sep 15 17:19:15 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Sep 2009 22:19:15 -0000 Subject: [llvm-commits] [llvm] r81934 - /llvm/tags/Apple/llvmCore-2207/ Message-ID: <200909152219.n8FMJFk1017124@zion.cs.uiuc.edu> Author: void Date: Tue Sep 15 17:19:15 2009 New Revision: 81934 URL: http://llvm.org/viewvc/llvm-project?rev=81934&view=rev Log: Creating llvmCore-2207 from Bender-SWB. Added: llvm/tags/Apple/llvmCore-2207/ - copied from r81933, llvm/branches/Apple/Bender-SWB/ From isanbard at gmail.com Tue Sep 15 17:19:24 2009 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Sep 2009 22:19:24 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r81935 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2207/ Message-ID: <200909152219.n8FMJOhs017155@zion.cs.uiuc.edu> Author: void Date: Tue Sep 15 17:19:23 2009 New Revision: 81935 URL: http://llvm.org/viewvc/llvm-project?rev=81935&view=rev Log: Creating llvmgcc42-2207 from Bender-SWB. Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2207/ - copied from r81934, llvm-gcc-4.2/branches/Apple/Bender-SWB/ From natebegeman at mac.com Tue Sep 15 17:30:11 2009 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 15 Sep 2009 22:30:11 -0000 Subject: [llvm-commits] [llvm] r81937 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200909152230.n8FMUC61018527@zion.cs.uiuc.edu> Author: sampo Date: Tue Sep 15 17:30:11 2009 New Revision: 81937 URL: http://llvm.org/viewvc/llvm-project?rev=81937&view=rev Log: Do not add the SVOffset to the Node CSE ID. The same pointer argument cannot have different SVOffsets. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=81937&r1=81936&r2=81937&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Sep 15 17:30:11 2009 @@ -432,14 +432,12 @@ const LoadSDNode *LD = cast(N); ID.AddInteger(LD->getMemoryVT().getRawBits()); ID.AddInteger(LD->getRawSubclassData()); - ID.AddInteger(LD->getSrcValueOffset()); break; } case ISD::STORE: { const StoreSDNode *ST = cast(N); ID.AddInteger(ST->getMemoryVT().getRawBits()); ID.AddInteger(ST->getRawSubclassData()); - ID.AddInteger(ST->getSrcValueOffset()); break; } case ISD::ATOMIC_CMP_SWAP: @@ -3681,7 +3679,6 @@ AddNodeIDNode(ID, ISD::LOAD, VTs, Ops, 3); ID.AddInteger(EVT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(ExtType, AM, isVolatile, Alignment)); - ID.AddInteger(SVOffset); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); @@ -3740,7 +3737,6 @@ ID.AddInteger(VT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(false, ISD::UNINDEXED, isVolatile, Alignment)); - ID.AddInteger(SVOffset); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); @@ -3776,7 +3772,6 @@ ID.AddInteger(SVT.getRawBits()); ID.AddInteger(encodeMemSDNodeFlags(true, ISD::UNINDEXED, isVolatile, Alignment)); - ID.AddInteger(SVOffset); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDValue(E, 0); From sabre at nondot.org Tue Sep 15 17:44:26 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 22:44:26 -0000 Subject: [llvm-commits] [llvm] r81940 - in /llvm/trunk: include/llvm/CodeGen/MachineFunction.h include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/MachineFunction.cpp lib/CodeGen/MachineModuleInfo.cpp Message-ID: <200909152244.n8FMiQ80020396@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 17:44:26 2009 New Revision: 81940 URL: http://llvm.org/viewvc/llvm-project?rev=81940&view=rev Log: add hooks to hang target-specific goop off MachineModuleInfo, move MachineFunctionInfo virtual method out of line to give it a home. Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h llvm/trunk/lib/CodeGen/MachineFunction.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=81940&r1=81939&r2=81940&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Tue Sep 15 17:44:26 2009 @@ -63,7 +63,7 @@ /// of type are accessed/created with MF::getInfo and destroyed when the /// MachineFunction is destroyed. struct MachineFunctionInfo { - virtual ~MachineFunctionInfo() {} + virtual ~MachineFunctionInfo(); }; class MachineFunction { @@ -159,8 +159,8 @@ /// void setAlignment(unsigned A) { Alignment = A; } - /// MachineFunctionInfo - Keep track of various per-function pieces of - /// information for backends that would like to do so. + /// getInfo - Keep track of various per-function pieces of information for + /// backends that would like to do so. /// template Ty *getInfo() { Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=81940&r1=81939&r2=81940&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Tue Sep 15 17:44:26 2009 @@ -54,6 +54,17 @@ class Module; class PointerType; class StructType; + + +/// MachineModuleInfoImpl - This class can be derived from and used by targets +/// to hold private target-specific information for each Module. Objects of +/// type are accessed/created with MMI::getInfo and destroyed when the +/// MachineModuleInfo is destroyed. +struct MachineModuleInfoImpl { + virtual ~MachineModuleInfoImpl(); +}; + + //===----------------------------------------------------------------------===// /// LandingPadInfo - This structure is used to retain landing pad info for @@ -80,7 +91,10 @@ /// schemes and reformated for specific use. /// class MachineModuleInfo : public ImmutablePass { -private: + /// TargetMMI - This is the target-specific implementation of + /// MachineModuleInfoImpl, which lets them accumulate whatever info they want. + MachineModuleInfoImpl *TargetMMI; + // LabelIDList - One entry per assigned label. Normally the entry is equal to // the list index(+1). If the entry is zero then the label has been deleted. // Any other value indicates the label has been deleted by is mapped to @@ -132,14 +146,9 @@ MachineModuleInfo(); ~MachineModuleInfo(); - /// doInitialization - Initialize the state for a new module. - /// bool doInitialization(); - - /// doFinalization - Tear down the state after completion of a module. - /// bool doFinalization(); - + /// BeginFunction - Begin gathering function meta information. /// void BeginFunction(MachineFunction *MF); @@ -148,6 +157,24 @@ /// void EndFunction(); + /// getInfo - Keep track of various per-function pieces of information for + /// backends that would like to do so. + /// + template + Ty *getInfo() { + if (TargetMMI == 0) + TargetMMI = new Ty(*this); + + assert((void*)dynamic_cast(TargetMMI) == (void*)TargetMMI && + "Invalid concrete type or multiple inheritence for getInfo"); + return static_cast(TargetMMI); + } + + template + const Ty *getInfo() const { + return const_cast(this)->getInfo(); + } + /// AnalyzeModule - Scan the module for global debug information. /// void AnalyzeModule(Module &M); Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=81940&r1=81939&r2=81940&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Tue Sep 15 17:44:26 2009 @@ -73,6 +73,9 @@ // MachineFunction implementation //===---------------------------------------------------------------------===// +// Out of line virtual method. +MachineFunctionInfo::~MachineFunctionInfo() {} + void ilist_traits::deleteNode(MachineBasicBlock *MBB) { MBB->getParent()->DeleteMachineBasicBlock(MBB); } Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=81940&r1=81939&r2=81940&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Tue Sep 15 17:44:26 2009 @@ -32,23 +32,23 @@ X("machinemoduleinfo", "Module Information"); char MachineModuleInfo::ID = 0; +// Out of line virtual method. +MachineModuleInfoImpl::~MachineModuleInfoImpl() {} + //===----------------------------------------------------------------------===// MachineModuleInfo::MachineModuleInfo() : ImmutablePass(&ID) -, LabelIDList() -, FrameMoves() -, LandingPads() -, Personalities() +, TargetMMI(0) , CallsEHReturn(0) , CallsUnwindInit(0) -, DbgInfoAvailable(false) -{ +, DbgInfoAvailable(false) { // Always emit some info, by default "no personality" info. Personalities.push_back(NULL); } -MachineModuleInfo::~MachineModuleInfo() { +MachineModuleInfo::~MachineModuleInfo() { + delete TargetMMI; } /// doInitialization - Initialize the state for a new module. From sabre at nondot.org Tue Sep 15 17:58:36 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 22:58:36 -0000 Subject: [llvm-commits] [llvm] r81942 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Message-ID: <200909152258.n8FMwaUF022299@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 17:58:35 2009 New Revision: 81942 URL: http://llvm.org/viewvc/llvm-project?rev=81942&view=rev Log: strength reduce a call to PrintRelDirective(true). Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=81942&r1=81941&r2=81942&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Sep 15 17:58:35 2009 @@ -160,10 +160,12 @@ // If there is a personality, we need to indicate the function's location. if (Personality) { - PrintRelDirective(true); + O << MAI->getData32bitsDirective(); + O << MAI->getPersonalityPrefix(); Asm->EmitExternalGlobal((const GlobalVariable *)(Personality)); O << MAI->getPersonalitySuffix(); + if (strcmp(MAI->getPersonalitySuffix(), "+4 at GOTPCREL")) O << "-" << MAI->getPCSymbol(); Asm->EOL("Personality"); From sabre at nondot.org Tue Sep 15 18:11:32 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Sep 2009 23:11:32 -0000 Subject: [llvm-commits] [llvm] r81946 - in /llvm/trunk: include/llvm/MC/MCAsmInfo.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/MC/MCAsmInfo.cpp Message-ID: <200909152311.n8FNBWw7024056@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 18:11:32 2009 New Revision: 81946 URL: http://llvm.org/viewvc/llvm-project?rev=81946&view=rev Log: remove some horrible MAI hooks which fortunately turn out to be always empty. Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/MC/MCAsmInfo.cpp Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=81946&r1=81945&r2=81946&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original) +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Tue Sep 15 18:11:32 2009 @@ -84,18 +84,6 @@ /// is "l" on Darwin, currently used for some ObjC metadata. const char *LinkerPrivateGlobalPrefix; // Defaults to "" - /// GlobalVarAddrPrefix/Suffix - If these are nonempty, these strings - /// will enclose any GlobalVariable (that isn't a function) - /// - const char *GlobalVarAddrPrefix; // Defaults to "" - const char *GlobalVarAddrSuffix; // Defaults to "" - - /// FunctionAddrPrefix/Suffix - If these are nonempty, these strings - /// will enclose any GlobalVariable that points to a function. - /// - const char *FunctionAddrPrefix; // Defaults to "" - const char *FunctionAddrSuffix; // Defaults to "" - /// PersonalityPrefix/Suffix - If these are nonempty, these strings will /// enclose any personality function in the common frame section. /// @@ -365,18 +353,6 @@ const char *getLinkerPrivateGlobalPrefix() const { return LinkerPrivateGlobalPrefix; } - const char *getGlobalVarAddrPrefix() const { - return GlobalVarAddrPrefix; - } - const char *getGlobalVarAddrSuffix() const { - return GlobalVarAddrSuffix; - } - const char *getFunctionAddrPrefix() const { - return FunctionAddrPrefix; - } - const char *getFunctionAddrSuffix() const { - return FunctionAddrSuffix; - } const char *getPersonalityPrefix() const { return PersonalityPrefix; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=81946&r1=81945&r2=81946&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Sep 15 18:11:32 2009 @@ -514,16 +514,7 @@ /// generate the appropriate value. const std::string &AsmPrinter::getGlobalLinkName(const GlobalVariable *GV, std::string &LinkName) const { - if (isa(GV)) { - LinkName += MAI->getFunctionAddrPrefix(); - LinkName += Mang->getMangledName(GV); - LinkName += MAI->getFunctionAddrSuffix(); - } else { - LinkName += MAI->getGlobalVarAddrPrefix(); - LinkName += Mang->getMangledName(GV); - LinkName += MAI->getGlobalVarAddrSuffix(); - } - + LinkName += Mang->getMangledName(GV); return LinkName; } @@ -838,18 +829,8 @@ O << CI->getZExtValue(); } else if (const GlobalValue *GV = dyn_cast(CV)) { // This is a constant address for a global variable or function. Use the - // name of the variable or function as the address value, possibly - // decorating it with GlobalVarAddrPrefix/Suffix or - // FunctionAddrPrefix/Suffix (these all default to "" ) - if (isa(GV)) { - O << MAI->getFunctionAddrPrefix() - << Mang->getMangledName(GV) - << MAI->getFunctionAddrSuffix(); - } else { - O << MAI->getGlobalVarAddrPrefix() - << Mang->getMangledName(GV) - << MAI->getGlobalVarAddrSuffix(); - } + // name of the variable or function as the address value. + O << Mang->getMangledName(GV); } else if (const ConstantExpr *CE = dyn_cast(CV)) { const TargetData *TD = TM.getTargetData(); unsigned Opcode = CE->getOpcode(); Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=81946&r1=81945&r2=81946&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Tue Sep 15 18:11:32 2009 @@ -30,10 +30,6 @@ GlobalPrefix = ""; PrivateGlobalPrefix = "."; LinkerPrivateGlobalPrefix = ""; - GlobalVarAddrPrefix = ""; - GlobalVarAddrSuffix = ""; - FunctionAddrPrefix = ""; - FunctionAddrSuffix = ""; PersonalityPrefix = ""; PersonalitySuffix = ""; NeedsIndirectEncoding = false; From scallanan at apple.com Tue Sep 15 18:37:51 2009 From: scallanan at apple.com (Sean Callanan) Date: Tue, 15 Sep 2009 23:37:51 -0000 Subject: [llvm-commits] [llvm] r81953 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200909152337.n8FNbplE027719@zion.cs.uiuc.edu> Author: spyffe Date: Tue Sep 15 18:37:51 2009 New Revision: 81953 URL: http://llvm.org/viewvc/llvm-project?rev=81953&view=rev Log: Added far return instructions (that is, returns to code in other segments) to the Intel instruction tables. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=81953&r1=81952&r2=81953&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Sep 15 18:37:51 2009 @@ -566,6 +566,10 @@ def RETI : Ii16<0xC2, RawFrm, (outs), (ins i16imm:$amt, variable_ops), "ret\t$amt", [(X86retflag timm:$amt)]>; + def LRET : I <0xCB, RawFrm, (outs), (ins), + "lret", []>; + def LRETI : Ii16<0xCA, RawFrm, (outs), (ins i16imm:$amt), + "lret\t$amt", []>; } // All branches are RawFrm, Void, Branch, and Terminators From daniel at zuster.org Tue Sep 15 18:40:07 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 23:40:07 -0000 Subject: [llvm-commits] [llvm] r81954 - /llvm/trunk/docs/CommandGuide/opt.pod Message-ID: <200909152340.n8FNe7iq028003@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 15 18:40:07 2009 New Revision: 81954 URL: http://llvm.org/viewvc/llvm-project?rev=81954&view=rev Log: Put back non-obsolete -f sections for 'opt'. Modified: llvm/trunk/docs/CommandGuide/opt.pod Modified: llvm/trunk/docs/CommandGuide/opt.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/opt.pod?rev=81954&r1=81953&r2=81954&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/opt.pod (original) +++ llvm/trunk/docs/CommandGuide/opt.pod Tue Sep 15 18:40:07 2009 @@ -38,6 +38,12 @@ =over +=item B<-f> + +Enable binary output on terminals. Normally, B will refuse to +write raw bitcode output if the output stream is a terminal. With this option, +B will write raw bitcode regardless of the output device. + =item B<-help> Print a summary of command line options. From daniel at zuster.org Tue Sep 15 18:41:43 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 16:41:43 -0700 Subject: [llvm-commits] [llvm] r81911 - in /llvm/trunk/docs/CommandGuide: llc.pod opt.pod In-Reply-To: <7BED6F84-135F-4226-87D8-B326C8005233@apple.com> References: <200909152031.n8FKVZ4C002735@zion.cs.uiuc.edu> <7BED6F84-135F-4226-87D8-B326C8005233@apple.com> Message-ID: <6a8523d60909151641x16b28090u56c0f6128993bb4d@mail.gmail.com> Fixed, thanks. - Daniel On Tue, Sep 15, 2009 at 1:40 PM, Dan Gohman wrote: > > On Sep 15, 2009, at 1:31 PM, Daniel Dunbar wrote: > > >> Author: ddunbar >> Date: Tue Sep 15 15:31:35 2009 >> New Revision: 81911 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=81911&view=rev >> Log: >> Remove references to obsolete -f option. > > Hi Danial, the -f option isn't completely obsolete. It's been > reduced to meaning "don't suppress binary output to a tty", which > is a small part of its original meaning, but at the moment > it still does mean that. > > Dan > > From daniel at zuster.org Tue Sep 15 18:43:26 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 16:43:26 -0700 Subject: [llvm-commits] [llvm] r80710 - in /llvm/trunk/lib: CodeGen/AsmPrinter/DwarfException.cpp Target/ARM/AsmPrinter/ARMAsmPrinter.cpp In-Reply-To: <6A35B456-A8BA-4904-A85C-02F5ABEF8406@apple.com> References: <200909011855.n81It8kt026907@zion.cs.uiuc.edu> <6a8523d60909022010h2feb03ebx5399164845f47918@mail.gmail.com> <6a8523d60909022159h1792b4c3taa44e0b552a5e5d5@mail.gmail.com> <6a8523d60909022201j5634507fh4ef373a5d1afe195@mail.gmail.com> <6a8523d60909030046x118c428ch856e2f8b8019aedf@mail.gmail.com> <6A35B456-A8BA-4904-A85C-02F5ABEF8406@apple.com> Message-ID: <6a8523d60909151643j5de93483q646e3066b0efa53e@mail.gmail.com> Done in r81912. - Daniel On Thu, Sep 3, 2009 at 9:47 AM, Chris Lattner wrote: > > On Sep 3, 2009, at 12:46 AM, Daniel Dunbar wrote: > >> On Wed, Sep 2, 2009 at 10:24 PM, Chris Lattner wrote: >>> >>> On Sep 2, 2009, at 10:01 PM, Daniel Dunbar wrote: >>>> >>>> On Wed, Sep 2, 2009 at 9:59 PM, Daniel Dunbar wrote: >>>>> >>>>> I'm happy to work on fixing this if someone has a good plan. >>>>> raw_ostream doesn't really seem to need its 64 byte buffer, for >>>>> example. When I first implemented >>>> >>>> ... the magic I-ownz-your-buffer ..., that is. >>> >>> Ah, ok, bumping it up to 64 with a comment about this seems reasonable. >> >> That seems burdensome for all callers, we should probably fix the API. >> What if we dropped the raw_ostream required buffer size to 4, since I >> think thats actually all that is required? > > Yes, that would be a much better solution, > > -chris > From daniel at zuster.org Tue Sep 15 18:45:47 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 15 Sep 2009 16:45:47 -0700 Subject: [llvm-commits] [llvm] r80929 - in /llvm/trunk: include/llvm/MC/MCAsmLexer.h lib/Target/X86/AsmParser/X86AsmParser.cpp tools/llvm-mc/AsmLexer.cpp tools/llvm-mc/AsmLexer.h tools/llvm-mc/llvm-mc.cpp In-Reply-To: <200909031715.n83HF7M8030983@zion.cs.uiuc.edu> References: <200909031715.n83HF7M8030983@zion.cs.uiuc.edu> Message-ID: <6a8523d60909151645q1344091bq37c9d2df8b5b9884@mail.gmail.com> Hi Kevin, One comment... On Thu, Sep 3, 2009 at 10:15 AM, Kevin Enderby wrote: > Author: enderby > Date: Thu Sep ?3 12:15:07 2009 > New Revision: 80929 > > URL: http://llvm.org/viewvc/llvm-project?rev=80929&view=rev > Log: > Removed the non-target independent AsmToken::Register enum constant > from MCAsmLexer.h in preparation of supporting other targets. ?Changed the > X86AsmParser code to reflect this by removing AsmLexer::LexPercent and looking > for AsmToken::Percent when parsing in places that used AsmToken::Register. > Then changed X86ATTAsmParser::ParseRegister to parse out registers as an > AsmToken::Percent followed by an AsmToken::Identifier. > ============================================================================== > --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original) > +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Thu Sep ?3 12:15:07 2009 > @@ -230,20 +230,23 @@ > > > ?bool X86ATTAsmParser::ParseRegister(X86Operand &Op) { > + ?const AsmToken &TokPercent = getLexer().getTok(); > + ?assert(TokPercent.is(AsmToken::Percent) && "Invalid token kind!"); > + ?getLexer().Lex(); // Eat percent token. > + > ? const AsmToken &Tok = getLexer().getTok(); > - ?assert(Tok.is(AsmToken::Register) && "Invalid token kind!"); > + ?assert(TokPercent.is(AsmToken::Identifier) && "Invalid token kind!"); This should be a branch not an assert (so a user error is detected), I think code like 'mov $0, %%eax' will assert currently. - Daniel From enderby at apple.com Tue Sep 15 18:52:11 2009 From: enderby at apple.com (Kevin Enderby) Date: Tue, 15 Sep 2009 16:52:11 -0700 Subject: [llvm-commits] [llvm] r80929 - in /llvm/trunk: include/llvm/MC/MCAsmLexer.h lib/Target/X86/AsmParser/X86AsmParser.cpp tools/llvm-mc/AsmLexer.cpp tools/llvm-mc/AsmLexer.h tools/llvm-mc/llvm-mc.cpp In-Reply-To: <6a8523d60909151645q1344091bq37c9d2df8b5b9884@mail.gmail.com> References: <200909031715.n83HF7M8030983@zion.cs.uiuc.edu> <6a8523d60909151645q1344091bq37c9d2df8b5b9884@mail.gmail.com> Message-ID: Yep that user error would assert currently. I'll fix it up. Thanks for the catch, Kev On Sep 15, 2009, at 4:45 PM, Daniel Dunbar wrote: > Hi Kevin, > > One comment... > > On Thu, Sep 3, 2009 at 10:15 AM, Kevin Enderby > wrote: >> Author: enderby >> Date: Thu Sep 3 12:15:07 2009 >> New Revision: 80929 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=80929&view=rev >> Log: >> Removed the non-target independent AsmToken::Register enum constant >> from MCAsmLexer.h in preparation of supporting other targets. >> Changed the >> X86AsmParser code to reflect this by removing AsmLexer::LexPercent >> and looking >> for AsmToken::Percent when parsing in places that used >> AsmToken::Register. >> Then changed X86ATTAsmParser::ParseRegister to parse out registers >> as an >> AsmToken::Percent followed by an AsmToken::Identifier. > >> ===================================================================== >> ========= >> --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original) >> +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Thu Sep >> 3 12:15:07 2009 >> @@ -230,20 +230,23 @@ >> >> >> bool X86ATTAsmParser::ParseRegister(X86Operand &Op) { >> + const AsmToken &TokPercent = getLexer().getTok(); >> + assert(TokPercent.is(AsmToken::Percent) && "Invalid token kind!"); >> + getLexer().Lex(); // Eat percent token. >> + >> const AsmToken &Tok = getLexer().getTok(); >> - assert(Tok.is(AsmToken::Register) && "Invalid token kind!"); >> + assert(TokPercent.is(AsmToken::Identifier) && "Invalid token >> kind!"); > > This should be a branch not an assert (so a user error is detected), I > think code like 'mov $0, %%eax' will assert currently. > > - Daniel From bob.wilson at apple.com Tue Sep 15 18:55:57 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 15 Sep 2009 23:55:57 -0000 Subject: [llvm-commits] [llvm] r81959 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200909152355.n8FNtvvN030118@zion.cs.uiuc.edu> Author: bwilson Date: Tue Sep 15 18:55:57 2009 New Revision: 81959 URL: http://llvm.org/viewvc/llvm-project?rev=81959&view=rev Log: Expand all v2f64 arithmetic operations for Neon. Radar 7200803. (This should also fix the SingleSource/UnitTests/Vector/sumarray-dbl test.) Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=81959&r1=81958&r2=81959&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Sep 15 18:55:57 2009 @@ -237,6 +237,33 @@ addQRTypeForNEON(MVT::v4i32); addQRTypeForNEON(MVT::v2i64); + // v2f64 is legal so that QR subregs can be extracted as f64 elements, but + // neither Neon nor VFP support any arithmetic operations on it. + setOperationAction(ISD::FADD, MVT::v2f64, Expand); + setOperationAction(ISD::FSUB, MVT::v2f64, Expand); + setOperationAction(ISD::FMUL, MVT::v2f64, Expand); + setOperationAction(ISD::FDIV, MVT::v2f64, Expand); + setOperationAction(ISD::FREM, MVT::v2f64, Expand); + setOperationAction(ISD::FCOPYSIGN, MVT::v2f64, Expand); + setOperationAction(ISD::VSETCC, MVT::v2f64, Expand); + setOperationAction(ISD::FNEG, MVT::v2f64, Expand); + setOperationAction(ISD::FABS, MVT::v2f64, Expand); + setOperationAction(ISD::FSQRT, MVT::v2f64, Expand); + setOperationAction(ISD::FSIN, MVT::v2f64, Expand); + setOperationAction(ISD::FCOS, MVT::v2f64, Expand); + setOperationAction(ISD::FPOWI, MVT::v2f64, Expand); + setOperationAction(ISD::FPOW, MVT::v2f64, Expand); + setOperationAction(ISD::FLOG, MVT::v2f64, Expand); + setOperationAction(ISD::FLOG2, MVT::v2f64, Expand); + setOperationAction(ISD::FLOG10, MVT::v2f64, Expand); + setOperationAction(ISD::FEXP, MVT::v2f64, Expand); + setOperationAction(ISD::FEXP2, MVT::v2f64, Expand); + setOperationAction(ISD::FCEIL, MVT::v2f64, Expand); + setOperationAction(ISD::FTRUNC, MVT::v2f64, Expand); + setOperationAction(ISD::FRINT, MVT::v2f64, Expand); + setOperationAction(ISD::FNEARBYINT, MVT::v2f64, Expand); + setOperationAction(ISD::FFLOOR, MVT::v2f64, Expand); + setTargetDAGCombine(ISD::INTRINSIC_WO_CHAIN); setTargetDAGCombine(ISD::SHL); setTargetDAGCombine(ISD::SRL); From sabre at nondot.org Tue Sep 15 19:08:07 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 00:08:07 -0000 Subject: [llvm-commits] [llvm] r81961 - /llvm/trunk/lib/Analysis/ConstantFolding.cpp Message-ID: <200909160008.n8G087nA031717@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 19:08:07 2009 New Revision: 81961 URL: http://llvm.org/viewvc/llvm-project?rev=81961&view=rev Log: simplify some code Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=81961&r1=81960&r2=81961&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ConstantFolding.cpp (original) +++ llvm/trunk/lib/Analysis/ConstantFolding.cpp Tue Sep 15 19:08:07 2009 @@ -379,9 +379,9 @@ return ConstantFoldCompareInstOperands(CI->getPredicate(), Ops.data(), Ops.size(), Context, TD); - else - return ConstantFoldInstOperands(I->getOpcode(), I->getType(), - Ops.data(), Ops.size(), Context, TD); + + return ConstantFoldInstOperands(I->getOpcode(), I->getType(), + Ops.data(), Ops.size(), Context, TD); } /// ConstantFoldConstantExpression - Attempt to fold the constant expression @@ -398,9 +398,8 @@ return ConstantFoldCompareInstOperands(CE->getPredicate(), Ops.data(), Ops.size(), Context, TD); - else - return ConstantFoldInstOperands(CE->getOpcode(), CE->getType(), - Ops.data(), Ops.size(), Context, TD); + return ConstantFoldInstOperands(CE->getOpcode(), CE->getType(), + Ops.data(), Ops.size(), Context, TD); } /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the From sabre at nondot.org Tue Sep 15 19:08:42 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 00:08:42 -0000 Subject: [llvm-commits] [llvm] r81962 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/CodeGen/AsmPrinter/DwarfException.cpp Message-ID: <200909160008.n8G08gWr031800@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 19:08:41 2009 New Revision: 81962 URL: http://llvm.org/viewvc/llvm-project?rev=81962&view=rev Log: eliminate the horrid AsmPrinter::getGlobalLinkName method, inlining it into all of its call sites and simplifying them. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=81962&r1=81961&r2=81962&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Sep 15 19:08:41 2009 @@ -159,12 +159,6 @@ /// bool isVerbose() const { return VerboseAsm; } - /// getGlobalLinkName - Returns the asm/link name of of the specified - /// global variable. Should be overridden by each target asm printer to - /// generate the appropriate value. - virtual const std::string &getGlobalLinkName(const GlobalVariable *GV, - std::string &LinkName) const; - /// EmitExternalGlobal - Emit the external reference to a global variable. /// Should be overridden if an indirect reference should be used. virtual void EmitExternalGlobal(const GlobalVariable *GV); Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=81962&r1=81961&r2=81962&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Sep 15 19:08:41 2009 @@ -509,20 +509,10 @@ } } -/// getGlobalLinkName - Returns the asm/link name of of the specified -/// global variable. Should be overridden by each target asm printer to -/// generate the appropriate value. -const std::string &AsmPrinter::getGlobalLinkName(const GlobalVariable *GV, - std::string &LinkName) const { - LinkName += Mang->getMangledName(GV); - return LinkName; -} - /// EmitExternalGlobal - Emit the external reference to a global variable. /// Should be overridden if an indirect reference should be used. void AsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) { - std::string GLN; - O << getGlobalLinkName(GV, GLN); + O << Mang->getMangledName(GV); } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=81962&r1=81961&r2=81962&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Sep 15 19:08:41 2009 @@ -23,6 +23,7 @@ #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Mangler.h" #include "llvm/Support/Timer.h" #include "llvm/Support/Debug.h" #include "llvm/System/Path.h" @@ -1501,9 +1502,8 @@ // Add address. DIEBlock *Block = new DIEBlock(); AddUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr); - std::string GLN; AddObjectLabel(Block, 0, dwarf::DW_FORM_udata, - Asm->getGlobalLinkName(DI_GV.getGlobal(), GLN)); + Asm->Mang->getMangledName(DI_GV.getGlobal())); AddBlock(VariableDie, dwarf::DW_AT_location, 0, Block); // Add to map. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=81962&r1=81961&r2=81962&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Sep 15 19:08:41 2009 @@ -872,8 +872,7 @@ PrintRelDirective(); if (GV) { - std::string GLN; - O << Asm->getGlobalLinkName(GV, GLN); + O << Asm->Mang->getMangledName(GV); } else { O << "0x0"; } From sabre at nondot.org Tue Sep 15 19:14:19 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 00:14:19 -0000 Subject: [llvm-commits] [llvm] r81965 - in /llvm/trunk/lib/Target/PowerPC: AsmPrinter/PPCAsmPrinter.cpp PPCMCAsmInfo.cpp Message-ID: <200909160014.n8G0EJwT032526@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 19:14:19 2009 New Revision: 81965 URL: http://llvm.org/viewvc/llvm-project?rev=81965&view=rev Log: eliminate the PPC backend's implementation of EmitExternalGlobal and use PersonalityPrefix/Suffix to achieve the same effect (like the x86 backend). This changes the code generated for ppc static mode, but guess what, we were generating this before: .byte 0x9B ; Personality (indirect pcrel sdata4) .long ___gxx_personality_v0-. ; Personality which is not correct! (it is not an 'indirect' reference). Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=81965&r1=81964&r2=81965&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Tue Sep 15 19:14:19 2009 @@ -341,8 +341,6 @@ const char *Modifier); virtual bool runOnMachineFunction(MachineFunction &F) = 0; - - virtual void EmitExternalGlobal(const GlobalVariable *GV); }; /// PPCLinuxAsmPrinter - PowerPC assembly printer, customized for Linux @@ -462,19 +460,6 @@ } } -/// EmitExternalGlobal - In this case we need to use the indirect symbol. -/// -void PPCAsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) { - std::string Name; - - if (TM.getRelocationModel() != Reloc::Static) { - Name = Mang->getMangledName(GV, "$non_lazy_ptr", true); - } else { - Name = Mang->getMangledName(GV); - } - O << Name; -} - /// PrintAsmOperand - Print out an operand for an inline asm expression. /// bool PPCAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, Modified: llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp?rev=81965&r1=81964&r2=81965&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp Tue Sep 15 19:14:19 2009 @@ -22,6 +22,9 @@ if (!is64Bit) Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. AssemblerDialect = 1; // New-Style mnemonics. + + PersonalityPrefix = "L"; + PersonalitySuffix = "$non_lazy_ptr"; } PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) { From bob.wilson at apple.com Tue Sep 15 19:17:29 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 16 Sep 2009 00:17:29 -0000 Subject: [llvm-commits] [llvm] r81966 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200909160017.n8G0HTrW000498@zion.cs.uiuc.edu> Author: bwilson Date: Tue Sep 15 19:17:28 2009 New Revision: 81966 URL: http://llvm.org/viewvc/llvm-project?rev=81966&view=rev Log: Neon does not support vector divide or remainder. Expand them. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=81966&r1=81965&r2=81966&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Sep 15 19:17:28 2009 @@ -99,6 +99,14 @@ AddPromotedToType (ISD::XOR, VT.getSimpleVT(), PromotedBitwiseVT.getSimpleVT()); } + + // Neon does not support vector divide/remainder operations. + setOperationAction(ISD::SDIV, VT.getSimpleVT(), Expand); + setOperationAction(ISD::UDIV, VT.getSimpleVT(), Expand); + setOperationAction(ISD::FDIV, VT.getSimpleVT(), Expand); + setOperationAction(ISD::SREM, VT.getSimpleVT(), Expand); + setOperationAction(ISD::UREM, VT.getSimpleVT(), Expand); + setOperationAction(ISD::FREM, VT.getSimpleVT(), Expand); } void ARMTargetLowering::addDRTypeForNEON(EVT VT) { From sabre at nondot.org Tue Sep 15 19:17:39 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 00:17:39 -0000 Subject: [llvm-commits] [llvm] r81967 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfException.cpp Message-ID: <200909160017.n8G0Hde1000531@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 19:17:39 2009 New Revision: 81967 URL: http://llvm.org/viewvc/llvm-project?rev=81967&view=rev Log: Eliminate AsmPrinter::EmitExternalGlobal, inlining its (now) one implementation into its one caller. This eliminates a totally awesome and gratuitous hack where we casted a Function* to GlobalVariable*. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=81967&r1=81966&r2=81967&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Sep 15 19:17:39 2009 @@ -159,10 +159,6 @@ /// bool isVerbose() const { return VerboseAsm; } - /// EmitExternalGlobal - Emit the external reference to a global variable. - /// Should be overridden if an indirect reference should be used. - virtual void EmitExternalGlobal(const GlobalVariable *GV); - /// getCurrentFunctionEHName - Called to return the CurrentFnEHName. /// std::string getCurrentFunctionEHName(const MachineFunction *MF) const; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=81967&r1=81966&r2=81967&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Sep 15 19:17:39 2009 @@ -509,13 +509,6 @@ } } -/// EmitExternalGlobal - Emit the external reference to a global variable. -/// Should be overridden if an indirect reference should be used. -void AsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) { - O << Mang->getMangledName(GV); -} - - //===----------------------------------------------------------------------===// /// LEB 128 number encoding. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=81967&r1=81966&r2=81967&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Sep 15 19:17:39 2009 @@ -163,7 +163,7 @@ O << MAI->getData32bitsDirective(); O << MAI->getPersonalityPrefix(); - Asm->EmitExternalGlobal((const GlobalVariable *)(Personality)); + O << Asm->Mang->getMangledName(Personality); O << MAI->getPersonalitySuffix(); if (strcmp(MAI->getPersonalitySuffix(), "+4 at GOTPCREL")) From sabre at nondot.org Tue Sep 15 19:24:31 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 00:24:31 -0000 Subject: [llvm-commits] [llvm] r81968 - /llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Message-ID: <200909160024.n8G0OVq0001386@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 19:24:31 2009 New Revision: 81968 URL: http://llvm.org/viewvc/llvm-project?rev=81968&view=rev Log: remove a dead bool. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=81968&r1=81967&r2=81968&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Sep 15 19:24:31 2009 @@ -134,11 +134,6 @@ /// bool VerboseAsm; - /// ExuberantAsm - Emit many more comments in assembly output if - /// this is true. - /// - bool ExuberantAsm; - /// Private state for PrintSpecial() // Assign a unique ID to this machine instruction. mutable const MachineInstr *LastMI; From bob.wilson at apple.com Tue Sep 15 19:32:15 2009 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 16 Sep 2009 00:32:15 -0000 Subject: [llvm-commits] [llvm] r81969 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200909160032.n8G0WFQs002345@zion.cs.uiuc.edu> Author: bwilson Date: Tue Sep 15 19:32:15 2009 New Revision: 81969 URL: http://llvm.org/viewvc/llvm-project?rev=81969&view=rev Log: Expand some more vector operations not supported by Neon. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=81969&r1=81968&r2=81969&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Sep 15 19:32:15 2009 @@ -272,6 +272,12 @@ setOperationAction(ISD::FNEARBYINT, MVT::v2f64, Expand); setOperationAction(ISD::FFLOOR, MVT::v2f64, Expand); + // Neon does not support some operations on v1i64 and v2i64 types. + setOperationAction(ISD::MUL, MVT::v1i64, Expand); + setOperationAction(ISD::MUL, MVT::v2i64, Expand); + setOperationAction(ISD::VSETCC, MVT::v1i64, Expand); + setOperationAction(ISD::VSETCC, MVT::v2i64, Expand); + setTargetDAGCombine(ISD::INTRINSIC_WO_CHAIN); setTargetDAGCombine(ISD::SHL); setTargetDAGCombine(ISD::SRL); From sabre at nondot.org Tue Sep 15 19:35:39 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 00:35:39 -0000 Subject: [llvm-commits] [llvm] r81970 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfException.cpp Message-ID: <200909160035.n8G0Zd0X002778@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 19:35:39 2009 New Revision: 81970 URL: http://llvm.org/viewvc/llvm-project?rev=81970&view=rev Log: inline AsmPrinter::getCurrentFunctionEHName into its only caller. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=81970&r1=81969&r2=81970&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Sep 15 19:35:39 2009 @@ -154,10 +154,6 @@ /// bool isVerbose() const { return VerboseAsm; } - /// getCurrentFunctionEHName - Called to return the CurrentFnEHName. - /// - std::string getCurrentFunctionEHName(const MachineFunction *MF) const; - /// getFunctionNumber - Return a unique ID for the current function. /// unsigned getFunctionNumber() const { return FunctionNumber; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=81970&r1=81969&r2=81970&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Sep 15 19:35:39 2009 @@ -212,21 +212,13 @@ return false; } -std::string -AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) const { - assert(MF && "No machine function?"); - return Mang->getMangledName(MF->getFunction(), ".eh", - MAI->is_EHSymbolPrivate()); -} - void AsmPrinter::SetupMachineFunction(MachineFunction &MF) { // What's my mangled name? CurrentFnName = Mang->getMangledName(MF.getFunction()); IncrementFunctionNumber(); - if (VerboseAsm) { + if (VerboseAsm) LI = &getAnalysis(); - } } namespace { Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=81970&r1=81969&r2=81970&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Sep 15 19:35:39 2009 @@ -960,9 +960,12 @@ EmitLabel("eh_func_end", SubprogramCount); EmitExceptionTable(); + std::string FunctionEHName = + Asm->Mang->getMangledName(MF->getFunction(), ".eh", + Asm->MAI->is_EHSymbolPrivate()); + // Save EH frame information - EHFrames.push_back(FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF), - SubprogramCount, + EHFrames.push_back(FunctionEHFrameInfo(FunctionEHName, SubprogramCount, MMI->getPersonalityIndex(), MF->getFrameInfo()->hasCalls(), !MMI->getLandingPads().empty(), From scallanan at apple.com Tue Sep 15 20:13:52 2009 From: scallanan at apple.com (Sean Callanan) Date: Wed, 16 Sep 2009 01:13:52 -0000 Subject: [llvm-commits] [llvm] r81979 - in /llvm/trunk/lib/Target/X86: X86InstrFPStack.td X86InstrSSE.td Message-ID: <200909160113.n8G1DrB2007707@zion.cs.uiuc.edu> Author: spyffe Date: Tue Sep 15 20:13:52 2009 New Revision: 81979 URL: http://llvm.org/viewvc/llvm-project?rev=81979&view=rev Log: Added a variety of floating-point and SSE instructions. All of these do not have patterns (they're for the disassembler). Many of the floating-point instructions will probably be rolled into definitions that have patterns, and may eventually be superseded by mdefs. So I put them together and left a comment. Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=81979&r1=81978&r2=81979&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Tue Sep 15 20:13:52 2009 @@ -303,6 +303,36 @@ } def TST_F : FPI<0xE4, RawFrm, (outs), (ins), "ftst">, D9; +// Versions of FP instructions that take a single memory operand. Added for the +// disassembler; remove as they are included with patterns elsewhere. +def FCOM32m : FPI<0xD8, MRM2m, (outs), (ins f32mem:$src), "fcom\t$src">; +def FCOMP32m : FPI<0xD8, MRM3m, (outs), (ins f32mem:$src), "fcomp\t$src">; + +def FLDENVm : FPI<0xD9, MRM4m, (outs), (ins f32mem:$src), "fldenv\t$src">; +def FSTENVm : FPI<0xD9, MRM6m, (outs f32mem:$dst), (ins), "fstenv\t$dst">; + +def FICOM32m : FPI<0xDA, MRM2m, (outs), (ins i32mem:$src), "ficom{l}\t$src">; +def FICOMP32m: FPI<0xDA, MRM3m, (outs), (ins i32mem:$src), "ficomp{l}\t$src">; + +def FCOM64m : FPI<0xDC, MRM2m, (outs), (ins f64mem:$src), "fcom\t$src">; +def FCOMP64m : FPI<0xDC, MRM3m, (outs), (ins f64mem:$src), "fcomp\t$src">; + +def FLD64m : FPI<0xDD, MRM0m, (outs), (ins f64mem:$src), "fld\t$src">; +def FISTTP32m: FPI<0xDD, MRM1m, (outs i32mem:$dst), (ins), "fisttp{l}\t$dst">; +def FST64m : FPI<0xDD, MRM2m, (outs f64mem:$dst), (ins), "fst\t$dst">; +def FSTP64m : FPI<0xDD, MRM3m, (outs f64mem:$dst), (ins), "fld\t$dst">; +def FRSTORm : FPI<0xDD, MRM4m, (outs f32mem:$dst), (ins), "frstor\t$dst">; +def FSAVEm : FPI<0xDD, MRM6m, (outs f32mem:$dst), (ins), "fsave\t$dst">; +def FSTSWm : FPI<0xDD, MRM7m, (outs f32mem:$dst), (ins), "fstsw\t$dst">; + +def FICOM16m : FPI<0xDE, MRM2m, (outs), (ins i16mem:$src), "ficom{w}\t$src">; +def FICOMP16m: FPI<0xDE, MRM3m, (outs), (ins i16mem:$src), "ficomp{w}\t$src">; + +def FBLDm : FPI<0xDF, MRM4m, (outs), (ins f32mem:$src), "fbld\t$src">; +def FILD64m : FPI<0xDF, MRM5m, (outs), (ins i64mem:$src), "fild{q}\t$src">; +def FBSTPm : FPI<0xDF, MRM6m, (outs f32mem:$dst), (ins), "fbstp\t$dst">; +def FISTP64m : FPI<0xDF, MRM7m, (outs i64mem:$dst), (ins), "fistp{q}\t$dst">; + // Floating point cmovs. multiclass FPCMov { def _Fp32 : FpIf32<(outs RFP32:$dst), (ins RFP32:$src1, RFP32:$src2), Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=81979&r1=81978&r2=81979&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Sep 15 20:13:52 2009 @@ -1096,6 +1096,27 @@ "cvtsi2sd\t{$src, $dst|$dst, $src}", [(set FR64:$dst, (sint_to_fp (loadi32 addr:$src)))]>; +def CVTPD2DQrm : S3DI<0xE6, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), + "cvtpd2dq\t{$src, $dst|$dst, $src}", []>; +def CVTPD2DQrr : S3DI<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), + "cvtpd2dq\t{$src, $dst|$dst, $src}", []>; +def CVTDQ2PDrm : S3SI<0xE6, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), + "cvtdq2pd\t{$src, $dst|$dst, $src}", []>; +def CVTDQ2PDrr : S3SI<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), + "cvtdq2pd\t{$src, $dst|$dst, $src}", []>; +def CVTPS2DQrr : PDI<0x5B, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), + "cvtps2dq\t{$src, $dst|$dst, $src}", []>; +def CVTPS2DQrm : PDI<0x5B, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), + "cvtps2dq\t{$src, $dst|$dst, $src}", []>; +def CVTDQ2PSrr : PSI<0x5B, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), + "cvtdq2ps\t{$src, $dst|$dst, $src}", []>; +def CVTDQ2PSrm : PSI<0x5B, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), + "cvtdq2ps\t{$src, $dst|$dst, $src}", []>; +def COMISDrr: PDI<0x2F, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), + "comisd\t{$src2, $src1|$src1, $src2}", []>; +def COMISDrm: PDI<0x2F, MRMSrcMem, (outs), (ins VR128:$src1, f128mem:$src2), + "comisd\t{$src2, $src1|$src1, $src2}", []>; + // SSE2 instructions with XS prefix def CVTSS2SDrr : I<0x5A, MRMSrcReg, (outs FR64:$dst), (ins FR32:$src), "cvtss2sd\t{$src, $dst|$dst, $src}", From sabre at nondot.org Tue Sep 15 20:26:31 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 01:26:31 -0000 Subject: [llvm-commits] [llvm] r81984 - in /llvm/trunk: include/llvm/MC/MCExpr.h lib/MC/MCExpr.cpp Message-ID: <200909160126.n8G1QWGf009371@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 20:26:31 2009 New Revision: 81984 URL: http://llvm.org/viewvc/llvm-project?rev=81984&view=rev Log: add a helper method for creating MCSymbol and MCSymbolRefExpr at the same time. Modified: llvm/trunk/include/llvm/MC/MCExpr.h llvm/trunk/lib/MC/MCExpr.cpp Modified: llvm/trunk/include/llvm/MC/MCExpr.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=81984&r1=81983&r2=81984&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCExpr.h (original) +++ llvm/trunk/include/llvm/MC/MCExpr.h Tue Sep 15 20:26:31 2009 @@ -19,6 +19,7 @@ class MCSymbol; class MCValue; class raw_ostream; +class StringRef; /// MCExpr - Base class for the full range of assembler expressions which are /// needed for parsing. @@ -119,7 +120,10 @@ /// @{ static const MCSymbolRefExpr *Create(const MCSymbol *Symbol, MCContext &Ctx); - + static const MCSymbolRefExpr *Create(const StringRef &Name, MCContext &Ctx); + + + /// @} /// @name Accessors /// @{ Modified: llvm/trunk/lib/MC/MCExpr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=81984&r1=81983&r2=81984&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCExpr.cpp (original) +++ llvm/trunk/lib/MC/MCExpr.cpp Tue Sep 15 20:26:31 2009 @@ -133,6 +133,12 @@ return new (Ctx) MCSymbolRefExpr(Sym); } +const MCSymbolRefExpr *MCSymbolRefExpr::Create(const StringRef &Name, + MCContext &Ctx) { + return Create(Ctx.GetOrCreateSymbol(Name), Ctx); +} + + /* *** */ bool MCExpr::EvaluateAsAbsolute(MCContext &Ctx, int64_t &Res) const { From sabre at nondot.org Tue Sep 15 20:29:11 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 01:29:11 -0000 Subject: [llvm-commits] [llvm] r81985 - in /llvm/trunk/lib/ExecutionEngine/JIT: JITDwarfEmitter.cpp JITDwarfEmitter.h Message-ID: <200909160129.n8G1TBxh009699@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 20:29:11 2009 New Revision: 81985 URL: http://llvm.org/viewvc/llvm-project?rev=81985&view=rev Log: remove a dead variable. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp?rev=81985&r1=81984&r2=81985&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp Tue Sep 15 20:29:11 2009 @@ -39,7 +39,6 @@ unsigned char* EndFunction) { const TargetMachine& TM = F.getTarget(); TD = TM.getTargetData(); - needsIndirectEncoding = TM.getMCAsmInfo()->getNeedsIndirectEncoding(); stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection(); RI = TM.getRegisterInfo(); JCE = &jce; @@ -608,7 +607,6 @@ unsigned char* EndFunction) { const TargetMachine& TM = F.getTarget(); TD = TM.getTargetData(); - needsIndirectEncoding = TM.getMCAsmInfo()->getNeedsIndirectEncoding(); stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection(); RI = TM.getRegisterInfo(); JCE = &jce; Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h?rev=81985&r1=81984&r2=81985&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h Tue Sep 15 20:29:11 2009 @@ -32,7 +32,6 @@ const TargetRegisterInfo* RI; MachineModuleInfo* MMI; JIT& Jit; - bool needsIndirectEncoding; bool stackGrowthDirection; unsigned char* EmitExceptionTable(MachineFunction* MF, From daniel at zuster.org Tue Sep 15 20:34:53 2009 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 16 Sep 2009 01:34:53 -0000 Subject: [llvm-commits] [llvm] r81987 - in /llvm/trunk/utils/lit: LitFormats.py TestFormats.py Message-ID: <200909160134.n8G1Yreo010423@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 15 20:34:52 2009 New Revision: 81987 URL: http://llvm.org/viewvc/llvm-project?rev=81987&view=rev Log: lit: Add a custom test format for use in clang. Modified: llvm/trunk/utils/lit/LitFormats.py llvm/trunk/utils/lit/TestFormats.py Modified: llvm/trunk/utils/lit/LitFormats.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/LitFormats.py?rev=81987&r1=81986&r2=81987&view=diff ============================================================================== --- llvm/trunk/utils/lit/LitFormats.py (original) +++ llvm/trunk/utils/lit/LitFormats.py Tue Sep 15 20:34:52 2009 @@ -1,2 +1,2 @@ -from TestFormats import GoogleTest, ShTest, TclTest +from TestFormats import GoogleTest, ShTest, TclTest, SyntaxCheckTest Modified: llvm/trunk/utils/lit/TestFormats.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/TestFormats.py?rev=81987&r1=81986&r2=81987&view=diff ============================================================================== --- llvm/trunk/utils/lit/TestFormats.py (original) +++ llvm/trunk/utils/lit/TestFormats.py Tue Sep 15 20:34:52 2009 @@ -89,3 +89,56 @@ class TclTest(FileBasedTest): def execute(self, test, litConfig): return TestRunner.executeTclTest(test, litConfig) + +### + +import re +import tempfile + +class SyntaxCheckTest: + # FIXME: Refactor into generic test for running some command on a directory + # of inputs. + + def __init__(self, compiler, dir, recursive, pattern, extra_cxx_args=[]): + self.compiler = str(compiler) + self.dir = str(dir) + self.recursive = bool(recursive) + self.pattern = re.compile(pattern) + self.extra_cxx_args = list(extra_cxx_args) + + def getTestsInDirectory(self, testSuite, path_in_suite, + litConfig, localConfig): + for dirname,subdirs,filenames in os.walk(self.dir): + if not self.recursive: + subdirs[:] = [] + + for filename in filenames: + if (not self.pattern.match(filename) or + filename in localConfig.excludes): + continue + + path = os.path.join(dirname,filename) + suffix = path[len(self.dir):] + if suffix.startswith(os.sep): + suffix = suffix[1:] + test = Test.Test(testSuite, + path_in_suite + tuple(suffix.split(os.sep)), + localConfig) + # FIXME: Hack? + test.source_path = path + yield test + + def execute(self, test, litConfig): + tmp = tempfile.NamedTemporaryFile(suffix='.cpp') + print >>tmp, '#include "%s"' % test.source_path + tmp.flush() + + cmd = [self.compiler, '-x', 'c++', '-fsyntax-only', tmp.name] + cmd.extend(self.extra_cxx_args) + out, err, exitCode = TestRunner.executeCommand(cmd) + + diags = out + err + if not exitCode and not diags.strip(): + return Test.PASS,'' + + return Test.FAIL, diags From vhernandez at apple.com Tue Sep 15 20:37:48 2009 From: vhernandez at apple.com (Victor Hernandez) Date: Tue, 15 Sep 2009 18:37:48 -0700 Subject: [llvm-commits] [PATCH] extend SelectionDAGBuild to treat malloc calls the same as MallocInst (patch #4) In-Reply-To: References: <05892D6F-5D3B-45FD-8FA0-82EB6A686B63@apple.com> Message-ID: <669A9FAC-73A2-4782-B5A1-0F8C97DB0C60@apple.com> On Sep 15, 2009, at 2:39 PM, Eli Friedman wrote: > On Tue, Sep 15, 2009 at 1:44 PM, Victor Hernandez > wrote: >> SelectionDAGBuild is the only pass in CodeGen that handles MallocInst >> specially. This patch extends that code to handle malloc calls also. > > This part is both wrong and not necessary. > Eli, Thanks for the feedback. I was under the impression that visitMalloc() did something malloc- specific that was needed even when using a malloc call and bitcast instead of MallocInst. Looking at the code, I see that visitCall() and visitBitCast() do all that is necessary for SelectionDAG translating. Do you have any thoughts on the 3 other patches I sent out? thanks, Victor From sabre at nondot.org Tue Sep 15 20:47:02 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 01:47:02 -0000 Subject: [llvm-commits] [llvm] r81991 - in /llvm/trunk: include/llvm/MC/MCAsmInfo.h include/llvm/Target/TargetLoweringObjectFile.h lib/CodeGen/AsmPrinter/DwarfException.cpp lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp lib/Target/PowerPC/PPCMCAsmInfo.cpp lib/Target/TargetLoweringObjectFile.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86MCAsmInfo.cpp lib/Target/X86/X86TargetObjectFile.cpp lib/Target/X86/X86TargetObjectFile.h Message-ID: <200909160147.n8G1lBVu011949@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 20:46:41 2009 New Revision: 81991 URL: http://llvm.org/viewvc/llvm-project?rev=81991&view=rev Log: Big change #1 for personality function references: Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding fields from MAI: they aren't part of the asm syntax, they are related to the structure of the object file. To replace their functionality, add a new TLOF::getSymbolForDwarfGlobalReference method which asks targets to decide how to reference a global from EH in a pc-relative way. The default implementation just returns the symbol. The default darwin implementation references the symbol through an indirect $non_lazy_ptr stub. The bizarro x86-64 darwin specialization handles the weird "foo at GOTPCREL+4" hack. DwarfException.cpp now uses this to emit the reference to the symbol in the right way, and this also eliminates another horrible hack from DwarfException.cpp: - if (strcmp(MAI->getPersonalitySuffix(), "+4 at GOTPCREL")) - O << "-" << MAI->getPCSymbol(); Added: llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp llvm/trunk/lib/Target/X86/X86TargetObjectFile.h Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp llvm/trunk/lib/MC/MCAsmInfo.cpp llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original) +++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Tue Sep 15 20:46:41 2009 @@ -84,17 +84,6 @@ /// is "l" on Darwin, currently used for some ObjC metadata. const char *LinkerPrivateGlobalPrefix; // Defaults to "" - /// PersonalityPrefix/Suffix - If these are nonempty, these strings will - /// enclose any personality function in the common frame section. - /// - const char *PersonalityPrefix; // Defaults to "" - const char *PersonalitySuffix; // Defaults to "" - - /// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit - /// for EH in Dwarf. - /// - bool NeedsIndirectEncoding; // Defaults to false - /// InlineAsmStart/End - If these are nonempty, they contain a directive to /// emit before and after an inline assembly statement. const char *InlineAsmStart; // Defaults to "#APP\n" @@ -353,15 +342,6 @@ const char *getLinkerPrivateGlobalPrefix() const { return LinkerPrivateGlobalPrefix; } - const char *getPersonalityPrefix() const { - return PersonalityPrefix; - } - const char *getPersonalitySuffix() const { - return PersonalitySuffix; - } - bool getNeedsIndirectEncoding() const { - return NeedsIndirectEncoding; - } const char *getInlineAsmStart() const { return InlineAsmStart; } Modified: llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h (original) +++ llvm/trunk/include/llvm/Target/TargetLoweringObjectFile.h Tue Sep 15 20:46:41 2009 @@ -26,6 +26,7 @@ class StringRef; class TargetMachine; class MCAsmInfo; + class MCExpr; class TargetLoweringObjectFile { MCContext *Ctx; @@ -173,6 +174,22 @@ return 0; } + /// getSymbolForDwarfGlobalReference - Return an MCExpr to use for a + /// pc-relative reference to the specified global variable from exception + /// handling information. In addition to the symbol, this returns + /// by-reference: + /// + /// IsIndirect - True if the returned symbol is actually a stub that contains + /// the address of the symbol, false if the symbol is the global itself. + /// + /// IsPCRel - True if the symbol reference is already pc-relative, false if + /// the caller needs to subtract off the address of the reference from the + /// symbol. + /// + virtual const MCExpr * + getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + bool &IsIndirect, bool &IsPCRel) const; + protected: virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, @@ -298,6 +315,12 @@ const MCSection *getNonLazySymbolPointerSection() const { return NonLazySymbolPointerSection; } + + /// getSymbolForDwarfGlobalReference - The mach-o version of this method + /// defaults to returning a stub reference. + virtual const MCExpr * + getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + bool &IsIndirect, bool &IsPCRel) const; }; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Sep 15 20:46:41 2009 @@ -17,9 +17,11 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineLocation.h" +#include "llvm/MC/MCAsmInfo.h" +#include "llvm/MC/MCContext.h" +#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSection.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" @@ -75,20 +77,22 @@ /// EmitCIE - Emit a Common Information Entry (CIE). This holds information that /// is shared among many Frame Description Entries. There is at least one CIE /// in every non-empty .debug_frame section. -void DwarfException::EmitCIE(const Function *Personality, unsigned Index) { +void DwarfException::EmitCIE(const Function *PersonalityFn, unsigned Index) { // Size and sign of stack growth. int stackGrowth = Asm->TM.getFrameInfo()->getStackGrowthDirection() == TargetFrameInfo::StackGrowsUp ? TD->getPointerSize() : -TD->getPointerSize(); + const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); + // Begin eh frame section. - Asm->OutStreamer.SwitchSection(Asm->getObjFileLowering().getEHFrameSection()); + Asm->OutStreamer.SwitchSection(TLOF.getEHFrameSection()); if (MAI->is_EHSymbolPrivate()) O << MAI->getPrivateGlobalPrefix(); - O << "EH_frame" << Index << ":\n"; + EmitLabel("section_eh_frame", Index); // Define base labels. @@ -107,11 +111,22 @@ Asm->EOL("CIE Version"); // The personality presence indicates that language specific information will - // show up in the eh frame. - - // FIXME: Don't hardcode these encodings. + // show up in the eh frame. Find out how we are supposed to lower the + // personality function reference: + const MCExpr *PersonalityRef = 0; + bool IsPersonalityIndirect = false, IsPersonalityPCRel = false; + if (PersonalityFn) { + // FIXME: HANDLE STATIC CODEGEN MODEL HERE. + + // In non-static mode, ask the object file how to represent this reference. + PersonalityRef = + TLOF.getSymbolForDwarfGlobalReference(PersonalityFn, Asm->Mang, + IsPersonalityIndirect, + IsPersonalityPCRel); + } + unsigned PerEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; - if (Personality && MAI->getNeedsIndirectEncoding()) + if (IsPersonalityIndirect) PerEncoding |= dwarf::DW_EH_PE_indirect; unsigned LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; unsigned FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; @@ -120,7 +135,7 @@ unsigned AugmentationSize = 0; char *APtr = Augmentation + 1; - if (Personality) { + if (PersonalityRef) { // There is a personality function. *APtr++ = 'P'; AugmentationSize += 1 + SizeOfEncodedValue(PerEncoding); @@ -159,15 +174,27 @@ Asm->EOL("Personality", PerEncoding); // If there is a personality, we need to indicate the function's location. - if (Personality) { - O << MAI->getData32bitsDirective(); - - O << MAI->getPersonalityPrefix(); - O << Asm->Mang->getMangledName(Personality); - O << MAI->getPersonalitySuffix(); + if (PersonalityRef) { + // If the reference to the personality function symbol is not already + // pc-relative, then we need to subtract our current address from it. Do + // this by emitting a label and subtracting it from the expression we + // already have. This is equivalent to emitting "foo - .", but we have to + // emit the label for "." directly. + if (!IsPersonalityPCRel) { + SmallString<64> Name; + raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix() + << "personalityref_addr" << Asm->getFunctionNumber() << "_" << Index; + MCSymbol *DotSym = Asm->OutContext.GetOrCreateSymbol(Name.str()); + Asm->OutStreamer.EmitLabel(DotSym); + + PersonalityRef = + MCBinaryExpr::CreateSub(PersonalityRef, + MCSymbolRefExpr::Create(DotSym,Asm->OutContext), + Asm->OutContext); + } - if (strcmp(MAI->getPersonalitySuffix(), "+4 at GOTPCREL")) - O << "-" << MAI->getPCSymbol(); + O << MAI->getData32bitsDirective(); + PersonalityRef->print(O, MAI); Asm->EOL("Personality"); Asm->EmitInt8(LSDAEncoding); @@ -185,8 +212,7 @@ // On Darwin the linker honors the alignment of eh_frame, which means it must // be 8-byte on 64-bit targets to match what gcc does. Otherwise you get // holes which confuse readers of eh_frame. - Asm->EmitAlignment(TD->getPointerSize() == sizeof(int32_t) ? 2 : 3, - 0, 0, false); + Asm->EmitAlignment(TD->getPointerSize() == 4 ? 2 : 3, 0, 0, false); EmitLabel("eh_frame_common_end", Index); Asm->EOL(); Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfo.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfo.cpp Tue Sep 15 20:46:41 2009 @@ -30,9 +30,6 @@ GlobalPrefix = ""; PrivateGlobalPrefix = "."; LinkerPrivateGlobalPrefix = ""; - PersonalityPrefix = ""; - PersonalitySuffix = ""; - NeedsIndirectEncoding = false; InlineAsmStart = "APP"; InlineAsmEnd = "NO_APP"; AssemblerDialect = 0; Modified: llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp (original) +++ llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Tue Sep 15 20:46:41 2009 @@ -20,9 +20,8 @@ // Syntax: GlobalPrefix = "_"; PrivateGlobalPrefix = "L"; - LinkerPrivateGlobalPrefix = "l"; // Marker for some ObjC metadata + LinkerPrivateGlobalPrefix = "l"; NeedsSet = true; - NeedsIndirectEncoding = true; AllowQuotesInName = true; HasSingleParameterDotFile = false; Modified: llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCMCAsmInfo.cpp Tue Sep 15 20:46:41 2009 @@ -22,9 +22,6 @@ if (!is64Bit) Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. AssemblerDialect = 1; // New-Style mnemonics. - - PersonalityPrefix = "L"; - PersonalitySuffix = "$non_lazy_ptr"; } PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) { Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original) +++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Tue Sep 15 20:46:41 2009 @@ -18,6 +18,7 @@ #include "llvm/Function.h" #include "llvm/GlobalVariable.h" #include "llvm/MC/MCContext.h" +#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSectionELF.h" #include "llvm/Target/TargetData.h" @@ -275,6 +276,30 @@ return DataSection; } +/// getSymbolForDwarfGlobalReference - Return an MCExpr to use for a +/// pc-relative reference to the specified global variable from exception +/// handling information. In addition to the symbol, this returns +/// by-reference: +/// +/// IsIndirect - True if the returned symbol is actually a stub that contains +/// the address of the symbol, false if the symbol is the global itself. +/// +/// IsPCRel - True if the symbol reference is already pc-relative, false if +/// the caller needs to subtract off the address of the reference from the +/// symbol. +/// +const MCExpr *TargetLoweringObjectFile:: +getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + bool &IsIndirect, bool &IsPCRel) const { + // The generic implementation of this just returns a direct reference to the + // symbol. + IsIndirect = false; + IsPCRel = false; + + SmallString<128> Name; + Mang->getNameWithPrefix(Name, GV, false); + return MCSymbolRefExpr::Create(Name.str(), getContext()); +} //===----------------------------------------------------------------------===// @@ -929,6 +954,19 @@ return true; } +const MCExpr *TargetLoweringObjectFileMachO:: +getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + bool &IsIndirect, bool &IsPCRel) const { + // The mach-o version of this method defaults to returning a stub reference. + IsIndirect = true; + IsPCRel = false; + + SmallString<128> Name; + Mang->getNameWithPrefix(Name, GV, true); + Name += "$non_lazy_ptr"; + return MCSymbolRefExpr::Create(Name.str(), getContext()); +} + //===----------------------------------------------------------------------===// // COFF @@ -1046,3 +1084,4 @@ return getDataSection(); } + Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Sep 15 20:46:41 2009 @@ -16,6 +16,7 @@ #include "X86InstrBuilder.h" #include "X86ISelLowering.h" #include "X86TargetMachine.h" +#include "X86TargetObjectFile.h" #include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" @@ -36,7 +37,6 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetOptions.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/StringExtras.h" @@ -63,6 +63,8 @@ switch (TM.getSubtarget().TargetType) { default: llvm_unreachable("unknown subtarget type"); case X86Subtarget::isDarwin: + if (TM.getSubtarget().is64Bit()) + return new X8664_MachoTargetObjectFile(); return new TargetLoweringObjectFileMachO(); case X86Subtarget::isELF: return new TargetLoweringObjectFileELF(); Modified: llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp?rev=81991&r1=81990&r2=81991&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp Tue Sep 15 20:46:41 2009 @@ -57,14 +57,6 @@ // Leopard and above support aligned common symbols. COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9; - if (is64Bit) { - PersonalityPrefix = ""; - PersonalitySuffix = "+4 at GOTPCREL"; - } else { - PersonalityPrefix = "L"; - PersonalitySuffix = "$non_lazy_ptr"; - } - CommentString = "##"; PCSymbol = "."; Added: llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp?rev=81991&view=auto ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp (added) +++ llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp Tue Sep 15 20:46:41 2009 @@ -0,0 +1,33 @@ +//===-- llvm/Target/X86/X86TargetObjectFile.cpp - X86 Object Info ---------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "X86TargetObjectFile.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/Support/Mangler.h" +#include "llvm/MC/MCExpr.h" +using namespace llvm; + +const MCExpr *X8664_MachoTargetObjectFile:: +getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + bool &IsIndirect, bool &IsPCRel) const { + + // On Darwin/X86-64, we can reference dwarf symbols with foo at GOTPCREL+4, which + // is an indirect pc-relative reference. + IsIndirect = true; + IsPCRel = true; + + SmallString<128> Name; + Mang->getNameWithPrefix(Name, GV, false); + Name += "@GOTPCREL"; + const MCExpr *Res = + MCSymbolRefExpr::Create(Name.str(), getContext()); + const MCExpr *Four = MCConstantExpr::Create(4, getContext()); + return MCBinaryExpr::CreateAdd(Res, Four, getContext()); +} + Added: llvm/trunk/lib/Target/X86/X86TargetObjectFile.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetObjectFile.h?rev=81991&view=auto ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetObjectFile.h (added) +++ llvm/trunk/lib/Target/X86/X86TargetObjectFile.h Tue Sep 15 20:46:41 2009 @@ -0,0 +1,28 @@ +//===-- llvm/Target/X86/X86TargetObjectFile.h - X86 Object Info -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TARGET_X86_TARGETOBJECTFILE_H +#define LLVM_TARGET_X86_TARGETOBJECTFILE_H + +#include "llvm/Target/TargetLoweringObjectFile.h" + +namespace llvm { + + /// X8664_MachoTargetObjectFile - This TLOF implementation is used for + /// Darwin/x86-64. + class X8664_MachoTargetObjectFile : public TargetLoweringObjectFileMachO { + public: + + virtual const MCExpr * + getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + bool &IsIndirect, bool &IsPCRel) const; + }; +} // end namespace llvm + +#endif From scallanan at apple.com Tue Sep 15 20:55:01 2009 From: scallanan at apple.com (Sean Callanan) Date: Wed, 16 Sep 2009 01:55:01 -0000 Subject: [llvm-commits] [llvm] r81992 - /llvm/trunk/lib/Target/X86/X86InstrFPStack.td Message-ID: <200909160155.n8G1tCj7012895@zion.cs.uiuc.edu> Author: spyffe Date: Tue Sep 15 20:54:38 2009 New Revision: 81992 URL: http://llvm.org/viewvc/llvm-project?rev=81992&view=rev Log: Removed a few instructions that were already covered by other definitions. Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=81992&r1=81991&r2=81992&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Tue Sep 15 20:54:38 2009 @@ -317,10 +317,7 @@ def FCOM64m : FPI<0xDC, MRM2m, (outs), (ins f64mem:$src), "fcom\t$src">; def FCOMP64m : FPI<0xDC, MRM3m, (outs), (ins f64mem:$src), "fcomp\t$src">; -def FLD64m : FPI<0xDD, MRM0m, (outs), (ins f64mem:$src), "fld\t$src">; def FISTTP32m: FPI<0xDD, MRM1m, (outs i32mem:$dst), (ins), "fisttp{l}\t$dst">; -def FST64m : FPI<0xDD, MRM2m, (outs f64mem:$dst), (ins), "fst\t$dst">; -def FSTP64m : FPI<0xDD, MRM3m, (outs f64mem:$dst), (ins), "fld\t$dst">; def FRSTORm : FPI<0xDD, MRM4m, (outs f32mem:$dst), (ins), "frstor\t$dst">; def FSAVEm : FPI<0xDD, MRM6m, (outs f32mem:$dst), (ins), "fsave\t$dst">; def FSTSWm : FPI<0xDD, MRM7m, (outs f32mem:$dst), (ins), "fstsw\t$dst">; @@ -329,9 +326,7 @@ def FICOMP16m: FPI<0xDE, MRM3m, (outs), (ins i16mem:$src), "ficomp{w}\t$src">; def FBLDm : FPI<0xDF, MRM4m, (outs), (ins f32mem:$src), "fbld\t$src">; -def FILD64m : FPI<0xDF, MRM5m, (outs), (ins i64mem:$src), "fild{q}\t$src">; def FBSTPm : FPI<0xDF, MRM6m, (outs f32mem:$dst), (ins), "fbstp\t$dst">; -def FISTP64m : FPI<0xDF, MRM7m, (outs i64mem:$dst), (ins), "fistp{q}\t$dst">; // Floating point cmovs. multiclass FPCMov { From gohman at apple.com Tue Sep 15 21:02:10 2009 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Sep 2009 02:02:10 -0000 Subject: [llvm-commits] [llvm] r81993 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/phi-merge-gep.ll Message-ID: <200909160202.n8G22EkD013750@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 15 21:01:52 2009 New Revision: 81993 URL: http://llvm.org/viewvc/llvm-project?rev=81993&view=rev Log: Don't sink gep operators through phi nodes if the result would require more than one phi, since that leads to higher register pressure on entry to the phi. This is especially problematic when the phi is in a loop header, as it increases register pressure throughout the loop. Added: llvm/trunk/test/Transforms/InstCombine/phi-merge-gep.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=81993&r1=81992&r2=81993&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Sep 15 21:01:52 2009 @@ -326,7 +326,7 @@ // instruction. Instead, visit methods should return the value returned by // this function. Instruction *EraseInstFromFunction(Instruction &I) { - DEBUG(errs() << "IC: erase " << I); + DEBUG(errs() << "IC: erase " << I << '\n'); assert(I.use_empty() && "Cannot erase instruction that is used!"); // Make sure that we reprocess all operands now that we reduced their @@ -10401,6 +10401,10 @@ // This is true if all GEP bases are allocas and if all indices into them are // constants. bool AllBasePointersAreAllocas = true; + + // We don't want to replace this phi if the replacement would require + // more than one phi. + bool NeededPhi = false; // Scan to see if all operands are the same opcode, all have one use, and all // kill their operands (i.e. the operands have one use). @@ -10432,7 +10436,16 @@ if (FirstInst->getOperand(op)->getType() !=GEP->getOperand(op)->getType()) return 0; + + // If we already needed a PHI for an earlier operand, and another operand + // also requires a PHI, we'd be introducing more PHIs than we're + // eliminating, which increases register pressure on entry to the PHI's + // block. + if (NeededPhi) + return 0; + FixedOperands[op] = 0; // Needs a PHI. + NeededPhi = true; } } Added: llvm/trunk/test/Transforms/InstCombine/phi-merge-gep.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/phi-merge-gep.ll?rev=81993&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/phi-merge-gep.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/phi-merge-gep.ll Tue Sep 15 21:01:52 2009 @@ -0,0 +1,101 @@ +; RUN: opt < %s -S -instcombine > %t +; RUN: grep {= getelementptr} %t | count 20 +; RUN: grep {= phi} %t | count 13 + +; Don't push the geps through these phis; they have multiple uses! + +define void @foo(float* %Ar, float* %Ai, i64 %As, float* %Cr, float* %Ci, i64 %Cs, i64 %n) nounwind { +entry: + %0 = getelementptr inbounds float* %Ar, i64 0 ; [#uses=1] + %1 = getelementptr inbounds float* %Ai, i64 0 ; [#uses=1] + %2 = mul i64 %n, %As ; [#uses=1] + %3 = getelementptr inbounds float* %Ar, i64 %2 ; [#uses=1] + %4 = mul i64 %n, %As ; [#uses=1] + %5 = getelementptr inbounds float* %Ai, i64 %4 ; [#uses=1] + %6 = mul i64 %n, 2 ; [#uses=1] + %7 = mul i64 %6, %As ; [#uses=1] + %8 = getelementptr inbounds float* %Ar, i64 %7 ; [#uses=1] + %9 = mul i64 %n, 2 ; [#uses=1] + %10 = mul i64 %9, %As ; [#uses=1] + %11 = getelementptr inbounds float* %Ai, i64 %10 ; [#uses=1] + %12 = getelementptr inbounds float* %Cr, i64 0 ; [#uses=1] + %13 = getelementptr inbounds float* %Ci, i64 0 ; [#uses=1] + %14 = mul i64 %n, %Cs ; [#uses=1] + %15 = getelementptr inbounds float* %Cr, i64 %14 ; [#uses=1] + %16 = mul i64 %n, %Cs ; [#uses=1] + %17 = getelementptr inbounds float* %Ci, i64 %16 ; [#uses=1] + %18 = mul i64 %n, 2 ; [#uses=1] + %19 = mul i64 %18, %Cs ; [#uses=1] + %20 = getelementptr inbounds float* %Cr, i64 %19 ; [#uses=1] + %21 = mul i64 %n, 2 ; [#uses=1] + %22 = mul i64 %21, %Cs ; [#uses=1] + %23 = getelementptr inbounds float* %Ci, i64 %22 ; [#uses=1] + br label %bb13 + +bb: ; preds = %bb13 + %24 = load float* %A0r.0, align 4 ; [#uses=1] + %25 = load float* %A0i.0, align 4 ; [#uses=1] + %26 = load float* %A1r.0, align 4 ; [#uses=2] + %27 = load float* %A1i.0, align 4 ; [#uses=2] + %28 = load float* %A2r.0, align 4 ; [#uses=2] + %29 = load float* %A2i.0, align 4 ; [#uses=2] + %30 = fadd float %26, %28 ; [#uses=2] + %31 = fadd float %27, %29 ; [#uses=2] + %32 = fsub float %26, %28 ; [#uses=1] + %33 = fsub float %27, %29 ; [#uses=1] + %34 = fadd float %24, %30 ; [#uses=2] + %35 = fadd float %25, %31 ; [#uses=2] + %36 = fmul float %30, -1.500000e+00 ; [#uses=1] + %37 = fmul float %31, -1.500000e+00 ; [#uses=1] + %38 = fadd float %34, %36 ; [#uses=2] + %39 = fadd float %35, %37 ; [#uses=2] + %40 = fmul float %32, 0x3FEBB67AE0000000 ; [#uses=2] + %41 = fmul float %33, 0x3FEBB67AE0000000 ; [#uses=2] + %42 = fadd float %38, %41 ; [#uses=1] + %43 = fsub float %39, %40 ; [#uses=1] + %44 = fsub float %38, %41 ; [#uses=1] + %45 = fadd float %39, %40 ; [#uses=1] + store float %34, float* %C0r.0, align 4 + store float %35, float* %C0i.0, align 4 + store float %42, float* %C1r.0, align 4 + store float %43, float* %C1i.0, align 4 + store float %44, float* %C2r.0, align 4 + store float %45, float* %C2i.0, align 4 + %46 = getelementptr inbounds float* %A0r.0, i64 %As ; [#uses=1] + %47 = getelementptr inbounds float* %A0i.0, i64 %As ; [#uses=1] + %48 = getelementptr inbounds float* %A1r.0, i64 %As ; [#uses=1] + %49 = getelementptr inbounds float* %A1i.0, i64 %As ; [#uses=1] + %50 = getelementptr inbounds float* %A2r.0, i64 %As ; [#uses=1] + %51 = getelementptr inbounds float* %A2i.0, i64 %As ; [#uses=1] + %52 = getelementptr inbounds float* %C0r.0, i64 %Cs ; [#uses=1] + %53 = getelementptr inbounds float* %C0i.0, i64 %Cs ; [#uses=1] + %54 = getelementptr inbounds float* %C1r.0, i64 %Cs ; [#uses=1] + %55 = getelementptr inbounds float* %C1i.0, i64 %Cs ; [#uses=1] + %56 = getelementptr inbounds float* %C2r.0, i64 %Cs ; [#uses=1] + %57 = getelementptr inbounds float* %C2i.0, i64 %Cs ; [#uses=1] + %58 = add nsw i64 %i.0, 1 ; [#uses=1] + br label %bb13 + +bb13: ; preds = %bb, %entry + %i.0 = phi i64 [ 0, %entry ], [ %58, %bb ] ; [#uses=2] + %C2i.0 = phi float* [ %23, %entry ], [ %57, %bb ] ; [#uses=2] + %C2r.0 = phi float* [ %20, %entry ], [ %56, %bb ] ; [#uses=2] + %C1i.0 = phi float* [ %17, %entry ], [ %55, %bb ] ; [#uses=2] + %C1r.0 = phi float* [ %15, %entry ], [ %54, %bb ] ; [#uses=2] + %C0i.0 = phi float* [ %13, %entry ], [ %53, %bb ] ; [#uses=2] + %C0r.0 = phi float* [ %12, %entry ], [ %52, %bb ] ; [#uses=2] + %A2i.0 = phi float* [ %11, %entry ], [ %51, %bb ] ; [#uses=2] + %A2r.0 = phi float* [ %8, %entry ], [ %50, %bb ] ; [#uses=2] + %A1i.0 = phi float* [ %5, %entry ], [ %49, %bb ] ; [#uses=2] + %A1r.0 = phi float* [ %3, %entry ], [ %48, %bb ] ; [#uses=2] + %A0i.0 = phi float* [ %1, %entry ], [ %47, %bb ] ; [#uses=2] + %A0r.0 = phi float* [ %0, %entry ], [ %46, %bb ] ; [#uses=2] + %59 = icmp slt i64 %i.0, %n ; [#uses=1] + br i1 %59, label %bb, label %bb14 + +bb14: ; preds = %bb13 + br label %return + +return: ; preds = %bb14 + ret void +} From scallanan at apple.com Tue Sep 15 21:28:54 2009 From: scallanan at apple.com (Sean Callanan) Date: Wed, 16 Sep 2009 02:28:54 -0000 Subject: [llvm-commits] [llvm] r81994 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td Message-ID: <200909160228.n8G2SvGE016899@zion.cs.uiuc.edu> Author: spyffe Date: Tue Sep 15 21:28:43 2009 New Revision: 81994 URL: http://llvm.org/viewvc/llvm-project?rev=81994&view=rev Log: Added the definitions for one-bit left shifts to the Intel instruction tables. The patterns will stay blank because ADD reg, reg is faster, but having the encoding available is useful for the disassembler. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=81994&r1=81993&r2=81994&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Sep 15 21:28:43 2009 @@ -752,8 +752,10 @@ def SHL64ri : RIi8<0xC1, MRM4r, (outs GR64:$dst), (ins GR64:$src1, i8imm:$src2), "shl{q}\t{$src2, $dst|$dst, $src2}", [(set GR64:$dst, (shl GR64:$src1, (i8 imm:$src2)))]>; -// NOTE: We don't use shifts of a register by one, because 'add reg,reg' is -// cheaper. +// NOTE: We don't include patterns for shifts of a register by one, because +// 'add reg,reg' is cheaper. +def SHL64r1 : RI<0xD1, MRM4r, (outs GR64:$dst), (ins GR64:$src1), + "shr{q}\t$dst", []>; } // isTwoAddress let Uses = [CL] in Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=81994&r1=81993&r2=81994&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Sep 15 21:28:43 2009 @@ -1974,8 +1974,17 @@ def SHL32ri : Ii8<0xC1, MRM4r, (outs GR32:$dst), (ins GR32:$src1, i8imm:$src2), "shl{l}\t{$src2, $dst|$dst, $src2}", [(set GR32:$dst, (shl GR32:$src1, (i8 imm:$src2)))]>; -// NOTE: We don't use shifts of a register by one, because 'add reg,reg' is -// cheaper. + +// NOTE: We don't include patterns for shifts of a register by one, because +// 'add reg,reg' is cheaper. + +def SHL8r1 : I<0xD0, MRM4r, (outs GR8:$dst), (ins GR8:$src1), + "shl{b}\t$dst", []>; +def SHL16r1 : I<0xD1, MRM4r, (outs GR16:$dst), (ins GR16:$src1), + "shl{w}\t$dst", []>, OpSize; +def SHL32r1 : I<0xD1, MRM4r, (outs GR32:$dst), (ins GR32:$src1), + "shl{l}\t$dst", []>; + } // isConvertibleToThreeAddress = 1 let isTwoAddress = 0 in { From scallanan at apple.com Tue Sep 15 21:57:14 2009 From: scallanan at apple.com (Sean Callanan) Date: Wed, 16 Sep 2009 02:57:14 -0000 Subject: [llvm-commits] [llvm] r81995 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200909160257.n8G2vFYj020545@zion.cs.uiuc.edu> Author: spyffe Date: Tue Sep 15 21:57:13 2009 New Revision: 81995 URL: http://llvm.org/viewvc/llvm-project?rev=81995&view=rev Log: Added the ENTER instruction, which sets up a stack frame, to the Intel instruction tables. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=81995&r1=81994&r2=81995&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Sep 15 21:57:13 2009 @@ -694,6 +694,11 @@ "lcall{l}\t{*}$dst", []>; } +// Constructing a stack frame. + +def ENTER : I<0xC8, RawFrm, (outs), (ins i16imm:$len, i8imm:$lvl), + "enter\t$len, $lvl", []>; + // Tail call stuff. let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in From eli.friedman at gmail.com Tue Sep 15 22:02:54 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Tue, 15 Sep 2009 20:02:54 -0700 Subject: [llvm-commits] [PATCH] extend analysis passes to treat malloc calls the same as MallocInst (patch #2) In-Reply-To: <13429790-6CCE-4644-A1EE-A554440F22E7@apple.com> References: <13429790-6CCE-4644-A1EE-A554440F22E7@apple.com> Message-ID: On Tue, Sep 15, 2009 at 1:44 PM, Victor Hernandez wrote: > These are the changes to make all the analysis passes apply the same > analysis to malloc calls as to MallocInst. Index: lib/Analysis/AliasAnalysis.cpp =================================================================== --- lib/Analysis/AliasAnalysis.cpp (revision 81898) +++ lib/Analysis/AliasAnalysis.cpp (working copy) @@ -31,6 +31,7 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Instructions.h" #include "llvm/Type.h" +#include "llvm/Analysis/MallocHelper.h" #include "llvm/Target/TargetData.h" using namespace llvm; @@ -239,7 +240,7 @@ /// NoAlias returns /// bool llvm::isIdentifiedObject(const Value *V) { - if (isa(V) || isNoAliasCall(V)) + if (isa(V) || isMalloc(V) || isNoAliasCall(V)) return true; if (isa(V) && !isa(V)) return true; Unnecessary change, assuming malloc gets a noalias attribute; isIdentifiedObject is only used on values with the bitcasts stripped off. Index: lib/Analysis/BasicAliasAnalysis.cpp =================================================================== --- lib/Analysis/BasicAliasAnalysis.cpp (revision 81898) +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) @@ -15,6 +15,7 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/CaptureTracking.h" +#include "llvm/Analysis/MallocHelper.h" #include "llvm/Analysis/Passes.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" @@ -82,7 +83,7 @@ /// object that never escapes from the function. static bool isNonEscapingLocalObject(const Value *V) { // If this is a local allocation, check to see if it escapes. - if (isa(V) || isNoAliasCall(V)) + if (isa(V) || isMalloc(V) || isNoAliasCall(V)) return !PointerMayBeCaptured(V, false); // If this is an argument that corresponds to a byval or noalias argument, Same as above. @@ -111,6 +112,20 @@ AccessTy = AI->getType()->getElementType(); else return false; + } else if (const CallInst* CI = extractMallocCall(V)) { + if (isArrayMalloc(V)) + return false; + if (const Type* PT = getMallocAllocatedType(CI)) + AccessTy = PT; + else + return false; + } else if (const CallInst* CI = extractMallocCallFromBitCast(V)) { + if (isArrayMalloc(V)) + return false; + if (const Type* PT = getMallocAllocatedType(CI)) + AccessTy = PT; + else + return false; } else if (const Argument *A = dyn_cast(V)) { if (A->hasByValAttr()) AccessTy = cast(A->getType())->getElementType(); It would be much more straightforward to just use the size argument to the malloc here; also, V is never a bitcast. @@ -328,8 +343,8 @@ return NoAlias; // Arguments can't alias with local allocations or noalias calls. - if ((isa(O1) && (isa(O2) || isNoAliasCall(O2))) || - (isa(O2) && (isa(O1) || isNoAliasCall(O1)))) + if ((isa(O1) && (isa(O2) || isMalloc(O2) || isNoAliasCall(O2))) || + (isa(O2) && (isa(O1) || isMalloc(O1) || isNoAliasCall(O1)))) return NoAlias; // Most objects can't alias null. Unnecessary change, assuming malloc gets a noalias attribute. Index: lib/Analysis/PointerTracking.cpp =================================================================== --- lib/Analysis/PointerTracking.cpp (revision 81898) +++ lib/Analysis/PointerTracking.cpp (working copy) @@ -13,6 +13,7 @@ #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/MallocHelper.h" #include "llvm/Analysis/PointerTracking.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" @@ -99,6 +100,22 @@ return SE->getSCEV(arraySize); } + if (CallInst *CI = extractMallocCall(V)) { + Value *arraySize = getMallocArraySize(CI); + Ty = getMallocAllocatedType(CI); + if (!Ty || !arraySize) return SE->getCouldNotCompute(); + // arraySize elements of type Ty. + return SE->getSCEV(arraySize); + } + + if (CallInst *CI = extractMallocCallFromBitCast(V)) { + Value *arraySize = getMallocArraySize(CI); + Ty = getMallocAllocatedType(CI); + if (!Ty || !arraySize) return SE->getCouldNotCompute(); + // arraySize elements of type Ty. + return SE->getSCEV(arraySize); + } + if (GlobalVariable *GV = dyn_cast(V)) { if (GV->hasDefinitiveInitializer()) { Constant *C = GV->getInitializer(); Will this mess up with malloc used as a char array? Index: lib/Analysis/ValueTracking.cpp =================================================================== --- lib/Analysis/ValueTracking.cpp (revision 81898) +++ lib/Analysis/ValueTracking.cpp (working copy) @@ -20,6 +20,7 @@ #include "llvm/IntrinsicInst.h" #include "llvm/LLVMContext.h" #include "llvm/Operator.h" +#include "llvm/Analysis/MallocHelper.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" @@ -621,6 +622,24 @@ break; } } + } else if (CallInst* CI = extractMallocCall(I)) { + unsigned Align = 0; + const Type* T = getMallocAllocatedType(CI); + if (TD && T) { + // Malloc returns maximally aligned memory. + Align = TD->getABITypeAlignment(T); + Align = + std::max(Align, + (unsigned)TD->getABITypeAlignment( + Type::getDoubleTy(V->getContext()))); + Align = + std::max(Align, + (unsigned)TD->getABITypeAlignment( + Type::getInt64Ty(V->getContext()))); + } + if (Align > 0) + KnownZero = Mask & APInt::getLowBitsSet(BitWidth, + CountTrailingZeros_32(Align)); } break; } This is simply wrong; we can't make that guarantee for malloc. Consider, for example, a malloc used as an SSE vector on Windows. More generally, getMallocAllocatedType seems a bit suspect in that an i8 array will get messed up by the change to getMallocAllocatedType. -Eli From natebegeman at mac.com Tue Sep 15 22:21:11 2009 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 16 Sep 2009 03:21:11 -0000 Subject: [llvm-commits] [llvm] r81996 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200909160321.n8G3LGOY023451@zion.cs.uiuc.edu> Author: sampo Date: Tue Sep 15 22:20:46 2009 New Revision: 81996 URL: http://llvm.org/viewvc/llvm-project?rev=81996&view=rev Log: Do not try and sink a load whose chain result has more than one use, when trying to create RMW opportunities in the x86 backend. This can cause a cycle to appear in the graph, since the other uses may eventually feed into the TokenFactor we are sinking the load below. Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=81996&r1=81995&r2=81996&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Sep 15 22:20:46 2009 @@ -364,7 +364,9 @@ Store.getOperand(2), Store.getOperand(3)); } -/// isRMWLoad - Return true if N is a load that's part of RMW sub-DAG. +/// isRMWLoad - Return true if N is a load that's part of RMW sub-DAG. The +/// chain produced by the load must only be used by the store's chain operand, +/// otherwise this may produce a cycle in the DAG. /// static bool isRMWLoad(SDValue N, SDValue Chain, SDValue Address, SDValue &Load) { @@ -382,8 +384,9 @@ return false; if (N.hasOneUse() && + LD->hasNUsesOfValue(1, 1) && N.getOperand(1) == Address && - N.getNode()->isOperandOf(Chain.getNode())) { + LD->isOperandOf(Chain.getNode())) { Load = N; return true; } From sabre at nondot.org Tue Sep 15 23:12:51 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 04:12:51 -0000 Subject: [llvm-commits] [llvm] r81997 - /llvm/trunk/tools/llvm-mc/AsmParser.cpp Message-ID: <200909160412.n8G4Cr1l029654@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 23:12:47 2009 New Revision: 81997 URL: http://llvm.org/viewvc/llvm-project?rev=81997&view=rev Log: use an accessor to simplify code. Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.cpp?rev=81997&r1=81996&r2=81997&view=diff ============================================================================== --- llvm/trunk/tools/llvm-mc/AsmParser.cpp (original) +++ llvm/trunk/tools/llvm-mc/AsmParser.cpp Tue Sep 15 23:12:47 2009 @@ -208,15 +208,12 @@ Res = MCUnaryExpr::CreateLNot(Res, getContext()); return false; case AsmToken::String: - case AsmToken::Identifier: { + case AsmToken::Identifier: // This is a label, this should be parsed as part of an expression, to // handle things like LFOO+4. - MCSymbol *Sym = CreateSymbol(Lexer.getTok().getIdentifier()); - - Res = MCSymbolRefExpr::Create(Sym, getContext()); + Res = MCSymbolRefExpr::Create(Lexer.getTok().getIdentifier(), getContext()); Lexer.Lex(); // Eat identifier. return false; - } case AsmToken::Integer: Res = MCConstantExpr::Create(Lexer.getTok().getIntVal(), getContext()); Lexer.Lex(); // Eat token. From tonic at nondot.org Tue Sep 15 23:31:10 2009 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 15 Sep 2009 23:31:10 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/register.php Message-ID: <200909160431.n8G4VAOL032087@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg: register.php updated: 1.7 -> 1.8 --- Log message: Registration cap of 190. --- Diffs of the changes: (+9 -0) register.php | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm-www/devmtg/register.php diff -u llvm-www/devmtg/register.php:1.7 llvm-www/devmtg/register.php:1.8 --- llvm-www/devmtg/register.php:1.7 Thu Jul 9 13:18:34 2009 +++ llvm-www/devmtg/register.php Tue Sep 15 23:26:19 2009 @@ -194,6 +194,15 @@ ?>
LLVM Developers' Meeting - Registration
+= 190){ +print '

Registration is now closed.

'; +exit; +} +?> Author: ssen Date: Tue Sep 15 23:44:00 2009 New Revision: 81999 URL: http://llvm.org/viewvc/llvm-project?rev=81999&view=rev Log: fix cmake build Modified: llvm/trunk/lib/Target/X86/CMakeLists.txt Modified: llvm/trunk/lib/Target/X86/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/CMakeLists.txt?rev=81999&r1=81998&r2=81999&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/CMakeLists.txt (original) +++ llvm/trunk/lib/Target/X86/CMakeLists.txt Tue Sep 15 23:44:00 2009 @@ -26,6 +26,7 @@ X86RegisterInfo.cpp X86Subtarget.cpp X86TargetMachine.cpp + X86TargetObjectFile.cpp X86FastISel.cpp ) From kremenek at apple.com Tue Sep 15 23:44:05 2009 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 16 Sep 2009 04:44:05 -0000 Subject: [llvm-commits] [llvm] r81998 - /llvm/tags/checker/checker-0.210/ Message-ID: <200909160444.n8G4i6cO001312@zion.cs.uiuc.edu> Author: kremenek Date: Tue Sep 15 23:44:00 2009 New Revision: 81998 URL: http://llvm.org/viewvc/llvm-project?rev=81998&view=rev Log: Removing checker-0.210. Removed: llvm/tags/checker/checker-0.210/ From kremenek at apple.com Tue Sep 15 23:44:57 2009 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 16 Sep 2009 04:44:57 -0000 Subject: [llvm-commits] [llvm] r82001 - /llvm/tags/checker/checker-0.220/ Message-ID: <200909160444.n8G4ivLL001456@zion.cs.uiuc.edu> Author: kremenek Date: Tue Sep 15 23:44:56 2009 New Revision: 82001 URL: http://llvm.org/viewvc/llvm-project?rev=82001&view=rev Log: Removing checker-0.220. Removed: llvm/tags/checker/checker-0.220/ From kremenek at apple.com Tue Sep 15 23:45:21 2009 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 16 Sep 2009 04:45:21 -0000 Subject: [llvm-commits] [llvm] r82003 - /llvm/tags/checker/checker-0.220/ Message-ID: <200909160445.n8G4jLcl001527@zion.cs.uiuc.edu> Author: kremenek Date: Tue Sep 15 23:45:20 2009 New Revision: 82003 URL: http://llvm.org/viewvc/llvm-project?rev=82003&view=rev Log: Tagging checker-0.220. Added: llvm/tags/checker/checker-0.220/ - copied from r82002, llvm/trunk/ From kremenek at apple.com Tue Sep 15 23:55:47 2009 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 16 Sep 2009 04:55:47 -0000 Subject: [llvm-commits] [llvm] r82005 - /llvm/tags/checker/checker-0.210/ Message-ID: <200909160455.n8G4tlSc002924@zion.cs.uiuc.edu> Author: kremenek Date: Tue Sep 15 23:55:35 2009 New Revision: 82005 URL: http://llvm.org/viewvc/llvm-project?rev=82005&view=rev Log: Restore checker-0.210 tag. Added: llvm/tags/checker/checker-0.210/ - copied from r81997, llvm/tags/checker/checker-0.210/ From sabre at nondot.org Tue Sep 15 23:57:26 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 04:57:26 -0000 Subject: [llvm-commits] [llvm] r82006 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Message-ID: <200909160457.n8G4vU1C003166@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 23:57:15 2009 New Revision: 82006 URL: http://llvm.org/viewvc/llvm-project?rev=82006&view=rev Log: remove the AsmPrinter::printMCInst hook hack now that we have MCInstPrinter. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=82006&r1=82005&r2=82006&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Sep 15 23:57:15 2009 @@ -321,12 +321,6 @@ /// EmitComments - Pretty-print comments for basic blocks void EmitComments(const MachineBasicBlock &MBB) const; - /// printMCInst - Print an MCInst for this target. - /// - /// Note, this is only a temporary hack to allow the MCStreamer to print - /// instructions, do not use this function outside of llvm-mc. - virtual void printMCInst(const MCInst *MI); - /// GetMBBSymbol - Return the MCSymbol corresponding to the specified basic /// block label. MCSymbol *GetMBBSymbol(unsigned MBBID) const; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=82006&r1=82005&r2=82006&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Sep 15 23:57:15 2009 @@ -1711,10 +1711,6 @@ O << Offset; } -void AsmPrinter::printMCInst(const MCInst *MI) { - llvm_unreachable("MCInst printing unavailable on this target!"); -} - GCMetadataPrinter *AsmPrinter::GetOrCreateGCPrinter(GCStrategy *S) { if (!S->usesMetadata()) return 0; Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h?rev=82006&r1=82005&r2=82006&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Tue Sep 15 23:57:15 2009 @@ -63,8 +63,7 @@ void printInstructionThroughMCStreamer(const MachineInstr *MI); - // FIXME: REMOVE. - virtual void printMCInst(const MCInst *MI); + void printMCInst(const MCInst *MI); void printSymbolOperand(const MachineOperand &MO); From sabre at nondot.org Tue Sep 15 23:59:31 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 04:59:31 -0000 Subject: [llvm-commits] [llvm] r82008 - /llvm/trunk/docs/DeveloperPolicy.html Message-ID: <200909160459.n8G4xWxe003438@zion.cs.uiuc.edu> Author: lattner Date: Tue Sep 15 23:59:30 2009 New Revision: 82008 URL: http://llvm.org/viewvc/llvm-project?rev=82008&view=rev Log: Ted is christened as the owner of the clang static analyzer. Modified: llvm/trunk/docs/DeveloperPolicy.html Modified: llvm/trunk/docs/DeveloperPolicy.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DeveloperPolicy.html?rev=82008&r1=82007&r2=82008&view=diff ============================================================================== --- llvm/trunk/docs/DeveloperPolicy.html (original) +++ llvm/trunk/docs/DeveloperPolicy.html Tue Sep 15 23:59:30 2009 @@ -192,6 +192,8 @@
  • Evan Cheng: Code generator and all targets.
  • +
  • Ted Kremenek: Clang Static Analyzer.
  • +
  • Chris Lattner: Everything else.
  • From sabre at nondot.org Wed Sep 16 00:20:33 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 05:20:33 -0000 Subject: [llvm-commits] [llvm] r82010 - in /llvm/trunk/lib/Target/X86: AsmPrinter/X86ATTAsmPrinter.cpp X86Subtarget.h Message-ID: <200909160520.n8G5KYhR006035@zion.cs.uiuc.edu> Author: lattner Date: Wed Sep 16 00:20:33 2009 New Revision: 82010 URL: http://llvm.org/viewvc/llvm-project?rev=82010&view=rev Log: rearrange X86ATTAsmPrinter::doFinalization, making a scan of the global variable list only happen for COFF targets. Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/trunk/lib/Target/X86/X86Subtarget.h Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=82010&r1=82009&r2=82010&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Wed Sep 16 00:20:33 2009 @@ -889,13 +889,6 @@ } bool X86ATTAsmPrinter::doFinalization(Module &M) { - // Print out module-level global variables here. - for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) { - if (I->hasDLLExportLinkage()) - DLLExportedGVs.insert(Mang->getMangledName(I)); - } - if (Subtarget->isTargetDarwin()) { // All darwin targets use mach-o. TargetLoweringObjectFileMachO &TLOFMacho = @@ -903,7 +896,7 @@ // Add the (possibly multiple) personalities to the set of global value // stubs. Only referenced functions get into the Personalities list. - if (MAI->doesSupportExceptionHandling() && MMI && !Subtarget->is64Bit()) { + if (!Subtarget->is64Bit()) { const std::vector &Personalities = MMI->getPersonalities(); for (unsigned i = 0, e = Personalities.size(); i != e; ++i) { if (Personalities[i] == 0) @@ -984,37 +977,46 @@ // linker can safely perform dead code stripping. Since LLVM never // generates code that does this, it is always safe to set. O << "\t.subsections_via_symbols\n"; - } else if (Subtarget->isTargetCygMing()) { - // Emit type information for external functions - for (StringSet<>::iterator i = CygMingStubs.begin(), e = CygMingStubs.end(); - i != e; ++i) { - O << "\t.def\t " << i->getKeyData() + } + + if (Subtarget->isTargetCOFF()) { + for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ++I) + if (I->hasDLLExportLinkage()) + DLLExportedGVs.insert(Mang->getMangledName(I)); + + if (Subtarget->isTargetCygMing()) { + // Emit type information for external functions + for (StringSet<>::iterator i = CygMingStubs.begin(), e = CygMingStubs.end(); + i != e; ++i) { + O << "\t.def\t " << i->getKeyData() << ";\t.scl\t" << COFF::C_EXT << ";\t.type\t" << (COFF::DT_FCN << COFF::N_BTSHFT) << ";\t.endef\n"; + } } - } - - // Output linker support code for dllexported globals on windows. - if (!DLLExportedGVs.empty() || !DLLExportedFns.empty()) { - // dllexport symbols only exist on coff targets. - TargetLoweringObjectFileCOFF &TLOFMacho = - static_cast(getObjFileLowering()); + // Output linker support code for dllexported globals on windows. + if (!DLLExportedGVs.empty() || !DLLExportedFns.empty()) { + // dllexport symbols only exist on coff targets. + TargetLoweringObjectFileCOFF &TLOFCOFF = + static_cast(getObjFileLowering()); + + OutStreamer.SwitchSection(TLOFCOFF.getCOFFSection(".section .drectve", + true, + SectionKind::getMetadata())); - OutStreamer.SwitchSection(TLOFMacho.getCOFFSection(".section .drectve",true, - SectionKind::getMetadata())); - - for (StringSet<>::iterator i = DLLExportedGVs.begin(), - e = DLLExportedGVs.end(); i != e; ++i) - O << "\t.ascii \" -export:" << i->getKeyData() << ",data\"\n"; - - for (StringSet<>::iterator i = DLLExportedFns.begin(), - e = DLLExportedFns.end(); - i != e; ++i) - O << "\t.ascii \" -export:" << i->getKeyData() << "\"\n"; + for (StringSet<>::iterator i = DLLExportedGVs.begin(), + e = DLLExportedGVs.end(); i != e; ++i) + O << "\t.ascii \" -export:" << i->getKeyData() << ",data\"\n"; + + for (StringSet<>::iterator i = DLLExportedFns.begin(), + e = DLLExportedFns.end(); + i != e; ++i) + O << "\t.ascii \" -export:" << i->getKeyData() << "\"\n"; + } } - + // Do common shutdown. return AsmPrinter::doFinalization(M); } Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=82010&r1=82009&r2=82010&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.h (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.h Wed Sep 16 00:20:33 2009 @@ -148,12 +148,20 @@ bool isTargetDarwin() const { return TargetType == isDarwin; } bool isTargetELF() const { return TargetType == isELF; } + bool isTargetWindows() const { return TargetType == isWindows; } bool isTargetMingw() const { return TargetType == isMingw; } + bool isTargetCygwin() const { return TargetType == isCygwin; } bool isTargetCygMing() const { return TargetType == isMingw || TargetType == isCygwin; } - bool isTargetCygwin() const { return TargetType == isCygwin; } + + /// isTargetCOFF - Return true if this is any COFF/Windows target variant. + bool isTargetCOFF() const { + return TargetType == isMingw || TargetType == isCygwin || + TargetType == isWindows; + } + bool isTargetWin64() const { return Is64Bit && (TargetType == isMingw || TargetType == isWindows); } From sabre at nondot.org Wed Sep 16 00:25:43 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 05:25:43 -0000 Subject: [llvm-commits] [llvm] r82011 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Message-ID: <200909160525.n8G5Phk8006695@zion.cs.uiuc.edu> Author: lattner Date: Wed Sep 16 00:25:43 2009 New Revision: 82011 URL: http://llvm.org/viewvc/llvm-project?rev=82011&view=rev Log: tidy up Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=82011&r1=82010&r2=82011&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Wed Sep 16 00:25:43 2009 @@ -732,11 +732,9 @@ } void X86ATTAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) { - const TargetData *TD = TM.getTargetData(); - if (!GVar->hasInitializer()) return; // External global require no code - + // Check to see if this is a special global used by LLVM, if so, emit it. if (EmitSpecialLLVMGlobal(GVar)) { if (Subtarget->isTargetDarwin() && @@ -748,6 +746,8 @@ } return; } + + const TargetData *TD = TM.getTargetData(); std::string name = Mang->getMangledName(GVar); Constant *C = GVar->getInitializer(); From sabre at nondot.org Wed Sep 16 00:26:00 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 05:26:00 -0000 Subject: [llvm-commits] [llvm] r82012 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/MachineModuleInfo.cpp Message-ID: <200909160526.n8G5Q1dp006747@zion.cs.uiuc.edu> Author: lattner Date: Wed Sep 16 00:26:00 2009 New Revision: 82012 URL: http://llvm.org/viewvc/llvm-project?rev=82012&view=rev Log: the pointer MMI keeps will start out with object-file format specific stuff Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=82012&r1=82011&r2=82012&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Wed Sep 16 00:26:00 2009 @@ -91,9 +91,10 @@ /// schemes and reformated for specific use. /// class MachineModuleInfo : public ImmutablePass { - /// TargetMMI - This is the target-specific implementation of - /// MachineModuleInfoImpl, which lets them accumulate whatever info they want. - MachineModuleInfoImpl *TargetMMI; + /// ObjFileMMI - This is the object-file-format-specific implementation of + /// MachineModuleInfoImpl, which lets targets accumulate whatever info they + /// want. + MachineModuleInfoImpl *ObjFileMMI; // LabelIDList - One entry per assigned label. Normally the entry is equal to // the list index(+1). If the entry is zero then the label has been deleted. @@ -161,18 +162,18 @@ /// backends that would like to do so. /// template - Ty *getInfo() { - if (TargetMMI == 0) - TargetMMI = new Ty(*this); + Ty *getObjFileInfo() { + if (ObjFileMMI == 0) + ObjFileMMI = new Ty(*this); - assert((void*)dynamic_cast(TargetMMI) == (void*)TargetMMI && + assert((void*)dynamic_cast(ObjFileMMI) == (void*)ObjFileMMI && "Invalid concrete type or multiple inheritence for getInfo"); - return static_cast(TargetMMI); + return static_cast(ObjFileMMI); } template - const Ty *getInfo() const { - return const_cast(this)->getInfo(); + const Ty *getObjFileInfo() const { + return const_cast(this)->getObjFileInfo(); } /// AnalyzeModule - Scan the module for global debug information. Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=82012&r1=82011&r2=82012&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Wed Sep 16 00:26:00 2009 @@ -39,7 +39,7 @@ MachineModuleInfo::MachineModuleInfo() : ImmutablePass(&ID) -, TargetMMI(0) +, ObjFileMMI(0) , CallsEHReturn(0) , CallsUnwindInit(0) , DbgInfoAvailable(false) { @@ -48,7 +48,7 @@ } MachineModuleInfo::~MachineModuleInfo() { - delete TargetMMI; + delete ObjFileMMI; } /// doInitialization - Initialize the state for a new module. From sabre at nondot.org Wed Sep 16 00:36:07 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 05:36:07 -0000 Subject: [llvm-commits] [llvm] r82013 - /llvm/trunk/docs/DeveloperPolicy.html Message-ID: <200909160536.n8G5a7T0007991@zion.cs.uiuc.edu> Author: lattner Date: Wed Sep 16 00:36:07 2009 New Revision: 82013 URL: http://llvm.org/viewvc/llvm-project?rev=82013&view=rev Log: Doug is now the code owner for most of the Clang frontend. Modified: llvm/trunk/docs/DeveloperPolicy.html Modified: llvm/trunk/docs/DeveloperPolicy.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DeveloperPolicy.html?rev=82013&r1=82012&r2=82013&view=diff ============================================================================== --- llvm/trunk/docs/DeveloperPolicy.html (original) +++ llvm/trunk/docs/DeveloperPolicy.html Wed Sep 16 00:36:07 2009 @@ -188,13 +188,15 @@
  • Anton Korobeynikov: Exception handling, debug information, and Windows codegen.
  • -
  • Duncan Sands: llvm-gcc 4.2.
  • -
  • Evan Cheng: Code generator and all targets.
  • +
  • Doug Gregor: Clang Basic, Lex, Parse, and Sema Libraries.
  • +
  • Ted Kremenek: Clang Static Analyzer.
  • Chris Lattner: Everything else.
  • + +
  • Duncan Sands: llvm-gcc 4.2.
  • Note that code ownership is completely different than reviewers: anyone can From sabre at nondot.org Wed Sep 16 00:36:54 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 05:36:54 -0000 Subject: [llvm-commits] [llvm] r82014 - /llvm/trunk/docs/DeveloperPolicy.html Message-ID: <200909160536.n8G5as8Y008094@zion.cs.uiuc.edu> Author: lattner Date: Wed Sep 16 00:36:54 2009 New Revision: 82014 URL: http://llvm.org/viewvc/llvm-project?rev=82014&view=rev Log: make more clear since it is sorted by last name now. Modified: llvm/trunk/docs/DeveloperPolicy.html Modified: llvm/trunk/docs/DeveloperPolicy.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DeveloperPolicy.html?rev=82014&r1=82013&r2=82014&view=diff ============================================================================== --- llvm/trunk/docs/DeveloperPolicy.html (original) +++ llvm/trunk/docs/DeveloperPolicy.html Wed Sep 16 00:36:54 2009 @@ -194,7 +194,7 @@

  • Ted Kremenek: Clang Static Analyzer.
  • -
  • Chris Lattner: Everything else.
  • +
  • Chris Lattner: Everything not covered by someone else.
  • Duncan Sands: llvm-gcc 4.2.
  • From sabre at nondot.org Wed Sep 16 00:37:13 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 05:37:13 -0000 Subject: [llvm-commits] [llvm] r82015 - /llvm/trunk/docs/DeveloperPolicy.html Message-ID: <200909160537.n8G5bD24008147@zion.cs.uiuc.edu> Author: lattner Date: Wed Sep 16 00:37:13 2009 New Revision: 82015 URL: http://llvm.org/viewvc/llvm-project?rev=82015&view=rev Log: I can sort, no really. Modified: llvm/trunk/docs/DeveloperPolicy.html Modified: llvm/trunk/docs/DeveloperPolicy.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DeveloperPolicy.html?rev=82015&r1=82014&r2=82015&view=diff ============================================================================== --- llvm/trunk/docs/DeveloperPolicy.html (original) +++ llvm/trunk/docs/DeveloperPolicy.html Wed Sep 16 00:37:13 2009 @@ -185,15 +185,15 @@ else. The current code owners are:

      -
    1. Anton Korobeynikov: Exception handling, debug information, and - Windows codegen.
    2. -
    3. Evan Cheng: Code generator and all targets.
    4. Doug Gregor: Clang Basic, Lex, Parse, and Sema Libraries.
    5. Ted Kremenek: Clang Static Analyzer.
    6. +
    7. Anton Korobeynikov: Exception handling, debug information, and + Windows codegen.
    8. +
    9. Chris Lattner: Everything not covered by someone else.
    10. Duncan Sands: llvm-gcc 4.2.
    11. From sabre at nondot.org Wed Sep 16 00:42:13 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Sep 2009 05:42:13 -0000 Subject: [llvm-commits] [llvm] r82016 - /llvm/trunk/docs/DeveloperPolicy.html Message-ID: <200909160542.n8G5gDnj008776@zion.cs.uiuc.edu> Author: lattner Date: Wed Sep 16 00:42:12 2009 New Revision: 82016 URL: http://llvm.org/viewvc/llvm-project?rev=82016&view=rev Log: apparently russians are really hard to sort or something! Modified: llvm/trunk/docs/DeveloperPolicy.html Modified: llvm/trunk/docs/DeveloperPolicy.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DeveloperPolicy.html?rev=82016&r1=82015&r2=82016&view=diff ============================================================================== --- llvm/trunk/docs/DeveloperPolicy.html (original) +++ llvm/trunk/docs/DeveloperPolicy.html Wed Sep 16 00:42:12 2009 @@ -189,11 +189,11 @@
    12. Doug Gregor: Clang Basic, Lex, Parse, and Sema Libraries.
    13. -
    14. Ted Kremenek: Clang Static Analyzer.
    15. -
    16. Anton Korobeynikov: Exception handling, debug information, and Windows codegen.
    17. +
    18. Ted Kremenek: Clang Static Analyzer.
    19. +
    20. Chris Lattner: Everything not covered by someone else.
    21. Duncan Sands: llvm-gcc 4.2.
    22. From tonic at nondot.org Wed Sep 16 00:46:51 2009 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 16 Sep 2009 00:46:51 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/2009-10/index.php Message-ID: <200909160546.n8G5kpOJ009354@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/2009-10: index.php updated: 1.12 -> 1.13 --- Log message: Add list of talks. --- Diffs of the changes: (+24 -1) index.php | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletion(-) Index: llvm-www/devmtg/2009-10/index.php diff -u llvm-www/devmtg/2009-10/index.php:1.12 llvm-www/devmtg/2009-10/index.php:1.13 --- llvm-www/devmtg/2009-10/index.php:1.12 Wed Sep 9 15:27:17 2009 +++ llvm-www/devmtg/2009-10/index.php Wed Sep 16 00:45:44 2009 @@ -56,6 +56,7 @@ This year's meeting is being coordinated by Ted Kremenek and Tanya Lattner.

      Registration
      +

      Registration is limited to 190 attendees.

      Register Now!! (Registration deadline is September 20, 2009)

      @@ -95,8 +96,30 @@
      Agenda
      -

      Volunteer to give a talk! (All talk proposals must be received by August 23, 2009)

      + +

      This is not a finalized schedule, but a list of the talks that will be given. We will update once we have the final schedule. You can expect the day to start at 8:45, with breakfast from 8:00-8:45.

      + + + + + + + + + + + + + + + + + + + +
      Talk TitleSpeaker
      Accelerating Ruby with LLVMEvan Phoenix
      ClangDough Gregor, Chris Lattner, Ted Kremenek
      CoVaC: Compiler Validation by Program Analysis of the Cross-ProductAnna Zaks
      Future Works in LLVM Register AllocationLang Hames
      LLVM on 180k CoresDavid Greene
      Object Code EmissionBruno Cardoso Lopes
      OpenCLNate Begeman
      Optimizing ActionScript Bytecode using LLVMScott Petersen
      The Parfait Bug-CheckerCristina Cifuentes
      PLANG: Translating nVidia PTX language to LLVM IRVinod Grover
      Precise and efficient garbage collection in VMKit with MMTkNicolas Geoffray
      Reimplementing llvm-gcc as a gcc pluginDuncan Sands
      ScalarEvolution: What's New, What's CoolDan Gohman
      SoftBound: Highly Compatible and Complete Spatial Memory Safety for CSantosh Nagarakatte
      Targeting XCore resources from LLVMRichard Osborne
      Tutorial: Building backend in 24 hoursAnton Korobeynikov
      Unladen Swallow: Python on LLVMCollin Winter
      {0,+,2} + %1 = sext i32 %i.01 to i64 ; [#uses=1] + +; CHECK: %2 = getelementptr inbounds double* %d, i64 %1 +; CHECK: --> {%d,+,16} + %2 = getelementptr inbounds double* %d, i64 %1 ; [#uses=1] + + %3 = load double* %2, align 8 ; [#uses=1] + %4 = sext i32 %i.01 to i64 ; [#uses=1] + %5 = getelementptr inbounds double* %q, i64 %4 ; [#uses=1] + %6 = load double* %5, align 8 ; [#uses=1] + %7 = or i32 %i.01, 1 ; [#uses=1] + +; CHECK: %8 = sext i32 %7 to i64 +; CHECK: --> {1,+,2} + %8 = sext i32 %7 to i64 ; [#uses=1] + +; CHECK: %9 = getelementptr inbounds double* %q, i64 %8 +; CHECK: {(8 + %q),+,16} + %9 = getelementptr inbounds double* %q, i64 %8 ; [#uses=1] + +; Artificially repeat the above three instructions, this time using +; add nsw instead of or. + %t7 = add nsw i32 %i.01, 1 ; [#uses=1] + +; CHECK: %t8 = sext i32 %t7 to i64 +; CHECK: --> {1,+,2} + %t8 = sext i32 %t7 to i64 ; [#uses=1] + +; CHECK: %t9 = getelementptr inbounds double* %q, i64 %t8 +; CHECK: {(8 + %q),+,16} + %t9 = getelementptr inbounds double* %q, i64 %t8 ; [#uses=1] + + %10 = load double* %9, align 8 ; [#uses=1] + %11 = fadd double %6, %10 ; [#uses=1] + %12 = fadd double %11, 3.200000e+00 ; [#uses=1] + %13 = fmul double %3, %12 ; [#uses=1] + %14 = sext i32 %i.01 to i64 ; [#uses=1] + %15 = getelementptr inbounds double* %d, i64 %14 ; [#uses=1] + store double %13, double* %15, align 8 + %16 = add nsw i32 %i.01, 2 ; [#uses=2] + br label %bb1 + +bb1: ; preds = %bb + %17 = icmp slt i32 %16, %n ; [#uses=1] + br i1 %17, label %bb, label %bb1.return_crit_edge + +bb1.return_crit_edge: ; preds = %bb1 + br label %return + +return: ; preds = %bb1.return_crit_edge, %entry + ret void +} + +; CHECK: Loop bb: backedge-taken count is ((-1 + %n) /u 2) +; CHECK: Loop bb: max backedge-taken count is 1073741823 From baldrick at free.fr Thu Sep 17 13:14:38 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Sep 2009 18:14:38 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r82152 - in /llvm-gcc-4.2/trunk/gcc: config.gcc config/exec-stack.h config/i386/openbsd.h config/i386/openbsd64.h config/i386/openbsdelf.h config/openbsd-libpthread.h config/openbsd.h Message-ID: <200909171814.n8HIEcfE029467@zion.cs.uiuc.edu> Author: baldrick Date: Thu Sep 17 13:14:37 2009 New Revision: 82152 URL: http://llvm.org/viewvc/llvm-project?rev=82152&view=rev Log: Update OpenBSD target configurations for llvm-gcc based on the gcc 4.2 port, and most importantly enable pic when building an llvm enabled configuration. Patch by Jonathan Gray. Added: llvm-gcc-4.2/trunk/gcc/config/exec-stack.h llvm-gcc-4.2/trunk/gcc/config/i386/openbsd64.h llvm-gcc-4.2/trunk/gcc/config/openbsd-libpthread.h Modified: llvm-gcc-4.2/trunk/gcc/config.gcc llvm-gcc-4.2/trunk/gcc/config/i386/openbsd.h llvm-gcc-4.2/trunk/gcc/config/i386/openbsdelf.h llvm-gcc-4.2/trunk/gcc/config/openbsd.h Modified: llvm-gcc-4.2/trunk/gcc/config.gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config.gcc?rev=82152&r1=82151&r2=82152&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config.gcc (original) +++ llvm-gcc-4.2/trunk/gcc/config.gcc Thu Sep 17 13:14:37 2009 @@ -1152,10 +1152,15 @@ ;; i[34567]86-*-openbsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h" - tm_file="${tm_file} openbsd.h i386/openbsdelf.h" + tm_file="${tm_file} openbsd.h openbsd-libpthread.h i386/openbsdelf.h" gas=yes gnu_ld=yes ;; +x86_64-*-openbsd*) + tm_file="i386/biarch64.h i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos.h openbsd.h openbsd-libpthread.h i386/x86-64.h i386/openbsd64.h" + tm_file="${tm_file} exec-stack.h" + tmake_file="t-libc-ok t-openbsd i386/t-openbsd" + ;; i[34567]86-*-coff*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/i386-coff.h" use_fixproto=yes Added: llvm-gcc-4.2/trunk/gcc/config/exec-stack.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/exec-stack.h?rev=82152&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/exec-stack.h (added) +++ llvm-gcc-4.2/trunk/gcc/config/exec-stack.h Thu Sep 17 13:14:37 2009 @@ -0,0 +1,40 @@ +/* Enable stack execute around trampoline address. + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#undef FINALIZE_TRAMPOLINE +#define FINALIZE_TRAMPOLINE(TRAMP) \ + emit_library_call(gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"), \ + 0, VOIDmode, 1, memory_address (SImode, (TRAMP)), Pmode) + +#undef TRANSFER_FROM_TRAMPOLINE +#define TRANSFER_FROM_TRAMPOLINE \ +extern void __enable_execute_stack (void *); \ +void \ +__enable_execute_stack (addr) \ + void *addr; \ +{ \ + long size = getpagesize (); \ + long mask = ~(size-1); \ + char *page = (char *) (((long) addr) & mask); \ + char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \ + \ + if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \ + perror ("mprotect of trampoline code"); \ +} Modified: llvm-gcc-4.2/trunk/gcc/config/i386/openbsd.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/openbsd.h?rev=82152&r1=82151&r2=82152&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/openbsd.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/openbsd.h Thu Sep 17 13:14:37 2009 @@ -41,10 +41,10 @@ /* This must agree with */ #undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" +#define SIZE_TYPE "long unsigned int" #undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" +#define PTRDIFF_TYPE "long int" #undef WCHAR_TYPE #define WCHAR_TYPE "int" @@ -52,6 +52,9 @@ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 32 +#undef WINT_TYPE +#define WINT_TYPE "int" + /* Assembler format: overall framework. */ #undef ASM_APP_ON Added: llvm-gcc-4.2/trunk/gcc/config/i386/openbsd64.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/openbsd64.h?rev=82152&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/openbsd64.h (added) +++ llvm-gcc-4.2/trunk/gcc/config/i386/openbsd64.h Thu Sep 17 13:14:37 2009 @@ -0,0 +1,121 @@ +/* Configuration for an OpenBSD x86-64 target. + + Copyright (C) 2003 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file C