<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><font size="2"><span style="font-size:11pt;">> At least there is some value allowing explicit conversion in general<br>
> between address spaces to do some basic type erasure. Otherwise it is<br>
> difficult to implement things like C++ std::any or whatever.<br>
> Of course at the end you go back to the original address space after a<br>
> journey though the type erased address space<br>
><br>
> AS1 $B"*(B AS_erased $B"*(B AS1.</span></font><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I am not sure erasing address space information in the example of</p>
<p style="margin-top:0;margin-bottom:0">std::any is a good idea as it seems it might violate type safety.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I haven't looked into details yet, perhaps I should. How does it currently</p>
<p style="margin-top:0;margin-bottom:0">work with other qualifiers btw? In the meantime if you have any code</p>
<p style="margin-top:0;margin-bottom:0">example where you find removing the address space useful for the case</p>
<p style="margin-top:0;margin-bottom:0">you have highlighted or any similar one, it would be valuable input for this</p>
<p style="margin-top:0;margin-bottom:0">discussion.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks!</p>
<p style="margin-top:0;margin-bottom:0">Anastasia<br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> cfe-dev <cfe-dev-bounces@lists.llvm.org> on behalf of Ronan KERYELL via cfe-dev <cfe-dev@lists.llvm.org><br>
<b>Sent:</b> 08 March 2019 19:39<br>
<b>To:</b> Bevin Hansson via cfe-dev<br>
<b>Subject:</b> Re: [cfe-dev] [RFC] Improved address space conversion semantics for targets and language dialects</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">>>>>> On Wed, 6 Mar 2019 18:11:39 +0000, Bevin Hansson via cfe-dev <cfe-dev@lists.llvm.org> said:<br>
<br>
    Bevin> Many address space semantics are locked behind the OpenCL<br>
    Bevin> language option, even though those semantics would likely be<br>
    Bevin> applicable to non-OpenCL cases as well. This means that, when<br>
    Bevin> not using any particular address space-using language<br>
    Bevin> dialect, the address space semantics are far too loosely<br>
    Bevin> defined. When using address spaces outside of the ones<br>
    Bevin> defined in LangAS (the 'target' address spaces), you can<br>
    Bevin> convert between any two address spaces explicitly, even<br>
    Bevin> though this might not make sense on a particular<br>
    Bevin> target. There is no way for a target to define which address<br>
    Bevin> spaces are compatible with each other.<br>
<br>
    Bevin> Technically, this behavior is in accordance with the<br>
    Bevin> Embedded-C TR (explicitly converting between all address<br>
    Bevin> spaces is allowed, but undefined if they aren't compatible),<br>
    Bevin> but I do not believe this behavior is meaningful. If a<br>
    Bevin> target's address spaces are disjoint, there is no reason to<br>
    Bevin> let a user convert between them, even with a cast.<br>
<br>
At least there is some value allowing explicit conversion in general<br>
between address spaces to do some basic type erasure. Otherwise it is<br>
difficult to implement things like C++ std::any or whatever.<br>
Of course at the end you go back to the original address space after a<br>
journey though the type erased address space<br>
<br>
AS1 $B"*(B AS_erased $B"*(B AS1.<br>
<br>
Thank you for having started this discussion. It is time to unify our<br>
efforts through the various users of address spaces.<br>
-- <br>
  Ronan KERYELL<br>
_______________________________________________<br>
cfe-dev mailing list<br>
cfe-dev@lists.llvm.org<br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>