[llvm-dev] Early CSE clobbering llvm.assume
Daniel Berlin via llvm-dev
llvm-dev at lists.llvm.org
Fri Jun 10 19:42:21 PDT 2016
So,
On Fri, Jun 10, 2016, 7:33 PM Lawrence, Peter <c_plawre at qca.qualcomm.com>
wrote:
> Daniel,
>
> Allow me to elaborate some more...
>
>
>
> You seem to be trying to get “Constant-propagation” out of an “assume”,
>
Actually, no. That is mostly what llvm tries to get, not me. It does get
some range info, but not a lot.
I think it's pretty much designed wrong, and in need of revision to get
good info out of. Not that I think it was a bad idea to start with
something, but I think we need to revise it.
But a good compiler does so much more
>
Fwiw, gvn already gets all these, but it is very complicated.
> * if(A > B), assert(A > B), assume(A > B), should all
> result in same optimizations
>
> * if(A>B && A<C), assert(A>B && A<C), assume(A>B & A<C), should all
> result in same optimizations
>
> * if(A & 0x1), assert(A & 0x1), assume(A & 0x1), should all
> result in same optimizations
>
> * if(A & (A-1)), assert(A & (A-1)), assume(A & (A-1)), should all
> result in same optimizations
>
>
>
>
>
>
>
> *From:* Daniel Berlin [mailto:dberlin at dberlin.org]
> *Sent:* Friday, June 10, 2016 6:32 PM
>
>
> *To:* Lawrence, Peter <c_plawre at qca.qualcomm.com>
> *Cc:* llvm-dev at lists.llvm.org
> *Subject:* Re: [llvm-dev] Early CSE clobbering llvm.assume
>
>
>
> We do, implicitly, because assert generates if conditions. Or at least,
> gvn knows how to propagate that implicit info. We can do better by exposing
> it more, most likely
>
> On Fri, Jun 10, 2016, 5:59 PM Lawrence, Peter <c_plawre at qca.qualcomm.com>
> wrote:
>
> Daniel,
>
> Well then my next (dumb?) question is why aren’t we using
> source level assert information
>
> For optimization ?
>
>
>
> --Peter Lawrence.
>
>
>
>
>
> *From:* Daniel Berlin [mailto:dberlin at dberlin.org]
> *Sent:* Friday, June 10, 2016 5:39 PM
> *To:* Lawrence, Peter <c_plawre at qca.qualcomm.com>
> *Cc:* llvm-dev at lists.llvm.org
> *Subject:* Re: [llvm-dev] Early CSE clobbering llvm.assume
>
>
>
>
>
>
>
> On Fri, Jun 10, 2016 at 5:34 PM, Lawrence, Peter via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
> My (dumb?) question would be: why is llvm.assume being handled any
> differently than llvm.assert ?
>
>
>
> There is no llvm.assert intrinsic, so i'm not sure what you mean here.
> Care to give an example?
>
>
>
> Other than one trapping and one not-trapping, they should be identical, in
> both cases they are giving
>
> The optimizers information, and that shouldn’t be any different from
> being inside an “if” statement with the same condition ?
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160611/76fbd1dd/attachment-0001.html>
More information about the llvm-dev
mailing list