From 600c6fa13de5c407dc36dbb0ab73807868741ae0 Mon Sep 17 00:00:00 2001
From: Ed Schouten
Date: Sun, 14 Jun 2009 09:23:33 +0000
Subject: [PATCH] Import LLVM r73340.
---
CMakeLists.txt | 18 +
CREDITS.TXT | 27 +-
cmake/modules/AddLLVM.cmake | 4 +-
cmake/modules/AddPartiallyLinkedObject.cmake | 2 +-
cmake/modules/CrossCompileLLVM.cmake | 6 +-
cmake/modules/TableGen.cmake | 4 +-
docs/CMake.html | 13 +-
docs/LangRef.html | 22 +-
docs/TableGenFundamentals.html | 9 +-
include/llvm/Analysis/ScalarEvolution.h | 7 +
include/llvm/Attributes.h | 5 +-
include/llvm/CodeGen/BinaryObject.h | 325 ++++++++++++
include/llvm/CodeGen/JITCodeEmitter.h | 10 +-
include/llvm/CodeGen/LazyLiveness.h | 63 +++
include/llvm/CodeGen/MachineCodeEmitter.h | 10 +-
.../llvm/ExecutionEngine/ExecutionEngine.h | 2 +-
include/llvm/Function.h | 4 +
include/llvm/LinkAllPasses.h | 1 +
include/llvm/Target/TargetELFWriterInfo.h | 39 +-
include/llvm/Target/TargetLowering.h | 43 +-
include/llvm/Target/TargetMachine.h | 10 +-
include/llvm/Target/TargetOptions.h | 8 +
include/llvm/Target/TargetSelectionDAG.td | 1 +
include/llvm/Transforms/IPO.h | 5 +
lib/Analysis/ScalarEvolution.cpp | 59 +++
lib/Analysis/ScalarEvolutionExpander.cpp | 104 ++--
lib/Archive/ArchiveWriter.cpp | 7 +-
lib/Bitcode/Writer/BitcodeWriter.cpp | 10 -
lib/Bitcode/Writer/ValueEnumerator.cpp | 16 -
lib/Bitcode/Writer/ValueEnumerator.h | 5 -
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 +-
lib/CodeGen/CMakeLists.txt | 1 +
lib/CodeGen/ELF.h | 129 ++---
lib/CodeGen/ELFCodeEmitter.cpp | 31 +-
lib/CodeGen/ELFWriter.cpp | 440 ++++++++++------
lib/CodeGen/ELFWriter.h | 61 ++-
lib/CodeGen/LLVMTargetMachine.cpp | 2 +-
lib/CodeGen/LazyLiveness.cpp | 158 ++++++
lib/CodeGen/RegisterScavenging.cpp | 17 +-
lib/ExecutionEngine/JIT/JIT.cpp | 5 +
lib/Target/ARM/ARM.h | 10 +-
lib/Target/ARM/ARM.td | 8 +-
lib/Target/ARM/ARMCallingConv.td | 62 ++-
lib/Target/ARM/ARMISelLowering.cpp | 7 +-
lib/Target/ARM/ARMInstrInfo.td | 5 +-
lib/Target/ARM/ARMInstrThumb.td | 3 +
lib/Target/ARM/ARMInstrVFP.td | 2 +
lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 336 +++++++++++-
lib/Target/ARM/ARMRegisterInfo.td | 15 +
lib/Target/ARM/ARMSubtarget.cpp | 6 +
lib/Target/ARM/ARMSubtarget.h | 4 +-
lib/Target/ARM/ARMTargetMachine.cpp | 13 +
lib/Target/ARM/ARMTargetMachine.h | 1 +
lib/Target/CMakeLists.txt | 3 +-
lib/Target/PIC16/PIC16AsmPrinter.cpp | 90 +++-
lib/Target/PIC16/PIC16AsmPrinter.h | 1 +
lib/Target/PIC16/PIC16DebugInfo.cpp | 167 +++---
lib/Target/PIC16/PIC16DebugInfo.h | 23 +-
lib/Target/PIC16/PIC16ISelLowering.cpp | 23 +-
lib/Target/PIC16/PIC16TargetAsmInfo.h | 6 +-
lib/Target/TargetELFWriterInfo.cpp | 36 ++
lib/Target/TargetMachine.cpp | 22 +
lib/Target/X86/README.txt | 114 ++--
lib/Target/X86/X86CallingConv.td | 44 --
lib/Target/X86/X86ELFWriterInfo.cpp | 23 +-
lib/Target/X86/X86ELFWriterInfo.h | 4 +-
lib/Target/X86/X86FastISel.cpp | 2 -
lib/Target/X86/X86ISelLowering.cpp | 8 +-
lib/Target/X86/X86RegisterInfo.cpp | 111 ++--
lib/Target/X86/X86Subtarget.cpp | 4 +
lib/Target/X86/X86TargetMachine.cpp | 3 +-
lib/Transforms/IPO/ArgumentPromotion.cpp | 13 +-
.../IPO/DeadArgumentElimination.cpp | 11 +-
lib/Transforms/IPO/GlobalDCE.cpp | 15 -
lib/Transforms/IPO/GlobalOpt.cpp | 38 +-
lib/Transforms/IPO/MergeFunctions.cpp | 490 ++++++++++++++----
lib/Transforms/IPO/PartialInlining.cpp | 171 ++++++
lib/Transforms/Scalar/IndVarSimplify.cpp | 95 +---
.../Scalar/InstructionCombining.cpp | 18 +-
lib/Transforms/Scalar/SimplifyCFGPass.cpp | 10 +-
lib/VMCore/Function.cpp | 11 +
lib/VMCore/Instruction.cpp | 7 +-
lib/VMCore/Verifier.cpp | 35 +-
.../2009-06-11-FirstClassAggregateConstant.ll | 12 +
test/BugPoint/misopt-basictest.ll | 3 +
.../ARM/2009-06-12-RegScavengerAssert.ll | 77 +++
test/CodeGen/ARM/arguments_f64_backfill.ll | 8 +
test/CodeGen/ARM/lsr-code-insertion.ll | 2 +-
test/CodeGen/ARM/stm.ll | 13 +
...2-x86_64-tail-call-conv-out-of-sync-bug.ll | 15 +
test/CodeGen/X86/tailcallstack64.ll | 12 +-
test/DebugInfo/2009-06-12-Inline.ll | 94 ++++
test/DebugInfo/2009-06-12-InlineFuncStart.ll | 75 +++
test/FrontendC/pr3518.c | 24 +
test/FrontendC/pr4349.c | 39 ++
test/TableGen/Slice.td | 87 ++++
test/TableGen/if.td | 4 +-
.../IndVarSimplify/2003-09-23-NotAtTop.ll | 2 +-
test/Transforms/IndVarSimplify/masked-iv.ll | 24 +
.../InstCombine/2009-06-11-StoreAddrSpace.ll | 7 +
test/Transforms/InstCombine/fsub-fsub.ll | 8 +
test/Transforms/MergeFunc/fold-weak.ll | 4 +-
test/lib/llvm.exp | 2 +-
tools/lto/LTOCodeGenerator.cpp | 2 +-
unittests/ADT/TripleTest.cpp | 140 ++---
utils/GenLibDeps.pl | 8 +-
utils/NewNightlyTest.pl | 31 +-
utils/TableGen/ClangDiagnosticsEmitter.cpp | 6 +
utils/TableGen/CodeGenDAGPatterns.cpp | 23 +-
utils/TableGen/Record.cpp | 110 +++-
utils/TableGen/Record.h | 53 +-
utils/TableGen/TGParser.cpp | 165 +++++-
utils/TableGen/TGParser.h | 6 +-
utils/crosstool/ARM/build-install-linux.sh | 203 ++++++++
utils/crosstool/create-snapshots.sh | 41 ++
115 files changed, 3938 insertions(+), 1122 deletions(-)
create mode 100644 include/llvm/CodeGen/BinaryObject.h
create mode 100644 include/llvm/CodeGen/LazyLiveness.h
create mode 100644 lib/CodeGen/LazyLiveness.cpp
create mode 100644 lib/Target/TargetELFWriterInfo.cpp
create mode 100644 lib/Transforms/IPO/PartialInlining.cpp
create mode 100644 test/Bitcode/2009-06-11-FirstClassAggregateConstant.ll
create mode 100644 test/CodeGen/ARM/2009-06-12-RegScavengerAssert.ll
create mode 100644 test/CodeGen/ARM/arguments_f64_backfill.ll
create mode 100644 test/CodeGen/ARM/stm.ll
create mode 100644 test/CodeGen/X86/2009-06-12-x86_64-tail-call-conv-out-of-sync-bug.ll
create mode 100644 test/DebugInfo/2009-06-12-Inline.ll
create mode 100644 test/DebugInfo/2009-06-12-InlineFuncStart.ll
create mode 100644 test/FrontendC/pr3518.c
create mode 100644 test/FrontendC/pr4349.c
create mode 100644 test/TableGen/Slice.td
create mode 100644 test/Transforms/IndVarSimplify/masked-iv.ll
create mode 100644 test/Transforms/InstCombine/2009-06-11-StoreAddrSpace.ll
create mode 100644 test/Transforms/InstCombine/fsub-fsub.ll
create mode 100755 utils/crosstool/ARM/build-install-linux.sh
create mode 100755 utils/crosstool/create-snapshots.sh
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 81333987bed..2e2cf358e41 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,7 @@ set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include)
set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(LLVM_TOOLS_BINARY_DIR ${LLVM_BINARY_DIR}/bin)
set(LLVM_EXAMPLES_BINARY_DIR ${LLVM_BINARY_DIR}/examples)
+set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
set(LLVM_ALL_TARGETS
Alpha
@@ -186,11 +187,26 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
if( MSVC )
+ # List of valid CRTs for MSVC
+ set(MSVC_CRT
+ MD
+ MDd)
+
+ set(LLVM_USE_CRT "" CACHE STRING "Specify VC++ CRT to use for debug/release configurations.")
add_llvm_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS )
add_llvm_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS )
add_llvm_definitions( -D_SCL_SECURE_NO_DEPRECATE )
add_llvm_definitions( -wd4146 -wd4503 -wd4996 -wd4800 -wd4244 -wd4624 )
add_llvm_definitions( -wd4355 -wd4715 -wd4180 -wd4345 -wd4224 )
+
+ if (NOT ${LLVM_USE_CRT} STREQUAL "")
+ list(FIND MSVC_CRT ${LLVM_USE_CRT} idx)
+ if (idx LESS 0)
+ message(FATAL_ERROR "Invalid value for LLVM_USE_CRT: ${LLVM_USE_CRT}. Valid options are one of: ${MSVC_CRT}")
+ endif (idx LESS 0)
+ add_llvm_definitions("/${LLVM_USE_CRT}")
+ message(STATUS "Using VC++ CRT: ${LLVM_USE_CRT}")
+ endif (NOT ${LLVM_USE_CRT} STREQUAL "")
endif( MSVC )
include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR})
@@ -207,6 +223,8 @@ set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
set(LLVM_TABLEGEN "tblgen" CACHE
STRING "Native TableGen executable. Saves building one when cross-compiling.")
+# Effective tblgen executable to be used:
+set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN})
add_subdirectory(utils/TableGen)
diff --git a/CREDITS.TXT b/CREDITS.TXT
index 0beee20b8d2..76b7296bc2a 100644
--- a/CREDITS.TXT
+++ b/CREDITS.TXT
@@ -3,7 +3,7 @@ project. If you have contributed a patch or made some other contribution to
LLVM, please submit a patch to this file to add yourself, and it will be
done!
-The list is sorted by name and formatted to allow easy grepping and
+The list is sorted by surname and formatted to allow easy grepping and
beautification by scripts. The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
(S).
@@ -148,10 +148,6 @@ N: Patrick Jenkins
E: patjenk@wam.umd.edu
D: Nightly Tester
-N: Brad Jones
-E: kungfoomaster@nondot.org
-D: Support for packed types
-
N: Dale Johannesen
E: dalej@apple.com
D: ARM constant islands improvements
@@ -160,6 +156,10 @@ D: Rewrite X87 back end
D: Use APFloat for floating point constants widely throughout compiler
D: Implement X87 long double
+N: Brad Jones
+E: kungfoomaster@nondot.org
+D: Support for packed types
+
N: Eric Kidd
W: http://randomhacks.net/
D: llvm-config script
@@ -231,6 +231,13 @@ N: Scott Michel
E: scottm@aero.org
D: Added STI Cell SPU backend.
+N: Edward O'Callaghan
+E: eocallaghan@auroraux.org
+W: http://www.auroraux.org
+D: Add Clang support with various other improvements to utils/NewNightlyTest.pl
+D: Fix and maintain Solaris & AuroraUX support for llvm, various build warnings
+D: and error clean ups.
+
N: Morten Ofstad
E: morten@hue.no
D: Visual C++ compatibility fixes
@@ -266,6 +273,10 @@ N: Arnold Schwaighofer
E: arnold.schwaighofer@gmail.com
D: Tail call optimization for the x86 backend
+N: Shantonu Sen
+E: ssen@apple.com
+D: Miscellaneous bug fixes
+
N: Anand Shukla
E: ashukla@cs.uiuc.edu
D: The `paths' pass
@@ -290,8 +301,4 @@ D: Thread Local Storage implementation
N: Bill Wendling
E: isanbard@gmail.com
-D: Machine LICM
-D: Darwin exception handling
-D: MMX & SSSE3 instructions
-D: SPEC2006 support
-
+D: Bunches of stuff
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index a21ed20d3ba..e5256746bcc 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -10,8 +10,8 @@ macro(add_llvm_library name)
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
endif( LLVM_COMMON_DEPENDS )
install(TARGETS ${name}
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endmacro(add_llvm_library name)
diff --git a/cmake/modules/AddPartiallyLinkedObject.cmake b/cmake/modules/AddPartiallyLinkedObject.cmake
index d20666dd79f..0f92455eacd 100755
--- a/cmake/modules/AddPartiallyLinkedObject.cmake
+++ b/cmake/modules/AddPartiallyLinkedObject.cmake
@@ -38,5 +38,5 @@ macro(add_partially_linked_object lib)
set( llvm_lib_targets ${llvm_lib_targets} ${tnplo} PARENT_SCOPE )
endif( )
install(FILES ${pll}
- DESTINATION lib)
+ DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endmacro(add_partially_linked_object lib)
diff --git a/cmake/modules/CrossCompileLLVM.cmake b/cmake/modules/CrossCompileLLVM.cmake
index f638d67a30d..138ff0e9fe6 100644
--- a/cmake/modules/CrossCompileLLVM.cmake
+++ b/cmake/modules/CrossCompileLLVM.cmake
@@ -1,7 +1,7 @@
if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )
set(CX_NATIVE_TG_DIR "${CMAKE_BINARY_DIR}/native")
- set(LLVM_TABLEGEN "${CX_NATIVE_TG_DIR}/bin/tblgen")
+ set(LLVM_TABLEGEN_EXE "${CX_NATIVE_TG_DIR}/bin/tblgen")
add_custom_command(OUTPUT ${CX_NATIVE_TG_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CX_NATIVE_TG_DIR}
@@ -13,12 +13,12 @@ if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )
DEPENDS ${CX_NATIVE_TG_DIR}
COMMENT "Configuring native TableGen...")
- add_custom_command(OUTPUT ${LLVM_TABLEGEN}
+ add_custom_command(OUTPUT ${LLVM_TABLEGEN_EXE}
COMMAND ${CMAKE_BUILD_TOOL}
DEPENDS ${CX_NATIVE_TG_DIR}/CMakeCache.txt
WORKING_DIRECTORY ${CX_NATIVE_TG_DIR}/utils/TableGen
COMMENT "Building native TableGen...")
- add_custom_target(NativeTableGen DEPENDS ${LLVM_TABLEGEN})
+ add_custom_target(NativeTableGen DEPENDS ${LLVM_TABLEGEN_EXE})
add_dependencies(tblgen NativeTableGen)
diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake
index adb22c726b9..16c732b0893 100644
--- a/cmake/modules/TableGen.cmake
+++ b/cmake/modules/TableGen.cmake
@@ -6,11 +6,11 @@ macro(tablegen ofn)
file(GLOB all_tds "*.td")
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
- COMMAND ${LLVM_TABLEGEN} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND ${LLVM_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
-I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS}
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
- DEPENDS ${LLVM_TABLEGEN} ${all_tds}
+ DEPENDS tblgen ${all_tds}
COMMENT "Building ${ofn}.tmp..."
)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
diff --git a/docs/CMake.html b/docs/CMake.html
index ac3b57a8489..1f50d397f00 100644
--- a/docs/CMake.html
+++ b/docs/CMake.html
@@ -217,6 +217,11 @@
Path where LLVM will be installed if "make install" is invoked
or the "INSTALL" target is built.
+ LLVM_LIBDIR_SUFFIX:STRING
+ Extra suffix to append to the directory where libraries are to
+ be installed. On a 64-bit architecture, one could use
+ -DLLVM_LIBDIR_SUFFIX=64 to install libraries to /usr/lib64.
+
CMAKE_C_FLAGS:STRING
Extra flags to use when compiling C source files.
@@ -296,7 +301,13 @@
-
TODO
+
See this
+ wiki page for generic instructions on how to cross-compile
+ with CMake. It goes into detailed explanations and may seem
+ daunting, but it is not. On the wiki page there are several
+ examples including toolchain files. Go directly to
+ this
+ section for a quick solution.
diff --git a/docs/LangRef.html b/docs/LangRef.html
index 89d4f936569..897654df956 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -1091,19 +1091,27 @@ stack before the local variables that's checked upon return from the function to
see if it has been overwritten. A heuristic is used to determine if a function
needs stack protectors or not.
-If a function that has an ssp attribute is inlined into a function
+
If a function that has an ssp attribute is inlined into a function
that doesn't have an ssp attribute, then the resulting function will
-have an ssp attribute.
+have an ssp attribute.
sspreq
This attribute indicates that the function should always emit a
stack smashing protector. This overrides the ssp
function attribute.
-If a function that has an sspreq attribute is inlined into a
+If a function that has an sspreq attribute is inlined into a
function that doesn't have an sspreq attribute or which has
an ssp attribute, then the resulting function will have
-an sspreq attribute.
+an sspreq attribute.
+
+noredzone
+This attribute indicates that the code generator should not enforce red zone
+mandated by target specific ABI.
+
+noimplicitfloat
+This attributes disables implicit floating point instructions.
+
@@ -1177,6 +1185,9 @@ aspect of the data layout. The specifications accepted are as follows:
asize:abi:pref
This specifies the alignment for an aggregate type of a given bit
size.
+ ssize:abi:pref
+ This specifies the alignment for a stack object of a given bit
+ size.
When constructing the data layout for a given target, LLVM starts with a
default set of specifications which are then (possibly) overriden by the
@@ -1196,6 +1207,7 @@ are given in this list:
v64:64:64 - 64-bit vector is 64-bit aligned
v128:128:128 - 128-bit vector is 128-bit aligned
a0:0:1 - aggregates are 8-bit aligned
+ s0:64:64 - stack objects are 64-bit aligned
When LLVM is determining the alignment for a given type, it uses the
following rules:
@@ -7209,7 +7221,7 @@ declare void @llvm.stackprotector( i8* <guard>, i8** <slot> )
Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2009-06-05 00:49:04 +0200 (Fri, 05 Jun 2009) $
+ Last modified: $Date: 2009-06-12 21:45:19 +0200 (Fri, 12 Jun 2009) $