[PATCH] D36916: Add default address space for functions to the data layout

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 18 20:59:12 PDT 2017


Hey all,

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.

I've yet to do some cleanups such as add more documentation and remove a
hack or two.

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

http://lists.llvm.org/pipermail/llvm-dev/2017-July/115245.html

Any feedback would be appreciated, specifically around

* Bitcode reading/writing and the way I've kept backwards compatibility
* The ergonomics of having to pass
Module.getDataLayout().getProgramAddressSpace() into all new FunctionTypes
(and any suggestions on a nicer way)

Cheers,
Dylan

On Sat, Aug 19, 2017 at 3:50 PM, Dylan McKay via Phabricator <
reviews at reviews.llvm.org> wrote:

> dylanmckay created this revision.
> Herald added subscribers: eraman, nhaehnle, wdng, sdardis, mzolotukhin,
> mehdi_amini, sanjoy.
>
> I am popping this up on Phabricator for early feedback.
>
> **NOTE*: I will submit this in several smaller patches once this is
> actually ready.
>
> This adds initial support for letting targets specify which address
> spaces their functions should reside in by default.
>
> This is the first step towards placing functions into the correct
> address space for Harvard architectures.
>
> Require address space to be specified when creating functions
>
>
> https://reviews.llvm.org/D36916
>
> Files:
>   docs/BitCodeFormat.rst
>   docs/LangRef.rst
>   include/llvm/Bitcode/LLVMBitCodes.h
>   include/llvm/IR/DataLayout.h
>   include/llvm/IR/DerivedTypes.h
>   include/llvm/IR/Function.h
>   include/llvm/IR/GlobalValue.h
>   include/llvm/IR/Module.h
>   include/llvm/IR/Type.h
>   include/llvm/IR/TypeBuilder.h
>   lib/AsmParser/LLParser.cpp
>   lib/Bitcode/Reader/BitcodeReader.cpp
>   lib/Bitcode/Writer/BitcodeWriter.cpp
>   lib/CodeGen/AtomicExpandPass.cpp
>   lib/CodeGen/IntrinsicLowering.cpp
>   lib/CodeGen/MIRParser/MIRParser.cpp
>   lib/IR/AsmWriter.cpp
>   lib/IR/AutoUpgrade.cpp
>   lib/IR/Core.cpp
>   lib/IR/DataLayout.cpp
>   lib/IR/Function.cpp
>   lib/IR/Globals.cpp
>   lib/IR/Type.cpp
>   lib/IR/Verifier.cpp
>   lib/Linker/IRMover.cpp
>   lib/Target/AMDGPU/AMDGPULibFunc.cpp
>   lib/Target/AMDGPU/AMDGPUOpenCLImageTypeLoweringPass.cpp
>   lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
>   lib/Target/AVR/AVRTargetMachine.cpp
>   lib/Target/Mips/Mips16HardFloat.cpp
>   lib/Target/X86/X86WinEHState.cpp
>   lib/Transforms/IPO/ArgumentPromotion.cpp
>   lib/Transforms/IPO/DeadArgumentElimination.cpp
>   lib/Transforms/IPO/LowerTypeTests.cpp
>   lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
>   lib/Transforms/InstCombine/InstCombineCalls.cpp
>   lib/Transforms/Instrumentation/AddressSanitizer.cpp
>   lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
>   lib/Transforms/Instrumentation/EfficiencySanitizer.cpp
>   lib/Transforms/Instrumentation/GCOVProfiling.cpp
>   lib/Transforms/Instrumentation/InstrProfiling.cpp
>   lib/Transforms/Instrumentation/MemorySanitizer.cpp
>   lib/Transforms/Instrumentation/SanitizerCoverage.cpp
>   lib/Transforms/ObjCARC/ARCRuntimeEntryPoints.h
>   lib/Transforms/ObjCARC/ObjCARCContract.cpp
>   lib/Transforms/Scalar/PlaceSafepoints.cpp
>   lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
>   lib/Transforms/Utils/CloneFunction.cpp
>   lib/Transforms/Utils/CodeExtractor.cpp
>   lib/Transforms/Utils/EscapeEnumerator.cpp
>   lib/Transforms/Utils/ModuleUtils.cpp
>   lib/Transforms/Utils/SanitizerStats.cpp
>   lib/Transforms/Utils/ValueMapper.cpp
>   lib/Transforms/Vectorize/LoopVectorize.cpp
>   test/Bitcode/function-nonzero-address-spaces.bc
>   test/Bitcode/function-nonzero-address-spaces.ll
>   unittests/Analysis/AliasAnalysisTest.cpp
>   unittests/Analysis/ScalarEvolutionTest.cpp
>   unittests/Analysis/TBAATest.cpp
>   unittests/Analysis/TargetLibraryInfoTest.cpp
>   unittests/IR/FunctionTest.cpp
>   unittests/IR/IRBuilderTest.cpp
>   unittests/IR/InstructionsTest.cpp
>   unittests/IR/LegacyPassManagerTest.cpp
>   unittests/IR/MetadataTest.cpp
>   unittests/IR/PatternMatch.cpp
>   unittests/IR/TypeBuilderTest.cpp
>   unittests/IR/UserTest.cpp
>   unittests/IR/VerifierTest.cpp
>   unittests/IR/WaymarkTest.cpp
>   unittests/ProfileData/InstrProfTest.cpp
>   unittests/Transforms/Utils/Cloning.cpp
>   unittests/Transforms/Utils/IntegerDivision.cpp
>   unittests/Transforms/Utils/Local.cpp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170819/7154c7f9/attachment.html>


More information about the llvm-commits mailing list