diff --git a/.travis.yml b/.travis.yml index 862c7c8e..dc47f692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ matrix: sudo: required dist: trusty env: - - LLVM_API_VERSION=4.0 + - LLVM_API_VERSION=5.0 before_install: - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:"${PKG_CONFIG_PATH}" - wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - diff --git a/Sources/LLVM/IRType.swift b/Sources/LLVM/IRType.swift index 1fb9693f..95f19253 100644 --- a/Sources/LLVM/IRType.swift +++ b/Sources/LLVM/IRType.swift @@ -29,11 +29,6 @@ public extension IRType { public func constPointerNull() -> IRValue { return LLVMConstPointerNull(asLLVM()) } - - /// Dumps a representation of this type to stderr. - public func dump() { - LLVMDumpType(asLLVM()) - } } internal func convertType(_ type: LLVMTypeRef) -> IRType { diff --git a/Sources/LLVM/PassManager.swift b/Sources/LLVM/PassManager.swift index d04fdaa8..ca6d4f37 100644 --- a/Sources/LLVM/PassManager.swift +++ b/Sources/LLVM/PassManager.swift @@ -166,6 +166,12 @@ public enum FunctionPass { /// These functions removes symbols from functions and modules without /// touching symbols for debugging information. case stripSymbols + /// Performs a loop vectorization pass to widen instructions in loops to + /// operate on multiple consecutive iterations. + case loopVectorize + /// This pass performs a superword-level parallelism pass to combine + /// similar independent instructions into vector instructions. + case slpVectorize } /// A `FunctionPassManager` is an object that collects a sequence of passes @@ -225,7 +231,8 @@ public class FunctionPassManager { .pruneEH: LLVMAddPruneEHPass, .stripDeadPrototypes: LLVMAddStripDeadPrototypesPass, .stripSymbols: LLVMAddStripSymbolsPass, - + .loopVectorize: LLVMAddLoopVectorizePass, + .slpVectorize: LLVMAddSLPVectorizePass, // .internalize: LLVMAddInternalizePass, // .sroaWithThreshhold: LLVMAddScalarReplAggregatesPassWithThreshold, ] diff --git a/Sources/LLVM/Predicates+Deprecations.swift b/Sources/LLVM/Predicates+Deprecations.swift deleted file mode 100644 index 3a0fd1e8..00000000 --- a/Sources/LLVM/Predicates+Deprecations.swift +++ /dev/null @@ -1,90 +0,0 @@ -extension IntPredicate { - /// Yields `true` if the operands are equal, false otherwise without sign - /// interpretation. - @available(*, deprecated, renamed: "equal") - public static let eq = equal - /// Yields `true` if the operands are unequal, false otherwise without sign - /// interpretation. - @available(*, deprecated, renamed: "notEqual") - public static let ne = notEqual - - /// Interprets the operands as unsigned values and yields true if the first is - /// greater than the second. - @available(*, deprecated, renamed: "unsignedGreaterThan") - public static let ugt = unsignedGreaterThan - /// Interprets the operands as unsigned values and yields true if the first is - /// greater than or equal to the second. - - @available(*, deprecated, renamed: "unsignedGreaterThanOrEqual") - public static let uge = unsignedGreaterThanOrEqual - /// Interprets the operands as unsigned values and yields true if the first is - /// less than the second. - @available(*, deprecated, renamed: "unsignedLessThan") - public static let ult = unsignedLessThan - /// Interprets the operands as unsigned values and yields true if the first is - /// less than or equal to the second. - @available(*, deprecated, renamed: "unsignedLessThanOrEqual") - public static let ule = unsignedLessThanOrEqual - - /// Interprets the operands as signed values and yields true if the first is - /// greater than the second. - @available(*, deprecated, renamed: "signedGreaterThan") - public static let sgt = signedGreaterThan - /// Interprets the operands as signed values and yields true if the first is - /// greater than or equal to the second. - @available(*, deprecated, renamed: "signedGreaterThanOrEqual") - public static let sge = signedGreaterThanOrEqual - /// Interprets the operands as signed values and yields true if the first is - /// less than the second. - @available(*, deprecated, renamed: "signedLessThan") - public static let slt = signedLessThan - /// Interprets the operands as signed values and yields true if the first is - /// less than or equal to the second. - @available(*, deprecated, renamed: "signedLessThanOrEqual") - public static let sle = signedLessThanOrEqual -} - -extension RealPredicate { - /// Ordered and equal. - @available(*, deprecated, renamed: "orderedEqual") - public static let oeq = orderedEqual - /// Ordered greater than. - @available(*, deprecated, renamed: "orderedGreaterThan") - public static let ogt = orderedGreaterThan - /// Ordered greater than or equal. - @available(*, deprecated, renamed: "orderedGreaterThanOrEqual") - public static let oge = orderedGreaterThanOrEqual - /// Ordered less than. - @available(*, deprecated, renamed: "orderedLessThan") - public static let olt = orderedLessThan - /// Ordered less than or equal. - @available(*, deprecated, renamed: "orderedLessThanOrEqual") - public static let ole = orderedLessThanOrEqual - /// Ordered and not equal. - @available(*, deprecated, renamed: "orderedNotEqual") - public static let one = orderedNotEqual - /// Ordered (no nans). - @available(*, deprecated, renamed: "ordered") - public static let ord = ordered - /// Unordered (either nans). - @available(*, deprecated, renamed: "unordered") - public static let uno = unordered - /// Unordered or equal. - @available(*, deprecated, renamed: "unorderedEqual") - public static let ueq = unorderedEqual - /// Unordered or greater than. - @available(*, deprecated, renamed: "unorderedGreaterThan") - public static let ugt = unorderedGreaterThan - /// Unordered or greater than or equal. - @available(*, deprecated, renamed: "unorderedGreaterThanOrEqual") - public static let uge = unorderedGreaterThanOrEqual - /// Unordered or less than. - @available(*, deprecated, renamed: "unorderedLessThan") - public static let ult = unorderedLessThan - /// Unordered or less than or equal. - @available(*, deprecated, renamed: "unorderedLessThanOrEqual") - public static let ule = unorderedLessThanOrEqual - /// Unordered or not equal. - @available(*, deprecated, renamed: "unorderedNotEqual") - public static let une = unorderedNotEqual -} diff --git a/utils/make-pkgconfig.swift b/utils/make-pkgconfig.swift index 43cc1b3f..2070f4a5 100644 --- a/utils/make-pkgconfig.swift +++ b/utils/make-pkgconfig.swift @@ -68,6 +68,7 @@ func makeFile() throws { let versionStr = run(llvmConfig, args: ["--version"])! .replacing(charactersIn: .newlines, with: "") + .replacingOccurrences(of: "svn", with: "") let components = versionStr.components(separatedBy: ".") .flatMap { Int($0) }