[PATCH] D114666: [InstSimplify] Simplify bool icmp with not in LHS

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 5 09:28:18 PST 2021


spatel added a comment.

In D114666#3172200 <https://reviews.llvm.org/D114666#3172200>, @hasyimibhar wrote:

> In D114666#3172182 <https://reviews.llvm.org/D114666#3172182>, @spatel wrote:
>
>> I don't think the logic is correct. You should start by creating a complete set of baseline tests based on the existing tests in:
>> https://github.com/llvm/llvm-project/blob/main/llvm/test/Transforms/InstSimplify/icmp-bool-constant.ll
>>
>> We can then pre-commit those tests ahead of this patch to make sure we get correct results in all cases with this patch.
>>
>> You may also want to check how these patterns are handled by "opt -instcombine" (assuming they are handled correctly there).
>
> I don't quite understand. Do you mean I should create a separate revision that contains only passing test cases to show how this case is currently being handled by both instsimplify and instcombine?

Yes, you can create a patch that just adds all of the tests with baseline CHECK results (without this patch) to the file "icmp-bool-constant.ll".
You can either commit that locally and show diffs on this patch, push it to main, or post it to Phabricator if you don't have commit access yet.

To check if your logic is correct, compare results against "opt -instcombine" and/or use Alive2:
https://alive2.llvm.org/ce/z/VzNJsr


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114666



More information about the llvm-commits mailing list