<div dir="ltr">Hey all,<div><br></div><div>I've got this patch to the point where we can correctly specify and serialise function address spaces on functions in bitcode, intermediate representation, and the in-memory IR structures.</div><div><br></div><div>I've yet to do some cleanups such as add more documentation and remove a hack or two.</div><div><br></div><div>I've added a few relevant code owners as reviewers, and I've also added some interested parties on the original discussion for this change</div><div><br></div><div><a href="http://lists.llvm.org/pipermail/llvm-dev/2017-July/115245.html">http://lists.llvm.org/pipermail/llvm-dev/2017-July/115245.html</a><br></div><div><br></div><div>Any feedback would be appreciated, specifically around</div><div><br></div><div>* Bitcode reading/writing and the way I've kept backwards compatibility</div><div>* The ergonomics of having to pass Module.getDataLayout().getProgramAddressSpace() into all new FunctionTypes (and any suggestions on a nicer way)</div><div><br></div><div>Cheers,</div><div>Dylan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 19, 2017 at 3:50 PM, Dylan McKay via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dylanmckay created this revision.<br>
Herald added subscribers: eraman, nhaehnle, wdng, sdardis, mzolotukhin, mehdi_amini, sanjoy.<br>
<br>
I am popping this up on Phabricator for early feedback.<br>
<br>
**NOTE*: I will submit this in several smaller patches once this is actually ready.<br>
<br>
This adds initial support for letting targets specify which address<br>
spaces their functions should reside in by default.<br>
<br>
This is the first step towards placing functions into the correct<br>
address space for Harvard architectures.<br>
<br>
Require address space to be specified when creating functions<br>
<br>
<br>
<a href="https://reviews.llvm.org/D36916" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D36916</a><br>
<br>
Files:<br>
  docs/BitCodeFormat.rst<br>
  docs/LangRef.rst<br>
  include/llvm/Bitcode/<wbr>LLVMBitCodes.h<br>
  include/llvm/IR/DataLayout.h<br>
  include/llvm/IR/DerivedTypes.h<br>
  include/llvm/IR/Function.h<br>
  include/llvm/IR/GlobalValue.h<br>
  include/llvm/IR/Module.h<br>
  include/llvm/IR/Type.h<br>
  include/llvm/IR/TypeBuilder.h<br>
  lib/AsmParser/LLParser.cpp<br>
  lib/Bitcode/Reader/<wbr>BitcodeReader.cpp<br>
  lib/Bitcode/Writer/<wbr>BitcodeWriter.cpp<br>
  lib/CodeGen/AtomicExpandPass.<wbr>cpp<br>
  lib/CodeGen/IntrinsicLowering.<wbr>cpp<br>
  lib/CodeGen/MIRParser/<wbr>MIRParser.cpp<br>
  lib/IR/AsmWriter.cpp<br>
  lib/IR/AutoUpgrade.cpp<br>
  lib/IR/Core.cpp<br>
  lib/IR/DataLayout.cpp<br>
  lib/IR/Function.cpp<br>
  lib/IR/Globals.cpp<br>
  lib/IR/Type.cpp<br>
  lib/IR/Verifier.cpp<br>
  lib/Linker/IRMover.cpp<br>
  lib/Target/AMDGPU/<wbr>AMDGPULibFunc.cpp<br>
  lib/Target/AMDGPU/<wbr>AMDGPUOpenCLImageTypeLoweringP<wbr>ass.cpp<br>
  lib/Target/AMDGPU/<wbr>AMDGPURewriteOutArguments.cpp<br>
  lib/Target/AVR/<wbr>AVRTargetMachine.cpp<br>
  lib/Target/Mips/<wbr>Mips16HardFloat.cpp<br>
  lib/Target/X86/X86WinEHState.<wbr>cpp<br>
  lib/Transforms/IPO/<wbr>ArgumentPromotion.cpp<br>
  lib/Transforms/IPO/<wbr>DeadArgumentElimination.cpp<br>
  lib/Transforms/IPO/<wbr>LowerTypeTests.cpp<br>
  lib/Transforms/IPO/<wbr>ThinLTOBitcodeWriter.cpp<br>
  lib/Transforms/InstCombine/<wbr>InstCombineCalls.cpp<br>
  lib/Transforms/<wbr>Instrumentation/<wbr>AddressSanitizer.cpp<br>
  lib/Transforms/<wbr>Instrumentation/<wbr>DataFlowSanitizer.cpp<br>
  lib/Transforms/<wbr>Instrumentation/<wbr>EfficiencySanitizer.cpp<br>
  lib/Transforms/<wbr>Instrumentation/GCOVProfiling.<wbr>cpp<br>
  lib/Transforms/<wbr>Instrumentation/<wbr>InstrProfiling.cpp<br>
  lib/Transforms/<wbr>Instrumentation/<wbr>MemorySanitizer.cpp<br>
  lib/Transforms/<wbr>Instrumentation/<wbr>SanitizerCoverage.cpp<br>
  lib/Transforms/ObjCARC/<wbr>ARCRuntimeEntryPoints.h<br>
  lib/Transforms/ObjCARC/<wbr>ObjCARCContract.cpp<br>
  lib/Transforms/Scalar/<wbr>PlaceSafepoints.cpp<br>
  lib/Transforms/Scalar/<wbr>RewriteStatepointsForGC.cpp<br>
  lib/Transforms/Utils/<wbr>CloneFunction.cpp<br>
  lib/Transforms/Utils/<wbr>CodeExtractor.cpp<br>
  lib/Transforms/Utils/<wbr>EscapeEnumerator.cpp<br>
  lib/Transforms/Utils/<wbr>ModuleUtils.cpp<br>
  lib/Transforms/Utils/<wbr>SanitizerStats.cpp<br>
  lib/Transforms/Utils/<wbr>ValueMapper.cpp<br>
  lib/Transforms/Vectorize/<wbr>LoopVectorize.cpp<br>
  test/Bitcode/function-nonzero-<wbr>address-spaces.bc<br>
  test/Bitcode/function-nonzero-<wbr>address-spaces.ll<br>
  unittests/Analysis/<wbr>AliasAnalysisTest.cpp<br>
  unittests/Analysis/<wbr>ScalarEvolutionTest.cpp<br>
  unittests/Analysis/TBAATest.<wbr>cpp<br>
  unittests/Analysis/<wbr>TargetLibraryInfoTest.cpp<br>
  unittests/IR/FunctionTest.cpp<br>
  unittests/IR/IRBuilderTest.cpp<br>
  unittests/IR/InstructionsTest.<wbr>cpp<br>
  unittests/IR/<wbr>LegacyPassManagerTest.cpp<br>
  unittests/IR/MetadataTest.cpp<br>
  unittests/IR/PatternMatch.cpp<br>
  unittests/IR/TypeBuilderTest.<wbr>cpp<br>
  unittests/IR/UserTest.cpp<br>
  unittests/IR/VerifierTest.cpp<br>
  unittests/IR/WaymarkTest.cpp<br>
  unittests/ProfileData/<wbr>InstrProfTest.cpp<br>
  unittests/Transforms/Utils/<wbr>Cloning.cpp<br>
  unittests/Transforms/Utils/<wbr>IntegerDivision.cpp<br>
  unittests/Transforms/Utils/<wbr>Local.cpp<br>
<br>
</blockquote></div><br></div>