Browse files

Updating branches/google/testing to r275480

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/testing@275865 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information...
2 parents 5946da6 + ef2acb5 commit 2002e49a65e69efaf480be73b0cdd9a86492de4d @dlj-NaN dlj-NaN committed Jul 18, 2016
Showing with 8,859 additions and 4,040 deletions.
  1. +1 −1 .arcconfig
  2. +2 −0 .gitignore
  3. +22 −1 CMakeLists.txt
  4. +4 −4 CODE_OWNERS.TXT
  5. +2 −0 bindings/ocaml/llvm/llvm.ml
  6. +4 −0 bindings/ocaml/llvm/llvm.mli
  7. +11 −0 bindings/ocaml/llvm/llvm_ocaml.c
  8. +7 −1 cmake/config-ix.cmake
  9. +32 −16 cmake/modules/AddLLVM.cmake
  10. +7 −1 cmake/modules/AddOCaml.cmake
  11. +2 −0 cmake/modules/CMakeLists.txt
  12. +37 −0 cmake/modules/CheckAtomic.cmake
  13. +22 −2 cmake/modules/HandleLLVMOptions.cmake
  14. +6 −1 cmake/modules/LLVMConfig.cmake.in
  15. +30 −10 cmake/modules/LLVMExternalProjectUtils.cmake
  16. +4 −4 docs/AMDGPUUsage.rst
  17. +1 −2 docs/AliasAnalysis.rst
  18. +1 −1 docs/Atomics.rst
  19. +0 −10 docs/BitCodeFormat.rst
  20. +0 −221 docs/BitSets.rst
  21. +1 −4 docs/CMake.rst
  22. +14 −15 docs/CodeGenerator.rst
  23. +112 −0 docs/CodeOfConduct.rst
  24. +19 −0 docs/CommandGuide/FileCheck.rst
  25. +12 −0 docs/CommandGuide/llvm-cov.rst
  26. +2 −2 docs/DeveloperPolicy.rst
  27. +105 −47 docs/LangRef.rst
  28. +2 −2 docs/LinkTimeOptimization.rst
  29. +1 −1 docs/MergeFunctions.rst
  30. +1 −1 docs/NVPTXUsage.rst
  31. +2 −2 docs/ProgrammersManual.rst
  32. +143 −0 docs/ReportingGuide.rst
  33. +7 −1 docs/SourceLevelDebugging.rst
  34. +1 −1 docs/TableGen/LangRef.rst
  35. +17 −0 docs/TestingGuide.rst
  36. +226 −0 docs/TypeMetadata.rst
  37. +3 −1 docs/index.rst
  38. +2 −2 docs/tutorial/BuildingAJIT1.rst
  39. +1 −1 docs/tutorial/BuildingAJIT2.rst
  40. +16 −13 docs/tutorial/{LangImpl1.rst → LangImpl01.rst}
  41. +1 −1 docs/tutorial/{LangImpl2.rst → LangImpl02.rst}
  42. +1 −1 docs/tutorial/{LangImpl3.rst → LangImpl03.rst}
  43. +1 −1 docs/tutorial/{LangImpl4.rst → LangImpl04.rst}
  44. 0 docs/tutorial/{LangImpl5-cfg.png → LangImpl05-cfg.png}
  45. +2 −2 docs/tutorial/{LangImpl5.rst → LangImpl05.rst}
  46. +1 −1 docs/tutorial/{LangImpl6.rst → LangImpl06.rst}
  47. +1 −1 docs/tutorial/{LangImpl7.rst → LangImpl07.rst}
  48. +218 −0 docs/tutorial/LangImpl08.rst
  49. +6 −6 docs/tutorial/{LangImpl8.rst → LangImpl09.rst}
  50. 0 docs/tutorial/{LangImpl9.rst → LangImpl10.rst}
  51. +1 −1 docs/tutorial/OCamlLangImpl5.rst
  52. +1 −5 examples/Kaleidoscope/Chapter8/CMakeLists.txt
  53. +93 −323 examples/Kaleidoscope/Chapter8/toy.cpp
  54. +13 −0 examples/Kaleidoscope/Chapter9/CMakeLists.txt
  55. +1,445 −0 examples/Kaleidoscope/Chapter9/toy.cpp
  56. +13 −4 include/llvm-c/lto.h
  57. +2 −2 include/llvm/ADT/APInt.h
  58. +153 −0 include/llvm/ADT/BitmaskEnum.h
  59. +224 −0 include/llvm/ADT/PriorityWorklist.h
  60. +8 −0 include/llvm/ADT/STLExtras.h
  61. +1 −1 include/llvm/ADT/SetVector.h
  62. +60 −44 include/llvm/ADT/Triple.h
  63. +13 −0 include/llvm/Analysis/AliasAnalysis.h
  64. +1 −1 include/llvm/Analysis/AliasSetTracker.h
  65. +0 −38 include/llvm/Analysis/BitSetUtils.h
  66. +5 −2 include/llvm/Analysis/BlockFrequencyInfo.h
  67. +121 −0 include/llvm/Analysis/BlockFrequencyInfoImpl.h
  68. +85 −0 include/llvm/Analysis/CFLAndersAliasAnalysis.h
  69. +45 −27 include/llvm/Analysis/{CFLAliasAnalysis.h → CFLSteensAliasAnalysis.h}
  70. +26 −14 include/llvm/Analysis/CGSCCPassManager.h
  71. +67 −0 include/llvm/Analysis/IndirectCallPromotionAnalysis.h
  72. 0 {lib/Transforms/Instrumentation → include/llvm/Analysis}/IndirectCallSiteVisitor.h
  73. +6 −4 include/llvm/Analysis/Interval.h
  74. +125 −0 include/llvm/Analysis/LazyBlockFrequencyInfo.h
  75. +84 −9 include/llvm/Analysis/LazyCallGraph.h
  76. +28 −21 include/llvm/Analysis/Loads.h
  77. +85 −28 include/llvm/Analysis/LoopAccessAnalysis.h
  78. +3 −3 include/llvm/Analysis/ScalarEvolutionExpressions.h
  79. +30 −0 include/llvm/Analysis/TargetTransformInfo.h
  80. +14 −4 include/llvm/Analysis/TargetTransformInfoImpl.h
  81. +45 −0 include/llvm/Analysis/TypeMetadataUtils.h
  82. +6 −8 include/llvm/Analysis/ValueTracking.h
  83. +10 −1 include/llvm/Analysis/VectorUtils.h
  84. +3 −4 include/llvm/Bitcode/LLVMBitCodes.h
  85. +5 −0 include/llvm/Bitcode/ReaderWriter.h
  86. +0 −3 include/llvm/CodeGen/Analysis.h
  87. +2 −0 include/llvm/CodeGen/AsmPrinter.h
  88. +36 −8 include/llvm/CodeGen/BasicTTIImpl.h
  89. +1 −1 include/llvm/CodeGen/FunctionLoweringInfo.h
  90. +21 −25 include/llvm/CodeGen/ISDOpcodes.h
  91. +9 −0 include/llvm/CodeGen/LiveInterval.h
  92. +7 −2 include/llvm/CodeGen/LivePhysRegs.h
  93. +4 −2 include/llvm/CodeGen/LiveRangeEdit.h
  94. +24 −25 include/llvm/CodeGen/LiveVariables.h
  95. +0 −3 include/llvm/CodeGen/MIRYamlMapping.h
  96. +4 −0 include/llvm/CodeGen/MachineBlockFrequencyInfo.h
  97. +23 −0 include/llvm/CodeGen/MachineDominators.h
  98. +5 −0 include/llvm/CodeGen/MachineInstr.h
  99. +31 −15 include/llvm/CodeGen/MachineInstrBuilder.h
  100. +35 −27 include/llvm/CodeGen/MachineMemOperand.h
  101. +0 −10 include/llvm/CodeGen/MachineModuleInfoImpls.h
  102. +6 −9 include/llvm/CodeGen/MachineRegisterInfo.h
  103. +33 −11 include/llvm/CodeGen/MachineScheduler.h
  104. +3 −0 include/llvm/CodeGen/PBQP/Graph.h
  105. +4 −0 include/llvm/CodeGen/Passes.h
  106. +26 −0 include/llvm/CodeGen/PreISelIntrinsicLowering.h
  107. +5 −4 include/llvm/CodeGen/RegisterScavenging.h
  108. +22 −26 include/llvm/CodeGen/SelectionDAG.h
  109. +15 −11 include/llvm/CodeGen/SelectionDAGNodes.h
  110. +1 −1 include/llvm/CodeGen/SlotIndexes.h
  111. +0 −1 include/llvm/CodeGen/TailDuplicator.h
  112. +37 −0 include/llvm/CodeGen/UnreachableBlockElim.h
  113. +1 −0 include/llvm/CodeGen/WinEHFuncInfo.h
  114. +2 −0 include/llvm/DebugInfo/CodeView/ByteStream.h
  115. +1 −1 include/llvm/DebugInfo/CodeView/CodeView.h
  116. +1 −1 include/llvm/DebugInfo/CodeView/EnumTables.h
  117. +1 −1 include/llvm/DebugInfo/CodeView/FieldListRecordBuilder.h
  118. +18 −5 include/llvm/DebugInfo/CodeView/ListRecordBuilder.h
  119. +2 −0 include/llvm/DebugInfo/CodeView/StreamInterface.h
  120. +9 −5 include/llvm/DebugInfo/CodeView/StreamRef.h
  121. +2 −1 include/llvm/DebugInfo/CodeView/SymbolRecord.h
  122. +29 −4 include/llvm/DebugInfo/CodeView/TypeRecord.h
  123. +7 −1 include/llvm/DebugInfo/CodeView/TypeRecordBuilder.h
  124. +1 −1 include/llvm/DebugInfo/CodeView/TypeRecords.def
  125. +3 −1 include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
  126. +0 −1 include/llvm/DebugInfo/DIContext.h
  127. +31 −1 include/llvm/DebugInfo/PDB/Raw/DbiStream.h
  128. +55 −0 include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
  129. +2 −2 include/llvm/DebugInfo/PDB/Raw/IPDBFile.h
  130. +12 −0 include/llvm/DebugInfo/PDB/Raw/InfoStream.h
  131. +50 −0 include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h
  132. +4 −1 include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h
  133. +2 −0 include/llvm/DebugInfo/PDB/Raw/ModStream.h
  134. +2 −0 include/llvm/DebugInfo/PDB/Raw/NameMap.h
  135. +13 −7 include/llvm/DebugInfo/PDB/Raw/PDBFile.h
  136. +60 −0 include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
  137. +2 −0 include/llvm/DebugInfo/PDB/Raw/PublicsStream.h
  138. +2 −0 include/llvm/DebugInfo/PDB/Raw/SymbolStream.h
  139. +2 −0 include/llvm/DebugInfo/PDB/Raw/TpiStream.h
  140. +0 −1 include/llvm/ExecutionEngine/ExecutionEngine.h
  141. +2 −7 include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
  142. +4 −2 include/llvm/IR/Attributes.h
  143. +3 −0 include/llvm/IR/Attributes.td
  144. +12 −0 include/llvm/IR/CallSite.h
  145. +22 −2 include/llvm/IR/DIBuilder.h
  146. +1 −1 include/llvm/IR/DataLayout.h
  147. +2 −1 include/llvm/IR/DebugInfoFlags.def
  148. +41 −26 include/llvm/IR/DebugInfoMetadata.h
  149. +5 −3 include/llvm/IR/DiagnosticInfo.h
  150. +21 −0 include/llvm/IR/Dominators.h
  151. +8 −0 include/llvm/IR/Function.h
  152. +6 −0 include/llvm/IR/GlobalObject.h
  153. +4 −22 include/llvm/IR/IRBuilder.h
  154. +1 −0 include/llvm/IR/InlineAsm.h
  155. +4 −0 include/llvm/IR/InstrTypes.h
  156. +6 −9 include/llvm/IR/Instruction.h
  157. +28 −0 include/llvm/IR/Instructions.h
  158. +20 −0 include/llvm/IR/Intrinsics.h
  159. +25 −7 include/llvm/IR/Intrinsics.td
  160. +1 −1 include/llvm/IR/IntrinsicsAArch64.td
  161. +50 −26 include/llvm/IR/IntrinsicsAMDGPU.td
  162. +71 −129 include/llvm/IR/IntrinsicsNVVM.td
  163. +11 −0 include/llvm/IR/IntrinsicsSystemZ.td
  164. +42 −550 include/llvm/IR/IntrinsicsX86.td
  165. +1 −0 include/llvm/IR/LLVMContext.h
  166. +70 −1 include/llvm/IR/Module.h
  167. +1 −0 include/llvm/IR/UseListOrder.h
  168. +16 −11 include/llvm/InitializePasses.h
  169. +0 −1 include/llvm/LTO/LTO.h
  170. 0 include/llvm/LTO/{ → legacy}/LTOCodeGenerator.h
  171. 0 include/llvm/LTO/{ → legacy}/LTOModule.h
  172. 0 include/llvm/LTO/{ → legacy}/ThinLTOCodeGenerator.h
  173. +2 −4 {lib/LTO → include/llvm/LTO/legacy}/UpdateCompilerUsed.h
  174. +5 −2 include/llvm/LinkAllPasses.h
  175. +3 −8 include/llvm/MC/MCAsmBackend.h
  176. +11 −0 include/llvm/MC/MCAsmInfo.h
  177. +0 −50 include/llvm/MC/MCCodeGenInfo.h
  178. +20 −12 include/llvm/MC/MCContext.h
  179. +1 −0 include/llvm/MC/MCELFObjectWriter.h
  180. +3 −22 include/llvm/MC/MCLinkerOptimizationHint.h
  181. +7 −1 include/llvm/MC/MCStreamer.h
  182. +2 −2 include/llvm/MC/MCSymbol.h
  183. +1 −0 include/llvm/MC/MCSymbolMachO.h
  184. +4 −0 include/llvm/MC/MCTargetOptions.h
  185. +27 −19 include/llvm/Object/Archive.h
  186. +25 −18 include/llvm/Object/ArchiveWriter.h
  187. +3 −5 include/llvm/Object/COFF.h
  188. +3 −3 include/llvm/Object/ELFObjectFile.h
  189. +21 −0 include/llvm/Object/ELFTypes.h
  190. +1 −2 include/llvm/Object/IRObjectFile.h
  191. +1 −1 include/llvm/Object/MachO.h
  192. +9 −4 include/llvm/Object/MachOUniversal.h
  193. +3 −3 include/llvm/Object/ObjectFile.h
  194. +34 −0 include/llvm/ObjectYAML/MachOYAML.h
  195. +35 −0 include/llvm/ObjectYAML/ObjectYAML.h
  196. +3 −3 include/llvm/PassAnalysisSupport.h
  197. +3 −3 include/llvm/ProfileData/Coverage/CoverageMapping.h
  198. +13 −11 include/llvm/ProfileData/Coverage/CoverageMappingWriter.h
  199. +1 −0 include/llvm/ProfileData/ProfileCommon.h
  200. +82 −5 include/llvm/Support/CommandLine.h
  201. +6 −9 include/llvm/Support/DataTypes.h.cmake
  202. +5 −2 include/llvm/Support/Dwarf.h
  203. +1 −5 include/llvm/Support/ELF.h
  204. +1 −0 include/llvm/Support/ELFRelocs/AMDGPU.def
  205. +9 −12 include/llvm/Support/Error.h
  206. +10 −12 include/llvm/Support/GenericDomTree.h
  207. +22 −0 include/llvm/Support/MachO.h
  208. +14 −28 include/llvm/Support/ManagedStatic.h
  209. +1 −1 include/llvm/Support/OnDiskHashTable.h
  210. +14 −61 include/llvm/Support/TargetRegistry.h
  211. +45 −0 include/llvm/Support/TrailingObjects.h
  212. +138 −79 include/llvm/TableGen/Record.h
  213. +41 −0 include/llvm/TableGen/SearchableTable.td
  214. +0 −3 include/llvm/Target/GenericOpcodes.td
  215. +15 −0 include/llvm/Target/Target.td
  216. +14 −0 include/llvm/Target/TargetFrameLowering.h
  217. +106 −101 include/llvm/Target/TargetInstrInfo.h
  218. +10 −13 include/llvm/Target/TargetLowering.h
  219. +8 −5 include/llvm/Target/TargetMachine.h
  220. +12 −3 include/llvm/Target/TargetOpcodes.def
  221. +7 −2 include/llvm/Target/TargetOptions.h
  222. +16 −0 include/llvm/Target/TargetSchedule.td
  223. +3 −0 include/llvm/Target/TargetSelectionDAG.td
  224. +0 −1 include/llvm/Target/TargetSubtargetInfo.h
  225. +4 −4 include/llvm/Transforms/IPO.h
  226. +28 −0 include/llvm/Transforms/IPO/CrossDSOCFI.h
  227. +16 −8 include/llvm/Transforms/IPO/{LowerBitSets.h → LowerTypeTests.h}
  228. +32 −0 include/llvm/Transforms/IPO/PartialInlining.h
  229. +19 −18 include/llvm/Transforms/IPO/WholeProgramDevirt.h
  230. +149 −0 include/llvm/Transforms/Scalar/ConstantHoisting.h
  231. +24 −0 include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h
  232. +51 −0 include/llvm/Transforms/Scalar/Float2Int.h
  233. +48 −0 include/llvm/Transforms/Scalar/LICM.h
  234. +38 −0 include/llvm/Transforms/Scalar/LoopDeletion.h
  235. +31 −0 include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
  236. +66 −0 include/llvm/Transforms/Scalar/TailRecursionElimination.h
  237. +65 −0 include/llvm/Transforms/Utils/LoopSimplify.h
  238. +0 −8 include/llvm/Transforms/Utils/LoopUtils.h
  239. +51 −74 include/llvm/Transforms/Utils/MemorySSA.h
  240. +31 −0 include/llvm/Transforms/Utils/SimplifyInstructions.h
  241. +7 −0 include/llvm/Transforms/Vectorize.h
  242. +103 −0 include/llvm/Transforms/Vectorize/LoopVectorize.h
  243. +3 −3 include/llvm/Transforms/{Scalar → Vectorize}/SLPVectorizer.h
  244. +58 −1 include/llvm/module.modulemap
  245. +19 −7 lib/Analysis/AliasAnalysis.cpp
  246. +19 −20 lib/Analysis/AliasAnalysisEvaluator.cpp
  247. +105 −0 lib/Analysis/AliasAnalysisSummary.cpp
  248. +191 −0 lib/Analysis/AliasAnalysisSummary.h
  249. +9 −10 lib/Analysis/AliasSetTracker.cpp
  250. +3 −1 lib/Analysis/Analysis.cpp
  251. +25 −24 lib/Analysis/BasicAliasAnalysis.cpp
  252. +67 −54 lib/Analysis/BlockFrequencyInfo.cpp
  253. +16 −0 lib/Analysis/BlockFrequencyInfoImpl.cpp
  254. +0 −985 lib/Analysis/CFLAliasAnalysis.cpp
  255. +60 −0 lib/Analysis/CFLAndersAliasAnalysis.cpp
  256. +533 −0 lib/Analysis/CFLGraph.h
  257. +442 −0 lib/Analysis/CFLSteensAliasAnalysis.cpp
  258. +6 −2 lib/Analysis/CMakeLists.txt
  259. +8 −10 lib/Analysis/CallGraph.cpp
  260. +4 −4 lib/Analysis/CallGraphSCCPass.cpp
  261. +138 −84 lib/Analysis/ConstantFolding.cpp
  262. +4 −5 lib/Analysis/CostModel.cpp
  263. +8 −8 lib/Analysis/DependenceAnalysis.cpp
  264. +1 −1 lib/Analysis/GlobalsModRef.cpp
  265. +7 −10 lib/Analysis/IVUsers.cpp
  266. +109 −0 lib/Analysis/IndirectCallPromotionAnalysis.cpp
  267. +12 −4 lib/Analysis/InlineCost.cpp
  268. +35 −5 lib/Analysis/InstructionSimplify.cpp
  269. +6 −9 lib/Analysis/Interval.cpp
  270. +2 −3 lib/Analysis/IntervalPartition.cpp
  271. +1 −1 lib/Analysis/LLVMBuild.txt
  272. +68 −0 lib/Analysis/LazyBlockFrequencyInfo.cpp
  273. +12 −1 lib/Analysis/LazyCallGraph.cpp
  274. +44 −48 lib/Analysis/LazyValueInfo.cpp
  275. +17 −34 lib/Analysis/Loads.cpp
  276. +124 −91 lib/Analysis/LoopAccessAnalysis.cpp
  277. +4 −5 lib/Analysis/LoopInfo.cpp
  278. +1 −3 lib/Analysis/LoopPass.cpp
  279. +1 −1 lib/Analysis/LoopUnrollAnalyzer.cpp
  280. +6 −8 lib/Analysis/MemDepPrinter.cpp
  281. +17 −18 lib/Analysis/MemoryBuiltins.cpp
  282. +3 −3 lib/Analysis/MemoryDependenceAnalysis.cpp
  283. +5 −6 lib/Analysis/ModuleSummaryAnalysis.cpp
  284. +2 −2 lib/Analysis/RegionPrinter.cpp
Sorry, we could not display the entire diff because too many files (2,403) changed.
View
2 .arcconfig
@@ -1,4 +1,4 @@
{
"project_id" : "llvm",
- "conduit_uri" : "http://reviews.llvm.org/"
+ "conduit_uri" : "https://reviews.llvm.org/"
}
View
2 .gitignore
@@ -46,6 +46,8 @@ autoconf/autom4te.cache
projects/*
!projects/*.*
!projects/Makefile
+runtimes/*
+!runtimes/*.*
# Clang, which is tracked independently.
tools/clang
# LLDB, which is tracked independently.
View
23 CMakeLists.txt
@@ -283,6 +283,13 @@ include(AddLLVMDefinitions)
option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
option(LLVM_ENABLE_MODULES "Compile with C++ modules enabled." OFF)
+if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." ON)
+ option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility." OFF)
+else()
+ option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." OFF)
+ option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility." ON)
+endif()
option(LLVM_ENABLE_CXX1Y "Compile with C++1y enabled." OFF)
option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF)
option(LLVM_ENABLE_LIBCXXABI "Use libc++abi when using libc++." OFF)
@@ -384,6 +391,8 @@ option(LLVM_BUILD_TOOLS
"Build the LLVM tools. If OFF, just generate build targets." ON)
option(LLVM_INCLUDE_UTILS "Generate build targets for the LLVM utils." ON)
+option(LLVM_BUILD_UTILS
+ "Build LLVM utility binaries. If OFF, just generate build targets." ON)
option(LLVM_BUILD_RUNTIME
"Build the LLVM runtime libraries." ON)
@@ -693,6 +702,15 @@ add_subdirectory(lib/TableGen)
add_subdirectory(utils/TableGen)
+# Force target to be built as soon as possible. Clang modules builds depend
+# header-wise on it as they ship all headers from the umbrella folders. Building
+# an entire module might include header, which depends on intrinsics_gen. This
+# should be right after LLVMSupport and LLVMTableGen otherwise we introduce a
+# circular dependence.
+if (LLVM_ENABLE_MODULES)
+ list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
+endif(LLVM_ENABLE_MODULES)
+
add_subdirectory(include/llvm)
add_subdirectory(lib)
@@ -732,6 +750,8 @@ if( LLVM_INCLUDE_TOOLS )
add_subdirectory(tools)
endif()
+add_subdirectory(runtimes)
+
if( LLVM_INCLUDE_EXAMPLES )
add_subdirectory(examples)
endif()
@@ -742,7 +762,8 @@ if( LLVM_INCLUDE_TESTS )
llvm_ExternalProject_Add(test-suite ${LLVM_MAIN_SRC_DIR}/projects/test-suite
USE_TOOLCHAIN
EXCLUDE_FROM_ALL
- NO_INSTALL)
+ NO_INSTALL
+ ALWAYS_CLEAN)
endif()
add_subdirectory(test)
add_subdirectory(unittests)
View
8 CODE_OWNERS.TXT
@@ -12,10 +12,6 @@ N: Joe Abbey
E: jabbey@arxan.com
D: LLVM Bitcode (lib/Bitcode/* include/llvm/Bitcode/*)
-N: Rafael Avila de Espindola
-E: rafael.espindola@gmail.com
-D: Gold plugin (tools/gold/*)
-
N: Justin Bogner
E: mail@justinbogner.com
D: InstrProfiling and related parts of ProfileData
@@ -90,6 +86,10 @@ N: Lang Hames
E: lhames@gmail.com
D: MCJIT, RuntimeDyld and JIT event listeners, Orcish Warchief
+N: Teresa Johnson
+E: tejohnson@google.com
+D: Gold plugin (tools/gold/*)
+
N: Galina Kistanova
E: gkistanova@gmail.com
D: LLVM Buildbot
View
2 bindings/ocaml/llvm/llvm.ml
@@ -483,6 +483,8 @@ external mdstring : llcontext -> string -> llvalue = "llvm_mdstring"
external mdnode : llcontext -> llvalue array -> llvalue = "llvm_mdnode"
external mdnull : llcontext -> llvalue = "llvm_mdnull"
external get_mdstring : llvalue -> string option = "llvm_get_mdstring"
+external get_mdnode_operands : llvalue -> llvalue array
+ = "llvm_get_mdnode_operands"
external get_named_metadata : llmodule -> string -> llvalue array
= "llvm_get_namedmd"
external add_named_metadata_operand : llmodule -> string -> llvalue -> unit
View
4 bindings/ocaml/llvm/llvm.mli
@@ -852,6 +852,10 @@ val mdnull : llcontext -> llvalue
See the method [llvm::MDString::getString] *)
val get_mdstring : llvalue -> string option
+(** [get_mdnode_operands v] returns the operands in the MDNode. *)
+(* See the method [llvm::MDNode::getOperand] *)
+val get_mdnode_operands : llvalue -> llvalue array
+
(** [get_named_metadata m name] returns all the MDNodes belonging to the named
metadata (if any).
See the method [llvm::NamedMDNode::getOperand]. *)
View
11 bindings/ocaml/llvm/llvm_ocaml.c
@@ -734,6 +734,17 @@ CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
CAMLreturn(Val_int(0));
}
+CAMLprim value llvm_get_mdnode_operands(LLVMValueRef V) {
+ CAMLparam0();
+ CAMLlocal1(Operands);
+ unsigned int n;
+
+ n = LLVMGetMDNodeNumOperands(V);
+ Operands = alloc(n, 0);
+ LLVMGetMDNodeOperands(V, (LLVMValueRef *) Operands);
+ CAMLreturn(Operands);
+}
+
/* llmodule -> string -> llvalue array */
CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name)
{
View
8 cmake/config-ix.cmake
@@ -110,7 +110,13 @@ if( NOT PURE_WINDOWS )
endif()
if(HAVE_LIBPTHREAD)
- set(PTHREAD_LIB pthread)
+ # We want to find pthreads library and at the moment we do want to
+ # have it reported as '-l<lib>' instead of '-pthread'.
+ # TODO: switch to -pthread once the rest of the build system can deal with it.
+ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+ set(THREADS_HAVE_PTHREAD_ARG Off)
+ find_package(Threads REQUIRED)
+ set(PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
endif()
# Don't look for these libraries on Windows. Also don't look for them if we're
View
48 cmake/modules/AddLLVM.cmake
@@ -670,6 +670,12 @@ macro(add_llvm_executable name)
if(NOT ARG_IGNORE_EXTERNALIZE_DEBUGINFO)
llvm_externalize_debuginfo(${name})
endif()
+ if (PTHREAD_LIB)
+ # libpthreads overrides some standard library symbols, so main
+ # executable must be linked with it in order to provide consistent
+ # API for all shared libaries loaded by this executable.
+ target_link_libraries(${name} ${PTHREAD_LIB})
+ endif()
endmacro(add_llvm_executable name)
function(export_executable_symbols target)
@@ -689,20 +695,22 @@ function(export_executable_symbols target)
set(link_libs ${new_libs})
while(NOT "${new_libs}" STREQUAL "")
foreach(lib ${new_libs})
- get_target_property(lib_type ${lib} TYPE)
- if("${lib_type}" STREQUAL "STATIC_LIBRARY")
- list(APPEND static_libs ${lib})
- else()
- list(APPEND other_libs ${lib})
- endif()
- get_target_property(transitive_libs ${lib} INTERFACE_LINK_LIBRARIES)
- foreach(transitive_lib ${transitive_libs})
- list(FIND link_libs ${transitive_lib} idx)
- if(TARGET ${transitive_lib} AND idx EQUAL -1)
- list(APPEND newer_libs ${transitive_lib})
- list(APPEND link_libs ${transitive_lib})
+ if(TARGET ${lib})
+ get_target_property(lib_type ${lib} TYPE)
+ if("${lib_type}" STREQUAL "STATIC_LIBRARY")
+ list(APPEND static_libs ${lib})
+ else()
+ list(APPEND other_libs ${lib})
endif()
- endforeach(transitive_lib)
+ get_target_property(transitive_libs ${lib} INTERFACE_LINK_LIBRARIES)
+ foreach(transitive_lib ${transitive_libs})
+ list(FIND link_libs ${transitive_lib} idx)
+ if(TARGET ${transitive_lib} AND idx EQUAL -1)
+ list(APPEND newer_libs ${transitive_lib})
+ list(APPEND link_libs ${transitive_lib})
+ endif()
+ endforeach(transitive_lib)
+ endif()
endforeach(lib)
set(new_libs ${newer_libs})
set(newer_libs "")
@@ -792,11 +800,16 @@ macro(add_llvm_example name)
set_target_properties(${name} PROPERTIES FOLDER "Examples")
endmacro(add_llvm_example name)
-
+# This is a macro that is used to create targets for executables that are needed
+# for development, but that are not intended to be installed by default.
macro(add_llvm_utility name)
+ if ( NOT LLVM_BUILD_UTILS )
+ set(EXCLUDE_FROM_ALL ON)
+ endif()
+
add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
set_target_properties(${name} PROPERTIES FOLDER "Utils")
- if( LLVM_INSTALL_UTILS )
+ if( LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS )
install (TARGETS ${name}
RUNTIME DESTINATION bin
COMPONENT ${name})
@@ -953,7 +966,10 @@ function(add_unittest test_suite test_name)
add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO ${ARGN})
set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
- target_link_libraries(${test_name} gtest_main gtest)
+ # libpthreads overrides some standard library symbols, so main
+ # executable must be linked with it in order to provide consistent
+ # API for all shared libaries loaded by this executable.
+ target_link_libraries(${test_name} gtest_main gtest ${PTHREAD_LIB})
add_dependencies(${test_suite} ${test_name})
get_target_property(test_suite_folder ${test_suite} FOLDER)
View
8 cmake/modules/AddOCaml.cmake
@@ -73,7 +73,13 @@ function(add_ocaml_library name)
get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS)
foreach(system_lib ${system_libs})
- list(APPEND ocaml_flags "-l${system_lib}" )
+ if (system_lib MATCHES "^-")
+ # If it's an option, pass it without changes.
+ list(APPEND ocaml_flags "${system_lib}" )
+ else()
+ # Otherwise assume it's a library name we need to link with.
+ list(APPEND ocaml_flags "-l${system_lib}" )
+ endif()
endforeach()
string(REPLACE ";" " " ARG_CFLAGS "${ARG_CFLAGS}")
View
2 cmake/modules/CMakeLists.txt
@@ -29,6 +29,7 @@ set(LLVM_CONFIG_LIBRARY_DIRS
"${LLVM_LIBRARY_DIR}"
)
set(LLVM_CONFIG_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+set(LLVM_CONFIG_BINARY_DIR "${LLVM_BINARY_DIR}")
set(LLVM_CONFIG_TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
set(LLVM_CONFIG_EXPORTS_FILE "${llvm_cmake_builddir}/LLVMExports.cmake")
configure_file(
@@ -60,6 +61,7 @@ endforeach(p)
set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}")
set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
+set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}")
set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin")
set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake")
configure_file(
View
37 cmake/modules/CheckAtomic.cmake
@@ -18,6 +18,22 @@ int main() {
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
endfunction(check_working_cxx_atomics)
+function(check_working_cxx_atomics64 varname)
+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}")
+ CHECK_CXX_SOURCE_COMPILES("
+#include <atomic>
+#include <cstdint>
+std::atomic<uint64_t> x (0);
+int main() {
+ uint64_t i = x.load(std::memory_order_relaxed);
+ return 0;
+}
+" ${varname})
+ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_working_cxx_atomics64)
+
+
# This isn't necessary on MSVC, so avoid command-line switch annoyance
# by only running on GCC-like hosts.
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
@@ -38,6 +54,27 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
endif()
endif()
+# Check for 64 bit atomic operations.
+if(MSVC)
+ set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
+else()
+ check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+endif()
+
+# If not, check if the library exists, and atomics work with it.
+if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+ check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
+ if(HAVE_CXX_LIBATOMICS64)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+ check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
+ if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
+ message(FATAL_ERROR "Host compiler must support std::atomic!")
+ endif()
+ else()
+ message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
+ endif()
+endif()
+
## TODO: This define is only used for the legacy atomic operations in
## llvm's Atomic.h, which should be replaced. Other code simply
## assumes C++11 <atomic> works.
View
24 cmake/modules/HandleLLVMOptions.cmake
@@ -249,6 +249,12 @@ if( MSVC )
-D_SCL_SECURE_NO_WARNINGS
)
+ # Tell MSVC to use the Unicode version of the Win32 APIs instead of ANSI.
+ add_llvm_definitions(
+ -DUNICODE
+ -D_UNICODE
+ )
+
set(msvc_warning_flags
# Disabled warnings.
-wd4141 # Suppress ''modifier' : used more than once' (because of __forceinline combined with inline)
@@ -459,7 +465,21 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
endif()
if (LLVM_ENABLE_MODULES)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fmodules -Xclang -fmodules-local-submodule-visibility -fmodules-cache-path=module.cache")
+ set(module_flags "-fmodules -fmodules-cache-path=module.cache")
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ # On Darwin -fmodules does not imply -fcxx-modules.
+ set(module_flags "${module_flags} -fcxx-modules")
+ endif()
+ if (LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY)
+ set(module_flags "${module_flags} -Xclang -fmodules-local-submodule-visibility")
+ endif()
+ if (LLVM_ENABLE_MODULE_DEBUGGING AND
+ ((uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") OR
+ (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")))
+ set(module_flags "${module_flags} -gmodules")
+ endif()
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${module_flags}")
+
# Check that we can build code with modules enabled, and that repeatedly
# including <cassert> still manages to respect NDEBUG properly.
CHECK_CXX_SOURCE_COMPILES("#undef NDEBUG
@@ -470,7 +490,7 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
CXX_SUPPORTS_MODULES)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
if (CXX_SUPPORTS_MODULES)
- append_if(CXX_SUPPORTS_MODULES "-fmodules -Xclang -fmodules-local-submodule-visibility -fmodules-cache-path=module.cache" CMAKE_CXX_FLAGS)
+ append("${module_flags}" CMAKE_CXX_FLAGS)
else()
message(FATAL_ERROR "LLVM_ENABLE_MODULES is not supported by this compiler")
endif()
View
7 cmake/modules/LLVMConfig.cmake.in
@@ -7,6 +7,8 @@ set(LLVM_VERSION_MINOR @LLVM_VERSION_MINOR@)
set(LLVM_VERSION_PATCH @LLVM_VERSION_PATCH@)
set(LLVM_PACKAGE_VERSION @PACKAGE_VERSION@)
+set(LLVM_BUILD_TYPE @CMAKE_BUILD_TYPE@)
+
set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)
set(LLVM_AVAILABLE_LIBS @LLVM_AVAILABLE_LIBS@)
@@ -39,6 +41,8 @@ set(LLVM_NATIVE_ARCH @LLVM_NATIVE_ARCH@)
set(LLVM_ENABLE_PIC @LLVM_ENABLE_PIC@)
+set(LLVM_BUILD_32_BITS @LLVM_BUILD_32_BITS@)
+
set(LLVM_ENABLE_PLUGINS @LLVM_ENABLE_PLUGINS@)
set(LLVM_EXPORT_SYMBOLS_FOR_PLUGINS @LLVM_EXPORT_SYMBOLS_FOR_PLUGINS@)
set(LLVM_PLUGIN_EXT @LLVM_PLUGIN_EXT@)
@@ -53,11 +57,12 @@ set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBRARY_DIRS@")
set(LLVM_LIBRARY_DIR "@LLVM_CONFIG_LIBRARY_DIRS@")
set(LLVM_DEFINITIONS "@LLVM_DEFINITIONS@")
set(LLVM_CMAKE_DIR "@LLVM_CONFIG_CMAKE_DIR@")
-set(LLVM_BINARY_DIR "${LLVM_INSTALL_PREFIX}")
+set(LLVM_BINARY_DIR "@LLVM_CONFIG_BINARY_DIR@")
set(LLVM_TOOLS_BINARY_DIR "@LLVM_CONFIG_TOOLS_BINARY_DIR@")
set(LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@")
if(NOT TARGET LLVMSupport)
+ set(LLVM_EXPORTED_TARGETS "@LLVM_EXPORTS@")
include("@LLVM_CONFIG_EXPORTS_FILE@")
endif()
View
40 cmake/modules/LLVMExternalProjectUtils.cmake
@@ -19,6 +19,8 @@ endfunction()
# Exclude this project from the all target
# NO_INSTALL
# Don't generate install targets for this project
+# ALWAYS_CLEAN
+# Always clean the sub-project before building
# CMAKE_ARGS arguments...
# Optional cmake arguments to pass when configuring the project
# TOOLCHAIN_TOOLS targets...
@@ -27,11 +29,15 @@ endfunction()
# Targets that this project depends on
# EXTRA_TARGETS targets...
# Extra targets in the subproject to generate targets for
+# PASSTHROUGH_PREFIXES prefix...
+# Extra variable prefixes (name is always included) to pass down
# )
function(llvm_ExternalProject_Add name source_dir)
- cmake_parse_arguments(ARG "USE_TOOLCHAIN;EXCLUDE_FROM_ALL;NO_INSTALL"
+ cmake_parse_arguments(ARG
+ "USE_TOOLCHAIN;EXCLUDE_FROM_ALL;NO_INSTALL;ALWAYS_CLEAN"
"SOURCE_DIR"
- "CMAKE_ARGS;TOOLCHAIN_TOOLS;RUNTIME_LIBRARIES;DEPENDS;EXTRA_TARGETS" ${ARGN})
+ "CMAKE_ARGS;TOOLCHAIN_TOOLS;RUNTIME_LIBRARIES;DEPENDS;EXTRA_TARGETS;PASSTHROUGH_PREFIXES"
+ ${ARGN})
canonicalize_tool_name(${name} nameCanon)
if(NOT ARG_TOOLCHAIN_TOOLS)
set(ARG_TOOLCHAIN_TOOLS clang lld)
@@ -52,6 +58,10 @@ function(llvm_ExternalProject_Add name source_dir)
endif()
endforeach()
+ if(ARG_ALWAYS_CLEAN)
+ set(always_clean clean)
+ endif()
+
list(FIND TOOLCHAIN_TOOLS clang FOUND_CLANG)
if(FOUND_CLANG GREATER -1)
set(CLANG_IN_TOOLCHAIN On)
@@ -71,15 +81,18 @@ function(llvm_ExternalProject_Add name source_dir)
USES_TERMINAL
)
- # Find all variables that start with COMPILER_RT and populate a variable with
- # them.
+ # Find all variables that start with a prefix and propagate them through
get_cmake_property(variableNames VARIABLES)
- foreach(variableName ${variableNames})
- if(variableName MATCHES "^${nameCanon}")
- string(REPLACE ";" "\;" value "${${variableName}}")
- list(APPEND PASSTHROUGH_VARIABLES
- -D${variableName}=${value})
- endif()
+
+ list(APPEND ARG_PASSTHROUGH_PREFIXES ${nameCanon})
+ foreach(prefix ${ARG_PASSTHROUGH_PREFIXES})
+ foreach(variableName ${variableNames})
+ if(variableName MATCHES "^${prefix}")
+ string(REPLACE ";" "\;" value "${${variableName}}")
+ list(APPEND PASSTHROUGH_VARIABLES
+ -D${variableName}=${value})
+ endif()
+ endforeach()
endforeach()
if(ARG_USE_TOOLCHAIN)
@@ -117,6 +130,12 @@ function(llvm_ExternalProject_Add name source_dir)
CMAKE_ARGS ${${nameCanon}_CMAKE_ARGS}
${compiler_args}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+ -DLLVM_BINARY_DIR=${PROJECT_BINARY_DIR}
+ -DLLVM_CONFIG_PATH=$<TARGET_FILE:llvm-config>
+ -DLLVM_ENABLE_WERROR=${LLVM_ENABLE_WERROR}
+ -DPACKAGE_VERSION=${PACKAGE_VERSION}
+ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+ -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
${ARG_CMAKE_ARGS}
${PASSTHROUGH_VARIABLES}
INSTALL_COMMAND ""
@@ -138,6 +157,7 @@ function(llvm_ExternalProject_Add name source_dir)
DEPENDEES configure
${force_deps}
WORKING_DIRECTORY ${BINARY_DIR}
+ EXCLUDE_FROM_MAIN 1
USES_TERMINAL 1
)
ExternalProject_Add_StepTargets(${name} clean)
View
8 docs/AMDGPUUsage.rst
@@ -88,14 +88,14 @@ wait for.
.. code-block:: nasm
- // Wait for all counters to be 0
+ ; Wait for all counters to be 0
s_waitcnt 0
- // Equivalent to s_waitcnt 0. Counter names can also be delimited by
- // '&' or ','.
+ ; Equivalent to s_waitcnt 0. Counter names can also be delimited by
+ ; '&' or ','.
s_waitcnt vmcnt(0) expcnt(0) lgkcmt(0)
- // Wait for vmcnt counter to be 1.
+ ; Wait for vmcnt counter to be 1.
s_waitcnt vmcnt(1)
VOP1, VOP2, VOP3, VOPC Instructions
View
3 docs/AliasAnalysis.rst
@@ -31,8 +31,7 @@ well together.
This document contains information necessary to successfully implement this
interface, use it, and to test both sides. It also explains some of the finer
-points about what exactly results mean. If you feel that something is unclear
-or should be added, please `let me know <mailto:sabre@nondot.org>`_.
+points about what exactly results mean.
``AliasAnalysis`` Class Overview
================================
View
2 docs/Atomics.rst
@@ -578,7 +578,7 @@ runtime support library.
LLVM will emit a call to an appropriate ``__sync_*`` routine if the target
ISelLowering code has set the corresponding ``ATOMIC_CMPXCHG``, ``ATOMIC_SWAP``,
or ``ATOMIC_LOAD_*`` operation to "Expand", and if it has opted-into the
-availablity of those library functions via a call to ``initSyncLibcalls()``.
+availability of those library functions via a call to ``initSyncLibcalls()``.
The full set of functions that may be called by LLVM is (for ``N`` being 1, 2,
4, 8, or 16)::
View
10 docs/BitCodeFormat.rst
@@ -862,16 +862,6 @@ be one ``GCNAME`` record for each garbage collector name referenced in function
``gc`` attributes within the module. These records can be referenced by 1-based
index in the *gc* fields of ``FUNCTION`` records.
-MODULE_CODE_GLOBALVAR_ATTACHMENT Record
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-``[GLOBALVAR_ATTACHMENT, valueid, n x [id, mdnode]]``
-
-The ``GLOBALVAR_ATTACHMENT`` record (code 19) describes the metadata
-attachments for a global variable. The ``valueid`` is the value index for
-the global variable, and the remaining fields are pairs of metadata name
-indices and metadata node indices.
-
.. _PARAMATTR_BLOCK:
PARAMATTR_BLOCK Contents
View
221 docs/BitSets.rst
@@ -1,221 +0,0 @@
-=======
-Bitsets
-=======
-
-This is a mechanism that allows IR modules to co-operatively build pointer
-sets corresponding to addresses within a given set of globals. One example
-of a use case for this is to allow a C++ program to efficiently verify (at
-each call site) that a vtable pointer is in the set of valid vtable pointers
-for the type of the class or its derived classes.
-
-To use the mechanism, a client creates a global metadata node named
-``llvm.bitsets``. Each element is a metadata node with three elements:
-
-1. a metadata object representing an identifier for the bitset
-2. either a global variable or a function
-3. a byte offset into the global (generally zero for functions)
-
-Each bitset must exclusively contain either global variables or functions.
-
-.. admonition:: Limitation
-
- The current implementation only supports functions as members of bitsets on
- the x86-32 and x86-64 architectures.
-
-An intrinsic, :ref:`llvm.bitset.test <bitset.test>`, is used to test
-whether a given pointer is a member of a bitset.
-
-Representing Type Information using Bitsets
-===========================================
-
-This section describes how Clang represents C++ type information associated with
-virtual tables using bitsets.
-
-Consider the following inheritance hierarchy:
-
-.. code-block:: c++
-
- struct A {
- virtual void f();
- };
-
- struct B : A {
- virtual void f();
- virtual void g();
- };
-
- struct C {
- virtual void h();
- };
-
- struct D : A, C {
- virtual void f();
- virtual void h();
- };
-
-The virtual table objects for A, B, C and D look like this (under the Itanium ABI):
-
-.. csv-table:: Virtual Table Layout for A, B, C, D
- :header: Class, 0, 1, 2, 3, 4, 5, 6
-
- A, A::offset-to-top, &A::rtti, &A::f
- B, B::offset-to-top, &B::rtti, &B::f, &B::g
- C, C::offset-to-top, &C::rtti, &C::h
- D, D::offset-to-top, &D::rtti, &D::f, &D::h, D::offset-to-top, &D::rtti, thunk for &D::h
-
-When an object of type A is constructed, the address of ``&A::f`` in A's
-virtual table object is stored in the object's vtable pointer. In ABI parlance
-this address is known as an `address point`_. Similarly, when an object of type
-B is constructed, the address of ``&B::f`` is stored in the vtable pointer. In
-this way, the vtable in B's virtual table object is compatible with A's vtable.
-
-D is a little more complicated, due to the use of multiple inheritance. Its
-virtual table object contains two vtables, one compatible with A's vtable and
-the other compatible with C's vtable. Objects of type D contain two virtual
-pointers, one belonging to the A subobject and containing the address of
-the vtable compatible with A's vtable, and the other belonging to the C
-subobject and containing the address of the vtable compatible with C's vtable.
-
-The full set of compatibility information for the above class hierarchy is
-shown below. The following table shows the name of a class, the offset of an
-address point within that class's vtable and the name of one of the classes
-with which that address point is compatible.
-
-.. csv-table:: Bitsets for A, B, C, D
- :header: VTable for, Offset, Compatible Class
-
- A, 16, A
- B, 16, A
- , , B
- C, 16, C
- D, 16, A
- , , D
- , 48, C
-
-The next step is to encode this compatibility information into the IR. The way
-this is done is to create bitsets named after each of the compatible classes,
-into which we add each of the compatible address points in each vtable.
-For example, these bitset entries encode the compatibility information for
-the above hierarchy:
-
-::
-
- !0 = !{!"_ZTS1A", [3 x i8*]* @_ZTV1A, i64 16}
- !1 = !{!"_ZTS1A", [4 x i8*]* @_ZTV1B, i64 16}
- !2 = !{!"_ZTS1B", [4 x i8*]* @_ZTV1B, i64 16}
- !3 = !{!"_ZTS1C", [3 x i8*]* @_ZTV1C, i64 16}
- !4 = !{!"_ZTS1A", [7 x i8*]* @_ZTV1D, i64 16}
- !5 = !{!"_ZTS1D", [7 x i8*]* @_ZTV1D, i64 16}
- !6 = !{!"_ZTS1C", [7 x i8*]* @_ZTV1D, i64 48}
-
-With these bitsets, we can now use the ``llvm.bitset.test`` intrinsic to test
-whether a given pointer is compatible with a bitset. Working backwards,
-if ``llvm.bitset.test`` returns true for a particular pointer, we can also
-statically determine the identities of the virtual functions that a particular
-virtual call may call. For example, if a program assumes a pointer to be in the
-``!"_ZST1A"`` bitset, we know that the address can be only be one of ``_ZTV1A+16``,
-``_ZTV1B+16`` or ``_ZTV1D+16`` (i.e. the address points of the vtables of A,
-B and D respectively). If we then load an address from that pointer, we know
-that the address can only be one of ``&A::f``, ``&B::f`` or ``&D::f``.
-
-.. _address point: https://mentorembedded.github.io/cxx-abi/abi.html#vtable-general
-
-Testing Bitset Addresses
-========================
-
-If a program tests an address using ``llvm.bitset.test``, this will cause
-a link-time optimization pass, ``LowerBitSets``, to replace calls to this
-intrinsic with efficient code to perform bitset tests. At a high level,
-the pass will lay out referenced globals in a consecutive memory region in
-the object file, construct bit vectors that map onto that memory region,
-and generate code at each of the ``llvm.bitset.test`` call sites to test
-pointers against those bit vectors. Because of the layout manipulation, the
-globals' definitions must be available at LTO time. For more information,
-see the `control flow integrity design document`_.
-
-A bit set containing functions is transformed into a jump table, which is a
-block of code consisting of one branch instruction for each of the functions
-in the bit set that branches to the target function. The pass will redirect
-any taken function addresses to the corresponding jump table entry. In the
-object file's symbol table, the jump table entries take the identities of
-the original functions, so that addresses taken outside the module will pass
-any verification done inside the module.
-
-Jump tables may call external functions, so their definitions need not
-be available at LTO time. Note that if an externally defined function is a
-member of a bitset, there is no guarantee that its identity within the module
-will be the same as its identity outside of the module, as the former will
-be the jump table entry if a jump table is necessary.
-
-The `GlobalLayoutBuilder`_ class is responsible for laying out the globals
-efficiently to minimize the sizes of the underlying bitsets.
-
-.. _control flow integrity design document: http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html
-
-:Example:
-
-::
-
- target datalayout = "e-p:32:32"
-
- @a = internal global i32 0
- @b = internal global i32 0
- @c = internal global i32 0
- @d = internal global [2 x i32] [i32 0, i32 0]
-
- define void @e() {
- ret void
- }
-
- define void @f() {
- ret void
- }
-
- declare void @g()
-
- !llvm.bitsets = !{!0, !1, !2, !3, !4, !5, !6}
-
- !0 = !{!"bitset1", i32* @a, i32 0}
- !1 = !{!"bitset1", i32* @b, i32 0}
- !2 = !{!"bitset2", i32* @b, i32 0}
- !3 = !{!"bitset2", i32* @c, i32 0}
- !4 = !{!"bitset2", i32* @d, i32 4}
- !5 = !{!"bitset3", void ()* @e, i32 0}
- !6 = !{!"bitset3", void ()* @g, i32 0}
-
- declare i1 @llvm.bitset.test(i8* %ptr, metadata %bitset) nounwind readnone
-
- define i1 @foo(i32* %p) {
- %pi8 = bitcast i32* %p to i8*
- %x = call i1 @llvm.bitset.test(i8* %pi8, metadata !"bitset1")
- ret i1 %x
- }
-
- define i1 @bar(i32* %p) {
- %pi8 = bitcast i32* %p to i8*
- %x = call i1 @llvm.bitset.test(i8* %pi8, metadata !"bitset2")
- ret i1 %x
- }
-
- define i1 @baz(void ()* %p) {
- %pi8 = bitcast void ()* %p to i8*
- %x = call i1 @llvm.bitset.test(i8* %pi8, metadata !"bitset3")
- ret i1 %x
- }
-
- define void @main() {
- %a1 = call i1 @foo(i32* @a) ; returns 1
- %b1 = call i1 @foo(i32* @b) ; returns 1
- %c1 = call i1 @foo(i32* @c) ; returns 0
- %a2 = call i1 @bar(i32* @a) ; returns 0
- %b2 = call i1 @bar(i32* @b) ; returns 1
- %c2 = call i1 @bar(i32* @c) ; returns 1
- %d02 = call i1 @bar(i32* getelementptr ([2 x i32]* @d, i32 0, i32 0)) ; returns 0
- %d12 = call i1 @bar(i32* getelementptr ([2 x i32]* @d, i32 0, i32 1)) ; returns 1
- %e = call i1 @baz(void ()* @e) ; returns 1
- %f = call i1 @baz(void ()* @f) ; returns 0
- %g = call i1 @baz(void ()* @g) ; returns 1
- ret void
- }
-
-.. _GlobalLayoutBuilder: http://llvm.org/klaus/llvm/blob/master/include/llvm/Transforms/IPO/LowerBitSets.h
View
5 docs/CMake.rst
@@ -34,10 +34,7 @@ Quick start
We use here the command-line, non-interactive CMake interface.
#. `Download <http://www.cmake.org/cmake/resources/software.html>`_ and install
- CMake. Version 2.8.8 is the minimum required, but if you're using the Ninja
- backend, CMake v3.2 or newer is required to `get interactive output
- <http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20141117/244797.html>`_
- when running :doc:`Lit <CommandGuide/lit>`.
+ CMake. Version 3.4.3 is the minimum required.
#. Open a shell. Your development tools must be reachable from this shell
through the PATH environment variable.
View
29 docs/CodeGenerator.rst
@@ -386,32 +386,27 @@ functions make it easy to build arbitrary machine instructions. Usage of the
.. code-block:: c++
// Create a 'DestReg = mov 42' (rendered in X86 assembly as 'mov DestReg, 42')
- // instruction. The '1' specifies how many operands will be added.
- MachineInstr *MI = BuildMI(X86::MOV32ri, 1, DestReg).addImm(42);
-
- // Create the same instr, but insert it at the end of a basic block.
+ // instruction and insert it at the end of the given MachineBasicBlock.
+ const TargetInstrInfo &TII = ...
MachineBasicBlock &MBB = ...
- BuildMI(MBB, X86::MOV32ri, 1, DestReg).addImm(42);
+ DebugLoc DL;
+ MachineInstr *MI = BuildMI(MBB, DL, TII.get(X86::MOV32ri), DestReg).addImm(42);
// Create the same instr, but insert it before a specified iterator point.
MachineBasicBlock::iterator MBBI = ...
- BuildMI(MBB, MBBI, X86::MOV32ri, 1, DestReg).addImm(42);
+ BuildMI(MBB, MBBI, DL, TII.get(X86::MOV32ri), DestReg).addImm(42);
// Create a 'cmp Reg, 0' instruction, no destination reg.
- MI = BuildMI(X86::CMP32ri, 2).addReg(Reg).addImm(0);
+ MI = BuildMI(MBB, DL, TII.get(X86::CMP32ri8)).addReg(Reg).addImm(42);
// Create an 'sahf' instruction which takes no operands and stores nothing.
- MI = BuildMI(X86::SAHF, 0);
+ MI = BuildMI(MBB, DL, TII.get(X86::SAHF));
// Create a self looping branch instruction.
- BuildMI(MBB, X86::JNE, 1).addMBB(&MBB);
+ BuildMI(MBB, DL, TII.get(X86::JNE)).addMBB(&MBB);
-The key thing to remember with the ``BuildMI`` functions is that you have to
-specify the number of operands that the machine instruction will take. This
-allows for efficient memory allocation. You also need to specify if operands
-default to be uses of values, not definitions. If you need to add a definition
-operand (other than the optional destination register), you must explicitly mark
-it as such:
+If you need to add a definition operand (other than the optional destination
+register), you must explicitly mark it as such:
.. code-block:: c++
@@ -2676,6 +2671,9 @@ Following notations are used for specifying relocation calculations:
* **A** --- Represents the addend used to compute the value of the relocatable
field
+* **G** --- Represents the offset into the global offset table at which the
+ relocation entry’s symbol will reside during execution.
+* **GOT** --- Represents the address of the global offset table.
* **P** --- Represents the place (section offset or address) of the storage unit
being relocated (computed using ``r_offset``)
* **S** --- Represents the value of the symbol whose index resides in the
@@ -2694,4 +2692,5 @@ supported relocation types:
``R_AMDGPU_REL32`` 4 ``word32`` S + A - P
``R_AMDGPU_REL64`` 5 ``word64`` S + A - P
``R_AMDGPU_ABS32`` 6 ``word32`` S + A
+ ``R_AMDGPU_GOTPCREL`` 7 ``word32`` G + GOT + A - P
===================== ===== ========== ====================
View
112 docs/CodeOfConduct.rst
@@ -0,0 +1,112 @@
+==============================
+LLVM Community Code of Conduct
+==============================
+
+.. note::
+
+ This document is currently a **DRAFT** document while it is being discussed
+ by the community.
+
+The LLVM community has always worked to be a welcoming and respectful
+community, and we want to ensure that doesn't change as we grow and evolve. To
+that end, we have a few ground rules that we ask people to adhere to:
+
+* `be friendly and patient`_,
+* `be welcoming`_,
+* `be considerate`_,
+* `be respectful`_,
+* `be careful in the words that you choose and be kind to others`_, and
+* `when we disagree, try to understand why`_.
+
+This isn't an exhaustive list of things that you can't do. Rather, take it in
+the spirit in which it's intended - a guide to make it easier to communicate
+and participate in the community.
+
+This code of conduct applies to all spaces managed by the LLVM project or The
+LLVM Foundation. This includes IRC channels, mailing lists, bug trackers, LLVM
+events such as the developer meetings and socials, and any other forums created
+by the project that the community uses for communication. It applies to all of
+your communication and conduct in these spaces, including emails, chats, things
+you say, slides, videos, posters, signs, or even t-shirts you display in these
+spaces. In addition, violations of this code outside these spaces may, in rare
+cases, affect a person's ability to participate within them, when the conduct
+amounts to an egregious violation of this code.
+
+If you believe someone is violating the code of conduct, we ask that you report
+it by emailing conduct@llvm.org. For more details please see our
+:doc:`Reporting Guide <ReportingGuide>`.
+
+.. _be friendly and patient:
+
+* **Be friendly and patient.**
+
+.. _be welcoming:
+
+* **Be welcoming.** We strive to be a community that welcomes and supports
+ people of all backgrounds and identities. This includes, but is not limited
+ to members of any race, ethnicity, culture, national origin, colour,
+ immigration status, social and economic class, educational level, sex, sexual
+ orientation, gender identity and expression, age, size, family status,
+ political belief, religion or lack thereof, and mental and physical ability.
+
+.. _be considerate:
+
+* **Be considerate.** Your work will be used by other people, and you in turn
+ will depend on the work of others. Any decision you take will affect users
+ and colleagues, and you should take those consequences into account. Remember
+ that we're a world-wide community, so you might not be communicating in
+ someone else's primary language.
+
+.. _be respectful:
+
+* **Be respectful.** Not all of us will agree all the time, but disagreement is
+ no excuse for poor behavior and poor manners. We might all experience some
+ frustration now and then, but we cannot allow that frustration to turn into
+ a personal attack. It's important to remember that a community where people
+ feel uncomfortable or threatened is not a productive one. Members of the LLVM
+ community should be respectful when dealing with other members as well as
+ with people outside the LLVM community.
+
+.. _be careful in the words that you choose and be kind to others:
+
+* **Be careful in the words that you choose and be kind to others.** Do not
+ insult or put down other participants. Harassment and other exclusionary
+ behavior aren't acceptable. This includes, but is not limited to:
+
+ * Violent threats or language directed against another person.
+ * Discriminatory jokes and language.
+ * Posting sexually explicit or violent material.
+ * Posting (or threatening to post) other people's personally identifying
+ information ("doxing").
+ * Personal insults, especially those using racist or sexist terms.
+ * Unwelcome sexual attention.
+ * Advocating for, or encouraging, any of the above behavior.
+
+ In general, if someone asks you to stop, then stop. Persisting in such
+ behavior after being asked to stop is considered harassment.
+
+.. _when we disagree, try to understand why:
+
+* **When we disagree, try to understand why.** Disagreements, both social and
+ technical, happen all the time and LLVM is no exception. It is important that
+ we resolve disagreements and differing views constructively. Remember that
+ we're different. The strength of LLVM comes from its varied community, people
+ from a wide range of backgrounds. Different people have different
+ perspectives on issues. Being unable to understand why someone holds
+ a viewpoint doesn't mean that they're wrong. Don't forget that it is human to
+ err and blaming each other doesn't get us anywhere. Instead, focus on helping
+ to resolve issues and learning from mistakes.
+
+Questions?
+==========
+
+If you have questions, please feel free to contact the LLVM Foundation Code of
+Conduct Advisory Committee by emailing conduct@llvm.org.
+
+
+(This text is based on the `Django Project`_ Code of Conduct, which is in turn
+based on wording from the `Speak Up! project`_.)
+
+.. _Django Project: https://www.djangoproject.com/conduct/
+.. _Speak Up! project: http://speakup.io/coc.html
+
View
19 docs/CommandGuide/FileCheck.rst
@@ -461,3 +461,22 @@ relative line number references, for example:
// CHECK-NEXT: {{^ ;}}
int a
+Matching Newline Characters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To match newline characters in regular expressions the character class
+``[[:space:]]`` can be used. For example, the following pattern:
+
+.. code-block:: c++
+
+ // CHECK: DW_AT_location [DW_FORM_sec_offset] ([[DLOC:0x[0-9a-f]+]]){{[[:space:]].*}}"intd"
+
+matches output of the form (from llvm-dwarfdump):
+
+.. code-block:: llvm
+
+ DW_AT_location [DW_FORM_sec_offset] (0x00000233)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000c9] = "intd")
+
+letting us set the :program:`FileCheck` variable ``DLOC`` to the desired value
+``0x00000233``, extracted from the line immediately preceding "``intd``".
View
12 docs/CommandGuide/llvm-cov.rst
@@ -236,6 +236,18 @@ OPTIONS
Show code coverage only for functions that match the given regular expression.
+.. option:: -format=<FORMAT>
+
+ Use the specified output format. The supported formats are: "text", "html".
+
+.. option:: -output-dir=PATH
+
+ Specify a directory to write coverage reports into. If the directory does not
+ exist, it is created. When used in function view mode (i.e when -name or
+ -name-regex are used to select specific functions), the report is written to
+ PATH/functions.EXTENSION. When used in file view mode, a report for each file
+ is written to PATH/REL_PATH_TO_FILE.EXTENSION.
+
.. option:: -line-coverage-gt=<N>
Show code coverage only for functions with line coverage greater than the
View
4 docs/DeveloperPolicy.rst
@@ -338,7 +338,7 @@ Obtaining Commit Access
We grant commit access to contributors with a track record of submitting high
quality patches. If you would like commit access, please send an email to
-`Chris <mailto:sabre@nondot.org>`_ with the following information:
+`Chris <mailto:clattner@llvm.org>`_ with the following information:
#. The user name you want to commit with, e.g. "hacker".
@@ -351,7 +351,7 @@ quality patches. If you would like commit access, please send an email to
comes with apache) in *crypt* mode (often enabled with "``-d``"), or find a web
page that will do it for you. Note that our system does not work with MD5
hashes. These are significantly longer than a crypt hash - e.g.
- "``$apr1$vea6bBV2$Z8IFx.AfeD8LhqlZFqJer0``".
+ "``$apr1$vea6bBV2$Z8IFx.AfeD8LhqlZFqJer0``", we only accept the shorter crypt hash.
Once you've been granted commit access, you should be able to check out an LLVM
tree with an SVN URL of "https://username@llvm.org/..." instead of the normal
View
152 docs/LangRef.rst
@@ -1060,12 +1060,13 @@ Currently, only the following parameter attributes are defined:
``returned``
This indicates that the function always returns the argument as its return
- value. This is an optimization hint to the code generator when generating
- the caller, allowing tail call optimization and omission of register saves
- and restores in some cases; it is not checked or enforced when generating
- the callee. The parameter and the function return type must be valid
- operands for the :ref:`bitcast instruction <i_bitcast>`. This is not a
- valid attribute for return values and can only be applied to one parameter.
+ value. This is a hint to the optimizer and code generator used when
+ generating the caller, allowing value propagation, tail call optimization,
+ and omission of register saves and restores in some cases; it is not
+ checked or enforced when generating the callee. The parameter and the
+ function return type must be valid operands for the
+ :ref:`bitcast instruction <i_bitcast>`. This is not a valid attribute for
+ return values and can only be applied to one parameter.
``nonnull``
This indicates that the parameter or return pointer is not null. This
@@ -1318,7 +1319,7 @@ example:
The ``convergent`` attribute may appear on functions or call/invoke
instructions. When it appears on a function, it indicates that calls to
this function should not be made control-dependent on additional values.
- For example, the intrinsic ``llvm.cuda.syncthreads`` is ``convergent``, so
+ For example, the intrinsic ``llvm.nvvm.barrier0`` is ``convergent``, so
calls to this intrinsic cannot be made control-dependent on additional
values.
@@ -1427,7 +1428,7 @@ example:
generated for this function needs to follow certain conventions that
make it possible for a runtime function to patch over it later.
The exact effect of this attribute depends on its string value,
- for which there currently is one legal possiblity:
+ for which there currently is one legal possibility:
* ``"prologue-short-redirect"`` - This style of patchable
function is intended to support patching a function prologue to
@@ -1474,6 +1475,13 @@ example:
On an argument, this attribute indicates that the function does not write
through this pointer argument, even though it may write to the memory that
the pointer points to.
+``writeonly``
+ On a function, this attribute indicates that the function may write to but
+ does not read from memory.
+
+ On an argument, this attribute indicates that the function may write to but
+ does not read through this pointer argument (even though it may read from
+ the memory that the pointer points to).
``argmemonly``
This attribute indicates that the only memory accesses inside function are
loads and stores from objects pointed to by its pointer-typed arguments,
@@ -4338,7 +4346,7 @@ DIMacro
``DIMacro`` nodes represent definition or undefinition of a macro identifiers.
The ``name:`` field is the macro identifier, followed by macro parameters when
-definining a function-like macro, and the ``value`` field is the token-string
+defining a function-like macro, and the ``value`` field is the token-string
used to expand the macro identifier.
.. code-block:: llvm
@@ -4510,8 +4518,8 @@ it. ULP is defined as follows:
distance between the two non-equal finite floating-point numbers
nearest ``x``. Moreover, ``ulp(NaN)`` is ``NaN``.
-The metadata node shall consist of a single positive floating point
-number representing the maximum relative error, for example:
+The metadata node shall consist of a single positive float type number
+representing the maximum relative error, for example:
.. code-block:: llvm
@@ -4839,12 +4847,6 @@ the loop identifier metadata node directly:
!1 = !{!1} ; an identifier for the inner loop
!2 = !{!2} ; an identifier for the outer loop
-'``llvm.bitsets``'
-^^^^^^^^^^^^^^^^^^
-
-The ``llvm.bitsets`` global metadata is used to implement
-:doc:`bitsets <BitSets>`.
-
'``invariant.group``' Metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -5481,7 +5483,7 @@ Syntax:
::
- <result> = invoke [cconv] [ret attrs] <ptr to function ty> <function ptr val>(<function args>) [fn attrs]
+ <result> = invoke [cconv] [ret attrs] <ty>|<fnty> <fnptrval>(<function args>) [fn attrs]
[operand bundles] to label <normal label> unwind label <exception label>
Overview:
@@ -5517,12 +5519,16 @@ This instruction requires several arguments:
#. The optional :ref:`Parameter Attributes <paramattrs>` list for return
values. Only '``zeroext``', '``signext``', and '``inreg``' attributes
are valid here.
-#. '``ptr to function ty``': shall be the signature of the pointer to
- function value being invoked. In most cases, this is a direct
- function invocation, but indirect ``invoke``'s are just as possible,
- branching off an arbitrary pointer to function value.
-#. '``function ptr val``': An LLVM value containing a pointer to a
- function to be invoked.
+#. '``ty``': the type of the call instruction itself which is also the
+ type of the return value. Functions that return no value are marked
+ ``void``.
+#. '``fnty``': shall be the signature of the function being invoked. The
+ argument types must match the types implied by this signature. This
+ type can be omitted if the function is not varargs.
+#. '``fnptrval``': An LLVM value containing a pointer to a function to
+ be invoked. In most cases, this is a direct function invocation, but
+ indirect ``invoke``'s are just as possible, calling an arbitrary pointer
+ to function value.
#. '``function args``': argument list whose types match the function
signature argument types and parameter attributes. All arguments must
be of :ref:`first class <t_firstclass>` type. If the function signature
@@ -8491,7 +8497,7 @@ Syntax:
::
- <result> = [tail | musttail | notail ] call [fast-math flags] [cconv] [ret attrs] <ty> [<fnty>*] <fnptrval>(<function args>) [fn attrs]
+ <result> = [tail | musttail | notail ] call [fast-math flags] [cconv] [ret attrs] <ty>|<fnty> <fnptrval>(<function args>) [fn attrs]
[ operand bundles ]
Overview:
@@ -8564,13 +8570,11 @@ This instruction requires several arguments:
#. '``ty``': the type of the call instruction itself which is also the
type of the return value. Functions that return no value are marked
``void``.
-#. '``fnty``': shall be the signature of the pointer to function value
- being invoked. The argument types must match the types implied by
- this signature. This type can be omitted if the function is not
- varargs and if the function type does not return a pointer to a
- function.
+#. '``fnty``': shall be the signature of the function being called. The
+ argument types must match the types implied by this signature. This
+ type can be omitted if the function is not varargs.
#. '``fnptrval``': An LLVM value containing a pointer to a function to
- be invoked. In most cases, this is a direct function invocation, but
+ be called. In most cases, this is a direct function call, but
indirect ``call``'s are just as possible, calling an arbitrary pointer
to function value.
#. '``function args``': argument list whose types match the function
@@ -11571,12 +11575,12 @@ This is an overloaded intrinsic. The loaded data is a vector of any integer, flo
::
- declare <16 x float> @llvm.masked.load.v16f32 (<16 x float>* <ptr>, i32 <alignment>, <16 x i1> <mask>, <16 x float> <passthru>)
- declare <2 x double> @llvm.masked.load.v2f64 (<2 x double>* <ptr>, i32 <alignment>, <2 x i1> <mask>, <2 x double> <passthru>)
+ declare <16 x float> @llvm.masked.load.v16f32.p0v16f32 (<16 x float>* <ptr>, i32 <alignment>, <16 x i1> <mask>, <16 x float> <passthru>)
+ declare <2 x double> @llvm.masked.load.v2f64.p0v2f64 (<2 x double>* <ptr>, i32 <alignment>, <2 x i1> <mask>, <2 x double> <passthru>)
;; The data is a vector of pointers to double
- declare <8 x double*> @llvm.masked.load.v8p0f64 (<8 x double*>* <ptr>, i32 <alignment>, <8 x i1> <mask>, <8 x double*> <passthru>)
+ declare <8 x double*> @llvm.masked.load.v8p0f64.p0v8p0f64 (<8 x double*>* <ptr>, i32 <alignment>, <8 x i1> <mask>, <8 x double*> <passthru>)
;; The data is a vector of function pointers
- declare <8 x i32 ()*> @llvm.masked.load.v8p0f_i32f (<8 x i32 ()*>* <ptr>, i32 <alignment>, <8 x i1> <mask>, <8 x i32 ()*> <passthru>)
+ declare <8 x i32 ()*> @llvm.masked.load.v8p0f_i32f.p0v8p0f_i32f (<8 x i32 ()*>* <ptr>, i32 <alignment>, <8 x i1> <mask>, <8 x i32 ()*> <passthru>)
Overview:
"""""""""
@@ -11599,7 +11603,7 @@ The result of this operation is equivalent to a regular vector load instruction
::
- %res = call <16 x float> @llvm.masked.load.v16f32 (<16 x float>* %ptr, i32 4, <16 x i1>%mask, <16 x float> %passthru)
+ %res = call <16 x float> @llvm.masked.load.v16f32.p0v16f32 (<16 x float>* %ptr, i32 4, <16 x i1>%mask, <16 x float> %passthru)
;; The result of the two following instructions is identical aside from potential memory access exception
%loadlal = load <16 x float>, <16 x float>* %ptr, align 4
@@ -11616,12 +11620,12 @@ This is an overloaded intrinsic. The data stored in memory is a vector of any in
::
- declare void @llvm.masked.store.v8i32 (<8 x i32> <value>, <8 x i32>* <ptr>, i32 <alignment>, <8 x i1> <mask>)
- declare void @llvm.masked.store.v16f32 (<16 x float> <value>, <16 x float>* <ptr>, i32 <alignment>, <16 x i1> <mask>)
+ declare void @llvm.masked.store.v8i32.p0v8i32 (<8 x i32> <value>, <8 x i32>* <ptr>, i32 <alignment>, <8 x i1> <mask>)
+ declare void @llvm.masked.store.v16f32.p0v16f32 (<16 x float> <value>, <16 x float>* <ptr>, i32 <alignment>, <16 x i1> <mask>)
;; The data is a vector of pointers to double
- declare void @llvm.masked.store.v8p0f64 (<8 x double*> <value>, <8 x double*>* <ptr>, i32 <alignment>, <8 x i1> <mask>)
+ declare void @llvm.masked.store.v8p0f64.p0v8p0f64 (<8 x double*> <value>, <8 x double*>* <ptr>, i32 <alignment>, <8 x i1> <mask>)
;; The data is a vector of function pointers
- declare void @llvm.masked.store.v4p0f_i32f (<4 x i32 ()*> <value>, <4 x i32 ()*>* <ptr>, i32 <alignment>, <4 x i1> <mask>)
+ declare void @llvm.masked.store.v4p0f_i32f.p0v4p0f_i32f (<4 x i32 ()*> <value>, <4 x i32 ()*>* <ptr>, i32 <alignment>, <4 x i1> <mask>)
Overview:
"""""""""
@@ -11642,7 +11646,7 @@ The result of this operation is equivalent to a load-modify-store sequence. Howe
::
- call void @llvm.masked.store.v16f32(<16 x float> %value, <16 x float>* %ptr, i32 4, <16 x i1> %mask)
+ call void @llvm.masked.store.v16f32.p0v16f32(<16 x float> %value, <16 x float>* %ptr, i32 4, <16 x i1> %mask)
;; The result of the following instructions is identical aside from potential data races and memory access exceptions
%oldval = load <16 x float>, <16 x float>* %ptr, align 4
@@ -12274,30 +12278,84 @@ sufficient overall improvement in code quality. For this reason,
that the optimizer can otherwise deduce or facts that are of little use to the
optimizer.
-.. _bitset.test:
+.. _type.test:
-'``llvm.bitset.test``' Intrinsic
+'``llvm.type.test``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Syntax:
"""""""
::
- declare i1 @llvm.bitset.test(i8* %ptr, metadata %bitset) nounwind readnone
+ declare i1 @llvm.type.test(i8* %ptr, metadata %type) nounwind readnone
Arguments:
""""""""""
The first argument is a pointer to be tested. The second argument is a
-metadata object representing an identifier for a :doc:`bitset <BitSets>`.
+metadata object representing a :doc:`type identifier <TypeMetadata>`.
Overview:
"""""""""
-The ``llvm.bitset.test`` intrinsic tests whether the given pointer is a
-member of the given bitset.
+The ``llvm.type.test`` intrinsic tests whether the given pointer is associated
+with the given type identifier.
+
+'``llvm.type.checked.load``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+ declare {i8*, i1} @llvm.type.checked.load(i8* %ptr, i32 %offset, metadata %type) argmemonly nounwind readonly
+
+
+Arguments:
+""""""""""
+
+The first argument is a pointer from which to load a function pointer. The
+second argument is the byte offset from which to load the function pointer. The
+third argument is a metadata object representing a :doc:`type identifier
+<TypeMetadata>`.
+
+Overview:
+"""""""""
+
+The ``llvm.type.checked.load`` intrinsic safely loads a function pointer from a
+virtual table pointer using type metadata. This intrinsic is used to implement
+control flow integrity in conjunction with virtual call optimization. The
+virtual call optimization pass will optimize away ``llvm.type.checked.load``
+intrinsics associated with devirtualized calls, thereby removing the type
+check in cases where it is not needed to enforce the control flow integrity
+constraint.
+
+If the given pointer is associated with a type metadata identifier, this
+function returns true as the second element of its return value. (Note that
+the function may also return true if the given pointer is not associated
+with a type metadata identifier.) If the function's return value's second
+element is true, the following rules apply to the first element:
+
+- If the given pointer is associated with the given type metadata identifier,
+ it is the function pointer loaded from the given byte offset from the given
+ pointer.
+
+- If the given pointer is not associated with the given type metadata
+ identifier, it is one of the following (the choice of which is unspecified):
+
+ 1. The function pointer that would have been loaded from an arbitrarily chosen
+ (through an unspecified mechanism) pointer associated with the type
+ metadata.
+
+ 2. If the function has a non-void return type, a pointer to a function that
+ returns an unspecified value without causing side effects.
+
+If the function's return value's second element is false, the value of the
+first element is undefined.
+
'``llvm.donothing``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
View
4 docs/LinkTimeOptimization.rst
@@ -87,9 +87,9 @@ To compile, run:
.. code-block:: console
- % clang -emit-llvm -c a.c -o a.o # <-- a.o is LLVM bitcode file
+ % clang -flto -c a.c -o a.o # <-- a.o is LLVM bitcode file
% clang -c main.c -o main.o # <-- main.o is native object file
- % clang a.o main.o -o main # <-- standard link command without modifications
+ % clang -flto a.o main.o -o main # <-- standard link command with -flto
* In this example, the linker recognizes that ``foo2()`` is an externally
visible symbol defined in LLVM bitcode file. The linker completes its usual
View
2 docs/MergeFunctions.rst
@@ -56,7 +56,7 @@ As a good start point, Kaleidoscope tutorial could be used:
Especially it's important to understand chapter 3 of tutorial:
-:doc:`tutorial/LangImpl3`
+:doc:`tutorial/LangImpl03`
Reader also should know how passes work in LLVM, they could use next article as
a reference and start point here:
View
2 docs/NVPTXUsage.rst
@@ -566,7 +566,7 @@ Intrinsic CUDA Equivalent
``i32 @llvm.nvvm.read.ptx.sreg.ctaid.{x,y,z}`` blockIdx.{x,y,z}
``i32 @llvm.nvvm.read.ptx.sreg.ntid.{x,y,z}`` blockDim.{x,y,z}
``i32 @llvm.nvvm.read.ptx.sreg.nctaid.{x,y,z}`` gridDim.{x,y,z}
-``void @llvm.cuda.syncthreads()`` __syncthreads()
+``void @llvm.nvvm.barrier0()`` __syncthreads()
================================================ ====================
View
4 docs/ProgrammersManual.rst
@@ -480,7 +480,7 @@ The ``function_ref`` class template
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``function_ref``
-(`doxygen <http://llvm.org/doxygen/classllvm_1_1function_ref.html>`__) class
+(`doxygen <http://llvm.org/docs/doxygen/html/classllvm_1_1function__ref_3_01Ret_07Params_8_8_8_08_4.html>`__) class
template represents a reference to a callable object, templated over the type
of the callable. This is a good choice for passing a callback to a function,
if you don't need to hold onto the callback after the function returns. In this
@@ -2221,7 +2221,7 @@ sequence of instructions that form a ``BasicBlock``:
CallInst* callTwo = Builder.CreateCall(...);
Value* result = Builder.CreateMul(callOne, callTwo);
- See :doc:`tutorial/LangImpl3` for a practical use of the ``IRBuilder``.
+ See :doc:`tutorial/LangImpl03` for a practical use of the ``IRBuilder``.
.. _schanges_deleting:
View
143 docs/ReportingGuide.rst
@@ -0,0 +1,143 @@
+===============
+Reporting Guide
+===============
+
+.. note::
+
+ This document is currently a **DRAFT** document while it is being discussed
+ by the community.
+
+If you believe someone is violating the :doc:`code of conduct <CodeOfConduct>`
+you can always report it to the LLVM Foundation Code of Conduct Advisory
+Committee by emailing conduct@llvm.org. **All reports will be kept
+confidential.** This isn't a public list and only `members`_ of the advisory
+committee will receive the report.
+
+If you believe anyone is in **physical danger**, please notify appropriate law
+enforcement first. If you are unsure what law enforcement agency is
+appropriate, please include this in your report and we will attempt to notify
+them.
+
+If the violation occurs at an event such as a Developer Meeting and requires
+immediate attention, you can also reach out to any of the event organizers or
+staff. Event organizers and staff will be prepared to handle the incident and
+able to help. If you cannot find one of the organizers, the venue staff can
+locate one for you. We will also post detailed contact information for specific
+events as part of each events' information. In person reports will still be
+kept confidential exactly as above, but also feel free to (anonymously if
+needed) email conduct@llvm.org.
+
+.. note::
+ The LLVM community has long handled inappropriate behavior on its own, using
+ both private communication and public responses. Nothing in this document is
+ intended to discourage this self enforcement of community norms. Instead,
+ the mechanisms described here are intended to supplement any self
+ enforcement within the community. They provide avenues for handling severe
+ cases or cases where the reporting party does not wish to respond directly
+ for any reason.
+
+Filing a report
+===============
+
+Reports can be as formal or informal as needed for the situation at hand. If
+possible, please include as much information as you can. If you feel
+comfortable, please consider including:
+
+* Your contact info (so we can get in touch with you if we need to follow up).
+* Names (real, nicknames, or pseudonyms) of any individuals involved. If there
+ were other witnesses besides you, please try to include them as well.
+* When and where the incident occurred. Please be as specific as possible.
+* Your account of what occurred. If there is a publicly available record (e.g.
+ a mailing list archive or a public IRC logger) please include a link.
+* Any extra context you believe existed for the incident.
+* If you believe this incident is ongoing.
+* Any other information you believe we should have.
+
+What happens after you file a report?
+=====================================
+
+You will receive an email from the advisory committee acknowledging receipt
+within 24 hours (and we will aim to respond much quicker than that).
+
+The advisory committee will immediately meet to review the incident and try to
+determine:
+
+* What happened and who was involved.
+* Whether this event constitutes a code of conduct violation.
+* Whether this is an ongoing situation, or if there is a threat to anyone's
+ physical safety.
+
+If this is determined to be an ongoing incident or a threat to physical safety,
+the working groups' immediate priority will be to protect everyone involved.
+This means we may delay an "official" response until we believe that the
+situation has ended and that everyone is physically safe.
+
+The working group will try to contact other parties involved or witnessing the
+event to gain clarity on what happened and understand any different
+perspectives.
+
+Once the advisory committee has a complete account of the events they will make
+a decision as to how to respond. Responses may include:
+
+* Nothing, if we determine no violation occurred or it has already been
+ appropriately resolved.
+* Providing either moderation or mediation to ongoing interactions (where
+ appropriate, safe, and desired by both parties).
+* A private reprimand from the working group to the individuals involved.
+* An imposed vacation (i.e. asking someone to "take a week off" from a mailing
+ list or IRC).
+* A public reprimand.
+* A permanent or temporary ban from some or all LLVM spaces (mailing lists,
+ IRC, etc.)
+* Involvement of relevant law enforcement if appropriate.
+
+If the situation is not resolved within one week, we'll respond within one week
+to the original reporter with an update and explanation.
+
+Once we've determined our response, we will separately contact the original
+reporter and other individuals to let them know what actions (if any) we'll be
+taking. We will take into account feedback from the individuals involved on the
+appropriateness of our response, but we don't guarantee we'll act on it.
+
+After any incident, the advisory committee will make a report on the situation
+to the LLVM Foundation board. The board may choose to make a public statement
+about the incident. If that's the case, the identities of anyone involved will
+remain confidential unless instructed by those inviduals otherwise.
+
+Appealing
+=========
<