_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Hi,How do it interact with the "typeless pointers" work?
David,Could you give us an update on the status of typeless pointer work? How much work is left and when you think it might be ready?
From: "Mehdi Amini via llvm-dev" <llvm...@lists.llvm.org>
To: "Philip Reames" <list...@philipreames.com>, "David Blaikie" <dbla...@gmail.com>
Cc: "llvm-dev" <llvm...@lists.llvm.org>, uwei...@de.ibm.com, "Tom Stellard" <thomas....@amd.com>
Sent: Tuesday, March 22, 2016 2:39:36 PM
Subject: Re: [llvm-dev] RFC: A change in InstCombine canonical form
I don't really mind, but the intermediate stage will not be very nice: that a lot of code / tests that needs to be written with bitcast, and all of that while they are deemed to disappear. The added value isn't clear to me considering the added work. I'm not sure it wouldn't add more work for all the cleanup required by the "typeless pointer", but I'm not sure what's involved here and if David thinks the intermediate steps of handling bit casts everywhere is not making it harder I'm fine with it.
On Mar 22, 2016, at 12:47 PM, Hal Finkel <hfi...@anl.gov> wrote:
From: "Mehdi Amini via llvm-dev" <llvm...@lists.llvm.org>
To: "Philip Reames" <list...@philipreames.com>, "David Blaikie" <dbla...@gmail.com>
Cc: "llvm-dev" <llvm...@lists.llvm.org>, uwei...@de.ibm.com, "Tom Stellard" <thomas....@amd.com>
Sent: Tuesday, March 22, 2016 2:39:36 PM
Subject: Re: [llvm-dev] RFC: A change in InstCombine canonical form
I don't really mind, but the intermediate stage will not be very nice: that a lot of code / tests that needs to be written with bitcast, and all of that while they are deemed to disappear. The added value isn't clear to me considering the added work. I'm not sure it wouldn't add more work for all the cleanup required by the "typeless pointer", but I'm not sure what's involved here and if David thinks the intermediate steps of handling bit casts everywhere is not making it harder I'm fine with it.
It is not clear to me that this is a particularly-large change. As I understand it, we're only talking about the canonicalization of small memcpy,
On Mar 22, 2016, at 1:37 PM, Philip Reames <list...@philipreames.com> wrote:But not what David was stating, unless I misread? I was specifically responding to David's wording:
"If we're talking about making an optimization able to ignore the bitcast instructions - yes, that work is unnecessary & perhaps questionable given the typeless pointer work. Not outright off limits, but the same time might be better invested in moving typeless pointers forward if the contributor is so inclined/able to shift in that direction."
Both "perhaps questionable" and "not outright off limits" seem to strongly imply such work should be discouraged. I disagree with that view which is why I wrote my response.
Philip
Sorry I should have been more clear (writing to many email in parallel)You're right. I was adding a +1 to you here.Especially I wrote "unless there is an acknowledgement that typeless pointers won't be there before a couple of years" with the PassManager in mind, and I was expecting from David some good indication of a timeframe for the typeless pointers.If the typeless pointer work is stalled or if it is not planned for LLVM 3.9,
I agree with Philip to not block anything.
On Mar 22, 2016, at 2:30 PM, David Blaikie <dbla...@gmail.com> wrote:On Tue, Mar 22, 2016 at 1:41 PM, Mehdi Amini <mehdi...@apple.com> wrote:Sorry I should have been more clear (writing to many email in parallel)You're right. I was adding a +1 to you here.Especially I wrote "unless there is an acknowledgement that typeless pointers won't be there before a couple of years" with the PassManager in mind, and I was expecting from David some good indication of a timeframe for the typeless pointers.If the typeless pointer work is stalled or if it is not planned for LLVM 3.9,It's neither stalled nor planned, as such.I agree with Philip to not block anything.All I'm suggesting is that if there are people who want to fix these bugs, I'd really appreciate them helping out on the typeless pointer work - it's totally parallelizable/shardable/shareable work & the project as a whole seemed to agree it was the right direction. Why not just get it done?
Thanks.Phillip, As Hal said I do not think (1) is a very large item. Please let me know if I am mistaken.
Thanks.Phillip, As Hal said I do not think (1) is a very large item. Please let me know if I am mistaken.
David I think (1) is more inline with typeless pointer work than (2). Contributing to typeless pointer work will be great, but given its unknown time frame we cannot stop fixing existing problems. Of course, we should follow an approach consistent with the long-term solution.
On Mar 22, 2016, at 4:15 PM, Ehsan Amiri via llvm-dev <llvm...@lists.llvm.org> wrote:Changing canonicaliztion of memcpy, will be removing a couple of lines of code. I am not sure about the size of backend changes to optimize load-store patterns. But I expect it to be small.James,I think (1) reduces the number of "do-not-see-through-bitcast" bugs that we need to uncover and fix between now and the time that typeless pointer is available. That means it is likely that we have multiple such fixes in the code and then we have to remove each one of them. (And means each one of those has to be done properly to be easily remove-able).
On Tue, Mar 22, 2016 at 6:58 PM, James Y Knight <jykn...@google.com> wrote:On Tue, Mar 22, 2016 at 5:44 PM, Ehsan Amiri via llvm-dev <llvm...@lists.llvm.org> wrote:Thanks.Phillip, As Hal said I do not think (1) is a very large item. Please let me know if I am mistaken.
David I think (1) is more inline with typeless pointer work than (2). Contributing to typeless pointer work will be great, but given its unknown time frame we cannot stop fixing existing problems. Of course, we should follow an approach consistent with the long-term solution.It seems to me that the question to ask is what would be the best state of the code, assuming that the typeless pointers work had already been done. Is it the current canonical form? Or the newly proposed one?I think it'd be the current one? If so, I'd suggest that proposal #2 is more compatible with the typeless pointer work. That is because (if done properly), code which knows how to look through pointer bitcast nodes is something which will be much more easily deletable once pointer bitcast nodes cease to exist, than to change the canonicalization of memcpy back and remove any backend code which was added only to compensate for that change.
On Mar 22, 2016, at 4:15 PM, Ehsan Amiri via llvm-dev <llvm...@lists.llvm.org> wrote:Changing canonicaliztion of memcpy, will be removing a couple of lines of code. I am not sure about the size of backend changes to optimize load-store patterns. But I expect it to be small.James,I think (1) reduces the number of "do-not-see-through-bitcast" bugs that we need to uncover and fix between now and the time that typeless pointer is available. That means it is likely that we have multiple such fixes in the code and then we have to remove each one of them. (And means each one of those has to be done properly to be easily remove-able).Are you saying that the canonicalization you want to change is temporary till we get the typeless pointers?
From: "Ehsan Amiri via llvm-dev" <llvm...@lists.llvm.org>
To: "Mehdi Amini" <mehdi...@apple.com>
Cc: "llvm-dev" <llvm...@lists.llvm.org>, "Tom Stellard" <thomas....@amd.com>, "Ulrich Weigand" <uwei...@de.ibm.com>
Sent: Tuesday, March 22, 2016 6:38:32 PM
Subject: Re: [llvm-dev] RFC: A change in InstCombine canonical form
On Tue, Mar 22, 2016 at 7:33 PM, Mehdi Amini <mehdi...@apple.com> wrote:On Mar 22, 2016, at 4:15 PM, Ehsan Amiri via llvm-dev <llvm...@lists.llvm.org> wrote:Changing canonicaliztion of memcpy, will be removing a couple of lines of code. I am not sure about the size of backend changes to optimize load-store patterns. But I expect it to be small.James,I think (1) reduces the number of "do-not-see-through-bitcast" bugs that we need to uncover and fix between now and the time that typeless pointer is available. That means it is likely that we have multiple such fixes in the code and then we have to remove each one of them. (And means each one of those has to be done properly to be easily remove-able).Are you saying that the canonicalization you want to change is temporary till we get the typeless pointers?I think typeless pointer, will automatically makes it obsolete. Remember, I proposed to make a change "when we load a value of type T from a type T* memory address". There will not be a type T * memory address, once typeless pointer work is in.
When we transform a small memcpy into a pair of load and store instructions, we'll still need to pick a type. Currently, as I understand it, we always pick integers. It is proposed to use the original type instead. Once we have typeless pointers, how will we pick the type? If the answer is that we'll always use integers, then I suppose this is temporary. Otherwise, not. Does that accurately represent the situation?
--Mehdi_______________________________________________On Tue, Mar 22, 2016 at 6:58 PM, James Y Knight <jykn...@google.com> wrote:On Tue, Mar 22, 2016 at 5:44 PM, Ehsan Amiri via llvm-dev <llvm...@lists.llvm.org> wrote:Thanks.Phillip, As Hal said I do not think (1) is a very large item. Please let me know if I am mistaken.
David I think (1) is more inline with typeless pointer work than (2). Contributing to typeless pointer work will be great, but given its unknown time frame we cannot stop fixing existing problems. Of course, we should follow an approach consistent with the long-term solution.It seems to me that the question to ask is what would be the best state of the code, assuming that the typeless pointers work had already been done. Is it the current canonical form? Or the newly proposed one?I think it'd be the current one? If so, I'd suggest that proposal #2 is more compatible with the typeless pointer work. That is because (if done properly), code which knows how to look through pointer bitcast nodes is something which will be much more easily deletable once pointer bitcast nodes cease to exist, than to change the canonicalization of memcpy back and remove any backend code which was added only to compensate for that change.
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
I think typeless pointer, will automatically makes it obsolete. Remember, I proposed to make a change "when we load a value of type T from a type T* memory address". There will not be a type T * memory address, once typeless pointer work is in.
When we transform a small memcpy into a pair of load and store instructions, we'll still need to pick a type. Currently, as I understand it, we always pick integers. It is proposed to use the original type instead. Once we have typeless pointers, how will we pick the type? If the answer is that we'll always use integers, then I suppose this is temporary. Otherwise, not. Does that accurately represent the situation?
On 03/22/2016 02:44 PM, Ehsan Amiri wrote:
I have no specific reason to believe it will be a large amount of work, but prior experience tells me changes to canonical form have a tendency of exposing unexpected issues. To be clear, I am supportive of you implementing solution 1.Thanks.Phillip, As Hal said I do not think (1) is a very large item. Please let me know if I am mistaken.
On Tue, Mar 22, 2016 at 6:42 PM, Philip Reames <list...@philipreames.com> wrote:
On 03/22/2016 02:44 PM, Ehsan Amiri wrote:
I have no specific reason to believe it will be a large amount of work, but prior experience tells me changes to canonical form have a tendency of exposing unexpected issues. To be clear, I am supportive of you implementing solution 1.Thanks.Phillip, As Hal said I do not think (1) is a very large item. Please let me know if I am mistaken.
Thanks Phillip. Do you mean exposing bugs that were unknown before? or something else?
If the problem is that some transformations will start to have problems because they do not know how to deal with the new canonical form, that's alarming. If the chances of exposing such problem is not too high, then we can possibly go ahead with (1) and fallback to (2) if (1) starts to be complicated. But if the risk is too high, then we may want to prefer (2) to (1).
Most are not correctness bugs, but performance bugs. Later passes (particular CGP and later) do not do well when presented arbitrary non-canonical IR. They won't crash, but they may not be as effective as expected and may miss obvious performance wins. When you change what canonical is, you sometimes miss the existing sweat spot and have to adjust the code to handle the new canonical form.
Any suggestions?
OK. I will do some experiments with (1) on Power PC. Will update this email chain about the results.