[LLVMdev] [cfe-commits] r170125 - /cfe/trunk/lib/Basic/Targets.cpp

Benyei, Guy guy.benyei at intel.com
Tue Dec 25 03:51:00 PST 2012


Hi,
Removing the data layout causes another issue:
In SPIR we know the size and alignment of everything, but except the data layout string, I see no other way to update this information in the DataLayout class. This way we get a failure when trying to build the layout of a struct that contains a pointer in 32 bits.
In DataLayout.cpp, the default pointer size and alignment is 8 bytes, which is clearly not right for the SPIR32 target.

Thanks
   Guy Benyei


-----Original Message-----
From: cfe-commits-bounces at cs.uiuc.edu [mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Benyei, Guy
Sent: Tuesday, December 25, 2012 12:42
To: Eli Friedman
Cc: cfe-commits at cs.uiuc.edu
Subject: Re: [cfe-commits] r170125 - /cfe/trunk/lib/Basic/Targets.cpp

Thanks Eli,
I'll remove the data layout strings from the SPIR targets.

Guy Benyei

-----Original Message-----
From: Eli Friedman [mailto:eli.friedman at gmail.com]
Sent: Saturday, December 22, 2012 03:17
To: Benyei, Guy
Cc: cfe-commits at cs.uiuc.edu
Subject: Re: [cfe-commits] r170125 - /cfe/trunk/lib/Basic/Targets.cpp

On Thu, Dec 20, 2012 at 1:06 AM, Benyei, Guy <guy.benyei at intel.com> wrote:
> Hi Eli,
>
> From the LLVM Language Reference Manual:
>
> " When constructing the data layout for a given target, LLVM starts with a default set of specifications which are then (possibly) overridden by the specifications in the datalayout keyword. The default specifications are given in this list:
>
> E - big endian..."
>
> It seems to me, that the default big endian is taken even if I don't define a data layout, and the rest of the data is still relevant.
> I'm not sure how to handle this, from the SPIR point of view it's possible to completely ignore the issue by declaring that the default endian in SPIR is neither little nor big, and this IR is still strong enough to work. Another solution would be to introduce a new notation for "unknown" endian.
>
> Any other ideas on this issue?

>From later in that section of LangRef: "If you would like to generate IR that does not embed this target-specific detail into the IR, then you don't have to specify the string."

-Eli
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.


_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.





More information about the llvm-dev mailing list