Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Commit

Permalink
Merged upstream, updated tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobly0 committed Mar 11, 2017
1 parent 2e0b7e0 commit 87ffa60
Show file tree
Hide file tree
Showing 91 changed files with 14,695 additions and 18,208 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -21,6 +21,9 @@
#OS X specific files.
.DS_store

# Nested build directory
/build

#==============================================================================#
# Explicit files to ignore (only matches one).
#==============================================================================#
Expand Down
84 changes: 46 additions & 38 deletions CMakeLists.txt
Expand Up @@ -20,7 +20,7 @@ if(POLICY CMP0057)
endif()

if(NOT DEFINED LLVM_VERSION_MAJOR)
set(LLVM_VERSION_MAJOR 4)
set(LLVM_VERSION_MAJOR 5)
endif()
if(NOT DEFINED LLVM_VERSION_MINOR)
set(LLVM_VERSION_MINOR 0)
Expand Down Expand Up @@ -56,17 +56,20 @@ endif()

# This should only apply if you are both on an Apple host, and targeting Apple.
if(CMAKE_HOST_APPLE AND APPLE)
if(NOT CMAKE_XCRUN)
find_program(CMAKE_XCRUN NAMES xcrun)
endif()
if(CMAKE_XCRUN)
execute_process(COMMAND ${CMAKE_XCRUN} -find libtool
OUTPUT_VARIABLE CMAKE_LIBTOOL
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
# if CMAKE_LIBTOOL is not set, try and find it with xcrun or find_program
if(NOT CMAKE_LIBTOOL)
if(NOT CMAKE_XCRUN)
find_program(CMAKE_XCRUN NAMES xcrun)
endif()
if(CMAKE_XCRUN)
execute_process(COMMAND ${CMAKE_XCRUN} -find libtool
OUTPUT_VARIABLE CMAKE_LIBTOOL
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

if(NOT CMAKE_LIBTOOL OR NOT EXISTS CMAKE_LIBTOOL)
find_program(CMAKE_LIBTOOL NAMES libtool)
if(NOT CMAKE_LIBTOOL OR NOT EXISTS CMAKE_LIBTOOL)
find_program(CMAKE_LIBTOOL NAMES libtool)
endif()
endif()

get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
Expand Down Expand Up @@ -132,18 +135,6 @@ foreach(proj ${LLVM_ENABLE_PROJECTS})
endif()
endforeach()

# The following only works with the Ninja generator in CMake >= 3.0.
set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
"Define the maximum number of concurrent compilation jobs.")
if(LLVM_PARALLEL_COMPILE_JOBS)
if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
message(WARNING "Job pooling is only available with Ninja generators.")
else()
set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${LLVM_PARALLEL_COMPILE_JOBS})
set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
endif()
endif()

# Build llvm with ccache if the package is present
set(LLVM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
if(LLVM_CCACHE_BUILD)
Expand Down Expand Up @@ -178,21 +169,12 @@ if(LLVM_DEPENDENCY_DEBUGGING)
endif()
endif()

option(LLVM_BUILD_GLOBAL_ISEL "Experimental: Build GlobalISel" OFF)
option(LLVM_BUILD_GLOBAL_ISEL "Experimental: Build GlobalISel" ON)
if(LLVM_BUILD_GLOBAL_ISEL)
add_definitions(-DLLVM_BUILD_GLOBAL_ISEL)
endif()

set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING
"Define the maximum number of concurrent link jobs.")
if(LLVM_PARALLEL_LINK_JOBS)
if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
message(WARNING "Job pooling is only available with Ninja generators.")
else()
set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LLVM_PARALLEL_LINK_JOBS})
set(CMAKE_JOB_POOL_LINK link_job_pool)
endif()
endif()
option(LLVM_ENABLE_DAGISEL_COV "Debug: Prints tablegen patterns that were used for selecting" OFF)

# Add path for custom modules
set(CMAKE_MODULE_PATH
Expand Down Expand Up @@ -415,9 +397,6 @@ option(LLVM_ENABLE_EXPENSIVE_CHECKS "Enable expensive checks" OFF)
set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
"Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")

option(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
"Disable abi-breaking checks mismatch detection at link-tim." OFF)

option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN
"Set to ON to force using an old, unsupported host toolchain." OFF)

Expand Down Expand Up @@ -738,6 +717,30 @@ configure_file(
${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake
${LLVM_INCLUDE_DIR}/llvm/Support/DataTypes.h)

# Add target for generating source rpm package.
set(LLVM_SRPM_USER_BINARY_SPECFILE ${CMAKE_CURRENT_SOURCE_DIR}/llvm.spec.in
CACHE FILEPATH ".spec file to use for srpm generation")
set(LLVM_SRPM_BINARY_SPECFILE ${CMAKE_CURRENT_BINARY_DIR}/llvm.spec)
set(LLVM_SRPM_DIR "${CMAKE_CURRENT_BINARY_DIR}/srpm")

# SVN_REVISION and GIT_COMMIT get set by the call to add_version_info_from_vcs.
# DUMMY_VAR contains a version string which we don't care about.
add_version_info_from_vcs(DUMMY_VAR)
if ( SVN_REVISION )
set(LLVM_RPM_SPEC_REVISION "r${SVN_REVISION}")
elseif ( GIT_COMMIT )
set (LLVM_RPM_SPEC_REVISION "g${GIT_COMMIT}")
endif()

configure_file(
${LLVM_SRPM_USER_BINARY_SPECFILE}
${LLVM_SRPM_BINARY_SPECFILE} @ONLY)

add_custom_target(srpm
COMMAND cpack -G TGZ --config CPackSourceConfig.cmake -B ${LLVM_SRPM_DIR}/SOURCES
COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR}' ${LLVM_SRPM_BINARY_SPECFILE})


# They are not referenced. See set_output_directory().
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
Expand Down Expand Up @@ -879,7 +882,7 @@ if( LLVM_INCLUDE_TESTS )
endif()
add_subdirectory(test)
add_subdirectory(unittests)
if (MSVC)
if (WIN32)
# This utility is used to prevent crashing tests from calling Dr. Watson on
# Windows.
add_subdirectory(utils/KillTheDoctor)
Expand Down Expand Up @@ -979,3 +982,8 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
endif()
endforeach()
endif()

# This allows us to deploy the Universal CRT DLLs by passing -DCMAKE_INSTALL_UCRT_LIBRARIES=ON to CMake
if (MSVC)
include(InstallRequiredSystemLibraries)
endif()
2 changes: 1 addition & 1 deletion LICENSE.TXT
Expand Up @@ -4,7 +4,7 @@ LLVM Release License
University of Illinois/NCSA
Open Source License

Copyright (c) 2003-2016 University of Illinois at Urbana-Champaign.
Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign.
All rights reserved.

Developed by:
Expand Down
23 changes: 22 additions & 1 deletion include/llvm/ADT/Triple.h
Expand Up @@ -112,6 +112,7 @@ class Triple {
ARMSubArch_v7m,
ARMSubArch_v7s,
ARMSubArch_v7k,
ARMSubArch_v7ve,
ARMSubArch_v6,
ARMSubArch_v6m,
ARMSubArch_v6k,
Expand Down Expand Up @@ -208,6 +209,7 @@ class Triple {
COFF,
ELF,
MachO,
Wasm,
};

private:
Expand Down Expand Up @@ -560,7 +562,8 @@ class Triple {

/// Tests whether the OS uses glibc.
bool isOSGlibc() const {
return getOS() == Triple::Linux || getOS() == Triple::KFreeBSD;
return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD) &&
!isAndroid();
}

/// Tests whether the OS uses the ELF binary format.
Expand All @@ -578,6 +581,11 @@ class Triple {
return getObjectFormat() == Triple::MachO;
}

/// Tests whether the OS uses the Wasm binary format.
bool isOSBinFormatWasm() const {
return getObjectFormat() == Triple::Wasm;
}

/// Tests whether the target is the PS4 CPU
bool isPS4CPU() const {
return getArch() == Triple::x86_64 &&
Expand All @@ -594,6 +602,19 @@ class Triple {
/// Tests whether the target is Android
bool isAndroid() const { return getEnvironment() == Triple::Android; }

bool isAndroidVersionLT(unsigned Major) const {
assert(isAndroid() && "Not an Android triple!");

unsigned Env[3];
getEnvironmentVersion(Env[0], Env[1], Env[2]);

// 64-bit targets did not exist before API level 21 (Lollipop).
if (isArch64Bit() && Env[0] < 21)
Env[0] = 21;

return Env[0] < Major;
}

/// Tests whether the environment is musl-libc
bool isMusl() const {
return getEnvironment() == Triple::Musl ||
Expand Down
37 changes: 8 additions & 29 deletions include/llvm/CodeGen/ISDOpcodes.h
Expand Up @@ -245,6 +245,12 @@ namespace ISD {
/// Simple binary floating point operators.
FADD, FSUB, FMUL, FDIV, FREM,

/// Constrained versions of the binary floating point operators.
/// These will be lowered to the simple operators before final selection.
/// They are used to limit optimizations while the DAG is being
/// optimized.
STRICT_FADD, STRICT_FSUB, STRICT_FMUL, STRICT_FDIV, STRICT_FREM,

/// FMA - Perform a * b + c with no intermediate rounding step.
FMA,

Expand Down Expand Up @@ -281,7 +287,8 @@ namespace ISD {
/// EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
/// identified by the (potentially variable) element number IDX. If the
/// return type is an integer type larger than the element type of the
/// vector, the result is extended to the width of the return type.
/// vector, the result is extended to the width of the return type. In
/// that case, the high bits are undefined.
EXTRACT_VECTOR_ELT,

/// CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of
Expand Down Expand Up @@ -503,19 +510,6 @@ namespace ISD {
/// address spaces.
ADDRSPACECAST,

/// CONVERT_RNDSAT - This operator is used to support various conversions
/// between various types (float, signed, unsigned and vectors of those
/// types) with rounding and saturation. NOTE: Avoid using this operator as
/// most target don't support it and the operator might be removed in the
/// future. It takes the following arguments:
/// 0) value
/// 1) dest type (type to convert to)
/// 2) src type (type to convert from)
/// 3) rounding imm
/// 4) saturation imm
/// 5) ISD::CvtCode indicating the type of conversion to do
CONVERT_RNDSAT,

/// FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions
/// and truncation for half-precision (16 bit) floating numbers. These nodes
/// form a semi-softened interface for dealing with f16 (as an i16), which
Expand Down Expand Up @@ -927,21 +921,6 @@ namespace ISD {
/// SETCC_INVALID if it is not possible to represent the resultant comparison.
CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger);

//===--------------------------------------------------------------------===//
/// This enum defines the various converts CONVERT_RNDSAT supports.
enum CvtCode {
CVT_FF, /// Float from Float
CVT_FS, /// Float from Signed
CVT_FU, /// Float from Unsigned
CVT_SF, /// Signed from Float
CVT_UF, /// Unsigned from Float
CVT_SS, /// Signed from Signed
CVT_SU, /// Signed from Unsigned
CVT_US, /// Unsigned from Signed
CVT_UU, /// Unsigned from Unsigned
CVT_INVALID /// Marker - Invalid opcode
};

} // end llvm::ISD namespace

} // end llvm namespace
Expand Down

0 comments on commit 87ffa60

Please sign in to comment.