[llvm-commits] First patch to add support for variable address spaces to optimizers
Nick Lewycky
nicholas at mxc.ca
Wed Oct 10 21:09:30 PDT 2012
Eli Friedman wrote:
> On Wed, Oct 10, 2012 at 1:27 PM, Villmow, Micah<Micah.Villmow at amd.com> wrote:
>> This patch starts enabling proper use of the variable address space throughout LLVM.
>> What this does is when it is known, it passes in the address space to the data layout for some functions.
>> The next patch will contain the more intrusive changes of getIntPtrType/get*PtrTy/getPointerTy.
>
> I'm sort of uncomfortable with the number of places you're hardcoding
> "0"; can you add a function to DataLayout with a more explanatory
> name?
>
> Index: include/llvm-c/Target.h
> ===================================================================
> --- include/llvm-c/Target.h (revision 165622)
> +++ include/llvm-c/Target.h (working copy)
> @@ -170,7 +170,7 @@
>
> /** Returns the pointer size in bytes for a target.
> See the method llvm::DataLayout::getPointerSize. */
> -unsigned LLVMPointerSize(LLVMTargetDataRef);
> +unsigned LLVMPointerSize(LLVMTargetDataRef, unsigned AS);
>
> This change isn't acceptable; the C API is stable. Add a new function
> if necessary.
Hey Eli, I'm not sure this is reasonable. There is a need to keep the C
API ABI stable for libLTO and libIndex and a few high-level C libraries,
but the main purpose of these C wrappers for all the C++ functions is to
allow people to write language-specific bindings on top LLVM, and they
don't need ABI stability. I've mentioned in the past that we should
remove the ABI-stability requirement except for the libraries which have
users that are really relying on that ABI guarantee.
Nick
> /// FIXME: The defaults need to be removed once all of
> /// the backends/clients are updated.
> - unsigned getPointerSizeInBits(unsigned AS = 0) const {
> + unsigned getPointerSizeInBits(unsigned AS) const {
>
> Get rid of the outdated FIXMEs.
>
> -Eli
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list