[PATCH] D28742: [InstCombine] Don't DSE across readnone functions that may throw

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 15 11:46:29 PST 2017


FWIW: I agree.
But i'd go farther.
I think at this point, ->hasSideEffects (or ->sideEffects) may just want to
return a mask, so that the above just becomes

->sideEffects & (MayWrite | MayRead | MayThrow)

or whatever nice version we want.

I think we've added enough accessors at this point, all recursively
defined,  that i think it's becoming a bit of a mess ;)

But others may disagree :)

On Sun, Jan 15, 2017 at 11:41 AM, Sanjoy Das via Phabricator <
reviews at reviews.llvm.org> wrote:

> sanjoy added a comment.
>
> In https://reviews.llvm.org/D28742#646705, @majnemer wrote:
>
> > Instead of using `I->mayReadFromMemoryOrThrow() ||
> I->mayWriteToMemory()`, I'd recommend using `I->mayReadFromMemory() ||
> I->mayHaveSideEffects()`
>
>
> What do you think about `I->mayReadFromMemory() || I->mayWriteToMemory()
> || I->mayThrow()`?  I don't particularly like that we club may-throw with
> has-side-effects.
>
>
> https://reviews.llvm.org/D28742
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170115/0f9a6d67/attachment.html>


More information about the llvm-commits mailing list