Date: Fri, 6 Jan 2017 20:13:22 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r311532 - in vendor/llvm/dist: cmake cmake/modules docs include/llvm include/llvm/Analysis include/llvm/Bitcode include/llvm/CodeGen include/llvm/CodeGen/GlobalISel include/llvm/DebugIn... Message-ID: <201701062013.v06KDMN9068258@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Fri Jan 6 20:13:21 2017 New Revision: 311532 URL: https://svnweb.freebsd.org/changeset/base/311532 Log: Vendor import of llvm trunk r291274: https://llvm.org/svn/llvm-project/llvm/trunk@291274 Added: vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h (contents, props changed) vendor/llvm/dist/include/llvm/Support/TarWriter.h (contents, props changed) vendor/llvm/dist/lib/Support/TarWriter.cpp (contents, props changed) vendor/llvm/dist/test/Analysis/CostModel/AArch64/bswap.ll vendor/llvm/dist/test/Analysis/CostModel/AArch64/falkor.ll vendor/llvm/dist/test/CodeGen/AArch64/loh.mir vendor/llvm/dist/test/CodeGen/Generic/cfi-sections.ll vendor/llvm/dist/test/CodeGen/MIR/AArch64/spill-fold.mir vendor/llvm/dist/test/CodeGen/NVPTX/tid-range.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-128.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-256.ll vendor/llvm/dist/test/CodeGen/X86/shuffle-vs-trunc-512.ll vendor/llvm/dist/test/DebugInfo/Generic/licm-hoist-debug-loc.ll vendor/llvm/dist/test/MC/AsmParser/Inputs/ vendor/llvm/dist/test/MC/AsmParser/Inputs/function.x vendor/llvm/dist/test/MC/AsmParser/Inputs/module.x vendor/llvm/dist/test/MC/AsmParser/include/ vendor/llvm/dist/test/MC/AsmParser/include.ll vendor/llvm/dist/test/ThinLTO/X86/Inputs/deadstrip.ll vendor/llvm/dist/test/ThinLTO/X86/Inputs/lazyload_metadata.ll vendor/llvm/dist/test/ThinLTO/X86/deadstrip.ll vendor/llvm/dist/test/ThinLTO/X86/lazyload_metadata.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp-shl-nsw.ll vendor/llvm/dist/test/Transforms/LoopVectorize/X86/strided_load_cost.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/ vendor/llvm/dist/test/Transforms/LowerTypeTests/Inputs/import-unsat.yaml vendor/llvm/dist/test/Transforms/LowerTypeTests/export-nothing.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/import-unsat.ll vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/custom/ vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/custom/gtest-port.h (contents, props changed) vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h (contents, props changed) vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/custom/gtest.h (contents, props changed) vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-port-arch.h (contents, props changed) Modified: vendor/llvm/dist/cmake/config-ix.cmake vendor/llvm/dist/cmake/modules/AddLLVM.cmake vendor/llvm/dist/docs/CompileCudaWithLLVM.rst vendor/llvm/dist/docs/Phabricator.rst vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/Bitcode/BitCodes.h vendor/llvm/dist/include/llvm/Bitcode/BitstreamReader.h vendor/llvm/dist/include/llvm/Bitcode/BitstreamWriter.h vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/CodeGen/DIE.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/IRTranslator.h vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDie.h vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h vendor/llvm/dist/include/llvm/IR/PassManager.h vendor/llvm/dist/include/llvm/LTO/LTO.h vendor/llvm/dist/include/llvm/MC/MCTargetOptions.h vendor/llvm/dist/include/llvm/Support/FileSystem.h vendor/llvm/dist/include/llvm/Transforms/IPO/FunctionImport.h vendor/llvm/dist/include/llvm/Transforms/IPO/LowerTypeTests.h vendor/llvm/dist/include/llvm/Transforms/Utils/FunctionImportUtils.h vendor/llvm/dist/include/llvm/module.modulemap vendor/llvm/dist/lib/Analysis/ModuleSummaryAnalysis.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp vendor/llvm/dist/lib/Bitcode/Reader/BitstreamReader.cpp vendor/llvm/dist/lib/Bitcode/Reader/MetadataLoader.cpp vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/ARMException.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/IRTranslator.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp vendor/llvm/dist/lib/CodeGen/IfConversion.cpp vendor/llvm/dist/lib/CodeGen/MIRPrinter.cpp vendor/llvm/dist/lib/CodeGen/MachineBasicBlock.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/RegisterScavenging.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDie.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerDriver.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerFlags.def vendor/llvm/dist/lib/Fuzzer/FuzzerIO.h vendor/llvm/dist/lib/Fuzzer/FuzzerIOPosix.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerIOWindows.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerInternal.h vendor/llvm/dist/lib/Fuzzer/FuzzerLoop.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerMerge.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerOptions.h vendor/llvm/dist/lib/Fuzzer/FuzzerTraceState.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerUtilPosix.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerUtilWindows.cpp vendor/llvm/dist/lib/Fuzzer/test/merge.test vendor/llvm/dist/lib/LTO/LTO.cpp vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp vendor/llvm/dist/lib/Support/APInt.cpp vendor/llvm/dist/lib/Support/CMakeLists.txt vendor/llvm/dist/lib/Support/Host.cpp vendor/llvm/dist/lib/Support/Unix/Signals.inc vendor/llvm/dist/lib/Target/AArch64/AArch64CollectLOH.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.h vendor/llvm/dist/lib/Target/AArch64/AArch64InstructionSelector.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64InstructionSelector.h vendor/llvm/dist/lib/Target/AArch64/AArch64MachineFunctionInfo.h vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetTransformInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetTransformInfo.h vendor/llvm/dist/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp vendor/llvm/dist/lib/Target/AArch64/Disassembler/AArch64Disassembler.h vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64MCCodeEmitter.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetTransformInfo.h vendor/llvm/dist/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp vendor/llvm/dist/lib/Target/Lanai/Disassembler/LanaiDisassembler.h vendor/llvm/dist/lib/Target/Lanai/InstPrinter/LanaiInstPrinter.h vendor/llvm/dist/lib/Target/Lanai/LanaiISelLowering.cpp vendor/llvm/dist/lib/Target/Lanai/LanaiRegisterInfo.h vendor/llvm/dist/lib/Target/Lanai/MCTargetDesc/LanaiELFObjectWriter.cpp vendor/llvm/dist/lib/Target/Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp vendor/llvm/dist/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstr64Bit.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrFormats.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86TargetTransformInfo.cpp vendor/llvm/dist/lib/Target/X86/X86TargetTransformInfo.h vendor/llvm/dist/lib/Transforms/IPO/FunctionImport.cpp vendor/llvm/dist/lib/Transforms/IPO/LowerTypeTests.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/LICM.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopSink.cpp vendor/llvm/dist/lib/Transforms/Utils/FunctionImportUtils.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/test/Analysis/CostModel/AArch64/gep.ll vendor/llvm/dist/test/Analysis/CostModel/X86/arith.ll vendor/llvm/dist/test/Analysis/CostModel/X86/shuffle-broadcast.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vdiv-cost.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-ashr-cost.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-lshr-cost.ll vendor/llvm/dist/test/Analysis/CostModel/X86/vshift-shl-cost.ll vendor/llvm/dist/test/Bitcode/summary_version.ll vendor/llvm/dist/test/Bitcode/thinlto-function-summary.ll vendor/llvm/dist/test/Bitcode/thinlto-summary-section.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/arm64-instructionselect.mir vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll vendor/llvm/dist/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-collect-loh-garbage-crash.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-collect-loh-str.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-collect-loh.ll vendor/llvm/dist/test/CodeGen/AArch64/machine-scheduler.mir vendor/llvm/dist/test/CodeGen/AMDGPU/hsa-func.ll vendor/llvm/dist/test/CodeGen/AMDGPU/hsa.ll vendor/llvm/dist/test/CodeGen/MIR/X86/basic-block-liveins.mir vendor/llvm/dist/test/CodeGen/MIR/X86/machine-verifier.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/irtranslator-call.ll vendor/llvm/dist/test/CodeGen/X86/avx512-intrinsics-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx512-trunc.ll vendor/llvm/dist/test/CodeGen/X86/cmov.ll vendor/llvm/dist/test/CodeGen/X86/lower-vec-shift-2.ll vendor/llvm/dist/test/CodeGen/X86/tail-call-conditional.mir vendor/llvm/dist/test/CodeGen/X86/vector-rotate-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-ashr-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-lshr-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-128.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-256.ll vendor/llvm/dist/test/CodeGen/X86/vector-shift-shl-512.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-128-v16.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-128-v4.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-128-v8.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-masked.ll vendor/llvm/dist/test/CodeGen/X86/vector-tzcnt-128.ll vendor/llvm/dist/test/CodeGen/X86/vshift-4.ll vendor/llvm/dist/test/Instrumentation/AddressSanitizer/asan-masked-load-store.ll vendor/llvm/dist/test/MC/Disassembler/PowerPC/ppc64-encoding-fp.txt vendor/llvm/dist/test/MC/PowerPC/ppc64-encoding-fp.s vendor/llvm/dist/test/Transforms/GVN/PRE/phi-translate.ll vendor/llvm/dist/test/Transforms/InstCombine/amdgcn-intrinsics.ll vendor/llvm/dist/test/Transforms/InstCombine/cos-intrinsic.ll vendor/llvm/dist/test/Transforms/InstCombine/icmp.ll vendor/llvm/dist/test/Transforms/InstSimplify/select.ll vendor/llvm/dist/test/Transforms/LICM/scalar_promote.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/function-disjoint.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/function-ext.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/function.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/simple.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/single-offset.ll vendor/llvm/dist/test/Transforms/LowerTypeTests/unsat.ll vendor/llvm/dist/tools/dsymutil/DwarfLinker.cpp vendor/llvm/dist/tools/llc/llc.cpp vendor/llvm/dist/tools/llvm-config/llvm-config.cpp vendor/llvm/dist/unittests/ADT/APFloatTest.cpp vendor/llvm/dist/unittests/ADT/IntrusiveRefCntPtrTest.cpp vendor/llvm/dist/unittests/Bitcode/BitstreamReaderTest.cpp vendor/llvm/dist/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp vendor/llvm/dist/unittests/DebugInfo/DWARF/DwarfGenerator.cpp vendor/llvm/dist/unittests/DebugInfo/DWARF/DwarfGenerator.h vendor/llvm/dist/utils/lit/lit/formats/googletest.py vendor/llvm/dist/utils/unittest/CMakeLists.txt vendor/llvm/dist/utils/unittest/googletest/README.LLVM vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest-death-test.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest-message.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest-param-test.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest-printers.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest-spi.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest-test-part.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest-typed-test.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/gtest_pred_impl.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-internal.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-linked_ptr.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-port.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-string.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-tuple.h vendor/llvm/dist/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h vendor/llvm/dist/utils/unittest/googletest/src/gtest-death-test.cc vendor/llvm/dist/utils/unittest/googletest/src/gtest-filepath.cc vendor/llvm/dist/utils/unittest/googletest/src/gtest-internal-inl.h vendor/llvm/dist/utils/unittest/googletest/src/gtest-port.cc vendor/llvm/dist/utils/unittest/googletest/src/gtest-printers.cc vendor/llvm/dist/utils/unittest/googletest/src/gtest-test-part.cc vendor/llvm/dist/utils/unittest/googletest/src/gtest-typed-test.cc vendor/llvm/dist/utils/unittest/googletest/src/gtest.cc Modified: vendor/llvm/dist/cmake/config-ix.cmake ============================================================================== --- vendor/llvm/dist/cmake/config-ix.cmake Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/cmake/config-ix.cmake Fri Jan 6 20:13:21 2017 (r311532) @@ -167,7 +167,10 @@ check_symbol_exists(futimens sys/stat.h check_symbol_exists(futimes sys/time.h HAVE_FUTIMES) check_symbol_exists(posix_fallocate fcntl.h HAVE_POSIX_FALLOCATE) # AddressSanitizer conflicts with lib/Support/Unix/Signals.inc -if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") +# Avoid sigaltstack on Apple platforms, where backtrace() cannot handle it +# (rdar://7089625) and _Unwind_Backtrace is unusable because it cannot unwind +# past the signal handler after an assertion failure (rdar://29866587). +if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*" AND NOT APPLE ) check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK) endif() if( HAVE_SYS_UIO_H ) @@ -314,6 +317,8 @@ else() endif() check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG) +check_cxx_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments" + SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG) set(USE_NO_MAYBE_UNINITIALIZED 0) set(USE_NO_UNINITIALIZED 0) Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/AddLLVM.cmake Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/cmake/modules/AddLLVM.cmake Fri Jan 6 20:13:21 2017 (r311532) @@ -1014,6 +1014,10 @@ function(add_unittest test_suite test_na if (SUPPORTS_NO_VARIADIC_MACROS_FLAG) list(APPEND LLVM_COMPILE_FLAGS "-Wno-variadic-macros") endif () + # Some parts of gtest rely on this GNU extension, don't warn on it. + if(SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG) + list(APPEND LLVM_COMPILE_FLAGS "-Wno-gnu-zero-variadic-macro-arguments") + endif() set(LLVM_REQUIRES_RTTI OFF) Modified: vendor/llvm/dist/docs/CompileCudaWithLLVM.rst ============================================================================== --- vendor/llvm/dist/docs/CompileCudaWithLLVM.rst Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/docs/CompileCudaWithLLVM.rst Fri Jan 6 20:13:21 2017 (r311532) @@ -35,8 +35,8 @@ by many Linux package managers; you prob You will need CUDA 7.0, 7.5, or 8.0 to compile with clang. -CUDA compilation is supported on Linux, and on MacOS as of XXXX-XX-XX. Windows -support is planned but not yet in place. +CUDA compilation is supported on Linux, on MacOS as of 2016-11-18, and on +Windows as of 2017-01-05. Invoking clang -------------- Modified: vendor/llvm/dist/docs/Phabricator.rst ============================================================================== --- vendor/llvm/dist/docs/Phabricator.rst Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/docs/Phabricator.rst Fri Jan 6 20:13:21 2017 (r311532) @@ -132,7 +132,7 @@ committed to trunk. If you do not have c commit the change for you (with attribution). It is sufficient to add a comment to the approved review indicating you cannot commit the patch yourself. If you have commit access, there are multiple workflows to commit the -change. Whichever method you follow it is recommend that your commit message +change. Whichever method you follow it is recommended that your commit message ends with the line: :: Modified: vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h Fri Jan 6 20:13:21 2017 (r311532) @@ -128,7 +128,7 @@ extern template class PassManager<LazyCa /// \brief The CGSCC pass manager. /// /// See the documentation for the PassManager template for details. It runs -/// a sequency of SCC passes over each SCC that the manager is run over. This +/// a sequence of SCC passes over each SCC that the manager is run over. This /// typedef serves as a convenient way to refer to this construct. typedef PassManager<LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult &> Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h Fri Jan 6 20:13:21 2017 (r311532) @@ -36,6 +36,8 @@ namespace llvm { class Function; class GlobalValue; class Loop; +class ScalarEvolution; +class SCEV; class Type; class User; class Value; @@ -613,10 +615,11 @@ public: /// merged into the instruction indexing mode. Some targets might want to /// distinguish between address computation for memory operations on vector /// types and scalar types. Such targets should override this function. - /// The 'IsComplex' parameter is a hint that the address computation is likely - /// to involve multiple instructions and as such unlikely to be merged into - /// the address indexing mode. - int getAddressComputationCost(Type *Ty, bool IsComplex = false) const; + /// The 'SE' parameter holds pointer for the scalar evolution object which + /// is used in order to get the Ptr step value in case of constant stride. + /// The 'Ptr' parameter holds SCEV of the access pointer. + int getAddressComputationCost(Type *Ty, ScalarEvolution *SE = nullptr, + const SCEV *Ptr = nullptr) const; /// \returns The cost, if any, of keeping values of the given types alive /// over a callsite. @@ -795,7 +798,8 @@ public: virtual int getCallInstrCost(Function *F, Type *RetTy, ArrayRef<Type *> Tys) = 0; virtual unsigned getNumberOfParts(Type *Tp) = 0; - virtual int getAddressComputationCost(Type *Ty, bool IsComplex) = 0; + virtual int getAddressComputationCost(Type *Ty, ScalarEvolution *SE, + const SCEV *Ptr) = 0; virtual unsigned getCostOfKeepingLiveOverCall(ArrayRef<Type *> Tys) = 0; virtual bool getTgtMemIntrinsic(IntrinsicInst *Inst, MemIntrinsicInfo &Info) = 0; @@ -1044,8 +1048,9 @@ public: unsigned getNumberOfParts(Type *Tp) override { return Impl.getNumberOfParts(Tp); } - int getAddressComputationCost(Type *Ty, bool IsComplex) override { - return Impl.getAddressComputationCost(Ty, IsComplex); + int getAddressComputationCost(Type *Ty, ScalarEvolution *SE, + const SCEV *Ptr) override { + return Impl.getAddressComputationCost(Ty, SE, Ptr); } unsigned getCostOfKeepingLiveOverCall(ArrayRef<Type *> Tys) override { return Impl.getCostOfKeepingLiveOverCall(Tys); Modified: vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h Fri Jan 6 20:13:21 2017 (r311532) @@ -15,6 +15,7 @@ #ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFOIMPL_H #define LLVM_ANALYSIS_TARGETTRANSFORMINFOIMPL_H +#include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/DataLayout.h" @@ -370,7 +371,10 @@ public: unsigned getNumberOfParts(Type *Tp) { return 0; } - unsigned getAddressComputationCost(Type *Tp, bool) { return 0; } + unsigned getAddressComputationCost(Type *Tp, ScalarEvolution *, + const SCEV *) { + return 0; + } unsigned getReductionCost(unsigned, Type *, bool) { return 1; } @@ -422,6 +426,30 @@ public: VectorType *VecTy) const { return VF; } +protected: + bool isStridedAccess(const SCEV *Ptr) { + return Ptr && isa<SCEVAddRecExpr>(Ptr); + } + + const SCEVConstant *getConstantStrideStep(ScalarEvolution *SE, + const SCEV *Ptr) { + if (!isStridedAccess(Ptr)) + return nullptr; + const SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ptr); + return dyn_cast<SCEVConstant>(AddRec->getStepRecurrence(*SE)); + } + + bool isConstantStridedAccessLessThan(ScalarEvolution *SE, const SCEV *Ptr, + int64_t MergeDistance) { + const SCEVConstant *Step = getConstantStrideStep(SE, Ptr); + if (!Step) + return false; + APInt StrideVal = Step->getAPInt(); + if (StrideVal.getBitWidth() > 64) + return false; + // FIXME: need to take absolute value for negtive stride case + return StrideVal.getSExtValue() < MergeDistance; + } }; /// \brief CRTP base class for use as a mix-in that aids implementing Modified: vendor/llvm/dist/include/llvm/Bitcode/BitCodes.h ============================================================================== --- vendor/llvm/dist/include/llvm/Bitcode/BitCodes.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/Bitcode/BitCodes.h Fri Jan 6 20:13:21 2017 (r311532) @@ -18,7 +18,6 @@ #ifndef LLVM_BITCODE_BITCODES_H #define LLVM_BITCODE_BITCODES_H -#include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/DataTypes.h" #include "llvm/Support/ErrorHandling.h" @@ -166,11 +165,8 @@ template <> struct isPodLike<BitCodeAbbr /// BitCodeAbbrev - This class represents an abbreviation record. An /// abbreviation allows a complex record that has redundancy to be stored in a /// specialized format instead of the fully-general, fully-vbr, format. -class BitCodeAbbrev : public RefCountedBase<BitCodeAbbrev> { +class BitCodeAbbrev { SmallVector<BitCodeAbbrevOp, 32> OperandList; - // Only RefCountedBase is allowed to delete. - ~BitCodeAbbrev() = default; - friend class RefCountedBase<BitCodeAbbrev>; public: unsigned getNumOperandInfos() const { Modified: vendor/llvm/dist/include/llvm/Bitcode/BitstreamReader.h ============================================================================== --- vendor/llvm/dist/include/llvm/Bitcode/BitstreamReader.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/Bitcode/BitstreamReader.h Fri Jan 6 20:13:21 2017 (r311532) @@ -16,7 +16,6 @@ #define LLVM_BITCODE_BITSTREAMREADER_H #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Bitcode/BitCodes.h" #include "llvm/Support/Endian.h" @@ -42,7 +41,7 @@ public: /// describe abbreviations that all blocks of the specified ID inherit. struct BlockInfo { unsigned BlockID; - std::vector<IntrusiveRefCntPtr<BitCodeAbbrev>> Abbrevs; + std::vector<std::shared_ptr<BitCodeAbbrev>> Abbrevs; std::string Name; std::vector<std::pair<unsigned, std::string> > RecordNames; }; @@ -316,11 +315,11 @@ class BitstreamCursor : SimpleBitstreamC unsigned CurCodeSize = 2; /// Abbrevs installed at in this block. - std::vector<IntrusiveRefCntPtr<BitCodeAbbrev>> CurAbbrevs; + std::vector<std::shared_ptr<BitCodeAbbrev>> CurAbbrevs; struct Block { unsigned PrevCodeSize; - std::vector<IntrusiveRefCntPtr<BitCodeAbbrev>> PrevAbbrevs; + std::vector<std::shared_ptr<BitCodeAbbrev>> PrevAbbrevs; explicit Block(unsigned PCS) : PrevCodeSize(PCS) {} }; @@ -478,8 +477,8 @@ public: return CurAbbrevs[AbbrevNo].get(); } - /// Read the current record and discard it. - void skipRecord(unsigned AbbrevID); + /// Read the current record and discard it, returning the code for the record. + unsigned skipRecord(unsigned AbbrevID); unsigned readRecord(unsigned AbbrevID, SmallVectorImpl<uint64_t> &Vals, StringRef *Blob = nullptr); Modified: vendor/llvm/dist/include/llvm/Bitcode/BitstreamWriter.h ============================================================================== --- vendor/llvm/dist/include/llvm/Bitcode/BitstreamWriter.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/Bitcode/BitstreamWriter.h Fri Jan 6 20:13:21 2017 (r311532) @@ -43,12 +43,12 @@ class BitstreamWriter { unsigned BlockInfoCurBID; /// CurAbbrevs - Abbrevs installed at in this block. - std::vector<IntrusiveRefCntPtr<BitCodeAbbrev>> CurAbbrevs; + std::vector<std::shared_ptr<BitCodeAbbrev>> CurAbbrevs; struct Block { unsigned PrevCodeSize; size_t StartSizeWord; - std::vector<IntrusiveRefCntPtr<BitCodeAbbrev>> PrevAbbrevs; + std::vector<std::shared_ptr<BitCodeAbbrev>> PrevAbbrevs; Block(unsigned PCS, size_t SSW) : PrevCodeSize(PCS), StartSizeWord(SSW) {} }; @@ -59,7 +59,7 @@ class BitstreamWriter { /// These describe abbreviations that all blocks of the specified ID inherit. struct BlockInfo { unsigned BlockID; - std::vector<IntrusiveRefCntPtr<BitCodeAbbrev>> Abbrevs; + std::vector<std::shared_ptr<BitCodeAbbrev>> Abbrevs; }; std::vector<BlockInfo> BlockInfoRecords; @@ -469,12 +469,12 @@ public: private: // Emit the abbreviation as a DEFINE_ABBREV record. - void EncodeAbbrev(BitCodeAbbrev *Abbv) { + void EncodeAbbrev(const BitCodeAbbrev &Abbv) { EmitCode(bitc::DEFINE_ABBREV); - EmitVBR(Abbv->getNumOperandInfos(), 5); - for (unsigned i = 0, e = static_cast<unsigned>(Abbv->getNumOperandInfos()); + EmitVBR(Abbv.getNumOperandInfos(), 5); + for (unsigned i = 0, e = static_cast<unsigned>(Abbv.getNumOperandInfos()); i != e; ++i) { - const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i); + const BitCodeAbbrevOp &Op = Abbv.getOperandInfo(i); Emit(Op.isLiteral(), 1); if (Op.isLiteral()) { EmitVBR64(Op.getLiteralValue(), 8); @@ -489,10 +489,10 @@ public: /// EmitAbbrev - This emits an abbreviation to the stream. Note that this /// method takes ownership of the specified abbrev. - unsigned EmitAbbrev(BitCodeAbbrev *Abbv) { + unsigned EmitAbbrev(std::shared_ptr<BitCodeAbbrev> Abbv) { // Emit the abbreviation as a record. - EncodeAbbrev(Abbv); - CurAbbrevs.push_back(Abbv); + EncodeAbbrev(*Abbv); + CurAbbrevs.push_back(std::move(Abbv)); return static_cast<unsigned>(CurAbbrevs.size())-1 + bitc::FIRST_APPLICATION_ABBREV; } @@ -532,13 +532,13 @@ public: /// EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified /// BlockID. - unsigned EmitBlockInfoAbbrev(unsigned BlockID, BitCodeAbbrev *Abbv) { + unsigned EmitBlockInfoAbbrev(unsigned BlockID, std::shared_ptr<BitCodeAbbrev> Abbv) { SwitchToBlockID(BlockID); - EncodeAbbrev(Abbv); + EncodeAbbrev(*Abbv); // Add the abbrev to the specified block record. BlockInfo &Info = getOrCreateBlockInfo(BlockID); - Info.Abbrevs.push_back(Abbv); + Info.Abbrevs.push_back(std::move(Abbv)); return Info.Abbrevs.size()-1+bitc::FIRST_APPLICATION_ABBREV; } Modified: vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h Fri Jan 6 20:13:21 2017 (r311532) @@ -140,6 +140,9 @@ private: /// If the target supports dwarf debug info, this pointer is non-null. DwarfDebug *DD; + /// If the current module uses dwarf CFI annotations strictly for debugging. + bool isCFIMoveForDebugging; + protected: explicit AsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer); @@ -262,6 +265,10 @@ public: enum CFIMoveType { CFI_M_None, CFI_M_EH, CFI_M_Debug }; CFIMoveType needsCFIMoves(); + /// Returns false if needsCFIMoves() == CFI_M_EH for any function + /// in the module. + bool needsOnlyDebugCFIMoves() const { return isCFIMoveForDebugging; } + bool needsSEHMoves(); /// Print to the current output stream assembly representations of the Modified: vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h Fri Jan 6 20:13:21 2017 (r311532) @@ -925,7 +925,10 @@ public: return LT.first; } - unsigned getAddressComputationCost(Type *Ty, bool IsComplex) { return 0; } + unsigned getAddressComputationCost(Type *Ty, ScalarEvolution *, + const SCEV *) { + return 0; + } unsigned getReductionCost(unsigned Opcode, Type *Ty, bool IsPairwise) { assert(Ty->isVectorTy() && "Expect a vector type"); Modified: vendor/llvm/dist/include/llvm/CodeGen/DIE.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/DIE.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/CodeGen/DIE.h Fri Jan 6 20:13:21 2017 (r311532) @@ -651,6 +651,9 @@ class DIE : IntrusiveBackListNode, publi unsigned AbbrevNumber = ~0u; /// Dwarf tag code. dwarf::Tag Tag = (dwarf::Tag)0; + /// Set to true to force a DIE to emit an abbreviation that says it has + /// children even when it doesn't. This is used for unit testing purposes. + bool ForceChildren; /// Children DIEs. IntrusiveBackList<DIE> Children; @@ -659,7 +662,8 @@ class DIE : IntrusiveBackListNode, publi PointerUnion<DIE *, DIEUnit *> Owner; DIE() = delete; - explicit DIE(dwarf::Tag Tag) : Offset(0), Size(0), Tag(Tag) {} + explicit DIE(dwarf::Tag Tag) : Offset(0), Size(0), Tag(Tag), + ForceChildren(false) {} public: static DIE *get(BumpPtrAllocator &Alloc, dwarf::Tag Tag) { @@ -677,7 +681,8 @@ public: /// Get the compile/type unit relative offset of this DIE. unsigned getOffset() const { return Offset; } unsigned getSize() const { return Size; } - bool hasChildren() const { return !Children.empty(); } + bool hasChildren() const { return ForceChildren || !Children.empty(); } + void setForceChildren(bool B) { ForceChildren = B; } typedef IntrusiveBackList<DIE>::iterator child_iterator; typedef IntrusiveBackList<DIE>::const_iterator const_child_iterator; Modified: vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/IRTranslator.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/IRTranslator.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/IRTranslator.h Fri Jan 6 20:13:21 2017 (r311532) @@ -180,6 +180,8 @@ private: /// \pre \p U is a branch instruction. bool translateBr(const User &U, MachineIRBuilder &MIRBuilder); + bool translateSwitch(const User &U, MachineIRBuilder &MIRBuilder); + bool translateExtractValue(const User &U, MachineIRBuilder &MIRBuilder); bool translateInsertValue(const User &U, MachineIRBuilder &MIRBuilder); @@ -292,12 +294,8 @@ private: return translateBinaryOp(TargetOpcode::G_FREM, U, MIRBuilder); } - // Stubs to keep the compiler happy while we implement the rest of the // translation. - bool translateSwitch(const User &U, MachineIRBuilder &MIRBuilder) { - return false; - } bool translateIndirectBr(const User &U, MachineIRBuilder &MIRBuilder) { return false; } Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h Fri Jan 6 20:13:21 2017 (r311532) @@ -308,7 +308,7 @@ public: // Iteration support for live in sets. These sets are kept in sorted // order by their register number. typedef LiveInVector::const_iterator livein_iterator; - livein_iterator livein_begin() const { return LiveIns.begin(); } + livein_iterator livein_begin() const; livein_iterator livein_end() const { return LiveIns.end(); } bool livein_empty() const { return LiveIns.empty(); } iterator_range<livein_iterator> liveins() const { Modified: vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDie.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDie.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDie.h Fri Jan 6 20:13:21 2017 (r311532) @@ -10,6 +10,8 @@ #ifndef LLVM_LIB_DEBUGINFO_DWARFDIE_H #define LLVM_LIB_DEBUGINFO_DWARFDIE_H +#include "llvm/ADT/iterator.h" +#include "llvm/ADT/iterator_range.h" #include "llvm/ADT/Optional.h" #include "llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h" @@ -40,9 +42,6 @@ public: bool isValid() const { return U && Die; } explicit operator bool() const { return isValid(); } - bool operator ==(const DWARFDie &RHS) const { - return Die == RHS.Die && U == RHS.U; - } const DWARFDebugInfoEntry *getDebugInfoEntry() const { return Die; } DWARFUnit *getDwarfUnit() const { return U; } @@ -361,8 +360,61 @@ public: getInlinedChainForAddress(const uint64_t Address, SmallVectorImpl<DWARFDie> &InlinedChain) const; + class iterator; + + iterator begin() const; + iterator end() const; + iterator_range<iterator> children() const; +}; + + +inline bool operator==(const DWARFDie &LHS, const DWARFDie &RHS) { + return LHS.getDebugInfoEntry() == RHS.getDebugInfoEntry() && + LHS.getDwarfUnit() == RHS.getDwarfUnit(); +} + +inline bool operator!=(const DWARFDie &LHS, const DWARFDie &RHS) { + return !(LHS == RHS); +} + +class DWARFDie::iterator : public iterator_facade_base<iterator, + std::forward_iterator_tag, + const DWARFDie> { + DWARFDie Die; + void skipNull() { + if (Die && Die.isNULL()) + Die = DWARFDie(); + } +public: + iterator() = default; + explicit iterator(DWARFDie D) : Die(D) { + // If we start out with only a Null DIE then invalidate. + skipNull(); + } + iterator &operator++() { + Die = Die.getSibling(); + // Don't include the NULL die when iterating. + skipNull(); + return *this; + } + explicit operator bool() const { return Die.isValid(); } + const DWARFDie &operator*() const { return Die; } + bool operator==(const iterator &X) const { return Die == X.Die; } }; +// These inline functions must follow the DWARFDie::iterator definition above +// as they use functions from that class. +inline DWARFDie::iterator DWARFDie::begin() const { + return iterator(getFirstChild()); +} + +inline DWARFDie::iterator DWARFDie::end() const { + return iterator(); +} + +inline iterator_range<DWARFDie::iterator> DWARFDie::children() const { + return make_range(begin(), end()); +} } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h ============================================================================== --- vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h Fri Jan 6 20:13:21 2017 (r311532) @@ -47,9 +47,9 @@ public: /// Locks the channel for writing. template <typename FunctionIdT, typename SequenceIdT> Error startSendMessage(const FunctionIdT &FnId, const SequenceIdT &SeqNo) { + writeLock.lock(); if (auto Err = serializeSeq(*this, FnId, SeqNo)) return Err; - writeLock.lock(); return Error::success(); } Modified: vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h Fri Jan 6 20:13:21 2017 (r311532) @@ -28,6 +28,10 @@ namespace llvm { +namespace yaml { +template <typename T> struct MappingTraits; +} + /// \brief Class to accumulate and hold information about a callee. struct CalleeInfo { enum class HotnessType : uint8_t { Unknown = 0, Cold = 1, None = 2, Hot = 3 }; @@ -102,7 +106,7 @@ public: /// \brief Sububclass discriminator (for dyn_cast<> et al.) enum SummaryKind : unsigned { AliasKind, FunctionKind, GlobalVarKind }; - /// Group flags (Linkage, noRename, isOptSize, etc.) as a bitfield. + /// Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield. struct GVFlags { /// \brief The linkage type of the associated global value. /// @@ -113,39 +117,20 @@ public: /// types based on global summary-based analysis. unsigned Linkage : 4; - /// Indicate if the global value cannot be renamed (in a specific section, - /// possibly referenced from inline assembly, etc). - unsigned NoRename : 1; - - /// Indicate if a function contains inline assembly (which is opaque), - /// that may reference a local value. This is used to prevent importing - /// of this function, since we can't promote and rename the uses of the - /// local in the inline assembly. Use a flag rather than bloating the - /// summary with references to every possible local value in the - /// llvm.used set. - unsigned HasInlineAsmMaybeReferencingInternal : 1; - - /// Indicate if the function is not viable to inline. - unsigned IsNotViableToInline : 1; + /// Indicate if the global value cannot be imported (e.g. it cannot + /// be renamed or references something that can't be renamed). + unsigned NotEligibleToImport : 1; + + /// Indicate that the global value must be considered a live root for + /// index-based liveness analysis. Used for special LLVM values such as + /// llvm.global_ctors that the linker does not know about. + unsigned LiveRoot : 1; /// Convenience Constructors - explicit GVFlags(GlobalValue::LinkageTypes Linkage, bool NoRename, - bool HasInlineAsmMaybeReferencingInternal, - bool IsNotViableToInline) - : Linkage(Linkage), NoRename(NoRename), - HasInlineAsmMaybeReferencingInternal( - HasInlineAsmMaybeReferencingInternal), - IsNotViableToInline(IsNotViableToInline) {} - - GVFlags(const GlobalValue &GV) - : Linkage(GV.getLinkage()), NoRename(GV.hasSection()), - HasInlineAsmMaybeReferencingInternal(false) { - IsNotViableToInline = false; - if (const auto *F = dyn_cast<Function>(&GV)) - // Inliner doesn't handle variadic functions. - // FIXME: refactor this to use the same code that inliner is using. - IsNotViableToInline = F->isVarArg(); - } + explicit GVFlags(GlobalValue::LinkageTypes Linkage, + bool NotEligibleToImport, bool LiveRoot) + : Linkage(Linkage), NotEligibleToImport(NotEligibleToImport), + LiveRoot(LiveRoot) {} }; private: @@ -213,31 +198,19 @@ public: Flags.Linkage = Linkage; } - bool isNotViableToInline() const { return Flags.IsNotViableToInline; } + /// Return true if this global value can't be imported. + bool notEligibleToImport() const { return Flags.NotEligibleToImport; } - /// Return true if this summary is for a GlobalValue that needs promotion - /// to be referenced from another module. - bool needsRenaming() const { return GlobalValue::isLocalLinkage(linkage()); } - - /// Return true if this global value cannot be renamed (in a specific section, - /// possibly referenced from inline assembly, etc). - bool noRename() const { return Flags.NoRename; } - - /// Flag that this global value cannot be renamed (in a specific section, - /// possibly referenced from inline assembly, etc). - void setNoRename() { Flags.NoRename = true; } - - /// Return true if this global value possibly references another value - /// that can't be renamed. - bool hasInlineAsmMaybeReferencingInternal() const { - return Flags.HasInlineAsmMaybeReferencingInternal; - } - - /// Flag that this global value possibly references another value that - /// can't be renamed. - void setHasInlineAsmMaybeReferencingInternal() { - Flags.HasInlineAsmMaybeReferencingInternal = true; - } + /// Return true if this global value must be considered a root for live + /// value analysis on the index. + bool liveRoot() const { return Flags.LiveRoot; } + + /// Flag that this global value must be considered a root for live + /// value analysis on the index. + void setLiveRoot() { Flags.LiveRoot = true; } + + /// Flag that this global value cannot be imported. + void setNotEligibleToImport() { Flags.NotEligibleToImport = true; } /// Return the list of values referenced by this global value definition. ArrayRef<ValueInfo> refs() const { return RefEdgeList; } @@ -330,6 +303,30 @@ public: } }; +struct TypeTestResolution { + /// Specifies which kind of type check we should emit for this byte array. + /// See http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html for full + /// details on each kind of check; the enumerators are described with + /// reference to that document. + enum Kind { + Unsat, ///< Unsatisfiable type (i.e. no global has this type metadata) + ByteArray, ///< Test a byte array (first example) + Inline, ///< Inlined bit vector ("Short Inline Bit Vectors") + Single, ///< Single element (last example in "Short Inline Bit Vectors") + AllOnes, ///< All-ones bit vector ("Eliminating Bit Vector Checks for + /// All-Ones Bit Vectors") + } TheKind = Unsat; + + /// Range of the size expressed as a bit width. For example, if the size is in + /// range [0,256), this number will be 8. This helps generate the most compact + /// instruction sequences. + unsigned SizeBitWidth = 0; +}; + +struct TypeIdSummary { + TypeTestResolution TTRes; +}; + /// 160 bits SHA1 typedef std::array<uint32_t, 5> ModuleHash; @@ -370,11 +367,20 @@ private: /// Holds strings for combined index, mapping to the corresponding module ID. ModulePathStringTableTy ModulePathStringTable; + /// Mapping from type identifiers to summary information for that type + /// identifier. + // FIXME: Add bitcode read/write support for this field. + std::map<std::string, TypeIdSummary> TypeIdMap; + + // YAML I/O support. + friend yaml::MappingTraits<ModuleSummaryIndex>; + public: gvsummary_iterator begin() { return GlobalValueMap.begin(); } const_gvsummary_iterator begin() const { return GlobalValueMap.begin(); } gvsummary_iterator end() { return GlobalValueMap.end(); } const_gvsummary_iterator end() const { return GlobalValueMap.end(); } + size_t size() const { return GlobalValueMap.size(); } /// Get the list of global value summary objects for a given value name. const GlobalValueSummaryList &getGlobalValueSummaryList(StringRef ValueName) { Added: vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h Fri Jan 6 20:13:21 2017 (r311532) @@ -0,0 +1,111 @@ +//===-- llvm/ModuleSummaryIndexYAML.h - YAML I/O for summary ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_IR_MODULESUMMARYINDEXYAML_H +#define LLVM_IR_MODULESUMMARYINDEXYAML_H + +#include "llvm/IR/ModuleSummaryIndex.h" +#include "llvm/Support/YAMLTraits.h" + +namespace llvm { +namespace yaml { + +template <> struct ScalarEnumerationTraits<TypeTestResolution::Kind> { + static void enumeration(IO &io, TypeTestResolution::Kind &value) { + io.enumCase(value, "Unsat", TypeTestResolution::Unsat); + io.enumCase(value, "ByteArray", TypeTestResolution::ByteArray); + io.enumCase(value, "Inline", TypeTestResolution::Inline); + io.enumCase(value, "Single", TypeTestResolution::Single); + io.enumCase(value, "AllOnes", TypeTestResolution::AllOnes); + } +}; + +template <> struct MappingTraits<TypeTestResolution> { + static void mapping(IO &io, TypeTestResolution &res) { + io.mapRequired("Kind", res.TheKind); + io.mapRequired("SizeBitWidth", res.SizeBitWidth); + } +}; + +template <> struct MappingTraits<TypeIdSummary> { + static void mapping(IO &io, TypeIdSummary& summary) { + io.mapRequired("TTRes", summary.TTRes); + } +}; + +struct FunctionSummaryYaml { + std::vector<uint64_t> TypeTests; +}; + +} // End yaml namespace +} // End llvm namespace + +LLVM_YAML_IS_SEQUENCE_VECTOR(uint64_t) + +namespace llvm { +namespace yaml { + +template <> struct MappingTraits<FunctionSummaryYaml> { + static void mapping(IO &io, FunctionSummaryYaml& summary) { + io.mapRequired("TypeTests", summary.TypeTests); + } +}; + +} // End yaml namespace +} // End llvm namespace + +LLVM_YAML_IS_STRING_MAP(TypeIdSummary) +LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionSummaryYaml) + +namespace llvm { +namespace yaml { + +// FIXME: Add YAML mappings for the rest of the module summary. +template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> { + static void inputOne(IO &io, StringRef Key, GlobalValueSummaryMapTy &V) { + std::vector<FunctionSummaryYaml> FSums; + io.mapRequired(Key.str().c_str(), FSums); + uint64_t KeyInt; + if (Key.getAsInteger(0, KeyInt)) { + io.setError("key not an integer"); + return; + } + auto &Elem = V[KeyInt]; + for (auto &FSum : FSums) { + GlobalValueSummary::GVFlags GVFlags(GlobalValue::ExternalLinkage, false, + false); + Elem.push_back(llvm::make_unique<FunctionSummary>( + GVFlags, 0, ArrayRef<ValueInfo>{}, + ArrayRef<FunctionSummary::EdgeTy>{}, std::move(FSum.TypeTests))); + } + } + static void output(IO &io, GlobalValueSummaryMapTy &V) { + for (auto &P : V) { + std::vector<FunctionSummaryYaml> FSums; + for (auto &Sum : P.second) { + if (auto *FSum = dyn_cast<FunctionSummary>(Sum.get())) + FSums.push_back(FunctionSummaryYaml{FSum->type_tests()}); + } + if (!FSums.empty()) + io.mapRequired(llvm::utostr(P.first).c_str(), FSums); + } + } +}; + +template <> struct MappingTraits<ModuleSummaryIndex> { + static void mapping(IO &io, ModuleSummaryIndex& index) { + io.mapRequired("GlobalValueMap", index.GlobalValueMap); + io.mapRequired("TypeIdMap", index.TypeIdMap); + } +}; + +} // End yaml namespace +} // End llvm namespace + +#endif Modified: vendor/llvm/dist/include/llvm/IR/PassManager.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/PassManager.h Fri Jan 6 19:58:20 2017 (r311531) +++ vendor/llvm/dist/include/llvm/IR/PassManager.h Fri Jan 6 20:13:21 2017 (r311532) @@ -64,32 +64,31 @@ namespace llvm { struct alignas(8) AnalysisKey {}; /// A special type used to provide an address that identifies a set of related -/// analyses. +/// analyses. These sets are primarily used below to mark sets of analyses as +/// preserved. /// -/// These sets are primarily used below to mark sets of analyses as preserved. -/// An example would be analyses depending only on the CFG of a function. -/// A transformation can mark that it is preserving the CFG of a function and -/// then analyses can check for this rather than each transform having to fully -/// enumerate every analysis preserved. +/// For example, a transformation can indicate that it preserves the CFG of a +/// function by preserving the appropriate AnalysisSetKey. An analysis that +/// depends only on the CFG can then check if that AnalysisSetKey is preserved; +/// if it is, the analysis knows that it itself is preserved. struct alignas(8) AnalysisSetKey {}; -/// Class for tracking what analyses are preserved after a transformation pass -/// runs over some unit of IR. +/// A set of analyses that are preserved following a run of a transformation +/// pass. /// -/// Transformation passes build and return these objects when run over the IR -/// to communicate which analyses remain valid afterward. For most passes this -/// is fairly simple: if they don't change anything all analyses are preserved, +/// Transformation passes build and return these objects to communicate which +/// analyses are still valid after the transformation. For most passes this is +/// fairly simple: if they don't change anything all analyses are preserved, /// otherwise only a short list of analyses that have been explicitly updated /// are preserved. /// -/// This class also provides the ability to mark abstract *sets* of analyses as -/// preserved. These sets allow passes to indicate that they preserve broad -/// aspects of the IR (such as its CFG) and analyses to opt in to that being -/// sufficient without the passes having to fully enumerate such analyses. -/// -/// Finally, this class can represent "abandoning" an analysis, which marks it -/// as not-preserved even if it would be covered by some abstract set of -/// analyses. +/// This class also lets transformation passes mark abstract *sets* of analyses +/// as preserved. A transformation that (say) does not alter the CFG can +/// indicate such by marking a particular AnalysisSetKey as preserved, and +/// then analyses can query whether that AnalysisSetKey is preserved. +/// +/// Finally, this class can represent an "abandoned" analysis, which is +/// not preserved even if it would be covered by some abstract set of analyses. /// /// Given a `PreservedAnalyses` object, an analysis will typically want to /// figure out whether it is preserved. In the example below, MyAnalysisType is @@ -120,7 +119,8 @@ public: /// Mark an analysis as preserved. template <typename AnalysisT> void preserve() { preserve(AnalysisT::ID()); } - /// Mark an analysis as preserved using its ID. + /// \brief Given an analysis's ID, mark the analysis as preserved, adding it + /// to the set. void preserve(AnalysisKey *ID) { // Clear this ID from the explicit not-preserved set if present. NotPreservedAnalysisIDs.erase(ID); @@ -224,17 +224,17 @@ public: : PA(PA), ID(ID), IsAbandoned(PA.NotPreservedAnalysisIDs.count(ID)) {} public: - /// Returns true if the checker's analysis was not abandoned and the - /// analysis is either is explicitly preserved or all analyses are - /// preserved. + /// Returns true if the checker's analysis was not abandoned and either + /// - the analysis is explicitly preserved or + /// - all analyses are preserved. bool preserved() { return !IsAbandoned && (PA.PreservedIDs.count(&AllAnalysesKey) || PA.PreservedIDs.count(ID)); } - /// Returns true if the checker's analysis was not abandoned and either the - /// provided set type is either explicitly preserved or all analyses are - /// preserved. + /// Returns true if the checker's analysis was not abandoned and either + /// - \p AnalysisSetT is explicitly preserved or + /// - all analyses are preserved. template <typename AnalysisSetT> bool preservedSet() { AnalysisSetKey *SetID = AnalysisSetT::ID(); return !IsAbandoned && (PA.PreservedIDs.count(&AllAnalysesKey) || @@ -262,8 +262,8 @@ public: /// Test whether all analyses are preserved (and none are abandoned). /// - /// This lets analyses optimize for the common case where a transformation - /// made no changes to the IR. + /// This is used primarily to optimize for the common case of a transformation + /// which makes no changes to the IR. bool areAllPreserved() const { return NotPreservedAnalysisIDs.empty() && PreservedIDs.count(&AllAnalysesKey); @@ -307,9 +307,9 @@ template <typename IRUnitT, typename... /// A CRTP mix-in to automatically provide informational APIs needed for /// passes. /// -/// This provides some boiler plate for types that are passes. +/// This provides some boilerplate for types that are passes. template <typename DerivedT> struct PassInfoMixin { - /// Returns the name of the derived pass type. + /// Gets the name of the pass we are mixed into. static StringRef name() { StringRef Name = getTypeName<DerivedT>(); if (Name.startswith("llvm::")) @@ -318,41 +318,35 @@ template <typename DerivedT> struct Pass } }; -/// A CRTP mix-in to automatically provide informational APIs needed for -/// analysis passes. +/// A CRTP mix-in that provides informational APIs needed for analysis passes. /// -/// This provides some boiler plate for types that are analysis passes. It -/// automatically mixes in \c PassInfoMixin and adds informational APIs -/// specifically used for analyses. +/// This provides some boilerplate for types that are analysis passes. It +/// automatically mixes in \c PassInfoMixin. template <typename DerivedT> struct AnalysisInfoMixin : PassInfoMixin<DerivedT> { /// Returns an opaque, unique ID for this analysis type. /// - /// This ID is a pointer type that is guaranteed to be 8-byte aligned and - /// thus suitable for use in sets, maps, and other data structures optimized - /// for pointer-like types using the alignment-provided low bits. + /// This ID is a pointer type that is guaranteed to be 8-byte aligned and thus + /// suitable for use in sets, maps, and other data structures that use the low + /// bits of pointers. /// /// Note that this requires the derived type provide a static \c AnalysisKey /// member called \c Key. /// - /// FIXME: The only reason the derived type needs to provide this rather than - /// this mixin providing it is due to broken implementations which cannot - /// correctly unique a templated static so that they have the same addresses - /// for each instantiation and are definitively emitted once for each - /// instantiation. The only currently known platform with this limitation are - /// Windows DLL builds, specifically building each part of LLVM as a DLL. If - /// we ever remove that build configuration, this mixin can provide the - /// static key as well. + /// FIXME: The only reason the mixin type itself can't declare the Key value + /// is that some compilers cannot correctly unique a templated static variable + /// so it has the same addresses in each instantiation. The only currently + /// known platform with this limitation is Windows DLL builds, specifically + /// building each part of LLVM as a DLL. If we ever remove that build + /// configuration, this mixin can provide the static key as well. static AnalysisKey *ID() { return &DerivedT::Key; } }; -/// A class template to provide analysis sets for IR units. +/// This templated class represents "all analyses that operate over \<a +/// particular IR unit\>" (e.g. a Function or a Module) in instances of +/// PreservedAnalysis. /// -/// Analyses operate on units of IR. It is useful to be able to talk about -/// preservation of all analyses for a given unit of IR as a set. This class -/// template can be used with the \c PreservedAnalyses API for that purpose and -/// the \c AnalysisManager will automatically check and use this set to skip -/// invalidation events. +/// This lets a transformation say e.g. "I preserved all function analyses". /// /// Note that you must provide an explicit instantiation declaration and /// definition for this template in order to get the correct behavior on @@ -371,17 +365,18 @@ template <typename IRUnitT> AnalysisSetK extern template class AllAnalysesOn<Module>; extern template class AllAnalysesOn<Function>; -/// \brief Manages a sequence of passes over units of IR. +/// \brief Manages a sequence of passes over a particular unit of IR. /// -/// A pass manager contains a sequence of passes to run over units of IR. It is -/// itself a valid pass over that unit of IR, and when over some given IR will -/// run each pass in sequence. This is the primary and most basic building -/// block of a pass pipeline. -/// -/// If it is run with an \c AnalysisManager<IRUnitT> argument, it will propagate -/// that analysis manager to each pass it runs, as well as calling the analysis -/// manager's invalidation routine with the PreservedAnalyses of each pass it -/// runs. +/// A pass manager contains a sequence of passes to run over a particular unit +/// of IR (e.g. Functions, Modules). It is itself a valid pass over that unit of +/// IR, and when run over some given IR will run each of its contained passes in +/// sequence. Pass managers are the primary and most basic building block of a +/// pass pipeline. +/// +/// When you run a pass manager, you provide an \c AnalysisManager<IRUnitT> +/// argument. The pass manager will propagate that analysis manager to each +/// pass it runs, and will call the analysis manager's invalidation routine with +/// the PreservedAnalyses of each pass it runs. template <typename IRUnitT, typename AnalysisManagerT = AnalysisManager<IRUnitT>, typename... ExtraArgTs> @@ -390,7 +385,7 @@ class PassManager : public PassInfoMixin public: /// \brief Construct a pass manager. /// - /// It can be passed a flag to get debug logging as the passes are run. *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701062013.v06KDMN9068258>