[PATCH] D154953: [InstSimplify] Remove the remainder loop if we know the mask is always true

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 16:23:30 PDT 2023


goldstein.w.n added a comment.

In D154953#4521461 <https://reviews.llvm.org/D154953#4521461>, @Allen wrote:

> It seems the alive2 doesn't support the semantics of vscale, https://github.com/AliveToolkit/alive2/issues/923
>
> In D154953#4519341 <https://reviews.llvm.org/D154953#4519341>, @goldstein.w.n wrote:
>
>> In D154953#4518239 <https://reviews.llvm.org/D154953#4518239>, @Allen wrote:
>>
>>> I don't add alive2 because vscale is not supported, https://github.com/AliveToolkit/alive2/issues/923
>>
>> The patch doesn't rely on alive2, just on the power of 2 nature of the arguments.
>> You can use: https://alive2.llvm.org/ce/z/FkTMoy + adding the srem versions.
>
> The case in the link can't be optimized with this patch because we can't infer the operands of urem is power-of-two with isKnownToBeAPowerOfTwo now, so I'll try it with a separate patch

Yes, but the link show  that the transform is semantically equivilent. The case in the link covers anything we detect in the patch (assuming non-buggy codes).


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

https://reviews.llvm.org/D154953



More information about the llvm-commits mailing list