[PATCH] D128322: [GuardWidening] Use logical and in widenCondCommon as it stated in doc

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 01:54:47 PDT 2022


skatkov added a comment.

In D128322#3617923 <https://reviews.llvm.org/D128322#3617923>, @nikic wrote:

> In D128322#3617593 <https://reviews.llvm.org/D128322#3617593>, @skatkov wrote:
>
>> Dear reviewers, after deeper investigation the issue I guess I come up with the tests https://reviews.llvm.org/D128779 showing the logical and does not resolve the issue and correctly used freeze the only choice.
>> I would very appreciate if you could review the tests and confirm that my understanding is valid.
>
> Yes, I agree with your analysis. The `@simple_case` test is clearest one I think, because it hoists a condition across other control flow.
>
> Basically, if you have two adjacent `llvm.experimental.guard` (or separated by must-exec instructions), then they can be combined with logical and. But if they're separated by any (normal or abnormal) control flow, then the second condition must be frozen.
>
> So yeah, we should go back to your original solution using freeze. Sorry for the red herring about logical and.

No need for sorry.  It helped to go deeper into optimization. Simple freeze for combine checks does not work as well. Need to figure out how to deal with that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128322/new/

https://reviews.llvm.org/D128322



More information about the llvm-commits mailing list